InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IMenuManager Class Referenceabstract

#include <IMenuManager.h>

Inheritance diagram for IMenuManager:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IMENUMANAGER }
 

Public Member Functions

virtual void AddMenuItem (ActionID actionID, PMString menuPath, PMReal menuPos, bool16 isDynamic, bool16 isOwnerDraw=kFalse, uint32 iconPluginID=0, uint32 iconRsrcID=0)=0
 
virtual void RemoveAllMenusForAction (ActionID actionID)=0
 
virtual void RemoveMenuItem (PMString menuPath, ActionID actionID)=0
 
virtual void RemoveSubmenuAndChildren (PMString menuPath)=0
 
virtual void HandlePopupMenu (PMString popupLabel, GSysPoint whereToPop, GSysPoint mousePoint, bool16 removeDisabledItems=kTrue, IPMUnknown *widget=nil, GSysRect *excludeRect=nil)=0
 
virtual bool16 IsMenuUp () const =0
 
virtual void RemoveIconOfActionID (ActionID actionID, PMString menuPath)=0
 
virtual void SetIconForMenuPath (const ActionID actionID, const PMString menuPath, uint32 iconPluginID=0, uint32 iconRsrcID=0)=0
 
virtual PMRect GetMenuBounds (PMString inMenuName)=0
 
virtual void ShowMenuItem (PMString menuPath, PMRect &position)=0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

Interface to menu manager.

Member Function Documentation

virtual void IMenuManager::AddMenuItem (ActionID actionID,
PMString menuPath,
PMReal menuPos,
bool16 isDynamic,
bool16 isOwnerDraw = kFalse,
uint32 iconPluginID = 0,
uint32 iconRsrcID = 0 
)
pure virtual

Add a menu item.

Parameters
actionIDidentifier associated with the menu item; kInvalidActionID for a submenu entry
menuPathto add a menu item, pass the full path of the submenu on which to add the menu item (e.g., "Main:&File"), the name associated with the actionID param will determine the menu item's name (e.g., kSaveActionID for "&Save"); to add a submenu entry, append a ":" to the full path of the submenu including the submenu's name (e.g., "Main:&Edit:Prefere&nces:") and pass kInvalidActionID for the actionID param to add a separator, append a "-" to the full path of the of the submenu on which to add the separator (e.g., "Main:&Edit:-") and pass a valid ActionID for the actionID param (but not one that's registered with the IActionManager)
menuPosthe menu position - menu items on the same menu are sorted based on this number; menu items with the same number are sorted alphabetically
isDynamicisDynamic indicates that this menu item requires a call to 'IDynamicMenu::RebuildMenu' before menu enable/display.
isOwnerDrawindicates that this menu item is drawn by the IOwnerDrawItem interface on the action component instead of being drawn by platform menu code
iconPluginIDis the pluginID of the icon(if any) associated with the menu item
iconRsrcIDis the resource ID of the icon(if any) associated with the menu item
virtual PMRect IMenuManager::GetMenuBounds (PMString inMenuName)
pure virtual

Given the menu name, return the global bounds of a main menu item.

Parameters
inMenuNamename of the main menu item for which the global bounds are needed
Returns
PMRect while contains the global bounds of the menu item (top, left, right, bottom)
virtual void IMenuManager::HandlePopupMenu (PMString popupLabel,
GSysPoint whereToPop,
GSysPoint mousePoint,
bool16 removeDisabledItems = kTrue,
IPMUnknownwidget = nil,
GSysRectexcludeRect = nil 
)
pure virtual

Display and react to user choice of a popup menu.

Parameters
popupLabelname for the popup menu (key)
whereToPopcontains global coordinate to specify where popup should be displayed
mousePointcontains global location of mouse at when mouse was clicked. May be the same as whereToPop.
removeDisabledItems
widgetcontains the popup menu, may be nil.
excludeRectcontains global coordinate rect, may be nil. For Win Only, popup menu should not overlap the excludeRect. Takes precedence over widget bounds, when provided.
virtual bool16 IMenuManager::IsMenuUp () const
pure virtual

Call to find out if the menu is popped up and the user is interacting with the menu.

Returns
kTrue if a menu is popped up, kFalse otherwise.
virtual void IMenuManager::RemoveAllMenusForAction (ActionID actionID)
pure virtual

Deletes all the menu items for this actionID

Parameters
actionIDidentifier associated with the menu item
virtual void IMenuManager::RemoveIconOfActionID (ActionID actionID,
PMString menuPath 
)
pure virtual

For internal use only. Remove icon of menu action id with icon.

Parameters
actionIDidentifier associated with the menu item; kInvalidActionID for a submenu entry
menuPathto add a menu item, pass the full path of the submenu on which to add the menu item (e.g., "Main:&File"), the name associated with the actionID param will determine the menu item's name (e.g., kSaveActionID for "&Save"); to add a submenu entry, append a ":" to the full path of the submenu including the submenu's name (e.g., "Main:&Edit:Prefere&nces:") and pass kInvalidActionID for the actionID param to add a separator, append a "-" to the full path of the of the submenu on which to add the separator (e.g., "Main:&Edit:-") and pass a valid ActionID for the actionID param (but not one that's registered with the IActionManager)
virtual void IMenuManager::RemoveMenuItem (PMString menuPath,
ActionID actionID 
)
pure virtual

Deletes the specified menu item - i.e. Pass "Main:&File" and kNewActionID to delete 'New...' from the file menu. If you pass a submenu item, it's entry (and associated positioning information) will be removed, but not the menu items on that submenu. As a result the submenu will still appear, but at the bottom of the containing menu.

Parameters
menuPaththe full path name of the menu item
actionIDidentifier associated with the menu item
virtual void IMenuManager::RemoveSubmenuAndChildren (PMString menuPath)
pure virtual

Deletes the specified submenu entry and all of its menu items - i.e. Pass "Main:&File:&New:" to delete the 'New' submenu and its contents from the file menu

Parameters
menuPaththe full path name of the submenu with a ":" appended
virtual void IMenuManager::SetIconForMenuPath (const ActionID actionID,
const PMString menuPath,
uint32 iconPluginID = 0,
uint32 iconRsrcID = 0 
)
pure virtual

For internal use only. Set icon of menu action id with icon.

Parameters
actionIDidentifier associated with the menu item; kInvalidActionID for a submenu entry
menuPathto add a menu item, pass the full path of the submenu on which to add the menu item (e.g., "Main:&File"), the name associated with the actionID param will determine the menu item's name (e.g., kSaveActionID for "&Save"); to add a submenu entry, append a ":" to the full path of the submenu including the submenu's name (e.g., "Main:&Edit:Prefere&nces:") and pass kInvalidActionID for the actionID param to add a separator, append a "-" to the full path of the of the submenu on which to add the separator (e.g., "Main:&Edit:-") and pass a valid ActionID for the actionID param (but not one that's registered with the IActionManager)
iconPluginIDis the pluginID of the icon(if any) associated with the menu item
iconRsrcIDis the resource ID of the icon(if any) associated with the menu item
virtual void IMenuManager::ShowMenuItem (PMString menuPath,
PMRectposition 
)
pure virtual

Show the menu for given menu name.

Parameters
menuPaththe full path name of the menu item. Only top level menu names (e.g. File, Edit etc.) are supported as of now.
positionPMRect bounds of the menu item.