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;
100 virtual void restoreState( QDomDocument &stateDoc ) = 0;
105 void setAfterState(
const QDomDocument &stateDoc );
108 bool mFirstRun =
true;
113 QDomDocument mBeforeState;
116 QDomDocument mAfterState;
147 #endif // QGSLAYOUTUNDOCOMMAND_H
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.
Interface for layout objects which support undo/redo commands.
QDomDocument afterState() const
Returns the after state for the layout.
QDomDocument beforeState() const
Returns the before state for the layout.