Marble

GeoDataSimpleField.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2014 Abhinav Gangwar <abhgang@gmail.com>
4//
5
6#include "GeoDataSimpleField.h"
7
8// Qt
9#include <QDataStream>
10#include <QString>
11
12// Marble
13#include "GeoDataTypes.h"
14
15
16namespace Marble
17{
18
19class GeoDataSimpleFieldPrivate
20{
21 public:
22 QString m_name;
23 GeoDataSimpleField::SimpleFieldType m_type;
24 QString m_displayName;
25};
26
27GeoDataSimpleField::GeoDataSimpleField()
28 : GeoNode(),
29 d( new GeoDataSimpleFieldPrivate )
30{
31}
32
33GeoDataSimpleField::GeoDataSimpleField( const GeoDataSimpleField& other )
34 : GeoNode(),
35 d( new GeoDataSimpleFieldPrivate( *other.d ) )
36{
37}
38
39bool GeoDataSimpleField::operator==(const GeoDataSimpleField& other) const
40{
41 return d->m_name == other.d->m_name &&
42 d->m_type == other.d->m_type &&
43 d->m_displayName == other.d->m_displayName;
44}
45
46bool GeoDataSimpleField::operator!=(const GeoDataSimpleField& other) const
47{
48 return !this->operator==( other );
49}
50
51GeoDataSimpleField::~GeoDataSimpleField()
52{
53 delete d;
54}
55
56GeoDataSimpleField::SimpleFieldType GeoDataSimpleField::type() const
57{
58 return d->m_type;
59}
60
61void GeoDataSimpleField::setType(SimpleFieldType type)
62{
63 d->m_type = type;
64}
65
66QString GeoDataSimpleField::name() const
67{
68 return d->m_name;
69}
70
71void GeoDataSimpleField::setName( const QString& value )
72{
73 d->m_name = value;
74}
75
76QString GeoDataSimpleField::displayName() const
77{
78 return d->m_displayName;
79}
80
81void GeoDataSimpleField::setDisplayName( const QString& displayName )
82{
83 d->m_displayName = displayName;
84}
85
86GeoDataSimpleField& GeoDataSimpleField::operator=( const GeoDataSimpleField& other )
87{
88 *d = *other.d;
89 return *this;
90}
91
92const char* GeoDataSimpleField::nodeType() const
93{
94 return GeoDataTypes::GeoDataSimpleFieldType;
95}
96
97void GeoDataSimpleField::pack( QDataStream& stream ) const
98{
99 stream << d->m_name;
100 stream << d->m_displayName;
101}
102
103void GeoDataSimpleField::unpack( QDataStream& stream )
104{
105 stream >> d->m_name;
106 stream >> d->m_displayName;
107}
108
109
110}
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
VehicleSection::Type type(QStringView coachNumber, QStringView coachClassification)
Binds a QML item to a specific geodetic location in screen coordinates.
bool operator==(const QGraphicsApiFilter &reference, const QGraphicsApiFilter &sample)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Fri Jun 21 2024 12:00:06 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.