📄 tool.pas
字号:
unit Tool;
interface
uses Windows, Classes,VirtIntf,EditIntf, FileIntf,ToolIntf;
type
ToolService=class(TIToolServices)
public
{ Action interfaces }
function CloseProject: Boolean; override;
function OpenProject(const ProjName: string): Boolean; override;
function OpenProjectInfo(const ProjName: string): Boolean; override;
function SaveProject: Boolean; override;
function CloseFile(const FileName: string): Boolean; override;
function SaveFile(const FileName: string): Boolean; override;
function OpenFile(const FileName: string): Boolean; override;
function ReloadFile(const FileName: string): Boolean; override;
function ModalDialogBox(Instance: THandle; TemplateName: PChar; WndParent: HWnd;
DialogFunc: TFarProc; InitParam: LongInt): Integer; override;
function CreateModule(const ModuleName: string;
Source, Form: TIStream; CreateFlags: TCreateModuleFlags): Boolean;override;
function CreateModuleEx(const ModuleName, FormName, AncestorClass,
FileSystem: string; Source, Form: TIStream;
CreateFlags: TCreateModuleFlags): TIModuleInterface; override;
{ Project/UI information }
function GetParentHandle: HWND; override;
function GetProjectName: string; override;
function GetUnitCount: Integer; override;
function GetUnitName(Index: Integer): string; override;
function EnumProjectUnits(EnumProc: TProjectEnumProc; Param: Pointer): Boolean;
override;
function GetFormCount: Integer; override;
function GetFormName(Index: Integer): string; override;
function GetCurrentFile: string; override;
function IsFileOpen(const FileName: string): Boolean; override;
function GetNewModuleName(var UnitIdent, FileName: string): Boolean; override;
{ Component Library interface }
function GetModuleCount: Integer; override;
function GetModuleName(Index: Integer): string; override;
function GetComponentCount(ModIndex: Integer): Integer; override;
function GetComponentName(ModIndex, CompIndex: Integer): string; override;
{function InstallModule(const ModuleName: string): Boolean; virtual; stdcall; abstract;
function CompileLibrary: Boolean; virtual; stdcall; abstract;}
{ Virtual File system interfaces }
function RegisterFileSystem(AVirtualFileSystem: TIVirtualFileSystem): Boolean; override;
function UnRegisterFileSystem(const Ident: string): Boolean; override;
function GetFileSystem(const Ident: string): TIVirtualFileSystem; override;
{ Editor Interfaces }
function GetModuleInterface(const FileName: string): TIModuleInterface;override;
function GetFormModuleInterface(const FormName: string): TIModuleInterface;override;
{ Menu Interfaces }
function GetMainMenu: TIMainMenuIntf; override;
{ Notification registration }
function AddNotifier(AddInNotifier: TIAddInNotifier): Boolean;override;
function RemoveNotifier(AddInNotifier: TIAddInNotifier): Boolean;override;
{ Pascal string handling functions }
function NewPascalString(Str: PChar): Pointer; override;
procedure FreePascalString(var Str: Pointer); override;
procedure ReferencePascalString(var Str: Pointer); override;
procedure AssignPascalString(var Dest, Src: Pointer); override;
{ Error handling }
procedure RaiseException(const Message: string); override;
{ Configuration Access }
function GetBaseRegistryKey: string; override;
{ Extensions }
function GetFormBounds(BoundsType: TBoundsType): TRect; override;
function ProjectCreate(ProjectCreator: TIProjectCreator;
CreateFlags: TCreateProjectFlags): TIModuleInterface; override;
function ModuleCreate(ModuleCreator: TIModuleCreator;
CreateFlags: TCreateModuleFlags): TIModuleInterface; override;
{ Extended Notification registration }
function AddNotifierEx(AddInNotifier: TIAddInNotifier): Boolean;override;
{ Create a unique unit name and class name }
function GetNewModuleAndClassName(const Prefix: string; var UnitIdent,
ClassName, FileName: string): Boolean; override;
end;
implementation
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -