DL Logo

PDActionHandler Typedefs

PDActionHandler

Header: PDExpT.h:135

Syntax

typedef struct _t_PDActionHandler *PDActionHandler;

Used By

PDActionHandlerData

Header: PDExpT.h:146

Description

Used to store PDAction data for copy and paste operations.

Related Methods

Syntax

typedef void *PDActionHandlerData;

Used By

PDActionHandler Callback Signatures

PDActionHandlerCanCopyProc

Header: PDExpT.h:176

Description

(Optional) A callback for PDActionHandler. It returns true if the copy operation is expected to succeed. It tests, for example, whether copying is allowed by document permissions.

Note: The handler is not expected to test other actions (if any) in the action chain.

Syntax

ASBool PDActionHandlerCanCopyProc(PDActionHandler pdah, PDAction action);

Parameters

pdah
The action handler.
action
The action object.

Returns

true if the action can be copied, false if it cannot.

Used In

PDActionHandlerCanPasteProc

Header: PDExpT.h:215

Description

(Optional) A callback for PDActionHandler. It returns true if the paste operation is expected to succeed. It tests, for example, whether pasting is allowed by document permissions.

Note: The handler is not expect to test other actions (if any) in the action chain.

Syntax

ASBool PDActionHandlerCanPasteProc(PDActionHandler pdah, PDDoc dest, PDActionHandlerData data);

Parameters

pdah
The action handler.
dest
The destination document.
data
The action data to test.

Returns

true if the action can be pasted to the document, false if it cannot.

Used In

PDActionHandlerCopyProc

Header: PDExpT.h:195

Description

(Optional) A callback for PDActionHandler. It copies data from an action object to a new data structure, from which it can be pasted to a new document. The PDActionHandlerData does not store any information related to a Next action. Rebuilding the action chain is the responsibility of the caller and can be ignored by the PDActionHandler.

Syntax

PDActionHandlerData PDActionHandlerCopyProc(PDActionHandler pdah, PDAction action);

Parameters

pdah
The action handler.
action
The action object.

Returns

The new structure containing the action data.

Used In

PDActionHandlerDestroyDataProc

Header: PDExpT.h:251

Description

A callback for PDActionHandler. It destroys data copied into an action clipboard data structure after it has been successfully pasted to a new document.

Syntax

void PDActionHandlerDestroyDataProc(PDActionHandler pdah, PDActionHandlerData data);

Parameters

pdah
The action handler.
data
The action data to destroy.

Used In

PDActionHandlerDestroyProc

Header: PDExpT.h:261

Description

(Optional) A callback for PDActionHandler. It destroys the action handler structure when the application no longer requires it. The handler should destroy any dynamic memory stored in the userData field.

Related Methods

Syntax

void PDActionHandlerDestroyProc(PDActionHandler pdah);

Parameters

pdah
The action handler to destroy.

Used In

PDActionHandlerGetTypeProc

Header: PDExpT.h:157

Description

A callback for PDActionHandler. It returns an ASAtom indicating the action type for which the handler is responsible. Types are defined by the client when registering the action handler.

Related Methods

Syntax

ASAtom PDActionHandlerGetTypeProc(PDActionHandler pdah);

Parameters

pdah
The action handler whose type is returned.

Returns

The action type for which this handler is responsible.

Used In

PDActionHandlerPasteProc

Header: PDExpT.h:235

Description

(Optional) A callback for PDActionHandler. It creates a new PDAction in the destination document using data that was placed in a PDActionClipboardA data structure using the PDActionCopy() function, and returns the new action object.

Syntax

PDAction PDActionHandlerPasteProc(PDActionHandler pdah, PDDoc dest, PDActionHandlerData data);

Parameters

pdah
The action handler.
dest
The destination document.
data
The action data to paste.

Returns

The new action object containing the pasted data and associated with the document.

Used In

PDActionHandler Structures

_t_PDActionHandler

Header: PDExpT.h:269

Description

A data structure containing callbacks that implement an action manager. The callbacks provide copy-and-paste functionality for a particular type of action.

Related Methods

Syntax

struct _t_PDActionHandler {
ASSize_t size;
The size of the data structure. It must be set to sizeof(PDAnnotHandlerRec).
void *userData;
A pointer to a block of user-supplied data.
} PDActionHandlerRec;

Used In

PDActionHandler Functions

PDRegisterActionHandler

Header: PDProcs.h:8739

Description

Registers a handler for PDAction operations.

Syntax

void PDRegisterActionHandler(PDActionHandler handler);

Parameters

handler
A pointer to a structure containing the action handler's callbacks. This structure must not be freed after this call, but must be retained.