Scribus
Open source desktop publishing at your fingertips
TransactionState Class Reference

TransactionState provides a container where multiple UndoStates can be stored. More...

#include <undostate.h>

Inheritance diagram for TransactionState:
Collaboration diagram for TransactionState:

Public Member Functions

 TransactionState ()
 Creates a new TransactionState instance.
 
 ~TransactionState ()
 Destroys the TransactionState instance.
 
bool isTransaction ()
 To know if the state is a Transaction.
 
void pushBack (UndoObject *target, UndoState *state)
 Add a new UndoState object to the transaction. More...
 
uint sizet () const
 Returns the count of the UndoState objects in this transaction. More...
 
void useActionName ()
 Use the name from last action added to this TransactionState
 
UndoStateat (int index) const
 Returns an UndoState object at index. More...
 
UndoStatelast () const
 Returns the last UndoState in transaction. More...
 
bool contains (int uid) const
 Returns true if this transaction contains UndoObject with the id uid More...
 
bool containsOnly (int uid) const
 Tells if this transaction contains only UndoObject with ID uid. More...
 
UndoObjectreplace (ulong uid, UndoObject *newUndoObject)
 Replace object with id uid with new UndoObject newUndoObject. More...
 
void undo ()
 undo all UndoStates in this transaction
 
void redo ()
 redo all UndoStates in this transaction
 
- Public Member Functions inherited from UndoState
 UndoState (const QString &name, const QString &description=0, QPixmap *pixmap=0)
 Creates a new UndoState instance. More...
 
virtual QString getName ()
 Returns name of the state (action). More...
 
virtual void setName (const QString &newName)
 Set the name for this UndoState. More...
 
virtual QString getDescription ()
 Returns description of the state. More...
 
virtual void setDescription (const QString &newDescription)
 Set the description for this UndoState. More...
 
virtual QPixmap * getPixmap ()
 Returns a pointer to the icon attached to the state. More...
 
virtual void setPixmap (QPixmap *newPixmap)
 Set the icon for this UndoState. More...
 
virtual void setUndoObject (UndoObject *object)
 Set the UndoObject this state belongs to.
 
virtual UndoObjectundoObject ()
 return the UndoObject this state belongs to
 

Additional Inherited Members

- Public Attributes inherited from UndoState
int transactionCode
 

Detailed Description

TransactionState provides a container where multiple UndoStates can be stored.

as a single action which then appears in the attached UndoGuis.

Author
Riku Leino riku@.nosp@m.scri.nosp@m.bus.i.nosp@m.nfo
Date
January 2005

Member Function Documentation

UndoState * TransactionState::at ( int  index) const

Returns an UndoState object at index.

Parameters
indexindex from where an UndoState object is returned. If index is out of scope NULL will be rerturned.
Returns
UndoState object from index or NULL if index is out of scope.
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 uid
otherwise returns false.
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
uidUndoObject's id to look for
Returns
true if this transaction only contains actions of the UndoObject whose id is uid
UndoState * TransactionState::last ( ) const

Returns the last UndoState in transaction.

Returns
a valid UndoState pointer or 0 if transaction is empty.
void TransactionState::pushBack ( UndoObject target,
UndoState state 
)

Add a new UndoState object to the transaction.

Parameters
statestate to be added to the transaction
UndoObject * TransactionState::replace ( ulong  uid,
UndoObject newUndoObject 
)

Replace object with id uid with new UndoObject newUndoObject.

Parameters
uidid of the object that is wanted to be replaced
newUndoObjectobject that is used for replacing
Returns
UndoObject which was replaced
uint TransactionState::sizet ( ) const

Returns the count of the UndoState objects in this transaction.

Returns
count of the UndoState objects in this transaction

The documentation for this class was generated from the following files: