root/lang/pascal/Bagel/BagelBrowser.pas

Revision 4248, 2.3 kB (checked in by plus7, 12 months ago)

initial import

  • Property svn:executable set to *
Line 
1unit BagelBrowser;
2
3interface
4
5uses
6  Windows, Messages, SysUtils, Classes, Controls, GeckoBrowser, ExtCtrls,Dialogs,nsXPCOM,nsTypes;
7
8type
9  TBagelBrowser = class(TGeckoBrowser)
10  private
11    { Private �錾 }
12    FReloadTimer:TTimer;
13    FLocked:Boolean;
14    FRead:Boolean;
15    FAutoHighlight:Boolean;
16    FId:Cardinal;
17    FProgress:Integer;
18   
19    procedure SetReload(Value:Integer);
20    function GetReload:Integer;
21
22{    procedure SetLocked(Value:Boolean);
23    function GetLocked:Boolean;       }
24
25    procedure ExecAutoReload(Sender:TObject);
26
27//    function IsPreferred(const aContentType: PAnsiChar; out aDesiredContentType: PAnsiChar; out _retval: PRBool): nsresult; override;
28  protected
29    { Protected �錾 }
30  public
31    constructor Create(AOwner: TComponent); override;
32    destructor Destroy; override;
33  published
34    { Published �錾 }
35    property ReloadTime:Integer read GetReload write SetReload;
36    property Locked:Boolean read FLocked write FLocked;
37    property Id:Cardinal read FId;
38    property IsRead:Boolean read FRead write FRead;
39    property AutoHighlight:Boolean read FAutoHighlight write FAutoHighlight;
40    property Progress:Integer read FProgress write FProgress;
41  end;
42
43implementation
44
45constructor TBagelBrowser.Create(AOwner: TComponent);
46begin
47  inherited Create(AOwner);
48  FReloadTimer:=TTimer.Create(Self);
49  FReloadTimer.OnTimer := ExecAutoReload;
50  FReloadTimer.Interval := 0;
51  FId := GetTickCount;
52  FRead:=False;
53  FProgress:=0;
54end;
55
56destructor TBagelBrowser.Destroy;
57begin
58  if Assigned(FReloadTimer) then FReloadTimer.Free;
59  inherited Destroy;
60end;
61
62procedure TBagelBrowser.ExecAutoReload(Sender:TObject);
63begin
64  Self.Reload;
65end;
66
67//function TBagelBrowser.IsPreferred(const aContentType: PAnsiChar; out aDesiredContentType: PAnsiChar; out _retval: PRBool): nsresult;
68//begin
69  //_retval:=False;
70  //if FLocked <>true then Result := Self.CanHandleContent(aContentType, True, aDesiredContentType, _retval);
71//end;
72
73procedure TBagelBrowser.SetReload(Value:Integer);
74begin
75  if Assigned(FReloadTimer) then
76  begin
77    FReloadTimer.Interval := Value;
78  end;
79end;
80
81function TBagelBrowser.GetReload:Integer;
82begin
83  Result := 0;
84  if Assigned(FReloadTimer) then Result := FReloadTimer.Interval;
85end;
86
87end.
Note: See TracBrowser for help on using the browser.