Warning: That file was not part of the compilation database. It may have many parsing errors.

1/*
2 Copyright (C) 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org>
3 Copyright (C) 2007 Murad Tagirov <tmurad@gmail.com>
4 Copyright (C) 2009 Patrick Spendrin <ps_ml@gmx.de>
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 <QHash>
28#include <QMetaType>
29#include <QVector>
30
31#include "geodata_export.h"
32
33#include "GeoDataContainer.h"
34#include "GeoDocument.h"
35
36namespace Marble
37{
38
39enum DocumentRole {
40 UnknownDocument,
41 MapDocument,
42 UserDocument,
43 TrackingDocument,
44 BookmarkDocument,
45 SearchResultDocument
46};
47
48
49class GeoDataStyle;
50class GeoDataStyleMap;
51class GeoDataNetworkLinkControl;
52
53class GeoDataDocumentPrivate;
54
55/**
56 * @short A container for Features, Styles and in the future Schemas.
57 *
58 * A GeoDataDocument is a container for features, styles, and
59 * schemas. This element is required if your KML file uses schemas or
60 * shared styles. It is recommended that all Styles be defined in a
61 * Document, each with an id, and then later referenced by a
62 * styleUrl for a given Feature or StyleMap.
63 */
64class GEODATA_EXPORT GeoDataDocument : public GeoDocument,
65 public GeoDataContainer
66{
67public:
68 GeoDataDocument();
69 GeoDataDocument( const GeoDataDocument& other );
70 ~GeoDataDocument();
71
72 /// Provides type information for downcasting a GeoData
73 virtual bool isGeoDataDocument() const { return true; }
74
75 DocumentRole documentRole() const;
76 void setDocumentRole( DocumentRole role );
77
78 QString property() const;
79 void setProperty( QString property );
80
81 /**
82 * @brief The filename of the document
83 *
84 * The filename of the document is used internally to identify the files.
85 * it should never be empty as this could lead to potential collisions.
86 *
87 * @return The filename of this document
88 */
89 QString fileName() const;
90 /**
91 * @brief Set a new file name for this document
92 * @param value the new name
93 */
94 void setFileName( const QString &value );
95
96 /**
97 * @brief The URI relative paths should be resolved against
98 */
99 QString baseUri() const;
100
101 /**
102 * @brief Change the URI for resolving relative paths.
103 * See http://tools.ietf.org/html/rfc3986#section-5
104 */
105 void setBaseUri( const QString &baseUri );
106
107 /**
108 * @brief the NetworkLinkControl of the file
109 */
110 GeoDataNetworkLinkControl networkLinkControl() const;
111
112 /**
113 * @brief set the NetworkLinkControl of the file
114 */
115 void setNetworkLinkControl( const GeoDataNetworkLinkControl &networkLinkControl );
116
117 /**
118 * @brief Add a style to the style storage
119 * @param style the new style
120 */
121 void addStyle( const GeoDataStyle& style );
122
123 /**
124 * @brief Add a style to the style storage
125 * @param style the new style
126 */
127 void removeStyle( const QString& styleId );
128
129 /**
130 * @brief Return a style in the style storage
131 * @param styleId the id of the style
132 */
133 GeoDataStyle& style( const QString& styleId ) const;
134
135 /**
136 * @brief dump a Vector of all styles
137 */
138 QList<GeoDataStyle> styles() const;
139
140 /**
141 * @brief Add a stylemap to the stylemap storage
142 * @param map the new stylemap
143 */
144 void addStyleMap( const GeoDataStyleMap& map );
145
146 /**
147 * @brief remove stylemap from storage
148 * @param mapId the styleId of the styleMap to be removed
149 */
150 void removeStyleMap( const QString& mapId );
151
152 /**
153 * @brief Return a style in the style storage
154 * @param styleId the id of the style
155 */
156 GeoDataStyleMap& styleMap( const QString& styleId ) const;
157
158 /**
159 * @brief dump a Vector of all styles
160 */
161 QList<GeoDataStyleMap> styleMaps() const;
162
163 // Serialize the Placemark to @p stream
164 virtual void pack( QDataStream& stream ) const;
165 // Unserialize the Placemark from @p stream
166 virtual void unpack( QDataStream& stream );
167
168private:
169 GeoDataDocumentPrivate *p() const;
170};
171
172}
173Q_DECLARE_METATYPE(Marble::GeoDataDocument*)
174#endif
175

Warning: That file was not part of the compilation database. It may have many parsing errors.