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

  1. //----------------------------------------------------------------------------
  2. // ObjectComponents
  3. // Copyright (c) 1994, 1996 by Borland International, All Rights Reserved
  4. //
  5. // $Revision:   2.4  $
  6. //
  7. //  Declares an IBClassMgr "factory" which can create Bolero helper objects.
  8. //
  9. //    Since callers of BOleClassManager don't have the class
  10. //    definition, they can't call operator new to create a
  11. //    helper object.
  12. //
  13. //    BOleClassMgr has a pointer to the service, so you need a
  14. //    BOleClassMgr for every Bolero connection you maintain.
  15. //----------------------------------------------------------------------------
  16. #ifndef BOLECMAN_H
  17. #define BOLECMAN_H
  18.  
  19. #ifndef _BOLECOMP_H
  20. #include "BOleComp.h"
  21. #endif
  22.  
  23. #ifndef _BOLESVC_H
  24. #include "BOleSvc.h"
  25. #endif
  26.  
  27. class _ICLASS BOleFontObj;
  28.  
  29. class BOleClassManager : public BOleComponent, public IBClassMgr
  30. {
  31.  
  32. private:
  33.     BOleService *pSvc;
  34.     BOleFontObj *pFont;  // font cache storage
  35.     int nServerCount;
  36.  
  37. public:
  38.  
  39.     // IUnknown methods
  40.     //
  41.     DEFINE_IUNKNOWN(pObjOuter);
  42.     virtual HRESULT _IFUNC QueryInterfaceMain(REFIID iid, LPVOID FAR* pif);
  43.  
  44.     // IClassMgr methods
  45.     //
  46.     virtual HRESULT _IFUNC ComponentCreate(
  47.         PIUnknown FAR* ppRet,
  48.         PIUnknown pAggregator,
  49.         BCID        idClass
  50.         );
  51.     virtual HRESULT _IFUNC ComponentInfoGet(
  52.         PIUnknown FAR* ppInfo,
  53.         PIUnknown pAggregator,
  54.         BCID        idClass
  55.         )
  56.     { *ppInfo = NULLP; return ResultFromScode(E_NOTIMPL); }
  57.  
  58.     int _IFUNC ServerCount (int nDelta = 0);
  59.     BOleService * GetService()    {return pSvc;};
  60.     BOleFontObj * GetFontCache()    {return pFont;};
  61.     void          SetFontCache(BOleFontObj *pFont);
  62.     
  63.     BOleClassManager(IBUnknownMain *pObj);
  64.     ~BOleClassManager();
  65. };
  66.  
  67. #endif
  68.