All Frameworks  Class Hierarchy  This Framework  Previous  Next  Indexes

DialogEngine Class CATDiaAction

System.IUnknown
  |
  +---System.IDispatch
    |
    +---System.CATBaseUnknown
      |
      +---CATDiaAction
 

Usage: you can derive this class.


public class CATDiaAction

Base class to create a command action.
Role: An action is a task without interaction with the end user. An action may be

Moreover, a CATDiaAction object manages the action undo/redo. But, it must only undo/redo not transactional objects, that is to say the objects which don't belong to a model which implements the CATIUndoTransaction interface, because such a model undoes and redoes its objects itself.
To create an action, you can derive this class and override the methods: or use the CATStateCommand.Action method and give as arguments the addresses of methods to execute the action.
Actions must be created in the CATStateCommand.BuildGraph method.
See also:
CATDialogState, CATDialogTransition


Constructor and Destructor Index


o CATDiaAction(CATString&)
Constructs an action.
o ~CATDiaAction()

Method Index


o AfterRedo(void*)
Redoes the action effects after the transactional redo.
o AfterUndo(void*)
Undoes the action effects after the transactional undo.
o BeforeRedo(void*)
Redoes the action effects before the transactional redo.
o BeforeUndo(void*)
Undoes the action effects before the transactional undo.
o Do(void*)
Executes the action.
o SetAfterRedoMethod(ActionMethod)
Sets the method to redo the action after the transactional redo.
o SetAfterUndoMethod(ActionMethod)
Sets the method to undo the action after the transactional undo.
o SetBeforeRedoMethod(ActionMethod)
Sets the method to redo the action before the transactional redo.
o SetBeforeUndoMethod(ActionMethod)
Sets the method to undo the action before the transactional undo.
o SetData(void*)
Sets data which may be useful to execute or undo/redo the action.
o SetExecuteMethod(ActionMethod)
Sets the method to execute the action.

Constructor and Destructor


o CATDiaAction
public CATDiaAction( const CATString& iName)
Constructs an action.
Role: Use it only when deriving the CATDiaAction class, otherwise use the CATStateCommand.Action method to create an action.
Parameters:
iName
The name of the action. May be useful for debug.
o ~CATDiaAction
public virtual ~CATDiaAction()

Methods


o AfterRedo
public virtual CATBoolean AfterRedo(void* iData=NULL)
Redoes the action effects after the transactional redo.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
SetData method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, the second action is executed only if the first action returns TRUE.
o AfterUndo
public virtual CATBoolean AfterUndo(void* iData=NULL)
Undoes the action effects after the transactional undo.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
SetData method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, the second action is executed only if the first action returns TRUE.
o BeforeRedo
public virtual CATBoolean BeforeRedo(void* iData=NULL)
Redoes the action effects before the transactional redo.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
SetData method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, the second action is executed only if the first action returns TRUE.
o BeforeUndo
public virtual CATBoolean BeforeUndo(void* iData=NULL)
Undoes the action effects before the transactional undo.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
SetData method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, if the second action is executed only if the first action returns TRUE.
o Do
public virtual CATBoolean Do(void* iData=NULL)
Executes the action.
Role: Redefine this method when deriving CATDiaAction.
Parameters:
iData
The data specified by the
SetData method.
Returns:
The CATBoolean value used to combine actions. In an OrAction, the second action is executed only if the first action returns TRUE.
o SetAfterRedoMethod
public virtual void SetAfterRedoMethod(ActionMethod iMeth)
Sets the method to redo the action after the transactional redo.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetAfterRedoMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which redoes the action.
o SetAfterUndoMethod
public virtual void SetAfterUndoMethod(ActionMethod iMeth)
Sets the method to undo the action after the transactional undo.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetAfterUndoMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which undoes the action.
o SetBeforeRedoMethod
public virtual void SetBeforeRedoMethod(ActionMethod iMeth)
Sets the method to redo the action before the transactional redo.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetBeforeRedoMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which redoes the action.
o SetBeforeUndoMethod
public virtual void SetBeforeUndoMethod(ActionMethod iMeth)
Sets the method to undo the action before the transactional undo.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetBeforeUndoMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which undoes the action.
o SetData
public virtual void SetData(void* iData)
Sets data which may be useful to execute or undo/redo the action.
Role: This data will be given as the argument of the ActionMethod methods.
Parameters:
iData
An object that can be useful for the action.
Warning: A copy of iData is kept. Deallocate this object only at the end of the command.
o SetExecuteMethod
public virtual void SetExecuteMethod(ActionMethod iMeth)
Sets the method to execute the action.
Role: This method must be a method of the CATStateCommand object which defines the statechart.
Do not use SetExecuteMethod if you derive the CATDiaAction class.
Parameters:
iMeth
The method which does the action.

This object is included in the file: CATDiaAction.h
If needed, your Imakefile.mk should include the module: CATDialogEngine

Copyright © 2003, Dassault Systèmes. All rights reserved.