home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / mfc / include / afxhtml.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  7KB  |  220 lines

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