File indexing completed on 2025-01-05 03:59:00
0001 // SPDX-License-Identifier: LGPL-2.1-or-later 0002 // 0003 // SPDX-FileCopyrightText: 2014 Abhinav Gangwar <abhgang@gmail.com> 0004 // 0005 0006 #ifndef MARBLE_GEODATASCHEMADATA_H 0007 #define MARBLE_GEODATASCHEMADATA_H 0008 0009 // Qt 0010 #include <QList> 0011 0012 // Marble 0013 #include "GeoDocument.h" 0014 0015 #include "digikam_export.h" 0016 0017 namespace Marble 0018 { 0019 0020 class GeoDataExtendedData; 0021 class GeoDataSchemaDataPrivate; 0022 class GeoDataSimpleData; 0023 0024 /** 0025 */ 0026 class DIGIKAM_EXPORT GeoDataSchemaData : public GeoNode 0027 { 0028 public: 0029 GeoDataSchemaData(); 0030 GeoDataSchemaData( const GeoDataSchemaData& other ); 0031 GeoDataSchemaData& operator=( const GeoDataSchemaData& rhs ); 0032 bool operator==( const GeoDataSchemaData &other ) const; 0033 bool operator!=( const GeoDataSchemaData &other ) const; 0034 ~GeoDataSchemaData() override; 0035 0036 /* 0037 * @brief Returns the id for schema which defines custom data 0038 */ 0039 QString schemaUrl() const; 0040 0041 /* 0042 * @brief Set the schemaUrl attribute of SchemaData to @p schemaUrl 0043 */ 0044 void setSchemaUrl( const QString& schemaUrl ); 0045 0046 /* 0047 * @brief Returns the SimpleData having name attribute @p name 0048 */ 0049 GeoDataSimpleData& simpleData( const QString& name ) const; 0050 0051 /* 0052 * @brief Adds a SimpleData @p simpleData to schemaDataHash 0053 */ 0054 void addSimpleData( const GeoDataSimpleData& simpleData ); 0055 0056 /* 0057 * @brief Dump a list containing all SimpleData values stored in schemaDataHash 0058 */ 0059 QList<GeoDataSimpleData> simpleDataList() const; 0060 0061 /* 0062 * @brief Set the parent @parent 0063 */ 0064 void setParent(GeoDataExtendedData *parent); 0065 0066 /* 0067 * @brief Get the parent 0068 */ 0069 const GeoDataExtendedData *parent() const; 0070 GeoDataExtendedData *parent(); 0071 0072 /* 0073 * @brief Provides information for downcasting a GeoNode 0074 */ 0075 const char* nodeType() const override; 0076 0077 /* 0078 * @brief Serialize SchemaData to a stream @p stream 0079 */ 0080 virtual void pack( QDataStream& stream ) const; 0081 0082 /* 0083 * @brief Unserialize SchemaData from a stream @p stream 0084 */ 0085 virtual void unpack( QDataStream& stream ); 0086 0087 private: 0088 GeoDataSchemaDataPrivate * const d; 0089 }; 0090 0091 } // namespace Marble 0092 0093 #endif // MARBLE_GEODATASCHEMADATA_H