QGIS API Documentation
3.16.0-Hannover (43b64b13f3)
|
Go to the documentation of this file.
18 #ifndef QGSLAYOUTUNDOCOMMAND_H
19 #define QGSLAYOUTUNDOCOMMAND_H
21 #include <QUndoCommand>
23 #include <QDomDocument>
25 #include "qgis_core.h"
47 int id()
const override {
return mId; }
54 void saveBeforeState();
61 void saveAfterState();
68 QDomDocument
beforeState()
const {
return mBeforeState.cloneNode().toDocument(); }
75 QDomDocument
afterState()
const {
return mAfterState.cloneNode().toDocument(); }
80 virtual bool containsChange()
const;
91 virtual void saveState( QDomDocument &stateDoc )
const = 0;
105 void setAfterState(
const QDomDocument &stateDoc );
108 bool mFirstRun =
true;
113 QDomDocument mBeforeState;
116 QDomDocument mAfterState;
147 #endif // QGSLAYOUTUNDOCOMMAND_H
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.
QDomDocument beforeState() const
Returns the before state for the layout.
virtual void saveState(QDomDocument &stateDoc) const =0
Saves the state of the object to the specified stateDoc.
virtual void restoreState(QDomDocument &stateDoc)=0
Restores the state of the object from the specified stateDoc.
QDomDocument afterState() const
Returns the after state for the layout.
virtual ~QgsLayoutUndoObjectInterface()=default
Destructor for QgsLayoutUndoObjectInterface.
Interface for layout objects which support undo/redo commands.
Base class for commands to undo/redo layout and layout object changes.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.