Layer | AV_Layer |
Object | AVMenu |
An AVMenu is a menu in the Acrobat viewer's menu bar. Plug-ins can create new menus, add menu items at any location in any menu, and remove menu items. Deleting an AVMenu removes it from the menu bar (if it was attached) and deletes all the menu items it contains.
There is a special AVMenu with the title Tools. This menu (the About Plug-ins menu item and the Plug-in Help menu item) are always created when Acrobat is launched. They are removed if and only if they are empty after every plug-in's initialization routines have been called.
Submenus (also called pullright menus) are AVMenu objects that are attached to an AVMenuItem instead of the menu bar.
Each menu has a title and a language-independent name. The title is the string that appears in the user interface, while the language-independent name is the same regardless of the language used in the user interface. Language-independent names allow a plug-in to locate the File menu without knowing, for example, that it is called Fichier in French and Ablage in German.
It is strongly encouraged that you begin your language-independent menu names with the
plug-in name (separated by a colon) to avoid name collisions when more than one plug-in is present.
For example, if my plug-in is named myPlug
, it might add a menu whose name
is myPlug:Options
.
Your plug-in cannot directly remove a submenu. Instead, it must remove the AVMenuItem to which the submenu is attached.
Define | ||
---|---|---|
kAVMenuKeyEnabled | ||
kAVMenuKeyHelpText | ||
kAVMenuKeyIcon | ||
kAVMenuKeyMarked | ||
kAVMenuKeyName | ||
kAVMenuKeyShortcut | ||
kAVMenuKeyShortcutFlags | ||
kAVMenuKeyTitle | ||
kAVMenuKeyTitleChanges | ||
kAVMenuKeyVisible |
Typedef | ||
---|---|---|
AVMenu
A menu in the Acrobat viewer's menu bar. Plug-ins can create new menus, add menu items at any location in any menu, and remove menu items. Deleting an AVMenu removes it from the menu bar (if it was attached) and deletes all the menu items it contains.
|
||
AVMenuIndex
A menu index value that indicates a user's choice in a popup menu. It uses negative indices for errors.
|
Callback | ||
---|---|---|
AVMenuPredicate
A callback that is called for each menu enumerated by AVMenubarAcquireMenuByPredicate(). The first menu for which this callback returns true is acquired.
|
Method | ||
---|---|---|
AVMenu AVMenuAcquire(AVMenu menu)
Acquires the specified menu. It increments the menu's reference count. When you are done using the menu item, release it using AVMenuRelease().
|
||
Acquires the menu item at the specified location in the specified menu. When you are done using the menu item, release it using AVMenuItemRelease(). Menu item indices are generally not reliable: they change as clients add, remove, or rearrange menu items, and may differ in different versions of the Acrobat viewer (if menu items are rearranged, removed, or added). Menu items should generally be acquired using AVMenubarAcquireMenuItemByName(), which is generally reliable.
|
||
Inserts a menu item in a specified location in a menu, and acquires the item. It does nothing if the menu or menu item is NULL, or the menu item is already in a menu.
|
||
AVMenu AVMenuClone(AVMenu menu)
(New in Acrobat 5.0.5)
|
||
Pops up a submenu.
|
||
Gets the index of the specified menu item in the specified menu.
|
||
ASAtom AVMenuGetName(AVMenu menu)
Gets the ASAtom for the menu's language-independent name.
|
||
AVTArraySize AVMenuGetNumMenuItems(AVMenu menu)
Gets the number of menu items in a menu, including those that are visible only in long-menus mode.
|
||
AVMenubar AVMenuGetParentMenubar(AVMenu menu)
Gets the parent menu bar for the specified menu.
|
||
AVMenuItem AVMenuGetParentMenuItem(AVMenu menu)
Gets the parent menu item for the specified menu.
|
||
Gets the menu's title as it appears in the user interface. The length of the title remains 0 if menu is NULL.
|
||
Gets the menu's title as it appears in the user interface, as an ASText object.
|
||
ASBool AVMenuIsHiddenOnMenubar(AVMenu menu)
Tests whether a menu is hidden on the menu bar.
|
||
AVMenu AVMenuNew(const char* title, const char* name, ASExtension owner)
Creates and acquires a new menu with the given title and language-independent name. The menu can be added to the menu bar using AVMenubarAddMenu(). When you are done using the menu, release it using AVMenuRelease().
|
||
Creates and acquires a new menu with the given title and language-independent name. The menu can be added to the menu bar using AVMenubarAddMenu(). When you are done using the menu, release it using AVMenuRelease().
|
||
void AVMenuRelease(AVMenu menu)
Releases the specified menu. It decrements the reference count and automatically destroys the menu when its reference count is zero.
|
||
void AVMenuRemove(AVMenu menu)
Removes a menu from the menu bar and releases it. If the menu is a submenu, this method does nothing.
|
kAVMenuKeyEnabled |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyEnabled Enabled"
File: AVExpT.h |
Line: 9909 |
kAVMenuKeyHelpText |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyHelpText HelpText"
File: AVExpT.h |
Line: 9914 |
kAVMenuKeyIcon |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyIcon Icon"
File: AVExpT.h |
Line: 9908 |
kAVMenuKeyMarked |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyMarked Marked"
File: AVExpT.h |
Line: 9910 |
kAVMenuKeyName |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyName Name"
File: AVExpT.h |
Line: 9905 |
kAVMenuKeyShortcut |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyShortcut Shortcut"
File: AVExpT.h |
Line: 9912 |
kAVMenuKeyShortcutFlags |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyShortcutFlags ShortcutFlags"
File: AVExpT.h |
Line: 9913 |
kAVMenuKeyTitle |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyTitle Title"
File: AVExpT.h |
Line: 9906 |
kAVMenuKeyTitleChanges |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyTitleChanges TitleChanges"
File: AVExpT.h |
Line: 9907 |
kAVMenuKeyVisible |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
#define kAVMenuKeyVisible Visible"
File: AVExpT.h |
Line: 9911 |
AVMenu |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
typedef struct _t_AVMenu* AVMenu;
A menu in the Acrobat viewer's menu bar. Plug-ins can create new menus, add menu items at any location in any menu, and remove menu items. Deleting an AVMenu removes it from the menu bar (if it was attached) and deletes all the menu items it contains.
See Also
File: AVExpT.h |
Line: 1279 |
AVMenuIndex |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
typedef ASInt32 AVMenuIndex;
A menu index value that indicates a user's choice in a popup menu. It uses negative indices for errors.
See Also
File: AVExpT.h |
Line: 265 |
AVMenuPredicate |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
A callback that is called for each menu enumerated by AVMenubarAcquireMenuByPredicate(). The first menu for which this callback returns true
is acquired.
See Also
File: AVExpT.h |
Line: 1293 |
AVMenuAcquire | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Acquires the specified menu. It increments the menu's reference count. When you are done using the menu item, release it using AVMenuRelease().
Parameters
menu — | IN/OUT The menu to acquire. |
The menu acquired. |
See Also
Since
File: AVProcs.h |
Line: 1515 |
AVMenuAcquireMenuItemByIndex | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenuItem AVMenuAcquireMenuItemByIndex(AVMenu menu, AVMenuIndex menuItemIndex)
Acquires the menu item at the specified location in the specified menu. When you are done using the menu item, release it using AVMenuItemRelease(). Menu item indices are generally not reliable: they change as clients add, remove, or rearrange menu items, and may differ in different versions of the Acrobat viewer (if menu items are rearranged, removed, or added). Menu items should generally be acquired using AVMenubarAcquireMenuItemByName(), which is generally reliable.
Parameters
menu — | The menu in which a menu item is acquired. |
|
menuItemIndex — | The index of the menu item in |
The menu item whose index is specified. It returns |
See Also
Since
File: AVProcs.h |
Line: 1622 |
AVMenuAddMenuItem | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuAddMenuItem(AVMenu menu, AVMenuItem menuItem, AVMenuIndex menuItemIndex)
Inserts a menu item in a specified location in a menu, and acquires the item. It does nothing if the menu or menu item is NULL
, or the menu item is already in a menu.
Parameters
menu — | The menu to which a menu item is added. |
|
menuItem — | The menu item to add. |
|
menuItemIndex — | The location in |
See Also
Exceptions
Since
File: AVProcs.h |
Line: 1704 |
AVMenuClone | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
(New in Acrobat 5.0.5)
Clones a menu, creating a new menu which is an exact duplicate of the original, except that shortcuts are not created for the items.
Parameters
menu — | The menu that is cloned. |
The new menu. |
Since
File: AVProcs.h |
Line: 6177 |
AVMenuDoPopUp | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Pops up a submenu.
Parameters
menu — | The menu to be displayed. |
|
x — | The x-coordinate of the upper left corner of the menu. |
|
y — | The y-coordinate of the upper left corner of the menu. |
|
rightButton — |
|
|
choice — | The index of the AVMenuItem that should appear under the mouse at popup time. |
The menu item selected from menu. |
See Also
Since
File: AVProcs.h |
Line: 7786 |
AVMenuGetMenuItemIndex | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenuIndex AVMenuGetMenuItemIndex(AVMenu menu, AVMenuItem menuItem)
Gets the index of the specified menu item in the specified menu.
Indices must be used with caution, because they change as clients add, remove, or rearrange menu items.
Parameters
menu — | The menu in which |
|
menuItem — | The menu item whose index is obtained. |
The index of BAD_MENUITEM_INDEX (see AVExpT.h) if |
See Also
Since
File: AVProcs.h |
Line: 1644 |
AVMenuGetName | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Gets the ASAtom for the menu's language-independent name.
Parameters
menu — | IN/OUT The menu whose language-independent name is obtained. |
The menu's name. The ASAtom can be converted to a string using ASAtomGetString(). It returns |
See Also
Since
File: AVProcs.h |
Line: 1562 |
AVMenuGetNumMenuItems | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVTArraySize AVMenuGetNumMenuItems(AVMenu menu)
Gets the number of menu items in a menu, including those that are visible only in long-menus mode.
Parameters
menu — | IN/OUT The menu for which the number of menu items is obtained. |
The number of menu items in the specified menu. It returns |
See Also
Since
File: AVProcs.h |
Line: 1593 |
AVMenuGetParentMenubar | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Gets the parent menu bar for the specified menu.
Parameters
menu — | IN/OUT The menu whose parent menu bar is obtained. |
The menu bar to which the menu is attached. It returns |
See Also
Since
File: AVProcs.h |
Line: 1667 |
AVMenuGetParentMenuItem | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenuItem AVMenuGetParentMenuItem(AVMenu menu)
Gets the parent menu item for the specified menu.
Parameters
menu — | IN/OUT The menu whose parent menu item is obtained. |
The menu item for which the specified menu is a submenu. Returns |
See Also
Since
File: AVProcs.h |
Line: 1685 |
AVMenuGetTitle | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVTArraySize AVMenuGetTitle(AVMenu menu, char* buffer, AVTArraySize bufferSize)
Gets the menu's title as it appears in the user interface. The length of the title remains 0
if menu is NULL
.
Parameters
menu — | The menu whose title is obtained. |
|
buffer — | (Filled by the method) A buffer into which the title is copied. If |
|
bufferSize — | The maximum number of characters the buffer can hold. |
If |
See Also
Since
File: AVProcs.h |
Line: 1581 |
AVMenuGetTitleAsASText | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Gets the menu's title as it appears in the user interface, as an ASText object.
Parameters
menu — | The menu whose title is obtained. |
|
title — | (Filled by the method) The text object containing the title. |
See Also
Since
File: AVProcs.h |
Line: 8168 |
AVMenuIsHiddenOnMenubar | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
Tests whether a menu is hidden on the menu bar.
Parameters
menu — | IN/OUT The menu to test. |
|
See Also
Since
File: AVProcs.h |
Line: 4397 |
AVMenuNew | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenu AVMenuNew(const char* title, const char* name, ASExtension owner)
Creates and acquires a new menu with the given title and language-independent name. The menu can be added to the menu bar using AVMenubarAddMenu(). When you are done using the menu, release it using AVMenuRelease().
Parameters
title — | The string that appears in the user interface. On Windows, an ampersand ( |
|
name — | The language-independent name of the menu to create: it is the value returned by AVMenuGetName(). It must not contain any spaces. Developers should prefix the names of menus they add with the name of their client and a colon, to avoid collisions in the menu name space. For example, a client named |
|
owner — | The |
The newly created menu. |
See Also
Exceptions
Since
File: AVProcs.h |
Line: 1500 |
AVMenuNewWithASText | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
AVMenu AVMenuNewWithASText(ASConstText title, const char* name, ASExtension owner)
Creates and acquires a new menu with the given title and language-independent name. The menu can be added to the menu bar using AVMenubarAddMenu(). When you are done using the menu, release it using AVMenuRelease().
Parameters
title — | A constant text object containing the string that appears in the user interface. On Windows, an ampersand ( |
|
name — | A language-independent name of the menu to create: it is the value returned by AVMenuGetName(). It must not contain any spaces. Developers should prefix the names of menus they add with the name of their client and a colon, to avoid collisions in the menu name space. For example, a client named |
|
owner — | The gExtensionID extension registering the menu. |
The newly created menu. |
See Also
Exceptions
Since
File: AVProcs.h |
Line: 8154 |
AVMenuRelease | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuRelease(AVMenu menu)
Releases the specified menu. It decrements the reference count and automatically destroys the menu when its reference count is zero.
Parameters
menu — | The menu to release. |
See Also
Since
File: AVProcs.h |
Line: 1526 |
AVMenuRemove | () |
Product availability: Acrobat, Reader |
Platform availability: Macintosh, Windows, UNIX |
void AVMenuRemove(AVMenu menu)
Removes a menu from the menu bar and releases it. If the menu is a submenu, this method does nothing.
Parameters
menu — | IN/OUT The menu to remove. |
See Also
Since
File: AVProcs.h |
Line: 1543 |