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 | |
| std::vector< TBAction * > | actions |
| Performed actions list. | |
| std::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 111 of file TBAction.h.
| casa::TBActionList::TBActionList | ( | ) |
Default Constructor to initialize the empty lists.
| casa::TBActionList::~TBActionList | ( | ) |
| TBAction* casa::TBActionList::at | ( | unsigned int | i | ) |
Returns the performed action at the designated index, or NULL if the index is invalid.
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.
| String casa::TBActionList::lastActionName | ( | ) |
Returns the name() value of the last performed action, or blank if there is none.
| String casa::TBActionList::lastUndoneActionName | ( | ) |
Returns the name() value of the last undone action, or blank if there is none.
| Result casa::TBActionList::redoAction | ( | ) |
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.
| Result casa::TBActionList::undoAction | ( | ) |
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.
std::vector<TBAction*> casa::TBActionList::actions [private] |
Performed actions list.
Definition at line 185 of file TBAction.h.
std::vector<TBAction*> casa::TBActionList::undone [private] |
Undone actions list.
Definition at line 189 of file TBAction.h.
1.6.1