Superclass for all objects that are wanted to have undoable actions.
More...
#include <undoobject.h>
Superclass for all objects that are wanted to have undoable actions.
The most important feature of UndoObject is the restore() method which must be implemented in the subclass. When an action that is wanted to be undoable happens UndoObject subclass must use UndoManager::action() method to store the action using UndoState object. Then when a user undos this action UndoManager will send the UndoState object back to this UndoObject by using the restore() method.
What is needed for an undo/redo:
-
UndoObject creates an UndoState object describing the action
-
Sends it to the UndoManager
-
When an undo/redo is requested UndoManager will send this very same UndoState object back to the UndoObject which then uses it to restore the state.
- Author
- Riku Leino riku@.nosp@m.scri.nosp@m.bus.i.nosp@m.nfo
- Date
- December 2004
UndoObject::UndoObject |
( |
const QString & |
objectName, |
|
|
QPixmap * |
objectIcon = 0 |
|
) |
| |
Creates a new UndoObject instance with the name objectName
- Parameters
-
ulong UndoObject::getUId |
( |
| ) |
const |
Returns an unique identifier number for the UndoObject.
- Returns
- unique identifier number for the UndoObjet
QString UndoObject::getUName |
( |
| ) |
|
|
virtual |
QPixmap * UndoObject::getUPixmap |
( |
| ) |
|
|
virtual |
Returns the pixmap connected to this object.
- Returns
- pixmap connected to this object
virtual void UndoObject::restore |
( |
UndoState * |
state, |
|
|
bool |
isUndo |
|
) |
| |
|
pure virtual |
void UndoObject::setUName |
( |
QString |
newUName | ) |
|
|
virtual |
void UndoObject::setUPixmap |
( |
QPixmap * |
newUPixmap | ) |
|
|
virtual |
Set the pixmap for this object.
- Parameters
-
newUPixmap | pixmap for this object |
The documentation for this class was generated from the following files:
- /Users/ale/src/Scribus/scribus/undoobject.h
- /Users/ale/src/Scribus/scribus/undoobject.cpp