20#ifndef LIBREPCB_EDITOR_UNDOSTACK_H
21#define LIBREPCB_EDITOR_UNDOSTACK_H
35class UndoCommandGroup;
130 QString getUndoText() const noexcept;
136 QString getRedoText() const noexcept;
142 bool canUndo() const noexcept;
148 bool canRedo() const noexcept;
158 uint getUniqueStateId() const noexcept;
170 bool isClean() const noexcept;
178 bool isCommandGroupActive() const noexcept;
185 void setClean() noexcept;
212 bool execCmd(
UndoCommand* cmd,
bool forceKeepCmd = false);
225 void beginCmdGroup(const QString& text);
253 bool commitCmdGroup();
261 void abortCmdGroup();
291 void clear() noexcept;
294 void undoTextChanged(const QString& text);
295 void redoTextChanged(const QString& text);
296 void canUndoChanged(
bool canUndo);
297 void canRedoChanged(
bool canRedo);
298 void cleanChanged(
bool clean);
299 void commandGroupEnded();
300 void commandGroupAborted();
301 void stateModified();
The UndoCommandGroup class makes it possible to pack multiple undo commands together (it acts as a pa...
Definition undocommandgroup.h:44
The UndoCommand class represents a command which you can undo/redo.
Definition undocommand.h:46
The UndoStack class holds UndoCommand objects and provides undo/redo commands.
Definition undostack.h:106
UndoStack(const UndoStack &other)=delete
UndoStack & operator=(const UndoStack &rhs)=delete
The UndoStackTransaction class helps to execute transactions on an UndoStack.
Definition undostack.h:56
void append(UndoCommand *cmd)
Definition undostack.cpp:58
UndoStack & mStack
Definition undostack.h:73
~UndoStackTransaction() noexcept
Definition undostack.cpp:49
UndoStackTransaction()=delete
bool mCmdActive
Definition undostack.h:74
void abort()
Definition undostack.cpp:63
UndoStackTransaction(const UndoStackTransaction &other)=delete
bool commit()
Definition undostack.cpp:69
Definition occmodel.cpp:76