include/shldisp: Add missing AUTOCOMPLETEOPTIONS constants.
[wine.git] / dlls / ieframe / ieframe.h
blob8adf47e053b4848f9359794feeba3bc3fb505157
1 /*
2 * Header includes for ieframe.dll
4 * Copyright 2011 Jacek Caban for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #define COBJMACROS
25 #include "windef.h"
26 #include "winbase.h"
27 #include "wingdi.h"
28 #include "winuser.h"
30 #include "ole2.h"
31 #include "olectl.h"
32 #include "shlobj.h"
33 #include "mshtmhst.h"
34 #include "exdisp.h"
35 #include "hlink.h"
36 #include "htiface.h"
37 #include "shdeprecated.h"
38 #include "docobjectservice.h"
40 #include "wine/unicode.h"
41 #include "wine/heap.h"
42 #include "wine/list.h"
44 typedef struct ConnectionPoint ConnectionPoint;
45 typedef struct DocHost DocHost;
47 typedef struct {
48 IConnectionPointContainer IConnectionPointContainer_iface;
50 ConnectionPoint *wbe2;
51 ConnectionPoint *wbe;
52 ConnectionPoint *pns;
54 IUnknown *impl;
55 } ConnectionPointContainer;
57 typedef struct {
58 IHlinkFrame IHlinkFrame_iface;
59 ITargetFrame ITargetFrame_iface;
60 ITargetFrame2 ITargetFrame2_iface;
61 ITargetFramePriv2 ITargetFramePriv2_iface;
62 IWebBrowserPriv2IE9 IWebBrowserPriv2IE9_iface;
64 IUnknown *outer;
65 DocHost *doc_host;
66 } HlinkFrame;
68 struct _task_header_t;
70 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
71 typedef void (*task_destr_t)(struct _task_header_t*);
73 typedef struct _task_header_t {
74 struct list entry;
75 task_proc_t proc;
76 task_destr_t destr;
77 } task_header_t;
79 typedef struct {
80 IShellBrowser IShellBrowser_iface;
81 IBrowserService IBrowserService_iface;
82 IDocObjectService IDocObjectService_iface;
84 LONG ref;
86 DocHost *doc_host;
87 } ShellBrowser;
89 typedef struct {
90 IHTMLWindow2 IHTMLWindow2_iface;
91 DocHost *doc_host;
92 } IEHTMLWindow;
94 typedef struct {
95 INewWindowManager INewWindowManager_iface;
96 DocHost *doc_host;
97 } NewWindowManager;
99 typedef struct {
100 WCHAR *url;
101 IStream *stream;
102 } travellog_entry_t;
104 typedef struct _IDocHostContainerVtbl
106 ULONG (*addref)(DocHost*);
107 ULONG (*release)(DocHost*);
108 void (*get_docobj_rect)(DocHost*,RECT*);
109 HRESULT (*set_status_text)(DocHost*,const WCHAR*);
110 void (*on_command_state_change)(DocHost*,LONG,BOOL);
111 void (*set_url)(DocHost*,const WCHAR*);
112 } IDocHostContainerVtbl;
114 struct DocHost {
115 IOleClientSite IOleClientSite_iface;
116 IOleInPlaceSiteEx IOleInPlaceSiteEx_iface;
117 IDocHostUIHandler2 IDocHostUIHandler2_iface;
118 IOleDocumentSite IOleDocumentSite_iface;
119 IOleControlSite IOleControlSite_iface;
120 IOleCommandTarget IOleCommandTarget_iface;
121 IDispatch IDispatch_iface;
122 IPropertyNotifySink IPropertyNotifySink_iface;
123 IServiceProvider IServiceProvider_iface;
125 /* Interfaces of InPlaceFrame object */
126 IOleInPlaceFrame IOleInPlaceFrame_iface;
128 IWebBrowser2 *wb;
130 IDispatch *client_disp;
131 IDocHostUIHandler *hostui;
132 IOleInPlaceFrame *frame;
133 IOleCommandTarget *olecmd;
135 IUnknown *document;
136 IOleDocumentView *view;
137 IUnknown *doc_navigate;
139 const IDocHostContainerVtbl *container_vtbl;
141 HWND hwnd;
142 HWND frame_hwnd;
144 struct list task_queue;
146 LPOLESTR url;
148 VARIANT_BOOL silent;
149 VARIANT_BOOL offline;
150 VARIANT_BOOL busy;
152 READYSTATE ready_state;
153 READYSTATE doc_state;
154 DWORD prop_notif_cookie;
155 BOOL is_prop_notif;
157 ShellBrowser *browser_service;
158 IShellUIHelper2 *shell_ui_helper;
160 struct {
161 travellog_entry_t *log;
162 unsigned size;
163 unsigned length;
164 unsigned position;
165 int loading_pos;
166 } travellog;
168 ConnectionPointContainer cps;
169 IEHTMLWindow html_window;
170 NewWindowManager nwm;
173 struct WebBrowser {
174 IWebBrowser2 IWebBrowser2_iface;
175 IOleObject IOleObject_iface;
176 IOleInPlaceObject IOleInPlaceObject_iface;
177 IOleControl IOleControl_iface;
178 IPersistStorage IPersistStorage_iface;
179 IPersistMemory IPersistMemory_iface;
180 IPersistStreamInit IPersistStreamInit_iface;
181 IProvideClassInfo2 IProvideClassInfo2_iface;
182 IViewObject2 IViewObject2_iface;
183 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
184 IOleCommandTarget IOleCommandTarget_iface;
185 IServiceProvider IServiceProvider_iface;
186 IDataObject IDataObject_iface;
187 HlinkFrame hlink_frame;
189 LONG ref;
191 INT version;
193 IOleClientSite *client;
194 IOleClientSite *client_closed;
195 IOleContainer *container;
196 IOleInPlaceSiteEx *inplace;
198 IAdviseSink *sink;
199 DWORD sink_aspects;
200 DWORD sink_flags;
202 /* window context */
204 HWND frame_hwnd;
205 IOleInPlaceUIWindow *uiwindow;
206 RECT pos_rect;
207 RECT clip_rect;
208 OLEINPLACEFRAMEINFO frameinfo;
209 SIZEL extent;
211 HWND shell_embedding_hwnd;
213 VARIANT_BOOL register_browser;
214 VARIANT_BOOL visible;
215 VARIANT_BOOL menu_bar;
216 VARIANT_BOOL address_bar;
217 VARIANT_BOOL status_bar;
218 VARIANT_BOOL tool_bar;
219 VARIANT_BOOL full_screen;
220 VARIANT_BOOL theater_mode;
222 DocHost doc_host;
225 struct InternetExplorer {
226 DocHost doc_host;
227 IWebBrowser2 IWebBrowser2_iface;
228 IExternalConnection IExternalConnection_iface;
229 IServiceProvider IServiceProvider_iface;
230 HlinkFrame hlink_frame;
232 LONG ref;
233 LONG extern_ref;
235 HWND frame_hwnd;
236 HWND status_hwnd;
237 HWND toolbar_hwnd;
238 HMENU menu;
239 BOOL nohome;
241 struct list entry;
244 void WebBrowser_OleObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
245 void WebBrowser_ViewObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
246 void WebBrowser_Persist_Init(WebBrowser*) DECLSPEC_HIDDEN;
247 void WebBrowser_ClassInfo_Init(WebBrowser*) DECLSPEC_HIDDEN;
249 void WebBrowser_OleObject_Destroy(WebBrowser*) DECLSPEC_HIDDEN;
251 void DocHost_Init(DocHost*,IWebBrowser2*,const IDocHostContainerVtbl*) DECLSPEC_HIDDEN;
252 void DocHost_Release(DocHost*) DECLSPEC_HIDDEN;
253 void DocHost_ClientSite_Init(DocHost*) DECLSPEC_HIDDEN;
254 void DocHost_ClientSite_Release(DocHost*) DECLSPEC_HIDDEN;
255 void DocHost_Frame_Init(DocHost*) DECLSPEC_HIDDEN;
256 void release_dochost_client(DocHost*) DECLSPEC_HIDDEN;
258 void IEHTMLWindow_Init(DocHost*) DECLSPEC_HIDDEN;
259 void NewWindowManager_Init(DocHost*) DECLSPEC_HIDDEN;
261 void HlinkFrame_Init(HlinkFrame*,IUnknown*,DocHost*) DECLSPEC_HIDDEN;
262 BOOL HlinkFrame_QI(HlinkFrame*,REFIID,void**) DECLSPEC_HIDDEN;
264 HRESULT create_browser_service(DocHost*,ShellBrowser**) DECLSPEC_HIDDEN;
265 void detach_browser_service(ShellBrowser*) DECLSPEC_HIDDEN;
266 HRESULT create_shell_ui_helper(IShellUIHelper2**) DECLSPEC_HIDDEN;
268 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*) DECLSPEC_HIDDEN;
269 void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
271 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN;
272 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
273 HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
274 HRESULT go_back(DocHost*) DECLSPEC_HIDDEN;
275 HRESULT go_forward(DocHost*) DECLSPEC_HIDDEN;
276 HRESULT refresh_document(DocHost*,const VARIANT*) DECLSPEC_HIDDEN;
277 HRESULT get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
278 HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN;
279 void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
280 HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN;
281 void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
282 void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
283 void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
284 void on_commandstate_change(DocHost*,LONG,BOOL) DECLSPEC_HIDDEN;
285 void notify_download_state(DocHost*,BOOL) DECLSPEC_HIDDEN;
286 void update_navigation_commands(DocHost *dochost) DECLSPEC_HIDDEN;
288 #define WM_DOCHOSTTASK (WM_USER+0x300)
289 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
290 void abort_dochost_tasks(DocHost*,task_proc_t) DECLSPEC_HIDDEN;
291 LRESULT process_dochost_tasks(DocHost*) DECLSPEC_HIDDEN;
293 void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN;
294 HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR) DECLSPEC_HIDDEN;
295 void released_obj(void) DECLSPEC_HIDDEN;
296 DWORD release_extern_ref(InternetExplorer*,BOOL) DECLSPEC_HIDDEN;
298 void register_iewindow_class(void) DECLSPEC_HIDDEN;
299 void unregister_iewindow_class(void) DECLSPEC_HIDDEN;
301 #define TID_LIST \
302 XCLSID(WebBrowser) \
303 XCLSID(WebBrowser_V1) \
304 XIID(IWebBrowser2)
306 typedef enum {
307 #define XIID(iface) iface ## _tid,
308 #define XCLSID(class) class ## _tid,
309 TID_LIST
310 #undef XIID
311 #undef XCLSID
312 LAST_tid
313 } tid_t;
315 HRESULT get_typeinfo(tid_t,ITypeInfo**) DECLSPEC_HIDDEN;
317 HRESULT WINAPI CUrlHistory_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
318 HRESULT WINAPI InternetExplorer_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
319 HRESULT WINAPI InternetShortcut_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
320 HRESULT WINAPI WebBrowser_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
321 HRESULT WINAPI WebBrowserV1_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
322 HRESULT WINAPI InternetExplorerManager_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
324 extern IClassFactory InternetExplorerFactory DECLSPEC_HIDDEN;
325 extern IClassFactory InternetExplorerManagerFactory DECLSPEC_HIDDEN;
327 extern LONG module_ref DECLSPEC_HIDDEN;
328 extern HINSTANCE ieframe_instance DECLSPEC_HIDDEN;
330 static inline void lock_module(void) {
331 InterlockedIncrement(&module_ref);
334 static inline void unlock_module(void) {
335 InterlockedDecrement(&module_ref);
338 static inline LPWSTR heap_strdupW(LPCWSTR str)
340 LPWSTR ret = NULL;
342 if(str) {
343 DWORD size;
345 size = (strlenW(str)+1)*sizeof(WCHAR);
346 ret = heap_alloc(size);
347 if(ret)
348 memcpy(ret, str, size);
351 return ret;
354 static inline LPWSTR co_strdupW(LPCWSTR str)
356 WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
357 if (ret)
358 lstrcpyW(ret, str);
359 return ret;
362 static inline LPWSTR co_strdupAtoW(LPCSTR str)
364 INT len;
365 WCHAR *ret;
366 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
367 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
368 if (ret)
369 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
370 return ret;
373 static inline LPSTR co_strdupWtoA(LPCWSTR str)
375 INT len;
376 CHAR *ret;
377 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
378 ret = CoTaskMemAlloc(len);
379 if (ret)
380 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
381 return ret;