TransactionState Class Reference
TransactionState provides a container where multiple UndoStates can be stored. More...
#include <undomanager.h>


Public Member Functions | |
| TransactionState () | |
| Creates a new TransactionState instance. | |
| ~TransactionState () | |
| Destroys the TransactionState instance. | |
| void | pushBack (UndoObject *target, UndoState *state) |
Add a new UndoState object to the transaction. | |
| uint | sizet () |
Returns the count of the UndoState objects in this transaction. | |
| void | useActionName () |
Use the name from last action added to this TransactionState. | |
| UndoState * | at (int index) |
Returns an UndoState object at index. | |
| bool | contains (int uid) const |
Returns true if this transaction contains UndoObject with the id uid. | |
| bool | containsOnly (int uid) const |
| Tells if this transaction contains only UndoObject with ID uid. | |
| UndoObject * | replace (ulong uid, UndoObject *newUndoObject) |
| Replace object with id uid with new UndoObject newUndoObject. | |
| void | undo () |
| undo all UndoStates in this transaction | |
| void | redo () |
| redo all UndoStates in this transaction | |
Private Attributes | |
| uint | size_ |
| Number of undo states stored in this transaction. | |
| std::vector< UndoState * > | states_ |
| vector to keep the states in | |
Detailed Description
TransactionState provides a container where multiple UndoStates can be stored.
as a single action which then appears in the attached UndoGuis.
- Date:
- January 2005
Definition at line 56 of file undomanager.h.
Constructor & Destructor Documentation
| TransactionState::TransactionState | ( | ) |
Creates a new TransactionState instance.
Definition at line 681 of file undomanager.cpp.
References size_.
| TransactionState::~TransactionState | ( | ) |
Destroys the TransactionState instance.
Definition at line 764 of file undomanager.cpp.
References states_.
Member Function Documentation
| void TransactionState::pushBack | ( | UndoObject * | target, | |
| UndoState * | state | |||
| ) |
Add a new UndoState object to the transaction.
- Parameters:
-
state state to be added to the transaction
Definition at line 714 of file undomanager.cpp.
References UndoState::setUndoObject(), size_, and states_.
| uint TransactionState::sizet | ( | ) |
Returns the count of the UndoState objects in this transaction.
- Returns:
- count of the
UndoStateobjects in this transaction
Definition at line 724 of file undomanager.cpp.
References size_.
Referenced by at(), UndoTransaction::commit(), redo(), and undo().
| void TransactionState::useActionName | ( | ) |
Use the name from last action added to this TransactionState.
Definition at line 729 of file undomanager.cpp.
References UndoState::getName(), UndoState::setName(), size_, and states_.
Referenced by UndoTransaction::commit().
| UndoState * TransactionState::at | ( | int | index | ) |
Returns an UndoState object at index.
- Parameters:
-
index index from where an UndoStateobject is returned. Ifindexis out of scopeNULLwill be rerturned.
- Returns:
UndoStateobject fromindexorNULLifindexis out of scope.
Definition at line 686 of file undomanager.cpp.
| bool TransactionState::contains | ( | int | uid | ) | const |
Returns true if this transaction contains UndoObject with the id uid.
otherwise returns false.
- Returns:
- true if this transaction contains UndoObject with the ide
uidotherwise returns false.
Definition at line 694 of file undomanager.cpp.
References UndoObject::getUId(), states_, and UndoState::undoObject().
Referenced by UndoStack::getNextRedo(), and UndoStack::getNextUndo().
| bool TransactionState::containsOnly | ( | int | uid | ) | const |
Tells if this transaction contains only UndoObject with ID uid.
If a transaction contains only single UndoObject it will be safe to include it in the object specific undo.
- Parameters:
-
uid UndoObject's id to look for
- Returns:
- true if this transaction only contains actions of the UndoObject whose id is uid
Definition at line 704 of file undomanager.cpp.
References UndoObject::getUId(), states_, and UndoState::undoObject().
Referenced by UndoManager::setState().
| UndoObject * TransactionState::replace | ( | ulong | uid, | |
| UndoObject * | newUndoObject | |||
| ) |
Replace object with id uid with new UndoObject newUndoObject.
- Parameters:
-
uid id of the object that is wanted to be replaced newUndoObject object that is used for replacing
- Returns:
- UndoObject which was replaced
Definition at line 735 of file undomanager.cpp.
References replace(), states_, and UndoState::undoObject().
Referenced by replace(), and UndoManager::replaceObject().
| void TransactionState::undo | ( | ) | [virtual] |
undo all UndoStates in this transaction
Reimplemented from UndoState.
Definition at line 752 of file undomanager.cpp.
References at(), sizet(), and UndoState::undo().
| void TransactionState::redo | ( | ) | [virtual] |
redo all UndoStates in this transaction
Reimplemented from UndoState.
Definition at line 758 of file undomanager.cpp.
References at(), UndoState::redo(), and sizet().
Member Data Documentation
uint TransactionState::size_ [private] |
Number of undo states stored in this transaction.
Definition at line 116 of file undomanager.h.
Referenced by pushBack(), sizet(), TransactionState(), and useActionName().
std::vector<UndoState*> TransactionState::states_ [private] |
vector to keep the states in
Definition at line 118 of file undomanager.h.
Referenced by at(), contains(), containsOnly(), pushBack(), replace(), useActionName(), and ~TransactionState().
The documentation for this class was generated from the following files:
