Scribus
Open source desktop publishing at your fingertips
UndoState Class Reference

UndoState describes an undoable state (action). More...

#include <undostate.h>

Inheritance diagram for UndoState:

Public Member Functions

 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 undo ()
 undo the state described by this UndoState, More...
 
virtual void redo ()
 redo the state described by this UndoState, More...
 
virtual bool isTransaction ()
 To know if the state is a transaction.
 
virtual void setUndoObject (UndoObject *object)
 Set the UndoObject this state belongs to.
 
virtual UndoObjectundoObject ()
 return the UndoObject this state belongs to
 

Public Attributes

int transactionCode
 

Detailed Description

UndoState describes an undoable state (action).

Undoable objects implement undo/redo by sending and receiving UndoState subclasses. This means that they will need to produce some sort of information for the UndoState subclass (if no suitable subclass exists it must be also created) and later they will need to be able to restore the state described by the subclass to apply undo/redo.

UndoManager will handle the deletion of UndoState objects.

See also
SimpleState
Author
Riku Leino riku@.nosp@m.scri.nosp@m.bus.i.nosp@m.nfo
Date
December 2004

Constructor & Destructor Documentation

UndoState::UndoState ( const QString &  name,
const QString &  description = 0,
QPixmap *  pixmap = 0 
)

Creates a new UndoState instance.

Parameters
nameName of the state (action). Will be used when describing the state in UndoGui subclasses.
descriptionDescription of the state (action)
pixmapPointer to an icon describing the action visually.

Member Function Documentation

QString UndoState::getDescription ( )
virtual

Returns description of the state.

Returns
description of the state
QString UndoState::getName ( )
virtual

Returns name of the state (action).

Returns
name of the state
QPixmap * UndoState::getPixmap ( )
virtual

Returns a pointer to the icon attached to the state.

Returns
A pointer to the icon attached to the state
void UndoState::redo ( )
virtual

redo the state described by this UndoState,

requires the related UndoObject

Reimplemented in TransactionState.

void UndoState::setDescription ( const QString &  newDescription)
virtual

Set the description for this UndoState.

Parameters
newDescriptiondescription for this UndoState
void UndoState::setName ( const QString &  newName)
virtual

Set the name for this UndoState.

Parameters
newNamename for this UndoState
void UndoState::setPixmap ( QPixmap *  newPixmap)
virtual

Set the icon for this UndoState.

Parameters
newPixmapicon for this UndoState
void UndoState::undo ( )
virtual

undo the state described by this UndoState,

requires related UndoObject

Reimplemented in TransactionState.


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