• 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
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 GeoDataBalloonStyle::~GeoDataBalloonStyle()
54 {
55  delete d;
56 }
57 
58 const char *GeoDataBalloonStyle::nodeType() const
59 {
60  return GeoDataTypes::GeoDataBalloonStyleType;
61 }
62 
63 QColor GeoDataBalloonStyle::backgroundColor() const
64 {
65  return d->m_bgColor;
66 }
67 
68 void GeoDataBalloonStyle::setBackgroundColor( const QColor &color )
69 {
70  d->m_bgColor = color;
71 }
72 
73 QColor GeoDataBalloonStyle::textColor() const
74 {
75  return d->m_textColor;
76 }
77 
78 void GeoDataBalloonStyle::setTextColor( const QColor &color )
79 {
80  d->m_textColor = color;
81 }
82 
83 QString GeoDataBalloonStyle::text() const
84 {
85  return d->m_text;
86 }
87 
88 void GeoDataBalloonStyle::setText( const QString &text )
89 {
90  d->m_text = text;
91 }
92 
93 GeoDataBalloonStyle::DisplayMode GeoDataBalloonStyle::displayMode() const
94 {
95  return d->m_mode;
96 }
97 
98 void GeoDataBalloonStyle::setDisplayMode( const DisplayMode &mode )
99 {
100  d->m_mode = mode;
101 }
102 
103 void GeoDataBalloonStyle::pack( QDataStream& stream ) const
104 {
105  GeoDataColorStyle::pack( stream );
106 
107  stream << d->m_bgColor.name();
108  stream << d->m_textColor.name();
109  stream << d->m_text;
110 }
111 
112 void GeoDataBalloonStyle::unpack( QDataStream& stream )
113 {
114  GeoDataColorStyle::unpack( stream );
115 
116  stream >> d->m_bgColor;
117  stream >> d->m_textColor;
118  stream >> d->m_text;
119 }
120 
121 }
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:103
Marble::GeoDataBalloonStyle::setBackgroundColor
void setBackgroundColor(const QColor &color)
Definition: GeoDataBalloonStyle.cpp:68
Marble::GeoDataBalloonStyle::setDisplayMode
void setDisplayMode(const DisplayMode &mode)
Definition: GeoDataBalloonStyle.cpp:98
Marble::GeoDataBalloonStyle::~GeoDataBalloonStyle
~GeoDataBalloonStyle()
Definition: GeoDataBalloonStyle.cpp:53
Marble::GeoDataBalloonStyle::setText
void setText(const QString &text)
Definition: GeoDataBalloonStyle.cpp:88
Marble::GeoDataBalloonStyle::setTextColor
void setTextColor(const QColor &color)
Definition: GeoDataBalloonStyle.cpp:78
Marble::GeoDataBalloonStyle::backgroundColor
QColor backgroundColor() const
Definition: GeoDataBalloonStyle.cpp:63
Marble::GeoDataColorStyle::pack
virtual void pack(QDataStream &stream) const
Serialize the style to a stream.
Definition: GeoDataColorStyle.cpp:107
Marble::GeoDataColorStyle
an abstract base class for various style classes
Definition: GeoDataColorStyle.h:64
Marble::GeoDataBalloonStyle::DisplayMode
DisplayMode
Definition: GeoDataBalloonStyle.h:37
Marble::GeoDataBalloonStyle
Definition: GeoDataBalloonStyle.h:23
Marble::GeoDataBalloonStyle::textColor
QColor textColor() const
Definition: GeoDataBalloonStyle.cpp:73
Marble::GeoDataBalloonStyle::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataBalloonStyle.cpp:58
Marble::GeoDataColorStyle::unpack
virtual void unpack(QDataStream &stream)
Unserialize the style from a stream.
Definition: GeoDataColorStyle.cpp:116
Marble::GeoDataColorStyle::color
QColor color() const
Return the color component.
Definition: GeoDataColorStyle.cpp:87
Marble::GeoDataTypes::GeoDataBalloonStyleType
const char * GeoDataBalloonStyleType
Definition: GeoDataTypes.cpp:80
Marble::GeoDataBalloonStyle::displayMode
DisplayMode displayMode() const
Definition: GeoDataBalloonStyle.cpp:93
Marble::GeoDataBalloonStyle::operator=
GeoDataBalloonStyle & operator=(const GeoDataBalloonStyle &other)
Definition: GeoDataBalloonStyle.cpp:46
GeoDataTypes.h
Marble::GeoDataBalloonStyle::text
QString text() const
Definition: GeoDataBalloonStyle.cpp:83
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:112
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:38:49 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