VkAction(3x) VkAction(3x)
VkAction - Supports encapsulation of a command that can be undone
#include <Vk/VkAction.h>
PUBLIC PROTOCOL SUMMARY
Constructor/Destructor
VkAction(const char*);
virtual void ~VkAction(void);
Executing actions [Toc] [Back]
void execute(void);
PROTECTED PROTOCOL SUMMARY [Toc] [Back] Specifying do/undo Behavior
virtual void doit(void);
virtual void undoit(void);
Protected Data Members [Toc] [Back]
char* _name;
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.
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 DESCRIPTIONS [Toc] [Back] doit()
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() [Toc] [Back]
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 [Toc] [Back] _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
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
PPPPaaaaggggeeee 2222 [ Back ]
|