Marble

GeoSceneGroup.h
1 /*
2  SPDX-FileCopyrightText: 2008 Torsten Rahn <[email protected]>
3 
4  SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6 
7 #ifndef MARBLE_GEOSCENEGROUP_H
8 #define MARBLE_GEOSCENEGROUP_H
9 
10 #include <QObject>
11 #include <QString>
12 #include <QVector>
13 
14 #include "GeoDocument.h"
15 
16 namespace Marble
17 {
18 
19 class GeoSceneProperty;
20 
21 /**
22  * @short Group inside the settings of a GeoScene document.
23  */
24 
25 class GeoSceneGroup : public QObject,
26  public GeoNode
27 {
28  Q_OBJECT
29 
30  public:
31  explicit GeoSceneGroup( const QString& name );
32  ~GeoSceneGroup() override;
33 
34  /**
35  * @brief Get the availability of a property in this group
36  * @param name the property name
37  * @param available availability of the property
38  * @return @c true the property was registered in this group
39  * @c false the property wasn't registered in this group
40  */
41  bool propertyAvailable( const QString& name, bool& available ) const;
42 
43  /**
44  * @brief Set the value of a property in this group
45  * @param name the property name
46  * @param value the value of the property
47  * @return @c true the property was found and changed accordingly
48  * @c false the property couldn't be found in this group
49  */
50  bool setPropertyValue( const QString& name, bool value );
51 
52  /**
53  * @brief Get the value of a property in this group
54  * @param name the property name
55  * @param value the value of the property
56  * @return @c true the property was found and returned accordingly
57  * @c false the property couldn't be found in this group
58  */
59  bool propertyValue( const QString& name, bool& value ) const;
60 
61  /**
62  * @brief Add a property to this setting group
63  * @param property the new property
64  */
66  const GeoSceneProperty* property( const QString& name ) const;
67  GeoSceneProperty* property( const QString& name );
68  QVector<GeoSceneProperty*> properties();
69  QVector<const GeoSceneProperty*> properties() const;
70 
71  QString name() const;
72 
73  const char *nodeType() const override;
74 
75  Q_SIGNALS:
76  void valueChanged( const QString&, bool );
77 
78  private:
80 
81  /// The vector holding all the properties in this settings group.
82  QVector<GeoSceneProperty*> m_properties;
83 
84  QString m_name;
85 };
86 
87 }
88 
89 #endif
Q_OBJECTQ_OBJECT
bool propertyValue(const QString &name, bool &value) const
Get the value of a property in this group.
bool setPropertyValue(const QString &name, bool value)
Set the value of a property in this group.
bool propertyAvailable(const QString &name, bool &available) const
Get the availability of a property in this group.
Group inside the settings of a GeoScene document.
Definition: GeoSceneGroup.h:25
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:34
Settings property within a GeoScene document.
Binds a QML item to a specific geodetic location in screen coordinates.
const char * nodeType() const override
Provides type information for downcasting a GeoNode.
void addProperty(GeoSceneProperty *)
Add a property to this setting group.
Q_SIGNALSQ_SIGNALS
Q_DISABLE_COPY(Class)
This file is part of the KDE documentation.
Documentation copyright © 1996-2022 The KDE developers.
Generated on Thu May 26 2022 04:07:49 by doxygen 1.8.17 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.