• 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
GeoDataItemIcon.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 "GeoDataItemIcon.h"
12 #include "GeoDataTypes.h"
13 
14 namespace Marble
15 {
16 
17 class GeoDataItemIconPrivate
18 {
19 public:
20  GeoDataItemIconPrivate();
21 
22  GeoDataItemIcon::ItemIconStates m_state;
23  QString m_iconPath;
24  QImage m_icon;
25 };
26 
27 GeoDataItemIconPrivate::GeoDataItemIconPrivate() :
28  m_state(),
29  m_iconPath(),
30  m_icon()
31 {
32 }
33 
34 GeoDataItemIcon::GeoDataItemIcon() :
35  d( new GeoDataItemIconPrivate )
36 {
37 }
38 
39 GeoDataItemIcon::GeoDataItemIcon( const Marble::GeoDataItemIcon &other ) :
40  GeoDataObject(), d( new GeoDataItemIconPrivate( *other.d ) )
41 {
42 }
43 
44 GeoDataItemIcon &GeoDataItemIcon::operator=( const GeoDataItemIcon &other )
45 {
46  GeoDataObject::operator=( other );
47  *d = *other.d;
48  return *this;
49 }
50 
51 GeoDataItemIcon::~GeoDataItemIcon()
52 {
53  delete d;
54 }
55 
56 const char *GeoDataItemIcon::nodeType() const
57 {
58  return GeoDataTypes::GeoDataItemIconType;
59 }
60 
61 GeoDataItemIcon::ItemIconStates GeoDataItemIcon::state() const
62 {
63  return d->m_state;
64 }
65 
66 void GeoDataItemIcon::setState( const ItemIconStates &state )
67 {
68  d->m_state = state;
69 }
70 
71 void GeoDataItemIcon::setIcon( const QImage &icon )
72 {
73  d->m_icon = icon;
74 }
75 
76 QString GeoDataItemIcon::iconPath() const
77 {
78  return d->m_iconPath;
79 }
80 
81 void GeoDataItemIcon::setIconPath( const QString &path )
82 {
83  d->m_iconPath = path;
84 }
85 
86 QImage GeoDataItemIcon::icon() const
87 {
88  if(!d->m_icon.isNull())
89  {
90  return d->m_icon;
91  }
92  else if(!d->m_iconPath.isEmpty())
93  {
94  d->m_icon = QImage(d->m_iconPath);
95  return d->m_icon;
96  }
97  else
98  {
99  return QImage();
100  }
101 }
102 
103 }
Marble::GeoDataTypes::GeoDataItemIconType
const char * GeoDataItemIconType
Definition: GeoDataTypes.cpp:82
Marble::GeoDataItemIcon::~GeoDataItemIcon
~GeoDataItemIcon()
Definition: GeoDataItemIcon.cpp:51
Marble::GeoDataItemIcon::nodeType
virtual const char * nodeType() const
Provides type information for downcasting a GeoNode.
Definition: GeoDataItemIcon.cpp:56
Marble::GeoDataItemIcon
Definition: GeoDataItemIcon.h:24
Marble::GeoDataItemIcon::icon
QImage icon() const
Definition: GeoDataItemIcon.cpp:86
Marble::GeoDataObject
A base class for all geodata objects.
Definition: GeoDataObject.h:48
Marble::GeoDataItemIcon::setIcon
void setIcon(const QImage &icon)
Definition: GeoDataItemIcon.cpp:71
GeoDataItemIcon.h
Marble::GeoDataItemIcon::setIconPath
void setIconPath(const QString &path)
Definition: GeoDataItemIcon.cpp:81
Marble::GeoDataItemIcon::GeoDataItemIcon
GeoDataItemIcon()
Definition: GeoDataItemIcon.cpp:34
Marble::GeoDataItemIcon::setState
void setState(const ItemIconStates &state)
Definition: GeoDataItemIcon.cpp:66
Marble::GeoDataItemIcon::operator=
GeoDataItemIcon & operator=(const GeoDataItemIcon &other)
Definition: GeoDataItemIcon.cpp:44
Marble::GeoDataObject::operator=
GeoDataObject & operator=(const GeoDataObject &)
Definition: GeoDataObject.cpp:54
GeoDataTypes.h
Marble::GeoDataItemIcon::iconPath
QString iconPath() const
Definition: GeoDataItemIcon.cpp:76
Marble::GeoDataItemIcon::state
ItemIconStates state() const
Definition: GeoDataItemIcon.cpp:61
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