#include <IActionManager.h>
|
| enum | { kDefaultIID = IID_IACTIONMANAGER } |
| |
|
| 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 IActionComponent * | QueryActionComponent (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 |
| |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| |
| virtual void | AddRef () const =0 |
| |
| virtual void | Release () const =0 |
| |
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
Default IID to make UseDefaultIID() work for this interface
| virtual void IActionManager::AddAction | ( | const IActionComponent * | actionComponent, | | | const ActionID & | actionID, | | | const PMString & | actionName, | | | const 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 pointer to an action component, is rarely used by client code.
- Parameters
| actionComponent | The action component boss which will handle enabling/execution of this new action |
| actionID | The action id of the new action. Should be defined in an xxxID.h file. |
| actionName | The 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. |
| actionArea | A 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
| actionType | The type of the action. |
- See Also
- ActionDefs.h
- Parameters
| enablingType | What kind of enabling this action uses. |
- See Also
- ActionDefs.h . Ignored unless actionType is kNormalAction.
- Parameters
| selectionIID | The IID this action needs the selection to support. Only meaningful if enablingType includes kDisableIfSelectionDoesNotSupportIID. Ignored unless actionType is kNormalAction. |
| userEditable | Whether 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
| componentID | The action component boss which will handle enabling/execution of this new action |
| actionID | The action id of the new action. Should be defined in an xxxID.h file. |
| actionName | The 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. |
| actionArea | A 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
| actionType | The type of the action. |
- See Also
- ActionDefs.h
- Parameters
| enablingType | What kind of enabling this action uses. |
- See Also
- ActionDefs.h . Ignored unless actionType is kNormalAction.
- Parameters
| selectionIID | The IID this action needs the selection to support. Only meaningful if enablingType includes kDisableIfSelectionDoesNotSupportIID. Ignored unless actionType is kNormalAction. |
| userEditable | Whether 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 ActionID & | actionID | ) | const |
| pure virtual |
Get the action area string for a given action
| virtual PMString IActionManager::GetActionName | ( | const ActionID & | actionID | ) | 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 ActionID & | actionID | ) | const |
| pure virtual |
Check if a given action is editable by the user
| virtual bool16 IActionManager::IsValidAction | ( | const ActionID & | actionID | ) | const |
| pure virtual |
Check if the passed in ActionID is known to the action manager
Function to handle an action.
- Parameters
| ac | current context for action component should operate on |
| actionID | action id to handle |
| mousePoint | contains the global mouse location at time of event causing action (e.g. context menus). kInvalidMousePoint if not known relevant. |
| widget | contains 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 PMLocaleId & | locale | ) | |
| pure virtual |
| virtual bool16 IActionManager::PreStartup | ( | const PMLocaleId & | locale | ) | |
| pure virtual |
Query the action component that handles a specified action
| virtual void IActionManager::RemoveAction | ( | const ActionID & | actionID, | | | int16 | actionType = kNormalAction, | | | const ClassID & | componentID = kInvalidClass | | ) | | |
| pure virtual |
Remove the specified action from the action manager's tables
- Parameters
| actionID | The action id of the action to remove |
| actionType | The type of the action to remove. |
- See Also
- ActionDefs.h
- Parameters
| componentID | The action component boss that handled pre- or post-notification for this action. Ignored if actionType is kNormalAction. |
| virtual void IActionManager::Shutdown | ( | const PMLocaleId & | locale | ) | |
| pure virtual |
| virtual void IActionManager::UpdateActionArea | ( | const ActionID & | actionID, | | | const PMString & | actionArea | | ) | | |
| pure virtual |
Change the area of an action
- Parameters
| actionID | is the action to update |
| actionArea | is the new area |
| virtual void IActionManager::UpdateActionName | ( | const ActionID & | actionID, | | | const PMString & | actionName | | ) | | |
| pure virtual |
Change the name of an action
- Parameters
| actionID | is the action to update |
| actionName | is the new name |
Function to handle enabling/disabling of actions. For menu actions, called before menu appears.
- Parameters
| ac | current context for action component should operate on |
| *listToUpdate | list of action states to update |
| mousePoint | contains the global mouse location at time of event causing action (e.g. context menus). kInvalidMousePoint if not known relevant. |
| widget | contains 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). |