Marble

GeoDataStyle.h
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2007 Murad Tagirov <tmurad@gmail.com>
4// SPDX-FileCopyrightText: 2007 Inge Wallin <ingwa@kde.org>
5//
6
7#ifndef MARBLE_GEODATASTYLE_H
8#define MARBLE_GEODATASTYLE_H
9
10#include "GeoDataStyleSelector.h"
11
12#include "geodata_export.h"
13
14#include <QMetaType>
15#include <QSharedPointer>
16
17class QFont;
18class QColor;
19
20namespace Marble
21{
22
23class GeoDataBalloonStyle;
24class GeoDataIconStyle;
25class GeoDataLabelStyle;
26class GeoDataLineStyle;
27class GeoDataListStyle;
28class GeoDataPolyStyle;
29class GeoDataStylePrivate;
30
31/**
32 * @short an addressable style group
33 *
34 * A GeoDataStyle defines an addressable style group that can be
35 * referenced by GeoDataStyleMaps and GeoDataFeatures. GeoDataStyles
36 * affect how Geometry is presented in the 3D viewer (not yet
37 * implemented) and how Features appear. Shared styles are collected
38 * in a GeoDataDocument and must have an id defined for them so that
39 * they can be referenced by the individual Features that use them.
40 *
41 * @see GeoDataIconStyle
42 * @see GeoDataLabelStyle
43 * @see GeoDataLineStyle
44 * @see GeoDataPolyStyle
45 * @see GeoDataBalloonStyle
46 * @see GeoDataListStyle
47 */
48class GEODATA_EXPORT GeoDataStyle : public GeoDataStyleSelector
49{
50public:
53
54 /// Construct a default style
56 GeoDataStyle(const GeoDataStyle &other);
57 /**
58 * @brief Construct a new style
59 * @param iconPath used to construct the icon style
60 * @param font used to construct the label styles
61 * @param color used to construct the label styles
62 */
63 GeoDataStyle(const QString &iconPath, const QFont &font, const QColor &color);
64 ~GeoDataStyle() override;
65
66 /// Provides type information for downcasting a GeoNode
67 const char *nodeType() const override;
68
69 /// set the icon style
70 void setIconStyle(const GeoDataIconStyle &style);
71 /// Return the icon style of this style
72 GeoDataIconStyle &iconStyle();
73 const GeoDataIconStyle &iconStyle() const;
74 /// set the label style
75 void setLabelStyle(const GeoDataLabelStyle &style);
76 /// Return the label style of this style
77 GeoDataLabelStyle &labelStyle();
78 const GeoDataLabelStyle &labelStyle() const;
79 /// set the line style
80 void setLineStyle(const GeoDataLineStyle &style);
81 /// Return the label style of this style
82 GeoDataLineStyle &lineStyle();
83 const GeoDataLineStyle &lineStyle() const;
84 /// set the poly style
85 void setPolyStyle(const GeoDataPolyStyle &style);
86 /// Return the label style of this style
87 GeoDataPolyStyle &polyStyle();
88 const GeoDataPolyStyle &polyStyle() const;
89 /// set the balloon style
90 void setBalloonStyle(const GeoDataBalloonStyle &style);
91 /// Return the balloon style of this style
92 GeoDataBalloonStyle &balloonStyle();
93 const GeoDataBalloonStyle &balloonStyle() const;
94 /// set the list style
95 void setListStyle(const GeoDataListStyle &style);
96 /// Return the list style of this style
97 GeoDataListStyle &listStyle();
98 const GeoDataListStyle &listStyle() const;
99
100 /**
101 * @brief assignment operator
102 * @param other the GeoDataStyle that gets duplicated
103 */
104 GeoDataStyle &operator=(const GeoDataStyle &other);
105
106 bool operator==(const GeoDataStyle &other) const;
107 bool operator!=(const GeoDataStyle &other) const;
108
109 /**
110 * @brief Serialize the style to a stream
111 * @param stream the stream
112 */
113 void pack(QDataStream &stream) const override;
114 /**
115 * @brief Unserialize the style from a stream
116 * @param stream the stream
117 */
118 void unpack(QDataStream &stream) override;
119
120private:
121 GeoDataStylePrivate *const d;
122};
123
124}
125
126Q_DECLARE_METATYPE(Marble::GeoDataStyle *)
127Q_DECLARE_METATYPE(const Marble::GeoDataStyle *)
128
129#endif
specifies how the name of a GeoDataFeature is drawn
specifies the style how lines are drawn
specifies the style how polygons are drawn
an abstract base class for the style classes
an addressable style group
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 Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.