BeginClone
The BeginClone method initiates a cloning transaction to transfer data from this draft to the specified destination draft.
ODDraftKey BeginClone (in ODDraft destDraft, in ODFrame destFrame, in ODCloneKind kind);
destDraft- A reference to the destination draft to which objects are to be cloned.
destFrame- A reference to the destination frame, or
kODNULLif the clone operation is not a paste or a drop.kind- The kind of clone operation being performed.
- return value
- The draft key for this cloning transaction.
DISCUSSION
TheBeginClonemethod sets up a cloning transaction of the specified kind and returns a unique draft key that identifies the transaction. Other methods involved in cloning require you to supply this draft key as a parameter. The Bento container suite allows only one cloning transaction at any given time.The
destFrameparameter allows OpenDoc to detect an attempt to move a part into one of its embedded frames. For pasting operations, thedestFrameparameter should be set to the part's active frame. For dropping operations, this parameter should be set to the drop target frame. In all other cases, this parameter should be set to null.The
kindparameter indicates the nature of the cloning operation required, such as copy object from source to clipboard (kODCloneCopy), cut object from source to clipboard (kODCloneCut), and so on. When performing a drop, a part must usekODCloneDropCopyorkODCloneDropMove; it should not use the clipboard clone kindkODClonePaste.After calling this method, you call this draft object's
Clonemethod to clone a particular persistent object. To commit a successful cloning transaction, call this draft object'sEndClonemethod; before theEndClonemethod has successfully executed, there is no guarantee that all the objects have been copied. If the cloning operation cannot be completed for any reason, you must terminate the transaction by calling this draft object'sAbortClonemethod.EXCEPTIONS
kODErrCloningInProgress- Another cloning process is in progress.
kODErrInconsistentCloneKind- The specified clone kind is used inconsistently. For example, a paste or drop clone kind can occur only following a copy or cut operation.
kODErrInvalidCloneKind- The specified clone kind is not valid.
kODErrInvalidDestinationDraft- The specified destination draft is not valid for the specified clone kind.
SEE ALSO
TheODCloneKindtype (page 917).
TheODDraftKeytype (page 902).
TheODDraft::AbortClonemethod (page 151).
TheODDraft::Clonemethod (page 162).
TheODDraft::EndClonemethod (page 171).
"BeginClone" on page 322 in OpenDoc Programmer's Guide.