20#ifndef LIBREPCB_EDITOR_UNDOCOMMAND_H
21#define LIBREPCB_EDITOR_UNDOCOMMAND_H
91 virtual
void undo() final;
96 virtual
void redo() final;
The UndoCommand class represents a command which you can undo/redo.
Definition: undocommand.h:46
virtual void undo() final
Undo the command.
Definition: undocommand.cpp:63
virtual bool performExecute()=0
Execute the command the first time.
virtual ~UndoCommand() noexcept
Definition: undocommand.cpp:43
int mUndoCount
Counter of how often undo() was called.
Definition: undocommand.h:134
bool wasEverReverted() const noexcept
This method shows whether that command was ever reverted (undo() called at least one time)
Definition: undocommand.h:69
UndoCommand(const UndoCommand &other)=delete
bool wasEverExecuted() const noexcept
This method shows whether that command was ever executed (execute() called successfully)
Definition: undocommand.h:63
QString mText
Definition: undocommand.h:131
int mRedoCount
Counter of how often redo() was called.
Definition: undocommand.h:133
virtual void performRedo()=0
Redo the command.
virtual void redo() final
Redo the command.
Definition: undocommand.cpp:72
virtual void performUndo()=0
Undo the command.
virtual bool execute() final
Execute the command (must only be called once)
Definition: undocommand.cpp:51
const QString & getText() const noexcept
Definition: undocommand.h:57
bool mIsExecuted
Shows whether execute() was called or not.
Definition: undocommand.h:132
bool isCurrentlyExecuted() const noexcept
This method shows whether that command is currently executed (redo() called one time more than undo()...
Definition: undocommand.h:75
Definition: occmodel.cpp:77