File indexing completed on 2025-01-05 03:58:58

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2013 Mohammed Nafees <nafees.technocool@gmail.com>
0004 //
0005 
0006 #include "GeoDataNetworkLinkControl.h"
0007 #include "GeoDataNetworkLinkControl_p.h"
0008 
0009 #include "GeoDataAbstractView.h"
0010 
0011 namespace Marble
0012 {
0013 
0014 GeoDataNetworkLinkControl::GeoDataNetworkLinkControl()
0015   : GeoDataContainer(new GeoDataNetworkLinkControlPrivate)
0016 {
0017 }
0018 
0019 GeoDataNetworkLinkControl::GeoDataNetworkLinkControl(const GeoDataNetworkLinkControl &other)
0020   : GeoDataContainer(other, new GeoDataNetworkLinkControlPrivate(*other.d_func()))
0021 {
0022 }
0023 
0024 GeoDataNetworkLinkControl &GeoDataNetworkLinkControl::operator=( const GeoDataNetworkLinkControl &other )
0025 {
0026     if (this != &other) {
0027         Q_D(GeoDataNetworkLinkControl);
0028         *d = *other.d_func();
0029     }
0030 
0031     return *this;
0032 }
0033 
0034 
0035 bool GeoDataNetworkLinkControl::operator==( const GeoDataNetworkLinkControl &other ) const
0036 {
0037     Q_D(const GeoDataNetworkLinkControl);
0038     const GeoDataNetworkLinkControlPrivate* const other_d = other.d_func();
0039 
0040     if ( !GeoDataContainer::equals(other) ||
0041          d->m_minRefreshPeriod != other_d->m_minRefreshPeriod ||
0042          d->m_maxSessionLength != other_d->m_maxSessionLength ||
0043          d->m_cookie != other_d->m_cookie ||
0044          d->m_message != other_d->m_message ||
0045          d->m_linkName != other_d->m_linkName ||
0046          d->m_linkDescription != other_d->m_linkDescription ||
0047          d->m_linkSnippet != other_d->m_linkSnippet ||
0048          d->m_maxLines != other_d->m_maxLines ||
0049          d->m_expires != other_d->m_expires ||
0050          d->m_update != other_d->m_update ) {
0051         return false;
0052     }
0053 
0054     if (!d->m_abstractView && !other_d->m_abstractView) {
0055         return true;
0056     }
0057     if ((!d->m_abstractView && other_d->m_abstractView) ||
0058         (d->m_abstractView && !other_d->m_abstractView)) {
0059         return false;
0060     }
0061 
0062     if (*d->m_abstractView != *other_d->m_abstractView) {
0063         return false;
0064     }
0065 
0066     return true;
0067 }
0068 
0069 bool GeoDataNetworkLinkControl::operator!=( const GeoDataNetworkLinkControl &other ) const
0070 {
0071     return !this->operator==( other );
0072 }
0073 
0074 GeoDataNetworkLinkControl::~GeoDataNetworkLinkControl()
0075 {
0076 }
0077 
0078 GeoDataFeature * GeoDataNetworkLinkControl::clone() const
0079 {
0080     return new GeoDataNetworkLinkControl(*this);
0081 }
0082 
0083 
0084 const char *GeoDataNetworkLinkControl::nodeType() const
0085 {
0086     Q_D(const GeoDataNetworkLinkControl);
0087     Q_UNUSED(d);
0088     return GeoDataTypes::GeoDataNetworkLinkControlType;
0089 }
0090 
0091 qreal GeoDataNetworkLinkControl::minRefreshPeriod() const
0092 {
0093     Q_D(const GeoDataNetworkLinkControl);
0094     return d->m_minRefreshPeriod;
0095 }
0096 
0097 void GeoDataNetworkLinkControl::setMinRefreshPeriod(qreal minRefreshPeriod )
0098 {
0099     Q_D(GeoDataNetworkLinkControl);
0100     d->m_minRefreshPeriod = minRefreshPeriod;
0101 }
0102 
0103 qreal GeoDataNetworkLinkControl::maxSessionLength() const
0104 {
0105     Q_D(const GeoDataNetworkLinkControl);
0106     return d->m_maxSessionLength;
0107 }
0108 
0109 void GeoDataNetworkLinkControl::setMaxSessionLength(qreal maxSessionLength)
0110 {
0111     Q_D(GeoDataNetworkLinkControl);
0112     d->m_maxSessionLength = maxSessionLength;
0113 }
0114 
0115 QString GeoDataNetworkLinkControl::cookie() const
0116 {
0117     Q_D(const GeoDataNetworkLinkControl);
0118     return d->m_cookie;
0119 }
0120 
0121 void GeoDataNetworkLinkControl::setCookie( const QString &cookie )
0122 {
0123     Q_D(GeoDataNetworkLinkControl);
0124     d->m_cookie = cookie;
0125 }
0126 
0127 QString GeoDataNetworkLinkControl::message() const
0128 {
0129     Q_D(const GeoDataNetworkLinkControl);
0130     return d->m_message;
0131 }
0132 
0133 void GeoDataNetworkLinkControl::setMessage( const QString &message )
0134 {
0135     Q_D(GeoDataNetworkLinkControl);
0136     d->m_message = message;
0137 }
0138 
0139 QString GeoDataNetworkLinkControl::linkName() const
0140 {
0141     Q_D(const GeoDataNetworkLinkControl);
0142     return d->m_linkName;
0143 }
0144 
0145 void GeoDataNetworkLinkControl::setLinkName( const QString &linkName )
0146 {
0147     Q_D(GeoDataNetworkLinkControl);
0148     d->m_linkName = linkName;
0149 }
0150 
0151 QString GeoDataNetworkLinkControl::linkDescription() const
0152 {
0153     Q_D(const GeoDataNetworkLinkControl);
0154     return d->m_linkDescription;
0155 }
0156 
0157 void GeoDataNetworkLinkControl::setLinkDescription( const QString &linkDescription )
0158 {
0159     Q_D(GeoDataNetworkLinkControl);
0160     d->m_linkDescription = linkDescription;
0161 }
0162 
0163 QString GeoDataNetworkLinkControl::linkSnippet() const
0164 {
0165     Q_D(const GeoDataNetworkLinkControl);
0166     return d->m_linkSnippet;
0167 }
0168 
0169 void GeoDataNetworkLinkControl::setLinkSnippet( const QString &linkSnippet )
0170 {
0171     Q_D(GeoDataNetworkLinkControl);
0172     d->m_linkSnippet = linkSnippet;
0173 }
0174 
0175 int GeoDataNetworkLinkControl::maxLines() const
0176 {
0177     Q_D(const GeoDataNetworkLinkControl);
0178     return d->m_maxLines;
0179 }
0180 
0181 void GeoDataNetworkLinkControl::setMaxLines(int maxLines)
0182 {
0183     Q_D(GeoDataNetworkLinkControl);
0184     d->m_maxLines = maxLines;
0185 }
0186 
0187 QDateTime GeoDataNetworkLinkControl::expires() const
0188 {
0189     Q_D(const GeoDataNetworkLinkControl);
0190     return d->m_expires;
0191 }
0192 
0193 void GeoDataNetworkLinkControl::setExpires( const QDateTime &expires )
0194 {
0195     Q_D(GeoDataNetworkLinkControl);
0196     d->m_expires = expires;
0197 }
0198 
0199 GeoDataUpdate &GeoDataNetworkLinkControl::update()
0200 {
0201     Q_D(GeoDataNetworkLinkControl);
0202     return d->m_update;
0203 }
0204 
0205 const GeoDataUpdate& GeoDataNetworkLinkControl::update() const
0206 {
0207     Q_D(const GeoDataNetworkLinkControl);
0208     return d->m_update;
0209 }
0210 
0211 void GeoDataNetworkLinkControl::setUpdate( const GeoDataUpdate &update )
0212 {
0213     Q_D(GeoDataNetworkLinkControl);
0214     d->m_update = update;
0215 }
0216 
0217 GeoDataAbstractView *GeoDataNetworkLinkControl::abstractView() const
0218 {
0219     Q_D(const GeoDataNetworkLinkControl);
0220     return d->m_abstractView;
0221 }
0222 
0223 void GeoDataNetworkLinkControl::setAbstractView( GeoDataAbstractView *abstractView )
0224 {
0225     Q_D(GeoDataNetworkLinkControl);
0226     d->m_abstractView = abstractView;
0227     d->m_abstractView->setParent( this );
0228 }
0229 
0230 }