#include <textacts.h>
Inheritance diagram for StoreKernCodeAction:
Public Member Functions | |
StoreKernCodeAction () | |
Constructor - initialises the member variables. | |
~StoreKernCodeAction () | |
Destructor. | |
virtual ActionCode | Execute () |
Called during undo/redo to restore a kern code value Inserts a StoreKernCodeAction to restore the current kern value then sets it to the value in the action. | |
KernCode * | GetKernCode () const |
DocCoord | GetKernValue () const |
void | SetKernCode (DocCoord NewValue) |
Static Public Member Functions | |
static ActionCode | Init (Operation *, ActionList *, TextStory *, KernCode *) |
static BOOL | DoStoreKernValue (Operation *pOp, ActionList *, KernCode *) |
Protected Attributes | |
KernCode * | pKernCode |
DocCoord | KernValue |
Definition at line 177 of file textacts.h.
|
Constructor - initialises the member variables.
Definition at line 283 of file textacts.cpp.
|
|
Destructor.
Definition at line 297 of file textacts.cpp.
|
|
Definition at line 386 of file textacts.cpp. 00387 { 00388 // Check the parameters 00389 ERROR2IF(pOp == NULL, AC_FAIL, "The operation pointer is NULL"); 00390 ERROR2IF(pActionList == NULL, AC_FAIL, "The action list pointer is NULL"); 00391 ERROR2IF(pKern == NULL, AC_FAIL, "TextChar pointer is NULL"); 00392 00393 // Get a pointer to the characters parent TextStory 00394 TextStory* pParentStory = (TextStory*)pKern->FindParent(CC_RUNTIME_CLASS(TextStory)); 00395 ERROR2IF(pParentStory == NULL, AC_FAIL, "TextChar has no parent TextStory"); 00396 00397 // Insert the action 00398 ActionCode Ac; 00399 Ac = Init(pOp, pActionList, pParentStory, pKern); 00400 00401 return (Ac != AC_FAIL); 00402 }
|
|
Called during undo/redo to restore a kern code value Inserts a StoreKernCodeAction to restore the current kern value then sets it to the value in the action.
Reimplemented from Action. Definition at line 311 of file textacts.cpp. 00312 { 00313 // Check the member variables 00314 ERROR2IF(pStory == NULL, AC_FAIL, "The TextStory pointer is NULL"); 00315 ERROR2IF(pKernCode == NULL, AC_FAIL, "TextChar pointer is NULL"); 00316 00317 // Insert an action to restore the kern code to its current value on redo 00318 ActionCode ActCode; 00319 ActCode = StoreKernCodeAction::Init(pOperation, pOppositeActLst, pStory, pKernCode); 00320 00321 // Now set the kern code the old value 00322 if (ActCode != AC_FAIL) 00323 pKernCode->SetValue(KernValue); 00324 00325 return ActCode; 00326 }
|
|
Definition at line 190 of file textacts.h. 00190 {return pKernCode;}
|
|
Definition at line 191 of file textacts.h. 00191 {return KernValue;}
|
|
Definition at line 346 of file textacts.cpp. 00347 { 00348 // Check the parameters 00349 ERROR2IF(pOp == NULL, AC_FAIL, "The operation pointer is NULL"); 00350 ERROR2IF(pActionList == NULL, AC_FAIL, "The action list pointer is NULL"); 00351 ERROR2IF(pTextStory == NULL, AC_FAIL, "The TextStory pointer is NULL"); 00352 ERROR2IF(pKern == NULL, AC_FAIL, "KernCode pointer is NULL"); 00353 00354 // Create a new action and insert it in the action list 00355 UINT32 ActSize = sizeof(StoreKernCodeAction); 00356 StoreKernCodeAction* pNewAction = NULL; 00357 ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(StoreKernCodeAction), (Action**)&pNewAction); 00358 00359 // Set the members of the new action 00360 if ((Ac == AC_OK) && (pNewAction != NULL)) 00361 { 00362 pNewAction->pStory = pTextStory; 00363 pNewAction->pKernCode = pKern; 00364 pNewAction->KernValue = pKern->GetValue(); 00365 } 00366 00367 return Ac; 00368 }
|
|
Definition at line 192 of file textacts.h. 00192 {KernValue = NewValue;}
|
|
Definition at line 196 of file textacts.h. |
|
Definition at line 195 of file textacts.h. |