RecordEnvelopeAction Class Reference

This class records undo/redo information for the Envelope shape object. More...

#include <moldenv.h>

Inheritance diagram for RecordEnvelopeAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 RecordEnvelopeAction ()
 Constructor for the action to undo envelope modification.
 ~RecordEnvelopeAction ()
 Destructor for the action to undo envelope modification.
virtual ActionCode Execute ()
 This is the virtual function that is called when the action is executed by the Undo/Redo system. This is the function that actually undoes the envelope change action by swapping the current internal definition of the envelope with the contexts of itself.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, MouldEnvelopeBase *pRecEnvelope, Action **NewAction)
 This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NORECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.

Private Attributes

MouldEnvelopeBasepCEnvelope
POINT RecordArray [24]

Detailed Description

This class records undo/redo information for the Envelope shape object.

class RecordEnvelopeAction : public Action

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95

Definition at line 299 of file moldenv.h.


Constructor & Destructor Documentation

RecordEnvelopeAction::RecordEnvelopeAction  ) 
 

Constructor for the action to undo envelope modification.

RecordEnvelopeAction::RecordEnvelopeAction()

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95

Definition at line 1794 of file moldenv.cpp.

01795 {
01796     pCEnvelope=NULL;
01797 }

RecordEnvelopeAction::~RecordEnvelopeAction  ) 
 

Destructor for the action to undo envelope modification.

RecordEnvelopeAction::~RecordEnvelopeAction()

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95

Definition at line 1810 of file moldenv.cpp.

01811 {
01812 }


Member Function Documentation

ActionCode RecordEnvelopeAction::Execute  )  [virtual]
 

This is the virtual function that is called when the action is executed by the Undo/Redo system. This is the function that actually undoes the envelope change action by swapping the current internal definition of the envelope with the contexts of itself.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, = AC_OK if the action was created correctly = AC_NORECORD if no memory to undo/redo but go ahead anyway without undo = AC_FAIL stop the operation

Errors: -

See also:
-

Reimplemented from Action.

Definition at line 1890 of file moldenv.cpp.

01891 {
01892     // try to create a redo record
01893     RecordEnvelopeAction* EnvAction;
01894     ActionCode Act;
01895     Act = RecordEnvelopeAction::Init(pOperation, pOppositeActLst, pCEnvelope, (Action**)(&EnvAction));
01896     
01897     // for undo, simply copy 'this' record over the shape.
01898     // No No , we dont need to check for AC_OK, hands off! we've done all that in the
01899     // init function which tries to record the current state of the envelope
01900     if (pCEnvelope)
01901         pCEnvelope->BuildShape(RecordArray,NULL);
01902 
01903     return Act;
01904 }

ActionCode RecordEnvelopeAction::Init Operation pOp,
ActionList pActionList,
MouldEnvelopeBase pRecEnvelope,
Action **  NewAction
[static]
 

This is the function which creates an instance of this action. If there is no room in the undo buffer (which is determined by the base class Init function called within) the function will either return AC_NORECORD which means the operation can continue, but no undo information needs to be stored, or AC_OK which means the operation should continue AND record undo information. If the function returns AC_FAIL, there was not enough memory to record the undo information, and the user has decided not to continue with the operation.

Author:
Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
Date:
16/01/95
Parameters:
pOp = a pointer to the operation to which this action belongs [INPUTS] pActionList = is the action list to which this action should be added
NewAction = a pointer to a pointer to an action, allowing the function to [OUTPUTS] return a pointer to the created action.
Returns:
ActionCode, = AC_OK if the action was created correctly = AC_NORECORD if no memory to undo/redo but go ahead anyway without undo = AC_FAIL stop the operation

Errors: -

See also:
Action::Init()

Definition at line 1845 of file moldenv.cpp.

01849 {
01850     ActionCode Ac = AC_FAIL;
01851     if (pRecEnvelope!=NULL)
01852     {
01853         UINT32 ActSize = sizeof(RecordEnvelopeAction);
01854         Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(RecordEnvelopeAction), NewAction);
01855         if (Ac==AC_OK)
01856         {
01857             RecordEnvelopeAction* pAct = ((RecordEnvelopeAction*)*NewAction);
01858             if (pAct)
01859             {
01860                 // Save a pointer to the Envelope and save the defining shape
01861                 pAct->pCEnvelope = pRecEnvelope;
01862                 pRecEnvelope->pEnvelope->CopyShape(pAct->RecordArray);
01863             }
01864         }
01865     }
01866     return Ac;
01867 }


Member Data Documentation

MouldEnvelopeBase* RecordEnvelopeAction::pCEnvelope [private]
 

Definition at line 312 of file moldenv.h.

POINT RecordEnvelopeAction::RecordArray[24] [private]
 

Definition at line 313 of file moldenv.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 04:00:21 2007 for Camelot by  doxygen 1.4.4