casa
$Rev:20696$
|
Contains an list of performed actions and a list of undone actions. More...
#include <TBAction.h>
Public Member Functions | |
TBActionList () | |
Default Constructor to initialize the empty lists. | |
~TBActionList () | |
bool | isEmpty () |
Returns true if the performed list is empty, false otherwise. | |
bool | undoneIsEmpty () |
Returns true if the undone list is empty, false otherwise. | |
int | size () |
Returns the size of the performed list. | |
int | undoneSize () |
Returns the size of the undone list. | |
String | lastActionName () |
Returns the name() value of the last performed action, or blank if there is none. | |
String | lastUndoneActionName () |
Returns the name() value of the last undone action, or blank if there is none. | |
TBAction * | at (unsigned int i) |
Returns the performed action at the designated index, or NULL if the index is invalid. | |
TBAction * | undoneAt (unsigned int i) |
Returns the undone action at the designated index, or NULL if the index is invalid. | |
Result | doAction (TBAction *action) |
Adds the given TBAction to the performed list and calls the action's doAction() method. | |
Result | undoAction () |
Moves the latest performed action to the undone list and calls the action's undoAction() method. | |
Result | redoAction () |
Moves the latest undone action to the performed list and calls the action's doAction() method. | |
bool | remove (TBAction *a) |
Removes the given action from the performed list, but does not delete it. | |
bool | removeUndone (TBAction *a) |
Removes the given action from the undone list, but does not delete it. | |
Private Attributes | |
vector< TBAction * > | actions |
Performed actions list. | |
vector< TBAction * > | undone |
Undone actions list. |
Contains an list of performed actions and a list of undone actions.
A TBActionList keep track of performed and undone actions and provides methods to add and move actions between the two lists. The lists have a maximum length defined by TBConstants::MAX_ACTION_BUFFER; once this limit has been reached, old actions are discarded.
Definition at line 114 of file TBAction.h.
Default Constructor to initialize the empty lists.
TBAction* casa::TBActionList::at | ( | unsigned int | i | ) |
Returns the performed action at the designated index, or NULL if the index is invalid.
Result casa::TBActionList::doAction | ( | TBAction * | action | ) |
Adds the given TBAction to the performed list and calls the action's doAction() method.
bool casa::TBActionList::isEmpty | ( | ) |
Returns true if the performed list is empty, false otherwise.
Returns the name() value of the last performed action, or blank if there is none.
Returns the name() value of the last undone action, or blank if there is none.
Moves the latest undone action to the performed list and calls the action's doAction() method.
bool casa::TBActionList::remove | ( | TBAction * | a | ) |
Removes the given action from the performed list, but does not delete it.
Returns true if the remove was successful, false otherwise.
bool casa::TBActionList::removeUndone | ( | TBAction * | a | ) |
Removes the given action from the undone list, but does not delete it.
Returns true if the remove was successful, false otherwise.
int casa::TBActionList::size | ( | ) |
Returns the size of the performed list.
Moves the latest performed action to the undone list and calls the action's undoAction() method.
TBAction* casa::TBActionList::undoneAt | ( | unsigned int | i | ) |
Returns the undone action at the designated index, or NULL if the index is invalid.
bool casa::TBActionList::undoneIsEmpty | ( | ) |
Returns true if the undone list is empty, false otherwise.
int casa::TBActionList::undoneSize | ( | ) |
Returns the size of the undone list.
vector<TBAction*> casa::TBActionList::actions [private] |
Performed actions list.
Definition at line 188 of file TBAction.h.
vector<TBAction*> casa::TBActionList::undone [private] |
Undone actions list.
Definition at line 192 of file TBAction.h.