![]() | InDesign SDK 20.5 |
#include <IMenuFilter.h>

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 IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
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, } };
| pure virtual |
Anything which calls IMenuManager::AddMenuItem will call all menu filters to allow them to change anything about the menu item being added.
| actionID | This 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. |
| menuPath | This 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. |
| menuPos | This 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. |
| isDynamic | Indicates 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. |
| isOwnerDraw | Indicates if the menu item does custom drawing. |