VkAction(3x)VkAction(3x)NAMEVkAction - Supports encapsulation of a command that can be undone
HEADER FILE
#include <Vk/VkAction.h>
PUBLIC PROTOCOL SUMMARY
Constructor/Destructor
VkAction(const char*);
virtual void ~VkAction(void);
Executing actions
void execute(void);
PROTECTED PROTOCOL SUMMARY
Specifying do/undo Behavior
virtual void doit(void);
virtual void undoit(void);
Protected Data Members
char* _name;
CLASS DESCRIPTION
This class supports applications that wish to model undoable actions
as objects. Applications must create derived classes that define the
exact actions to be taken. Applications use classes derived from
VkAction by instantiating an instance of a class and calling the
object's execute() member function. The object automatically
registers itself with the application's undo manager, which provides
the interface for undoing the command.
DERIVING SUBCLASSES
To use this class, an application must create a derived class for
every type of action it wishes to perform. Each derived class must
override the virtual functions doit() and undoit(). The derived
class can add data members to maintain any state required between
doing the command and undoing the command.
FUNCTION DESCRIPTIONSdoit()
virtual void doit(void);
Page 1
VkAction(3x)VkAction(3x)
This virtual function should be overridden to provide the action to
be performed by the derived class.
undoit()
virtual void undoit(void);
This virtual function should be overridden to reverse the effects of
the action performed by the derived class.
VkAction()
VkAction(const char* name);
Initialize a VkAction object.
~VkAction()
virtual void ~VkAction(void);
Handle destruction of a VkAction object.
execute()
void execute(void);
Calls derived classes' doit() method and arranges for the undo
action to be registered with the undo manager.
DATA MEMBER DESCRIPTIONS
_name
char* _name;
Every action should have a name, which is used to identify the
action in the undo manager.
CLASSES USED BY THIS CLASS
VkMenuUndoManager
SEE ALSO
VkMenuUndoManager
ViewKit Programmer's Guide
The X Window System, DEC Press, Bob Sheifler and Jim Gettys
The X Window System Toolkit, DEC Press, Paul Asente and Ralph Swick
The OSF/Motif Programmers Reference, Prentice Hall, OSF
Page 2