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

#include <IActionFilter.h>

Inheritance diagram for IActionFilter:
IPMUnknownCPMUnknown< IActionFilter >CstAFltActionFilter

Public Types

enum  { kDefaultIID = IID_IACTIONFILTER }
 

Public Member Functions

virtual void FilterAction (ClassID *componentClass, ActionID *actionID, PMString *actionName, PMString *actionArea, int16 *actionType, uint32 *enablingType, bool16 *userEditable)=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 behavior of existing actions at the time they are added. Typically this is used to either remove menu items completely(in conjunction with an IMenuFilter) or to replace the default implementation of some action(i.e. you have a plugin which wants to do something different when the user chooses File:Open). To get your action filter implementation called, you must put it on a boss that supports kActionFilterService, like so: Class { kXXXActionFilterBoss, kInvalidClass, { IID_IK2SERVICEPROVIDER, kActionFilterProviderImpl, IID_IACTIONFILTER, kXXXActionFilterImpl, IID_IPMPERSIST, kPMPersistImpl, } };

Member Function Documentation

virtual void IActionFilter::FilterAction (ClassIDcomponentClass,
ActionIDactionID,
PMStringactionName,
PMStringactionArea,
int16 * actionType,
uint32 * enablingType,
bool16 * userEditable 
)
pure virtual

Any call to IActionManager::AddAction will call all action filters to allow them to change anything about the action being added.

Parameters
componentClassThis is a pointer to the action component class to be used to handle this action. The action filter is free to change this to some other action component class
actionIDThis is a pointer to the ActionID. The action filter is free to change this to some other ActionID. If it's changed to kInvalidActionID the action will not be added.
actionNameThis is a pointer to the name of the action. This is the name that appears in the menu or in the shortcut editor describing the action. The action filter is free to change this to a different string.
actionAreaThis is a pointer to the area of the action. This is the string that appears as the grouping in the shortcut editor. The action filter is free to change this to a different string.
actionTypeThis is a pointer to the type of the action. Usually kNormalAction, but could also be kPreNotify or kPostNotify(see ActionDefs.h). The action filter is free to change this to some other action type.
enablingTypeThis is a pointer to the enabling bitfield for this action(see ActionDefs.h). Often something like (kCustomEnabling|kDisableIfLowMem). The action filter is free to change this bitfield to alter the enabling for this action.
userEditableThis is a pointer to the user editable flag. If this flag is true this action will show up in the shortcut editor. The action filter is free to change this boolean.

Implemented in CstAFltActionFilter.