-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathGDK.ToolsAPI.Helper.Interfaces.pas
More file actions
245 lines (183 loc) · 8.28 KB
/
Copy pathGDK.ToolsAPI.Helper.Interfaces.pas
File metadata and controls
245 lines (183 loc) · 8.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
unit GDK.ToolsAPI.Helper.Interfaces;
interface
uses
ToolsAPI,
System.Classes,
System.SysUtils,
GDK.ToolsAPI.CustomMessage,
GDK.ToolsAPI.Debugger.Interfaces;
type
IToolsApiHelper = interface;
IToolsApiLogger = interface;
IToolsApiProject = interface;
IToolsApiModule = interface;
IToolsApiEditView = interface;
IToolsApiSourceEditor = interface;
IToolsApiEditReader = interface;
IToolsApiEditWriter = interface;
IToolsApiBuildConfigurations = interface;
IToolsApiBuildConfiguration = interface;
IToolsApiEnvironmentOptions = interface;
IToolsApiFormEditor = interface;
IToolsApiProjectContextMenu = interface;
IToolsApiProjectContextMenuItem = interface;
EToolsApiNoProjectFound = class(Exception);
EToolsApiNoModuleFound = class(Exception);
EToolsApiNoEditorFound = class(Exception);
EToolsApiNoEditViewFound = class(Exception);
EToolsApiNoCustomLogGroupUsed = class(Exception);
EToolsApiComponentNotFound = class(Exception);
EToolsApiComponentNotCreated = class(Exception);
EToolsApiPropertyNotSupported = class(Exception);
EToolsApiModuleOutOfSync = class(Exception);
IToolsApiHelper = interface
['{3D85AEBD-3FE0-43A0-9C30-F30F0A820C45}']
function Logger: IToolsApiLogger; overload;
function Logger(const GroupName: string): IToolsApiLogger; overload;
function ProjectGroup: IOTAProjectGroup;
function Project: IToolsApiProject; overload;
function Project(const Project: IOTAProject): IToolsApiProject; overload;
function ProjectContextMenu: IToolsApiProjectContextMenu;
function ModuleCount: Integer;
function Module: IToolsApiModule; overload;
function Module(const Module: IOTAModule): IToolsApiModule; overload;
function Module(const Index: Integer): IToolsApiModule; overload;
function SourceEditor: IToolsApiSourceEditor;
function EditorReader: IToolsApiEditReader;
function EditorWriter: IToolsApiEditWriter;
procedure EditorInsertText(const Text: TArray<string>; const Position: TOTAEditPos); overload;
procedure EditorInsertText(const Text: TArray<string>; const AtLine: Integer); overload;
function EditorPosition: TOTAEditPos;
function EditorContent: string;
function BuildConfigurations: IToolsApiBuildConfigurations;
function EnvironmentOptions: IToolsApiEnvironmentOptions;
function Debugger: IToolsApiDebugger;
function EditView: IToolsApiEditView;
end;
IToolsApiLogger = interface
['{D8FF6783-45A9-4D15-A239-7D5B3EC19D7C}']
function UsesCustomGroup: Boolean;
function GetGroup: IOTAMessageGroup;
procedure Clear;
procedure Log(const Text: string); overload;
procedure Log(const Text: string; const Params: array of const); overload;
function Custom: TCustomMessage;
end;
IToolsApiProject = interface
['{F78C515E-354A-4341-8073-E45B091847B2}']
function Get: IOTAProject;
function ProjectConfigurations: IOTAProjectOptionsConfigurations;
function BuildConfigurations: IToolsApiBuildConfigurations;
function Build(const HideProgressDialog: Boolean = False): Boolean;
// Creates a new form unit through the IDE (default form template), adds it
// to the project and opens the designer. AncestorName without the leading
// "T" (empty means TForm).
function CreateFormUnit(const UnitFileName: string;
const FormName: string;
const AncestorName: string = ''): IOTAModule;
end;
IToolsApiModule = interface
['{6370BA7A-2A5C-468F-BA8F-93B090837B90}']
function Get: IOTAModule;
function FileCount: Integer;
function FileName: string;
procedure Refresh(const ForceRefresh: Boolean);
function IsDirty: Boolean;
function MatchesDisk: Boolean;
// Reloads the module from disk when the buffer is unmodified; raises
// EToolsApiModuleOutOfSync when the buffer has unsaved changes AND the
// file on disk differs (both sides changed).
procedure SyncWithDisk;
function Editor(const Predicate: TFunc<IOTAEditor, Boolean>): IOTAEditor;
function SourceEditor(const Predicate: TFunc<IOTASourceEditor, Boolean> = nil): IToolsApiSourceEditor;
function FormEditor(const Predicate: TFunc<IOTAFormEditor, Boolean> = nil): IOTAFormEditor;
function FormDesigner: IToolsApiFormEditor;
end;
IToolsApiEditView = interface
['{5E080CEF-0D18-453E-8AF4-F7CF9BBCE45C}']
function TopView: IOTAEditView;
function CursorPosition: TOTAEditPos;
procedure InsertText(const Text: TArray<string>; const Position: TOTAEditPos);
end;
IToolsApiSourceEditor = interface
['{1A2D29C0-A6B2-4B21-B17D-781F89A54A14}']
function Get: IOTASourceEditor;
function Reader: IToolsApiEditReader;
function Writer: IToolsApiEditWriter;
function UndoableWriter: IToolsApiEditWriter;
procedure AddToInterfaceUses(const UnitName: string); overload;
procedure AddToInterfaceUses(const UnitNames: TArray<string>); overload;
procedure AddToImplementationUses(const UnitName: string); overload;
procedure AddToImplementationUses(const UnitNames: TArray<string>); overload;
end;
IToolsApiEditReader = interface
['{81675E71-2231-4165-B5CF-EC898D204DEC}']
function Get: IOTAEditReader;
function Content: string;
end;
IToolsApiEditWriter = interface
['{27079628-B140-4E0E-959C-40879C213D52}']
function Get: IOTAEditWriter;
procedure InsertText(const Text: string; const Position: Integer); overload;
procedure InsertText(const Text: string; const Position: TOTAEditPos); overload;
end;
IToolsApiBuildConfigurations = interface
['{CF2A696D-B493-491F-9E2F-C82D7B69CEFE}']
function Base: IToolsApiBuildConfiguration;
function Active: IToolsApiBuildConfiguration;
end;
IToolsApiBuildConfiguration = interface
['{B1FF2C33-0F59-4FD1-822E-327FA78216D2}']
function GetSearchPaths: TArray<string>;
procedure SetSearchPaths(const Paths: TArray<string>);
function Get: IOTABuildConfiguration;
property SearchPaths: TArray<string> read GetSearchPaths write SetSearchPaths;
end;
// Component-level access to an open form designer. Native TComponent
// references are only valid while the designer stays open; do not hold on
// to them.
IToolsApiFormEditor = interface
['{2D75892D-2B7F-422B-A8E4-278C92AEC6F0}']
function Get: IOTAFormEditor;
function Root: TComponent;
function Find(const ComponentName: string): TComponent;
function Components: TArray<TComponent>;
// Assigned event handlers as 'OnClick=Button1Click' pairs.
function AssignedEvents(const Component: TComponent): TArray<string>;
function AddComponent(const TypeName: string;
const ContainerName: string;
const Left: Integer;
const Top: Integer;
const Width: Integer;
const Height: Integer): TComponent;
procedure SetComponentProperty(const ComponentName: string;
const PropertyPath: string;
const Value: string);
// Renders the designed form to a PNG (TCustomForm.GetFormImage).
function CaptureImage: TBytes;
procedure ShowDesigner;
procedure MarkModified;
end;
IToolsApiEnvironmentOptions = interface
['{E258D39A-DA61-4D55-B1FF-DBEB3FE156BC}']
function Get: IOTAEnvironmentOptions;
function TryFindOptionName(const OptionName: string; out ExactName: string): Boolean;
function GetOption(const OptionName: string): Variant;
procedure SetOption(const OptionName: string; const Value: Variant);
end;
IToolsApiProjectContextMenu = interface
['{B8BBB29F-A521-4ED1-9443-8BFA3DEE6E29}']
procedure Remove(const NotifierIndex: Integer);
end;
IToolsApiProjectContextMenuItem = interface(IOTAProjectManagerMenu)
['{32307ABE-6BFD-41D7-A47C-DEBC11F9B217}']
procedure SetOnPostExecute(const Value: TFunc<IOTAProject, Boolean>);
procedure SetOnExecute(const Value: TProc<IOTAProject>);
procedure SetOnPreExecute(const Value: TFunc<IOTAProject, Boolean>);
function NotifierIndex: Integer;
property OnPreExecute: TFunc<IOTAProject, Boolean> write SetOnPreExecute;
property OnExecute: TProc<IOTAProject> write SetOnExecute;
property OnPostExecute: TFunc<IOTAProject, Boolean> write SetOnPostExecute;
end;
implementation
end.