QGIS API Documentation  3.14.0-Pi (9f7028fd23)
qgslayoutserializableobject.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgslayoutserializableobject.h
3  -----------------------------
4  begin : July 2017
5  copyright : (C) 2017 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 QGSLAYOUTSERIALIZABLEOBJECT_H
19 #define QGSLAYOUTSERIALIZABLEOBJECT_H
20 
21 #include "qgis_sip.h"
22 #include "qgis_core.h"
23 #include "qgslayoutundocommand.h"
24 
25 class QDomElement;
26 class QDomDocument;
29 
36 {
37  public:
38 
44  virtual QString stringType() const = 0;
45 
49  virtual QgsLayout *layout() = 0;
50 
55  virtual bool writeXml( QDomElement &parentElement, QDomDocument &document, const QgsReadWriteContext &context ) const = 0;
56 
61  virtual bool readXml( const QDomElement &element, const QDomDocument &document, const QgsReadWriteContext &context ) = 0;
62 
63  QgsAbstractLayoutUndoCommand *createCommand( const QString &text, int id, QUndoCommand *parent = nullptr ) override SIP_FACTORY;
64 
65  private:
66 
67  friend class QgsLayoutSerializableObjectUndoCommand;
68 
69 };
70 
71 #endif // QGSLAYOUTSERIALIZABLEOBJECT_H
QgsLayoutUndoObjectInterface::createCommand
virtual QgsAbstractLayoutUndoCommand * createCommand(const QString &text, int id=0, QUndoCommand *parent=nullptr)=0
Creates a new layout undo command with the specified text and parent.
QgsReadWriteContext
Definition: qgsreadwritecontext.h:34
SIP_FACTORY
#define SIP_FACTORY
Definition: qgis_sip.h:76
qgis_sip.h
qgslayoutundocommand.h
QgsLayoutUndoObjectInterface
Definition: qgslayoutundocommand.h:128
QgsLayoutSerializableObject
Definition: qgslayoutserializableobject.h:35
QgsAbstractLayoutUndoCommand
Definition: qgslayoutundocommand.h:34
QgsLayout
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.
Definition: qgslayout.h:49