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
12class GeoDataLinkPrivate
13{
14public:
15 QString m_href;
16 GeoDataLink::RefreshMode m_refreshMode;
17 qreal m_refreshInterval;
18 GeoDataLink::ViewRefreshMode m_viewRefreshMode;
19 qreal m_viewRefreshTime;
20 qreal m_viewBoundScale;
21 QString m_viewFormat;
22 QString m_httpQuery;
23
24 GeoDataLinkPrivate();
25};
26
27GeoDataLinkPrivate::GeoDataLinkPrivate() :
28 m_href(),
29 m_refreshMode(GeoDataLink::OnChange),
30 m_refreshInterval(4.0),
31 m_viewRefreshMode(GeoDataLink::Never),
32 m_viewRefreshTime(4.0),
33 m_viewBoundScale(1.0),
34 m_viewFormat("BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]"),
35 m_httpQuery()
36{
37 // nothing to do
38}
39
40GeoDataLink::GeoDataLink() : d( new GeoDataLinkPrivate )
41{
42 // nothing to do
43}
44
45GeoDataLink::GeoDataLink( const Marble::GeoDataLink &other ) :
46 GeoDataObject( other ), d( new GeoDataLinkPrivate( *other.d ) )
47{
48 // nothing to do
49}
50
51GeoDataLink &GeoDataLink::operator=( const GeoDataLink &other )
52{
53 GeoDataObject::operator=( other );
54 *d = *other.d;
55 return *this;
56}
57
58bool GeoDataLink::operator==( const GeoDataLink& other ) const
59{
60 return equals(other) &&
61 d->m_href == other.d->m_href &&
62 d->m_refreshMode == other.d->m_refreshMode &&
63 d->m_refreshInterval == other.d->m_refreshInterval &&
64 d->m_viewRefreshMode == other.d->m_viewRefreshMode &&
65 d->m_viewRefreshTime == other.d->m_viewRefreshTime &&
66 d->m_viewBoundScale == other.d->m_viewBoundScale &&
67 d->m_viewFormat == other.d->m_viewFormat &&
68 d->m_httpQuery == other.d->m_httpQuery;
69}
70
71bool GeoDataLink::operator!=( const GeoDataLink& other ) const
72{
73 return !this->operator==(other);
74}
75
76GeoDataLink::~GeoDataLink()
77{
78 delete d;
79}
80
81const char *GeoDataLink::nodeType() const
82{
83 return GeoDataTypes::GeoDataLinkType;
84}
85
86QString GeoDataLink::href() const
87{
88 return d->m_href;
89}
90
91void GeoDataLink::setHref( const QString& href )
92{
93 d->m_href = href;
94}
95
96GeoDataLink::RefreshMode GeoDataLink::refreshMode() const
97{
98 return d->m_refreshMode;
99}
100
101void GeoDataLink::setRefreshMode(RefreshMode refreshMode )
102{
103 d->m_refreshMode = refreshMode;
104}
105
106qreal GeoDataLink::refreshInterval() const
107{
108 return d->m_refreshInterval;
109}
110
111void GeoDataLink::setRefreshInterval( qreal refreshInterval)
112{
113 d->m_refreshInterval = refreshInterval;
114}
115
116GeoDataLink::ViewRefreshMode GeoDataLink::viewRefreshMode() const
117{
118 return d->m_viewRefreshMode;
119}
120
121void GeoDataLink::setViewRefreshMode(ViewRefreshMode viewRefreshMode)
122{
123 d->m_viewRefreshMode = viewRefreshMode;
124}
125
126qreal GeoDataLink::viewRefreshTime() const
127{
128 return d->m_viewRefreshTime;
129}
130
131void GeoDataLink::setViewRefreshTime(qreal viewRefreshTime)
132{
133 d->m_viewRefreshTime = viewRefreshTime;
134}
135
136qreal GeoDataLink::viewBoundScale() const
137{
138 return d->m_viewBoundScale;
139}
140
141void GeoDataLink::setViewBoundScale(qreal viewBoundScale)
142{
143 d->m_viewBoundScale = viewBoundScale;
144}
145
146QString GeoDataLink::viewFormat() const
147{
148 return d->m_viewFormat;
149}
150
151void GeoDataLink::setViewFormat(const QString &viewFormat)
152{
153 d->m_viewFormat = viewFormat;
154}
155
156QString GeoDataLink::httpQuery() const
157{
158 return d->m_httpQuery;
159}
160void GeoDataLink::setHttpQuery(const QString &httpQuery)
161{
162 d->m_httpQuery = httpQuery;
163}
164
165}
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 Fri Jun 14 2024 11:54:16 by doxygen 1.10.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.