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

#include <IToolManager.h>

Inheritance diagram for IToolManager:
IPMUnknown

Public Member Functions

virtual void SetActiveTool (ITool *newActiveTool, ClassID toolType)=0
 
virtual IToolQueryActiveTool (ClassID toolType)=0
 
virtual IToolQueryPreviousActiveTool (ClassID toolType)=0
 
virtual IToolQueryMostRecentSelectionTool ()=0
 
virtual IToolQueryMostRecentCreationTool ()=0
 
virtual int32 GetNumToolTypes ()=0
 
virtual ClassID GetNthToolType (int32 index)=0
 
virtual void Startup (const PMLocaleId &localId)=0
 
virtual void Shutdown (const PMLocaleId &localeId)=0
 
virtual void AddTool (ITool *tool, int32 groupNum, int32 toolNum, ClassID parentTool, int32 subToolNum, RsrcID iconID, const PluginID &pluginID)=0
 
virtual ToolRecord GetNthTool (int32 index)=0
 
virtual ToolRecord GetNthSubTool (int32 index)=0
 
virtual int32 GetNumTools ()=0
 
virtual int32 GetNumSubTools ()=0
 
virtual bool16 FindParentTool (ClassID parentClass, ToolRecord *result)=0
 
virtual bool16 FindTool (ClassID toolClass, ToolRecord *result)=0
 
virtual void SetMostRecentSelectionTool (ITool *selectionTool)=0
 
virtual void SetSpringLoadedTool (ITool *tool)=0
 
virtual void RestoreSpringLoadedTool ()=0
 
virtual bool16 OnKeyUp (IEvent *e)=0
 
virtual bool16 OnKeyDown (IEvent *e)=0
 
virtual bool16 IsToolSpringLoaded ()=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

Interface responsible for maintaining a list of tools. Also keeps track of MRU tools of specific types.

See Also
IToolBoxUtils for the most common way to access most of this functionality.

Member Function Documentation

virtual void IToolManager::AddTool (ITooltool,
int32 groupNum,
int32 toolNum,
ClassID parentTool,
int32 subToolNum,
RsrcID iconID,
const PluginIDpluginID 
)
pure virtual

Add a new tool to the tool manager. This is only legal to do during startup. Usually this gets called as a result of registering plugins and reading in their ToolDef resources

Parameters
toolthe new tool
groupNumthe group number this tool should be in in the toolbox. See ToolboxDefs.h
toolNumthe tool number for this tool within its group in the toolbox. See ToolboxDefs.h
parentToolthe ClassID of the tool this tool should be 'under' in the toolbox.
subToolNumthe subtool number for this tool. Used for relative positioning of subtools. See ToolboxDefs.h
iconIDthe icon for the toolbox to display for this tool
pluginIDthe plugin where the tool resource can be found.
virtual bool16 IToolManager::FindParentTool (ClassID parentClass,
ToolRecordresult 
)
pure virtual

Request the ToolRecord for the parent tool.

Parameters
parentClassthe ClassID of the parent tool you want to find.
resultthe requested ToolRecord for the parent tool is copied into the passed in 'result' param
Returns
boolean indicating if the parent tool was found
virtual bool16 IToolManager::FindTool (ClassID toolClass,
ToolRecordresult 
)
pure virtual

Request the ToolRecord for a tool or subtool

Parameters
toolClassthe ClassID of the tool you want to find.
resultthe requested ToolRecord for the tool is copied into the passed in 'result' param
Returns
boolean indicating if the tool was found
virtual ToolRecord IToolManager::GetNthSubTool (int32 index)
pure virtual

Request the nth subtool. None of these tools live in the main toolbox(i.e. they are subtools)

Parameters
indexthe index of the subtool you're interested in.
Returns
the requested ToolRecord
virtual ToolRecord IToolManager::GetNthTool (int32 index)
pure virtual

Request the nth tool. All these tools live in the main toolbox(i.e. they are not subtools)

Parameters
indexthe index of the tool you're interested in.
Returns
the requested ToolRecord
virtual ClassID IToolManager::GetNthToolType (int32 index)
pure virtual

request the nth tool type. Note that the tool type is a ClassID equal to the ClassID of the default tool for that type.

Parameters
indexthe index of the tool type you're interested in.
Returns
ClassID of nth tool type
virtual int32 IToolManager::GetNumSubTools ()
pure virtual

Request the number of subtools. None of these tools live in the main toolbox(i.e. they are subtools)

Returns
count of subtools
virtual int32 IToolManager::GetNumTools ()
pure virtual

Request the number of tools. All these tools live in the main toolbox(i.e. they are not subtools)

Returns
count of tools
virtual int32 IToolManager::GetNumToolTypes ()
pure virtual

request the number of tool types. Traditional tools are of type kPointerToolBoss. Tools of the same type are mutually exclusive.

Returns
count of unique tool types
virtual bool16 IToolManager::IsToolSpringLoaded ()
pure virtual

checks to see if we have a spring loaded tool in the hopper.

Returns
true if we have a spring loaded tool.
virtual bool16 IToolManager::OnKeyDown (IEvente)
pure virtual

Handles KeyDown events for spring loaded shortcuts

Parameters
eevent from the KeyDown event that fired.
Returns
true if the handler did something and watching should stop.
virtual bool16 IToolManager::OnKeyUp (IEvente)
pure virtual

Handles KeyUp events for spring loaded shortcuts

Parameters
eevent from the KeyUp event that fired.
Returns
true if the handler did something and watching should stop.
virtual ITool* IToolManager::QueryActiveTool (ClassID toolType)
pure virtual

returns the active tool. Most often this is accessed by calling Utils<IToolBoxUtils>()->QueryActiveTool( toolType );

Parameters
toolTypethe 'type' of this tool. Traditional tools are of type kPointerToolBoss. Tools of the same type are mutually exclusive.
Returns
pointer to the active tool of the desired type.
virtual ITool* IToolManager::QueryMostRecentCreationTool ()
pure virtual

returns the most recent creation tool. If the user is using the oval tool, then switches to the zoom tool, calling this would return the oval tool to you.

Returns
pointer to the previous active selection tool
virtual ITool* IToolManager::QueryMostRecentSelectionTool ()
pure virtual

returns the most recent active selection tool. If the user is using the direct select tool, and then switches to the zoom tool, and then switches to the oval tool, calling this would return the direct select tool to you.

Returns
pointer to the previous active selection tool
virtual ITool* IToolManager::QueryPreviousActiveTool (ClassID toolType)
pure virtual

returns the previous active tool. If the user is using the rectangle tool, and then switches to the oval tool, calling this would return the rectangle tool to you. Most often this is accessed by calling Utils<IToolBoxUtils>()->QueryPreviousActiveTool( toolType );

Parameters
toolTypethe 'type' of this tool. Traditional tools are of type kPointerToolBoss. Tools of the same type are mutually exclusive.
Returns
pointer to the previous active tool of the desired type.
virtual void IToolManager::RestoreSpringLoadedTool ()
pure virtual

Restores the spring loaded tool

virtual void IToolManager::SetActiveTool (IToolnewActiveTool,
ClassID toolType 
)
pure virtual

Sets the active tool. Typically only called by SetToolCmd, which in turn is usually invoked by calling Utils<IToolBoxUtils>()->SetActiveTool( itool, toolType );

Parameters
newActiveToolthe new tool to make active
toolTypethe 'type' of this tool. Traditional tools are of type kPointerToolBoss. Tools of the same type are mutually exclusive.
virtual void IToolManager::SetMostRecentSelectionTool (IToolselectionTool)
pure virtual

Sets the selection tool returned by QueryMostRecentSelectionTool to a different selection tool without changing tools. Used for cmd-tab behavior.

Parameters
selectionToolthe newly used selection tool.
virtual void IToolManager::SetSpringLoadedTool (ITooltool)
pure virtual

Sets the tool that RestoreSpringLoadedTool will restore.

Parameters
tooltool that should be restored.
virtual void IToolManager::Shutdown (const PMLocaleIdlocaleId)
pure virtual

Shutdown the tool manager. Internal use only.

virtual void IToolManager::Startup (const PMLocaleIdlocalId)
pure virtual

Startup the tool manager. Internal use only.