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

KDE's Doxygen guidelines are available online.