2011-09-08 07:05:53 +00:00
|
|
|
unit browsermodules;
|
|
|
|
|
|
|
|
{$mode delphi}
|
|
|
|
|
|
|
|
interface
|
|
|
|
|
|
|
|
uses
|
|
|
|
Classes, SysUtils;
|
|
|
|
|
|
|
|
type
|
|
|
|
|
|
|
|
{ TBrowserModule }
|
|
|
|
|
|
|
|
TBrowserModule = class
|
|
|
|
public
|
|
|
|
ShortDescription: string;
|
|
|
|
Activated: Boolean;
|
|
|
|
constructor Create; virtual;
|
2011-09-15 12:19:24 +00:00
|
|
|
function HandleOnPageLoad(AInput: string; out AOutput: string): Boolean; virtual;
|
2011-09-08 07:05:53 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
procedure RegisterBrowserModule(AModule: TBrowserModule);
|
|
|
|
function GetBrowserModule(AIndex: Integer): TBrowserModule;
|
|
|
|
function GetBrowserModuleCount(): Integer;
|
|
|
|
|
|
|
|
implementation
|
|
|
|
|
|
|
|
var
|
|
|
|
gBrowserModules: TList;
|
|
|
|
|
|
|
|
procedure RegisterBrowserModule(AModule: TBrowserModule);
|
|
|
|
begin
|
|
|
|
if AModule = nil then raise Exception.Create('[RegisterBrowserModule] Attempted to register a nil Module');
|
|
|
|
gBrowserModules.Add(AModule);
|
|
|
|
end;
|
|
|
|
|
|
|
|
function GetBrowserModule(AIndex: Integer): TBrowserModule;
|
|
|
|
begin
|
|
|
|
if AIndex < 0 then Exit(nil);
|
|
|
|
Result := TBrowserModule(gBrowserModules.Items[AIndex]);
|
|
|
|
end;
|
|
|
|
|
|
|
|
function GetBrowserModuleCount: Integer;
|
|
|
|
begin
|
|
|
|
Result := gBrowserModules.Count;
|
|
|
|
end;
|
|
|
|
|
|
|
|
{ TBrowserModule }
|
|
|
|
|
|
|
|
constructor TBrowserModule.Create;
|
|
|
|
begin
|
|
|
|
|
|
|
|
end;
|
|
|
|
|
2011-09-08 14:16:34 +00:00
|
|
|
function TBrowserModule.HandleOnPageLoad(AInput: string; out AOutput: string): Boolean;
|
2011-09-08 07:05:53 +00:00
|
|
|
begin
|
2011-09-08 14:16:34 +00:00
|
|
|
AOutput := '';
|
|
|
|
Result := False;
|
2011-09-08 07:05:53 +00:00
|
|
|
end;
|
|
|
|
|
|
|
|
initialization
|
|
|
|
gBrowserModules := TList.Create;
|
|
|
|
finalization
|
|
|
|
gBrowserModules.Free;
|
|
|
|
end.
|
|
|
|
|