VirtualBox

source: vbox/trunk/src/VBox/Installer/win/AutoStartMenu/HTMLWindow.h@ 31659

Last change on this file since 31659 was 31659, checked in by vboxsync, 14 years ago

export Windows installer to OSE

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 6.4 KB
Line 
1#ifndef HTMLWINDOW_H__
2#define HTMLWINDOW_H__
3
4#include <windows.h>
5#include <exdisp.h>
6#include <mshtml.h>
7#include <mshtmhst.h>
8#include <oaidl.h>
9
10#include <string>
11#include <map>
12
13#include "DocHostUiHandler.h"
14#include "OleInPlaceFrame.h"
15#include "OleInPlaceSite.h"
16
17// TODO
18#define MUST_BE_IMPLEMENTED(s) ::MessageBox(0, s, "Not Implemented", 0); return E_NOTIMPL;
19
20/*
21 Thanks to http://www.codeproject.com/com/cwebpage.asp for a great example
22*/
23
24
25extern bool todo_bool;
26
27class EventReceiver
28{
29 friend class HTMLWindow;
30protected:
31 virtual void AppLink(std::string const&, std::string& out_html, const std::map<std::string,std::string>& param_map) = 0;
32};
33
34class HTMLWindow :
35public virtual DWebBrowserEvents2
36{
37
38 friend class DocHostUiHandler;
39
40public:
41 typedef std::map<std::string, std::string> param_list;
42
43 HTMLWindow(std::string const& html_or_url,
44 std::string const& title,
45 HINSTANCE,
46 bool is_url);
47
48 HTMLWindow(EventReceiver*,
49 std::string const& title,
50 HINSTANCE,
51 std::string const& first_link = "start_app",
52 param_list const& first_params = param_list());
53
54 virtual ~HTMLWindow();
55
56 long HTML(std::string const&);
57 long URL (std::string const& url);
58 void ResizeBrowser (HWND hwnd, DWORD width, DWORD height);
59 void AddSink();
60
61 HWND hwnd_;
62
63private:
64 static bool ole_is_initialized_;
65 static LRESULT CALLBACK WindowProc(HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam);
66
67 long EmbedBrowserObject();
68
69 void InitOle_CreateWindow(std::string const& title);
70
71 HINSTANCE instance_;
72 IOleObject* browserObject_;
73
74 IOleClientSite* ole_client_site_;
75 IStorage* storage_;
76 OleInPlaceSite* ole_in_place_site_;
77 OleInPlaceFrame* ole_in_place_frame_;
78 DocHostUiHandler* doc_host_ui_handler_;
79
80 EventReceiver* event_receiver_;
81
82 HRESULT STDMETHODCALLTYPE QueryInterface(REFIID riid, void ** ppvObject);
83
84 ULONG STDMETHODCALLTYPE AddRef()
85 {
86 return 1;
87 }
88
89 ULONG STDMETHODCALLTYPE Release()
90 {
91 return 1;
92 }
93
94 void STDMETHODCALLTYPE BeforeNavigate2(
95 IDispatch* pDisp,
96 VARIANT* url,
97 VARIANT* Flags,
98 VARIANT* TargetFrameName,
99 VARIANT* PostData,
100 VARIANT* Headers,
101 VARIANT_BOOL* Cancel);
102
103 void ClientToHostWindow(
104 long* CX,
105 long* CY
106 )
107 {
108 }
109
110 void CommandStateChange( long Command,
111 VARIANT_BOOL Enable
112 )
113 {
114 }
115
116 void DocumentComplete( IDispatch* pDisp,
117 VARIANT* URL
118 )
119 {
120 }
121
122 void DownloadBegin(VOID)
123 {
124 }
125
126 void DownloadComplete(VOID)
127 {
128 }
129
130 void FileDownload(VARIANT_BOOL* Cancel);
131
132 void NavigateComplete(IDispatch* pDisp, VARIANT* URL)
133 {
134 }
135
136 void NavigateError( IDispatch* pDisp,
137 VARIANT* URL,
138 VARIANT* TargetFrameName,
139 VARIANT* StatusCode,
140 VARIANT_BOOL* Cancel
141 )
142 {
143 }
144
145 void NewWindow2(
146 IDispatch** ppDisp,
147 VARIANT_BOOL* Cancel
148 )
149 {
150 }
151
152 void OnFullScreen(VARIANT_BOOL FullScreen)
153 {
154 }
155
156 void OnMenuBar(VARIANT_BOOL MenuBar)
157 {
158 }
159
160 void OnQuit(VOID)
161 {
162 }
163
164 void OnStatusBar(VARIANT_BOOL StatusBar)
165 {
166 }
167
168 void OnTheaterMode(VARIANT_BOOL TheaterMode)
169 {
170 }
171
172 void OnToolBar(VARIANT_BOOL ToolBar)
173 {
174 }
175
176 void OnVisible(VARIANT_BOOL Visible)
177 {
178 ::MessageBox(0, "OnVisible", 0, 0);
179 }
180
181 void PrintTemplateInstantiation(IDispatch* pDisp)
182 {
183 }
184
185 void PrintTemplateTeardown(IDispatch* pDisp)
186 {
187 }
188
189 void PrivacyImpactedStateChange(VARIANT_BOOL PrivacyImpacted)
190 {
191 }
192
193 void ProgressChange(long Progress, long ProgressMax)
194 {
195 }
196
197 void PropertyChange(BSTR szProperty)
198 {
199 }
200
201 void SetSecureLockIcon(long SecureLockIcon)
202 {
203 }
204
205 void StatusTextChange(BSTR Text)
206 {
207 }
208
209 void TitleChange(BSTR Text)
210 {
211 }
212
213 void WindowClosing(VARIANT_BOOL IsChildWindow, VARIANT_BOOL* Cancel)
214 {
215 }
216
217 void WindowSetHeight(long Height)
218 {
219 }
220
221 void WindowSetLeft(long Left)
222 {
223 }
224
225 void WindowSetResizable(VARIANT_BOOL Resizable)
226 {
227 }
228
229 void WindowSetTop(long Top)
230 {
231 }
232
233 void WindowSetWidth(long Width)
234 {
235 }
236
237 HRESULT STDMETHODCALLTYPE GetTypeInfoCount( unsigned int FAR* pctinfo)
238 {
239 MUST_BE_IMPLEMENTED("GetTypeInfoCount")
240 *pctinfo = 0;
241 return S_OK;
242 }
243
244 HRESULT STDMETHODCALLTYPE GetTypeInfo(
245 unsigned int iTInfo,
246 LCID lcid,
247 ITypeInfo FAR* FAR* ppTInfo
248 )
249 {
250 MUST_BE_IMPLEMENTED("GetTypeInfo")
251 }
252
253 HRESULT STDMETHODCALLTYPE GetIDsOfNames(
254 REFIID riid,
255 OLECHAR FAR* FAR* rgszNames,
256 unsigned int cNames,
257 LCID lcid,
258 DISPID FAR* rgDispId
259 )
260 {
261 MUST_BE_IMPLEMENTED("GetIDsOfNames")
262 }
263
264 HRESULT STDMETHODCALLTYPE Invoke(
265 DISPID dispIdMember,
266 REFIID riid,
267 LCID lcid,
268 WORD wFlags,
269 DISPPARAMS FAR* pDispParams,
270 VARIANT FAR* pVarResult,
271 EXCEPINFO FAR* pExcepInfo,
272 unsigned int FAR* puArgErr);
273};
274
275#endif
Note: See TracBrowser for help on using the repository browser.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette