Marble

OsmPlacemarkData.h
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2015 Marius-Valeriu Stanciu <[email protected]>
9 //
10 
11 #ifndef MARBLE_OSMPLACEMARKDATA_H
12 #define MARBLE_OSMPLACEMARKDATA_H
13 
14 // Qt
15 #include <QHash>
16 #include <QMetaType>
17 #include <QString>
18 
19 // Marble
20 #include "GeoDataCoordinates.h"
21 #include <marble_export.h>
22 #include "GeoDocument.h"
23 
25 
26 namespace Marble
27 {
28 
50 class MARBLE_EXPORT OsmPlacemarkData: public GeoNode
51 {
52 
53 public:
55 
56  qint64 id() const;
57  qint64 oid() const;
58  QString version() const;
59  QString changeset() const;
60  QString uid() const;
61  QString isVisible() const;
62  QString user() const;
63  QString timestamp() const;
64  QString action() const;
65  const char* nodeType() const override;
66 
67  void setId( qint64 id );
68  void setVersion( const QString& version );
69  void setChangeset( const QString& changeset );
70  void setUid( const QString& uid );
71  void setVisible( const QString& visible );
72  void setUser( const QString& user );
73  void setTimestamp( const QString& timestamp );
74  void setAction( const QString& action );
75 
76 
81  QString tagValue( const QString &key ) const;
82 
88  void addTag( const QString& key, const QString& value );
89 
93  void removeTag( const QString& key );
94 
99  bool containsTag( const QString& key, const QString& value ) const;
100 
105  bool containsTagKey( const QString& key ) const;
106 
111  QHash<QString, QString>::const_iterator findTag(const QString &key) const;
112 
118 
119 
123  OsmPlacemarkData &nodeReference( const GeoDataCoordinates& coordinates );
124  OsmPlacemarkData nodeReference( const GeoDataCoordinates& coordinates ) const;
125 
131  void addNodeReference( const GeoDataCoordinates& key, const OsmPlacemarkData &value );
132  void removeNodeReference( const GeoDataCoordinates& key );
133  bool containsNodeReference( const GeoDataCoordinates& key ) const;
134 
140  void changeNodeReference( const GeoDataCoordinates& oldKey, const GeoDataCoordinates &newKey );
141 
148 
149 
150 
156  OsmPlacemarkData &memberReference( int key );
157  OsmPlacemarkData memberReference( int key ) const;
158 
165  void addMemberReference( int key, const OsmPlacemarkData &value );
166  void removeMemberReference( int key );
167  bool containsMemberReference( int key ) const;
168 
169  QHash< int, OsmPlacemarkData > & memberReferences();
170  QHash< int, OsmPlacemarkData >::const_iterator memberReferencesBegin() const;
171  QHash< int, OsmPlacemarkData >::const_iterator memberReferencesEnd() const;
172 
177  void addRelation( qint64 id, const QString &role );
178  void removeRelation( qint64 id );
179  bool containsRelation( qint64 id ) const;
180 
181  QHash< qint64, QString >::const_iterator relationReferencesBegin() const;
182  QHash< qint64, QString >::const_iterator relationReferencesEnd() const;
183 
188  bool isNull() const;
189 
193  bool isEmpty() const;
194 
200  static OsmPlacemarkData fromParserAttributes( const QXmlStreamAttributes &attributes );
201 
202 private:
203  qint64 m_id;
205 
211 
218  QHash<int, OsmPlacemarkData> m_memberReferences;
219 
226  QHash<qint64, QString> m_relationReferences;
227 
228 };
229 
230 }
231 
232 // Makes qvariant_cast possible for OsmPlacemarkData objects
233 Q_DECLARE_METATYPE( Marble::OsmPlacemarkData )
234 
235 #endif
A 3d point representation.
This class is used to encapsulate the osm data fields kept within a placemark&#39;s extendedData.
Binds a QML item to a specific geodetic location in screen coordinates.
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:49
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Sat Jul 4 2020 23:20:18 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.