ToggleAutoKerningAction Class Reference

Toggle a story's auto kerning value. More...

#include <textops.h>

Inheritance diagram for ToggleAutoKerningAction:

Action ListItem CCObject SimpleCCObject List of all members.

Public Member Functions

 ToggleAutoKerningAction ()
 Constructor for the action.
virtual ActionCode Execute ()
 Executes the action. Uses Init() to undo/redo the action.

Static Public Member Functions

static ActionCode Init (Operation *pOp, ActionList *pActionList, TextStory *pStory, BOOL NewIsAutoKerning)
 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.

Protected Attributes

TextStorypTextStory
bool OldIsAutoKerning

Detailed Description

Toggle a story's auto kerning value.

Author:
Jonathan_Payne (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/2000

Definition at line 604 of file textops.h.


Constructor & Destructor Documentation

ToggleAutoKerningAction::ToggleAutoKerningAction  ) 
 

Constructor for the action.

Author:
Jonathan_Payne (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/2000

Definition at line 6212 of file textops.cpp.

06213 {
06214     pTextStory          = 0;
06215     OldIsAutoKerning    = FALSE;
06216 }


Member Function Documentation

ActionCode ToggleAutoKerningAction::Execute  )  [virtual]
 

Executes the action. Uses Init() to undo/redo the action.

Author:
Jonathan_Payne (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/2000
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL
See also:
Action::Init()

Reimplemented from Action.

Definition at line 6285 of file textops.cpp.

06286 {
06287     ActionCode Act;
06288 
06289     Act = ToggleAutoKerningAction::Init(pOperation, 
06290                                         pOppositeActLst,
06291                                         pTextStory,
06292                                         OldIsAutoKerning);
06293 
06294     return Act;
06295 }

ActionCode ToggleAutoKerningAction::Init Operation pOp,
ActionList pActionList,
TextStory pStory,
BOOL  NewIsAutoKerning
[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:
Jonathan_Payne (Xara Group Ltd) <camelotdev@xara.com>
Date:
27/10/2000
Parameters:
pOp = ptr to the operation to which this action belongs [INPUTS] pActionList = ptr to action list to which this action should be added pStory = ptr to TextStory to change NewIsAutoKerning = as the name says
Returns:
ActionCode, one of AC_OK, AC_NO_RECORD or AC_FAIL
See also:
Action::Init()

Definition at line 6243 of file textops.cpp.

06247 {
06248     ERROR2IF(pStory==0,AC_FAIL,"pStory was NULL");
06249 
06250     UINT32 ActSize = sizeof(ToggleAutoKerningAction);
06251 
06252     ToggleAutoKerningAction* pNewAction = NULL;
06253 
06254     ActionCode Ac = Action::Init(   pOp,
06255                                     pActionList,
06256                                     ActSize,
06257                                     CC_RUNTIME_CLASS(ToggleAutoKerningAction),
06258                                     (Action**)&pNewAction);
06259 
06260     if ((Ac != AC_FAIL) && (pNewAction != NULL))
06261     {
06262         ERROR2IF(pStory == NULL,AC_FAIL,"TextStory pointer was NULL");
06263         pNewAction->pTextStory          = pStory;
06264         pNewAction->OldIsAutoKerning    = !NewIsAutoKerning;
06265 
06266         pStory->SetAutoKerning(NewIsAutoKerning);
06267         pStory->FlagNodeAndDescendantsModifiedByOpAndParentsHaveDescendantModifiedByOp();
06268         pStory->FormatAndChildren(NULL,FALSE);
06269     }
06270 
06271     return Ac;
06272 }


Member Data Documentation

bool ToggleAutoKerningAction::OldIsAutoKerning [protected]
 

Definition at line 618 of file textops.h.

TextStory* ToggleAutoKerningAction::pTextStory [protected]
 

Definition at line 617 of file textops.h.


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