Obtaining Tools API Services

From RAD Studio
Jump to: navigation, search

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.

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

INTAServices

Provides access to native IDE objects: main menu, action list, image list, and toolbars. See Using Native IDE Objects.

INTACodeEditorServices

Allows users to register for editor events.

INTAWelcomePageBackgroundService

Interface to implement the Welcome Page background.

INTAWelcomePagePluginService

Provides services of the Welcome Page Service.

IOTAActionServices

Performs basic file actions: open, close, save and reload a file.

IOTACodeCompletionServices

Provides access to code completion, allowing a wizard to install a custom code completion manager.

IOTADebuggerServices

Provides access to the debugger.

IOTAEditorServices

Provides access to source code editor and its internal buffers.

IOTAIDEThemingServices

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.

IOTAKeyBindingServices

Permits a wizard to register custom keyboard bindings.

IOTAKeyboardServices

Provides access to keyboard macros and bindings.

IOTAKeyboardDiagnostics

Toggle Debugging of keystrokes.

IOTAMessageServices

Provides access to message view.

IOTAModuleServices

Provides access to open files.

IOTAPackageServices

Queries the names of all installed packages and their components.

IOTAServices

Miscellaneous services.

IOTASplashScreenServices

Splash screen interface.

IOTAToDoServices

Provides access to the To-Do list, allowing a wizard to install a custom To-Do manager.

IOTAToolsFilter

Registers tools filter notifiers.

IOTAVersionSKUInfoService

Queries the list of installed platforms, SKU, and if the running IDE is a Trial version.

IOTAWizardServices

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:

See Also