/usr/include/marble/MarbleModel.h is in libmarble-dev 4:15.12.3-0ubuntu2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 | //
// This file is part of the Marble Virtual Globe.
//
// This program is free software licensed under the GNU LGPL. You can
// find a copy of this license in LICENSE.txt in the top directory of
// the source code.
//
// Copyright 2005-2007 Torsten Rahn <tackat@kde.org>
// Copyright 2007 Inge Wallin <ingwa@kde.org>
// Copyright 2010-2013 Bernhard Beschow <bbeschow@cs.tu-berlin.de>
//
//
// MarbleModel is the data store and index class for the MarbleWidget.
//
#ifndef MARBLE_MARBLEMODEL_H
#define MARBLE_MARBLEMODEL_H
/** @file
* This file contains the headers for MarbleModel
*
* @author Torsten Rahn <tackat@kde.org>
* @author Inge Wallin <inge@lysator.liu.se>
*/
#include "marble_export.h"
#include <QDateTime>
#include <QList>
#include <QObject>
#include <QString>
#include <QVector>
#include "MarbleGlobal.h"
#include "GeoDataCoordinates.h"
class QItemSelectionModel;
class QAbstractItemModel;
class QTextDocument;
namespace Marble
{
class AbstractDataPlugin;
class AbstractDataPluginItem;
class GeoDataPlacemark;
class GeoPainter;
class MeasureTool;
class PositionTracking;
class HttpDownloadManager;
class MarbleModelPrivate;
class MarbleClock;
class SunLocator;
class TileCreator;
class PluginManager;
class GeoDataCoordinates;
class GeoDataDocument;
class GeoDataStyle;
class GeoDataTreeModel;
class GeoSceneDocument;
class Planet;
class RoutingManager;
class BookmarkManager;
class FileManager;
class ElevationModel;
/**
* @short The data model (not based on QAbstractModel) for a MarbleWidget.
*
* This class provides a data storage and indexer that can be
* displayed in a MarbleWidget. It contains 3 different datatypes:
* <b>tiles</b> which provide the background, <b>vectors</b> which
* provide things like country borders and coastlines and
* <b>placemarks</b> which can show points of interest, such as
* cities, mountain tops or the poles.
*
* The <b>tiles</b> provide the background of the image and can be for
* instance height and depth fields, magnetic strength, topographic
* data or anything else that is area based.
*
* The <b>vectors</b> provide things like country borders and
* coastlines. They are stored in separate files and can be added or
* removed at anytime.
*
* The <b>placemarks</b> contain points of interest, such as cities,
* mountain tops or the poles. These are sorted by size (for cities)
* and category (capitals, other important cities, less important
* cities, etc) and are displayed with different color or shape like
* square or round.
*
* @see MarbleWidget
*/
class MARBLE_EXPORT MarbleModel : public QObject
{
friend class MarbleModelPrivate;
Q_OBJECT
Q_PROPERTY( QString mapThemeId READ mapThemeId WRITE setMapThemeId NOTIFY themeChanged )
Q_PROPERTY( bool workOffline READ workOffline WRITE setWorkOffline NOTIFY workOfflineChanged )
public:
/**
* @brief Construct a new MarbleModel.
* @param parent the parent widget
*/
explicit MarbleModel( QObject *parent = 0 );
virtual ~MarbleModel();
/**
* @brief Return the list of Placemarks as a QAbstractItemModel *
* @return a list of all Placemarks in the MarbleModel.
*/
GeoDataTreeModel *treeModel();
const GeoDataTreeModel *treeModel() const;
QAbstractItemModel *groundOverlayModel();
const QAbstractItemModel *groundOverlayModel() const;
QAbstractItemModel *placemarkModel();
const QAbstractItemModel *placemarkModel() const;
QItemSelectionModel *placemarkSelectionModel();
/**
* @brief Return the name of the current map theme.
* @return the identifier of the current MapTheme.
* To ensure that a unique identifier is being used the theme does NOT
* get represented by its name but the by relative location of the file
* that specifies the theme:
*
* Example:
* maptheme = "earth/bluemarble/bluemarble.dgml"
*/
QString mapThemeId() const;
GeoSceneDocument *mapTheme();
const GeoSceneDocument *mapTheme() const;
void setMapTheme( GeoSceneDocument * document );
/**
* @brief Set a new map theme to use.
* @param mapThemeId the identifier of the new map theme
*
* This function sets the map theme, i.e. combination of tile set
* and color scheme to use. If the map theme is not previously
* used, some basic tiles are created and a progress dialog is
* shown.
*
* The ID of the new maptheme. To ensure that a unique
* identifier is being used the theme does NOT get represented by its
* name but the by relative location of the file that specifies the theme:
*
* Example:
* maptheme = "earth/bluemarble/bluemarble.dgml"
*/
void setMapThemeId( const QString &mapThemeId );
/**
* @brief get the home point
* @param lon the longitude of the home point.
* @param lat the latitude of the home point.
* @param zoom the default zoom level of the home point.
*/
void home( qreal &lon, qreal &lat, int& zoom ) const;
/**
* @brief Set the home point
* @param lon the longitude of the new home point.
* @param lat the latitude of the new home point.
* @param zoom the default zoom level for the new home point.
*/
void setHome( qreal lon, qreal lat, int zoom = 1050 );
/**
* @brief Set the home point
* @param homePoint the new home point.
* @param zoom the default zoom level for the new home point.
*/
void setHome( const GeoDataCoordinates& homePoint, int zoom = 1050 );
/**
* @brief Return the downloadmanager to load missing tiles
* @return the HttpDownloadManager instance.
*/
HttpDownloadManager *downloadManager();
const HttpDownloadManager *downloadManager() const;
/**
* @brief Handle file loading into the treeModel
* @param filename the file to load
*/
void addGeoDataFile( const QString& filename );
/**
* @brief Handle raw data loading into the treeModel
* @param data the raw data to load
* @param key the name to remove this raw data later
*/
void addGeoDataString( const QString& data, const QString& key = QLatin1String("data") );
/**
* @brief Remove the file or raw data from the treeModel
* @param key either the file name or the key for raw data
*/
void removeGeoData( const QString& key );
FileManager *fileManager();
PositionTracking *positionTracking() const;
qreal planetRadius() const;
QString planetName() const;
QString planetId() const;
MarbleClock *clock();
const MarbleClock *clock() const;
SunLocator *sunLocator();
const SunLocator *sunLocator() const;
/**
* @brief Returns the limit in kilobytes of the persistent (on hard disc) tile cache.
* @return the limit of persistent tile cache in kilobytes.
*/
quint64 persistentTileCacheLimit() const;
/**
* @brief Returns the limit of the volatile (in RAM) tile cache.
* @return the cache limit in kilobytes
*/
quint64 volatileTileCacheLimit() const;
const PluginManager* pluginManager() const;
PluginManager* pluginManager();
/**
* @brief Returns the planet object for the current map.
* @return the planet object for the current map
*/
const Planet *planet() const;
RoutingManager* routingManager();
const RoutingManager* routingManager() const;
void setClockDateTime( const QDateTime& datetime );
QDateTime clockDateTime() const;
int clockSpeed() const;
void setClockSpeed( int speed );
void setClockTimezone( int timeInSec );
int clockTimezone() const;
/**
* return instance of BookmarkManager
*/
BookmarkManager *bookmarkManager();
QTextDocument * legend();
/**
* @brief Uses the given text document as the new content of the legend
* Any previous legend content is overwritten. MarbleModel takes ownership
* of the passed document.
*/
void setLegend( QTextDocument * document );
bool workOffline() const;
void setWorkOffline( bool workOffline );
ElevationModel* elevationModel();
const ElevationModel* elevationModel() const;
/**
* Returns the placemark being tracked by this model or 0 if no
* placemark is currently tracked.
* @see setTrackedPlacemark(), trackedPlacemarkChanged()
*/
const GeoDataPlacemark *trackedPlacemark() const;
public Q_SLOTS:
void clearPersistentTileCache();
/**
* @brief Set the limit of the persistent (on hard disc) tile cache.
* @param bytes The limit in kilobytes, 0 means no limit.
*/
void setPersistentTileCacheLimit( quint64 kiloBytes );
/**
* @brief Change the placemark tracked by this model
* @see trackedPlacemark(), trackedPlacemarkChanged()
*/
void setTrackedPlacemark( const GeoDataPlacemark *placemark );
void updateProperty( const QString &property, bool value );
Q_SIGNALS:
/**
* @brief Signal that the MarbleModel has started to create a new set of tiles.
* @param
*/
void creatingTilesStart( TileCreator*, const QString& name, const QString& description );
/**
* @brief Signal that the map theme has changed, and to which theme.
* @param mapTheme the identifier of the new map theme.
* @see mapTheme
* @see setMapTheme
*/
void themeChanged( QString mapTheme );
void workOfflineChanged();
/**
* @brief Emitted when the placemark tracked by this model has changed
* @see setTrackedPlacemark(), trackedPlacemark()
*/
void trackedPlacemarkChanged( const GeoDataPlacemark *placemark );
/** @brief Emitted when the home location is changed
* @see home(), setHome()
*/
void homeChanged( const GeoDataCoordinates &newHomePoint );
private:
Q_DISABLE_COPY( MarbleModel )
Q_PRIVATE_SLOT( d, void assignFillColors( const QString &filePath ) )
void addDownloadPolicies( const GeoSceneDocument *mapTheme );
MarbleModelPrivate * const d;
};
}
#endif
|