• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.12
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • data
GeoDataStyle.cpp
Go to the documentation of this file.
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 2007 Murad Tagirov <tmurad@gmail.com>
9 //
10 
11 
12 #include "GeoDataStyle.h"
13 
14 #include "GeoDataTypes.h"
15 
16 namespace Marble
17 {
18 
19 class GeoDataStylePrivate
20 {
21  public:
22  GeoDataStylePrivate()
23  {
24  }
25 
26  GeoDataStylePrivate(const QImage& icon,
27  const QFont &font, const QColor &color )
28  : m_iconStyle( icon ),
29  m_labelStyle( font, color ),
30  m_lineStyle( color ),
31  m_polyStyle( color ),
32  m_balloonStyle()
33  {
34  }
35 
36  const char* nodeType() const
37  {
38  return GeoDataTypes::GeoDataStyleType;
39  }
40 
41  GeoDataIconStyle m_iconStyle;
42  GeoDataLabelStyle m_labelStyle;
43  GeoDataLineStyle m_lineStyle;
44  GeoDataPolyStyle m_polyStyle;
45  GeoDataBalloonStyle m_balloonStyle;
46  GeoDataListStyle m_listStyle;
47 };
48 
49 GeoDataStyle::GeoDataStyle()
50  : d( new GeoDataStylePrivate )
51 {
52 }
53 
54 GeoDataStyle::GeoDataStyle( const GeoDataStyle& other )
55  : GeoDataStyleSelector( other ), d( new GeoDataStylePrivate( *other.d ) )
56 {
57 }
58 
59 GeoDataStyle::GeoDataStyle( const QImage& icon,
60  const QFont &font, const QColor &color )
61  : d( new GeoDataStylePrivate( icon, font, color ) )
62 {
63 }
64 
65 GeoDataStyle::~GeoDataStyle()
66 {
67  delete d;
68 }
69 
70 GeoDataStyle& GeoDataStyle::operator=( const GeoDataStyle& other )
71 {
72  GeoDataStyleSelector::operator=( other );
73  *d = *other.d;
74  return *this;
75 }
76 
77 const char* GeoDataStyle::nodeType() const
78 {
79  return d->nodeType();
80 }
81 
82 void GeoDataStyle::setIconStyle( const GeoDataIconStyle& style )
83 {
84  d->m_iconStyle = style;
85  d->m_iconStyle.setParent( this );
86 }
87 
88 void GeoDataStyle::setLineStyle( const GeoDataLineStyle& style )
89 {
90  d->m_lineStyle = style;
91 }
92 
93 void GeoDataStyle::setLabelStyle( const GeoDataLabelStyle& style )
94 {
95  d->m_labelStyle = style;
96 }
97 
98 void GeoDataStyle::setPolyStyle( const GeoDataPolyStyle& style )
99 {
100  d->m_polyStyle = style;
101 }
102 
103 void GeoDataStyle::setBalloonStyle( const GeoDataBalloonStyle& style )
104 {
105  d->m_balloonStyle = style;
106 }
107 
108 void GeoDataStyle::setListStyle( const GeoDataListStyle& style )
109 {
110  d->m_listStyle = style;
111 }
112 
113 GeoDataIconStyle& GeoDataStyle::iconStyle() const
114 {
115  return d->m_iconStyle;
116 }
117 
118 GeoDataLineStyle& GeoDataStyle::lineStyle() const
119 {
120  return d->m_lineStyle;
121 }
122 
123 GeoDataPolyStyle& GeoDataStyle::polyStyle() const
124 {
125  return d->m_polyStyle;
126 }
127 
128 GeoDataLabelStyle& GeoDataStyle::labelStyle() const
129 {
130  return d->m_labelStyle;
131 }
132 
133 GeoDataBalloonStyle& GeoDataStyle::balloonStyle()
134 {
135  return d->m_balloonStyle;
136 }
137 
138 const GeoDataBalloonStyle& GeoDataStyle::balloonStyle() const
139 {
140  return d->m_balloonStyle;
141 }
142 
143 GeoDataListStyle& GeoDataStyle::listStyle()
144 {
145  return d->m_listStyle;
146 }
147 
148 const GeoDataListStyle& GeoDataStyle::listStyle() const
149 {
150  return d->m_listStyle;
151 }
152 
153 void GeoDataStyle::pack( QDataStream& stream ) const
154 {
155  GeoDataStyleSelector::pack( stream );
156 
157  d->m_iconStyle.pack( stream );
158  d->m_labelStyle.pack( stream );
159  d->m_polyStyle.pack( stream );
160  d->m_lineStyle.pack( stream );
161  d->m_balloonStyle.pack( stream );
162  d->m_listStyle.pack( stream );
163 }
164 
165 void GeoDataStyle::unpack( QDataStream& stream )
166 {
167  GeoDataStyleSelector::unpack( stream );
168 
169  d->m_iconStyle.unpack( stream );
170  d->m_labelStyle.unpack( stream );
171  d->m_lineStyle.unpack( stream );
172  d->m_polyStyle.unpack( stream );
173  d->m_balloonStyle.unpack( stream );
174  d->m_listStyle.unpack( stream );
175 }
176 
177 }
Marble::GeoDataIconStyle
Definition: GeoDataIconStyle.h:29
Marble::GeoDataLineStyle
specifies the style how lines are drawn
Definition: GeoDataLineStyle.h:36
Marble::GeoDataStyle::operator=
GeoDataStyle & operator=(const GeoDataStyle &other)
assignment operator
Definition: GeoDataStyle.cpp:70
Marble::GeoDataStyle::setIconStyle
void setIconStyle(const GeoDataIconStyle &style)
set the icon style
Definition: GeoDataStyle.cpp:82
Marble::GeoDataStyle::setListStyle
void setListStyle(const GeoDataListStyle &style)
set the list style
Definition: GeoDataStyle.cpp:108
Marble::GeoDataStyle::setBalloonStyle
void setBalloonStyle(const GeoDataBalloonStyle &style)
set the balloon style
Definition: GeoDataStyle.cpp:103
GeoDataStyle.h
Marble::GeoDataStyle::pack
virtual void pack(QDataStream &stream) const
Serialize the style to a stream.
Definition: GeoDataStyle.cpp:153
Marble::GeoDataStyle::labelStyle
GeoDataLabelStyle & labelStyle() const
Return the label style of this style.
Definition: GeoDataStyle.cpp:128
Marble::GeoDataStyle::GeoDataStyle
GeoDataStyle()
Construct a default style.
Definition: GeoDataStyle.cpp:49
Marble::GeoDataStyle
an addressable style group
Definition: GeoDataStyle.h:55
Marble::GeoDataStyleSelector::unpack
virtual void unpack(QDataStream &stream)
Unserialize the styleselector from a stream.
Definition: GeoDataStyleSelector.cpp:77
Marble::GeoDataStyleSelector::operator=
GeoDataStyleSelector & operator=(const GeoDataStyleSelector &other)
assignment operator
Definition: GeoDataStyleSelector.cpp:48
Marble::GeoDataStyle::iconStyle
GeoDataIconStyle & iconStyle() const
Return the icon style of this style.
Definition: GeoDataStyle.cpp:113
Marble::GeoDataBalloonStyle
Definition: GeoDataBalloonStyle.h:23
Marble::GeoDataStyleSelector::pack
virtual void pack(QDataStream &stream) const
Serialize the styleselector to a stream.
Definition: GeoDataStyleSelector.cpp:70
Marble::GeoDataStyle::lineStyle
GeoDataLineStyle & lineStyle() const
Return the label style of this style.
Definition: GeoDataStyle.cpp:118
Marble::GeoDataLabelStyle
specifies how the name of a GeoDataFeature is drawn
Definition: GeoDataLabelStyle.h:36
Marble::GeoDataStyle::setLineStyle
void setLineStyle(const GeoDataLineStyle &style)
set the line style
Definition: GeoDataStyle.cpp:88
Marble::GeoDataTypes::GeoDataStyleType
const char * GeoDataStyleType
Definition: GeoDataTypes.cpp:71
Marble::GeoDataStyle::balloonStyle
GeoDataBalloonStyle & balloonStyle()
Return the balloon style of this style.
Definition: GeoDataStyle.cpp:133
Marble::GeoDataStyle::listStyle
GeoDataListStyle & listStyle()
Return the list style of this style.
Definition: GeoDataStyle.cpp:143
Marble::GeoDataStyle::~GeoDataStyle
~GeoDataStyle()
Definition: GeoDataStyle.cpp:65
Marble::GeoDataStyle::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataStyle.cpp:77
Marble::GeoDataStyle::unpack
virtual void unpack(QDataStream &stream)
Unserialize the style from a stream.
Definition: GeoDataStyle.cpp:165
Marble::GeoDataStyle::setLabelStyle
void setLabelStyle(const GeoDataLabelStyle &style)
set the label style
Definition: GeoDataStyle.cpp:93
GeoDataTypes.h
Marble::GeoDataStyleSelector
a base class for the style classes
Definition: GeoDataStyleSelector.h:40
Marble::GeoDataPolyStyle
specifies the style how polygons are drawn
Definition: GeoDataPolyStyle.h:34
Marble::GeoDataStyle::setPolyStyle
void setPolyStyle(const GeoDataPolyStyle &style)
set the poly style
Definition: GeoDataStyle.cpp:98
Marble::GeoDataListStyle
Definition: GeoDataListStyle.h:28
Marble::GeoDataStyle::polyStyle
GeoDataPolyStyle & polyStyle() const
Return the label style of this style.
Definition: GeoDataStyle.cpp:123
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:50 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal