![]() | InDesign SDK 20.5 |
#include <ITool.h>

Public Types | |
| enum | { kDefaultIID = IID_ITOOL } |
| enum | ToolType { kNone = 0, kLayoutSelectionTool = 1, kTextSelectionTool = 2, kTableSelectionTool = 4, kLayoutManipulationTool = 8, kTextManipulationTool = 16, kTableManipulationTool = 32, kLayoutCreationTool = 64, kTextCreationTool = 128, kTableCreationTool = 256, kPathManipulationTool = 512, kViewModificationTool = 1024, kJGridTool = 2048, kPageSelectionTool = 4096 } |
Public Member Functions | |
| virtual void | Init (RsrcID iconID, const PluginID &pluginID)=0 |
| virtual void | Select ()=0 |
| virtual void | Deselect ()=0 |
| virtual bool | IsSelected ()=0 |
| virtual ICursorProvider * | GetCursorProvider () const =0 |
| virtual void | SetCursorProvider (ICursorProvider *newProvider)=0 |
| virtual const PMString & | GetName () const =0 |
| virtual void | SetName (const PMString &newName)=0 |
| virtual const PMString & | GetToolHint () const =0 |
| virtual void | SetToolHint (const PMString &newHint)=0 |
| virtual const IDFile & | GetToolIconFile () const =0 |
| virtual ActionID | GetActionID () const =0 |
| virtual void | SetActionID (ActionID actionID)=0 |
| virtual const ClassID & | GetToolType () const =0 |
| virtual void | SetToolType (const ClassID &newToolType)=0 |
| virtual void | DisplayOptions ()=0 |
| virtual void | DisplayAltOptions ()=0 |
| virtual bool16 | IsCreationTool () const =0 |
| virtual bool16 | IsSelectionTool () const =0 |
| virtual bool16 | IsTextTool () const =0 |
| virtual bool16 | IsToolOfType (ITool::ToolType type) const =0 |
| virtual ScriptID | GetScriptID () const =0 |
| virtual bool16 | IsToolNone () const =0 |
Public Member Functions inherited from IPMUnknown | |
| virtual IPMUnknown * | QueryInterface (PMIID interfaceID) const =0 |
| virtual void | AddRef () const =0 |
| virtual void | Release () const =0 |
Basic tool interface. Provides methods to get/set information about a tool, as well as displaying options, selecting and deselecting.
| enum ITool::ToolType |
These are the types a tool will support.
A tool can be one of more of the following types depending on what the tool does This is not to be confused with the tool type which is a ClassID as to what group the tool is in
| pure virtual |
Called when tool is deselected.
Implemented in CTool.
| pure virtual |
Called to display alternate tool options(usually a dialog or nothing)
Implemented in CTool.
| pure virtual |
| pure virtual |
| pure virtual |
| pure virtual |
| pure virtual |
Returns the ScriptID associated with this particular tool such that
scripts can ask the toolBox for the ScriptID of the current tool. The
list of ScriptIDs for the toolbox tools are defined by en_ToolBoxTools
(kToolBoxEnumScriptElement). That is, when adding a new to to the Tool Box,
you must first define a new ScriptID and then add it to kToolBoxEnumScriptElement. For
example, to add scripting support for the pumpkin tool:
1. Define a ScriptID to represent the tool.
en_PumpkinTool = 'pmpk',
2. Add the new constant to the kToolBoxEnumScriptElement by adding the following to your
plugin's ScriptInfo.fr file.
resource VersionedScriptElementInfo( 10 )
{
Contexts { kCS5ScriptVersion, kCoreScriptManagerBoss, kInDesignAllLanguagesFS, k_Wild, } Elements { Enumerator { kToolBoxEnumScriptElement, { en_PumpkinTool, "pumpkin tool", "The pumpkin tool", } } } } ;
Implemented in CTool, SnapTool, SineWaveTool, and SawWaveTool.
| pure virtual |
| pure virtual |
Get the current tool's toolbox icon resource file.
Implemented in CTool.
| pure virtual |
Get tool type. This type determines which tools are mutually exclusive
Implemented in CTool.
| pure virtual |
Called to initialize tool. Tool should set the icon for it's view, and do any other needed initialization.
| iconID | resource ID for the icon associated with the tool's view |
| pluginID | plugin that contains this resource |
Implemented in CTool, SnapTool, SineWaveTool, and SawWaveTool.
| pure virtual |
Does this tool create items?
| kTrue | if items are created, kFalse otherwise |
Implemented in CTool.
| pure virtual |
Returns true if the tool is selected, false otherwise
Implemented in CTool.
| pure virtual |
Does this tool select items? (i.e. kPointerToolBoss, kDirectSelectToolBoss, kCropToolBoss).
| kTrue | if tool selects items, kFalse otherwise |
Implemented in CTool.
| pure virtual |
Does this tool select text? This function could be more accurately be called DoesToolDeactivateTextEditor. For example, in addition to the kIBeamToolBoss, the kZoomToolBoss, kGradientToolBoss, kGrabberHandToolBoss also return kTrue for this function. Use IsToolOfType in conjuction with kTextSelectionTool for traditional "text" tools that select text.
Implemented in CTool.
| pure virtual |
Returns bool16 whether the tool is this none tool i.e. ITool::kNone
Implemented in CTool.
| pure virtual |
Returns bool16 whether the tool is this type of tool
| type | specifies type to compare this tool against |
Implemented in CTool.
| pure virtual |
Called when tool is selected.
Implemented in CTool.
| pure virtual |
| pure virtual |
Set cursor provider for this tool
| newProvider | specifies ICursorProvider for the tool |
Implemented in CTool.
| pure virtual |
| pure virtual |