File indexing completed on 2025-01-05 03:58:54
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2010 Harshit Jain <hjain.itbhu@gmail.com> 0004 // 0005 0006 #ifndef MARBLE_GEODATADATA_H 0007 #define MARBLE_GEODATADATA_H 0008 0009 #include "GeoDataObject.h" 0010 0011 #include "digikam_export.h" 0012 0013 class QVariant; 0014 0015 namespace Marble 0016 { 0017 0018 class GeoDataDataPrivate; 0019 0020 /** 0021 */ 0022 class DIGIKAM_EXPORT GeoDataData : public GeoDataObject 0023 { 0024 public: 0025 GeoDataData(); 0026 0027 /** Convenience constructor that sets name and value directly */ 0028 GeoDataData( const QString &name, const QVariant &value ); 0029 0030 GeoDataData( const GeoDataData& other ); 0031 bool operator==( const GeoDataData& other ) const; 0032 bool operator!=( const GeoDataData& other ) const; 0033 ~GeoDataData() override; 0034 0035 /** 0036 * @brief assignment operator 0037 */ 0038 GeoDataData& operator=( const GeoDataData& other ); 0039 0040 /// Provides type information for downcasting a GeoData 0041 const char* nodeType() const override; 0042 0043 /** 0044 * @brief return a reference to the value of data; 0045 */ 0046 QVariant& valueRef(); 0047 const QVariant& valueRef() const; 0048 0049 /** 0050 * @brief return the value of data 0051 */ 0052 QVariant value() const; 0053 0054 /** 0055 * @brief set the value of data 0056 * @param value the value to be set 0057 */ 0058 void setValue( const QVariant& value ); 0059 0060 /** 0061 * @brief return the name of data 0062 */ 0063 QString name() const; 0064 0065 /** 0066 * @brief set the name of data 0067 * @param name the name to be set 0068 */ 0069 void setName( const QString& name ); 0070 0071 /** 0072 * @brief return the displayName of data 0073 */ 0074 QString displayName() const; 0075 0076 /** 0077 * @brief set the displayName of data 0078 * @param displayName the displayName to be set 0079 */ 0080 void setDisplayName( const QString& displayName ); 0081 0082 /// Serialize the contents of the feature to @p stream. 0083 void pack( QDataStream& stream ) const override; 0084 0085 /// Unserialize the contents of the feature from @p stream. 0086 void unpack( QDataStream& stream ) override; 0087 0088 private: 0089 GeoDataDataPrivate * const d; 0090 }; 0091 0092 } 0093 0094 #endif //MARBLE_GEODATADATA_H