ts010002.pp 4.9 KB

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