QGIS API Documentation 4.1.0-Master (60fea48833c)
Loading...
Searching...
No Matches
qgsprojectmetadata.h
Go to the documentation of this file.
1/***************************************************************************
2 qgsprojectmetadata.h
3 -------------------
4 begin : March 2018
5 copyright : (C) 2018 by Nyall Dawson
6 email : nyall dot dawson at gmail dot com
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef QGSPROJECTMETADATA_H
19#define QGSPROJECTMETADATA_H
20
21#include "qgis_core.h"
22#include "qgis_sip.h"
24
25#include <QDateTime>
26
54{
55 public:
56 QgsProjectMetadata() = default;
57
58 QgsProjectMetadata *clone() const override SIP_FACTORY;
59
64 QString author() const;
65
70 void setAuthor( const QString &author );
71
76 QDateTime creationDateTime() const;
77
82 void setCreationDateTime( const QDateTime &creationDateTime );
83
84 bool readMetadataXml( const QDomElement &metadataElement, const QgsReadWriteContext &context = QgsReadWriteContext() ) override;
85 bool writeMetadataXml( QDomElement &metadataElement, QDomDocument &document, const QgsReadWriteContext &context = QgsReadWriteContext() ) const override;
86 void combine( const QgsAbstractMetadataBase *other ) override;
87 void registerTranslations( QgsTranslationContext *translationContext ) const override;
88
89 bool operator==( const QgsProjectMetadata &metadataOther ) const;
90
91 private:
92 /*
93 * IMPORTANT!!!!!!
94 *
95 * Do NOT add anything to this class without also updating the schema
96 * definition located at resources/qgis-resource-metadata.xsd
97 *
98 */
99
100 QString mAuthor;
101
102 /*
103 * IMPORTANT!!!!!!
104 *
105 * Do NOT add anything to this class without also updating the schema
106 * definition located at resources/qgis-resource-metadata.xsd
107 *
108 */
109};
110
111
112#endif // QGSPROJECTMETADATA_H
QgsAbstractMetadataBase()=default
Constructor for QgsAbstractMetadataBase.
virtual QgsAbstractMetadataBase * clone() const =0
Clones the metadata object.
void registerTranslations(QgsTranslationContext *translationContext) const override
Registers metadata translation strings.
QString author() const
Returns the project author string.
bool readMetadataXml(const QDomElement &metadataElement, const QgsReadWriteContext &context=QgsReadWriteContext()) override
Sets state from DOM document.
bool writeMetadataXml(QDomElement &metadataElement, QDomDocument &document, const QgsReadWriteContext &context=QgsReadWriteContext()) const override
Stores state in a DOM node.
QgsProjectMetadata()=default
void combine(const QgsAbstractMetadataBase *other) override
Combines the metadata from this object with the metadata from an other object.
void setCreationDateTime(const QDateTime &creationDateTime)
Sets the project's creation date/timestamp.
void setAuthor(const QString &author)
Sets the project author string.
QDateTime creationDateTime() const
Returns the project's creation date/timestamp.
A container for the context for various read/write operations on objects.
Used for the collecting of strings from projects for translation and creation of ts files.
#define SIP_FACTORY
Definition qgis_sip.h:83