1/************************************************************************ 2 * This file has been generated automatically from * 3 * * 4 * src/core/layout/qgslayoutundostack.h * 5 * * 6 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 7 ************************************************************************/ 8 9 10 11 12 13 14class QgsLayoutUndoStack : QObject 15{ 16%Docstring(signature="appended") 17An undo stack for :py:class:`QgsLayouts`. 18 19.. versionadded:: 3.0 20%End 21 22%TypeHeaderCode 23#include "qgslayoutundostack.h" 24%End 25 public: 26 27 QgsLayoutUndoStack( QgsLayout *layout ); 28%Docstring 29Constructor for QgsLayoutUndoStack, for the specified parent ``layout``. 30%End 31 32 void beginMacro( const QString &commandText ); 33%Docstring 34Starts a macro command, with the given descriptive ``commandText``. 35 36Any commands added to the stack (either via direct manipulation of 37:py:func:`~QgsLayoutUndoStack.stack` or via :py:func:`~QgsLayoutUndoStack.beginCommand`/:py:func:`~QgsLayoutUndoStack.endCommand` calls) between a 38:py:func:`~QgsLayoutUndoStack.beginMacro` and :py:func:`~QgsLayoutUndoStack.endMacro` block are collapsed into a single 39undo command, which will be applied or rolled back in a single step. 40 41.. seealso:: :py:func:`endMacro` 42%End 43 44 void endMacro(); 45%Docstring 46Ends a macro command. This must be called after :py:func:`~QgsLayoutUndoStack.beginMacro`, when 47all child undo commands which form part of the macro have been completed. 48 49Any commands added to the stack (either via direct manipulation of 50:py:func:`~QgsLayoutUndoStack.stack` or via :py:func:`~QgsLayoutUndoStack.beginCommand`/:py:func:`~QgsLayoutUndoStack.endCommand` calls) between a 51:py:func:`~QgsLayoutUndoStack.beginMacro` and :py:func:`~QgsLayoutUndoStack.endMacro` block are collapsed into a single 52undo command, which will be applied or rolled back in a single step. 53 54.. seealso:: :py:func:`beginMacro` 55%End 56 57 void beginCommand( QgsLayoutUndoObjectInterface *object, const QString &commandText, int id = 0 ); 58%Docstring 59Begins a new undo command for the specified ``object``. 60 61This must be followed by a call to :py:func:`~QgsLayoutUndoStack.endCommand` or :py:func:`~QgsLayoutUndoStack.cancelCommand` after the desired changes 62have been made to ``object``. 63 64The ``id`` argument can be used to specify an id number for the source event - this is used to determine whether QUndoCommand 65command compression can apply to the command. 66 67.. seealso:: :py:func:`endCommand` 68 69.. seealso:: :py:func:`cancelCommand` 70%End 71 72 void endCommand(); 73%Docstring 74Saves final state of an object and pushes the active command to the undo history. 75 76.. seealso:: :py:func:`beginCommand` 77 78.. seealso:: :py:func:`cancelCommand` 79%End 80 81 void cancelCommand(); 82%Docstring 83Cancels the active command, discarding it without pushing to the undo history. 84 85.. seealso:: :py:func:`endCommand` 86 87.. seealso:: :py:func:`cancelCommand` 88%End 89 90 QUndoStack *stack(); 91%Docstring 92Returns a pointer to the internal QUndoStack. 93%End 94 95 void notifyUndoRedoOccurred( QgsLayoutItem *item ); 96%Docstring 97Notifies the stack that an undo or redo action occurred for a specified ``item``. 98%End 99 100 void blockCommands( bool blocked ); 101%Docstring 102Sets whether undo commands for the layout should be temporarily blocked. 103 104If ``blocked`` is ``True``, subsequent undo commands will be blocked until a follow-up 105call to blockCommands( ``False`` ) is made. 106 107Note that calls to blockCommands are stacked, so two calls blocking the commands 108will take two calls unblocking commands in order to release the block. 109 110.. seealso:: :py:func:`isBlocked` 111%End 112 113 bool isBlocked() const; 114%Docstring 115Returns ``True`` if undo commands are currently blocked. 116 117.. seealso:: :py:func:`blockCommands` 118%End 119 120 void push( QUndoCommand *command /Transfer/ ); 121%Docstring 122Manually pushes a ``command`` to the stack, and takes ownership of the command. 123%End 124 125 signals: 126 127 void undoRedoOccurredForItems( QSet< QString > itemUuids ); 128%Docstring 129Emitted when an undo or redo action has occurred, which affected a 130set of layout ``itemUuids``. 131%End 132 133 private: 134 QgsLayoutUndoStack( const QgsLayoutUndoStack &other ); 135}; 136 137/************************************************************************ 138 * This file has been generated automatically from * 139 * * 140 * src/core/layout/qgslayoutundostack.h * 141 * * 142 * Do not edit manually ! Edit header and run scripts/sipify.pl again * 143 ************************************************************************/ 144