Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

137 lines
5.2 KiB

  1. /*
  2. * d o c h o s t . h
  3. *
  4. * Purpose:
  5. * basic implementation of a docobject host. Used by the body class to
  6. * host Trident and/or MSHTML
  7. *
  8. * History
  9. * August '96: brettm - created
  10. *
  11. * Copyright (C) Microsoft Corp. 1995, 1996.
  12. */
  13. #ifndef _DOCHOST_H
  14. #define _DOCHOST_H
  15. class CDocHost:
  16. public IOleInPlaceFrame,
  17. public IOleInPlaceSite,
  18. public IOleClientSite,
  19. public IOleControlSite,
  20. public IOleDocumentSite,
  21. public IOleCommandTarget,
  22. public IServiceProvider
  23. {
  24. public:
  25. // *** IUnknown methods ***
  26. virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID, LPVOID FAR *);
  27. virtual ULONG STDMETHODCALLTYPE AddRef();
  28. virtual ULONG STDMETHODCALLTYPE Release();
  29. // *** IOleWindow methods ***
  30. virtual HRESULT STDMETHODCALLTYPE GetWindow(HWND *);
  31. virtual HRESULT STDMETHODCALLTYPE ContextSensitiveHelp(BOOL);
  32. // *** IOleInPlaceUIWindow methods ***
  33. virtual HRESULT STDMETHODCALLTYPE GetBorder(LPRECT);
  34. virtual HRESULT STDMETHODCALLTYPE RequestBorderSpace(LPCBORDERWIDTHS);
  35. virtual HRESULT STDMETHODCALLTYPE SetBorderSpace(LPCBORDERWIDTHS);
  36. virtual HRESULT STDMETHODCALLTYPE SetActiveObject(IOleInPlaceActiveObject *, LPCOLESTR);
  37. // *** IOleInPlaceFrame methods ***
  38. virtual HRESULT STDMETHODCALLTYPE InsertMenus(HMENU, LPOLEMENUGROUPWIDTHS);
  39. virtual HRESULT STDMETHODCALLTYPE SetMenu(HMENU, HOLEMENU, HWND);
  40. virtual HRESULT STDMETHODCALLTYPE RemoveMenus(HMENU);
  41. virtual HRESULT STDMETHODCALLTYPE SetStatusText(LPCOLESTR);
  42. virtual HRESULT STDMETHODCALLTYPE EnableModeless(BOOL);
  43. virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator(LPMSG, WORD);
  44. // IOleInPlaceSite methods.
  45. virtual HRESULT STDMETHODCALLTYPE CanInPlaceActivate();
  46. virtual HRESULT STDMETHODCALLTYPE OnInPlaceActivate();
  47. virtual HRESULT STDMETHODCALLTYPE OnUIActivate();
  48. virtual HRESULT STDMETHODCALLTYPE GetWindowContext(LPOLEINPLACEFRAME *, LPOLEINPLACEUIWINDOW *, LPRECT, LPRECT, LPOLEINPLACEFRAMEINFO);
  49. virtual HRESULT STDMETHODCALLTYPE Scroll(SIZE);
  50. virtual HRESULT STDMETHODCALLTYPE OnUIDeactivate(BOOL);
  51. virtual HRESULT STDMETHODCALLTYPE OnInPlaceDeactivate();
  52. virtual HRESULT STDMETHODCALLTYPE DiscardUndoState();
  53. virtual HRESULT STDMETHODCALLTYPE DeactivateAndUndo();
  54. virtual HRESULT STDMETHODCALLTYPE OnPosRectChange(LPCRECT);
  55. // IOleClientSite methods.
  56. virtual HRESULT STDMETHODCALLTYPE SaveObject();
  57. virtual HRESULT STDMETHODCALLTYPE GetMoniker(DWORD, DWORD, LPMONIKER *);
  58. virtual HRESULT STDMETHODCALLTYPE GetContainer(LPOLECONTAINER *);
  59. virtual HRESULT STDMETHODCALLTYPE ShowObject();
  60. virtual HRESULT STDMETHODCALLTYPE OnShowWindow(BOOL);
  61. virtual HRESULT STDMETHODCALLTYPE RequestNewObjectLayout();
  62. // IOleControlSite
  63. virtual HRESULT STDMETHODCALLTYPE OnControlInfoChanged();
  64. virtual HRESULT STDMETHODCALLTYPE LockInPlaceActive(BOOL fLock);
  65. virtual HRESULT STDMETHODCALLTYPE GetExtendedControl(LPDISPATCH *ppDisp);
  66. virtual HRESULT STDMETHODCALLTYPE TransformCoords(POINTL *pPtlHimetric, POINTF *pPtfContainer,DWORD dwFlags);
  67. virtual HRESULT STDMETHODCALLTYPE TranslateAccelerator(MSG *lpMsg,DWORD grfModifiers);
  68. virtual HRESULT STDMETHODCALLTYPE OnFocus(BOOL fGotFocus);
  69. virtual HRESULT STDMETHODCALLTYPE ShowPropertyFrame(void);
  70. // IOleDocumentSite
  71. virtual HRESULT STDMETHODCALLTYPE ActivateMe(LPOLEDOCUMENTVIEW);
  72. // IOleCommandTarget
  73. virtual HRESULT STDMETHODCALLTYPE QueryStatus(const GUID *, ULONG, OLECMD prgCmds[], OLECMDTEXT *);
  74. virtual HRESULT STDMETHODCALLTYPE Exec(const GUID *, DWORD, DWORD, VARIANTARG *, VARIANTARG *);
  75. // IServiceProvider
  76. virtual HRESULT STDMETHODCALLTYPE QueryService(REFGUID guidService, REFIID riid, LPVOID *ppvObject);
  77. CDocHost();
  78. virtual ~CDocHost();
  79. // statics
  80. static LRESULT CALLBACK ExtWndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  81. virtual LRESULT WndProc(HWND hwnd, UINT msg, WPARAM wParam, LPARAM lParam);
  82. virtual HRESULT GetDocObjSize(LPRECT prc)
  83. {return E_NOTIMPL;};
  84. HRESULT CreateDocObj(LPCLSID pCLSID);
  85. HRESULT CloseDocObj();
  86. HRESULT Init(HWND hwndParent, BOOL fBorder, LPRECT prc);
  87. LPOLEOBJECT m_lpOleObj;
  88. LPOLECOMMANDTARGET m_pCmdTarget;
  89. protected:
  90. HWND m_hwnd,
  91. m_hwndDocObj;
  92. LPOLEDOCUMENTVIEW m_pDocView;
  93. BOOL m_fDownloading,
  94. m_fFocus,
  95. m_fUIActive,
  96. m_fCycleFocus;
  97. LPOLEINPLACEACTIVEOBJECT m_pInPlaceActiveObj;
  98. virtual HRESULT Show();
  99. virtual HRESULT OnUpdateCommands();
  100. virtual void WMSize(int x, int y);
  101. private:
  102. ULONG m_cRef;
  103. DWORD m_dwFrameWidth,
  104. m_dwFrameHeight;
  105. HRESULT CreateDocView();
  106. HRESULT OnCreate(HWND hwnd);
  107. HRESULT OnNCDestroy();
  108. HRESULT OnDestroy();
  109. };
  110. typedef CDocHost DOCHOST;
  111. typedef DOCHOST *LPDOCHOST;
  112. #endif //_DOCHOST_H