update for HEAD-2003091401
[reactos.git] / subsys / system / explorer / Seashell / SeaShellExt / Include / UIHtmlView.h
1 //*******************************************************************************
2 // COPYRIGHT NOTES
3 // ---------------
4 // You may use this source code, compile or redistribute it as part of your application 
5 // for free. You cannot redistribute it as a part of a software development 
6 // library without the agreement of the author. If the sources are 
7 // distributed along with the application, you should leave the original 
8 // copyright notes in the source code without any changes.
9 // This code can be used WITHOUT ANY WARRANTIES at your own risk.
10 // 
11 // For the latest updates to this code, check this site:
12 // http://www.masmex.com 
13 // after Sept 2000
14 // 
15 // Copyright(C) 2000 Philip Oldaker <email: philip@masmex.com>
16 //*******************************************************************************
17
18 #if !defined(AFX_HTMLMSGVIEW_H__4A8E5045_F2AC_47AE_A24D_584CB7D9D084__INCLUDED_)
19 #define AFX_HTMLMSGVIEW_H__4A8E5045_F2AC_47AE_A24D_584CB7D9D084__INCLUDED_
20
21 #if _MSC_VER > 1000
22 #pragma once
23 #endif // _MSC_VER > 1000
24 // HtmlMsgView.h : header file
25 //
26 /////////////////////////////////////////////////////////////////////////////
27 // CUIHtmlView html view
28
29 interface IHTMLDocument2;
30 interface IHTMLElement;
31 interface IHTMLImgElement;
32 interface IHTMLObjectElement;
33
34 #ifndef __AFXEXT_H__
35 #include <afxext.h>
36 #endif
37 #include <afxhtml.h>
38
39 #include <comdef.h>
40
41 class CTRL_EXT_CLASS CUIHtmlView : public CHtmlView
42 {
43 protected:
44         CUIHtmlView();           // protected constructor used by dynamic creation
45         DECLARE_DYNAMIC(CUIHtmlView)
46
47 // html Data
48 public:
49         //{{AFX_DATA(CUIHtmlView)
50                 // NOTE: the ClassWizard will add data members here
51         //}}AFX_DATA
52
53 // Attributes
54 public:
55         void SetNotifyWnd(HWND hwnd);
56         bool IsWorking() { return m_pHTMLDocument2 == NULL; }
57         IHTMLDocument2 *GetHTMLDocument();
58         void GetElement(LPCTSTR pszID,IHTMLElement **pElement);
59         CString GetBodyText();
60 // Operations
61 public:
62         virtual bool ExecScript(LPCTSTR pszScript,LPCTSTR pszLang=NULL,_variant_t *pvt=NULL);
63         virtual bool SetElementText(LPCTSTR pszElemID,LPCTSTR pszText);
64         virtual bool SetElementHTML(LPCTSTR pszElemID,LPCTSTR pszText);
65         virtual bool SetElementValue(LPCTSTR pszElemID,LPCTSTR pszText);
66         virtual bool SetImageSource(LPCTSTR pszElemID,LPCTSTR pszText);
67         virtual bool AddOptionString(LPCTSTR pszElemID,LPCTSTR pszText,LPCTSTR pszValue,bool bSelect=false);
68         virtual bool SetOptionString(LPCTSTR pszElemID,LPCTSTR pszText);
69         virtual bool GetOptionString(LPCTSTR pszElemID,CString &sText,CString &sValue);
70         virtual CString GetElementText(LPCTSTR pszElemID);
71         virtual CString GetElementHTML(LPCTSTR pszElemID);
72         virtual CString GetElementValue(LPCTSTR pszElemID);
73         virtual void ParseDocument();
74
75 protected:
76         virtual void DocumentReady();
77         virtual void ActiveXControl(IHTMLObjectElement *pObj);
78         virtual void ImageElement(IHTMLImgElement *pImg);
79         virtual void Element(IHTMLElement *pElement);
80 // Overrides
81         // ClassWizard generated virtual function overrides
82         //{{AFX_VIRTUAL(CUIHtmlView)
83         public:
84         virtual void OnBeforeNavigate2(LPCTSTR lpszURL, DWORD nFlags, LPCTSTR lpszTargetFrameName, CByteArray& baPostedData, LPCTSTR lpszHeaders, BOOL* pbCancel);
85         virtual void OnCommandStateChange(long nCommand, BOOL bEnable);
86         protected:
87         virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
88         virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
89         virtual void DocumentComplete(LPDISPATCH pDisp, VARIANT* URL);
90         virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
91         virtual void OnActivateView(BOOL bActivate, CView* pActivateView, CView* pDeactiveView);
92         virtual void OnTitleChange(LPCTSTR lpszText);
93         virtual void OnDocumentComplete(LPCTSTR lpszUrl);
94         //}}AFX_VIRTUAL
95
96 // Implementation
97 protected:
98         void ReleaseDocument();
99         virtual ~CUIHtmlView();
100 #ifdef _DEBUG
101         virtual void AssertValid() const;
102         virtual void Dump(CDumpContext& dc) const;
103 #endif
104
105         // Generated message map functions
106         //{{AFX_MSG(CUIHtmlView)
107         afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
108         afx_msg void OnBrowserGoBack();
109         afx_msg void OnBrowserGoForward();
110         afx_msg void OnBrowserGoHome();
111         afx_msg void OnBrowserRefresh();
112         afx_msg void OnBrowserStop();
113         afx_msg void OnUpdateBrowserGoBack(CCmdUI *pUI);
114         afx_msg void OnUpdateBrowserGoForward(CCmdUI *pUI);
115         //}}AFX_MSG
116         DECLARE_MESSAGE_MAP()
117 private:
118         IHTMLDocument2 *m_pHTMLDocument2;
119         BOOL m_bDocumentComplete;
120         BOOL m_bGoBack;
121         BOOL m_bGoForward;
122         HWND m_hNotifyWnd;
123         bool m_bSetCursor;
124 };
125
126 inline void CUIHtmlView::SetNotifyWnd(HWND hwnd)
127 {
128         m_hNotifyWnd = hwnd;
129 }
130
131 inline IHTMLDocument2 *CUIHtmlView::GetHTMLDocument()
132 {
133         ASSERT(m_pHTMLDocument2);
134         return m_pHTMLDocument2;
135 }
136 /////////////////////////////////////////////////////////////////////////////
137
138 //{{AFX_INSERT_LOCATION}}
139 // Microsoft Visual C++ will insert additional declarations immediately before the previous line.
140
141 #endif // !defined(AFX_HTMLMSGVIEW_H__4A8E5045_F2AC_47AE_A24D_584CB7D9D084__INCLUDED_)