Marble

GeoDataData.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2010 Harshit Jain <hjain.itbhu@gmail.com>
4//
5
6#include "GeoDataData.h"
7#include "GeoDataData_p.h"
8
9#include <QDataStream>
10
11#include "GeoDataTypes.h"
12#include "osm/OsmPlacemarkData.h"
13
14namespace Marble
15{
16
17GeoDataData::GeoDataData()
18 : GeoDataObject(), d( new GeoDataDataPrivate )
19{
20}
21
22GeoDataData::GeoDataData( const GeoDataData& other )
23 : GeoDataObject( other ), d( new GeoDataDataPrivate( *other.d ) )
24{
25}
26
27GeoDataData::~GeoDataData()
28{
29 delete d;
30}
31
32GeoDataData& GeoDataData::operator=( const GeoDataData& other )
33{
34 GeoDataObject::operator=( other );
35 *d = *other.d;
36 return *this;
37}
38
39bool GeoDataData::operator==( const GeoDataData& other) const
40{
41 return equals(other) &&
42 d->m_name == other.d->m_name &&
43 d->m_value == other.d->m_value &&
44 d->m_displayName == other.d->m_displayName;
45}
46
47bool GeoDataData::operator!=( const GeoDataData &other ) const
48{
49 return !this->operator==(other);
50}
51
52GeoDataData::GeoDataData( const QString &name, const QVariant &value )
53 : d( new GeoDataDataPrivate )
54{
55 d->m_name = name;
56 d->m_value = value;
57}
58
59const char* GeoDataData::nodeType() const
60{
61 return GeoDataTypes::GeoDataDataType;
62}
63
64QVariant GeoDataData::value() const
65{
66 return d->m_value;
67}
68
69QVariant& GeoDataData::valueRef()
70{
71 return d->m_value;
72}
73
74const QVariant& GeoDataData::valueRef() const
75{
76 return d->m_value;
77}
78
79void GeoDataData::setValue( const QVariant& value )
80{
81 d->m_value = value;
82}
83
84QString GeoDataData::name() const
85{
86 return d->m_name;
87}
88
89void GeoDataData::setName( const QString& name )
90{
91 d->m_name = name;
92}
93
94QString GeoDataData::displayName() const
95{
96 return d->m_displayName;
97}
98
99void GeoDataData::setDisplayName( const QString& displayName )
100{
101 d->m_displayName = displayName;
102}
103
104void GeoDataData::pack( QDataStream& stream ) const
105{
106 GeoDataObject::pack( stream );
107
108 stream << d->m_value;
109 stream << d->m_displayName;
110}
111
112void GeoDataData::unpack( QDataStream& stream )
113{
114 GeoDataObject::unpack( stream );
115
116 stream >> d->m_value;
117 stream >> d->m_displayName;
118}
119
120}
AKONADI_CALENDAR_EXPORT QString displayName(Akonadi::ETMCalendar *calendar, const Akonadi::Collection &collection)
QString name(StandardShortcut id)
bool equals(const QVariant &lhs, const QVariant &rhs)
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 Tue Mar 26 2024 11:18:17 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.