VCF::UndoRedoStack Class Reference
stack class managing any undo redo operation.
More...
#include <vcf/ApplicationKit/UndoRedoStack.h>
Inheritance diagram for VCF::UndoRedoStack:
List of all members.
Detailed Description
stack class managing any undo redo operation.
It is possible to bypass the default undo redo behaviour of this class, without deriving form this class, through the use of its UndoCommand and RedoCommand delegates.
Constructor & Destructor Documentation
| VCF::UndoRedoStack::UndoRedoStack |
( |
|
) |
|
|
| virtual VCF::UndoRedoStack::~UndoRedoStack |
( |
|
) |
[virtual] |
|
Member Function Documentation
| virtual void VCF::UndoRedoStack::addCommand |
( |
Command * |
command, |
|
|
const bool & |
autoExecute = true |
|
) |
[virtual] |
|
|
|
adds a command to the undo stack and clears the redo stack.
By default this also executes the command. - Parameters:
-
| Command* | command, the instance representing the action which is potentially undoable. bool& autoExecute, true if the operation needs also to be executed. This is the default.
fire event:: ExecuteCommand, only if autoExecute==true, after the command has been executed.
event class: UndoRedoEvent
event type: UNDOREDO_EVENT_EXECUTE.
fire event:: StackChanged, after the command has been added.
event class: UndoRedoEvent
event type: UNDOREDO_EVENT_STACK_CHANGED. |
|
| void VCF::UndoRedoStack::clearCommands |
( |
|
) |
|
|
|
|
clears both the undo/redo stacks.
fire event:: StackChanged, event before the stack is cleared.
event class: UndoRedoEvent
event type: UNDOREDO_EVENT_STACK_CHANGED. |
| virtual Command* VCF::UndoRedoStack::getCurrentRedoCommand |
( |
|
) |
[virtual] |
|
|
|
gets the first command to redo.
|
| virtual Command* VCF::UndoRedoStack::getCurrentUndoCommand |
( |
|
) |
[virtual] |
|
|
|
gets the first command to undo.
|
| virtual bool VCF::UndoRedoStack::hasRedoableItems |
( |
|
) |
[virtual] |
|
|
|
tells if there is any redo item in the stack.
|
| virtual bool VCF::UndoRedoStack::hasUndoableItems |
( |
|
) |
[virtual] |
|
|
|
tells if there is any undo item in the stack.
|
| void VCF::UndoRedoStack::movetToRedoStack |
( |
Command * |
command |
) |
[protected] |
|
| virtual void VCF::UndoRedoStack::redo |
( |
|
) |
[virtual] |
|
|
|
redoes the last command ( undoes the previous undo ).
this default behaviour can be bypassed.
fire event:: UndoCommand, before the default redo action is performed.
event class: UndoRedoEvent
event type: UNDOREDO_EVENT_REDO |
| virtual void VCF::UndoRedoStack::undo |
( |
|
) |
[virtual] |
|
|
|
undoes the last command.
this default behaviour can be bypassed.
fire event:: UndoCommand, before the default undo action is performed.
event class: UndoRedoEvent
event type: UNDOREDO_EVENT_UNDO |
Member Data Documentation
|
|
to be notified that a command has been executed.
In this case the user needs to add an event handler to this delegate, and setAllowsUndo(false) inside this handler. |
|
|
the undo and redo internal stacks.
|
The documentation for this class was generated from the following file: