RAD Studio
ContentsIndex
PreviousUpNext
Obtaining Tools API Services

To do anything useful, a wizard needs access to the IDE: its editors, windows, menus, and so on. This is the role of the 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 summarizes all the service interfaces.  

Tools API service interfaces  

Interface 
Description 
INTAServices  
Provides access to native IDE objects: main menu, action list, image list, and tool bars.  
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 debugger.  
IOTAEditorServices  
Provides access to source code editor and its internal buffers.  
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.  
IOTAToDoServices  
Provides access to the To-Do list, allowing a wizard to install a custom To-Do manager.  
IOTAToolsFilter  
Registers tools filter notifiers.  
IOTAWizardServices  
Registers and unregisters wizards.  

To use a service interface, cast the BorlandIDEServices variable to the desired service using the global Supports function, which is defined in the SysUtils unit. For example,

procedure set_keystroke_debugging(debugging: Boolean);
var
  diag: IOTAKeyboardDiagnostics
begin
  if Supports(BorlandIDEServices, IOTAKeyboardDiagnostics, diag) then
    diag.KeyTracing := debugging;
end;

 

void set_keystroke_debugging(bool debugging)
{
_di_IOTAKeyboardDiagnostics diag;
if (BorlandIDEServices->Supports(diag))
diag->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. 

The following topics discuss special considerations when working with the Tools API service interfaces:

Copyright(C) 2009 Embarcadero Technologies, Inc. All Rights Reserved.
What do you think about this topic? Send feedback!