#include <cpyact.h>
Inheritance diagram for CopyObjectsToClipboardAction:
Public Member Functions | |
CopyObjectsToClipboardAction () | |
~CopyObjectsToClipboardAction () | |
CopyObjectsToClipboardAction destructor. | |
virtual ActionCode | Execute () |
Executes the CopyObjectsToClipboardAction which when executed on an undo list does nothing except spawn a redo CopyObjectsToClipboardAction. | |
Static Public Member Functions | |
static ActionCode | Init (Operation *const pOp, ActionList *pActionList, Range NodeRange, Action **NewAction) |
To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list. | |
Private Attributes | |
Range | NodeRange |
Definition at line 122 of file cpyact.h.
|
|
|
CopyObjectsToClipboardAction destructor.
Definition at line 150 of file cpyact.cpp.
|
|
Executes the CopyObjectsToClipboardAction which when executed on an undo list does nothing except spawn a redo CopyObjectsToClipboardAction.
Reimplemented from Action. Definition at line 174 of file cpyact.cpp. 00175 { 00176 ActionCode ActCode; 00177 00178 // Create the twin action 00179 CopyObjectsToClipboardAction* CpyObjAct; 00180 00181 if ( (ActCode = CopyObjectsToClipboardAction::Init(pOperation, 00182 pOppositeActLst, 00183 NodeRange, 00184 (Action**)(&CpyObjAct))) 00185 != AC_FAIL) 00186 { 00187 // Is this a redo action ? 00188 if (pOppositeActLst == pOperation->GetUndoActionList()) 00189 { 00190 BOOL CopiedOK; 00191 00192 // After the operation ends we will need to inform all DocComponents in the clipboard 00193 // of the outcome. 00194 pOperation->InformDocComponentsOfOperationsOutcome(InternalClipboard::Instance()); 00195 00196 // Inform all DocComponents in the clipboard that a copy is about to take place 00197 BOOL ok; 00198 CALL_WITH_FAIL(InternalClipboard::Instance()->StartComponentCopy(), pOperation, ok) 00199 if (!ok) 00200 { 00201 // Start Component copy has failed so abort operation 00202 // Note that AbortComponentCopy will get called in the ops end method 00203 return AC_FAIL; 00204 } 00205 00206 00207 // Copy the selection to the clipboard 00208 CALL_WITH_FAIL(InternalClipboard::CopyObjects(NodeRange, pOperation), pOperation, CopiedOK) 00209 00210 if (!CopiedOK) 00211 { 00212 return AC_FAIL; 00213 } 00214 00215 // Now try and copy accross the component data 00216 CALL_WITH_FAIL(InternalClipboard::CopyComponentData(GetWorkingDoc()), 00217 pOperation, 00218 CopiedOK) 00219 if (!CopiedOK) return AC_FAIL; 00220 } 00221 // else do nothing 00222 }; 00223 00224 return ActCode; 00225 }
|
|
To check that there is sufficient room for the action in the operation history, and if there is, then to add the action to the operations action list.
NodeRange: The range of nodes to copy
AC_OK : The action was successfully initialised and added to the operation. The function calls the Action::Init function passing the runtime class of a CopyObjectsToClipboardAction.
Definition at line 270 of file cpyact.cpp. 00275 { 00276 ActionCode Ac = (Action::Init(pOp, 00277 pActionList, 00278 sizeof(CopyObjectsToClipboardAction), 00279 CC_RUNTIME_CLASS(CopyObjectsToClipboardAction), 00280 NewAction)); 00281 00282 if (Ac != AC_FAIL) 00283 if (*NewAction != NULL) 00284 { 00285 // Store the range and transform in the action 00286 ((CopyObjectsToClipboardAction*)(*NewAction))->NodeRange = NodeRange; 00287 } 00288 00289 return (Ac); 00290 }
|
|
|