|
| 1 | +unit GDK.ToolsAPI.Helper.Interfaces; |
| 2 | + |
| 3 | +interface |
| 4 | + |
| 5 | +uses |
| 6 | + ToolsAPI, |
| 7 | + System.SysUtils; |
| 8 | + |
| 9 | +type |
| 10 | + IToolsApiHelper = interface; |
| 11 | + IToolsApiLogger = interface; |
| 12 | + IToolsApiProject = interface; |
| 13 | + IToolsApiModule = interface; |
| 14 | + IToolsApiEditView = interface; |
| 15 | + IToolsApiSourceEditor = interface; |
| 16 | + IToolsApiEditReader = interface; |
| 17 | + IToolsApiEditWriter = interface; |
| 18 | + IToolsApiBuildConfigurations = interface; |
| 19 | + IToolsApiBuildConfiguration = interface; |
| 20 | + |
| 21 | + EToolsApiNoProjectFound = class(Exception); |
| 22 | + EToolsApiNoModuleFound = class(Exception); |
| 23 | + EToolsApiNoEditorFound = class(Exception); |
| 24 | + EToolsApiNoEditViewFound = class(Exception); |
| 25 | + EToolsApiNoCustomLogGroupUsed = class(Exception); |
| 26 | + |
| 27 | + IToolsApiHelper = interface |
| 28 | + ['{3D85AEBD-3FE0-43A0-9C30-F30F0A820C45}'] |
| 29 | + |
| 30 | + function Logger: IToolsApiLogger; overload; |
| 31 | + function Logger(const GroupName: string): IToolsApiLogger; overload; |
| 32 | + |
| 33 | + function Project: IToolsApiProject; overload; |
| 34 | + function Project(const Project: IOTAProject): IToolsApiProject; overload; |
| 35 | + |
| 36 | + function Module: IToolsApiModule; overload; |
| 37 | + function Module(const Module: IOTAModule): IToolsApiModule; overload; |
| 38 | + |
| 39 | + function SourceEditor: IToolsApiSourceEditor; |
| 40 | + function EditorReader: IToolsApiEditReader; |
| 41 | + function EditorWriter: IToolsApiEditWriter; |
| 42 | + |
| 43 | + procedure EditorInsertText(const Text: TArray<string>; const Position: TOTAEditPos); overload; |
| 44 | + procedure EditorInsertText(const Text: TArray<string>; const AtLine: Integer); overload; |
| 45 | + function EditorPosition: TOTAEditPos; |
| 46 | + function EditorContent: string; |
| 47 | + |
| 48 | + function BuildConfigurations: IToolsApiBuildConfigurations; |
| 49 | + |
| 50 | + function EditView: IToolsApiEditView; |
| 51 | + end; |
| 52 | + |
| 53 | + IToolsApiLogger = interface |
| 54 | + ['{D8FF6783-45A9-4D15-A239-7D5B3EC19D7C}'] |
| 55 | + |
| 56 | + function UsesCustomGroup: Boolean; |
| 57 | + function GetGroup: IOTAMessageGroup; |
| 58 | + |
| 59 | + procedure Clear; |
| 60 | + |
| 61 | + procedure Log(const Text: string); overload; |
| 62 | + procedure Log(const Text: string; const Params: array of const); overload; |
| 63 | + end; |
| 64 | + |
| 65 | + IToolsApiProject = interface |
| 66 | + ['{F78C515E-354A-4341-8073-E45B091847B2}'] |
| 67 | + |
| 68 | + function Get: IOTAProject; |
| 69 | + function ProjectConfigurations: IOTAProjectOptionsConfigurations; |
| 70 | + |
| 71 | + function BuildConfigurations: IToolsApiBuildConfigurations; |
| 72 | + end; |
| 73 | + |
| 74 | + IToolsApiModule = interface |
| 75 | + ['{6370BA7A-2A5C-468F-BA8F-93B090837B90}'] |
| 76 | + |
| 77 | + function Get: IOTAModule; |
| 78 | + function FileCount: Integer; |
| 79 | + |
| 80 | + function Editor(const Predicate: TFunc<IOTAEditor, Boolean>): IOTAEditor; |
| 81 | + function SourceEditor(const Predicate: TFunc<IOTASourceEditor, Boolean> = nil): IToolsApiSourceEditor; |
| 82 | + function FormEditor(const Predicate: TFunc<IOTAFormEditor, Boolean> = nil): IOTAFormEditor; |
| 83 | + end; |
| 84 | + |
| 85 | + IToolsApiEditView = interface |
| 86 | + ['{5E080CEF-0D18-453E-8AF4-F7CF9BBCE45C}'] |
| 87 | + |
| 88 | + function TopView: IOTAEditView; |
| 89 | + function CursorPosition: TOTAEditPos; |
| 90 | + |
| 91 | + procedure InsertText(const Text: TArray<string>; const Position: TOTAEditPos); |
| 92 | + end; |
| 93 | + |
| 94 | + IToolsApiSourceEditor = interface |
| 95 | + ['{1A2D29C0-A6B2-4B21-B17D-781F89A54A14}'] |
| 96 | + |
| 97 | + function Get: IOTASourceEditor; |
| 98 | + function Reader: IToolsApiEditReader; |
| 99 | + function Writer: IToolsApiEditWriter; |
| 100 | + function UndoableWriter: IToolsApiEditWriter; |
| 101 | + end; |
| 102 | + |
| 103 | + IToolsApiEditReader = interface |
| 104 | + ['{81675E71-2231-4165-B5CF-EC898D204DEC}'] |
| 105 | + |
| 106 | + function Get: IOTAEditReader; |
| 107 | + function Content: string; |
| 108 | + end; |
| 109 | + |
| 110 | + IToolsApiEditWriter = interface |
| 111 | + ['{27079628-B140-4E0E-959C-40879C213D52}'] |
| 112 | + |
| 113 | + function Get: IOTAEditWriter; |
| 114 | + |
| 115 | + procedure InsertText(const Text: string; const Position: Integer); overload; |
| 116 | + procedure InsertText(const Text: string; const Position: TOTAEditPos); overload; |
| 117 | + end; |
| 118 | + |
| 119 | + IToolsApiBuildConfigurations = interface |
| 120 | + ['{CF2A696D-B493-491F-9E2F-C82D7B69CEFE}'] |
| 121 | + |
| 122 | + function Base: IToolsApiBuildConfiguration; |
| 123 | + function Active: IToolsApiBuildConfiguration; |
| 124 | + end; |
| 125 | + |
| 126 | + IToolsApiBuildConfiguration = interface |
| 127 | + ['{B1FF2C33-0F59-4FD1-822E-327FA78216D2}'] |
| 128 | + function GetSearchPaths: TArray<string>; |
| 129 | + procedure SetSearchPaths(const Paths: TArray<string>); |
| 130 | + |
| 131 | + function Get: IOTABuildConfiguration; |
| 132 | + |
| 133 | + property SearchPaths: TArray<string> read GetSearchPaths write SetSearchPaths; |
| 134 | + end; |
| 135 | + |
| 136 | +implementation |
| 137 | + |
| 138 | +end. |
0 commit comments