UpdateCachedKeyholePathAction Class Reference

Cause a NodeClipViewController node to update it cached keyhole path when an operation is undone or redone. Notes: Invoking this action via its Init() method has no _direct_ effect, save to set the action to trigger on undo/redo. More...

#include <ndclpcnt.h>

Inheritance diagram for UpdateCachedKeyholePathAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 UpdateCachedKeyholePathAction ()
 Constructor.
 ~UpdateCachedKeyholePathAction ()
 Destructor.
virtual ActionCode Execute ()
 Called by Camelot when it meets this Action on an undo/redo ActionList. You should undo/redo the action here and record an opposite action in the opposite ActionList. If the action is not too complex or you can't be bothered with two Actions, then you can use the same Action to both undo and redo, passing it appropriate information via Init(), or other means.

Static Public Member Functions

static ActionCode Init (UndoableOperation *pUndoOp, ActionList *pActionList, NodeClipViewController *pUpdateNCVC)
 Action Init function. This is the public interface through which the Action is invoked. It should call Action::Init to actually construct a new Action and put it on the given action list. It should usually also perform the action (we don't actually in this case, as this action is a BODGE so we update NCVC's on undo/redo!).

Private Member Functions

void SetNCVCToUpdate (NodeClipViewController *pNCVC)
 Tell us which NCVC we will be updating.

Private Attributes

NodeClipViewControllerm_pNCVC

Detailed Description

Cause a NodeClipViewController node to update it cached keyhole path when an operation is undone or redone. Notes: Invoking this action via its Init() method has no _direct_ effect, save to set the action to trigger on undo/redo.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
20 March 2000

Definition at line 355 of file ndclpcnt.h.


Constructor & Destructor Documentation

UpdateCachedKeyholePathAction::UpdateCachedKeyholePathAction  ) 
 

Constructor.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
20 March 2000

Definition at line 2735 of file ndclpcnt.cpp.

02736 {
02737     m_pNCVC = NULL;
02738 }

UpdateCachedKeyholePathAction::~UpdateCachedKeyholePathAction  ) 
 

Destructor.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
20 March 2000

Definition at line 2751 of file ndclpcnt.cpp.

02752 {
02753     m_pNCVC = NULL;
02754 }


Member Function Documentation

ActionCode UpdateCachedKeyholePathAction::Execute  )  [virtual]
 

Called by Camelot when it meets this Action on an undo/redo ActionList. You should undo/redo the action here and record an opposite action in the opposite ActionList. If the action is not too complex or you can't be bothered with two Actions, then you can use the same Action to both undo and redo, passing it appropriate information via Init(), or other means.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
20 March 2000
Parameters:
[INPUTS] 
[OUTPUTS] 
Returns:
This Action simply causes a specific NodeClipViewController to update its cached keyhole path.
Returns:
Errors: See also:

Reimplemented from Action.

Definition at line 2840 of file ndclpcnt.cpp.

02841 {
02842     // complain loudly if our state is invalid - however, we can survive without it,
02843     // so we'll still return a thumbs up anyway.
02844     ERROR3IF(m_pNCVC == NULL, "UpdateCachedKeyholePathAction::Execute; NULL NCVC pointer!");
02845     
02846     // record our 'inverse' action, and as a side effect of this, our NCVC
02847     // will be told that it needs to update it cached keyhole path.
02848     ActionCode ac = AC_OK;
02849     if (m_pNCVC != NULL)
02850     {
02851         ac = UpdateCachedKeyholePathAction::Init(   (UndoableOperation*)pOperation,
02852                                                     pOppositeActLst,
02853                                                     m_pNCVC );
02854     }
02855     return ac;
02856 }

ActionCode UpdateCachedKeyholePathAction::Init UndoableOperation pUndoOp,
ActionList pActionList,
NodeClipViewController pUpdateNCVC
[static]
 

Action Init function. This is the public interface through which the Action is invoked. It should call Action::Init to actually construct a new Action and put it on the given action list. It should usually also perform the action (we don't actually in this case, as this action is a BODGE so we update NCVC's on undo/redo!).

Parameters:
Puts a copy of this action at the head of the given action list. The upshot [OUTPUTS] of this is that when that list, eg undo list, is executed, this action's Execute method will be called last (the lists go backwards(??))
Returns:
AC_FAIL, AC_NORECORD or AC_OK. See Action::Init() in ops.cpp for more detail.

Errors: See also:

Definition at line 2787 of file ndclpcnt.cpp.

02790 {
02791     // call the base class to create and put the action onto the action list.
02792     ActionCode ac = AC_FAIL;
02793     UINT32 ActSize = sizeof(UpdateCachedKeyholePathAction);
02794     UpdateCachedKeyholePathAction* pNewAction = NULL;
02795     ac = Action::Init(  pUndoOp,
02796                         pActionList,
02797                         ActSize,
02798                         CC_RUNTIME_CLASS(UpdateCachedKeyholePathAction),
02799                         (Action**)&pNewAction  );
02800 
02801     // ok, the action now exists. initialise it with the NCVC to be updated,
02802     // and mark the NCVC as needing to update itself.
02803     if (ac != AC_FAIL && pNewAction != NULL)
02804     {
02805         pUpdateNCVC->MarkKeyholeInvalid();
02806         pNewAction->SetNCVCToUpdate(pUpdateNCVC);
02807     }
02808 
02809     // we want the update action to be called last whenever an action is undone or redone,
02810     // so it actually needs to go at the other end of the list.
02811     pActionList->RemoveItem(pNewAction);
02812     pActionList->AddHead(pNewAction);
02813 
02814     return ac;
02815 }

void UpdateCachedKeyholePathAction::SetNCVCToUpdate NodeClipViewController pNCVC  )  [private]
 

Tell us which NCVC we will be updating.

Author:
Karim_MacDonald (Xara Group Ltd) <camelotdev@xara.com>
Date:
20 March 2000
Parameters:
pNCVC ptr to the NCVC to update. [INPUTS]

Definition at line 2870 of file ndclpcnt.cpp.

02871 {
02872     ERROR3IF(pNCVC == NULL, "UpdateCachedKeyholePathAction::SetNCVCToUpdate; NULL param!");
02873     m_pNCVC = pNCVC;
02874 }


Member Data Documentation

NodeClipViewController* UpdateCachedKeyholePathAction::m_pNCVC [private]
 

Definition at line 374 of file ndclpcnt.h.


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