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

#include <IActionManager.h>

Inheritance diagram for IActionManager:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IACTIONMANAGER }
 

Public Member Functions

virtual void AddAction (const IActionComponent *actionComponent, const ActionID &actionID, const PMString &actionName, const PMString &actionArea, int16 actionType, uint32 enablingType, PMIID selectionIID, bool16 userEditable)=0
 
virtual void AddAction (ClassID componentID, ActionID actionID, PMString actionName, PMString actionArea, int16 actionType, uint32 enablingType, PMIID selectionIID, bool16 userEditable)=0
 
virtual void RemoveAction (const ActionID &actionID, int16 actionType=kNormalAction, const ClassID &componentID=kInvalidClass)=0
 
virtual int32 GetNumActions () const =0
 
virtual ActionID GetNthAction (int32 index) const =0
 
virtual bool16 IsValidAction (const ActionID &actionID) const =0
 
virtual PMString GetActionArea (const ActionID &actionID) const =0
 
virtual PMString GetActionName (const ActionID &actionID) const =0
 
virtual bool16 IsActionUserEditable (const ActionID &actionID) const =0
 
virtual void UpdateActionArea (const ActionID &actionID, const PMString &actionArea)=0
 
virtual void UpdateActionName (const ActionID &actionID, const PMString &actionName)=0
 
virtual void UpdateActionStates (IActiveContext *ac, IActionStateList *listToUpdate, GSysPoint mousePoint=kInvalidMousePoint, IPMUnknown *widget=nil)=0
 
virtual void PerformAction (IActiveContext *ac, const ActionID &actionID, GSysPoint mousePoint=kInvalidMousePoint, IPMUnknown *widget=nil) const =0
 
virtual IActionComponentQueryActionComponent (const ActionID &actionID) const =0
 
virtual bool16 PreStartup (const PMLocaleId &locale)=0
 
virtual bool16 PostStartup (const PMLocaleId &locale)=0
 
virtual void Shutdown (const PMLocaleId &locale)=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

The action manager is the chunk of code that supports both menus and shortcuts. It maintains a list of ActionIDs and the IActionComponents that own them, in order to be able to check if a particular action is enabled, and execute that action if it is enabled.

See Also
IActionComponent
IActionStateList
IActionRegister
ActionDef.fh
IMenuManager
IShortcutManager

Member Enumeration Documentation

anonymous enum

Default IID to make UseDefaultIID() work for this interface

Member Function Documentation

virtual void IActionManager::AddAction (const IActionComponentactionComponent,
const ActionIDactionID,
const PMStringactionName,
const PMStringactionArea,
int16 actionType,
uint32 enablingType,
PMIID selectionIID,
bool16 userEditable 
)
pure virtual

Register a new action with the action manager. This version, which takes a pointer to an action component, is rarely used by client code.

Parameters
actionComponentThe action component boss which will handle enabling/execution of this new action
actionIDThe action id of the new action. Should be defined in an xxxID.h file.
actionNameThe name of this action. If this action is added to a menu, this name will be used for the menu item. Ignored unless actionType is kNormalAction.
actionAreaA string describing the area for this action. This is used to group actions in the shortcut editor.
See Also
ActionDefs.h for some predefined areas. Ignored unless actionType is kNormalAction.
Parameters
actionTypeThe type of the action.
See Also
ActionDefs.h
Parameters
enablingTypeWhat kind of enabling this action uses.
See Also
ActionDefs.h . Ignored unless actionType is kNormalAction.
Parameters
selectionIIDThe IID this action needs the selection to support. Only meaningful if enablingType includes kDisableIfSelectionDoesNotSupportIID. Ignored unless actionType is kNormalAction.
userEditableWhether or not this action is editable by the user. Currently this controls if the action appears in the Keyboard Shortcut Editor or not. Ignored unless actionType is kNormalAction.
virtual void IActionManager::AddAction (ClassID componentID,
ActionID actionID,
PMString actionName,
PMString actionArea,
int16 actionType,
uint32 enablingType,
PMIID selectionIID,
bool16 userEditable 
)
pure virtual

Register a new action with the action manager. This version, which takes a ClassID for an action component, is often called by an initializer which reads ActionDef resources from plugins at first launch.

Parameters
componentIDThe action component boss which will handle enabling/execution of this new action
actionIDThe action id of the new action. Should be defined in an xxxID.h file.
actionNameThe name of this action. If this action is added to a menu, this name will be used for the menu item. Ignored unless actionType is kNormalAction.
actionAreaA string describing the area for this action. This is used to group actions in the shortcut editor.
See Also
ActionDefs.h for some predefined areas. Ignored unless actionType is kNormalAction.
Parameters
actionTypeThe type of the action.
See Also
ActionDefs.h
Parameters
enablingTypeWhat kind of enabling this action uses.
See Also
ActionDefs.h . Ignored unless actionType is kNormalAction.
Parameters
selectionIIDThe IID this action needs the selection to support. Only meaningful if enablingType includes kDisableIfSelectionDoesNotSupportIID. Ignored unless actionType is kNormalAction.
userEditableWhether or not this action is editable by the user. Currently this controls if the action appears in the Keyboard Shortcut Editor or not. Ignored unless actionType is kNormalAction.
virtual PMString IActionManager::GetActionArea (const ActionIDactionID) const
pure virtual

Get the action area string for a given action

virtual PMString IActionManager::GetActionName (const ActionIDactionID) const
pure virtual

Get the action name string for a given action

virtual ActionID IActionManager::GetNthAction (int32 index) const
pure virtual

Get the nth known ActionID

virtual int32 IActionManager::GetNumActions () const
pure virtual

Check how many actions the action manager knows about.

virtual bool16 IActionManager::IsActionUserEditable (const ActionIDactionID) const
pure virtual

Check if a given action is editable by the user

virtual bool16 IActionManager::IsValidAction (const ActionIDactionID) const
pure virtual

Check if the passed in ActionID is known to the action manager

virtual void IActionManager::PerformAction (IActiveContextac,
const ActionIDactionID,
GSysPoint mousePoint = kInvalidMousePoint,
IPMUnknownwidget = nil 
) const
pure virtual

Function to handle an action.

Parameters
accurrent context for action component should operate on
actionIDaction id to handle
mousePointcontains the global mouse location at time of event causing action (e.g. context menus). kInvalidMousePoint if not known relevant.
widgetcontains the widget that invoked this action. May be nil. e.g. Useful to use as a basis for Utils<IWidgetUtils>()->QueryRelatedWidget(...) to find widgets in a panel after its popup menu is hit. NB: Don't assume it's a widget from your panel (menu scripting may access any menu at any time).
virtual bool16 IActionManager::PostStartup (const PMLocaleIdlocale)
pure virtual

Internal use only

virtual bool16 IActionManager::PreStartup (const PMLocaleIdlocale)
pure virtual

Internal use only

virtual IActionComponent* IActionManager::QueryActionComponent (const ActionIDactionID) const
pure virtual

Query the action component that handles a specified action

virtual void IActionManager::RemoveAction (const ActionIDactionID,
int16 actionType = kNormalAction,
const ClassIDcomponentID = kInvalidClass 
)
pure virtual

Remove the specified action from the action manager's tables

Parameters
actionIDThe action id of the action to remove
actionTypeThe type of the action to remove.
See Also
ActionDefs.h
Parameters
componentIDThe action component boss that handled pre- or post-notification for this action. Ignored if actionType is kNormalAction.
virtual void IActionManager::Shutdown (const PMLocaleIdlocale)
pure virtual

Internal use only

virtual void IActionManager::UpdateActionArea (const ActionIDactionID,
const PMStringactionArea 
)
pure virtual

Change the area of an action

Parameters
actionIDis the action to update
actionAreais the new area
virtual void IActionManager::UpdateActionName (const ActionIDactionID,
const PMStringactionName 
)
pure virtual

Change the name of an action

Parameters
actionIDis the action to update
actionNameis the new name
virtual void IActionManager::UpdateActionStates (IActiveContextac,
IActionStateListlistToUpdate,
GSysPoint mousePoint = kInvalidMousePoint,
IPMUnknownwidget = nil 
)
pure virtual

Function to handle enabling/disabling of actions. For menu actions, called before menu appears.

Parameters
accurrent context for action component should operate on
*listToUpdatelist of action states to update
mousePointcontains the global mouse location at time of event causing action (e.g. context menus). kInvalidMousePoint if not known relevant.
widgetcontains the widget that invoked this action. May be nil. e.g. Useful to use as a basis for Utils<IWidgetUtils>()->QueryRelatedWidget(...) to find widgets in a panel after its popup menu is hit. NB: Don't assume it's a widget from your panel (menu scripting may access any menu at any time).