123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217 |
- { $OPT=-S2 }
- {
- $Id$
- This file is part of the Free Pascal run time library.
- Copyright (c) 1993,97 by the Free Pascal development team.
- See the file COPYING.FPC, included in this distribution,
- for details about the copyright.
- This program is distributed in the hope that it will be useful,
- but WITHOUT ANY WARRANTY; without even the implied warranty of
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- **********************************************************************}
- {
- This unit introduces some basic classes as they are defined in Delphi.
- These classes should be source compatible to their Delphi counterparts:
- TPersistent
- TComponent
- }
- Unit ts010002;
- {$M+}
- Interface
- Type
- { ---------------------------------------------------------------------
- Forward Declarations.
- ---------------------------------------------------------------------}
- TComponent = Class;
- TFiler = Class;
- TPersistent = Class;
- { ---------------------------------------------------------------------
- TFiler
- ---------------------------------------------------------------------}
- TFiler = Class (TObject)
- Protected
- FAncestor : TComponent;
- FIgnoreChildren : Boolean;
- FRoot : TComponent;
- Private
- Public
- Published
- { Methods }
- Constructor Create {(Stream : TStream; BufSize : Longint) };
- Destructor Destroy; override;
- Procedure FlushBuffer; virtual; abstract;
- { Properties }
- Property Root : TComponent Read FRoot Write FRoot;
- Property Ancestor : TComponent Read FAncestor Write FAncestor;
- Property IgnoreChildren : Boolean Read FIgnoreChildren Write FIgnoreChildren;
- end;
- { ---------------------------------------------------------------------
- TPersistent
- ---------------------------------------------------------------------}
- TPersistent = Class (TObject)
- Private
- Procedure AssignError (Source : TPersistent);
- Protected
- Procedure AssignTo (Dest : TPersistent);
- Procedure DefineProperties (Filer : TFiler); Virtual;
- Public
- { Methods }
- Destructor Destroy; Override;
- Procedure Assign (Source : TPersistent); virtual;
- Published
- end;
- { ---------------------------------------------------------------------
- TComponent
- ---------------------------------------------------------------------}
- TComponentState = Set of ( csLoading, csReading, CsWriting, csDestroying,
- csDesigning, csAncestor, csUpdating, csFixups );
- TComponentStyle = set of ( csInheritable,csCheckPropAvail );
- TComponentName = String;
- TComponent = Class (TPersistent)
- Protected
- FComponentState : TComponentState;
- FComponentStyle : TComponentStyle;
- FName : TComponentName;
- FOwner : TComponent;
- Function GetComponent (Index : Longint) : TComponent;
- Function GetComponentCount : Longint;
- Function GetComponentIndex : Longint;
- Procedure SetComponentIndex (Value : Longint);
- Procedure Setname (Value : TComponentName);
- Private
- Public
- { Methods }
- { Properties }
- Property ComponentCount : Longint Read GetComponentCount; { RO }
- Property ComponentIndex : Longint Read GetComponentIndex write SetComponentIndex; { R/W }
- // Property Components [Index : LongInt] : TComponent Read GetComponent; { R0 }
- Property ComponentState : TComponentState Read FComponentState; { RO }
- Property ComponentStyle : TcomponentStyle Read FComponentStyle; { RO }
- Property Owner : TComponent Read Fowner; { RO }
- Published
- Property Name : TComponentName Read FName Write Setname;
- end;
- Implementation
- { ---------------------------------------------------------------------
- TComponent
- ---------------------------------------------------------------------}
- Function TComponent.GetComponent (Index : Longint) : TComponent;
- begin
- end;
- Function TComponent.GetComponentCount : Longint;
- begin
- end;
- Function TComponent.GetComponentIndex : Longint;
- begin
- end;
- Procedure TComponent.SetComponentIndex (Value : Longint);
- begin
- end;
- Procedure TComponent.Setname (Value : TComponentName);
- begin
- end;
- { ---------------------------------------------------------------------
- TFiler
- ---------------------------------------------------------------------}
- Constructor TFiler.Create {(Stream : TStream; BufSize : Longint) };
- begin
- end;
- Destructor TFiler.Destroy;
- begin
- end;
- { ---------------------------------------------------------------------
- TPersistent
- ---------------------------------------------------------------------}
- Procedure TPersistent.AssignError (Source : TPersistent);
- begin
- end;
- Procedure TPersistent.AssignTo (Dest : TPersistent);
- begin
- end;
- Procedure TPersistent.DefineProperties (Filer : TFiler);
- begin
- end;
- Destructor TPersistent.Destroy;
- begin
- end;
- Procedure TPersistent.Assign (Source : TPersistent);
- begin
- end;
- end.
|