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 tool bars. See Using Native IDE Objects. |
|
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 debugger. |
|
Provides access to source code editor and its internal buffers. |
|
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. |
|
Provides access to the To-Do list, allowing a wizard to install a custom To-Do manager. |
|
Registers tools filter notifiers. |
|
Registers and unregisters wizards. |
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: