Marble

MarbleModel.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2005-2007 Torsten Rahn <[email protected]>
9 // Copyright 2007 Inge Wallin <[email protected]>
10 // Copyright 2010-2013 Bernhard Beschow <[email protected]>
11 //
12 
13 //
14 // MarbleModel is the data store and index class for the MarbleWidget.
15 //
16 
17 #ifndef MARBLE_MARBLEMODEL_H
18 #define MARBLE_MARBLEMODEL_H
19 
20 
30 #include "marble_export.h"
31 
32 #include <QObject>
33 #include <QString>
34 
35 #include "MarbleGlobal.h"
36 
38 class QAbstractItemModel;
39 class QTextDocument;
40 class QDateTime;
41 
42 namespace Marble
43 {
44 
45 class GeoDataPlacemark;
46 class GeoPainter;
47 class MeasureTool;
48 class PositionTracking;
49 class HttpDownloadManager;
50 class MarbleModelPrivate;
51 class MarbleClock;
52 class SunLocator;
53 class TileCreator;
54 class PluginManager;
55 class GeoDataCoordinates;
56 class GeoDataTreeModel;
57 class GeoSceneDocument;
58 class Planet;
59 class RoutingManager;
60 class BookmarkManager;
61 class FileManager;
62 class ElevationModel;
63 
91 class MARBLE_EXPORT MarbleModel : public QObject
92 {
93  friend class MarbleModelPrivate;
94 
95  Q_OBJECT
96 
97  Q_PROPERTY( QString mapThemeId READ mapThemeId WRITE setMapThemeId NOTIFY themeChanged )
98  Q_PROPERTY( bool workOffline READ workOffline WRITE setWorkOffline NOTIFY workOfflineChanged )
99 
100  public:
105  explicit MarbleModel( QObject *parent = nullptr );
106  ~MarbleModel() override;
107 
112  GeoDataTreeModel *treeModel();
113  const GeoDataTreeModel *treeModel() const;
114 
115  QAbstractItemModel *groundOverlayModel();
116  const QAbstractItemModel *groundOverlayModel() const;
117 
118  QAbstractItemModel *placemarkModel();
119  const QAbstractItemModel *placemarkModel() const;
120 
121  QItemSelectionModel *placemarkSelectionModel();
122 
133  QString mapThemeId() const;
134 
135  GeoSceneDocument *mapTheme();
136  const GeoSceneDocument *mapTheme() const;
137  void setMapTheme( GeoSceneDocument * document );
138 
155  void setMapThemeId( const QString &mapThemeId );
156 
163  void home( qreal &lon, qreal &lat, int& zoom ) const;
170  void setHome( qreal lon, qreal lat, int zoom = 1050 );
176  void setHome( const GeoDataCoordinates& homePoint, int zoom = 1050 );
177 
182  HttpDownloadManager *downloadManager();
183  const HttpDownloadManager *downloadManager() const;
184 
185 
190  void addGeoDataFile( const QString& filename );
191 
197  void addGeoDataString( const QString& data, const QString& key = QLatin1String("data") );
198 
203  void removeGeoData( const QString& key );
204 
205  FileManager *fileManager();
206 
207  PositionTracking *positionTracking() const;
208 
209  qreal planetRadius() const;
210  QString planetName() const;
211  QString planetId() const;
212 
213  MarbleClock *clock();
214  const MarbleClock *clock() const;
215 
216  SunLocator *sunLocator();
217  const SunLocator *sunLocator() const;
218 
223  quint64 persistentTileCacheLimit() const;
224 
229  quint64 volatileTileCacheLimit() const;
230 
231  const PluginManager* pluginManager() const;
232 
233  PluginManager* pluginManager();
234 
239  const Planet *planet() const;
240 
241  RoutingManager* routingManager();
242  const RoutingManager* routingManager() const;
243 
244  void setClockDateTime( const QDateTime& datetime );
245 
246  QDateTime clockDateTime() const;
247 
248  int clockSpeed() const;
249 
250  void setClockSpeed( int speed );
251 
252  void setClockTimezone( int timeInSec );
253 
254  int clockTimezone() const;
255 
259  BookmarkManager *bookmarkManager();
260 
261  QTextDocument * legend();
262 
268  void setLegend( QTextDocument * document );
269 
270  bool workOffline() const;
271 
272  void setWorkOffline( bool workOffline );
273 
274  ElevationModel* elevationModel();
275  const ElevationModel* elevationModel() const;
276 
282  const GeoDataPlacemark *trackedPlacemark() const;
283 
284  public Q_SLOTS:
285  void clearPersistentTileCache();
286 
291  void setPersistentTileCacheLimit( quint64 kiloBytes );
292 
297  void setTrackedPlacemark( const GeoDataPlacemark *placemark );
298 
299  void updateProperty( const QString &property, bool value );
300 
301  Q_SIGNALS:
302 
308  void creatingTilesStart( TileCreator*, const QString& name, const QString& description );
309 
316  void themeChanged( const QString &mapTheme );
317 
318  void workOfflineChanged();
319 
324  void trackedPlacemarkChanged( const GeoDataPlacemark *placemark );
325 
329  void homeChanged( const GeoDataCoordinates &newHomePoint );
330 
331  private:
332  Q_DISABLE_COPY( MarbleModel )
333 
334  Q_PRIVATE_SLOT( d, void assignFillColors( const QString &filePath ) )
335 
336  void addDownloadPolicies( const GeoSceneDocument *mapTheme );
337  MarbleModelPrivate * const d;
338 };
339 
340 }
341 
342 #endif
A 3d point representation.
The class that handles Marble&#39;s plugins.
Definition: PluginManager.h:44
The representation of GeoData in a model This class represents all available data given by kml-data f...
Binds a QML item to a specific geodetic location in screen coordinates.
This class is responsible for loading the book mark objects from the files and various book mark oper...
This class is responsible for loading the different files into Geodata model.
Definition: FileManager.h:37
Delegates data retrieval and model updates to the appropriate routing provider.
A container for features parsed from the DGML file.
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:91
a class representing a point of interest on the map
This class manages scheduled downloads.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Wed Aug 12 2020 23:19:32 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.