home *** CD-ROM | disk | FTP | other *** search
/ QBasic & Borland Pascal & C / Delphi5.iso / C / BC_502 / BOCOLE.PAK / BOLECONT.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-05-06  |  2.6 KB  |  87 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectComponents
  3. // Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
  4. //
  5. // $Revision:   2.2  $
  6. //
  7. //  Implements the server helper for documents by masquerading as the 
  8. //  container object. Provides plumbing for server linking to documents 
  9. //  and items
  10. //----------------------------------------------------------------------------
  11. #ifndef _BOLECONT_H
  12. #define _BOLECONT_H 1
  13.  
  14. #include "BOleComp.h"
  15.  
  16. class _ICLASS BOleFact;
  17.  
  18. class _ICLASS BOleContainer :
  19.     public BOleComponent,
  20.     public IPersistFile,
  21.     public IOleItemContainer,
  22. #if 0
  23.     public IExternalConnection,
  24. #endif
  25.     public IBRootLinkable
  26. {
  27. protected:
  28.     DWORD regId;          // magic cookie for linkable document
  29.     LPMONIKER pMoniker;   // file moniker
  30.     PIBContains pDoc;     // back pointer
  31.     IBClass *pClassFact;  // pointer to class object
  32.  
  33. public:
  34.     BOleContainer (BOleClassManager *, IBUnknownMain *);
  35.     ~BOleContainer ();
  36.  
  37.     // IUnknown Methods
  38.     //
  39.     DEFINE_IUNKNOWN(pObjOuter)
  40.  
  41.     // IUnknownMain methods
  42.     //
  43.     virtual HRESULT _IFUNC QueryInterfaceMain(REFIID iid, LPVOID FAR* pif);
  44.  
  45.     // IPersistFile methods
  46.     //
  47.     HRESULT _IFUNC GetClassID(LPCLSID lpClassID);
  48.     HRESULT _IFUNC IsDirty();
  49.     HRESULT _IFUNC Load(LPCOLESTR lpszFileName, DWORD grfMode);
  50.     HRESULT _IFUNC Save(LPCOLESTR lpszFileName, BOOL fRemember);
  51.     HRESULT _IFUNC SaveCompleted(LPCOLESTR lpszFileName);
  52.     HRESULT _IFUNC GetCurFile(LPOLESTR FAR* lplpszFileName);
  53.  
  54.     // IOleItemContainer methods
  55.     //
  56.     HRESULT _IFUNC ParseDisplayName(IBindCtx* pbc, LPOLESTR lpszDisplayName,
  57.         ULONG FAR* pchEaten, IMoniker* FAR* ppmkOut);
  58.     HRESULT _IFUNC EnumObjects(DWORD grfFlags,IEnumUnknown* FAR* ppenumUnknown);
  59.     HRESULT _IFUNC LockContainer(BOOL fLock);   
  60.     HRESULT _IFUNC GetObject(LPOLESTR lpszItem, DWORD dwSpeedNeeded, IBindCtx* pbc,
  61.                              REFIID riid, LPVOID FAR* ppvObject);
  62.     HRESULT _IFUNC GetObjectStorage(LPOLESTR lpszItem, IBindCtx* pbc, REFIID riid,
  63.                                     LPVOID FAR* ppvStorage);
  64.     HRESULT _IFUNC IsRunning(LPOLESTR lpszItem);
  65.  
  66.     // IBLinkable
  67.  
  68.     // pass in class name (if reg'd in .reg)
  69.     //
  70.     virtual HRESULT _IFUNC Init(PIBContains, LPCOLESTR pszProgId);
  71.     virtual HRESULT _IFUNC SetMoniker(LPMONIKER pMon); 
  72.  
  73.     // pass NULL to OnRename when Doc closes 
  74.     //
  75.     virtual HRESULT _IFUNC OnRename(PIBLinkable, LPCOLESTR) ;
  76.  
  77.     virtual HRESULT _IFUNC GetMoniker(LPMONIKER *ppMon);
  78.  
  79. #if 0
  80.     virtual DWORD _IFUNC AddConnection(DWORD, DWORD);
  81.     virtual DWORD _IFUNC ReleaseConnection(DWORD, DWORD, BOOL);
  82. #endif
  83. };
  84.  
  85. #endif _BOLECONT_H
  86.  
  87.