Obtaining Tools API Services
Go Up to Extending the IDE Using the Tools API
To do anything useful, packages that extend the IDE need access to its editors, windows, menus, and so on. This is the role of the service interfaces.
Contents
List of Common Tools API Service Interfaces
The Tools API includes many services, such as action services to perform file actions, editor services to access the source code editor, debugger services to access the debugger, and so on. The following table shows some of the most important service interfaces:
Interface | Description |
---|---|
|
Provides access to native IDE objects: main menu, action list, image list, and toolbars. See Using Native IDE Objects. |
Allows users to register for editor events. | |
Interface to implement the Welcome Page background. | |
Provides services of the Welcome Page Service. | |
|
Performs basic file actions: open, close, save and reload a file. |
|
Provides access to code completion, allowing a wizard to install a custom code completion manager. |
|
Provides access to the debugger. |
|
Provides access to source code editor and its internal buffers. |
|
Provides access to the IDE's StyleServices, allows you to check if theming is enabled, lets you register your forms to be drawn in the same style as the IDE's inbuilt forms, and more. |
|
Permits a wizard to register custom keyboard bindings. |
|
Provides access to keyboard macros and bindings. |
|
Toggle Debugging of keystrokes. |
|
Provides access to message view. |
|
Provides access to open files. |
|
Queries the names of all installed packages and their components. |
|
Miscellaneous services. |
|
Splash screen interface. |
|
Provides access to the To-Do list, allowing a wizard to install a custom To-Do manager. |
|
Registers tools filter notifiers. |
Queries the list of installed platforms, SKU, and if the running IDE is a Trial version. | |
|
Registers and unregisters wizards. |
High DPI Images in the Tools API
All APIs that pass images, such as the splash screen services, about box, IDE Insight, and other areas, support high DPI images.
Each interface has a new overload of relevant methods that take a TGraphicArray
, defined as an array of TGraphic
. This allows you to pass in multiple resolutions of the same icon, which are added to the internal image collection and used with a virtual image list.
Although the methods take an array of any TGraphic,
we recommend PNG images.
Using a Service Interface
To use a service interface, cast the BorlandIDEServices
variable to the desired service using the global Supports function. For example:
Delphi:
procedure SetKeystrokeDebugging(Debugging: Boolean);
var
Dialog: IOTAKeyboardDiagnostics
begin
if Supports(BorlandIDEServices, IOTAKeyboardDiagnostics, Dialog) then
Dialog.KeyTracing := Debugging;
end;
C++:
void SetKeystrokeDebugging(bool Debugging)
{
_di_IOTAKeyboardDiagnostics Dialog;
if (BorlandIDEServices->Supports(Dialog))
Dialog->KeyTracing = Debugging;
}
If your wizard needs to use a specific service often, you can keep a pointer to the service as a data member of your wizard class.
Topics
The following topics discuss special considerations when working with the Tools API service interfaces: