Marble

GeoDataLink.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
4// SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <sanjiban22393@gmail.com>
5//
6
7#include "GeoDataLink.h"
8#include "GeoDataTypes.h"
9
10namespace Marble
11{
12
13class GeoDataLinkPrivate
14{
15public:
16 QString m_href;
17 GeoDataLink::RefreshMode m_refreshMode;
18 qreal m_refreshInterval;
19 GeoDataLink::ViewRefreshMode m_viewRefreshMode;
20 qreal m_viewRefreshTime;
21 qreal m_viewBoundScale;
22 QString m_viewFormat;
23 QString m_httpQuery;
24
25 GeoDataLinkPrivate();
26};
27
28GeoDataLinkPrivate::GeoDataLinkPrivate()
29 : m_href()
30 , m_refreshMode(GeoDataLink::OnChange)
31 , m_refreshInterval(4.0)
32 , m_viewRefreshMode(GeoDataLink::Never)
33 , m_viewRefreshTime(4.0)
34 , m_viewBoundScale(1.0)
35 , m_viewFormat(QStringLiteral("BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]"))
36 , m_httpQuery()
37{
38 // nothing to do
39}
40
41GeoDataLink::GeoDataLink()
42 : d(new GeoDataLinkPrivate)
43{
44 // nothing to do
45}
46
47GeoDataLink::GeoDataLink(const Marble::GeoDataLink &other)
48 : GeoDataObject(other)
49 , d(new GeoDataLinkPrivate(*other.d))
50{
51 // nothing to do
52}
53
54GeoDataLink &GeoDataLink::operator=(const GeoDataLink &other)
55{
56 GeoDataObject::operator=(other);
57 *d = *other.d;
58 return *this;
59}
60
61bool GeoDataLink::operator==(const GeoDataLink &other) const
62{
63 return equals(other) && d->m_href == other.d->m_href && d->m_refreshMode == other.d->m_refreshMode && d->m_refreshInterval == other.d->m_refreshInterval
64 && d->m_viewRefreshMode == other.d->m_viewRefreshMode && d->m_viewRefreshTime == other.d->m_viewRefreshTime
65 && d->m_viewBoundScale == other.d->m_viewBoundScale && d->m_viewFormat == other.d->m_viewFormat && d->m_httpQuery == other.d->m_httpQuery;
66}
67
68bool GeoDataLink::operator!=(const GeoDataLink &other) const
69{
70 return !this->operator==(other);
71}
72
73GeoDataLink::~GeoDataLink()
74{
75 delete d;
76}
77
78const char *GeoDataLink::nodeType() const
79{
80 return GeoDataTypes::GeoDataLinkType;
81}
82
83QString GeoDataLink::href() const
84{
85 return d->m_href;
86}
87
88void GeoDataLink::setHref(const QString &href)
89{
90 d->m_href = href;
91}
92
93GeoDataLink::RefreshMode GeoDataLink::refreshMode() const
94{
95 return d->m_refreshMode;
96}
97
98void GeoDataLink::setRefreshMode(RefreshMode refreshMode)
99{
100 d->m_refreshMode = refreshMode;
101}
102
103qreal GeoDataLink::refreshInterval() const
104{
105 return d->m_refreshInterval;
106}
107
108void GeoDataLink::setRefreshInterval(qreal refreshInterval)
109{
110 d->m_refreshInterval = refreshInterval;
111}
112
113GeoDataLink::ViewRefreshMode GeoDataLink::viewRefreshMode() const
114{
115 return d->m_viewRefreshMode;
116}
117
118void GeoDataLink::setViewRefreshMode(ViewRefreshMode viewRefreshMode)
119{
120 d->m_viewRefreshMode = viewRefreshMode;
121}
122
123qreal GeoDataLink::viewRefreshTime() const
124{
125 return d->m_viewRefreshTime;
126}
127
128void GeoDataLink::setViewRefreshTime(qreal viewRefreshTime)
129{
130 d->m_viewRefreshTime = viewRefreshTime;
131}
132
133qreal GeoDataLink::viewBoundScale() const
134{
135 return d->m_viewBoundScale;
136}
137
138void GeoDataLink::setViewBoundScale(qreal viewBoundScale)
139{
140 d->m_viewBoundScale = viewBoundScale;
141}
142
143QString GeoDataLink::viewFormat() const
144{
145 return d->m_viewFormat;
146}
147
148void GeoDataLink::setViewFormat(const QString &viewFormat)
149{
150 d->m_viewFormat = viewFormat;
151}
152
153QString GeoDataLink::httpQuery() const
154{
155 return d->m_httpQuery;
156}
157void GeoDataLink::setHttpQuery(const QString &httpQuery)
158{
159 d->m_httpQuery = httpQuery;
160}
161
162}
bool equals(const QVariant &lhs, const QVariant &rhs)
bool operator==(const StyleDelim &l, const StyleDelim &r)
Binds a QML item to a specific geodetic location in screen coordinates.
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Mon Nov 18 2024 12:15:45 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.