#include <CSOUndoRedoManager.h>
Public Types | |
| enum | UNDO_MODE { MODE_UNDOING = 0, MODE_REDOING = 1, MODE_NORMAL = 2 } |
| The undo (and redo) modes. More... | |
Public Member Functions | |
| CSOUndoRedoManager () | |
| Constructor. | |
| ~CSOUndoRedoManager () | |
| Destructor. | |
| void | addCommand (CSOCommand *command) |
| Adds a command (modification). | |
| void | popUndoCommand () |
| Remove the last added undo command without executing it. | |
| void | undo () |
| Performs an undo of the last modification (if undo stack is not empty). | |
| void | redo () |
| Performs a redo (if the undo stack is not empty). | |
| void | clearUndo () |
| Clears the undo stack. | |
| void | clearRedo () |
| Clears the redo stack. | |
| void | clearAll () |
| Clears the undo and redo stack. | |
| void | pushUndoCommand (CSOCommand *command) |
| Pushes a command onto the undo stack. | |
| void | pushRedoCommand (CSOCommand *command) |
| Pushes a command onto the redo stack. | |
| bool | canUndo () const |
| Returns if there are possible undoes. | |
| bool | canRedo () const |
| Returns if there are possible redoes. | |
| int | maxNumUndos () const |
| Returns the maximum number of possible undos. If a -1 is returned, the undo stack has no limitation. | |
| void | setMaxNumUndos (int maxNumUndos) |
| Sets the maximum number of possible undos. If a -1 is passed, the undo stack has no limitation. | |
| int | numUndos () const |
| Returns the number of stored undo steps. | |
| int | numRedos () const |
| Returns the number of stored redo steps. | |
| bool | isInUndoMode () const |
| Returns if the manager is in undo-mode. | |
| bool | isInRedoMode () const |
| Returns if the manager is in redo-mode. | |
| void | enableUndoRedo () |
| Enables this undo/redo manager. | |
| void | disableUndoRedo () |
| Disables this undo/redo manager; if it is disabled, the incoming commands are deleted and not added. | |
| bool | isEnabled () |
| Returns if this undo/redo manager is currently enabled. | |
Definition at line 24 of file CSOUndoRedoManager.h.
The undo (and redo) modes.
| MODE_UNDOING | The manager is in undo-mode. |
| MODE_REDOING | The manager is in redo-mode. |
| MODE_NORMAL | The manager is no special mode and pushes commands onto the undo stack. |
Definition at line 30 of file CSOUndoRedoManager.h.
| ml::CSOUndoRedoManager::CSOUndoRedoManager | ( | ) |
Constructor.
| ml::CSOUndoRedoManager::~CSOUndoRedoManager | ( | ) |
Destructor.
| void ml::CSOUndoRedoManager::addCommand | ( | CSOCommand * | command | ) |
Adds a command (modification).
The inverse command is added to the undo stack while the command itself is added to the redo stack.
| bool ml::CSOUndoRedoManager::canRedo | ( | ) | const |
Returns if there are possible redoes.
| bool ml::CSOUndoRedoManager::canUndo | ( | ) | const |
Returns if there are possible undoes.
| void ml::CSOUndoRedoManager::clearAll | ( | ) |
Clears the undo and redo stack.
| void ml::CSOUndoRedoManager::clearRedo | ( | ) |
Clears the redo stack.
| void ml::CSOUndoRedoManager::clearUndo | ( | ) |
Clears the undo stack.
| void ml::CSOUndoRedoManager::disableUndoRedo | ( | ) | [inline] |
Disables this undo/redo manager; if it is disabled, the incoming commands are deleted and not added.
Definition at line 97 of file CSOUndoRedoManager.h.
| void ml::CSOUndoRedoManager::enableUndoRedo | ( | ) | [inline] |
| bool ml::CSOUndoRedoManager::isEnabled | ( | ) | [inline] |
Returns if this undo/redo manager is currently enabled.
Definition at line 100 of file CSOUndoRedoManager.h.
| bool ml::CSOUndoRedoManager::isInRedoMode | ( | ) | const |
Returns if the manager is in redo-mode.
| bool ml::CSOUndoRedoManager::isInUndoMode | ( | ) | const |
Returns if the manager is in undo-mode.
| int ml::CSOUndoRedoManager::maxNumUndos | ( | ) | const [inline] |
Returns the maximum number of possible undos. If a -1 is returned, the undo stack has no limitation.
Definition at line 78 of file CSOUndoRedoManager.h.
References ML_TRACE_IN.
| int ml::CSOUndoRedoManager::numRedos | ( | ) | const |
Returns the number of stored redo steps.
| int ml::CSOUndoRedoManager::numUndos | ( | ) | const |
Returns the number of stored undo steps.
| void ml::CSOUndoRedoManager::popUndoCommand | ( | ) |
Remove the last added undo command without executing it.
This could be useful if you temporary want to save a state of a CSOList in your C++ code.
| void ml::CSOUndoRedoManager::pushRedoCommand | ( | CSOCommand * | command | ) |
Pushes a command onto the redo stack.
| void ml::CSOUndoRedoManager::pushUndoCommand | ( | CSOCommand * | command | ) |
Pushes a command onto the undo stack.
| void ml::CSOUndoRedoManager::redo | ( | ) |
Performs a redo (if the undo stack is not empty).
| void ml::CSOUndoRedoManager::setMaxNumUndos | ( | int | maxNumUndos | ) |
Sets the maximum number of possible undos. If a -1 is passed, the undo stack has no limitation.
| void ml::CSOUndoRedoManager::undo | ( | ) |
Performs an undo of the last modification (if undo stack is not empty).
1.5.8