Arbortext Command Language > Callbacks > doc_add_callback > copy Callback Type
  
copy Callback Type
Function prototype:
function funcname (doc, buffername, op)
copy is called before a copy operation is done in the Edit pane.
It is not called if the copy will request an external selection (that is, Arbortext Editor does not own the selection). This caveat does not apply to Windows platforms, because they do not support external selections.
A drag and drop action uses a special paste buffer named _APT_DRAGDROP_PASTEBUF. You can check _APT_DRAGDROP_PASTEBUF to tell if the copy operation is due to a drag and drop action.
Arguments
doc is the identifier of the document in which the copy was attempted and can be used to derive the cursor position and/or the selected region.
buffername is the name of the paste buffer that is the target of the copy. The standard paste buffer is named "default".
op is the function callback operation. Callbacks are called twice in succession with op specifying the stage of callback operation.
1. op == 1 first call — The returned argument specifies whether the execution should continue or be stopped:
0 — Continue callback processing.
-1 — Stop further callback processing.
2. op == 2 second call — Occurs unless the processing was stopped during the first call. The returned argument allows or prevents basic Arbortext Editor processing after all callbacks have been called:
0 — Basic Arbortext Editor processing allowed.
-1 — Basic Arbortext Editor processing prevented.