StorePathIndentAction Class Reference

This action is used to store a text stories path indent value. More...

#include <textops.h>

Inheritance diagram for StorePathIndentAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 StorePathIndentAction ()
 Constructor for StorePathIndentAction. Initialises the member variables.
 ~StorePathIndentAction ()
 Destructor for StorePathIndentAction.
virtual ActionCode Execute ()
 This action inserts the opposite StorePathIndentAction for redo purposes, then set the indent in the TextStory to the stored value.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, TextStory *pStory, MILLIPOINT LeftIndent, MILLIPOINT RightIndent, MILLIPOINT StoryWidth)
 Sets up the action to store a text story path indent.
static BOOL DoStoreIndent (Operation *pOp, ActionList *pActionList, TextStory *pStory)
 Call this function to store the current text story path indent value before changing it.

Protected Attributes

TextStorympTextStory
MILLIPOINT mLeftIndentLength
MILLIPOINT mRightIndentLength
MILLIPOINT mStoryWidth

Detailed Description

This action is used to store a text stories path indent value.

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

Definition at line 756 of file textops.h.


Constructor & Destructor Documentation

StorePathIndentAction::StorePathIndentAction  ) 
 

Constructor for StorePathIndentAction. Initialises the member variables.

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

Definition at line 5867 of file textops.cpp.

05868 {
05869     mpTextStory = NULL;
05870     mLeftIndentLength = 0;
05871     mRightIndentLength = 0;
05872     mStoryWidth = 0;
05873 }

StorePathIndentAction::~StorePathIndentAction  ) 
 

Destructor for StorePathIndentAction.

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

Definition at line 5884 of file textops.cpp.

05885 {
05886 }


Member Function Documentation

BOOL StorePathIndentAction::DoStoreIndent Operation pOp,
ActionList pActionList,
TextStory pStory
[static]
 

Call this function to store the current text story path indent value before changing it.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/12/95
Parameters:
pOp is the pointer to the operation to which this action belongs [INPUTS] pActionList is the action list to which this action should be added pStory - pointer to the text story to apply this action to
Returns:
TRUE/FALSE for success/failure
See also:
StorePathIndentAction::Init()

Definition at line 5991 of file textops.cpp.

05992 {
05993     // Salary check
05994     ERROR2IF(pStory == NULL, FALSE, "The TextStory pointer is NULL");
05995     
05996     // Create an action for this
05997     ActionCode Act;
05998     Act = StorePathIndentAction::Init(pOp, pActionList, pStory, pStory->GetLeftIndent(), pStory->GetRightIndent(), pStory->GetStoryWidth());
05999 
06000     return (Act != AC_FAIL);
06001 }

ActionCode StorePathIndentAction::Execute  )  [virtual]
 

This action inserts the opposite StorePathIndentAction for redo purposes, then set the indent in the TextStory to the stored value.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
12/18/95
Returns:
ActionCode, either AC_OK, AC_NORECORD or AC_FAIL

Errors: Checks on pointers

Reimplemented from Action.

Definition at line 5900 of file textops.cpp.

05901 {
05902     // Salary checks
05903     ERROR2IF(mpTextStory == NULL, AC_FAIL, "The TextStory pointer is NULL");
05904     
05905     // Create a redo action for this action, which is also a StorePathIndentAction
05906     ActionCode Act;
05907     Act = StorePathIndentAction::Init(pOperation, 
05908                                         pOppositeActLst, 
05909                                         mpTextStory,
05910                                         mpTextStory->GetLeftIndent(),
05911                                         mpTextStory->GetRightIndent(),
05912                                         mpTextStory->GetStoryWidth());
05913 
05914     // Now undo
05915     if (Act != AC_FAIL)
05916     {
05917         mpTextStory->SetLeftIndent(mLeftIndentLength);
05918         mpTextStory->SetRightIndent(mRightIndentLength);
05919         mpTextStory->SetStoryWidth(mStoryWidth);
05920     }
05921 
05922     return Act;
05923 }

ActionCode StorePathIndentAction::Init Operation pOp,
ActionList pActionList,
TextStory pStory,
MILLIPOINT  LeftIndent,
MILLIPOINT  RightIndent,
MILLIPOINT  StoryWidth
[static]
 

Sets up the action to store a text story path indent.

Author:
Peter_Arnold (Xara Group Ltd) <camelotdev@xara.com>
Date:
18/12/95
Parameters:
pOp is the pointer to the operation to which this action belongs [INPUTS] pActionList is the action list to which this action should be added pStory - pointer to the text story to apply this action to LeftIndent - the left path indent value RightIndent - the right path indent value StoryWidth - the width of the story
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL
See also:
Action::Init(), StorePathIndentAction::Execute()

Definition at line 5947 of file textops.cpp.

05953 {
05954     // Salary check
05955     ERROR2IF(pStory == NULL, AC_FAIL, "TextStory pointer was NULL");
05956 
05957     // Create the new action
05958     UINT32 ActSize = sizeof(StorePathIndentAction);
05959     StorePathIndentAction* pNewAction = NULL;
05960     ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(StorePathIndentAction), (Action**)&pNewAction);
05961 
05962     // Fill in its data
05963     if ((Ac == AC_OK) && (pNewAction != NULL))
05964     {
05965         pNewAction->mpTextStory = pStory;
05966         pNewAction->mLeftIndentLength = LeftIndent;
05967         pNewAction->mRightIndentLength = RightIndent;
05968         pNewAction->mStoryWidth = StoryWidth;
05969     }
05970 
05971     return Ac;
05972 }


Member Data Documentation

MILLIPOINT StorePathIndentAction::mLeftIndentLength [protected]
 

Definition at line 770 of file textops.h.

TextStory* StorePathIndentAction::mpTextStory [protected]
 

Definition at line 769 of file textops.h.

MILLIPOINT StorePathIndentAction::mRightIndentLength [protected]
 

Definition at line 771 of file textops.h.

MILLIPOINT StorePathIndentAction::mStoryWidth [protected]
 

Definition at line 772 of file textops.h.


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