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

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2013 Mayank Madan <maddiemadan@gmail.com>
0004 //
0005 
0006 #include "GeoDataNetworkLink.h"
0007 
0008 #include "GeoDataTypes.h"
0009 #include "GeoDataLink.h"
0010 
0011 namespace Marble {
0012 
0013 class GeoDataNetworkLinkPrivate
0014 {
0015 public:
0016     bool m_refreshVisibility;
0017 
0018     bool m_flyToView;
0019 
0020     GeoDataLink m_link;
0021 
0022     GeoDataNetworkLinkPrivate();
0023 };
0024 
0025 GeoDataNetworkLinkPrivate::GeoDataNetworkLinkPrivate() :
0026     m_refreshVisibility(false), m_flyToView(false)
0027 {
0028     // nothing to do
0029 }
0030 
0031 GeoDataNetworkLink::GeoDataNetworkLink() : d( new GeoDataNetworkLinkPrivate )
0032 {
0033     // nothing to do
0034 }
0035 
0036 GeoDataNetworkLink::GeoDataNetworkLink( const Marble::GeoDataNetworkLink &other ) :
0037     GeoDataFeature( other ), d( new GeoDataNetworkLinkPrivate( *other.d ) )
0038 {
0039     // nothing to do
0040 }
0041 
0042 GeoDataNetworkLink &GeoDataNetworkLink::operator=( const GeoDataNetworkLink &other )
0043 {
0044     GeoDataFeature::operator=( other );
0045     *d = *other.d;
0046     return *this;
0047 }
0048 
0049 bool GeoDataNetworkLink::operator==( const GeoDataNetworkLink &other ) const
0050 {
0051     return equals( other) &&
0052            d->m_refreshVisibility == other.d->m_refreshVisibility &&
0053            d->m_link == other.d->m_link &&
0054            d->m_flyToView == other.d->m_flyToView;
0055 }
0056 
0057 bool GeoDataNetworkLink::operator!=( const GeoDataNetworkLink &other ) const
0058 {
0059     return !this->operator==( other );
0060 }
0061 
0062 GeoDataNetworkLink::~GeoDataNetworkLink()
0063 {
0064     delete d;
0065 }
0066 
0067 GeoDataFeature * GeoDataNetworkLink::clone() const
0068 {
0069     return new GeoDataNetworkLink(*this);
0070 }
0071 
0072 
0073 const char *GeoDataNetworkLink::nodeType() const
0074 {
0075     return GeoDataTypes::GeoDataNetworkLinkType;
0076 }
0077 
0078 bool GeoDataNetworkLink::refreshVisibility() const
0079 {
0080     return d->m_refreshVisibility;
0081 }
0082 
0083 void GeoDataNetworkLink::setRefreshVisibility( bool refreshVisibility )
0084 {
0085     d->m_refreshVisibility = refreshVisibility;
0086 }
0087 
0088 bool GeoDataNetworkLink::flyToView() const
0089 {
0090     return d->m_flyToView;
0091 }
0092 
0093 void GeoDataNetworkLink::setFlyToView( bool flyToView)
0094 {
0095     d->m_flyToView = flyToView;
0096 }
0097 
0098 GeoDataLink &GeoDataNetworkLink::link()
0099 {
0100     return d->m_link;
0101 }
0102 
0103 const GeoDataLink& GeoDataNetworkLink::link() const
0104 {
0105     return d->m_link;
0106 }
0107 
0108 void GeoDataNetworkLink::setLink(const GeoDataLink &link)
0109 {
0110     d->m_link = link;
0111 }
0112 
0113 }