InsertFloaterAction Class Reference

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

#include <opbezier.h>

Inheritance diagram for InsertFloaterAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 InsertFloaterAction ()
 Constructor for the action to insert a floating endpoint.
 ~InsertFloaterAction ()
virtual ActionCode Execute ()
 Inserts the floating endpoint into the Line Tool, creating an undo action to remove the endpoint.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, 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 DoInsert (Operation *pOp, ActionList *pActionList, BezierTool *pTool, DocCoord *pPoint, Spread *pSpread)
 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.

Public Attributes

BezierToolpLineTool
DocCoord Point
SpreadpSpread

Detailed Description

An action to provide the Line tool with an undoable way of inserting 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 259 of file opbezier.h.


Constructor & Destructor Documentation

InsertFloaterAction::InsertFloaterAction  ) 
 

Constructor for the action to insert 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 1133 of file opbezier.cpp.

01134 {
01135     pLineTool = NULL;
01136 }

InsertFloaterAction::~InsertFloaterAction  ) 
 

Definition at line 1256 of file opbezier.cpp.

01257 {
01258 }


Member Function Documentation

ActionCode InsertFloaterAction::DoInsert Operation pOp,
ActionList pActionList,
BezierTool pTool,
DocCoord pPoint,
Spread pSpread
[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:
RemoveFloaterAction::DoRemove

Definition at line 1198 of file opbezier.cpp.

01203 {
01204     InsertFloaterAction* RecAction = NULL;
01205     ActionCode Act = InsertFloaterAction::Init(pOp, pActionList, (Action**)&RecAction);
01206     if ( (Act == AC_OK) && (RecAction != NULL) )
01207     {
01208         RecAction->pLineTool = pTool;
01209         RecAction->pSpread = pSpread;
01210         RecAction->Point = *pPoint;
01211     }
01212     return Act;
01213 }

ActionCode InsertFloaterAction::Execute  )  [virtual]
 

Inserts the floating endpoint into the Line Tool, creating an undo action to remove 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:
RemoveFloaterAction::Execute

Reimplemented from Action.

Definition at line 1232 of file opbezier.cpp.

01233 {
01234     ERROR3IF(pLineTool == NULL, "Pointer to line tool was NULL");
01235 
01236     RemoveFloaterAction* ReAction = NULL;
01237     ActionCode Act = AC_FAIL;
01238     
01239     // Create a redo action for this action, which is a RemoveFloaterAction
01240     if (pLineTool != NULL)
01241     {
01242         Act = RemoveFloaterAction::Init(pOperation, 
01243                                         pOppositeActLst, 
01244                                         pLineTool,
01245                                         (Action**)(&ReAction));
01246         if (Act == AC_FAIL)
01247             return AC_FAIL;
01248 
01249         // Now do the actual action
01250         pLineTool->SetMoveTo(Point, pSpread, GetWorkingDoc());
01251     }
01252 
01253     return Act;
01254 }

ActionCode InsertFloaterAction::Init Operation pOp,
ActionList pActionList,
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 1166 of file opbezier.cpp.

01169 {
01170     UINT32 ActSize = sizeof(InsertFloaterAction);
01171 
01172     ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(InsertFloaterAction), NewAction);
01173     return Ac;
01174 }


Member Data Documentation

BezierTool* InsertFloaterAction::pLineTool
 

Definition at line 277 of file opbezier.h.

DocCoord InsertFloaterAction::Point
 

Definition at line 278 of file opbezier.h.

Spread* InsertFloaterAction::pSpread
 

Definition at line 279 of file opbezier.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:55:29 2007 for Camelot by  doxygen 1.4.4