Marble

MapThemeManager.h
1 // SPDX-License-Identifier: LGPL-2.1-or-later
2 //
3 // SPDX-FileCopyrightText: 2006-2008 Torsten Rahn <[email protected]>
4 // SPDX-FileCopyrightText: 2007 Inge Wallin <[email protected]>
5 // SPDX-FileCopyrightText: 2008 Jens-Michael Hoffmann <[email protected]>
6 //
7 
8 #ifndef MARBLE_MAPTHEMEMANAGER_H
9 #define MARBLE_MAPTHEMEMANAGER_H
10 
11 #include <QObject>
12 
13 #include "marble_export.h"
14 
15 class QStandardItemModel;
16 class QString;
17 class QStringList;
18 
19 namespace Marble
20 {
21 
22 class GeoSceneDocument;
23 class GeoDataPhotoOverlay;
24 /**
25  * @short The class that handles map themes that are locally available .
26  *
27  * This class which is able to check for maps that are locally available.
28  * After parsing the data it only stores the name, description and path
29  * into a QStandardItemModel.
30  *
31  * The MapThemeManager is not owned by the MarbleWidget/Map itself.
32  * Instead it is owned by the widget or application that contains
33  * MarbleWidget/Map ( usually: the ControlView convenience class )
34  *
35  * For convenience MarbleThemeManager provides a static helper class
36  * that loads the properties of a map theme into a GeoSceneDocument
37  * object.
38  *
39  * @see GeoSceneDocument
40  */
41 
42 class MARBLE_EXPORT MapThemeManager : public QObject
43 {
44  Q_OBJECT
45 
46  public:
47  explicit MapThemeManager(QObject *parent = nullptr);
48  ~MapThemeManager() override;
49 
50  /**
51  * @brief Returns a list of all locally available map theme IDs
52  */
53  QStringList mapThemeIds() const;
54 
55  /**
56  * @brief Provides a model of the locally existing themes.
57  *
58  * This method provides a QStandardItemModel of all themes
59  * that are available via MarbleDirs.
60  */
61  QStandardItemModel* mapThemeModel();
62 
63  /**
64  * @brief Provides a model of all installed planets.
65  */
66  QStandardItemModel *celestialBodiesModel();
67 
68  /**
69  * @brief Returns the map theme as a GeoSceneDocument object
70  * @param mapThemeStringID the string ID that refers to the map theme
71  *
72  * This helper method should only get used by MarbleModel to load the
73  * current theme into memory or by the MapThemeManager.
74  */
75  static GeoSceneDocument* loadMapTheme( const QString& mapThemeStringID );
76 
77  /**
78  * @brief Returns a map as a GeoSceneDocument object created from a GeoDataPhotoOverlay
79  */
80  static GeoSceneDocument* createMapThemeFromOverlay( const GeoDataPhotoOverlay *overlayData );
81 
82  /**
83  * @brief Deletes the map theme with the specified map theme ID.
84  * @param mapThemeId ID of the map theme to be deleted
85  *
86  * Deletion will only succeed for local map themes, that is, if the map
87  * theme's directory structure resides in the user's home directory.
88  */
89  static void deleteMapTheme( const QString &mapThemeId );
90 
91  Q_SIGNALS:
92  /**
93  * @brief This signal will be emitted, when the themes change.
94  */
95  void themesChanged();
96 
97  private:
98  Q_PRIVATE_SLOT( d, void directoryChanged( const QString& path ) )
99  Q_PRIVATE_SLOT( d, void fileChanged( const QString & path ) )
100 
101  Q_DISABLE_COPY( MapThemeManager )
102 
103  class Private;
104  friend class Private;
105  Private * const d;
106 };
107 
108 }
109 
110 #endif
The class that handles map themes that are locally available .
Binds a QML item to a specific geodetic location in screen coordinates.
A container for features parsed from the DGML file.
This file is part of the KDE documentation.
Documentation copyright © 1996-2023 The KDE developers.
Generated on Sun Oct 1 2023 04:09:37 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.