Views
Application Framework Package API Reference Guide
Product Documentation:
Views Documentation Home
List of all members | Public Member Functions
IlvDvCommand Class Referenceabstract

Application Framework command class. More...

#include <ilviews/appframe/command.h>

Inheritance diagram for IlvDvCommand:
IlvDvSerializable

Public Member Functions

 IlvDvCommand (const char *name=0)
 Initializes a new IlvDvCommand object. More...
 
 IlvDvCommand (const IlvDvCommand &source)
 Copy constructor. More...
 
virtual ~IlvDvCommand ()
 Destructor. More...
 
virtual IlBoolean bringChanges () const
 Query for the impact of the command on the document. More...
 
virtual IlBoolean canUndo () const
 Query for undo capability. More...
 
virtual IlvDvCommandcopy () const =0
 Returns a copy of the command object. More...
 
virtual void doIt ()=0
 Called when the command must be executed.
 
virtual void undo ()=0
 
- Public Member Functions inherited from IlvDvSerializable
virtual void serialize (IlvDvStream &stream)
 Serializes the object in the stream stream.
Typically, the body of the method has the following form:
More...
 

Detailed Description

Application Framework command class.

Library: ilvappframe

This is the base class for all commands in the Application Framework package.
To define new commands, you need to create a subclass of this class and provide, as a minimum, an implementation for the doIt() and undo() methods.

Constructor & Destructor Documentation

◆ IlvDvCommand() [1/2]

IlvDvCommand::IlvDvCommand ( const char *  name = 0)

Initializes a new IlvDvCommand object.

The name of this command is a copy of the string name.
If name is set to 0, the command name is initialized to 0.

Parameters
nameThe name of the new command.

◆ IlvDvCommand() [2/2]

IlvDvCommand::IlvDvCommand ( const IlvDvCommand source)

Copy constructor.

Initializes a new command object by copying the name of source.

Parameters
sourceThe command object that is copied.

◆ ~IlvDvCommand()

virtual IlvDvCommand::~IlvDvCommand ( )
virtual

Destructor.

Releases all memory used by the command object.

Member Function Documentation

◆ bringChanges()

virtual IlBoolean IlvDvCommand::bringChanges ( ) const
virtual

Query for the impact of the command on the document.

Returns
IlTrue if the command modifies the document (so that it should be saved after doIt() is called), and IlFalse otherwise.
The default implementation returns IlTrue.

◆ canUndo()

virtual IlBoolean IlvDvCommand::canUndo ( ) const
virtual

Query for undo capability.

Returns
IlTrue if this command can be undone (if unDo() makes sense), and IlFalse otherwise.
The default implementation returns IlTrue.

◆ copy()

virtual IlvDvCommand* IlvDvCommand::copy ( ) const
pure virtual

Returns a copy of the command object.

Returns
A copy of the command object.

◆ undo()

virtual void IlvDvCommand::undo ( )
pure virtual

Called when the command must be undone.