File indexing completed on 2025-01-05 03:58:57
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com> 0004 // SPDX-FileCopyrightText: 2013 Sanjiban Bairagya <sanjiban22393@gmail.com> 0005 // 0006 0007 #include "GeoDataLink.h" 0008 #include "GeoDataTypes.h" 0009 0010 namespace Marble { 0011 0012 class GeoDataLinkPrivate 0013 { 0014 public: 0015 QString m_href; 0016 GeoDataLink::RefreshMode m_refreshMode; 0017 qreal m_refreshInterval; 0018 GeoDataLink::ViewRefreshMode m_viewRefreshMode; 0019 qreal m_viewRefreshTime; 0020 qreal m_viewBoundScale; 0021 QString m_viewFormat; 0022 QString m_httpQuery; 0023 0024 GeoDataLinkPrivate(); 0025 }; 0026 0027 GeoDataLinkPrivate::GeoDataLinkPrivate() : 0028 m_href(), 0029 m_refreshMode(GeoDataLink::OnChange), 0030 m_refreshInterval(4.0), 0031 m_viewRefreshMode(GeoDataLink::Never), 0032 m_viewRefreshTime(4.0), 0033 m_viewBoundScale(1.0), 0034 m_viewFormat(QLatin1String("BBOX=[bboxWest],[bboxSouth],[bboxEast],[bboxNorth]")), 0035 m_httpQuery() 0036 { 0037 // nothing to do 0038 } 0039 0040 GeoDataLink::GeoDataLink() : d( new GeoDataLinkPrivate ) 0041 { 0042 // nothing to do 0043 } 0044 0045 GeoDataLink::GeoDataLink( const Marble::GeoDataLink &other ) : 0046 GeoDataObject( other ), d( new GeoDataLinkPrivate( *other.d ) ) 0047 { 0048 // nothing to do 0049 } 0050 0051 GeoDataLink &GeoDataLink::operator=( const GeoDataLink &other ) 0052 { 0053 GeoDataObject::operator=( other ); 0054 *d = *other.d; 0055 return *this; 0056 } 0057 0058 bool GeoDataLink::operator==( const GeoDataLink& other ) const 0059 { 0060 return equals(other) && 0061 d->m_href == other.d->m_href && 0062 d->m_refreshMode == other.d->m_refreshMode && 0063 d->m_refreshInterval == other.d->m_refreshInterval && 0064 d->m_viewRefreshMode == other.d->m_viewRefreshMode && 0065 d->m_viewRefreshTime == other.d->m_viewRefreshTime && 0066 d->m_viewBoundScale == other.d->m_viewBoundScale && 0067 d->m_viewFormat == other.d->m_viewFormat && 0068 d->m_httpQuery == other.d->m_httpQuery; 0069 } 0070 0071 bool GeoDataLink::operator!=( const GeoDataLink& other ) const 0072 { 0073 return !this->operator==(other); 0074 } 0075 0076 GeoDataLink::~GeoDataLink() 0077 { 0078 delete d; 0079 } 0080 0081 const char *GeoDataLink::nodeType() const 0082 { 0083 return GeoDataTypes::GeoDataLinkType; 0084 } 0085 0086 QString GeoDataLink::href() const 0087 { 0088 return d->m_href; 0089 } 0090 0091 void GeoDataLink::setHref( const QString& href ) 0092 { 0093 d->m_href = href; 0094 } 0095 0096 GeoDataLink::RefreshMode GeoDataLink::refreshMode() const 0097 { 0098 return d->m_refreshMode; 0099 } 0100 0101 void GeoDataLink::setRefreshMode(RefreshMode refreshMode ) 0102 { 0103 d->m_refreshMode = refreshMode; 0104 } 0105 0106 qreal GeoDataLink::refreshInterval() const 0107 { 0108 return d->m_refreshInterval; 0109 } 0110 0111 void GeoDataLink::setRefreshInterval( qreal refreshInterval) 0112 { 0113 d->m_refreshInterval = refreshInterval; 0114 } 0115 0116 GeoDataLink::ViewRefreshMode GeoDataLink::viewRefreshMode() const 0117 { 0118 return d->m_viewRefreshMode; 0119 } 0120 0121 void GeoDataLink::setViewRefreshMode(ViewRefreshMode viewRefreshMode) 0122 { 0123 d->m_viewRefreshMode = viewRefreshMode; 0124 } 0125 0126 qreal GeoDataLink::viewRefreshTime() const 0127 { 0128 return d->m_viewRefreshTime; 0129 } 0130 0131 void GeoDataLink::setViewRefreshTime(qreal viewRefreshTime) 0132 { 0133 d->m_viewRefreshTime = viewRefreshTime; 0134 } 0135 0136 qreal GeoDataLink::viewBoundScale() const 0137 { 0138 return d->m_viewBoundScale; 0139 } 0140 0141 void GeoDataLink::setViewBoundScale(qreal viewBoundScale) 0142 { 0143 d->m_viewBoundScale = viewBoundScale; 0144 } 0145 0146 QString GeoDataLink::viewFormat() const 0147 { 0148 return d->m_viewFormat; 0149 } 0150 0151 void GeoDataLink::setViewFormat(const QString &viewFormat) 0152 { 0153 d->m_viewFormat = viewFormat; 0154 } 0155 0156 QString GeoDataLink::httpQuery() const 0157 { 0158 return d->m_httpQuery; 0159 } 0160 void GeoDataLink::setHttpQuery(const QString &httpQuery) 0161 { 0162 d->m_httpQuery = httpQuery; 0163 } 0164 0165 }