Marble

GeoDataNetworkLinkControl.cpp
1// SPDX-License-Identifier: LGPL-2.1-or-later
2//
3// SPDX-FileCopyrightText: 2013 Mohammed Nafees <nafees.technocool@gmail.com>
4//
5
6#include "GeoDataNetworkLinkControl.h"
7#include "GeoDataNetworkLinkControl_p.h"
8
9#include "GeoDataAbstractView.h"
10
11namespace Marble
12{
13
14GeoDataNetworkLinkControl::GeoDataNetworkLinkControl()
15 : GeoDataContainer(new GeoDataNetworkLinkControlPrivate)
16{
17}
18
19GeoDataNetworkLinkControl::GeoDataNetworkLinkControl(const GeoDataNetworkLinkControl &other)
20 : GeoDataContainer(other, new GeoDataNetworkLinkControlPrivate(*other.d_func()))
21{
22}
23
24GeoDataNetworkLinkControl &GeoDataNetworkLinkControl::operator=(const GeoDataNetworkLinkControl &other)
25{
26 if (this != &other) {
27 Q_D(GeoDataNetworkLinkControl);
28 *d = *other.d_func();
29 }
30
31 return *this;
32}
33
34bool GeoDataNetworkLinkControl::operator==(const GeoDataNetworkLinkControl &other) const
35{
36 Q_D(const GeoDataNetworkLinkControl);
37 const GeoDataNetworkLinkControlPrivate *const other_d = other.d_func();
38
39 if (!GeoDataContainer::equals(other) || d->m_minRefreshPeriod != other_d->m_minRefreshPeriod || d->m_maxSessionLength != other_d->m_maxSessionLength
40 || d->m_cookie != other_d->m_cookie || d->m_message != other_d->m_message || d->m_linkName != other_d->m_linkName
41 || d->m_linkDescription != other_d->m_linkDescription || d->m_linkSnippet != other_d->m_linkSnippet || d->m_maxLines != other_d->m_maxLines
42 || d->m_expires != other_d->m_expires || d->m_update != other_d->m_update) {
43 return false;
44 }
45
46 if (!d->m_abstractView && !other_d->m_abstractView) {
47 return true;
48 }
49 if ((!d->m_abstractView && other_d->m_abstractView) || (d->m_abstractView && !other_d->m_abstractView)) {
50 return false;
51 }
52
53 if (*d->m_abstractView != *other_d->m_abstractView) {
54 return false;
55 }
56
57 return true;
58}
59
60bool GeoDataNetworkLinkControl::operator!=(const GeoDataNetworkLinkControl &other) const
61{
62 return !this->operator==(other);
63}
64
65GeoDataNetworkLinkControl::~GeoDataNetworkLinkControl() = default;
66
67GeoDataFeature *GeoDataNetworkLinkControl::clone() const
68{
69 return new GeoDataNetworkLinkControl(*this);
70}
71
72const char *GeoDataNetworkLinkControl::nodeType() const
73{
74 Q_D(const GeoDataNetworkLinkControl);
75 return GeoDataTypes::GeoDataNetworkLinkControlType;
76}
77
78qreal GeoDataNetworkLinkControl::minRefreshPeriod() const
79{
80 Q_D(const GeoDataNetworkLinkControl);
81 return d->m_minRefreshPeriod;
82}
83
84void GeoDataNetworkLinkControl::setMinRefreshPeriod(qreal minRefreshPeriod)
85{
86 Q_D(GeoDataNetworkLinkControl);
87 d->m_minRefreshPeriod = minRefreshPeriod;
88}
89
90qreal GeoDataNetworkLinkControl::maxSessionLength() const
91{
92 Q_D(const GeoDataNetworkLinkControl);
93 return d->m_maxSessionLength;
94}
95
96void GeoDataNetworkLinkControl::setMaxSessionLength(qreal maxSessionLength)
97{
98 Q_D(GeoDataNetworkLinkControl);
99 d->m_maxSessionLength = maxSessionLength;
100}
101
102QString GeoDataNetworkLinkControl::cookie() const
103{
104 Q_D(const GeoDataNetworkLinkControl);
105 return d->m_cookie;
106}
107
108void GeoDataNetworkLinkControl::setCookie(const QString &cookie)
109{
110 Q_D(GeoDataNetworkLinkControl);
111 d->m_cookie = cookie;
112}
113
114QString GeoDataNetworkLinkControl::message() const
115{
116 Q_D(const GeoDataNetworkLinkControl);
117 return d->m_message;
118}
119
120void GeoDataNetworkLinkControl::setMessage(const QString &message)
121{
122 Q_D(GeoDataNetworkLinkControl);
123 d->m_message = message;
124}
125
126QString GeoDataNetworkLinkControl::linkName() const
127{
128 Q_D(const GeoDataNetworkLinkControl);
129 return d->m_linkName;
130}
131
132void GeoDataNetworkLinkControl::setLinkName(const QString &linkName)
133{
134 Q_D(GeoDataNetworkLinkControl);
135 d->m_linkName = linkName;
136}
137
138QString GeoDataNetworkLinkControl::linkDescription() const
139{
140 Q_D(const GeoDataNetworkLinkControl);
141 return d->m_linkDescription;
142}
143
144void GeoDataNetworkLinkControl::setLinkDescription(const QString &linkDescription)
145{
146 Q_D(GeoDataNetworkLinkControl);
147 d->m_linkDescription = linkDescription;
148}
149
150QString GeoDataNetworkLinkControl::linkSnippet() const
151{
152 Q_D(const GeoDataNetworkLinkControl);
153 return d->m_linkSnippet;
154}
155
156void GeoDataNetworkLinkControl::setLinkSnippet(const QString &linkSnippet)
157{
158 Q_D(GeoDataNetworkLinkControl);
159 d->m_linkSnippet = linkSnippet;
160}
161
162int GeoDataNetworkLinkControl::maxLines() const
163{
164 Q_D(const GeoDataNetworkLinkControl);
165 return d->m_maxLines;
166}
167
168void GeoDataNetworkLinkControl::setMaxLines(int maxLines)
169{
170 Q_D(GeoDataNetworkLinkControl);
171 d->m_maxLines = maxLines;
172}
173
174QDateTime GeoDataNetworkLinkControl::expires() const
175{
176 Q_D(const GeoDataNetworkLinkControl);
177 return d->m_expires;
178}
179
180void GeoDataNetworkLinkControl::setExpires(const QDateTime &expires)
181{
182 Q_D(GeoDataNetworkLinkControl);
183 d->m_expires = expires;
184}
185
186GeoDataUpdate &GeoDataNetworkLinkControl::update()
187{
188 Q_D(GeoDataNetworkLinkControl);
189 return d->m_update;
190}
191
192const GeoDataUpdate &GeoDataNetworkLinkControl::update() const
193{
194 Q_D(const GeoDataNetworkLinkControl);
195 return d->m_update;
196}
197
198void GeoDataNetworkLinkControl::setUpdate(const GeoDataUpdate &update)
199{
200 Q_D(GeoDataNetworkLinkControl);
201 d->m_update = update;
202}
203
204GeoDataAbstractView *GeoDataNetworkLinkControl::abstractView() const
205{
206 Q_D(const GeoDataNetworkLinkControl);
207 return d->m_abstractView;
208}
209
210void GeoDataNetworkLinkControl::setAbstractView(GeoDataAbstractView *abstractView)
211{
212 Q_D(GeoDataNetworkLinkControl);
213 d->m_abstractView = abstractView;
214 d->m_abstractView->setParent(this);
215}
216
217}
void update(Part *part, const QByteArray &data, qint64 dataSize)
bool operator==(const StyleDelim &l, const StyleDelim &r)
Binds a QML item to a specific geodetic location in screen coordinates.
Q_D(Todo)
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Sat Dec 21 2024 17:04:14 by doxygen 1.12.0 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.