Marble

GeoSceneSettings.h
1/*
2 SPDX-FileCopyrightText: 2008 Torsten Rahn <rahn@kde.org>
3
4 SPDX-License-Identifier: LGPL-2.0-or-later
5*/
6
7#ifndef MARBLE_GEOSCENESETTINGS_H
8#define MARBLE_GEOSCENESETTINGS_H
9
10#include <QObject>
11#include <QVector>
12
13#include <geodata_export.h>
14
15#include "GeoDocument.h"
16
17class QString;
18
19namespace Marble
20{
21
22class GeoSceneProperty;
23class GeoSceneGroup;
24
25class GeoSceneSettingsPrivate;
26
27/**
28 * @short Settings of a GeoScene document.
29 */
30class GEODATA_EXPORT GeoSceneSettings : public QObject,
31 public GeoNode
32{
33 Q_OBJECT
34
35 public:
37 ~GeoSceneSettings() override;
38 const char* nodeType() const override;
39
40 /**
41 * @brief Get the availability of a property across groups
42 * @param name the property name
43 * @param available availability of the property
44 * @return @c true the property was registered across groups
45 * @c false the property wasn't registered across groups
46 */
47 bool propertyAvailable( const QString& name, bool& available ) const;
48
49 /**
50 * @brief Set the value of a property across groups
51 * @param name the property name
52 * @param value the value of the property
53 * @return @c true the property was found and changed accordingly
54 * @c false the property couldn't be found here
55 */
56 bool setPropertyValue( const QString& name, bool value );
57
58 /**
59 * @brief Get the value of a property across groups
60 * @param name the property name
61 * @param value the value of the property
62 * @return @c true the property was found and returned accordingly
63 * @c false the property couldn't be found in this group
64 */
65 bool propertyValue( const QString& name, bool& value ) const;
66
67 /**
68 * @brief Get the whole list of properties stored in the settings
69 */
70 QVector<GeoSceneProperty*> allProperties();
71
72 /**
73 * @brief Get the whole list of properties stored in the settings
74 */
75 QVector<const GeoSceneProperty*> allProperties() const;
76
77 /**
78 * @brief Add a group to the settings
79 * @param group the new group
80 */
81 void addGroup( GeoSceneGroup* group );
82
83 /**
84 * @brief Get a group from the settings
85 * @param name the name of the group
86 */
87 const GeoSceneGroup* group( const QString& name ) const;
88 GeoSceneGroup* group( const QString& name );
89
90 /**
91 * @brief Add a property to the settings
92 * @param property the new property
93 */
94 void addProperty( GeoSceneProperty* property );
95
96 /**
97 * @brief Get a property from the settings
98 * @param name the name of the property
99 */
100 const GeoSceneProperty* property( const QString& name ) const;
101 GeoSceneProperty* property( const QString& name );
102
103 /**
104 * @brief Get the properties that are categorized into groups
105 *
106 * NOTE: If you want all the properties distributed among groups
107 * then please use: QVector<GeoSceneProperty*> allProperties().
108 */
109 QVector<GeoSceneProperty*> rootProperties();
110
111 Q_SIGNALS:
112 void valueChanged( const QString&, bool );
113
114 private:
115 Q_DISABLE_COPY( GeoSceneSettings )
116 GeoSceneSettingsPrivate * const d;
117};
118
119}
120
121#endif
A shared base class for all classes that are mapped to a specific tag (ie.
Definition GeoDocument.h:35
Group inside the settings of a GeoScene document.
Settings property within a GeoScene document.
Settings of a GeoScene document.
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 Jul 12 2024 11:58:55 by doxygen 1.11.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.