ts010002.pp 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217
  1. { $OPT=-S2 }
  2. {
  3. $Id$
  4. This file is part of the Free Pascal run time library.
  5. Copyright (c) 1993,97 by the Free Pascal development team.
  6. See the file COPYING.FPC, included in this distribution,
  7. for details about the copyright.
  8. This program is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  11. **********************************************************************}
  12. {
  13. This unit introduces some basic classes as they are defined in Delphi.
  14. These classes should be source compatible to their Delphi counterparts:
  15. TPersistent
  16. TComponent
  17. }
  18. Unit ts010002;
  19. {$M+}
  20. Interface
  21. Type
  22. { ---------------------------------------------------------------------
  23. Forward Declarations.
  24. ---------------------------------------------------------------------}
  25. TComponent = Class;
  26. TFiler = Class;
  27. TPersistent = Class;
  28. { ---------------------------------------------------------------------
  29. TFiler
  30. ---------------------------------------------------------------------}
  31. TFiler = Class (TObject)
  32. Protected
  33. FAncestor : TComponent;
  34. FIgnoreChildren : Boolean;
  35. FRoot : TComponent;
  36. Private
  37. Public
  38. Published
  39. { Methods }
  40. Constructor Create {(Stream : TStream; BufSize : Longint) };
  41. Destructor Destroy; override;
  42. Procedure FlushBuffer; virtual; abstract;
  43. { Properties }
  44. Property Root : TComponent Read FRoot Write FRoot;
  45. Property Ancestor : TComponent Read FAncestor Write FAncestor;
  46. Property IgnoreChildren : Boolean Read FIgnoreChildren Write FIgnoreChildren;
  47. end;
  48. { ---------------------------------------------------------------------
  49. TPersistent
  50. ---------------------------------------------------------------------}
  51. TPersistent = Class (TObject)
  52. Private
  53. Procedure AssignError (Source : TPersistent);
  54. Protected
  55. Procedure AssignTo (Dest : TPersistent);
  56. Procedure DefineProperties (Filer : TFiler); Virtual;
  57. Public
  58. { Methods }
  59. Destructor Destroy; Override;
  60. Procedure Assign (Source : TPersistent); virtual;
  61. Published
  62. end;
  63. { ---------------------------------------------------------------------
  64. TComponent
  65. ---------------------------------------------------------------------}
  66. TComponentState = Set of ( csLoading, csReading, CsWriting, csDestroying,
  67. csDesigning, csAncestor, csUpdating, csFixups );
  68. TComponentStyle = set of ( csInheritable,csCheckPropAvail );
  69. TComponentName = String;
  70. TComponent = Class (TPersistent)
  71. Protected
  72. FComponentState : TComponentState;
  73. FComponentStyle : TComponentStyle;
  74. FName : TComponentName;
  75. FOwner : TComponent;
  76. Function GetComponent (Index : Longint) : TComponent;
  77. Function GetComponentCount : Longint;
  78. Function GetComponentIndex : Longint;
  79. Procedure SetComponentIndex (Value : Longint);
  80. Procedure Setname (Value : TComponentName);
  81. Private
  82. Public
  83. { Methods }
  84. { Properties }
  85. Property ComponentCount : Longint Read GetComponentCount; { RO }
  86. Property ComponentIndex : Longint Read GetComponentIndex write SetComponentIndex; { R/W }
  87. // Property Components [Index : LongInt] : TComponent Read GetComponent; { R0 }
  88. Property ComponentState : TComponentState Read FComponentState; { RO }
  89. Property ComponentStyle : TcomponentStyle Read FComponentStyle; { RO }
  90. Property Owner : TComponent Read Fowner; { RO }
  91. Published
  92. Property Name : TComponentName Read FName Write Setname;
  93. end;
  94. Implementation
  95. { ---------------------------------------------------------------------
  96. TComponent
  97. ---------------------------------------------------------------------}
  98. Function TComponent.GetComponent (Index : Longint) : TComponent;
  99. begin
  100. end;
  101. Function TComponent.GetComponentCount : Longint;
  102. begin
  103. end;
  104. Function TComponent.GetComponentIndex : Longint;
  105. begin
  106. end;
  107. Procedure TComponent.SetComponentIndex (Value : Longint);
  108. begin
  109. end;
  110. Procedure TComponent.Setname (Value : TComponentName);
  111. begin
  112. end;
  113. { ---------------------------------------------------------------------
  114. TFiler
  115. ---------------------------------------------------------------------}
  116. Constructor TFiler.Create {(Stream : TStream; BufSize : Longint) };
  117. begin
  118. end;
  119. Destructor TFiler.Destroy;
  120. begin
  121. end;
  122. { ---------------------------------------------------------------------
  123. TPersistent
  124. ---------------------------------------------------------------------}
  125. Procedure TPersistent.AssignError (Source : TPersistent);
  126. begin
  127. end;
  128. Procedure TPersistent.AssignTo (Dest : TPersistent);
  129. begin
  130. end;
  131. Procedure TPersistent.DefineProperties (Filer : TFiler);
  132. begin
  133. end;
  134. Destructor TPersistent.Destroy;
  135. begin
  136. end;
  137. Procedure TPersistent.Assign (Source : TPersistent);
  138. begin
  139. end;
  140. end.