Marble

TourPlayback.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2014 Sanjiban Bairagya <[email protected]>
4 //
5 
6 #ifndef TOURPLAYBACK_H
7 #define TOURPLAYBACK_H
8 
9 #include <QObject>
10 
11 #include "marble_export.h"
12 
13 class QUrl;
14 
15 namespace Marble
16 {
17 
18 class MarbleWidget;
19 class GeoDataCoordinates;
20 class GeoDataTour;
21 class GeoDataPlacemark;
22 class GeoDataFeature;
23 class GeoDataContainer;
24 class PlaybackItem;
25 
26 class TourPlaybackPrivate;
27 
28 class MARBLE_EXPORT TourPlayback : public QObject
29 {
30  Q_OBJECT
31 public:
32  explicit TourPlayback(QObject *parent=nullptr);
33  ~TourPlayback() override;
34 
35  void setTour(GeoDataTour *tour);
36  void setMarbleWidget( MarbleWidget *widget );
37 
38  /**
39  * @brief setBaseUrl - sets base url for using in QWebView.
40  */
41  void setBaseUrl( const QUrl &baseUrl );
42 
43  /**
44  * @brief baseUrl - gets base url which is using in QWebView.
45  */
46  QUrl baseUrl() const;
47 
48  /** Tour duration in seconds */
49  double duration() const;
50  bool isPlaying() const;
51 
52  void play();
53  void pause();
54  void stop();
55 
56  /**
57  * Seek to the given timestamp (in seconds)
58  * @param offset Target timestamp in seconds in the range 0..duration()
59  */
60  void seek( double offset );
61 
62  /** Size of main track (flyto, wait, tourcontrol primitives) **/
63  int mainTrackSize();
64  /**
65  * Element of main track (flyto, wait, tourcontrol primitives)
66  * @param i Position of element.
67  */
68  PlaybackItem* mainTrackItemAt( int i );
69 
70 public Q_SLOTS:
71  void updateTracks();
72  void clearTracks();
73 
74 Q_SIGNALS:
75  void finished();
76  void paused();
77  void stopped();
78  void progressChanged( double );
79  void updated( GeoDataFeature* );
80  void added( GeoDataContainer *parent, GeoDataFeature *feature, int row );
81  void removed(GeoDataFeature *feature);
82  void itemFinished( int index );
83 
84 private Q_SLOTS:
85  void stopTour();
86  void showBalloon( GeoDataPlacemark* );
87  void hideBalloon();
88  void centerOn( const GeoDataCoordinates &coordinates );
89  void handleFinishedItem( int index );
90 
91 private:
92  TourPlaybackPrivate * const d;
93 };
94 
95 } // namespace Marble
96 
97 #endif // TOURPLAYBACK_H
void stop(Ekos::AlignState mode)
Q_SCRIPTABLE Q_NOREPLY void pause()
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Mon Oct 2 2023 03:52:10 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.