### IDE Example Wizards Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Classes for example wizards, such as Blog OTA Example Wizard. ```APIDOC TBlogOTAExampleWizard: (Example wizard for blog OTA) ``` -------------------------------- ### Install RAD Studio IDE CR/LF Fix Plugin Source: https://github.com/embarcadero/otapi-docs/wiki/examples/README Instructions for installing the RAD Studio IDE plug-in. This involves opening the project in the IDE, building it, and then installing it via the Component -> Install Packages menu. ```delphi To use this, open it up in the IDE, build it, and install it using Component, Install Packages. ``` -------------------------------- ### Install OTAPI Packages Source: https://github.com/embarcadero/otapi-docs/blob/main/examples/AIEngines/GeminiAIPlugin/README.md Instructions for installing OTAPI packages using the Embarcadero IDE's package manager. ```delphi Install with Component -> Install Packages ``` -------------------------------- ### IOTAPackageServices API Documentation Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAPackageServices140.md Provides methods to query installed packages and components. Use BorlandIDEServices to obtain the IOTAPackageServices object. ```APIDOC IOTAPackageServices: GetComponentCount(): Integer Returns the number of components registered by this package index. GetComponentName(Index: Integer): String Returns the component name of the package index. Parameters: Index: The index of the component. GetPackageCount(): Integer Returns the number of loaded packages. GetPackageName(Index: Integer): String Returns the name of the loaded package. Parameters: Index: The index of the package. Properties: ComponentCount: Integer (Calls GetComponentCount) ComponentNames: String (Calls GetComponentNames - Note: This method is not explicitly defined in the provided table but implied by the property) PackageCount: Integer (Calls GetPackageCount) PackageNames: String (Calls GetPackageNames - Note: This method is not explicitly defined in the provided table but implied by the property) ``` -------------------------------- ### Installing BPL Packages Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Instructions for installing compiled BPL packages into the RAD Studio IDE. This can be done directly after compilation or by adding an existing package through the 'Installed Components' dialog. ```Pascal To install immediately after compiling: Right click on the package and select Install. To install an existing package: Go to the Components main menu, select Installed Components, click Add, browse to the package, and click OK. ``` -------------------------------- ### Open Tools API Code Examples Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Information regarding the availability and usage rights of code examples associated with the Open Tools API documentation. The code is provided in ZIP files and is free for all to use, with specific rights reserved for non-Open Tools API related code. ```APIDOC Code Examples: Availability: Provided in ZIP files on the same webpage. Usage Rights: - Open Tools API aspects: Free to use. - Other code: Provided for information, rights reserved, not for redistribution or reuse. ``` -------------------------------- ### IOTAHighlightServices Methods and Properties Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAHighlightServices.md This section documents the methods and properties of the IOTAHighlightServices interface. It includes methods for managing highlighters (adding, removing, getting count, and getting specific highlighters) and properties that provide convenient access to the highlighter count and highlighters. ```APIDOC IOTAHighlightServices: Up to Parent: [IInterface] Methods: GetHighlighterCount(): Returns the number of highlighters. GetHighlighter(Index: Integer): Returns the highlighter at the specified index. AddHighlighter(AHighlighter: IHighlighter): Adds a new highlighter. RemoveHighlighter(AHighlighter: IHighlighter): Removes the specified highlighter. Properties: Highlighter: Calls GetHighlighter. HighlighterCount: Calls GetHighlighterCount. ``` -------------------------------- ### Generate Content API Request Example Source: https://github.com/embarcadero/otapi-docs/blob/main/examples/AIEngines/GeminiAIPlugin/GeminiAI Specs.md Provides an example JSON payload for the 'generateContent' method, demonstrating how to structure the request with text input. ```JSON { "contents": [ { "parts": [ { "text": "Explain how this API works" } ] } ] } ``` -------------------------------- ### Install RAD Studio IDE CR/LF Fix Plugin Source: https://github.com/embarcadero/otapi-docs/blob/main/examples/FixCRLF/README.md Instructions for installing the RAD Studio IDE plug-in. This involves opening the project in the IDE, building it, and then installing it via the Component -> Install Packages menu. ```delphi To use this, open it up in the IDE, build it, and install it using Component, Install Packages. ``` -------------------------------- ### IOTABuildConfiguration150 Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTABuildConfiguration150.md Provides access to platform-specific build configurations. Includes methods to retrieve a configuration for a given platform name, get the current platform name, and list all available platform names. ```APIDOC IOTABuildConfiguration150: GetPlatformConfiguration(PlatformName: string): IOTABuildConfiguration Returns the IOTABuildConfiguration for the specified PlatformName. GetPlatform(): string Returns the platform name. GetPlatforms(): TStrings Returns the platform names. ``` -------------------------------- ### Generate Content API Response Example Source: https://github.com/embarcadero/otapi-docs/blob/main/examples/AIEngines/GeminiAIPlugin/GeminiAI Specs.md Illustrates a typical JSON response from the 'generateContent' method, showing the structure of generated content, usage metadata, and model version. ```JSON { "candidates": [ { "content": { "parts": [ { "text": "Hi! How can I help you today?\n" } ], "role": "model" }, "finishReason": "STOP", "avgLogprobs": -0.23888545036315917 } ], "usageMetadata": { "promptTokenCount": 2, "candidatesTokenCount": 10, "totalTokenCount": 12, "promptTokensDetails": [ { "modality": "TEXT", "tokenCount": 2 } ], "candidatesTokensDetails": [ { "modality": "TEXT", "tokenCount": 10 } ] }, "modelVersion": "gemini-2.0-flash" } ``` -------------------------------- ### IOTAPackageServices140 Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAPackageServices210.md Provides methods for managing design-time packages within the IDE. Includes retrieving package information, installing new packages, and uninstalling existing ones. ```APIDOC GetPackage: Retrieves the IOTAPackageInfo for the specified package. InstallPackage: Installs the specified design-time package into the IDE. UninstallPackage: Uninstalls the specified design-time package from the IDE. ``` -------------------------------- ### InstallMainMenu Procedure Stub Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md This is the procedure where the main menu is created and installed into the IDE. It checks for the existence of a main menu provided by the IDE, creates a top-level menu item, assigns it to FOTAMainMenu, and then builds the menu structure beneath it. It relies on utility methods not shown here. ```Pascal **procedure** TApplicationMainMenu.InstallMainMenu; **Var** NTAS : INTAServices; **begin** ``` -------------------------------- ### TBlogOTAExampleWizard LoadSettings Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Loads wizard settings (AutoSaveInt and Prompt) from an INI file. It uses TIniFile to read integer and boolean values from the 'Setup' section. The settings are read into FAutoSaveInt and FPrompt respectively. Includes error handling for resource management. ```Delphi procedure TBlogOTAExampleWizard.LoadSettings; begin With TIniFile.Create(FINIFileName) Do Try FAutoSaveInt := ReadInteger('Setup', 'AutoSaveInt', FAutoSaveInt); FPrompt := ReadBool('Setup', 'Prompt', FPrompt); Finally Free; End; end; ``` -------------------------------- ### IOTAProjectCreator Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAProjectCreator.md This section details the methods available in the IOTAProjectCreator interface. These methods are used to manage project creation, file naming, source display, and resource handling within the IDE. ```APIDOC IOTAProjectCreator: GetFileName(): string Description: Return the project filename. NOTE: This *must* be a fully qualified file name. Returns: The fully qualified project filename. GetOptionFileName(): string Description: Deprecated!! Return the option file name (C++ .bpr, .bpk, etc...) Returns: The deprecated option filename. GetShowSource(): boolean Description: Return True to show the source. Returns: True if the source should be shown, False otherwise. NewDefaultModule(): void Description: Deprecated!! Called to create a new default module for this project. NewOptionSource(): void Description: Deprecated!! Create and return the project option source. (C++) NewProjectResource(): void Description: Called to indicate when to create/modify the project resource file. NewProjectSource(): void Description: Create and return the Project source file. ``` -------------------------------- ### IOTAHelp and IOTAHighlighter Interfaces Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/ToolsAPI.md Interfaces for accessing help services, managing help traits, and handling code highlighting. These are essential for integrated help systems and code visualization. ```Pascal interface IOTAHelpInsight : IDispatch; interface IOTAHelpServices : IDispatch; interface IOTAHelpTrait : IDispatch; interface IOTAHighlighter : IOTANotifier; interface IOTAHighlighterPreview : IInterface; interface IOTAHighlightServices : IInterface; ``` -------------------------------- ### Get Word at Cursor in Delphi IDE Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Retrieves the word (identifier) located directly under the cursor in the IDE's editor. It parses the current line of text based on the cursor's column position and identifies characters belonging to an identifier. Returns an empty string if no valid identifier is found or if the identifier starts with a digit. ```Pascal function TKeybindingTemplate.GetWordAtCursor: String; const strIdentChars = ['a'..'z', 'A'..'Z', '_', '0'..'9']; var SE: IOTASourceEditor; EP: TOTAEditPos; iPosition: Integer; sl: TStringList; begin Result := ''; SE := ActiveSourceEditor; EP := SE.EditViews[0].CursorPos; sl := TStringList.Create; try sl.Text := EditorAsString(SE); Result := sl[Pred(EP.Line)]; iPosition := EP.Col; if (iPosition > 0) and (Length(Result) >= iPosition) and CharInSet(Result[iPosition], strIdentChars) then begin while (iPosition > 1) and (CharInSet(Result[Pred(iPosition)], strIdentChars)) do Dec(iPosition); Delete(Result, 1, Pred(iPosition)); iPosition := 1; while CharInSet(Result[iPosition], strIdentChars) do Inc(iPosition); Delete(Result, iPosition, Length(Result) - iPosition + 1); if CharInSet(Result[1], ['0'..'9']) then Result := ''; end else Result := ''; finally sl.Free; end; end; ``` -------------------------------- ### Project Options Configurations Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAProjectOptionsConfigurations.md Provides access to project options and configurations, including methods for managing mobile devices. ```APIDOC IOTAProjectOptionsConfigurations230: GetActiveMobileDevice(PlatformName: str) -> str Description: Returns the active mobile device Id on the specified PlatformName. Parameters: PlatformName: The name of the platform for which to retrieve the active mobile device ID. Returns: The ID of the active mobile device for the given platform. Related Methods: None explicitly mentioned, but likely part of a broader device management API. ``` -------------------------------- ### Example Delphi OTA Debugger Notifier Implementation Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md A conceptual example of how to implement a debugger notifier in Delphi. ```Object Pascal type TMyDebuggerNotifier = class(TInterfacedObject, IOTADebuggerNotifier110) public function BeforeProgramLaunch(const Project: IOTAProject): Boolean; procedure BreakpointAdded(const Breakpoint: IOTABreakpoint); procedure BreakpointChanged(const Breakpoint: IOTABreakpoint); procedure BreakpointDeleted(const Breakpoint: IOTABreakpoint); procedure CurrentProcessChanged(const Process: IOTAProcess); procedure DebuggerOptionsChanged; procedure ProcessDestroyed(const Process: IOTAProcess); procedure ProcessMemoryChanged; procedure ProcessMemoryChanged(EIPChanged: Boolean); procedure ProcessStateChanged(const Process: IOTAProcess); end; { TMyDebuggerNotifier } function TMyDebuggerNotifier.BeforeProgramLaunch(const Project: IOTAProject): Boolean; begin Result := True; // Allow launch end; procedure TMyDebuggerNotifier.BreakpointAdded(const Breakpoint: IOTABreakpoint); begin // Handle breakpoint added event end; procedure TMyDebuggerNotifier.BreakpointChanged(const Breakpoint: IOTABreakpoint); begin // Handle breakpoint changed event end; procedure TMyDebuggerNotifier.BreakpointDeleted(const Breakpoint: IOTABreakpoint); begin // Handle breakpoint deleted event end; procedure TMyDebuggerNotifier.CurrentProcessChanged(const Process: IOTAProcess); begin // Handle current process changed event end; procedure TMyDebuggerNotifier.DebuggerOptionsChanged; begin // Handle debugger options changed event end; procedure TMyDebuggerNotifier.ProcessDestroyed(const Process: IOTAProcess); begin // Handle process destroyed event end; procedure TMyDebuggerNotifier.ProcessMemoryChanged; begin // Handle process memory changed event (older versions) end; procedure TMyDebuggerNotifier.ProcessMemoryChanged(EIPChanged: Boolean); begin // Handle process memory changed event (newer versions) end; procedure TMyDebuggerNotifier.ProcessStateChanged(const Process: IOTAProcess); begin // Handle process state changed event end; ``` -------------------------------- ### Accessing IDE Services with ToolsAPI Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/ToolsAPI.md Demonstrates how to query for IDE services using the ToolsAPI unit and the BorlandIDEServices variable. It shows the pattern for obtaining IOTAxxxService or INTAxxxService interfaces. ```pascal uses ToolsAPI; var MyService: IOTAService; begin if Supports(BorlandIDEServices, IOTAService, MyService) then begin // Use MyService here end; end; ``` -------------------------------- ### IOTAHighlighterPreview Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAHighlighterPreview.md This section details the methods available in the IOTAHighlighterPreview interface. These methods are used to provide preview information for code highlighting, including display names, sample text, and line/block positioning for breakpoints and errors. ```APIDOC IOTAHighlighterPreview: GetDisplayName(): string Description: The display name for the source sample. Returns: The display name of the highlighter. GetSampleText(): string Description: SampleText to highlight. Returns: The sample text to be highlighted. GetInvalidBreakpointLine(): integer Description: Retrieve the line for current settings. Return -1 to not show it. Returns: The line number for an invalid breakpoint, or -1. GetCurrentInstructionLine(): integer Description: Retrieves the current instruction line. Returns: The current instruction line number. GetValidBreakpointLine(): integer Description: Retrieves the line number for a valid breakpoint. Returns: The valid breakpoint line number. GetDisabledBreakpointLine(): integer Description: Retrieves the line number for a disabled breakpoint. Returns: The disabled breakpoint line number. GetErrorLine(): integer Description: Retrieves the line number where an error occurred. Returns: The error line number. GetSampleSearchText(): string Description: Sample text to search for in order to show it as highlighted. Return an empty string to not support it. Returns: The sample text for searching, or an empty string. GetBlockStartLine(): integer Description: Block start/end positions MUST be valid. 1-based indexes. Returns: The starting line number of the block. GetBlockStartCol(): integer Description: Retrieves the starting column number of the block. Returns: The starting column number of the block. GetBlockEndLine(): integer Description: Retrieves the ending line number of the block. Returns: The ending line number of the block. GetBlockEndCol(): integer Description: Retrieves the ending column number of the block. Returns: The ending column number of the block. ``` -------------------------------- ### Delphi Interface Inheritance Example Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Demonstrates the correct way to declare a class that inherits from multiple interfaces, including the necessity of implementing all interfaces in the inheritance chain to avoid IDE crashes. This example highlights the difference between an incorrect and a correct interface declaration. ```Delphi TBNFHighlighter = **Class**(TNotifierObject, IOTAHighlighter **{$IFDEF D2005}**, IOTAHighlighterPreview **{$ENDIF}**) TBNFHighlighter = **Class**(TNotifierObject, IOTANotifier, IOTAHighlighter **{$IFDEF D2005}**, IOTAHighlighterPreview **{$ENDIF}**) ``` -------------------------------- ### Project Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAProjectCompileNotifier.md Provides details on the methods available for the Project object, including their purpose and when they are invoked. ```APIDOC Project: Inherits from: IInterface Methods: AfterCompile() Description: This notifier is called after a compile. Parameters: None Returns: None BeforeCompile() Description: This notifier is called before a compile. Parameters: None Returns: None Destroyed() Description: The associated project builder is being destroyed so all references should be dropped. Parameters: None Returns: None Properties: There are no properties. ``` -------------------------------- ### IOTAOptions Interface Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAOptions.md This section details the methods available for the IOTAOptions interface, allowing interaction with environment and project options. ```APIDOC IOTAOptions: EditOptions() Opens the options dialog. GetOptionValue(OptionName: string): Variant Get the value of the named option. Parameters: OptionName: The name of the option to retrieve. Returns: The value of the specified option. SetOptionValue(OptionName: string; Value: Variant): Boolean Set the value of the named option. Parameters: OptionName: The name of the option to set. Value: The new value for the option. Returns: True if the option was set successfully, False otherwise. GetOptionNames(): TStringList Get the list of available options for this option structure. Returns: A TStringList containing the names of all available options. ``` -------------------------------- ### Querying IDE Services with Supports Source: https://github.com/embarcadero/otapi-docs/wiki/BorlandIDEServices Demonstrates how to use the 'Supports' function to check for and retrieve an interface to an IDE service. This is a common pattern for accessing various IDE functionalities. ```Pascal var LDebuggerServices: IOTADebuggerServices; if Supports(BorlandIDEServices, IOTADebuggerServices, LDebuggerServices) then begin // do something with LDebuggerServices here... end; ``` ```Pascal var LServices: IOTA...; // use the full type name here if Supports(BorlandIDEServices, IOTA...., LServices) then begin // Do something with LServices end; ``` ```Pascal var LNTAType: INTA...; // use the full type name here if Supports(BorlandIDEServices, INTA..., LNTAType) then begin // Do something with LNTAType end; ``` ```Pascal var OTAServices: IOTAServices; LEnvironmentOptions: IOTAEnvironmentOptions; ... if Supports(BorlandIDEServices, IOTAServices, OTAServices) then LEnvironmentOptions := OTAServices.GetEnvironmentOptions; ``` -------------------------------- ### OTAPI Thread Properties Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAThread90.md Provides property accessors for thread information, internally calling corresponding Get methods. ```APIDOC DisplayString: string (read-only) Description: Calls GetDisplayString. Location: string (read-only) Description: Calls GetLocation. OSThreadID: integer (read-only) Description: Calls GetOSThreadID. OwningProcess: Process (read-only) Description: Calls GetOwningProcess. StateString: string (read-only) Description: Calls GetStateString. Status: string (read-only) Description: Calls GetStatus. ``` -------------------------------- ### IOTAPackageServices Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAPackageServices.md Provides methods for managing package notifications. Use BorlandIDEServices to get the IOTAPackageServices object. ```APIDOC IOTAPackageServices: RegisterPackageNotifier(ANotifier: IOTAPackageNotifier) Adds a callback notifier for package notifications. Parameters: ANotifier: The IOTAPackageNotifier to register. UnregisterPackageNotifier(ANotifier: IOTAPackageNotifier) Removes a callback notifier for package notifications. Parameters: ANotifier: The IOTAPackageNotifier to unregister. ``` -------------------------------- ### Querying IDE Services with Supports Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/BorlandIDEServices.md Demonstrates how to use the 'Supports' function to check for and retrieve an interface to an IDE service. This is a common pattern for accessing various IDE functionalities. ```Pascal var LDebuggerServices: IOTADebuggerServices; if Supports(BorlandIDEServices, IOTADebuggerServices, LDebuggerServices) then begin // do something with LDebuggerServices here... end; ``` ```Pascal var LServices: IOTA...; // use the full type name here if Supports(BorlandIDEServices, IOTA...., LServices) then begin // Do something with LServices end; ``` ```Pascal var LNTAType: INTA...; // use the full type name here if Supports(BorlandIDEServices, INTA..., LNTAType) then begin // Do something with LNTAType end; ``` ```Pascal var OTAServices: IOTAServices; LEnvironmentOptions: IOTAEnvironmentOptions; ... if Supports(BorlandIDEServices, IOTAServices, OTAServices) then LEnvironmentOptions := OTAServices.GetEnvironmentOptions; ``` -------------------------------- ### IOTACustomMessage Child Access Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTACustomMessage50.md Provides methods to retrieve child messages by index and to get the total count of child messages. ```APIDOC IOTACustomMessage: GetChild(Index: Integer): IOTACustomMessage Description: Returns the child message referred to by the Index parameter. Parameters: Index: The index of the child message to retrieve. Returns: The child IOTACustomMessage object. GetChildCount(): Integer Description: Returns the number of child messages the current message has. Returns: The count of child messages. Properties: Child: IOTACustomMessage Description: Calls GetChild. ChildCount: Integer Description: Calls GetChildCount. ``` -------------------------------- ### IOTAFile Interface Properties Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAFile.md Provides property accessors for the file's source code and age, internally calling the respective Get methods. ```APIDOC IOTAFile: Source: bytes { get } Gets the actual source code of the file (calls GetSource). Age: int { get } Gets the age of the file in days (calls GetAge). Returns -1 if the file is new. ``` -------------------------------- ### IOTAHighlighterPreview Display and Sample Text Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md These methods provide the display name for the highlighter and the sample text to be shown in the preview. GetSampleSearchText returns text to be highlighted as searched, while GetSampleText returns the full sample content. ```APIDOC TEidolonHighlighter.GetDisplayName: String; - Returns the name of the highlighter preview. - Example: Result := 'Eidolon'; ``` ```APIDOC TEidolonHighlighter.GetSampleSearchText: String; - Returns the text to be highlighted as searched in the preview. - Example: Result := 'Date'; ``` ```APIDOC TEidolonHighlighter.GetSampleText: String; - Returns the sample text to be shown in the preview. - Example: Result := '\n\n Eidolon Map File\n\n**\nThis is a text file definition=Class(TextTable)\n{\n #TableName=D:\\Path\\Text table.txt\n Activity ID:C(255)\n Activity Name:C(255)=Description\n Start Date:D\n Finish Date:D\n Start Chainage:I\n Start Chainage:I\n Time Location Symbol:C(255)\n}'; ``` -------------------------------- ### Project Configuration and Platform Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAProjectOptionsConfigurations230.md Provides methods to retrieve the name of the currently active configuration and the current platform name. These are essential for understanding the project's current state. ```APIDOC GetCurrentConfigurationName: Description: Return currently active configuration's name. GetCurrentPlatformName: Description: Returns the current platform name. ActiveConfigurationName: Description: Calls GetCurrentConfigurationName. ActivePlatformName: Description: Calls GetCurrentPlatformName. ``` -------------------------------- ### IOTAFile Interface Properties Source: https://github.com/embarcadero/otapi-docs/wiki/IOTAFile Provides property accessors for the file's source code and age, internally calling the respective Get methods. ```APIDOC IOTAFile: Source: bytes { get } Gets the actual source code of the file (calls GetSource). Age: int { get } Gets the age of the file in days (calls GetAge). Returns -1 if the file is new. ``` -------------------------------- ### IOTACustomMessage Interface Properties Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTACustomMessage.md This section details the properties available in the IOTACustomMessage interface. These properties provide convenient access to the information returned by the corresponding Get methods. ```APIDOC IOTACustomMessage: ColumnNumber: Integer read GetColumnNumber Calls GetColumnNumber. FileName: String read GetFileName Calls GetFileName. LineNumber: Integer read GetLineNumber Calls GetLineNumber. LineText: String read GetLineText Calls GetLineText. ``` -------------------------------- ### IOTA Platform SDK Services (Multiple Versions) Source: https://github.com/embarcadero/otapi-docs/wiki/BorlandIDEServices Services for interacting with the IOTA Platform Software Development Kit (SDK). These services enable developers to leverage the SDK's capabilities for platform integration. ```APIDOC IOTAPlatformSDKServices GUID: {6C659F7B-FD36-478C-85C5-F2942C224FD9} ``` ```APIDOC IOTAPlatformSDKServices180 GUID: {A41933CA-8F86-46F3-835B-63EF1CAD9783} ``` ```APIDOC IOTAPlatformSDKServices190 GUID: {DEEC6CA6-7027-4962-A236-A2DF222F2163} ``` ```APIDOC IOTAPlatformSDKServices210 GUID: {9A083C9D-8CE3-43E6-B0AB-B70C3FFB8308} ``` -------------------------------- ### IOTACodeInsightManager100 Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTACodeInsightUIOverride.md This section details the methods available in the IOTACodeInsightManager100 interface. These methods allow the IDE to query and control features like GoToDefinition and Tooltip. ```APIDOC IOTACodeInsightManager100: Inherits from: IInterface Methods: EnableGotoDefinition(AEnabled: Boolean): void Description: Called when the IDE is determining whether to call goto definition or not. Changing the value of AEnabled will override the default calculations of the IDE. Parameters: AEnabled: Boolean - Set to True to enable GoToDefinition, False to disable. EnableTooltip(AEnabled: Boolean): void Description: Called when the IDE is determining whether to call Tooltip or not. Changing the value of AEnabled will override the default calculations of the IDE. Parameters: AEnabled: Boolean - Set to True to enable Tooltip, False to disable. ``` -------------------------------- ### Adding and Removing Notifiers Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Code examples for registering a notifier with the IDE using IOTAEditorServices.AddNotifier and removing it using IOTAEditorServices.RemoveNotifier. ```Delphi // Adding the notifier FEditorNotifier := (BorlandIDEServices As IOTAEditorServices).AddNotifier( TDGHNotificationsEditorNotifier.Create('INTAEditorServicesNotifier', dinEditorNotifier) ); // Removing the notifier If FEditorNotifier > -1 Then (BorlandIDEServices As IOTAEditorServices).RemoveNotifier(FEditorNotifier); ``` -------------------------------- ### Unified Initialization Logic Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Provides the implementation for a unified InitialiseWizard function that creates and initializes the wizard instance, handling IDE integration for both DLLs and Packages. ```Pascal Var iWizard : Integer = 0; Function InitialiseWizard(BIDES : IBorlandIDEServices) : TBlogOTAExampleWizard; Begin Result := TBlogOTAExampleWizard.Create; Application.Handle := (BIDES As IOTAServices).GetParentHandle; End; ``` -------------------------------- ### Get Existing Message Group Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Retrieves an existing message group (tab) from the IDE's message window. ```Pascal Var MyGroup : IOTAMessageGroup; Begin ... MyGroup := GetGroup('My Message Group'); ... End; ``` -------------------------------- ### Delphi Wizard Initialization with Aboutbox Plugin Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Initializes a wizard, retrieves IDE services, and adds plugin information to the about box. It loads a splash screen bitmap and uses `AddPluginInfo` to register the expert's details, including its version number. ```Delphi Function InitialiseWizard : TWizardTemplate; Var Svcs : IOTAServices; Begin Svcs := BorlandIDEServices As IOTAServices; ToolsAPI.BorlandIDEServices := BorlandIDEServices; Application.Handle := Svcs.GetParentHandle; {$IFDEF D2005} // Aboutbox plugin bmSplashScreen := LoadBitmap(hInstance, 'SplashScreenBitMap'); With VersionInfo Do iAboutPluginIndex := (BorlandIDEServices As IOTAAboutBoxServices).AddPluginInfo( Format(strSplashScreenName, [iMajor, iMinor, Copy(strRevision, iBugFix + 1, 1)]), '$WIZARDDESCRIPTION$.', bmSplashScreen, False, Format(strSplashScreenBuild, [iMajor, iMinor, iBugfix, iBuild]), Format('SKU Build %d.%d.%d.%d', [iMajor, iMinor, iBugfix, iBuild])); {$ENDIF} ... End; ``` -------------------------------- ### IOTAProject40 Properties Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAProject40.md This section outlines the properties of the IOTAProject40 interface, which provide convenient access to project options and the project builder. These properties internally call the corresponding Get methods. ```APIDOC IOTAProject40: ProjectOptions: IOTAProjectOptions read GetProjectOptions Description: Accesses the project's configuration settings. ProjectBuilder: IOTAProjectBuilder read GetProjectBuilder Description: Provides access to the project builder interface. ``` -------------------------------- ### IDE Object Properties Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/INTAServices.md Provides properties that offer direct access to key IDE components, including the ActionList, ImageList, MainMenu, and ToolBar. These properties internally call their corresponding Get methods. ```APIDOC ActionList: Calls GetActionList. ImageList: Calls GetImageList. MainMenu: Calls GetMainMenu. ToolBar: Calls GetToolBar. ``` -------------------------------- ### Accessing Package Services Source: https://github.com/embarcadero/otapi-docs/wiki/BorlandIDEServices Shows how to directly cast the BorlandIDEServices to a specific package service interface, such as IOTAPackageServices210, and then call its methods like InstallPackage. ```Pascal var LPackageServices: IOTAPackageServices210 := BorlandIDEServices as IOTAPackageServices210; LPackageServices.InstallPackage(...); ``` -------------------------------- ### IOTA Splash Screen Service Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/BorlandIDEServices.md Manages the display and behavior of the splash screen during application startup in the IOTA environment. This service controls the initial visual presentation. ```APIDOC IOTASplashScreenService GUID: {2550066E-CF92-475E-8C27-EBDC6CEFB3D8} ``` -------------------------------- ### OTAPI Thread Call Stack Management Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAThread90.md Manages access to a thread's call stack. Includes methods to start and end access, and retrieve information about the call stack's accessibility. ```APIDOC StartCallStackAccess() Description: Tells the thread that you are about to access the call stack. Returns the current state of the call stack for this thread. Check the state before using the GetCallCount, GetCallHeader, or GetCallPos methods. States: csAccessible: stack can be queried. csInaccessible: stack can not be queried. csWait: stack is temporarily unavailable. Try again after letting the message loop spin for a bit (i.e post yourself a message to try again). EndCallStackAccess() Description: Tells the thread that you are done accessing the call stack. ``` -------------------------------- ### Get Active Project Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Retrieves a reference to the currently active project in the Project Manager. Returns nil if no project is active. ```Pascal Function ActiveProject : IOTAProject; var G : IOTAProjectGroup; Begin Result := Nil; G := ProjectGroup; If G <> Nil Then Result := G.ActiveProject; End; ``` -------------------------------- ### IOTA Platform SDK Services (Multiple Versions) Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/BorlandIDEServices.md Services for interacting with the IOTA Platform Software Development Kit (SDK). These services enable developers to leverage the SDK's capabilities for platform integration. ```APIDOC IOTAPlatformSDKServices GUID: {6C659F7B-FD36-478C-85C5-F2942C224FD9} ``` ```APIDOC IOTAPlatformSDKServices180 GUID: {A41933CA-8F86-46F3-835B-63EF1CAD9783} ``` ```APIDOC IOTAPlatformSDKServices190 GUID: {DEEC6CA6-7027-4962-A236-A2DF222F2163} ``` ```APIDOC IOTAPlatformSDKServices210 GUID: {9A083C9D-8CE3-43E6-B0AB-B70C3FFB8308} ``` -------------------------------- ### IOTASearchOptions Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAReplaceOptions.md This section documents the methods available for interacting with search and replace options within IOTASearchOptions. It covers methods for getting and setting prompt behavior, replace all flags, and replace text. ```APIDOC IOTASearchOptions Methods: GetPromptOnReplace() Description: Retrieves the current setting for prompting on replace. GetReplaceAll() Description: Retrieves the current setting for replacing all occurrences. GetReplaceText() Description: Retrieves the text to be used for replacement. SetPromptOnReplace(value: Boolean) Description: Sets the behavior for prompting on replace. Parameters: value: A boolean value indicating whether to prompt on replace. SetReplaceAll(value: Boolean) Description: Sets the flag for replacing all occurrences. Parameters: value: A boolean value indicating whether to replace all occurrences. SetReplaceText(value: String) Description: Sets the text to be used for replacement. Parameters: value: The string to be used as the replacement text. ``` -------------------------------- ### IOTACreator Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTACreator.md This section details the core methods of the IOTACreator interface. These methods are implemented by creator subclasses to define how modules, projects, or files are created and managed. They cover aspects like default creator types, existence checks, file system interactions, ownership, and naming conventions. ```APIDOC IOTACreator: GetCreatorType(): string Description: Returns a string representing the default creator type to augment, or an empty string if this creator provides all information. Returns: A string representing the creator type or an empty string. GetExisting(): boolean Description: Returns False if this is a new module, True otherwise. Returns: True if the module exists, False if it is new. GetFileSystem(): string Description: Returns the File system IDString that this module uses for reading/writing. Returns: The IDString of the file system. GetOwner(): IUnknown Description: Returns the Owning module. For a project module, this would be a project; for a project, this is a project group. Returns: The owning module or interface. GetUnnamed(): boolean Description: Returns True if this item is to be marked as un-named. This forces the save as dialog to appear the first time the user saves. Returns: True if the item should be un-named, False otherwise. ``` -------------------------------- ### IOTAHighlighter Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAHighlighter.md Core methods for the IOTAHighlighter interface, used for identifying and retrieving information about the highlighter. ```APIDOC IOTAHighlighter: GetIDString(): string // Returns a unique string identifier for the highlighter. GetName(): string // Returns the display name of the highlighter. Tokenize(text: string): Token[] // Tokenizes the input text and returns an array of tokens. TokenizeLineClass(text: string): string[] // Tokenizes the input text and returns an array of line classes. ``` -------------------------------- ### Get Project Group Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Retrieves a reference to the single active project group in the IDE. Returns nil if no project group is open. ```Pascal Function ProjectGroup: IOTAProjectGroup; Var AModuleServices: IOTAModuleServices; AModule: IOTAModule; i: integer; AProjectGroup: IOTAProjectGroup; Begin Result := Nil; AModuleServices := (BorlandIDEServices as IOTAModuleServices); For i := 0 To AModuleServices.ModuleCount - 1 Do Begin AModule := AModuleServices.Modules[i]; If (AModule.QueryInterface(IOTAProjectGroup, AProjectGroup) = S_OK) Then Break; End; Result := AProjectGroup; end; ``` -------------------------------- ### IOTAProjectOptionsConfigurations Methods Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/IOTAProjectOptionsConfigurations140.md Provides access to methods for managing project configurations. These include retrieving counts, accessing configurations by index or status, setting the active configuration, and adding or removing configurations. ```APIDOC IOTAProjectOptionsConfigurations: GetConfigurationCount(): Integer Returns the number of configurations in this project. GetConfiguration(Index: Integer): IOTABuildConfiguration Returns the indexed configuration in this project. GetActiveConfiguration(): IOTABuildConfiguration Returns the active configuration for this project. SetActiveConfiguration(Value: IOTABuildConfiguration): Void Sets the active configuration for this project. GetBaseConfiguration(): IOTABuildConfiguration Returns the Base configuration in this project. AddConfiguration(Name: String, Parent: IOTABuildConfiguration): IOTABuildConfiguration Adds a new configuration with the specified name, descending from the specified Parent configuration. Returns the added configuration. RemoveConfiguration(NameOrKey: String): Void Removes the configuration with the specified Name or Key. ``` -------------------------------- ### Get Editor Content as String Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Reads the entire content of a given source editor and returns it as a string. Handles reading in chunks. ```Pascal Function EditorAsString(SourceEditor : IOTASourceEditor) : String; Var Reader : IOTAEditReader; iRead : Integer; iPosition : Integer; strBuffer : AnsiString; Begin Result := ''; Reader := SourceEditor.CreateReader; Try iPosition := 0; Repeat SetLength(strBuffer, iBufferSize); iRead := Reader.GetText(iPosition, PAnsiChar(strBuffer), iBufferSize); SetLength(strBuffer, iRead); Result := Result + String(strBuffer); Inc(iPosition, iRead); Until iRead < iBufferSize; Finally Reader := Nil; End; End; ``` -------------------------------- ### IOTA Splash Screen Service Source: https://github.com/embarcadero/otapi-docs/wiki/BorlandIDEServices Manages the display and behavior of the splash screen during application startup in the IOTA environment. This service controls the initial visual presentation. ```APIDOC IOTASplashScreenService GUID: {2550066E-CF92-475E-8C27-EBDC6CEFB3D8} ``` -------------------------------- ### Get Project Module Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Retrieves the source module (e.g., DPR, DPK) for a given project. Requires a valid IOTAProject reference. ```Pascal Function ProjectModule(Project : IOTAProject) : IOTAModule; Var AModuleServices: IOTAModuleServices; AModule: IOTAModule; i: integer; AProject: IOTAProject; Begin Result := Nil; AModuleServices := (BorlandIDEServices as IOTAModuleServices); For i := 0 To AModuleServices.ModuleCount - 1 Do Begin AModule := AModuleServices.Modules[i]; If (AModule.QueryInterface(IOTAProject, AProject) = S_OK) And (Project = AProject) Then Break; End; Result := AProject; End; ``` -------------------------------- ### Pre-Compilation Hook Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md The BeforeCompile procedure is called just before the compiler starts. It allows you to cancel the compilation process by setting the 'Cancel' parameter to True. ```Delphi procedure BeforeCompile(const Project: IOTAProject; var Cancel: Boolean); // Example usage: // if Project.GetCompilerOptions.Target = 'Debug' then // Cancel := True; ``` -------------------------------- ### Accessing Package Services Source: https://github.com/embarcadero/otapi-docs/blob/main/wiki/BorlandIDEServices.md Shows how to directly cast the BorlandIDEServices to a specific package service interface, such as IOTAPackageServices210, and then call its methods like InstallPackage. ```Pascal var LPackageServices: IOTAPackageServices210 := BorlandIDEServices as IOTAPackageServices210; LPackageServices.InstallPackage(...); ``` -------------------------------- ### IDE Configuration and Options Source: https://github.com/embarcadero/otapi-docs/blob/main/The Delphi IDE Open Tools API - Version 1.2.md Interfaces for IDE configuration options, including help and repository wizards. ```APIDOC TfmIDEHelpHelperOptions: (Form for IDE Help Helper Options) TfrmRepositoryWizard: (Form for the Repository Wizard) TRepositoryWizardInterface: (Interface for the Repository Wizard) ```