|
Scribus
Open source desktop publishing at your fingertips
|
#include <transaction.h>

Classes | |
| class | TransactionStateBase |
Public Types | |
| enum | Status { STATE_OPEN, STATE_WILLFAIL, STATE_FAILED, STATE_COMMITTED } |
Public Member Functions | |
| Transaction (TransactionStateBase *data) | |
| virtual | ~Transaction () |
| operator bool () const | |
| virtual bool | commit ()=0 |
| virtual bool | cancel ()=0 |
| virtual void | markFailed () |
| virtual void | reset () |
| int | getState () const |
| bool | isNull () const |
| bool | isStarted () const |
| bool | isOpened () const |
Protected Attributes | |
| QExplicitlySharedDataPointer< TransactionStateBase > | m_data |
Interface class for objects representing a going transaction. Will be specialized by classes like Undomanager for use as a result type in their beginTransaction() method.
|
inlinevirtual |
Automatically commits if forgotten. Override as appropiate. Since the superclass destructor is called last, you can cancel in the subclass destructor; the commit here then will do nothing. Don't forget to set m_data to NULL if you free the m_data pointer!
|
pure virtual |
Cancels this transaction if in STATE_OPEN or STATE_WILLFAIL; otherwise do nothing Returns true iff the transaction was canceled.
Implemented in UndoTransaction.
|
pure virtual |
Commits this transaction if in STATE_OPEN. If in STATE_WILLFAIL, cancel the transaction instead; otherwise do nothing. Returns true iff the transaction was committed or canceled.
Implemented in UndoTransaction.
|
virtual |
Marks this transaction as failed.
|
inline |
Test if transaction has some valid data
|
virtual |
Reset underlyng transaciton data