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.

117 lines
5.1 KiB

  1. //**********************************************************************
  2. // File name: SITE.H
  3. //
  4. // Definition of COleSite
  5. //
  6. // Copyright (c) 1992 - 1996 Microsoft Corporation. All rights reserved.
  7. //**********************************************************************
  8. #if !defined( _SITE_H_ )
  9. #define _SITE_H_
  10. #include <mshtmhst.h>
  11. class COleSite : public IDocHostUIHandler, public DWebBrowserEvents
  12. {
  13. private:
  14. ULONG m_cRef; //Reference count
  15. public:
  16. LPSTORAGE m_lpStorage;
  17. LPOLEOBJECT m_lpOleObject;
  18. LPOLEINPLACEOBJECT m_lpInPlaceObject;
  19. HWND m_hwndIPObj;
  20. IWebBrowser2 *m_lpWebBrowser;
  21. DWORD m_dwDrawAspect;
  22. FORMATETC m_fe;
  23. BOOL m_fInPlaceActive;
  24. COleClientSite m_OleClientSite;
  25. COleInPlaceSite m_OleInPlaceSite;
  26. COleInPlaceFrame m_OleInPlaceFrame;
  27. HWND m_hWnd;
  28. DWORD m_dwHtmPageType;
  29. BOOL m_bUseBkGndBitmap;
  30. HBITMAP m_hbmBkGrnd;
  31. RECT m_rcBkGrnd;
  32. TCHAR m_szForeGrndColor[MAX_COLOR_NAME];
  33. TCHAR m_szBkGrndColor[MAX_COLOR_NAME];
  34. DWORD m_dwcpCookie;
  35. TCHAR m_szBkGndBitmapFile[MAX_PATH];
  36. // IUnknown Interfaces
  37. STDMETHODIMP QueryInterface(REFIID riid, LPVOID FAR* ppvObj);
  38. STDMETHODIMP_(ULONG) AddRef();
  39. STDMETHODIMP_(ULONG) Release();
  40. // IDocHostUIHandler
  41. HRESULT STDMETHODCALLTYPE ShowContextMenu(
  42. DWORD dwID, POINT *ppt, IUnknown *pcmdtReserved, IDispatch *pdispReserved);
  43. HRESULT STDMETHODCALLTYPE GetHostInfo(DOCHOSTUIINFO *pInfo);
  44. HRESULT STDMETHODCALLTYPE ShowUI(
  45. DWORD dwID, IOleInPlaceActiveObject *pActiveObject,
  46. IOleCommandTarget *pCommandTarget, IOleInPlaceFrame *pFrame,
  47. IOleInPlaceUIWindow *pDoc);
  48. HRESULT STDMETHODCALLTYPE HideUI(void);
  49. HRESULT STDMETHODCALLTYPE UpdateUI(void);
  50. HRESULT STDMETHODCALLTYPE EnableModeless(BOOL fEnable);
  51. HRESULT STDMETHODCALLTYPE OnDocWindowActivate(BOOL fActivate);
  52. HRESULT STDMETHODCALLTYPE OnFrameWindowActivate(BOOL fActivate);
  53. HRESULT STDMETHODCALLTYPE ResizeBorder(
  54. LPCRECT prcBorder, IOleInPlaceUIWindow *pUIWindow, BOOL fRameWindow);
  55. HRESULT STDMETHODCALLTYPE TranslateAccelerator(
  56. LPMSG lpMsg, const GUID *pguidCmdGroup, DWORD nCmdID);
  57. HRESULT STDMETHODCALLTYPE GetOptionKeyPath(BSTR *pbstrKey, DWORD dw);
  58. HRESULT STDMETHODCALLTYPE GetDropTarget(
  59. IDropTarget *pDropTarget, IDropTarget **ppDropTarget);
  60. HRESULT STDMETHODCALLTYPE GetExternal(IDispatch **ppDisp);
  61. HRESULT STDMETHODCALLTYPE TranslateUrl(DWORD dwTranslate, OLECHAR *pchURLIn, OLECHAR **ppchURLOut);
  62. HRESULT STDMETHODCALLTYPE FilterDataObject(IDataObject *pDO, IDataObject **ppDORet);
  63. // DWebBrowserEvents
  64. STDMETHOD(GetTypeInfoCount)(UINT FAR* pcInfo) { return E_NOTIMPL; }
  65. STDMETHOD(GetTypeInfo)( UINT, LCID, ITypeInfo** ) { return E_NOTIMPL; }
  66. STDMETHOD(GetIDsOfNames)( REFIID, OLECHAR**, UINT, LCID, DISPID* );
  67. STDMETHOD(Invoke)( DISPID dispidMember,
  68. REFIID riid,
  69. LCID lcid,
  70. WORD wFlags,
  71. DISPPARAMS FAR* pdispparams,
  72. VARIANT FAR* pvarResult,
  73. EXCEPINFO FAR* pexcepinfo,
  74. UINT FAR* puArgErr);
  75. HRESULT TweakHTML ( TCHAR* pszFontFace,
  76. TCHAR* pszFontSize,
  77. TCHAR* pszBgColor,
  78. TCHAR* pszForeColor);
  79. HRESULT ActivateOLSText(void );
  80. HRESULT SetHTMLBackground(IHTMLDocument2 *pDoc, HBITMAP hbm, LPRECT lpRC);
  81. void CreateBrowserObject(void);
  82. void DestroyBrowserObject(void);
  83. void InitBrowserObject(void);
  84. void ConnectBrowserObjectToWindow(HWND hWnd,
  85. DWORD dwHtmPageType,
  86. BOOL bUseBkGndBitmap,
  87. HBITMAP hbmBkGrnd,
  88. LPRECT lprcBkGrnd,
  89. LPTSTR lpszclrBkGrnd,
  90. LPTSTR lpszclrForeGrnd);
  91. void DisableHyperlinksInDocument();
  92. void ShowHTML();
  93. void InPlaceActivate();
  94. void UIActivate();
  95. BOOL TrySettingFocusOnHtmlElement (IUnknown* pUnk);
  96. BOOL SetFocusToFirstHtmlInputElement (void);
  97. BOOL SetFocusToHtmlPage (void);
  98. COleSite();
  99. ~COleSite();
  100. void GetObjRect(LPRECT lpRect);
  101. void CloseOleObject(void);
  102. void UnloadOleObject(void);
  103. };
  104. #endif