• 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
GeoDataSimpleField.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 2014 Abhinav Gangwar <abhgang@gmail.com>
9 //
10 
11 // Qt
12 #include <QDataStream>
13 #include <QString>
14 
15 // Marble
16 #include "GeoDataSimpleField.h"
17 #include "GeoDataTypes.h"
18 
19 
20 namespace Marble
21 {
22 
23 class GeoDataSimpleFieldPrivate
24 {
25  public:
26  QString m_name;
27  GeoDataSimpleField::SimpleFieldType m_type;
28  QString m_displayName;
29 };
30 
31 GeoDataSimpleField::GeoDataSimpleField()
32  : GeoNode(),
33  d( new GeoDataSimpleFieldPrivate )
34 {
35 }
36 
37 GeoDataSimpleField::GeoDataSimpleField( const GeoDataSimpleField& other )
38  : GeoNode(),
39  d( new GeoDataSimpleFieldPrivate( *other.d ) )
40 {
41 }
42 
43 bool GeoDataSimpleField::operator==(const GeoDataSimpleField& other) const
44 {
45  return d->m_name == other.d->m_name &&
46  d->m_type == other.d->m_type &&
47  d->m_displayName == other.d->m_displayName;
48 }
49 
50 bool GeoDataSimpleField::operator!=(const GeoDataSimpleField& other) const
51 {
52  return !this->operator==( other );
53 }
54 
55 GeoDataSimpleField::~GeoDataSimpleField()
56 {
57  delete d;
58 }
59 
60 GeoDataSimpleField::SimpleFieldType GeoDataSimpleField::type() const
61 {
62  return d->m_type;
63 }
64 
65 void GeoDataSimpleField::setType( const SimpleFieldType& type )
66 {
67  d->m_type = type;
68 }
69 
70 QString GeoDataSimpleField::name() const
71 {
72  return d->m_name;
73 }
74 
75 void GeoDataSimpleField::setName( const QString& value )
76 {
77  d->m_name = value;
78 }
79 
80 QString GeoDataSimpleField::displayName() const
81 {
82  return d->m_displayName;
83 }
84 
85 void GeoDataSimpleField::setDisplayName( const QString& displayName )
86 {
87  d->m_displayName = displayName;
88 }
89 
90 GeoDataSimpleField& GeoDataSimpleField::operator=( const GeoDataSimpleField& other )
91 {
92  *d = *other.d;
93  return *this;
94 }
95 
96 const char* GeoDataSimpleField::nodeType() const
97 {
98  return GeoDataTypes::GeoDataSimpleFieldType;
99 }
100 
101 void GeoDataSimpleField::pack( QDataStream& stream ) const
102 {
103  stream << d->m_name;
104  stream << d->m_displayName;
105 }
106 
107 void GeoDataSimpleField::unpack( QDataStream& stream )
108 {
109  stream >> d->m_name;
110  stream >> d->m_displayName;
111 }
112 
113 
114 }
Marble::GeoDataSimpleField::GeoDataSimpleField
GeoDataSimpleField()
Definition: GeoDataSimpleField.cpp:31
Marble::GeoDataSimpleField::operator==
bool operator==(const GeoDataSimpleField &other) const
Definition: GeoDataSimpleField.cpp:43
QDataStream
Marble::GeoNode
A shared base class for all classes that are mapped to a specific tag (ie.
Definition: GeoDocument.h:60
Marble::GeoDataSimpleField
Definition: GeoDataSimpleField.h:25
GeoDataSimpleField.h
Marble::GeoDataSimpleField::~GeoDataSimpleField
virtual ~GeoDataSimpleField()
Definition: GeoDataSimpleField.cpp:55
Marble::GeoDataTypes::GeoDataSimpleFieldType
const char * GeoDataSimpleFieldType
Definition: GeoDataTypes.cpp:74
Marble::GeoDataSimpleField::operator=
GeoDataSimpleField & operator=(const GeoDataSimpleField &rhs)
Definition: GeoDataSimpleField.cpp:90
Marble::GeoDataSimpleField::nodeType
virtual const char * nodeType() const
Definition: GeoDataSimpleField.cpp:96
Marble::GeoDataSimpleField::unpack
virtual void unpack(QDataStream &stream)
Definition: GeoDataSimpleField.cpp:107
Marble::GeoDataSimpleField::setType
void setType(const SimpleFieldType &type)
Definition: GeoDataSimpleField.cpp:65
Marble::GeoDataSimpleField::name
QString name() const
Definition: GeoDataSimpleField.cpp:70
Marble::GeoDataSimpleField::SimpleFieldType
SimpleFieldType
Definition: GeoDataSimpleField.h:37
QString
Marble::GeoDataSimpleField::type
SimpleFieldType type() const
Definition: GeoDataSimpleField.cpp:60
Marble::GeoDataSimpleField::setName
void setName(const QString &value)
Definition: GeoDataSimpleField.cpp:75
Marble::GeoDataSimpleField::operator!=
bool operator!=(const GeoDataSimpleField &other) const
Definition: GeoDataSimpleField.cpp:50
Marble::GeoDataSimpleField::pack
virtual void pack(QDataStream &stream) const
Definition: GeoDataSimpleField.cpp:101
Marble::GeoDataSimpleField::displayName
QString displayName() const
Definition: GeoDataSimpleField.cpp:80
GeoDataTypes.h
Marble::GeoDataSimpleField::setDisplayName
void setDisplayName(const QString &displayName)
Definition: GeoDataSimpleField.cpp:85
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