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

  1. //----------------------------------------------------------------------------
  2. // OleCtnrs.hpp - dcc32 generated hdr (DO NOT EDIT) rev: -2
  3. // From: OleCtnrs.pas
  4. //----------------------------------------------------------------------------
  5. #ifndef OleCtnrsHPP
  6. #define OleCtnrsHPP
  7. //----------------------------------------------------------------------------
  8. #ifndef OleAutoHPP
  9. #include <OleAuto.hpp>
  10. #endif
  11.  
  12. #ifndef GraphicsHPP
  13. #include <Graphics.hpp>
  14. #endif
  15.  
  16. #ifndef MenusHPP
  17. #include <Menus.hpp>
  18. #endif
  19.  
  20. #ifndef FormsHPP
  21. #include <Forms.hpp>
  22. #endif
  23.  
  24. #ifndef ControlsHPP
  25. #include <Controls.hpp>
  26. #endif
  27.  
  28. #ifndef ClassesHPP
  29. #include <Classes.hpp>
  30. #endif
  31.  
  32. #ifndef SysUtilsHPP
  33. #include <SysUtils.hpp>
  34. #endif
  35.  
  36. #ifndef OleDlgHPP
  37. #include <OleDlg.hpp>
  38. #endif
  39.  
  40. #ifndef OLE2HPP
  41. #include <OLE2.hpp>
  42. #endif
  43.  
  44. #ifndef CommCtrlHPP
  45. #include <CommCtrl.hpp>
  46. #endif
  47.  
  48. #ifndef MessagesHPP
  49. #include <Messages.hpp>
  50. #endif
  51.  
  52. #ifndef WindowsHPP
  53. #include <Windows.hpp>
  54. #endif
  55.  
  56. #ifndef SystemHPP
  57. #include <System.hpp>
  58. #endif
  59.  
  60. namespace Olectnrs
  61. {
  62. //-- type declarations -------------------------------------------------------
  63. class __declspec(delphiclass) TOleClientSite;
  64. class __declspec(delphiclass) TOleContainer;
  65. class __declspec(delphiclass) TOleInPlaceSite;
  66. class __declspec(pascalimplementation) TOleInPlaceSite : public Ole2::IOleInPlaceSite
  67. {
  68.     typedef TOleInPlaceSite ThisClass;
  69.     typedef Ole2::IOleInPlaceSite inherited;
  70.     
  71. private:
  72.     TOleContainer *FContainer;
  73.     
  74. public:
  75.     __fastcall TOleInPlaceSite(TOleContainer *Container);
  76.     virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);
  77.     virtual System::Longint __stdcall AddRef(void);
  78.     virtual System::Longint __stdcall Release(void);
  79.     virtual System::Longint __stdcall GetWindow(System::Integer &wnd);
  80.     virtual System::Longint __stdcall ContextSensitiveHelp(System::LongBool fEnterMode);
  81.     virtual System::Longint __stdcall CanInPlaceActivate(void);
  82.     virtual System::Longint __stdcall OnInPlaceActivate(void);
  83.     virtual System::Longint __stdcall OnUIActivate(void);
  84.     virtual System::Longint __stdcall GetWindowContext(Ole2::IOleInPlaceFrame *&frame, Ole2::IOleInPlaceUIWindow *
  85.         &doc, Windows::TRect &rcPosRect, Windows::TRect &rcClipRect, Ole2::TOleInPlaceFrameInfo &frameInfo
  86.         );
  87.     virtual System::Longint __stdcall Scroll(const Windows::TPoint &scrollExtent);
  88.     virtual System::Longint __stdcall OnUIDeactivate(System::LongBool fUndoable);
  89.     virtual System::Longint __stdcall OnInPlaceDeactivate(void);
  90.     virtual System::Longint __stdcall DiscardUndoState(void);
  91.     virtual System::Longint __stdcall DeactivateAndUndo(void);
  92.     virtual System::Longint __stdcall OnPosRectChange(const Windows::TRect &rcPosRect);
  93. public:
  94.     /* !! TObject.Destroy */ __fastcall virtual ~TOleInPlaceSite(void) { }
  95.     
  96. };
  97.  
  98. class __declspec(delphiclass) TAdviseSink;
  99. class __declspec(pascalimplementation) TAdviseSink : public Ole2::IAdviseSink
  100. {
  101.     typedef TAdviseSink ThisClass;
  102.     typedef Ole2::IAdviseSink inherited;
  103.     
  104. private:
  105.     TOleContainer *FContainer;
  106.     
  107. public:
  108.     __fastcall TAdviseSink(TOleContainer *Container);
  109.     virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);
  110.     virtual System::Longint __stdcall AddRef(void);
  111.     virtual System::Longint __stdcall Release(void);
  112.     virtual void __stdcall OnDataChange(Ole2::TFormatEtc &formatetc, Ole2::TStgMedium &stgmed);
  113.     virtual void __stdcall OnViewChange(System::Longint dwAspect, System::Longint lindex);
  114.     virtual void __stdcall OnRename(Ole2::IMoniker *mk);
  115.     virtual void __stdcall OnSave(void);
  116.     virtual void __stdcall OnClose(void);
  117. public:
  118.     /* !! TObject.Destroy */ __fastcall virtual ~TAdviseSink(void) { }
  119.     
  120. };
  121.  
  122. class __declspec(delphiclass) TOleForm;
  123. class __declspec(delphiclass) TOleInPlaceFrame;
  124. class __declspec(pascalimplementation) TOleInPlaceFrame : public Ole2::IOleInPlaceFrame
  125. {
  126.     typedef TOleInPlaceFrame ThisClass;
  127.     typedef Ole2::IOleInPlaceFrame inherited;
  128.     
  129. private:
  130.     TOleForm *FOleForm;
  131.     
  132. public:
  133.     __fastcall TOleInPlaceFrame(TOleForm *OleForm);
  134.     virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);
  135.     virtual System::Longint __stdcall AddRef(void);
  136.     virtual System::Longint __stdcall Release(void);
  137.     virtual System::Longint __stdcall GetWindow(System::Integer &wnd);
  138.     virtual System::Longint __stdcall ContextSensitiveHelp(System::LongBool fEnterMode);
  139.     virtual System::Longint __stdcall GetBorder(Windows::TRect &rectBorder);
  140.     virtual System::Longint __stdcall RequestBorderSpace(const Windows::TRect &borderwidths);
  141.     virtual System::Longint __stdcall SetBorderSpace(Windows::PRect pborderwidths);
  142.     virtual System::Longint __stdcall SetActiveObject(Ole2::IOleInPlaceActiveObject *activeObject, System::PWideChar 
  143.         pszObjName);
  144.     virtual System::Longint __stdcall InsertMenus(System::Integer hmenuShared, Ole2::TOleMenuGroupWidths 
  145.         &menuWidths);
  146.     virtual System::Longint __stdcall SetMenu(System::Integer hmenuShared, System::Integer holemenu, System::Integer 
  147.         hwndActiveObject);
  148.     virtual System::Longint __stdcall RemoveMenus(System::Integer hmenuShared);
  149.     virtual System::Longint __stdcall SetStatusText(System::PWideChar pszStatusText);
  150.     virtual System::Longint __stdcall EnableModeless(System::LongBool fEnable);
  151.     virtual System::Longint __stdcall TranslateAccelerator(Windows::TMsg &msg, System::Word wID);
  152. public:
  153.         
  154.     /* !! TObject.Destroy */ __fastcall virtual ~TOleInPlaceFrame(void) { }
  155.     
  156. };
  157.  
  158. class __declspec(pascalimplementation) TOleForm : public Forms::TOleFormObject
  159. {
  160.     typedef TOleForm ThisClass;
  161.     typedef Forms::TOleFormObject inherited;
  162.     
  163. private:
  164.     System::Integer FRefCount;
  165.     Forms::TForm *FForm;
  166.     TOleInPlaceFrame *FOleInPlaceFrame;
  167.     Classes::TList *FContainers;
  168.     Ole2::IOleInPlaceActiveObject *FActiveObject;
  169.     System::Integer FSaveWidth;
  170.     System::Integer FSaveHeight;
  171.     Classes::TList *FHiddenControls;
  172.     Controls::TControl *FSpacers[4];
  173.     System::Longint __fastcall AddRef(void);
  174.     System::Boolean __fastcall BorderSpaceAvailable(const Windows::TRect &BorderWidths);
  175.     void __fastcall ClearBorderSpace(void);
  176.     void __fastcall GetBorder(Windows::TRect &BorderRect);
  177.     System::Boolean __fastcall IsSpacer(Controls::TControl *Control);
  178.     System::Boolean __fastcall IsToolControl(Controls::TControl *Control);
  179.     System::Longint __fastcall Release(void);
  180.     void __fastcall SetActiveObject(Ole2::IOleInPlaceActiveObject *ActiveObject);
  181.     System::Boolean __fastcall SetBorderSpace(const Windows::TRect &BorderWidths);
  182.     
  183. protected:
  184.     virtual void __fastcall OnDestroy(void);
  185.     virtual void __fastcall OnResize(void);
  186.     
  187. public:
  188.     __fastcall TOleForm(Forms::TForm *Form);
  189.     __fastcall virtual ~TOleForm(void);
  190. };
  191.  
  192. enum TAutoActivate { aaManual, aaGetFocus, aaDoubleClick };
  193.  
  194. enum TSizeMode { smClip, smCenter, smScale, smStretch, smAutoSize };
  195.  
  196. typedef void __fastcall (__closure *TObjectMoveEvent)(TOleContainer *OleContainer, const Windows::TRect 
  197.     &Bounds);
  198.  
  199. enum TObjectState { osEmpty, osLoaded, osRunning, osOpen, osInPlaceActive, osUIActive };
  200.  
  201. struct TCreateInfo;
  202. class __declspec(pascalimplementation) TOleContainer : public Controls::TCustomControl
  203. {
  204.     typedef TOleContainer ThisClass;
  205.     typedef Controls::TCustomControl inherited;
  206.     
  207. private:
  208.     System::Longint FRefCount;
  209.     Ole2::ILockBytes *FLockBytes;
  210.     Ole2::IStorage *FStorage;
  211.     Ole2::IOleObject *FOleObject;
  212.     TOleClientSite *FOleClientSite;
  213.     TOleInPlaceSite *FOleInPlaceSite;
  214.     TAdviseSink *FAdviseSink;
  215.     System::Longint FDrawAspect;
  216.     Windows::TPoint FViewSize;
  217.     Classes::TStringList *FObjectVerbs;
  218.     System::Longint FDataConnection;
  219.     TOleForm *FDocForm;
  220.     TOleForm *FFrameForm;
  221.     Ole2::IOleInPlaceObject *FOleInPlaceObject;
  222.     Ole2::IOleInPlaceActiveObject *FOleInPlaceActiveObject;
  223.     System::Integer FAccelTable;
  224.     System::Integer FAccelCount;
  225.     Menus::TPopupMenu *FPopupVerbMenu;
  226.     System::Boolean FAllowInPlace;
  227.     TAutoActivate FAutoActivate;
  228.     System::Boolean FAutoVerbMenu;
  229.     TFormBorderStyle FBorderStyle;
  230.     System::Boolean FCopyOnSave;
  231.     System::Boolean FOldStreamFormat;
  232.     TSizeMode FSizeMode;
  233.     System::Boolean FObjectOpen;
  234.     System::Boolean FUIActive;
  235.     System::Boolean FModified;
  236.     System::Boolean FModSinceSave;
  237.     System::Boolean FFocused;
  238.     System::Boolean FNewInserted;
  239.     Classes::TNotifyEvent FOnActivate;
  240.     Classes::TNotifyEvent FOnDeactivate;
  241.     TObjectMoveEvent FOnObjectMove;
  242.     Classes::TNotifyEvent FOnResize;
  243.     System::Longint __fastcall AddRef(void);
  244.     void __fastcall AdjustBounds(void);
  245.     void __fastcall CheckObject(void);
  246.     void __fastcall CreateAccelTable(void);
  247.     void __fastcall CreateStorage(void);
  248.     void __fastcall DesignModified(void);
  249.     void __fastcall DestroyAccelTable(void);
  250.     void __fastcall DestroyVerbs(void);
  251.     System::Integer __fastcall GetBorderWidth(void);
  252.     System::Boolean __fastcall GetCanPaste(void);
  253.     System::Boolean __fastcall GetIconic(void);
  254.     System::Boolean __fastcall GetLinked(void);
  255.     System::Integer __fastcall GetObjectDataSize(void);
  256.     Classes::TStrings *__fastcall GetObjectVerbs(void);
  257.     System::AnsiString __fastcall GetOleClassName(void);
  258.     System::Variant __fastcall GetOleObject(void);
  259.     System::Integer __fastcall GetPrimaryVerb(void);
  260.     System::AnsiString __fastcall GetSourceDoc(void);
  261.     TObjectState __fastcall GetState(void);
  262.     void __fastcall InitObject(void);
  263.     void __fastcall ObjectModified(void);
  264.     void __fastcall ObjectMoved(const Windows::TRect &ObjectRect);
  265.     void __fastcall ObjectShowWindow(System::Boolean Show);
  266.     void __fastcall ObjectViewChange(System::Longint Aspect);
  267.     void __fastcall PopupVerbMenuClick(System::TObject *Sender);
  268.     System::Longint __fastcall QueryInterface(const Ole2::TGUID &iid, void *obj);
  269.     System::Longint __fastcall Release(void);
  270.     void __fastcall SaveObject(void);
  271.     void __fastcall SetBorderStyle(Forms::TBorderStyle Value);
  272.     void __fastcall SetDrawAspect(System::Boolean Iconic, System::Integer IconMetaPict);
  273.     void __fastcall SetFocused(System::Boolean Value);
  274.     void __fastcall SetIconic(System::Boolean Value);
  275.     void __fastcall SetSizeMode(TSizeMode Value);
  276.     void __fastcall SetUIActive(System::Boolean Active);
  277.     void __fastcall SetViewAdviseSink(System::Boolean Enable);
  278.     void __fastcall UpdateObjectRect(void);
  279.     void __fastcall UpdateView(void);
  280.     MESSAGE void __fastcall CMCtl3DChanged(Messages::TMessage &Message);
  281.     MESSAGE void __fastcall CMDocWindowActivate(Messages::TMessage &Message);
  282.     MESSAGE void __fastcall CMUIDeactivate(Messages::TMessage &Message);
  283.     MESSAGE void __fastcall WMKillFocus(Messages::TWMSetFocus &Message);
  284.     MESSAGE void __fastcall WMSetFocus(Messages::TWMSetFocus &Message);
  285.     MESSAGE void __fastcall WMSize(Messages::TWMSize &Message);
  286.     MESSAGE void __fastcall WMWindowPosChanged(Messages::TWMWindowPosMsg &Message);
  287.     
  288. protected:
  289.     virtual void __fastcall CreateParams(Controls::TCreateParams &Params);
  290.     virtual void __fastcall DblClick(void);
  291.     virtual void __fastcall DefineProperties(Classes::TFiler *Filer);
  292.     virtual void __fastcall DoEnter(void);
  293.     virtual Menus::TPopupMenu *__fastcall GetPopupMenu(void);
  294.     virtual void __fastcall KeyDown(System::Word &Key,  Classes::TShiftState Shift);
  295.     virtual void __fastcall MouseDown(Controls::TMouseButton Button,  Classes::TShiftState Shift, System::Integer 
  296.         X, System::Integer Y);
  297.     virtual void __fastcall Paint(void);
  298.     
  299. public:
  300.     __fastcall virtual TOleContainer(Classes::TComponent *AOwner);
  301.     __fastcall virtual ~TOleContainer(void);
  302.     System::Boolean __fastcall ChangeIconDialog(void);
  303.     void __fastcall Close(void);
  304.     void __fastcall Copy(void);
  305.     void __fastcall CreateLinkToFile(const System::AnsiString FileName, System::Boolean Iconic);
  306.     void __fastcall CreateObject(const System::AnsiString OleClassName, System::Boolean Iconic);
  307.     void __fastcall CreateObjectFromFile(const System::AnsiString FileName, System::Boolean Iconic);
  308.     void __fastcall CreateObjectFromInfo(const TCreateInfo &CreateInfo);
  309.     void __fastcall DestroyObject(void);
  310.     void __fastcall DoVerb(System::Integer Verb);
  311.     System::Integer __fastcall GetIconMetaPict(void);
  312.     System::Boolean __fastcall InsertObjectDialog(void);
  313.     void __fastcall LoadFromFile(const System::AnsiString FileName);
  314.     void __fastcall LoadFromStream(Classes::TStream *Stream);
  315.     System::Boolean __fastcall ObjectPropertiesDialog(void);
  316.     void __fastcall Paste(void);
  317.     System::Boolean __fastcall PasteSpecialDialog(void);
  318.     void __fastcall Run(void);
  319.     void __fastcall SaveToFile(const System::AnsiString FileName);
  320.     void __fastcall SaveToStream(Classes::TStream *Stream);
  321.     void __fastcall UpdateObject(void);
  322.     void __fastcall UpdateVerbs(void);
  323.     __property System::Boolean CanPaste = {read=GetCanPaste, nodefault};
  324.     __property System::Boolean Linked = {read=GetLinked, nodefault};
  325.     __property System::Boolean Modified = {read=FModified, write=FModified, nodefault};
  326.     __property System::Boolean NewInserted = {read=FNewInserted, nodefault};
  327.     __property Classes::TStrings * ObjectVerbs = {read=GetObjectVerbs, nodefault};
  328.     __property System::AnsiString OleClassName = {read=GetOleClassName, nodefault};
  329.     __property System::Variant OleObject = {read=GetOleObject};
  330.     __property Ole2::IOleObject * OleObjectInterface = {read=FOleObject, nodefault};
  331.     __property System::Integer PrimaryVerb = {read=GetPrimaryVerb, nodefault};
  332.     __property System::AnsiString SourceDoc = {read=GetSourceDoc, nodefault};
  333.     __property TObjectState State = {read=GetState, nodefault};
  334.     __property Ole2::IStorage * StorageInterface = {read=FStorage, nodefault};
  335.     
  336. __published:
  337.     __property System::Boolean AllowInPlace = {read=FAllowInPlace, write=FAllowInPlace, default=1};
  338.     __property TAutoActivate AutoActivate = {read=FAutoActivate, write=FAutoActivate, default=2};
  339.     __property System::Boolean AutoVerbMenu = {read=FAutoVerbMenu, write=FAutoVerbMenu, default=1};
  340.     __property Align ;
  341.     __property Forms::TBorderStyle BorderStyle = {read=FBorderStyle, write=SetBorderStyle, default=1};
  342.     __property Caption ;
  343.     __property Color ;
  344.     __property System::Boolean CopyOnSave = {read=FCopyOnSave, write=FCopyOnSave, default=1};
  345.     __property Ctl3D ;
  346.     __property DragCursor ;
  347.     __property DragMode ;
  348.     __property Enabled ;
  349.     __property System::Boolean Iconic = {read=GetIconic, write=SetIconic, stored=false, nodefault};
  350.     __property System::Boolean OldStreamFormat = {read=FOldStreamFormat, write=FOldStreamFormat, default=0
  351.         };
  352.     __property ParentColor ;
  353.     __property ParentCtl3D ;
  354.     __property ParentShowHint ;
  355.     __property PopupMenu ;
  356.     __property ShowHint ;
  357.     __property TSizeMode SizeMode = {read=FSizeMode, write=SetSizeMode, default=0};
  358.     __property TabOrder ;
  359.     __property TabStop ;
  360.     __property Visible ;
  361.     __property Classes::TNotifyEvent OnActivate = {read=FOnActivate, write=FOnActivate};
  362.     __property Classes::TNotifyEvent OnDeactivate = {read=FOnDeactivate, write=FOnDeactivate};
  363.     __property OnDragDrop ;
  364.     __property OnDragOver ;
  365.     __property OnEndDrag ;
  366.     __property OnEnter ;
  367.     __property OnExit ;
  368.     __property OnMouseDown ;
  369.     __property OnMouseMove ;
  370.     __property OnMouseUp ;
  371.     __property OnKeyDown ;
  372.     __property OnKeyPress ;
  373.     __property OnKeyUp ;
  374.     __property TObjectMoveEvent OnObjectMove = {read=FOnObjectMove, write=FOnObjectMove};
  375.     __property Classes::TNotifyEvent OnResize = {read=FOnResize, write=FOnResize};
  376.     __property OnStartDrag ;
  377. };
  378.  
  379. class __declspec(pascalimplementation) TOleClientSite : public Ole2::IOleClientSite
  380. {
  381.     typedef TOleClientSite ThisClass;
  382.     typedef Ole2::IOleClientSite inherited;
  383.     
  384. private:
  385.     TOleContainer *FContainer;
  386.     
  387. public:
  388.     __fastcall TOleClientSite(TOleContainer *Container);
  389.     virtual System::Longint __stdcall QueryInterface(const Ole2::TGUID &iid, void *obj);
  390.     virtual System::Longint __stdcall AddRef(void);
  391.     virtual System::Longint __stdcall Release(void);
  392.     virtual System::Longint __stdcall SaveObject(void);
  393.     virtual System::Longint __stdcall GetMoniker(System::Longint dwAssign, System::Longint dwWhichMoniker
  394.         , Ole2::IMoniker *&mk);
  395.     virtual System::Longint __stdcall GetContainer(Ole2::IOleContainer *&container);
  396.     virtual System::Longint __stdcall ShowObject(void);
  397.     virtual System::Longint __stdcall OnShowWindow(System::LongBool fShow);
  398.     virtual System::Longint __stdcall RequestNewObjectLayout(void);
  399. public:
  400.     /* !! TObject.Destroy */ __fastcall virtual ~TOleClientSite(void) { }
  401.     
  402. };
  403.  
  404. enum TCreateType { ctNewObject, ctFromFile, ctLinkToFile, ctFromData, ctLinkFromData };
  405.  
  406. struct TCreateInfo
  407. {
  408.     TCreateType CreateType;
  409.     System::Boolean ShowAsIcon;
  410.     System::Integer IconMetaPict;
  411.     Ole2::TGUID ClassID;
  412.     System::AnsiString FileName;
  413.     Ole2::IDataObject *DataObject;
  414. } ;
  415.  
  416. struct TVerbInfo
  417. {
  418.     System::Smallint Verb;
  419.     System::Word Flags;
  420. } ;
  421.  
  422. //-- var, const, procedure ---------------------------------------------------
  423. #define ovShow System::Shortint(-1)
  424. #define ovOpen System::Shortint(-2)
  425. #define ovHide System::Shortint(-3)
  426. #define ovUIActivate System::Shortint(-4)
  427. #define ovInPlaceActivate System::Shortint(-5)
  428. #define ovDiscardUndoState System::Shortint(-6)
  429. #define ovPrimary System::Integer(-65536)
  430. extern void __fastcall DestroyMetaPict(System::Integer MetaPict);
  431.  
  432. }    /* namespace Olectnrs */
  433. #if !defined(NO_IMPLICIT_NAMESPACE_USE)
  434. using namespace Olectnrs;
  435. #endif
  436. //-- end unit ----------------------------------------------------------------
  437. #endif    // OleCtnrs
  438.