Source code of Windows XP (NT5)
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.

219 lines
6.2 KiB

  1. // This is a part of the Microsoft Foundation Classes C++ library.
  2. // Copyright (C) 1992-1998 Microsoft Corporation
  3. // All rights reserved.
  4. //
  5. // This source code is only intended as a supplement to the
  6. // Microsoft Foundation Classes Reference and related
  7. // electronic documentation provided with the library.
  8. // See these sources for detailed information regarding the
  9. // Microsoft Foundation Classes product.
  10. #ifndef __AFXHTML_H__
  11. #define __AFXHTML_H__
  12. #ifndef __AFXDISP_H__
  13. #include <afxdisp.h>
  14. #endif
  15. #ifndef __exdisp_h__
  16. #include <exdisp.h>
  17. #endif
  18. #ifdef _AFX_MINREBUILD
  19. #pragma component(minrebuild, off)
  20. #endif
  21. #ifndef _AFX_FULLTYPEINFO
  22. #pragma component(mintypeinfo, on)
  23. #endif
  24. #ifdef _AFX_PACKING
  25. #pragma pack(push, _AFX_PACKING)
  26. #endif
  27. /////////////////////////////////////////////////////////////////////////////
  28. // AFXHTML - MFC Visual HTML classes
  29. // Classes declared in this file
  30. //CObject
  31. //CCmdTarget;
  32. //CWnd
  33. //CView
  34. //CFormView
  35. class CHtmlView;
  36. #undef AFX_DATA
  37. #define AFX_DATA AFX_OLE_DATA
  38. /////////////////////////////////////////////////////////////////////////////
  39. // CHtmlView
  40. class CHtmlView : public CFormView
  41. {
  42. protected: // create from serialization only
  43. CHtmlView();
  44. DECLARE_DYNCREATE(CHtmlView)
  45. DECLARE_EVENTSINK_MAP()
  46. // Attributes
  47. public:
  48. CString GetType() const;
  49. long GetLeft() const;
  50. void SetLeft(long nNewValue);
  51. long GetTop() const;
  52. void SetTop(long nNewValue);
  53. long GetHeight() const;
  54. void SetHeight(long nNewValue);
  55. void SetVisible(BOOL bNewValue);
  56. BOOL GetVisible() const;
  57. CString GetLocationName() const;
  58. READYSTATE GetReadyState() const;
  59. BOOL GetOffline() const;
  60. void SetOffline(BOOL bNewValue);
  61. BOOL GetSilent() const;
  62. void SetSilent(BOOL bNewValue);
  63. BOOL GetTopLevelContainer() const;
  64. CString GetLocationURL() const;
  65. BOOL GetBusy() const;
  66. LPDISPATCH GetApplication() const;
  67. LPDISPATCH GetParentBrowser() const;
  68. LPDISPATCH GetContainer() const;
  69. LPDISPATCH GetHtmlDocument() const;
  70. CString GetFullName() const;
  71. int GetToolBar() const;
  72. void SetToolBar(int nNewValue);
  73. BOOL GetMenuBar() const;
  74. void SetMenuBar(BOOL bNewValue);
  75. BOOL GetFullScreen() const;
  76. void SetFullScreen(BOOL bNewValue);
  77. OLECMDF QueryStatusWB(OLECMDID cmdID) const;
  78. BOOL GetRegisterAsBrowser() const;
  79. void SetRegisterAsBrowser(BOOL bNewValue);
  80. BOOL GetRegisterAsDropTarget() const;
  81. void SetRegisterAsDropTarget(BOOL bNewValue);
  82. BOOL GetTheaterMode() const;
  83. void SetTheaterMode(BOOL bNewValue);
  84. BOOL GetAddressBar() const;
  85. void SetAddressBar(BOOL bNewValue);
  86. BOOL GetStatusBar() const;
  87. void SetStatusBar(BOOL bNewValue);
  88. // Operations
  89. public:
  90. void GoBack();
  91. void GoForward();
  92. void GoHome();
  93. void GoSearch();
  94. void Navigate(LPCTSTR URL, DWORD dwFlags = 0,
  95. LPCTSTR lpszTargetFrameName = NULL,
  96. LPCTSTR lpszHeaders = NULL, LPVOID lpvPostData = NULL,
  97. DWORD dwPostDataLen = 0);
  98. void Navigate2(LPITEMIDLIST pIDL, DWORD dwFlags = 0,
  99. LPCTSTR lpszTargetFrameName = NULL);
  100. void Navigate2(LPCTSTR lpszURL, DWORD dwFlags = 0,
  101. LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeaders = NULL,
  102. LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0);
  103. void Navigate2(LPCTSTR lpszURL, DWORD dwFlags,
  104. CByteArray& baPostedData,
  105. LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeader = NULL);
  106. void Refresh();
  107. void Refresh2(int nLevel);
  108. void Stop();
  109. void PutProperty(LPCTSTR lpszProperty, const VARIANT& vtValue);
  110. void PutProperty(LPCTSTR lpszPropertyName, double dValue);
  111. void PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue);
  112. void PutProperty(LPCTSTR lpszPropertyName, long lValue);
  113. void PutProperty(LPCTSTR lpszPropertyName, short nValue);
  114. BOOL GetProperty(LPCTSTR lpszProperty, CString& strValue);
  115. COleVariant GetProperty(LPCTSTR lpszProperty);
  116. void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT* pvaIn,
  117. VARIANT* pvaOut);
  118. BOOL LoadFromResource(LPCTSTR lpszResource);
  119. BOOL LoadFromResource(UINT nRes);
  120. // Overrides
  121. public:
  122. virtual void OnDraw(CDC* pDC);
  123. virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
  124. DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
  125. CCreateContext* pContext = NULL);
  126. //{{AFX_MSG(CHtmlView)
  127. afx_msg void OnFilePrint();
  128. //}}AFX_MSG
  129. // Events
  130. virtual void OnNavigateComplete2(LPCTSTR strURL);
  131. virtual void OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags,
  132. LPCTSTR lpszTargetFrameName, CByteArray& baPostedData,
  133. LPCTSTR lpszHeaders, BOOL* pbCancel);
  134. virtual void OnStatusTextChange(LPCTSTR lpszText);
  135. virtual void OnProgressChange(long nProgress, long nProgressMax);
  136. virtual void OnCommandStateChange(long nCommand, BOOL bEnable);
  137. virtual void OnDownloadBegin();
  138. virtual void OnDownloadComplete();
  139. virtual void OnTitleChange(LPCTSTR lpszText);
  140. virtual void OnPropertyChange(LPCTSTR lpszProperty);
  141. virtual void OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel);
  142. virtual void OnDocumentComplete(LPCTSTR lpszURL);
  143. virtual void OnQuit();
  144. virtual void OnVisible(BOOL bVisible);
  145. virtual void OnToolBar(BOOL bToolBar);
  146. virtual void OnMenuBar(BOOL bMenuBar);
  147. virtual void OnStatusBar(BOOL bStatusBar);
  148. virtual void OnFullScreen(BOOL bFullScreen);
  149. virtual void OnTheaterMode(BOOL bTheaterMode);
  150. // Implementation
  151. public:
  152. virtual ~CHtmlView();
  153. CWnd m_wndBrowser;
  154. #ifdef _DEBUG
  155. virtual void AssertValid() const;
  156. virtual void Dump(CDumpContext& dc) const;
  157. #endif
  158. protected:
  159. IWebBrowser2* m_pBrowserApp;
  160. // Event reflectors (not normally overridden)
  161. protected:
  162. virtual void NavigateComplete2(LPDISPATCH pDisp, VARIANT* URL);
  163. virtual void BeforeNavigate2(LPDISPATCH pDisp, VARIANT* URL,
  164. VARIANT* Flags, VARIANT* TargetFrameName, VARIANT* PostData,
  165. VARIANT* Headers, BOOL* Cancel);
  166. virtual void DocumentComplete(LPDISPATCH pDisp, VARIANT* URL);
  167. // Generated message map functions
  168. protected:
  169. //{{AFX_MSG(CHtmlView)
  170. afx_msg void OnSize(UINT nType, int cx, int cy);
  171. afx_msg void OnPaint();
  172. afx_msg void OnDestroy();
  173. //}}AFX_MSG
  174. DECLARE_MESSAGE_MAP()
  175. };
  176. /////////////////////////////////////////////////////////////////////////////
  177. // Inline function declarations
  178. #ifdef _AFX_PACKING
  179. #pragma pack(pop)
  180. #endif
  181. #ifdef _AFX_ENABLE_INLINES
  182. #define _AFXHTML_INLINE AFX_INLINE
  183. #include <afxhtml.inl>
  184. #endif
  185. #undef AFX_DATA
  186. #define AFX_DATA
  187. #ifdef _AFX_MINREBUILD
  188. #pragma component(minrebuild, on)
  189. #endif
  190. #ifndef _AFX_FULLTYPEINFO
  191. #pragma component(mintypeinfo, off)
  192. #endif
  193. #endif // __AFXHTML_H__