File indexing completed on 2024-05-19 03:51:50

0001 /*
0002     SPDX-FileCopyrightText: 2008 Torsten Rahn <rahn@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #include "GeoSceneProperty.h"
0008 
0009 #include "MarbleDebug.h"
0010 #include "GeoSceneTypes.h"
0011 
0012 namespace Marble
0013 {
0014 
0015 GeoSceneProperty::GeoSceneProperty( const QString& name )
0016     : m_name( name ),
0017       m_available( false ),
0018       m_defaultValue( false ),
0019       m_value( false )
0020 {
0021 }
0022  
0023 const char* GeoSceneProperty::nodeType() const
0024 {
0025     return GeoSceneTypes::GeoScenePropertyType;
0026 }
0027 
0028 QString GeoSceneProperty::name() const
0029 {
0030     return m_name;
0031 }
0032 
0033 bool GeoSceneProperty::available() const
0034 {
0035     return m_available;
0036 }
0037 
0038 void GeoSceneProperty::setAvailable( bool available )
0039 {
0040     m_available = available;
0041 }
0042 
0043 bool GeoSceneProperty::defaultValue() const
0044 {
0045     return m_defaultValue;
0046 }
0047 
0048 void GeoSceneProperty::setDefaultValue( bool defaultValue )
0049 {
0050     m_defaultValue = defaultValue;
0051     setValue( defaultValue );
0052 }
0053 
0054 bool GeoSceneProperty::value() const
0055 {
0056     return m_value;
0057 }
0058 
0059 void GeoSceneProperty::setValue( bool value )
0060 {
0061     if ( m_value == value ) 
0062         return;
0063 
0064     m_value = value;
0065 //    mDebug() << "GeoSceneProperty: Setting " << m_name << "to" << m_value; 
0066     emit valueChanged( m_name, m_value );
0067 }
0068 
0069 }
0070 
0071 #include "moc_GeoSceneProperty.cpp"