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

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • lib
  • marble
  • geodata
  • data
GeoDataBalloonStyle.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 2012 Mohammed Nafees <nafees.technocool@gmail.com>
9 //
10 
11 #include "GeoDataBalloonStyle.h"
12 #include "GeoDataTypes.h"
13 
14 namespace Marble
15 {
16 
17 class GeoDataBalloonStylePrivate
18 {
19 public:
20  GeoDataBalloonStylePrivate();
21 
22  QColor m_bgColor;
23  QColor m_textColor;
24  QString m_text;
25  GeoDataBalloonStyle::DisplayMode m_mode;
26 };
27 
28 GeoDataBalloonStylePrivate::GeoDataBalloonStylePrivate() :
29  m_bgColor( Qt::white ),
30  m_textColor( Qt::black ),
31  m_text( "" ),
32  m_mode( GeoDataBalloonStyle::Default )
33 {
34 }
35 
36 GeoDataBalloonStyle::GeoDataBalloonStyle() :
37  d( new GeoDataBalloonStylePrivate )
38 {
39 }
40 
41 GeoDataBalloonStyle::GeoDataBalloonStyle( const Marble::GeoDataBalloonStyle &other ) :
42  GeoDataColorStyle( other ), d( new GeoDataBalloonStylePrivate( *other.d ) )
43 {
44 }
45 
46 GeoDataBalloonStyle &GeoDataBalloonStyle::operator=( const GeoDataBalloonStyle &other )
47 {
48  GeoDataColorStyle::operator=(other);
49  *d = *other.d;
50  return *this;
51 }
52 
53 bool GeoDataBalloonStyle::operator==( const GeoDataBalloonStyle &other ) const
54 {
55  return equals(other) &&
56  d->m_bgColor == other.d->m_bgColor &&
57  d->m_mode == other.d->m_mode &&
58  d->m_text == other.d->m_text &&
59  d->m_textColor == other.d->m_textColor;
60 }
61 
62 bool GeoDataBalloonStyle::operator!=( const GeoDataBalloonStyle &other ) const
63 {
64  return !this->operator==(other);
65 }
66 
67 GeoDataBalloonStyle::~GeoDataBalloonStyle()
68 {
69  delete d;
70 }
71 
72 const char *GeoDataBalloonStyle::nodeType() const
73 {
74  return GeoDataTypes::GeoDataBalloonStyleType;
75 }
76 
77 QColor GeoDataBalloonStyle::backgroundColor() const
78 {
79  return d->m_bgColor;
80 }
81 
82 void GeoDataBalloonStyle::setBackgroundColor( const QColor &color )
83 {
84  d->m_bgColor = color;
85 }
86 
87 QColor GeoDataBalloonStyle::textColor() const
88 {
89  return d->m_textColor;
90 }
91 
92 void GeoDataBalloonStyle::setTextColor( const QColor &color )
93 {
94  d->m_textColor = color;
95 }
96 
97 QString GeoDataBalloonStyle::text() const
98 {
99  return d->m_text;
100 }
101 
102 void GeoDataBalloonStyle::setText( const QString &text )
103 {
104  d->m_text = text;
105 }
106 
107 GeoDataBalloonStyle::DisplayMode GeoDataBalloonStyle::displayMode() const
108 {
109  return d->m_mode;
110 }
111 
112 void GeoDataBalloonStyle::setDisplayMode( const DisplayMode &mode )
113 {
114  d->m_mode = mode;
115 }
116 
117 void GeoDataBalloonStyle::pack( QDataStream& stream ) const
118 {
119  GeoDataColorStyle::pack( stream );
120 
121  stream << d->m_bgColor.name();
122  stream << d->m_textColor.name();
123  stream << d->m_text;
124 }
125 
126 void GeoDataBalloonStyle::unpack( QDataStream& stream )
127 {
128  GeoDataColorStyle::unpack( stream );
129 
130  stream >> d->m_bgColor;
131  stream >> d->m_textColor;
132  stream >> d->m_text;
133 }
134 
135 }
Marble::GeoDataBalloonStyle::GeoDataBalloonStyle
GeoDataBalloonStyle()
Definition: GeoDataBalloonStyle.cpp:36
Marble::GeoDataBalloonStyle::pack
virtual void pack(QDataStream &stream) const
Serialize the style to a stream.
Definition: GeoDataBalloonStyle.cpp:117
Marble::GeoDataBalloonStyle::setBackgroundColor
void setBackgroundColor(const QColor &color)
Definition: GeoDataBalloonStyle.cpp:82
QDataStream
Marble::GeoDataBalloonStyle::setDisplayMode
void setDisplayMode(const DisplayMode &mode)
Definition: GeoDataBalloonStyle.cpp:112
Marble::GeoDataBalloonStyle::operator!=
bool operator!=(const GeoDataBalloonStyle &other) const
Definition: GeoDataBalloonStyle.cpp:62
Marble::GeoDataObject::equals
virtual bool equals(const GeoDataObject &other) const
Compares the value of id and targetId of the two objects.
Definition: GeoDataObject.cpp:126
Marble::GeoDataBalloonStyle::~GeoDataBalloonStyle
~GeoDataBalloonStyle()
Definition: GeoDataBalloonStyle.cpp:67
Marble::GeoDataBalloonStyle::setText
void setText(const QString &text)
Definition: GeoDataBalloonStyle.cpp:102
Marble::GeoDataBalloonStyle::setTextColor
void setTextColor(const QColor &color)
Definition: GeoDataBalloonStyle.cpp:92
Marble::GeoDataBalloonStyle::backgroundColor
QColor backgroundColor() const
Definition: GeoDataBalloonStyle.cpp:77
Marble::GeoDataColorStyle::pack
virtual void pack(QDataStream &stream) const
Serialize the style to a stream.
Definition: GeoDataColorStyle.cpp:118
Marble::GeoDataColorStyle
an abstract base class for various style classes
Definition: GeoDataColorStyle.h:64
Marble::GeoDataBalloonStyle::operator==
bool operator==(const GeoDataBalloonStyle &other) const
Definition: GeoDataBalloonStyle.cpp:53
Marble::GeoDataBalloonStyle::DisplayMode
DisplayMode
Definition: GeoDataBalloonStyle.h:40
QString
QColor
Marble::GeoDataBalloonStyle
Definition: GeoDataBalloonStyle.h:23
Marble::GeoDataBalloonStyle::textColor
QColor textColor() const
Definition: GeoDataBalloonStyle.cpp:87
Marble::GeoDataBalloonStyle::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataBalloonStyle.cpp:72
Marble::GeoDataColorStyle::unpack
virtual void unpack(QDataStream &stream)
Unserialize the style from a stream.
Definition: GeoDataColorStyle.cpp:127
Marble::GeoDataColorStyle::color
QColor color() const
Return the color component.
Definition: GeoDataColorStyle.cpp:98
Marble::GeoDataTypes::GeoDataBalloonStyleType
const char * GeoDataBalloonStyleType
Definition: GeoDataTypes.cpp:89
Marble::GeoDataBalloonStyle::displayMode
DisplayMode displayMode() const
Definition: GeoDataBalloonStyle.cpp:107
Marble::GeoDataBalloonStyle::operator=
GeoDataBalloonStyle & operator=(const GeoDataBalloonStyle &other)
Definition: GeoDataBalloonStyle.cpp:46
GeoDataTypes.h
Marble::GeoDataBalloonStyle::text
QString text() const
Definition: GeoDataBalloonStyle.cpp:97
Marble::GeoDataColorStyle::operator=
GeoDataColorStyle & operator=(const GeoDataColorStyle &other)
assignment operator
Definition: GeoDataColorStyle.cpp:61
GeoDataBalloonStyle.h
Marble::GeoDataBalloonStyle::unpack
virtual void unpack(QDataStream &stream)
Unserialize the style from a stream.
Definition: GeoDataBalloonStyle.cpp:126
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:39 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
  • 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