home *** CD-ROM | disk | FTP | other *** search
- // This is a part of the Microsoft Foundation Classes C++ library.
- // Copyright (C) 1992-1998 Microsoft Corporation
- // All rights reserved.
- //
- // This source code is only intended as a supplement to the
- // Microsoft Foundation Classes Reference and related
- // electronic documentation provided with the library.
- // See these sources for detailed information regarding the
- // Microsoft Foundation Classes product.
-
- #ifndef __AFXHTML_H__
- #define __AFXHTML_H__
-
- #ifndef __AFXDISP_H__
- #include <afxdisp.h>
- #endif
-
- #ifndef __exdisp_h__
- #include <exdisp.h>
- #endif
-
- #ifdef _AFX_MINREBUILD
- #pragma component(minrebuild, off)
- #endif
- #ifndef _AFX_FULLTYPEINFO
- #pragma component(mintypeinfo, on)
- #endif
-
- #ifdef _AFX_PACKING
- #pragma pack(push, _AFX_PACKING)
- #endif
-
- /////////////////////////////////////////////////////////////////////////////
- // AFXHTML - MFC Visual HTML classes
-
- // Classes declared in this file
-
- //CObject
- //CCmdTarget;
- //CWnd
- //CView
- //CFormView
- class CHtmlView;
-
- #undef AFX_DATA
- #define AFX_DATA AFX_OLE_DATA
-
- /////////////////////////////////////////////////////////////////////////////
- // CHtmlView
-
- class CHtmlView : public CFormView
- {
- protected: // create from serialization only
- CHtmlView();
- DECLARE_DYNCREATE(CHtmlView)
- DECLARE_EVENTSINK_MAP()
-
- // Attributes
- public:
- CString GetType() const;
- long GetLeft() const;
- void SetLeft(long nNewValue);
- long GetTop() const;
- void SetTop(long nNewValue);
- long GetHeight() const;
- void SetHeight(long nNewValue);
- void SetVisible(BOOL bNewValue);
- BOOL GetVisible() const;
- CString GetLocationName() const;
- READYSTATE GetReadyState() const;
- BOOL GetOffline() const;
- void SetOffline(BOOL bNewValue);
- BOOL GetSilent() const;
- void SetSilent(BOOL bNewValue);
- BOOL GetTopLevelContainer() const;
- CString GetLocationURL() const;
- BOOL GetBusy() const;
- LPDISPATCH GetApplication() const;
- LPDISPATCH GetParentBrowser() const;
- LPDISPATCH GetContainer() const;
- LPDISPATCH GetHtmlDocument() const;
- CString GetFullName() const;
- int GetToolBar() const;
- void SetToolBar(int nNewValue);
- BOOL GetMenuBar() const;
- void SetMenuBar(BOOL bNewValue);
- BOOL GetFullScreen() const;
- void SetFullScreen(BOOL bNewValue);
- OLECMDF QueryStatusWB(OLECMDID cmdID) const;
- BOOL GetRegisterAsBrowser() const;
- void SetRegisterAsBrowser(BOOL bNewValue);
- BOOL GetRegisterAsDropTarget() const;
- void SetRegisterAsDropTarget(BOOL bNewValue);
- BOOL GetTheaterMode() const;
- void SetTheaterMode(BOOL bNewValue);
- BOOL GetAddressBar() const;
- void SetAddressBar(BOOL bNewValue);
- BOOL GetStatusBar() const;
- void SetStatusBar(BOOL bNewValue);
-
- // Operations
- public:
- void GoBack();
- void GoForward();
- void GoHome();
- void GoSearch();
- void Navigate(LPCTSTR URL, DWORD dwFlags = 0,
- LPCTSTR lpszTargetFrameName = NULL,
- LPCTSTR lpszHeaders = NULL, LPVOID lpvPostData = NULL,
- DWORD dwPostDataLen = 0);
- void Navigate2(LPITEMIDLIST pIDL, DWORD dwFlags = 0,
- LPCTSTR lpszTargetFrameName = NULL);
- void Navigate2(LPCTSTR lpszURL, DWORD dwFlags = 0,
- LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeaders = NULL,
- LPVOID lpvPostData = NULL, DWORD dwPostDataLen = 0);
- void Navigate2(LPCTSTR lpszURL, DWORD dwFlags,
- CByteArray& baPostedData,
- LPCTSTR lpszTargetFrameName = NULL, LPCTSTR lpszHeader = NULL);
- void Refresh();
- void Refresh2(int nLevel);
- void Stop();
- void PutProperty(LPCTSTR lpszProperty, const VARIANT& vtValue);
- void PutProperty(LPCTSTR lpszPropertyName, double dValue);
- void PutProperty(LPCTSTR lpszPropertyName, LPCTSTR lpszValue);
- void PutProperty(LPCTSTR lpszPropertyName, long lValue);
- void PutProperty(LPCTSTR lpszPropertyName, short nValue);
- BOOL GetProperty(LPCTSTR lpszProperty, CString& strValue);
- COleVariant GetProperty(LPCTSTR lpszProperty);
- void ExecWB(OLECMDID cmdID, OLECMDEXECOPT cmdexecopt, VARIANT* pvaIn,
- VARIANT* pvaOut);
- BOOL LoadFromResource(LPCTSTR lpszResource);
- BOOL LoadFromResource(UINT nRes);
-
- // Overrides
- public:
- virtual void OnDraw(CDC* pDC);
- virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName,
- DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID,
- CCreateContext* pContext = NULL);
-
- //{{AFX_MSG(CHtmlView)
- afx_msg void OnFilePrint();
- //}}AFX_MSG
-
- // Events
- virtual void OnNavigateComplete2(LPCTSTR strURL);
- virtual void OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags,
- LPCTSTR lpszTargetFrameName, CByteArray& baPostedData,
- LPCTSTR lpszHeaders, BOOL* pbCancel);
- virtual void OnStatusTextChange(LPCTSTR lpszText);
- virtual void OnProgressChange(long nProgress, long nProgressMax);
- virtual void OnCommandStateChange(long nCommand, BOOL bEnable);
- virtual void OnDownloadBegin();
- virtual void OnDownloadComplete();
- virtual void OnTitleChange(LPCTSTR lpszText);
- virtual void OnPropertyChange(LPCTSTR lpszProperty);
- virtual void OnNewWindow2(LPDISPATCH* ppDisp, BOOL* Cancel);
- virtual void OnDocumentComplete(LPCTSTR lpszURL);
- virtual void OnQuit();
- virtual void OnVisible(BOOL bVisible);
- virtual void OnToolBar(BOOL bToolBar);
- virtual void OnMenuBar(BOOL bMenuBar);
- virtual void OnStatusBar(BOOL bStatusBar);
- virtual void OnFullScreen(BOOL bFullScreen);
- virtual void OnTheaterMode(BOOL bTheaterMode);
-
- // Implementation
- public:
- virtual ~CHtmlView();
- CWnd m_wndBrowser;
- #ifdef _DEBUG
- virtual void AssertValid() const;
- virtual void Dump(CDumpContext& dc) const;
- #endif
- protected:
- IWebBrowser2* m_pBrowserApp;
-
- // Event reflectors (not normally overridden)
- protected:
- virtual void NavigateComplete2(LPDISPATCH pDisp, VARIANT* URL);
- virtual void BeforeNavigate2(LPDISPATCH pDisp, VARIANT* URL,
- VARIANT* Flags, VARIANT* TargetFrameName, VARIANT* PostData,
- VARIANT* Headers, BOOL* Cancel);
- virtual void DocumentComplete(LPDISPATCH pDisp, VARIANT* URL);
-
- // Generated message map functions
- protected:
- //{{AFX_MSG(CHtmlView)
- afx_msg void OnSize(UINT nType, int cx, int cy);
- afx_msg void OnPaint();
- afx_msg void OnDestroy();
- //}}AFX_MSG
- DECLARE_MESSAGE_MAP()
- };
-
-
- /////////////////////////////////////////////////////////////////////////////
- // Inline function declarations
-
- #ifdef _AFX_PACKING
- #pragma pack(pop)
- #endif
-
- #ifdef _AFX_ENABLE_INLINES
- #define _AFXHTML_INLINE AFX_INLINE
- #include <afxhtml.inl>
- #endif
-
- #undef AFX_DATA
- #define AFX_DATA
-
- #ifdef _AFX_MINREBUILD
- #pragma component(minrebuild, on)
- #endif
- #ifndef _AFX_FULLTYPEINFO
- #pragma component(mintypeinfo, off)
- #endif
-
- #endif // __AFXHTML_H__
-