Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | Related Pages

RS_Undo Class Reference

Undo / redo functionality. More...

#include <rs_undo.h>

Inheritance diagram for RS_Undo:

RS_Document RS_Block RS_Graphic RS_FontChar List of all members.

Public Member Functions

 RS_Undo ()
 Default constructor.
void addUndoCycle (RS_UndoCycle *i)
 Adds an Undo Cycle at the current position in the list.
virtual void undo ()
 Undoes the last undo cycle.
virtual void redo ()
 Redoes the undo cycle which was at last undone.
virtual RS_UndoCyclegetUndoCycle ()
virtual RS_UndoCyclegetRedoCycle ()
virtual int countUndoCycles ()
virtual int countRedoCycles ()
virtual void startUndoCycle ()
 Starts a new cycle for one undo step.
virtual void addUndoable (RS_Undoable *u)
 Adds an undoable to the current undo cycle.
virtual void endUndoCycle ()
 Ends the current undo cycle.
virtual void removeUndoable (RS_Undoable *u)=0
 Must be overwritten by the implementing class and delete the given Undoable (unrecoverable).

Protected Attributes

RS_PtrList< RS_UndoCycleundoList
 List of undo list items. every item is something that can be undone.
int undoPointer
 Index that points to the current position in the undo list.
RS_UndoCyclecurrentCycle
 Current undo cycle.

Detailed Description

Undo / redo functionality.

The internal undo list consists of RS_UndoCycle entries.

See also:
RS_UndoCycle
Author:
Andrew Mustun


Member Function Documentation

void RS_Undo::addUndoCycle RS_UndoCycle i  ) 
 

Adds an Undo Cycle at the current position in the list.

All Cycles after the new one are removed and the Undoabels on them deleted.

int RS_Undo::countRedoCycles  )  [virtual]
 

Returns:
Number of Cycles that can be redone.

int RS_Undo::countUndoCycles  )  [virtual]
 

Returns:
Number of Cycles that can be undone.

RS_UndoCycle * RS_Undo::getRedoCycle  )  [virtual]
 

Returns:
The redo item that is next if we're about to redo or NULL.

RS_UndoCycle * RS_Undo::getUndoCycle  )  [virtual]
 

Returns:
The undo item that is next if we're about to undo or NULL.

virtual void RS_Undo::removeUndoable RS_Undoable u  )  [pure virtual]
 

Must be overwritten by the implementing class and delete the given Undoable (unrecoverable).

This method is called for Undoables that are no longer in the undo buffer.

Implemented in RS_Document.

void RS_Undo::startUndoCycle  )  [virtual]
 

Starts a new cycle for one undo step.

Every undoable that is added after calling this method goes into this cycle.

Reimplemented in RS_Document.


Member Data Documentation

int RS_Undo::undoPointer [protected]
 

Index that points to the current position in the undo list.

The item it points on will be undone the next time undo is called. The item after will be redone (if there is an item) when redo is called.


The documentation for this class was generated from the following files:
Generated on Sat Jan 6 13:48:23 2007 for qcadlib by  doxygen 1.4.4