File indexing completed on 2024-05-12 03:50:15

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     return GeoDataTypes::GeoDataNetworkLinkControlType;
0088 }
0089 
0090 qreal GeoDataNetworkLinkControl::minRefreshPeriod() const
0091 {
0092     Q_D(const GeoDataNetworkLinkControl);
0093     return d->m_minRefreshPeriod;
0094 }
0095 
0096 void GeoDataNetworkLinkControl::setMinRefreshPeriod(qreal minRefreshPeriod )
0097 {
0098     Q_D(GeoDataNetworkLinkControl);
0099     d->m_minRefreshPeriod = minRefreshPeriod;
0100 }
0101 
0102 qreal GeoDataNetworkLinkControl::maxSessionLength() const
0103 {
0104     Q_D(const GeoDataNetworkLinkControl);
0105     return d->m_maxSessionLength;
0106 }
0107 
0108 void GeoDataNetworkLinkControl::setMaxSessionLength(qreal maxSessionLength)
0109 {
0110     Q_D(GeoDataNetworkLinkControl);
0111     d->m_maxSessionLength = maxSessionLength;
0112 }
0113 
0114 QString GeoDataNetworkLinkControl::cookie() const
0115 {
0116     Q_D(const GeoDataNetworkLinkControl);
0117     return d->m_cookie;
0118 }
0119 
0120 void GeoDataNetworkLinkControl::setCookie( const QString &cookie )
0121 {
0122     Q_D(GeoDataNetworkLinkControl);
0123     d->m_cookie = cookie;
0124 }
0125 
0126 QString GeoDataNetworkLinkControl::message() const
0127 {
0128     Q_D(const GeoDataNetworkLinkControl);
0129     return d->m_message;
0130 }
0131 
0132 void GeoDataNetworkLinkControl::setMessage( const QString &message )
0133 {
0134     Q_D(GeoDataNetworkLinkControl);
0135     d->m_message = message;
0136 }
0137 
0138 QString GeoDataNetworkLinkControl::linkName() const
0139 {
0140     Q_D(const GeoDataNetworkLinkControl);
0141     return d->m_linkName;
0142 }
0143 
0144 void GeoDataNetworkLinkControl::setLinkName( const QString &linkName )
0145 {
0146     Q_D(GeoDataNetworkLinkControl);
0147     d->m_linkName = linkName;
0148 }
0149 
0150 QString GeoDataNetworkLinkControl::linkDescription() const
0151 {
0152     Q_D(const GeoDataNetworkLinkControl);
0153     return d->m_linkDescription;
0154 }
0155 
0156 void GeoDataNetworkLinkControl::setLinkDescription( const QString &linkDescription )
0157 {
0158     Q_D(GeoDataNetworkLinkControl);
0159     d->m_linkDescription = linkDescription;
0160 }
0161 
0162 QString GeoDataNetworkLinkControl::linkSnippet() const
0163 {
0164     Q_D(const GeoDataNetworkLinkControl);
0165     return d->m_linkSnippet;
0166 }
0167 
0168 void GeoDataNetworkLinkControl::setLinkSnippet( const QString &linkSnippet )
0169 {
0170     Q_D(GeoDataNetworkLinkControl);
0171     d->m_linkSnippet = linkSnippet;
0172 }
0173 
0174 int GeoDataNetworkLinkControl::maxLines() const
0175 {
0176     Q_D(const GeoDataNetworkLinkControl);
0177     return d->m_maxLines;
0178 }
0179 
0180 void GeoDataNetworkLinkControl::setMaxLines(int maxLines)
0181 {
0182     Q_D(GeoDataNetworkLinkControl);
0183     d->m_maxLines = maxLines;
0184 }
0185 
0186 QDateTime GeoDataNetworkLinkControl::expires() const
0187 {
0188     Q_D(const GeoDataNetworkLinkControl);
0189     return d->m_expires;
0190 }
0191 
0192 void GeoDataNetworkLinkControl::setExpires( const QDateTime &expires )
0193 {
0194     Q_D(GeoDataNetworkLinkControl);
0195     d->m_expires = expires;
0196 }
0197 
0198 GeoDataUpdate &GeoDataNetworkLinkControl::update()
0199 {
0200     Q_D(GeoDataNetworkLinkControl);
0201     return d->m_update;
0202 }
0203 
0204 const GeoDataUpdate& GeoDataNetworkLinkControl::update() const
0205 {
0206     Q_D(const GeoDataNetworkLinkControl);
0207     return d->m_update;
0208 }
0209 
0210 void GeoDataNetworkLinkControl::setUpdate( const GeoDataUpdate &update )
0211 {
0212     Q_D(GeoDataNetworkLinkControl);
0213     d->m_update = update;
0214 }
0215 
0216 GeoDataAbstractView *GeoDataNetworkLinkControl::abstractView() const
0217 {
0218     Q_D(const GeoDataNetworkLinkControl);
0219     return d->m_abstractView;
0220 }
0221 
0222 void GeoDataNetworkLinkControl::setAbstractView( GeoDataAbstractView *abstractView )
0223 {
0224     Q_D(GeoDataNetworkLinkControl);
0225     d->m_abstractView = abstractView;
0226     d->m_abstractView->setParent( this );
0227 }
0228 
0229 }