18#ifndef QGSLAYOUTITEMUNDOCOMMAND_H
19#define QGSLAYOUTITEMUNDOCOMMAND_H
52 QgsLayoutItemUndoCommand( QgsLayoutItem *item,
const QString &text,
int id = 0, QUndoCommand *parent
SIP_TRANSFERTHIS =
nullptr );
54 bool mergeWith(
const QUndoCommand *command )
override;
59 QgsLayout *layout()
const;
65 QString itemUuid()
const;
69 void saveState( QDomDocument &stateDoc )
const override;
72 virtual QgsLayoutItem *recreateItem(
int itemType, QgsLayout *layout );
77 QgsLayout *mLayout =
nullptr;
91class CORE_EXPORT QgsLayoutItemDeleteUndoCommand:
public QgsLayoutItemUndoCommand
102 QgsLayoutItemDeleteUndoCommand( QgsLayoutItem *item,
const QString &text,
int id = 0, QUndoCommand *parent
SIP_TRANSFERTHIS =
nullptr );
103 bool mergeWith(
const QUndoCommand *command )
override;
104 void redo()
override;
118class CORE_EXPORT QgsLayoutItemAddItemCommand:
public QgsLayoutItemUndoCommand
129 QgsLayoutItemAddItemCommand( QgsLayoutItem *item,
const QString &text,
int id = 0, QUndoCommand *parent
SIP_TRANSFERTHIS =
nullptr );
131 bool mergeWith(
const QUndoCommand *command )
override;
132 void undo()
override;
Base class for commands to undo/redo layout and layout object changes.
virtual bool containsChange() const
Returns true if both the before and after states are valid and different.
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.
Base class for graphical items within a QgsLayout.
Base class for layouts, which can contain items such as maps, labels, scalebars, etc.