Layer | AV_Layer |
Object | AVActionHandler |
An AVActionHandler carries out an action. For instance, an action is what happens when a link or bookmark is clicked in Acrobat. See Section 8.5 in the PDF Reference for more information on actions.
When Acrobat executes an action, it looks for the action handler with a type matching that of the action it is trying to execute. Acrobat invokes the matching handler to perform the action. If no match is found, Acrobat ignores the user action.
Your plug-in can add new action handlers by using AVAppRegisterActionHandler(), expanding the range of action types to which Acrobat can respond. See Developing Plug-ins and Applications for further information on creating action handlers.
Your plug-in can use AVActionHandlerGetProcs() to get a structure containing pointers to an action handler's methods. This method can be used to modify an existing action handler.
Typedef | ||
---|---|---|
AVActionContext | ||
AVActionContextRec | ||
AVActionHandler
Carries out an action. When the Acrobat viewer executes an action, it looks for the action handler with a type matching that of the action it is trying to execute. The Acrobat viewer invokes the matching handler to perform the action. If no match is found, the Acrobat viewer ignores the user action.
|
||
AVActionHandlerProcs | ||
AVActionHandlerProcsRec |
Structure | ||
---|---|---|
_AVActionContextRec
This structure gives the action handler some context in terms of its execution. It specifies the " parent" object, which initiated the action, and the trigger type of the action. Trigger names should correspond to the key used in the AA dictionary of the file.
|
||
_t_AVActionHandlerProcs
A data structure containing callbacks that implement an action handler. The callbacks implement the action handler functions. For example, they can display user interface text, request the action's properties from the user, and perform the action.
|
Callback | ||
---|---|---|
AVActionCopyProc
(Optional) A callback for AVActionHandlerProcs(). It is called upon to copy an action, possibly to another document. Action handlers should provide this callback to allow for copying their actions. It is called by AVDocCopyAction().
|
||
AVActionDoPropertiesExProc
A callback for AVActionHandlerProcs. If defined, it is called instead of DoProperties().
|
||
AVActionDoPropertiesProc
A callback for AVActionHandlerProcs(). It displays a user interface that allows a user to set the action's properties. For example, for a Launch action, set the file to launch; for a GoTo action, select the destination page/zoom coordinates).
|
||
AVActionEnumProc
A callback used by AVAppEnumActionHandlers(). It is called once for each action handler.
|
||
AVActionFillActionDictProc
(Required) A callback for AVActionHandlerProcs(). This required function is called as soon as the user selects the action from the action types popup menu. It allows an action handler to populate a newly created action's actionDict. At the time this method is called, the information needed to completely specify an action is often not yet available. As a result, this method is generally a good place to populate the actionDict with default values.
|
||
AVActionGetButtonTextProc
A callback for AVActionHandlerProcs. This optional function should store into buffer a NULL-terminated C string that is a localized string for the edit action button in the action dialog box.
|
||
AVActionGetDetailsProc
Optional callback for AVActionHandlerProcs(). It is called to get informational details to present to the user. The handler can provide one or more ASText strings which are added to the ASCab provided by the caller. Generally, each string should form a single informational item, often provided in a "key: value" format. The caller will organize the strings into a list that is presented in the user interface.
|
||
AVActionGetInstructionsProc
A callback for AVActionHandlerProcs(). This optional function should store into buffer a NULL-terminated C string that contains localized instructions for the action creation/properties dialog box.
|
||
AVActionGetStringOneTextProc
(Optional) A callback for AVActionHandlerProcs(). This function should store into buffer a NULL-terminated C string that is a localized string placed above the edit action button in the action dialog box. A NULL proc will cause the button to hide.
|
||
AVActionGetStringTwoTextProc
A callback for AVActionHandlerProcs(). This optional function should store into buffer a NULL-terminated C string which is a localized string placed below the edit action button in the action dialog box.
|
||
AVActionPerformExProc
A callback for AVActionHandlerProcs(). If defined, it is called instead of AVActionPerformProc(). It is passed the context of an action, which provides information on what triggered the action.
|
||
AVActionPerformProc
A callback for AVActionHandlerProcs(). It performs the action.
|
Method | ||
---|---|---|
AVActionHandlerProcs AVActionHandlerGetProcs(AVActionHandler handler)
Gets a structure containing pointers to the action handler's procedures.
|
||
ASAtom AVActionHandlerGetType(AVActionHandler handler)
Gets the ASAtom specifying what type of actions an action handler services. This is the same as the name used when the action handler was registered using AVAppRegisterActionHandler().
|
||
const char* AVActionHandlerGetUIName(AVActionHandler handler)
Gets the string that was passed as the user friendly when the action handler was registered using AVAppRegisterActionHandler().
|
AVActionContext |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
typedef _AVActionContextRec AVActionContext;
File: AVExpT.h |
Line: 5748 |
AVActionContextRec |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
typedef _AVActionContextRec AVActionContextRec;
File: AVExpT.h |
Line: 5748 |
AVActionHandler |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
typedef struct _t_AVActionHandler* AVActionHandler;
Carries out an action. When the Acrobat viewer executes an action, it looks for the action handler with a type matching that of the action it is trying to execute. The Acrobat viewer invokes the matching handler to perform the action. If no match is found, the Acrobat viewer ignores the user action.
See Also
File: AVExpT.h |
Line: 5520 |
AVActionHandlerProcs |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
typedef _t_AVActionHandlerProcs AVActionHandlerProcs;
File: AVExpT.h |
Line: 5525 |
AVActionHandlerProcsRec |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
typedef _t_AVActionHandlerProcs AVActionHandlerProcsRec;
File: AVExpT.h |
Line: 5849 |
_AVActionContextRec |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
This structure gives the action handler some context in terms of its execution. It specifies the " parent"
object, which initiated the action, and the trigger type of the action. Trigger names should correspond to the key used in the AA dictionary of the file.
See Also
File: AVExpT.h |
Line: 5720 |
size | The size of this record. It must be set to |
|
co | The object that is performing the action, such as a bookmark or annotation. |
|
asaType | The type of the object, using these defines:
|
|
asaKey | The trigger name for the object, using these defines:
|
_t_AVActionHandlerProcs |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
struct _t_AVActionHandlerProcs {
ASSize_t size;
AVActionPerformProc Perform;
AVActionDoPropertiesProc DoProperties;
AVActionFillActionDictProc FillActionDict;
AVActionGetInstructionsProc GetInstructions;
AVActionGetButtonTextProc GetButtonText;
AVActionGetStringOneTextProc GetStringOneText;
AVActionGetStringTwoTextProc GetStringTwoText;
AVActionCopyProc Copy;
AVActionPerformExProc PerformEx;
AVActionDoPropertiesExProc DoPropertiesEx;
AVActionGetDetailsProc GetDetails;
}
A data structure containing callbacks that implement an action handler. The callbacks implement the action handler functions. For example, they can display user interface text, request the action's properties from the user, and perform the action.
See Also
File: AVExpT.h |
Line: 5811 |
size | The size of the data structure. It must be set to |
|
AVActionCopyProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
(Optional) A callback for AVActionHandlerProcs(). It is called upon to copy an action, possibly to another document. Action handlers should provide this callback to allow for copying their actions. It is called by AVDocCopyAction().
See Also
File: AVExpT.h |
Line: 5692 |
AVActionDoPropertiesExProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASBool (*AVActionDoPropertiesExProc)(void *actionHandlerObj, AVDoc doc, PDAction *actions, ASArraySize numActions)
A callback for AVActionHandlerProcs. If defined, it is called instead of DoProperties().
It is called to allow the user to view or edit the properties for an array of actions. Typically this presents a modal OK/Cancel dialog box to the user. The dialog box should graphically denote properties that do not have the same value for every action in the array by using an indeterminant state. For example, if the action has a flag property that is set to true
for one action and false
for another, instead of "true"
or "false"
, the dialog box could show the string "<varies>"
for that property. The user will still be able to change the "<varies>"
string to either true
or false
, which would apply the new value to every action in the array.
See Also
File: AVExpT.h |
Line: 5802 |
AVActionDoPropertiesProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
A callback for AVActionHandlerProcs(). It displays a user interface that allows a user to set the action's properties. For example, for a Launch action, set the file to launch; for a GoTo action, select the destination page/zoom coordinates).
See Also
File: AVExpT.h |
Line: 5572 |
AVActionEnumProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
A callback used by AVAppEnumActionHandlers(). It is called once for each action handler.
See Also
File: AVExpT.h |
Line: 5540 |
AVActionFillActionDictProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
(Required) A callback for AVActionHandlerProcs(). This required function is called as soon as the user selects the action from the action types popup menu. It allows an action handler to populate a newly created action's actionDict
. At the time this method is called, the information needed to completely specify an action is often not yet available. As a result, this method is generally a good place to populate the actionDict
with default values.
See Also
File: AVExpT.h |
Line: 5590 |
AVActionGetButtonTextProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVTArraySize (*AVActionGetButtonTextProc)(void *actionHandlerObj, PDAction action, char *buffer, AVTArraySize bufLen, AVDoc doc)
A callback for AVActionHandlerProcs. This optional function should store into buffer
a NULL
-terminated C string that is a localized string for the edit action button in the action dialog box.
For example, the Acrobat viewer's built-in OpenFile
action returns "Select File"
for this string.
See Also
File: AVExpT.h |
Line: 5630 |
AVActionGetDetailsProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Optional callback for AVActionHandlerProcs(). It is called to get informational details to present to the user. The handler can provide one or more ASText strings which are added to the ASCab provided by the caller. Generally, each string should form a single informational item, often provided in a "key: value"
format. The caller will organize the strings into a list that is presented in the user interface.
See Also
File: AVExpT.h |
Line: 5710 |
AVActionGetInstructionsProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVTArraySize (*AVActionGetInstructionsProc)(void *actionHandlerObj, PDAction action, char *buffer, AVTArraySize bufLen, AVDoc doc)
A callback for AVActionHandlerProcs(). This optional function should store into buffer a NULL
-terminated C string that contains localized instructions for the action creation/properties dialog box.
See Also
File: AVExpT.h |
Line: 5609 |
AVActionGetStringOneTextProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVTArraySize (*AVActionGetStringOneTextProc)(void *actionHandlerObj, PDAction action, char *buffer, AVTArraySize bufLen, AVDoc doc)
(Optional) A callback for AVActionHandlerProcs(). This function should store into buffer
a NULL
-terminated C string that is a localized string placed above the edit action button in the action dialog box. A NULL
proc will cause the button to hide.
For example, the Acrobat viewer's built-in OpenFile
action returns "File N: \<the current filename\>"
for this string.
See Also
File: AVExpT.h |
Line: 5653 |
AVActionGetStringTwoTextProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVTArraySize (*AVActionGetStringTwoTextProc)(void *actionHandlerObj, PDAction action, char *buffer, AVTArraySize bufLen, AVDoc doc)
A callback for AVActionHandlerProcs(). This optional function should store into buffer a NULL
-terminated C string which is a localized string placed below the edit action button in the action dialog box.
For example, the Acrobat viewer's built-in OpenFile
action returns nothing for this string, but the built-in GoToView
action returns a description of the current zoom type.
See Also
File: AVExpT.h |
Line: 5676 |
AVActionPerformExProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void (*AVActionPerformExProc)(void *actionHandlerObj, PDAction action, AVDoc doc, AVActionContext context)
A callback for AVActionHandlerProcs(). If defined, it is called instead of AVActionPerformProc(). It is passed the context of an action, which provides information on what triggered the action.
See Also
File: AVExpT.h |
Line: 5776 |
AVActionPerformProc |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
A callback for AVActionHandlerProcs(). It performs the action.
See Also
File: AVExpT.h |
Line: 5558 |
AVActionHandlerGetProcs | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVActionHandlerProcs AVActionHandlerGetProcs(AVActionHandler handler)
Gets a structure containing pointers to the action handler's procedures.
This method is useful when you want to subclass a previously registered action handler. Acrobat releases the previously registered action handler when you call AVAppRegisterActionHandler(), so you must copy the previously registered action handler to a new action handler structure, which you use in the call to AVAppRegisterActionHandler().
Parameters
handler — |
A pointer to a structure that contains the action handler's callbacks. |
See Also
Since
File: AVProcs.h |
Line: 84 |
AVActionHandlerGetType | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASAtom AVActionHandlerGetType(AVActionHandler handler)
Gets the ASAtom specifying what type of actions an action handler services. This is the same as the name used when the action handler was registered using AVAppRegisterActionHandler().
Parameters
handler — |
See Also
Since
File: AVProcs.h |
Line: 57 |
AVActionHandlerGetUIName | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
const char* AVActionHandlerGetUIName(AVActionHandler handler)
Gets the string that was passed as the user friendly when the action handler was registered using AVAppRegisterActionHandler().
Parameters
handler — | IN The action handler whose user interface name is obtained. |
See Also
Since
File: AVProcs.h |
Line: 68 |