Main Page | Modules | Namespace List | Class Hierarchy | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CP_UndoAction Class Reference

CP_Action class that provide undo / redo support.

Inheritance diagram for CP_UndoAction:

CP_Action List of all members.

Public Member Functions

Constructor / Destructor
 CP_UndoAction (const CP_String &inMenuText)
 Constructor.
 ~CP_UndoAction () throw ()
 Destructor.
Undo / Redo
virtual bool DoUndo ()
virtual bool DoRedo ()
Edit Menu
CP_String GetMenuText ()
void SetMenuText (const CP_String &inString)
Perform
virtual void Finish (CP_UndoAction *inCommand)
Testers
virtual bool IsDone ()
virtual bool IsUndoable ()
virtual bool IsRedoable ()

Protected Member Functions

Undo / Redo
virtual bool UndoSelf ()
virtual bool RedoSelf ()
Perform
virtual void FinishSelf (CP_UndoAction *)
Setters
void SetIsUndoable (bool isUndoable=true)
void SetIsRedoable (bool isRedoable=true)

Protected Attributes

CP_String fMenuText
bool fDone
bool fIsUndoable
bool fIsRedoable

Constructor & Destructor Documentation

CPLAT_Begin_Namespace_CPLAT CP_UndoAction::CP_UndoAction const CP_String inMenuText  ) 
 

Constructor.

Parameters:
inMenuText - the text to displayed in the undo/redo menu item.

CP_UndoAction::~CP_UndoAction  )  throw ()
 

Destructor.


Member Function Documentation

bool CP_UndoAction::DoUndo  )  [virtual]
 

Undo ourselves. Return true if we were able to handle the undo. This calls UndoSelf() which is the method to override to provide undo in a command.

bool CP_UndoAction::DoRedo  )  [virtual]
 

Redo ourselves. Return true if we were able to handle the redo. This calls RedoSelf() which is the method to override to provide redo in a command.

Reimplemented from CP_Action.

CP_String CP_UndoAction::GetMenuText  ) 
 

Return the menu text to be displayed for this command.

Exceptions:
none 
Returns:
CP_String The text to be used.

void CP_UndoAction::SetMenuText const CP_String inString  ) 
 

Sets the menu text to be displayed for this command.

Parameters:
inString The text to be displayed in the menu.
Exceptions:
none 
Returns:
void

void CP_UndoAction::Finish CP_UndoAction inCommand  )  [virtual]
 

Called just before this command is deleted, allow the command to finish any needed housekeeping before being deleted.

Parameters:
inCommand - the command that is about to be deleted.

virtual bool CP_UndoAction::IsDone  )  [virtual]
 

Return true if this command has been done.

Exceptions:
none 
Returns:
bool True if the action has been done.

virtual bool CP_UndoAction::IsUndoable  )  [virtual]
 

Return true if this action is undoable.

Exceptions:
none 
Returns:
bool True if the action is undoable.

virtual bool CP_UndoAction::IsRedoable  )  [virtual]
 

Return true if this action is redoable.

Exceptions:
none 
Returns:
bool True if the action is redoable.

virtual bool CP_UndoAction::UndoSelf  )  [protected, virtual]
 

Undo the command. Subclasses must override.

Exceptions:
none 
Returns:
bool True if the action was performed. Default implementation returns false.

virtual bool CP_UndoAction::RedoSelf  )  [protected, virtual]
 

Redo the command. Subclasses must override.

Exceptions:
none 
Returns:
bool True if the action was performed. Default implementation returns false.

virtual void CP_UndoAction::FinishSelf CP_UndoAction  )  [protected, virtual]
 

Finish the action. This is called just before the action is deleted.

Parameters:
inCommand The Action or Command to act upon.
Exceptions:
none 
Returns:
void

void CP_UndoAction::SetIsUndoable bool  isUndoable = true  )  [protected]
 

Set the flag indicating if our operation is undoable.

void CP_UndoAction::SetIsRedoable bool  isRedoable = true  )  [protected]
 

Set the flag indicating if our operation is redoable.


Member Data Documentation

CP_String CP_UndoAction::fMenuText [protected]
 

bool CP_UndoAction::fDone [protected]
 

Text displayed in the undo menu item.

bool CP_UndoAction::fIsUndoable [protected]
 

Flag to indicate if the command is finished.

bool CP_UndoAction::fIsRedoable [protected]
 

Flag to indicate if the command is undoable.


The documentation for this class was generated from the following files:
Generated on Tue Sep 20 20:22:16 2005 for CPLAT_MacOS by  doxygen 1.4.0