ReversePathAction Class Reference

This action is used to reverse (change direction of) the path inside a TextStory. More...

#include <textacts.h>

Inheritance diagram for ReversePathAction:

BaseTextAction Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ReversePathAction ()
 Constructor - initialises the member variables.
 ~ReversePathAction ()
 Destructor.
virtual ActionCode Execute ()
 Called during undo/redo to reverse the path inside a TextStory Inserts a similar action into the opposite action list then reverses the path.

Static Public Member Functions

static ActionCode Init (Operation *, ActionList *, TextStory *)
static BOOL DoReversePath (Operation *pOp, ActionList *, TextStory *)

Detailed Description

This action is used to reverse (change direction of) the path inside a TextStory.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/5/95
See also:
BaseTextAction

Definition at line 212 of file textacts.h.


Constructor & Destructor Documentation

ReversePathAction::ReversePathAction  ) 
 

Constructor - initialises the member variables.

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

Definition at line 416 of file textacts.cpp.

00417 {
00418 }

ReversePathAction::~ReversePathAction  ) 
 

Destructor.

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

Definition at line 428 of file textacts.cpp.

00429 {
00430 }


Member Function Documentation

BOOL ReversePathAction::DoReversePath Operation pOp,
ActionList ,
TextStory
[static]
 

Definition at line 509 of file textacts.cpp.

00510 {
00511     // Check the parameters
00512     ERROR2IF(pOp == NULL, FALSE, "The operation pointer is NULL");
00513     ERROR2IF(pActionList == NULL, FALSE, "The action list pointer is NULL");
00514     ERROR2IF(pTextStory == NULL, FALSE, "The TextStory pointer is NULL");
00515     ERROR3IF(pTextStory->GetTextPath() == NULL, "TextStory was not on a path");
00516 
00517     // Insert an action to restore the path on undo (just reverse it back)
00518     ActionCode ActCode;
00519     ActCode = ReversePathAction::Init(pOp, pActionList, pTextStory);
00520 
00521     // Now reverse the path
00522     if (ActCode != AC_FAIL)
00523         pTextStory->ReverseTextOnPath();
00524 
00525     return (ActCode != AC_FAIL);
00526 }

ActionCode ReversePathAction::Execute  )  [virtual]
 

Called during undo/redo to reverse the path inside a TextStory Inserts a similar action into the opposite action list then reverses the path.

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

Reimplemented from Action.

Definition at line 441 of file textacts.cpp.

00442 {
00443     // Check the member variables
00444     ERROR2IF(pStory == NULL, AC_FAIL, "The TextStory pointer is NULL");
00445     ERROR2IF(pOperation == NULL, AC_FAIL, "The operation pointer is NULL(!)");
00446 
00447     // Insert an action to reverse the path again on redo
00448     ActionCode ActCode;
00449     ActCode = ReversePathAction::Init(pOperation, pOppositeActLst, pStory);
00450 
00451     // Now reverse the path
00452     if (ActCode != AC_FAIL)
00453         pStory->ReverseTextOnPath();
00454 
00455     return ActCode;
00456 }

ActionCode ReversePathAction::Init Operation ,
ActionList ,
TextStory
[static]
 

Definition at line 474 of file textacts.cpp.

00475 {
00476     // Check the parameters
00477     ERROR2IF(pOp == NULL, AC_FAIL, "The operation pointer is NULL");
00478     ERROR2IF(pActionList == NULL, AC_FAIL, "The action list pointer is NULL");
00479     ERROR2IF(pTextStory == NULL, AC_FAIL, "The TextStory pointer is NULL");
00480 
00481     // Create a new action and insert it in the action list
00482     UINT32 ActSize = sizeof(ReversePathAction);
00483     ReversePathAction* pNewAction = NULL;
00484     ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(ReversePathAction), (Action**)&pNewAction);
00485 
00486     // Set the members of the new action
00487     if ((Ac == AC_OK) && (pNewAction != NULL))
00488         pNewAction->pStory = pTextStory;
00489 
00490     return Ac;
00491 }


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