Marble

GeoDataDocument.h
1 /*
2  Copyright (C) 2007, 2008 Nikolas Zimmermann <[email protected]>
3  Copyright (C) 2007 Murad Tagirov <[email protected]>
4  Copyright (C) 2009 Patrick Spendrin <[email protected]>
5 
6  This file is part of the KDE project
7 
8  This library is free software you can redistribute it and/or
9  modify it under the terms of the GNU Library General Public
10  License as published by the Free Software Foundation either
11  version 2 of the License, or (at your option) any later version.
12 
13  This library is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16  Library General Public License for more details.
17 
18  You should have received a copy of the GNU Library General Public License
19  aint with this library see the file COPYING.LIB. If not, write to
20  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
21  Boston, MA 02110-1301, USA.
22 */
23 
24 #ifndef MARBLE_GEODATADOCUMENT_H
25 #define MARBLE_GEODATADOCUMENT_H
26 
27 #include <QMetaType>
28 
29 #include "geodata_export.h"
30 
31 #include "GeoDataContainer.h"
32 #include "GeoDocument.h"
33 #include "GeoDataStyle.h"
34 
35 namespace Marble
36 {
37 
38 enum DocumentRole {
39  UnknownDocument,
40  MapDocument,
41  UserDocument,
42  TrackingDocument,
43  BookmarkDocument,
44  SearchResultDocument
45 };
46 
47 
48 class GeoDataStyleMap;
49 class GeoDataNetworkLinkControl;
50 class GeoDataSchema;
51 
52 class GeoDataDocumentPrivate;
53 
63 class GEODATA_EXPORT GeoDataDocument : public GeoDocument,
64  public GeoDataContainer
65 {
66 public:
68  GeoDataDocument( const GeoDataDocument& other );
69  ~GeoDataDocument() override;
70 
71  GeoDataDocument& operator=(const GeoDataDocument& other);
72 
73  bool operator==( const GeoDataDocument &other ) const;
74  bool operator!=( const GeoDataDocument &other ) const;
75 
76  const char* nodeType() const override;
77 
78  GeoDataFeature * clone() const override;
79 
81  bool isGeoDataDocument() const override { return true; }
82 
83  DocumentRole documentRole() const;
84  void setDocumentRole( DocumentRole role );
85 
86  QString property() const;
87  void setProperty( const QString& property );
88 
97  QString fileName() const;
102  void setFileName( const QString &value );
103 
107  QString baseUri() const;
108 
113  void setBaseUri( const QString &baseUri );
114 
118  GeoDataNetworkLinkControl networkLinkControl() const;
119 
123  void setNetworkLinkControl( const GeoDataNetworkLinkControl &networkLinkControl );
124 
129  void addStyle(const GeoDataStyle::Ptr &style);
130 
135  void removeStyle( const QString& styleId );
136 
141  GeoDataStyle::Ptr style( const QString& styleId );
142  GeoDataStyle::ConstPtr style( const QString& styleId ) const;
143 
147  QList<GeoDataStyle::Ptr> styles();
148  QList<GeoDataStyle::ConstPtr> styles() const;
149 
154  void addStyleMap( const GeoDataStyleMap& map );
155 
160  void removeStyleMap( const QString& mapId );
161 
166  GeoDataStyleMap& styleMap( const QString& styleId );
167  GeoDataStyleMap styleMap( const QString& styleId ) const;
168 
172  QList<GeoDataStyleMap> styleMaps() const;
173 
178  void addSchema( const GeoDataSchema& schema );
179 
184  void removeSchema( const QString& schemaId );
185 
190  GeoDataSchema schema( const QString& schemaId ) const;
191  GeoDataSchema &schema( const QString& schemaId );
192 
196  QList<GeoDataSchema> schemas() const;
197 
198  // Serialize the Placemark to @p stream
199  void pack( QDataStream& stream ) const override;
200  // Unserialize the Placemark from @p stream
201  void unpack( QDataStream& stream ) override;
202 
203 private:
204  Q_DECLARE_PRIVATE(GeoDataDocument)
205 };
206 
207 }
208 Q_DECLARE_METATYPE(Marble::GeoDataDocument*)
209 #endif
A container for Features, Styles and in the future Schemas.
Binds a QML item to a specific geodetic location in screen coordinates.
A base class that can hold GeoDataFeatures.
a class to map different styles to one style
bool isGeoDataDocument() const override
Provides type information for downcasting a GeoData.
A shared base class between GeoDataDocument/GeoSourceDocument.
Definition: GeoDocument.h:34
A base class for all geodata features.
QCA_EXPORT void setProperty(const QString &name, const QVariant &value)
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Jun 4 2020 22:32:23 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.