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

#include <IMenuFilter.h>

Inheritance diagram for IMenuFilter:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IMENUFILTER }
 

Public Member Functions

virtual void FilterMenuItem (ActionID *actionID, PMString *menuPath, PMReal *menuPos, bool16 isDynamic, bool16 isOwnerDraw)=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

This Interface allows plugin writers to change existing menus at the time they are added. Typically this is used to either remove menu items completely(usually in conjunction with an IActionFilter) or to move a menu item to a different location. To get your menu filter implementation called, you must put it one a boss that supports kMenuFilterService, like so: Class { kMacOSXMenuFilterBoss, kInvalidClass, { IID_IK2SERVICEPROVIDER, kMenuFilterProviderImpl, IID_IMENUFILTER, kMySpiffyMenuFilterImpl, IID_IPMPERSIST, kPMPersistImpl, } };

Member Function Documentation

virtual void IMenuFilter::FilterMenuItem (ActionIDactionID,
PMStringmenuPath,
PMRealmenuPos,
bool16 isDynamic,
bool16 isOwnerDraw 
)
pure virtual

Anything which calls IMenuManager::AddMenuItem will call all menu filters to allow them to change anything about the menu item being added.

Parameters
actionIDThis is a pointer to the ActionID. The action filter is free to change this to some other ActionID to cause this menu item to invoke a different action.
menuPathThis is a pointer to the menu path. The action filter is free to change this to some other path to change where in the menu this item will appear. If the menuPath is changed to "" it will not be added.
menuPosThis is a pointer to the menu position. This controls where on this menu the item will appear. The menu filter is free to change this to a different value.
isDynamicIndicates if this is a 'dynamic' menu item or not. Dynamic menu items are just placeholders for menus which need to be built at display time.
See Also
IDynamicMenu
Parameters
isOwnerDrawIndicates if the menu item does custom drawing.