RemoveFloaterAction Class Reference

An action to provide the Line tool with an undoable way of removing the floating endpoint. This isn't stored in the document, which makes life tricky. More...

#include <opbezier.h>

Inheritance diagram for RemoveFloaterAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 RemoveFloaterAction ()
 Constructor for the action to remove a floating endpoint.
 ~RemoveFloaterAction ()
virtual ActionCode Execute ()
 Removes the floating endpoint from the Line Tool, creating an undo action to insert the endpoint.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, BezierTool *pTool, 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_NO_RECORD 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.
static ActionCode DoRemove (Operation *pOp, ActionList *pActionList, BezierTool *pTool)
 This static function makes it a little easier to use this action. It creates an instance of this action and appends it to the action list.

Protected Attributes

BezierToolpLineTool

Detailed Description

An action to provide the Line tool with an undoable way of removing the floating endpoint. This isn't stored in the document, which makes life tricky.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/12/94
See also:

Definition at line 296 of file opbezier.h.


Constructor & Destructor Documentation

RemoveFloaterAction::RemoveFloaterAction  ) 
 

Constructor for the action to remove a floating endpoint.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
-

Errors: -

See also:
-

Definition at line 1280 of file opbezier.cpp.

01281 {
01282     pLineTool = NULL;
01283 }

RemoveFloaterAction::~RemoveFloaterAction  ) 
 

Definition at line 1411 of file opbezier.cpp.

01412 {
01413 }


Member Function Documentation

ActionCode RemoveFloaterAction::DoRemove Operation pOp,
ActionList pActionList,
BezierTool pTool
[static]
 

This static function makes it a little easier to use this action. It creates an instance of this action and appends it to the action list.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/12/94
Parameters:
pOp is the currently running operation [INPUTS] pActionList is a pointer ot the action list to which the action should be appended pTool is a pointer to the Line tool.
- [OUTPUTS]
Returns:
Action code which indicates success or failure to create the action

Errors: -

See also:
InsertFloaterAction::DoInsert

Definition at line 1350 of file opbezier.cpp.

01353 {
01354     RemoveFloaterAction* RecAction;
01355     ActionCode Act = RemoveFloaterAction::Init(pOp, pActionList, pTool, (Action**)&RecAction);
01356     return Act;
01357 }

ActionCode RemoveFloaterAction::Execute  )  [virtual]
 

Removes the floating endpoint from the Line Tool, creating an undo action to insert the endpoint.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/12/94
Parameters:
- [INPUTS]
- [OUTPUTS]
Returns:
ActionCode, either AC_OK, AC_NORECORD or AC_FAIL

Errors: -

See also:
InsertFloaterAction::Execute

Reimplemented from Action.

Definition at line 1376 of file opbezier.cpp.

01377 {
01378     ERROR3IF(pLineTool == NULL, "Pointer to line tool was NULL");
01379 
01380     InsertFloaterAction* ReAction = NULL;
01381     ActionCode Act = AC_FAIL;
01382     
01383     // Create a redo action for this action, which is an InsertFloaterAction
01384     if (pLineTool != NULL)
01385     {
01386         DocCoord    OldPos;
01387         Spread*     OldpSpread;
01388         Document*   OldpDoc;
01389 
01390         if (pLineTool->GetMoveTo(&OldpSpread, &OldPos, &OldpDoc))
01391         {
01392             Act = InsertFloaterAction::Init(pOperation, pOppositeActLst, (Action**)(&ReAction));
01393             if (ReAction != NULL)
01394             {
01395                 ReAction->pLineTool = pLineTool;
01396                 ReAction->pSpread = OldpSpread;
01397                 ReAction->Point = OldPos;
01398             }
01399 
01400             if (Act == AC_FAIL)
01401                 return AC_FAIL;
01402         }
01403 
01404         // Now do the actual action
01405         pLineTool->ClearMoveTo();
01406     }
01407 
01408     return Act;
01409 }

ActionCode RemoveFloaterAction::Init Operation pOp,
ActionList pActionList,
BezierTool pTool,
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_NO_RECORD 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:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
05/12/94
Parameters:
pOp is the pointer to the operation to which this action belongs [INPUTS] pTool is a pointer to the Line tool so the action can access the SetLineTo and ClearLineTo functions pActionList is the action list to which this action should be added
NewAction is a pointer to a pointer to an action, allowing the function to [OUTPUTS] return a pointer to the created action
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL

Errors: -

See also:
Action::Init()

Definition at line 1313 of file opbezier.cpp.

01317 {
01318     UINT32 ActSize = sizeof(RemoveFloaterAction);
01319 
01320     ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(RemoveFloaterAction), NewAction);
01321     if ((Ac == AC_OK) && (*NewAction != NULL))
01322     {
01323         ((RemoveFloaterAction*)*NewAction)->pLineTool = pTool;
01324     }
01325     return Ac;
01326 }


Member Data Documentation

BezierTool* RemoveFloaterAction::pLineTool [protected]
 

Definition at line 313 of file opbezier.h.


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