ieframe: Implement SetQueryNetSessionCount.
[wine/zf.git] / dlls / ieframe / ieframe.h
blob633906a70ca864994616a18e303352e92900aceb
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/heap.h"
41 #include "wine/list.h"
43 typedef struct ConnectionPoint ConnectionPoint;
44 typedef struct DocHost DocHost;
46 typedef struct {
47 IConnectionPointContainer IConnectionPointContainer_iface;
49 ConnectionPoint *wbe2;
50 ConnectionPoint *wbe;
51 ConnectionPoint *pns;
53 IUnknown *impl;
54 } ConnectionPointContainer;
56 typedef struct {
57 IHlinkFrame IHlinkFrame_iface;
58 ITargetFrame ITargetFrame_iface;
59 ITargetFrame2 ITargetFrame2_iface;
60 ITargetFramePriv2 ITargetFramePriv2_iface;
61 IWebBrowserPriv2IE9 IWebBrowserPriv2IE9_iface;
63 IUnknown *outer;
64 DocHost *doc_host;
65 } HlinkFrame;
67 struct _task_header_t;
69 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
70 typedef void (*task_destr_t)(struct _task_header_t*);
72 typedef struct _task_header_t {
73 struct list entry;
74 task_proc_t proc;
75 task_destr_t destr;
76 } task_header_t;
78 typedef struct {
79 IShellBrowser IShellBrowser_iface;
80 IBrowserService IBrowserService_iface;
81 IDocObjectService IDocObjectService_iface;
83 LONG ref;
85 DocHost *doc_host;
86 } ShellBrowser;
88 typedef struct {
89 IHTMLWindow2 IHTMLWindow2_iface;
90 DocHost *doc_host;
91 } IEHTMLWindow;
93 typedef struct {
94 INewWindowManager INewWindowManager_iface;
95 DocHost *doc_host;
96 } NewWindowManager;
98 typedef struct {
99 WCHAR *url;
100 IStream *stream;
101 } travellog_entry_t;
103 typedef struct _IDocHostContainerVtbl
105 ULONG (*addref)(DocHost*);
106 ULONG (*release)(DocHost*);
107 void (*get_docobj_rect)(DocHost*,RECT*);
108 HRESULT (*set_status_text)(DocHost*,const WCHAR*);
109 void (*on_command_state_change)(DocHost*,LONG,BOOL);
110 void (*set_url)(DocHost*,const WCHAR*);
111 } IDocHostContainerVtbl;
113 struct DocHost {
114 IOleClientSite IOleClientSite_iface;
115 IOleInPlaceSiteEx IOleInPlaceSiteEx_iface;
116 IDocHostUIHandler2 IDocHostUIHandler2_iface;
117 IOleDocumentSite IOleDocumentSite_iface;
118 IOleControlSite IOleControlSite_iface;
119 IOleCommandTarget IOleCommandTarget_iface;
120 IDispatch IDispatch_iface;
121 IPropertyNotifySink IPropertyNotifySink_iface;
122 IServiceProvider IServiceProvider_iface;
124 /* Interfaces of InPlaceFrame object */
125 IOleInPlaceFrame IOleInPlaceFrame_iface;
127 IWebBrowser2 *wb;
129 IDispatch *client_disp;
130 IDocHostUIHandler *hostui;
131 IOleInPlaceFrame *frame;
132 IOleCommandTarget *olecmd;
134 IUnknown *document;
135 IOleDocumentView *view;
136 IUnknown *doc_navigate;
138 const IDocHostContainerVtbl *container_vtbl;
140 HWND hwnd;
141 HWND frame_hwnd;
143 struct list task_queue;
145 LPOLESTR url;
147 VARIANT_BOOL silent;
148 VARIANT_BOOL offline;
149 VARIANT_BOOL busy;
151 READYSTATE ready_state;
152 READYSTATE doc_state;
153 DWORD prop_notif_cookie;
154 BOOL is_prop_notif;
156 ShellBrowser *browser_service;
157 IShellUIHelper2 *shell_ui_helper;
159 struct {
160 travellog_entry_t *log;
161 unsigned size;
162 unsigned length;
163 unsigned position;
164 int loading_pos;
165 } travellog;
167 ConnectionPointContainer cps;
168 IEHTMLWindow html_window;
169 NewWindowManager nwm;
172 struct WebBrowser {
173 IUnknown IUnknown_inner;
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 IOleAdviseHolder *advise_holder;
204 /* window context */
206 HWND frame_hwnd;
207 IOleInPlaceUIWindow *uiwindow;
208 RECT pos_rect;
209 RECT clip_rect;
210 OLEINPLACEFRAMEINFO frameinfo;
211 SIZEL extent;
213 BOOL ui_activated;
215 HWND shell_embedding_hwnd;
217 VARIANT_BOOL register_browser;
218 VARIANT_BOOL visible;
219 VARIANT_BOOL menu_bar;
220 VARIANT_BOOL address_bar;
221 VARIANT_BOOL status_bar;
222 VARIANT_BOOL tool_bar;
223 VARIANT_BOOL full_screen;
224 VARIANT_BOOL theater_mode;
226 DocHost doc_host;
229 struct InternetExplorer {
230 DocHost doc_host;
231 IWebBrowser2 IWebBrowser2_iface;
232 IExternalConnection IExternalConnection_iface;
233 IServiceProvider IServiceProvider_iface;
234 HlinkFrame hlink_frame;
236 LONG ref;
237 LONG extern_ref;
239 HWND frame_hwnd;
240 HWND status_hwnd;
241 HWND toolbar_hwnd;
242 HMENU menu;
243 BOOL nohome;
245 struct list entry;
248 void WebBrowser_OleObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
249 void WebBrowser_ViewObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
250 void WebBrowser_Persist_Init(WebBrowser*) DECLSPEC_HIDDEN;
251 void WebBrowser_ClassInfo_Init(WebBrowser*) DECLSPEC_HIDDEN;
253 void WebBrowser_OleObject_Destroy(WebBrowser*) DECLSPEC_HIDDEN;
255 void DocHost_Init(DocHost*,IWebBrowser2*,const IDocHostContainerVtbl*) DECLSPEC_HIDDEN;
256 void DocHost_Release(DocHost*) DECLSPEC_HIDDEN;
257 void DocHost_ClientSite_Init(DocHost*) DECLSPEC_HIDDEN;
258 void DocHost_ClientSite_Release(DocHost*) DECLSPEC_HIDDEN;
259 void DocHost_Frame_Init(DocHost*) DECLSPEC_HIDDEN;
260 void release_dochost_client(DocHost*) DECLSPEC_HIDDEN;
262 void IEHTMLWindow_Init(DocHost*) DECLSPEC_HIDDEN;
263 void NewWindowManager_Init(DocHost*) DECLSPEC_HIDDEN;
265 void HlinkFrame_Init(HlinkFrame*,IUnknown*,DocHost*) DECLSPEC_HIDDEN;
266 BOOL HlinkFrame_QI(HlinkFrame*,REFIID,void**) DECLSPEC_HIDDEN;
268 HRESULT create_browser_service(DocHost*,ShellBrowser**) DECLSPEC_HIDDEN;
269 void detach_browser_service(ShellBrowser*) DECLSPEC_HIDDEN;
270 HRESULT create_shell_ui_helper(IShellUIHelper2**) DECLSPEC_HIDDEN;
272 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*) DECLSPEC_HIDDEN;
273 void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
275 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN;
276 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
277 HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
278 HRESULT go_back(DocHost*) DECLSPEC_HIDDEN;
279 HRESULT go_forward(DocHost*) DECLSPEC_HIDDEN;
280 HRESULT refresh_document(DocHost*,const VARIANT*) DECLSPEC_HIDDEN;
281 HRESULT get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
282 HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN;
283 void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
284 HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN;
285 void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
286 void activate_document(DocHost*) DECLSPEC_HIDDEN;
287 void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
288 void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
289 void on_commandstate_change(DocHost*,LONG,BOOL) DECLSPEC_HIDDEN;
290 void notify_download_state(DocHost*,BOOL) DECLSPEC_HIDDEN;
291 void update_navigation_commands(DocHost *dochost) DECLSPEC_HIDDEN;
293 #define WM_DOCHOSTTASK (WM_USER+0x300)
294 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
295 void abort_dochost_tasks(DocHost*,task_proc_t) DECLSPEC_HIDDEN;
296 LRESULT process_dochost_tasks(DocHost*) DECLSPEC_HIDDEN;
298 void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN;
299 HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR) DECLSPEC_HIDDEN;
300 void released_obj(void) DECLSPEC_HIDDEN;
301 DWORD release_extern_ref(InternetExplorer*,BOOL) DECLSPEC_HIDDEN;
303 void register_iewindow_class(void) DECLSPEC_HIDDEN;
304 void unregister_iewindow_class(void) DECLSPEC_HIDDEN;
306 #define TID_LIST \
307 XCLSID(WebBrowser) \
308 XCLSID(WebBrowser_V1) \
309 XIID(IWebBrowser2)
311 typedef enum {
312 #define XIID(iface) iface ## _tid,
313 #define XCLSID(class) class ## _tid,
314 TID_LIST
315 #undef XIID
316 #undef XCLSID
317 LAST_tid
318 } tid_t;
320 HRESULT get_typeinfo(tid_t,ITypeInfo**) DECLSPEC_HIDDEN;
322 HRESULT WINAPI CUrlHistory_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
323 HRESULT WINAPI InternetExplorer_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
324 HRESULT WINAPI InternetShortcut_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
325 HRESULT WINAPI WebBrowser_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
326 HRESULT WINAPI WebBrowserV1_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
327 HRESULT WINAPI InternetExplorerManager_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
329 extern IClassFactory InternetExplorerFactory DECLSPEC_HIDDEN;
330 extern IClassFactory InternetExplorerManagerFactory DECLSPEC_HIDDEN;
332 extern LONG module_ref DECLSPEC_HIDDEN;
333 extern HINSTANCE ieframe_instance DECLSPEC_HIDDEN;
335 static inline void lock_module(void) {
336 InterlockedIncrement(&module_ref);
339 static inline void unlock_module(void) {
340 InterlockedDecrement(&module_ref);
343 static inline LPWSTR heap_strdupW(LPCWSTR str)
345 LPWSTR ret = NULL;
347 if(str) {
348 DWORD size;
350 size = (lstrlenW(str)+1)*sizeof(WCHAR);
351 ret = heap_alloc(size);
352 if(ret)
353 memcpy(ret, str, size);
356 return ret;
359 static inline LPWSTR co_strdupW(LPCWSTR str)
361 WCHAR *ret = CoTaskMemAlloc((lstrlenW(str) + 1)*sizeof(WCHAR));
362 if (ret)
363 lstrcpyW(ret, str);
364 return ret;
367 static inline LPWSTR co_strdupAtoW(LPCSTR str)
369 INT len;
370 WCHAR *ret;
371 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
372 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
373 if (ret)
374 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
375 return ret;
378 static inline LPSTR co_strdupWtoA(LPCWSTR str)
380 INT len;
381 CHAR *ret;
382 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
383 ret = CoTaskMemAlloc(len);
384 if (ret)
385 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
386 return ret;
389 enum SessionOp
391 SESSION_QUERY,
392 SESSION_INCREMENT,
393 SESSION_DECREMENT
396 LONG WINAPI SetQueryNetSessionCount(DWORD session_op);