Layer | AV_Layer |
Object | AVMenuItem |
An AVMenuItem is a menu item in a menu. It has attributes, including the following:
Menu items also may serve as separators between menu items. You are encouraged to position your plug-in menu items relative to a separator. This helps ensure that if a block of menu items is moved in a future version of Acrobat, your plug-in's menu items also are moved.
In Acrobat 4.0 and later, plug-ins can be liberal in their use of separators. After initialization, Acrobat 4.0 and later clean up by removing separators at the beginning or end of menus as well as removing duplicate separators.
A plug-in can simulate a user selecting a menu item by calling AVMenuItemExecute(). If the menu item is disabled, AVMenuItemExecute() returns without doing anything. AVMenuItemExecute() works even when the menu item is not displayed (for example, if it has not been added to a menu, its menu is not displayed, or the menu bar is not visible). Plug-ins can set all attributes of menu items they create, but must not set the Execute procedure of the Acrobat built-in menu items.
Your plug-in can specify menu item names using either the names seen by a user, or language-independent names. The latter allows your plug-in to locate the Print menu item without knowing, for example, that it is called Imprimer in French and Drucken in German.
You are strongly encouraged to begin your plug-in's language-independent menu item names
with your plug-in's name (separated by a colon) to avoid name collisions when more than one
plug-in is present. For example, if your plug-in is named myPlug
, it might add
menu items whose names are myPlug:Open
and myPlug:Find
.
Typedef | ||
---|---|---|
AVMenuItem
A menu item under a menu in the Acrobat viewer. It has a number of attributes, including a name, a keyboard shortcut, a procedure to execute when the menu item is selected, a procedure to compute whether the menu item is enabled, a procedure to compute whether the menu item is check marked, and whether or not it has a submenu.
|
Callback | ||
---|---|---|
AVMenuItemPredicate
A callback that is called for each menu item enumerated by AVMenubarAcquireMenuItemByPredicate(). The first menu item for which this callback returns true is acquired.
|
Method | ||
---|---|---|
AVMenuItem AVMenuItemAcquire(AVMenuItem menuItem)
Acquires a menu item. It increments the menu item's reference count.
|
||
AVMenu AVMenuItemAcquireSubmenu(AVMenuItem menuItem)
Acquires the submenu attached to the specified menu item, if there is one. When you are done with the submenu, release it using AVMenuRelease().
|
||
AVMenuItem AVMenuItemClone(AVMenuItem menuItem)
Creates a new menu item object using an existing menu item as a template. If the menu item contains a submenu, that submenu is also copied.
|
||
void AVMenuItemExecute(AVMenuItem menuItem)
Executes a menu item's AVExecuteProc(). It does nothing if menuItem is NULL, if menuItem has no AVExecuteProc, or if menuItem is not enabled.
|
||
ASBool AVMenuItemGetLongOnly(AVMenuItem menuItem)
Gets the flag indicating whether a menu item is visible only in long-menus mode.
|
||
ASAtom AVMenuItemGetName(AVMenuItem menuItem)
Gets the atom for the language-independent name of the menu item.
|
||
AVMenu AVMenuItemGetParentMenu(AVMenuItem menuItem)
Gets the menu in which the specified menu item appears.
|
||
Gets the shortcut key for the specified menu item.
|
||
Gets a menu item's title, which is the string that appears in the user interface.
|
||
Gets the menu item's title as it appears in the user interface, as an ASText object.
|
||
ASBool AVMenuItemIsEnabled(AVMenuItem menuItem)
Tests whether the specified menu item is enabled.
|
||
ASBool AVMenuItemIsMarked(AVMenuItem menuItem)
Tests whether menuItem is marked (for example, it appears with a check mark).
|
||
ASBool AVMenuItemIsScriptable(AVMenuItem menuItem)
Determines whether the given menu item is an executable menu item.
|
||
ASBool AVMenuItemIsVisible(AVMenuItem menuItem)
Tests whether the specified menu item is visible on its parent menu. The visibility state is calculated using the AVComputeVisibleProc().
|
||
AVMenuItem AVMenuItemNew(const char* title, const char* name, AVMenu submenu, ASBool longMenusOnly, char shortcut, AVFlagBits16 flags, AVIcon icon, ASExtension owner)
Creates and acquires a new AVMenuItem. The menu item can be added to a menu using AVMenuAddMenuItem().
|
||
AVMenuItem AVMenuItemNewWithASText(ASConstText title, const char* name, AVMenu submenu, ASBool longMenusOnly, char shortcut, AVFlagBits16 flags, AVIcon icon, ASExtension owner)
Creates and acquires a new AVMenuItem. The menu item can be added to a menu using AVMenuAddMenuItem().
|
||
void AVMenuItemRelease(AVMenuItem menuItem)
Releases a menu item. It decrements the reference count and destroys the menu item if the count is zero.
|
||
void AVMenuItemRemove(AVMenuItem menuItem)
Removes a menu item from the menu hierarchy and releases it. It does nothing if menuItem is NULL.
|
||
Sets the user-supplied procedure to call to determine whether the menu item is enabled. It does nothing if menuItem is NULL.
|
||
Sets the user-supplied procedure that determines whether the menu item appears with a check mark. It does nothing if menuItem is NULL. If the menu item has no AVExecuteProc() (see AVMenuItemSetExecuteProc()), its AVComputeMarkedProc() is never called. To avoid this, add an AVExecuteProc() that does nothing, and if you wish the menu item to gray out, also add an AVComputeEnabledProc() that always returns false.
|
||
Sets the user-supplied procedure that determines whether the menu item appears when its parent menu is opened. It does nothing if menuItem is NULL.
|
||
Sets the user-supplied procedure to execute whenever the menu item is chosen. It does nothing if menuItem is NULL. Clients must not set the execute procedure of the Acrobat viewer's built-in menu items.
|
||
void AVMenuItemSetTitle(AVMenuItem menuItem, const char* title)
Sets a menu item's title, which is the string that appears in the user interface. Use this method to manage menu items whose titles change (such as 'show/hide fooWindow'), instead of inserting and removing menu items on the fly.
|
||
Sets a menu item's title, which is the string that appears in the user interface, from a constant text object. Use this method to manage menu items whose titles change (such as 'show/hide fooWindow'), instead of inserting and removing menu items on the fly.
|
AVMenuItem |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
typedef struct _t_AVMenuItem* AVMenuItem;
A menu item under a menu in the Acrobat viewer. It has a number of attributes, including a name, a keyboard shortcut, a procedure to execute when the menu item is selected, a procedure to compute whether the menu item is enabled, a procedure to compute whether the menu item is check marked, and whether or not it has a submenu.
See Also
File: AVExpT.h |
Line: 1391 |
AVMenuItemPredicate |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASBool (*AVMenuItemPredicate)(AVMenuItem menuItem, void *clientData)
A callback that is called for each menu item enumerated by AVMenubarAcquireMenuItemByPredicate(). The first menu item for which this callback returns true
is acquired.
See Also
File: AVExpT.h |
Line: 1487 |
AVMenuItemAcquire | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenuItem AVMenuItemAcquire(AVMenuItem menuItem)
Acquires a menu item. It increments the menu item's reference count.
Parameters
menuItem — | IN/OUT The menu item to acquire. |
The menu item acquired. |
See Also
Since
File: AVProcs.h |
Line: 1766 |
AVMenuItemAcquireSubmenu | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenu AVMenuItemAcquireSubmenu(AVMenuItem menuItem)
Acquires the submenu attached to the specified menu item, if there is one. When you are done with the submenu, release it using AVMenuRelease().
Parameters
menuItem — | IN/OUT The menu item whose submenu is obtained. |
The specified menu item's submenu. It returns |
See Also
Since
File: AVProcs.h |
Line: 1950 |
AVMenuItemClone | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenuItem AVMenuItemClone(AVMenuItem menuItem)
Creates a new menu item object using an existing menu item as a template. If the menu item contains a submenu, that submenu is also copied.
Parameters
menuItem — | The menu item to copy. |
The new menu item object. |
See Also
Since
File: AVProcs.h |
Line: 8973 |
AVMenuItemExecute | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemExecute(AVMenuItem menuItem)
Executes a menu item's AVExecuteProc(). It does nothing if menuItem
is NULL
, if menuItem
has no AVExecuteProc, or if menuItem
is not enabled.
You cannot execute a menu item that has a submenu (for example, the Pages menu item in the Document menu).
Parameters
menuItem — | The menu item to execute. |
See Also
Since
File: AVProcs.h |
Line: 1989 |
AVMenuItemGetLongOnly | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASBool AVMenuItemGetLongOnly(AVMenuItem menuItem)
Gets the flag indicating whether a menu item is visible only in long-menus mode.
Parameters
menuItem — | The menu item whose flag is obtained. |
|
Since
File: AVProcs.h |
Line: 1873 |
AVMenuItemGetName | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASAtom AVMenuItemGetName(AVMenuItem menuItem)
Gets the atom for the language-independent name of the menu item.
Parameters
menuItem — | IN/OUT The menu item whose language-independent name is obtained. |
The ASAtom corresponding to the name of the specified menu item, or ASAtomNull if |
See Also
Since
File: AVProcs.h |
Line: 1805 |
AVMenuItemGetParentMenu | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenu AVMenuItemGetParentMenu(AVMenuItem menuItem)
Gets the menu in which the specified menu item appears.
Parameters
menuItem — | IN/OUT The menu item whose parent menu is obtained. |
The menu in which the specified menu item appears. It returns |
See Also
Since
File: AVProcs.h |
Line: 2002 |
AVMenuItemGetShortcut | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASBool AVMenuItemGetShortcut(AVMenuItem menuItem, char* key, AVFlagBits16* flags)
Gets the shortcut key for the specified menu item.
Parameters
menuItem — | The menu item whose shortcut is obtained. |
|
key — | (Filled by the method) The key that is a shortcut for the menu item (an ASCII character). The value NO_SHORTCUT (see AVExpT.h) indicates that the menu item has no shortcut. |
|
flags — | (Filled by the method) Modifier keys, if any, used as part of the shortcut. It must be an OR of the Modifier Keys values, except that AV_COMMAND will never be present. |
|
See Also
Since
File: AVProcs.h |
Line: 1859 |
AVMenuItemGetTitle | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVTArraySize AVMenuItemGetTitle(AVMenuItem menuItem, char* buffer, AVTArraySize bufferSize)
Gets a menu item's title, which is the string that appears in the user interface.
Parameters
menuItem — | The menu item whose title is obtained. |
|
buffer — | (Filled by the method) A buffer to hold the |
|
bufferSize — | The maximum number of characters that can be placed into |
See Also
Since
File: AVProcs.h |
Line: 1826 |
AVMenuItemGetTitleAsASText | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemGetTitleAsASText(AVMenuItem menuItem, ASText title)
Gets the menu item's title as it appears in the user interface, as an ASText object.
Parameters
menuItem — | The menu item whose title is obtained. |
|
title — | (Filled by the method) The text object containing the title. |
See Also
Since
File: AVProcs.h |
Line: 8233 |
AVMenuItemIsEnabled | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASBool AVMenuItemIsEnabled(AVMenuItem menuItem)
Tests whether the specified menu item is enabled.
Parameters
menuItem — | The menu item whose enabled flag is obtained. |
|
See Also
Since
File: AVProcs.h |
Line: 1962 |
AVMenuItemIsMarked | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASBool AVMenuItemIsMarked(AVMenuItem menuItem)
Tests whether menuItem
is marked (for example, it appears with a check mark).
Parameters
menuItem — | The menu item whose marked state is obtained. |
|
See Also
Since
File: AVProcs.h |
Line: 1975 |
AVMenuItemIsScriptable | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASBool AVMenuItemIsScriptable(AVMenuItem menuItem)
Determines whether the given menu item is an executable menu item.
Parameters
menuItem — | IN The given menu item. |
|
Since
File: AVProcs.h |
Line: 9791 |
AVMenuItemIsVisible | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
ASBool AVMenuItemIsVisible(AVMenuItem menuItem)
Tests whether the specified menu item is visible on its parent menu. The visibility state is calculated using the AVComputeVisibleProc().
Parameters
menuItem — | The menu item whose visibility state is tested. |
|
See Also
Since
File: AVProcs.h |
Line: 9233 |
AVMenuItemNew | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenuItem AVMenuItemNew(const char* title, const char* name, AVMenu submenu, ASBool longMenusOnly, char shortcut, AVFlagBits16 flags, AVIcon icon, ASExtension owner)
Creates and acquires a new AVMenuItem. The menu item can be added to a menu using AVMenuAddMenuItem().
Release the AVMenuItem using AVMenuItemRelease() after it has been added to a menu.
Parameters
title — | The string shown in the user interface for this menu item. Use a hyphen to create a separator menu item. This value is also returned by AVMenuItemGetTitle(). On Windows, an ampersand ( |
|
name — | The language-independent name of the menu item to create. This is the value returned by AVMenuItemGetName(). |
|
submenu — | A submenu (if any) for which this menu item is the parent. Pass |
|
longMenusOnly — | (Ignored in Acrobat 3.0 or later) If |
|
shortcut — | The key to use as a shortcut for the menu item (an ASCII character). Use NO_SHORTCUT (see AVExpT.h) if the menu item has no shortcut. The Acrobat viewer does not check for conflicts between shortcuts. The consequences of multiple menu items having the same shortcut is undefined. On Windows, the shortcut is not displayed for any menu item that also has an icon, although the shortcut will work. |
|
flags — | Modifier keys, if any, used as part of the shortcut. It must be an OR of the Modifier Keys values, except that AV_COMMAND cannot be specified. |
|
icon — | The icon to show in the menu item, or |
|
owner — | The |
The newly created menu item. |
See Also
Since
File: AVProcs.h |
Line: 1753 |
AVMenuItemNewWithASText | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenuItem AVMenuItemNewWithASText(ASConstText title, const char* name, AVMenu submenu, ASBool longMenusOnly, char shortcut, AVFlagBits16 flags, AVIcon icon, ASExtension owner)
Creates and acquires a new AVMenuItem. The menu item can be added to a menu using AVMenuAddMenuItem().
Release the AVMenuItem using AVMenuItemRelease() after it has been added to a menu.
Parameters
title — | A constant text object containing the string shown in the user interface for this menu item. Use a hyphen to create a separator menu item. This value is also returned by AVMenuItemGetTitleAsASText(). On Windows, an ampersand ( |
|
name — | The language-independent name of the menu item to create. This is the value returned by AVMenuItemGetName(). |
|
submenu — | The submenu (if any) for which this menu item is the parent. Pass |
|
longMenusOnly — | (Ignored in Acrobat 3.0 or later) If |
|
shortcut — | The key to use as a shortcut for the menu item (an ASCII character). Use |
|
flags — | Modifier keys, if any, used as part of the shortcut. It must be an OR of the Modifier Keys values, except that |
|
icon — | The icon to show in the menu item, or |
|
owner — | The gExtensionID extension registering the menu item. |
The newly created menu item. |
See Also
Since
File: AVProcs.h |
Line: 8218 |
AVMenuItemRelease | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemRelease(AVMenuItem menuItem)
Releases a menu item. It decrements the reference count and destroys the menu item if the count is zero.
Parameters
menuItem — | IN/OUT The menu item to release. |
See Also
Since
File: AVProcs.h |
Line: 1778 |
AVMenuItemRemove | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemRemove(AVMenuItem menuItem)
Removes a menu item from the menu hierarchy and releases it. It does nothing if menuItem
is NULL
.
Keyboard accelerators for the Acrobat viewer's built-in menu items will always work, even if the menu item is removed.
Parameters
menuItem — | IN/OUT The menu item to remove. |
See Also
Since
File: AVProcs.h |
Line: 1792 |
AVMenuItemSetComputeEnabledProc | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemSetComputeEnabledProc(AVMenuItem menuItem, AVComputeEnabledProc proc, void* data)
Sets the user-supplied procedure to call to determine whether the menu item is enabled. It does nothing if menuItem
is NULL
.
Parameters
menuItem — | The menu item whose AVComputeEnabledProc() is set. |
|
proc — | A user-supplied callback to call whenever the Acrobat viewer needs to know whether |
|
data — | A pointer to user-supplied data to pass to |
See Also
Since
File: AVProcs.h |
Line: 1912 |
AVMenuItemSetComputeMarkedProc | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemSetComputeMarkedProc(AVMenuItem menuItem, AVComputeMarkedProc proc, void* data)
Sets the user-supplied procedure that determines whether the menu item appears with a check mark. It does nothing if menuItem
is NULL
. If the menu item has no AVExecuteProc() (see AVMenuItemSetExecuteProc()), its AVComputeMarkedProc() is never called. To avoid this, add an AVExecuteProc() that does nothing, and if you wish the menu item to gray out, also add an AVComputeEnabledProc() that always returns false
.
Parameters
menuItem — | The menu item whose AVComputeMarkedProc() is set. |
|
proc — | A user-supplied callback to call whenever the Acrobat viewer needs to know whether |
|
data — | A pointer to user-supplied data to pass to |
See Also
Since
File: AVProcs.h |
Line: 1936 |
AVMenuItemSetComputeVisibleProc | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemSetComputeVisibleProc(AVMenuItem menuItem, AVComputeVisibleProc proc, void* data)
Sets the user-supplied procedure that determines whether the menu item appears when its parent menu is opened. It does nothing if menuItem
is NULL
.
Parameters
menuItem — | The menu item whose visibility procedure is set. |
|
proc — | User-supplied procedure to call when the Acrobat viewer needs to know if the menu item is visible. |
|
data — | A pointer to user-supplied data to pass to |
See Also
Since
File: AVProcs.h |
Line: 9218 |
AVMenuItemSetExecuteProc | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemSetExecuteProc(AVMenuItem menuItem, AVExecuteProc proc, void* data)
Sets the user-supplied procedure to execute whenever the menu item is chosen. It does nothing if menuItem
is NULL
. Clients must not set the execute procedure of the Acrobat viewer's built-in menu items.
Parameters
menuItem — | The menu item whose execute procedure is set. |
|
proc — | A user-supplied callback to call whenever |
|
data — | A pointer to user-supplied data to pass to |
See Also
Since
File: AVProcs.h |
Line: 1891 |
AVMenuItemSetTitle | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemSetTitle(AVMenuItem menuItem, const char* title)
Sets a menu item's title, which is the string that appears in the user interface. Use this method to manage menu items whose titles change (such as 'show/hide fooWindow'), instead of inserting and removing menu items on the fly.
Parameters
menuItem — | IN/OUT The menu item whose title is set. |
|
title — | IN/OUT The new menu title. It must be a |
See Also
Since
File: AVProcs.h |
Line: 1840 |
AVMenuItemSetTitleWithASText | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuItemSetTitleWithASText(AVMenuItem menuItem, ASConstText title)
Sets a menu item's title, which is the string that appears in the user interface, from a constant text object. Use this method to manage menu items whose titles change (such as 'show/hide fooWindow'
), instead of inserting and removing menu items on the fly.
Parameters
menuItem — | The menu item whose title is set. |
|
title — |
See Also
Since
File: AVProcs.h |
Line: 8247 |