home *** CD-ROM | disk | FTP | other *** search
/ PC World Komputer 1998 May / Pcwk5b98.iso / Borland / Cplus45 / BC45 / OWLINC.PAK / OLEFRAME.H < prev    next >
C/C++ Source or Header  |  1995-08-29  |  3KB  |  89 lines

  1. //----------------------------------------------------------------------------
  2. // ObjectWindows
  3. // (C) Copyright 1994 by Borland International, All Rights Reserved
  4. //
  5. //----------------------------------------------------------------------------
  6. #if !defined(OWL_OLEFRAME_H)
  7. #define OWL_OLEFRAME_H
  8.  
  9. #if !defined(OWL_DECFRAME_H)
  10. # include <owl/decframe.h>
  11. #endif
  12. #if !defined(OWL_OCFEVENT_H)
  13. # include <owl/ocfevent.h>
  14. #endif
  15. #if !defined(OCF_OCREG)
  16. # include <ocf/ocreg.h>
  17. #endif
  18. #if !defined(OWL_OLEFACTO_H)
  19. # include <owl/olefacto.h>
  20. #endif
  21.  
  22. // pad decorations IDs, 4 total: 32042, 32043, 32044, 32045
  23. //
  24. const int IDW_PADDECORATION = 32042;
  25. const int IDW_REMVIEWBUCKET = 32046;  // Window id for remote view holder
  26. const int IDT_DLLIDLE       = 32000;  // Idle timer ID for DLL servers
  27.  
  28. class TOcMenuDescr;
  29. class _ICLASS TOcApp;
  30.  
  31. //
  32. // class TOleFrame
  33. // ----- ---------
  34. //
  35. // Decorated frame that supports OLE 2 using OCF
  36. //
  37. class _USERCLASS TOleFrame : public TDecoratedFrame {
  38.   public:
  39.     TOleFrame(const char far* title,
  40.               TWindow*        clientWnd,
  41.               bool            trackMenuSelection = false,
  42.               TModule*        module = 0);
  43.    ~TOleFrame();
  44.     TOcApp*    GetOcApp() {return OcApp;}
  45.     void       SetOcApp(TOcApp* app);
  46.     void       AddUserFormatName(const char far* name, const char far* resultName, const char far* id);
  47.  
  48.     TWindow*   GetRemViewBucket() {return ChildWithId(IDW_REMVIEWBUCKET);}
  49.     void       OleViewClosing(bool close);
  50.  
  51.   protected:
  52.     void       SetupWindow();
  53.     void       CleanupWindow();
  54.     void       Destroy(int retVal);
  55.  
  56.     void       EvSize(uint sizeType, TSize& size);
  57.     void       EvActivateApp(bool active, HTASK hTask);
  58.     void       EvTimer(uint timerId);
  59.  
  60.     LRESULT    EvOcEvent(WPARAM wParam, LPARAM lParam);
  61.     bool       EvOcAppInsMenus(TOcMenuDescr far& sharedMenu);
  62.     bool       EvOcAppMenus(TOcMenuDescr far& md);
  63.     bool       EvOcAppProcessMsg(MSG far* msg);
  64.     bool       EvOcAppFrameRect(TRect far* rect);
  65.     bool       EvOcAppBorderSpaceReq(TRect far* rect);
  66.     bool       EvOcAppBorderSpaceSet(TRect far* rect);
  67.     void       EvOcAppStatusText(const char far* rect);
  68.     void       EvOcAppRestoreUI();
  69.     void       EvOcAppDialogHelp(TOcDialogHelp far& dh) {}
  70.     bool       EvOcAppShutdown();
  71.  
  72.   protected:
  73.     TOcApp*    OcApp;
  74.     TMenu      StashedContainerPopups;
  75.     int        StashCount;
  76.     void       StashContainerPopups(const TMenuDescr& shMenuDescr);
  77.     void       DestroyStashedPopups();
  78.     HMENU      HOldMenu;
  79.  
  80.   private:
  81.     enum {
  82.       DontCare, UserInitiated, ViewInitiated, ServerInitiated
  83.     } OcShutDown;
  84.  
  85.   DECLARE_RESPONSE_TABLE(TOleFrame);
  86. };
  87.  
  88. #endif  // OWL_OLEFRAME_H
  89.