Marble

MapThemeManager.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2006-2008 Torsten Rahn <tackat@kde.org>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5// SPDX-FileCopyrightText: 2008 Jens-Michael Hoffmann <jensmh@gmx.de>
6//
7
8#ifndef MARBLE_MAPTHEMEMANAGER_H
9#define MARBLE_MAPTHEMEMANAGER_H
10
11#include <QObject>
12
13#include "marble_export.h"
14
15#include <QStandardItemModel>
16#include <QString>
17#include <QStringList>
18
19namespace Marble
20{
21
22class GeoSceneDocument;
23class 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
42class MARBLE_EXPORT MapThemeManager : public QObject
43{
44 Q_OBJECT
45
46public:
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
91Q_SIGNALS:
92 /**
93 * @brief This signal will be emitted, when the themes change.
94 */
96
97private:
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
A container for features parsed from the DGML file.
The class that handles map themes that are locally available .
void themesChanged()
This signal will be emitted, when the themes change.
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Dec 20 2024 11:52:13 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.