Files

124 lines
3.8 KiB
ObjectPascal

{-------------------------------------------------------------------------------
The contents of this file are subject to the Mozilla Public License
Version 1.1 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
http://www.mozilla.org/MPL/
Software distributed under the License is distributed on an "AS IS" basis,
WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for
the specific language governing rights and limitations under the License.
The Original Code is: uEditAppIntfs.pas, released 2000-09-08.
The Original Code is part of the EditAppDemos project, written by
Michael Hieke for the SynEdit component suite.
All Rights Reserved.
Contributors to the SynEdit project are listed in the Contributors.txt file.
Alternatively, the contents of this file may be used under the terms of the
GNU General Public License Version 2 or later (the "GPL"), in which case
the provisions of the GPL are applicable instead of those above.
If you wish to allow use of your version of this file only under the terms
of the GPL and not to allow others to use your version of this file
under the MPL, indicate your decision by deleting the provisions above and
replace them with the notice and other provisions required by the GPL.
If you do not delete the provisions above, a recipient may use your version
of this file under either the MPL or the GPL.
$Id: uEditAppIntfs.pas,v 1.2 2000/11/22 08:34:14 mghie Exp $
You may retrieve the latest version of this file at the SynEdit home page,
located at http://SynEdit.SourceForge.net
Known Issues:
-------------------------------------------------------------------------------}
unit uEditAppIntfs;
{$I SynEdit.inc}
interface
uses
Windows, Classes, Forms, ComCtrls;
type
IEditor = interface
procedure Activate;
function AskSaveChanges: boolean;
function CanClose: boolean;
procedure Close;
function GetCaretPos: TPoint;
function GetEditorState: string;
function GetFileName: string;
function GetFileTitle: string;
function GetModified: boolean;
procedure OpenFile(AFileName: string);
end;
IEditorFactory = interface
function CanCloseAll: boolean;
procedure CloseAll;
function CreateBorderless(AOwner: TForm): IEditor;
function CreateMDIChild(AOwner: TForm): IEditor;
function CreateTabSheet(AOwner: TPageControl): IEditor;
function GetEditorCount: integer;
function GetEditor(Index: integer): IEditor;
procedure RemoveEditor(AEditor: IEditor);
property Editor[Index: integer]: IEditor read GetEditor;
end;
IEditCommands = interface
function CanCopy: boolean;
function CanCut: boolean;
function CanDelete: boolean;
function CanPaste: boolean;
function CanRedo: boolean;
function CanSelectAll: boolean;
function CanUndo: boolean;
procedure ExecCopy;
procedure ExecCut;
procedure ExecDelete;
procedure ExecPaste;
procedure ExecRedo;
procedure ExecSelectAll;
procedure ExecUndo;
end;
IFileCommands = interface
function CanClose: boolean;
function CanPrint: boolean;
function CanSave: boolean;
function CanSaveAs: boolean;
procedure ExecClose;
procedure ExecPrint;
procedure ExecSave;
procedure ExecSaveAs;
end;
ISearchCommands = interface
function CanFind: boolean;
function CanFindNext: boolean;
function CanFindPrev: boolean;
function CanReplace: boolean;
procedure ExecFind;
procedure ExecFindNext;
procedure ExecFindPrev;
procedure ExecReplace;
end;
var
GI_EditorFactory: IEditorFactory;
GI_ActiveEditor: IEditor;
GI_EditCmds: IEditCommands;
GI_FileCmds: IFileCommands;
GI_SearchCmds: ISearchCommands;
implementation
end.