home *** CD-ROM | disk | FTP | other *** search
/ CD Actual 9 / CDACTUAL9.iso / progs / CB / DATA.Z / UPDATE.HPP < prev    next >
Encoding:
C/C++ Source or Header  |  1996-11-06  |  5.9 KB  |  154 lines

  1. //----------------------------------------------------------------------------
  2. // Update.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
  3. // From: Update.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef UpdateHPP
  6. #define UpdateHPP
  7. //----------------------------------------------------------------------------
  8. #ifndef TypInfoHPP
  9. #include <TypInfo.hpp>
  10. #endif
  11.  
  12. #ifndef ClassesHPP
  13. #include <Classes.hpp>
  14. #endif
  15.  
  16. #ifndef SysUtilsHPP
  17. #include <SysUtils.hpp>
  18. #endif
  19.  
  20. #ifndef SystemHPP
  21. #include <System.hpp>
  22. #endif
  23.  
  24. namespace Update
  25. {
  26. //-- type declarations -------------------------------------------------------
  27. enum TUpdateFilterState { usFilter, usReading, usWriting };
  28.  
  29. class __declspec(delphiclass) TUpdateFiler;
  30. class __declspec(delphiclass) TUpdateObject;
  31. class __declspec(delphiclass) TUpdateManager;
  32. class __declspec(pascalimplementation) TUpdateObject : public System::TObject
  33. {
  34.     typedef TUpdateObject ThisClass;
  35.     typedef System::TObject inherited;
  36.     
  37. private:
  38.     TUpdateObject *FOwner;
  39.     Classes::TPersistent *FObject;
  40.     Classes::TPersistent *FAncestor;
  41.     Classes::TComponent *FObjectOwner;
  42.     Classes::TComponent *FAncestorOwner;
  43.     Classes::TList *FPropList;
  44.     Classes::TList *FChildList;
  45.     TUpdateFiler *FUpdateFiler;
  46.     System::Boolean FIsComponent;
  47.     System::Boolean FIsCollection;
  48.     System::Boolean FUpdateCollection;
  49.     System::Boolean FUpdateOrder;
  50.     System::Integer FOrder;
  51.     Typinfo::TPropInfo *FPropInfo;
  52.     System::Boolean FCompare;
  53.     __fastcall TUpdateObject(TUpdateObject *AOwner, Classes::TPersistent *AObject, Classes::TPersistent *
  54.         AAncestor, Typinfo::PPropInfo APropInfo, System::Boolean Compare);
  55.     __fastcall virtual ~TUpdateObject(void);
  56.     void __fastcall AddChild(Classes::TComponent *Component);
  57.     System::Boolean __fastcall CanRevert(Classes::TPersistent *Instance, Typinfo::PPropInfo PropInfo, System::Boolean 
  58.         &Continue);
  59.     Sysutils::TMethod __fastcall GetAncestorMethod(Typinfo::PPropInfo PropInfo);
  60.     System::Pointer __fastcall GetAncestorPointer(System::Pointer Value);
  61.     System::Pointer __fastcall GetAncestorReference(Typinfo::PPropInfo PropInfo);
  62.     TUpdateObject *__fastcall FindChild(Classes::TComponent *Component);
  63.     TUpdateObject *__fastcall FindChildProp(Typinfo::PPropInfo APropInfo);
  64.     void __fastcall ComponentDelete(Classes::TComponent *AComponent);
  65.     void __fastcall Filter(void);
  66.     void __fastcall FilterOrder(void);
  67.     System::Boolean __fastcall Revert(Classes::TPersistent *Instance, Typinfo::PPropInfo PropInfo);
  68.     void __fastcall Update(TUpdateManager *UpdateManager);
  69.     void __fastcall ValidateObjects(void);
  70. public:
  71.     /* !! TObject.Create */ __fastcall TUpdateObject(void) : System::TObject() { }
  72.     
  73. };
  74.  
  75. class __declspec(pascalimplementation) TUpdateFiler : public Classes::TFiler
  76. {
  77.     typedef TUpdateFiler ThisClass;
  78.     typedef Classes::TFiler inherited;
  79.     
  80. private:
  81.     Classes::TStringList *FPropertyList;
  82.     TUpdateObject *FUpdateObject;
  83.     Classes::TWriter *FWriter;
  84.     Classes::TReader *FReader;
  85.     System::Boolean FFiltered;
  86.     TUpdateFilterState FState;
  87.     System::AnsiString FPropName;
  88.     System::Boolean FCompare;
  89.     System::Boolean __fastcall Empty(void);
  90.     void __fastcall Filter(void);
  91.     void __fastcall FilterProp(const System::AnsiString Name, System::Boolean HasData);
  92.     void __fastcall Update(void);
  93.     
  94. public:
  95.     __fastcall TUpdateFiler(TUpdateObject *AUpdateObject, System::Boolean ACompare);
  96.     __fastcall virtual ~TUpdateFiler(void);
  97.     virtual void __fastcall DefineProperty(const System::AnsiString Name, Classes::TReaderProc ReadData
  98.         , Classes::TWriterProc WriteData, System::Boolean HasData);
  99.     virtual void __fastcall DefineBinaryProperty(const System::AnsiString Name, Classes::TStreamProc ReadData
  100.         , Classes::TStreamProc WriteData, System::Boolean HasData);
  101.     virtual void __fastcall FlushBuffer(void);
  102. };
  103.  
  104. enum TUpdateMode { umNone, umUpdate, umFilter };
  105.  
  106. class __declspec(pascalimplementation) TUpdateManager : public System::TObject
  107. {
  108.     typedef TUpdateManager ThisClass;
  109.     typedef System::TObject inherited;
  110.     
  111. private:
  112.     TUpdateObject *FComponentUpdate;
  113.     Classes::TList *FChildList;
  114.     Classes::TComponent *FComponent;
  115.     Classes::TComponent *FAncestor;
  116.     TUpdateManager *FParent;
  117.     TUpdateMode FMode;
  118.     Classes::TList *FUpdateList;
  119.     Classes::TNotifyEvent FOnUpdating;
  120.     Classes::TNotifyEvent FOnUpdate;
  121.     void __fastcall Filter(void);
  122.     System::Boolean __fastcall GetHasDescendents(void);
  123.     System::Boolean __fastcall GetIsDescendent(void);
  124.     void __fastcall UpdateChildren(void);
  125.     void __fastcall SetChildAncestor(Classes::TComponent *Child);
  126.     void __fastcall Updating(Classes::TComponent *Component);
  127.     
  128. public:
  129.     __fastcall TUpdateManager(Classes::TComponent *AComponent, Classes::TComponent *AAncestor, TUpdateManager *
  130.         AAncestorManager);
  131.     __fastcall virtual ~TUpdateManager(void);
  132.     System::Boolean __fastcall CanRevert(Classes::TPersistent *Instance, Typinfo::PPropInfo PropInfo);
  133.     void __fastcall Notification(Classes::TComponent *AComponent, Classes::TOperation Operation);
  134.     void __fastcall Modified(void);
  135.     System::Boolean __fastcall NameExists(const System::AnsiString Name);
  136.     void __fastcall Revert(Classes::TPersistent *Instance, Typinfo::PPropInfo PropInfo);
  137.     void __fastcall Update(void);
  138.     __property Classes::TNotifyEvent OnUpdating = {read=FOnUpdating, write=FOnUpdating};
  139.     __property Classes::TNotifyEvent OnUpdate = {read=FOnUpdate, write=FOnUpdate};
  140.     __property Classes::TComponent * Component = {read=FComponent, nodefault};
  141.     __property Classes::TComponent * Ancestor = {read=FAncestor, nodefault};
  142.     __property System::Boolean HasDescendents = {read=GetHasDescendents, nodefault};
  143.     __property System::Boolean IsDescendent = {read=GetIsDescendent, nodefault};
  144. };
  145.  
  146. //-- var, const, procedure ---------------------------------------------------
  147.  
  148. }    /* namespace Update */
  149. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  150. using namespace Update;
  151. #endif
  152. //-- end unit ----------------------------------------------------------------
  153. #endif    // Update
  154.