Public Member Functions

IActionManager Class Reference

This reference page is linked to from the following overview topics: Classes Involved in the Action System, Building Action Tables, Action Interfaces.


Search for all occurrences

Detailed Description

Manages a set of ActionTables, ActionCallbacks and ActionContext.

The manager handles the keyboard accelerator tables for each ActionTable as well. You can get a pointer to a class implementing this interface using Interface::GetActionManager().

Version:
4.0
See also:
Class ActionTable, Class ClassDesc, Class ActionItem, Class ActionCallback, Class ActionContext, Class DynamicMenu, Class DynamicMenuCallback, Class Interface.

#include <actiontable.h>

Inheritance diagram for IActionManager:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual void  RegisterActionTable (ActionTable *pTable)=0
  Register an action table with the manager.
virtual int  NumActionTables ()=0
  Returns the number of ActionTables.
virtual ActionTable GetTable (int i)=0
  Returns a pointer to the nth ActionTable.
virtual int  ActivateActionTable (ActionCallback *pCallback, ActionTableId id)=0
  Activate the action table.
virtual int  DeactivateActionTable (ActionCallback *pCallback, ActionTableId id)=0
  Deactivates the action table.
virtual ActionTable FindTable (ActionTableId id)=0
  Returns a pointer to an action table.
virtual BOOL  GetShortcutString (ActionTableId tableId, int commandId, MCHAR *buf)=0
  Retrieves the string that describes the keyboard shortcut for the specified ActionItem.
virtual BOOL  GetActionDescription (ActionTableId tableId, int commandId, MCHAR *buf)=0
  Retrieves a string that descibes the specified operation from the action table whose ID is passed.
virtual BOOL  RegisterActionContext (ActionContextId contextId, MCHAR *pName)=0
  Registers an action context.
virtual int  NumActionContexts ()=0
  Returns the number of ActionContexts.
virtual ActionContext GetActionContext (int i)=0
  Returns a pointer to the nth ActionContext.
virtual ActionContext FindContext (ActionContextId contextId)=0
  Returns a pointer to the specified ActionContext.
virtual BOOL  IsContextActive (ActionContextId contextId)=0
  Checks if an ActionContext is active or not.

Internal Methods

enum   ActionManagerFps {
  executeAction, saveKeyboardFile, loadKeyboardFile, getKeyboardFile,
  numActionTables, getActionTable, getActionContext
}
 

IDs for function published (Fps) methods and properties.

More...
virtual MCHAR *  GetShortcutFile ()=0
virtual MCHAR *  GetShortcutDir ()=0
virtual int  IdToIndex (ActionTableId id)=0
virtual void  SaveAllContextsToINI ()=0
virtual int  MakeActionSetCurrent (MCHAR *pDir, MCHAR *pFile)=0
virtual int  LoadAccelConfig (LPACCEL *accel, int *cts, ActionTableId tableId=-1, BOOL forceDefault=FALSE)=0
virtual int  SaveAccelConfig (LPACCEL *accel, int *cts)=0
virtual int  GetCurrentActionSet (MCHAR *buf)=0
virtual BOOL  SaveKeyboardFile (MCHAR *pFileName)=0
virtual BOOL  LoadKeyboardFile (MCHAR *pFileName)=0
virtual MCHAR *  GetKeyboardFile ()=0

Member Enumeration Documentation

IDs for function published (Fps) methods and properties.

Enumerator:
executeAction 
saveKeyboardFile 
loadKeyboardFile 
getKeyboardFile 
numActionTables 
getActionTable 
getActionContext 
    {
        executeAction,
#ifndef NO_CUI  // russom - 02/12/02
        saveKeyboardFile,
        loadKeyboardFile,
        getKeyboardFile,
#endif // NO_CUI
        numActionTables,
        getActionTable,
        getActionContext,
        };

Member Function Documentation

virtual void RegisterActionTable ( ActionTable pTable ) [pure virtual]

Register an action table with the manager.

Note that plug-ins that expose their action tables via their ClassDesc::NumActionTables() method. do not need to register their action tables explicitely, as 3ds Max will do it for them. Also note that plug-ins do not need to unregister or destroy their action tables and action items, as 3ds Max will take care of this when it shuts down. Also note that an action table needs to be activated once registered. For more information see IActionManager::ActivateActionTable() See ClassDesc Action Table Methods.

Parameters:
pTable Points to the Action Table to register.
virtual int NumActionTables ( ) [pure virtual]

Returns the number of ActionTables.

virtual ActionTable* GetTable ( int  i ) [pure virtual]

Returns a pointer to the nth ActionTable.

Parameters:
i The zero based index of the table.
virtual int ActivateActionTable ( ActionCallback pCallback,
ActionTableId  id 
) [pure virtual]

Activate the action table.

Action tables need to be activated by their owners. Some plug-ins (for instance Modifiers or Geometric Objects) may only want to activate the table when they are being edited in the command panel (between BeginEditParams() and EndEditParams()). Others, for instance Global Utility Plug-ins, may wish to do so when they are initially loaded so the actions are always available. Note that if this method is called multiple times, only the callback from the last call will be used.

Parameters:
pCallback Points to the callback object which is responsible for executing the action.
id This is the ID of the table to activate.
Returns:
TRUE if the action table was activated. FALSE if the table is already active or doesn't exist.
virtual int DeactivateActionTable ( ActionCallback pCallback,
ActionTableId  id 
) [pure virtual]

Deactivates the action table.

After the table is deactivated (for example in EndEditParams()) the callback object can be deleted. Tables are initially active, please do not call this method without a preceding call to ActivateActionTable().

Parameters:
pCallback Points to the callback object responsible for executing the action. Pass the same callback that was originally passed to ActivateActionTable() and do not set this to NULL.
id The ID of the table to deactivate.
Returns:
TRUE if the action table was deactivated. FALSE if the table was already deactivated or doesn't exist.
virtual ActionTable* FindTable ( ActionTableId  id ) [pure virtual]

Returns a pointer to an action table.

Parameters:
id The ID of the table to find.
virtual BOOL GetShortcutString ( ActionTableId  tableId,
int  commandId,
MCHAR *  buf 
) [pure virtual]

Retrieves the string that describes the keyboard shortcut for the specified ActionItem.

Parameters:
tableId The ID of the action table.
commandId The ID of the command for the action.
[out] buf String to contain the retrieved text.
Returns:
TRUE if found; FALSE if not found.
virtual BOOL GetActionDescription ( ActionTableId  tableId,
int  commandId,
MCHAR *  buf 
) [pure virtual]

Retrieves a string that descibes the specified operation from the action table whose ID is passed.

Parameters:
tableId The ID of the action table.
commandId The ID of the command.
MCHAR* buf Points to storage for the description string.
Returns:
TRUE if the string was returned; FALSE if not.
virtual BOOL RegisterActionContext ( ActionContextId  contextId,
MCHAR *  pName 
) [pure virtual]

Registers an action context.

This is called when you create the action table that uses this context.

Parameters:
contextId The context ID.
pName The name for the action context.
Returns:
If the specified action context is already registered FALSE is returned; otherwise TRUE is returned.
virtual int NumActionContexts ( ) [pure virtual]

Returns the number of ActionContexts.

virtual ActionContext* GetActionContext ( int  i ) [pure virtual]

Returns a pointer to the nth ActionContext.

Parameters:
i The zero based index of the ActionContext.
virtual ActionContext* FindContext ( ActionContextId  contextId ) [pure virtual]

Returns a pointer to the specified ActionContext.

Parameters:
contextId The ID of the context to find
Returns:
A poitner to the ActionContext or NULL if it not found.
virtual BOOL IsContextActive ( ActionContextId  contextId ) [pure virtual]

Checks if an ActionContext is active or not.

Parameters:
contextId Specifies the context to check.
Returns:
Returns TRUE if the specified context is active; otherwise FALSE.
virtual MCHAR* GetShortcutFile ( ) [pure virtual]
virtual MCHAR* GetShortcutDir ( ) [pure virtual]
virtual int IdToIndex ( ActionTableId  id ) [pure virtual]
virtual void SaveAllContextsToINI ( ) [pure virtual]
virtual int MakeActionSetCurrent ( MCHAR *  pDir,
MCHAR *  pFile 
) [pure virtual]
virtual int LoadAccelConfig ( LPACCEL *  accel,
int *  cts,
ActionTableId  tableId = -1,
BOOL  forceDefault = FALSE 
) [pure virtual]
virtual int SaveAccelConfig ( LPACCEL *  accel,
int *  cts 
) [pure virtual]
virtual int GetCurrentActionSet ( MCHAR *  buf ) [pure virtual]
virtual BOOL SaveKeyboardFile ( MCHAR *  pFileName ) [pure virtual]
virtual BOOL LoadKeyboardFile ( MCHAR *  pFileName ) [pure virtual]
virtual MCHAR* GetKeyboardFile ( ) [pure virtual]

IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager
IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager IActionManager