#include <textacts.h>
Inheritance diagram for StoreCharCodeAction:
Public Member Functions | |
StoreCharCodeAction () | |
Constructor - initialises the member variables. | |
~StoreCharCodeAction () | |
Destructor. | |
virtual ActionCode | Execute () |
Called during undo/redo to restore a character code to a particular character Inserts StoreCharCodeAction to restore the current character code then sets it to the value in the action. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *, ActionList *, TextStory *, TextChar *) |
static BOOL | DoStoreCharacterCode (Operation *pOp, ActionList *, TextChar *) |
Protected Attributes | |
TextChar * | pChar |
WCHAR | CharCode |
Definition at line 145 of file textacts.h.
|
Constructor - initialises the member variables.
Definition at line 150 of file textacts.cpp.
|
|
Destructor.
Definition at line 164 of file textacts.cpp.
|
|
Definition at line 253 of file textacts.cpp. 00254 { 00255 // Check the parameters 00256 ERROR2IF(pOp == NULL, AC_FAIL, "The operation pointer is NULL"); 00257 ERROR2IF(pActionList == NULL, AC_FAIL, "The action list pointer is NULL"); 00258 ERROR2IF(pTextChar == NULL, AC_FAIL, "TextChar pointer is NULL"); 00259 00260 // Get a pointer to the characters parent TextStory 00261 TextStory* pParentStory = (TextStory*)pTextChar->FindParent(CC_RUNTIME_CLASS(TextStory)); 00262 ERROR2IF(pParentStory == NULL, AC_FAIL, "TextChar has no parent TextStory"); 00263 00264 // Insert the action 00265 ActionCode Ac; 00266 Ac = Init(pOp, pActionList, pParentStory, pTextChar); 00267 00268 return (Ac != AC_FAIL); 00269 }
|
|
Called during undo/redo to restore a character code to a particular character Inserts StoreCharCodeAction to restore the current character code then sets it to the value in the action.
Reimplemented from Action. Definition at line 178 of file textacts.cpp. 00179 { 00180 // Check the member variables 00181 ERROR2IF(pStory == NULL, AC_FAIL, "The TextStory pointer is NULL"); 00182 ERROR2IF(pChar == NULL, AC_FAIL, "TextChar pointer is NULL"); 00183 00184 // Insert an action to restore the character code to its current value on redo 00185 ActionCode ActCode; 00186 ActCode = StoreCharCodeAction::Init(pOperation, pOppositeActLst, pStory, pChar); 00187 00188 // Now set the character code the old value 00189 if (ActCode != AC_FAIL) 00190 pChar->SetUnicodeValue(CharCode); 00191 00192 return ActCode; 00193 }
|
|
Definition at line 213 of file textacts.cpp. 00214 { 00215 // Check the parameters 00216 ERROR2IF(pOp == NULL, AC_FAIL, "The operation pointer is NULL"); 00217 ERROR2IF(pActionList == NULL, AC_FAIL, "The action list pointer is NULL"); 00218 ERROR2IF(pTextStory == NULL, AC_FAIL, "The TextStory pointer is NULL"); 00219 ERROR2IF(pTextChar == NULL, AC_FAIL, "TextChar pointer is NULL"); 00220 00221 // Create a new action and insert it in the action list 00222 UINT32 ActSize = sizeof(StoreCharCodeAction); 00223 StoreCharCodeAction* pNewAction = NULL; 00224 ActionCode Ac = Action::Init( pOp, pActionList, ActSize, CC_RUNTIME_CLASS(StoreCharCodeAction), (Action**)&pNewAction); 00225 00226 // Set the members of the new action 00227 if ((Ac == AC_OK) && (pNewAction != NULL)) 00228 { 00229 pNewAction->pStory = pTextStory; 00230 pNewAction->pChar = pTextChar; 00231 pNewAction->CharCode = pTextChar->GetUnicodeValue(); 00232 } 00233 00234 return Ac; 00235 }
|
|
Definition at line 159 of file textacts.h. |
|
Definition at line 158 of file textacts.h. |