kernelbase/tests: Use win_skip() for missing APIs.
[wine.git] / dlls / ieframe / ieframe.h
blob9a42bd801df371ca5ec3292cc8d45403f2e92a70
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/list.h"
42 typedef struct ConnectionPoint ConnectionPoint;
43 typedef struct DocHost DocHost;
45 typedef struct {
46 IConnectionPointContainer IConnectionPointContainer_iface;
48 ConnectionPoint *wbe2;
49 ConnectionPoint *wbe;
50 ConnectionPoint *pns;
52 IUnknown *impl;
53 } ConnectionPointContainer;
55 typedef struct {
56 IHlinkFrame IHlinkFrame_iface;
57 ITargetFrame ITargetFrame_iface;
58 ITargetFrame2 ITargetFrame2_iface;
59 ITargetFramePriv2 ITargetFramePriv2_iface;
60 IWebBrowserPriv2IE9 IWebBrowserPriv2IE9_iface;
62 IUnknown *outer;
63 DocHost *doc_host;
64 } HlinkFrame;
66 struct _task_header_t;
68 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
69 typedef void (*task_destr_t)(struct _task_header_t*);
71 typedef struct _task_header_t {
72 struct list entry;
73 task_proc_t proc;
74 task_destr_t destr;
75 } task_header_t;
77 typedef struct {
78 IShellBrowser IShellBrowser_iface;
79 IBrowserService IBrowserService_iface;
80 IDocObjectService IDocObjectService_iface;
82 LONG ref;
84 DocHost *doc_host;
85 } ShellBrowser;
87 typedef struct {
88 IHTMLWindow2 IHTMLWindow2_iface;
89 DocHost *doc_host;
90 } IEHTMLWindow;
92 typedef struct {
93 INewWindowManager INewWindowManager_iface;
94 DocHost *doc_host;
95 } NewWindowManager;
97 typedef struct {
98 WCHAR *url;
99 IStream *stream;
100 } travellog_entry_t;
102 typedef struct _IDocHostContainerVtbl
104 ULONG (*addref)(DocHost*);
105 ULONG (*release)(DocHost*);
106 void (*get_docobj_rect)(DocHost*,RECT*);
107 HRESULT (*set_status_text)(DocHost*,const WCHAR*);
108 void (*on_command_state_change)(DocHost*,LONG,BOOL);
109 void (*set_url)(DocHost*,const WCHAR*);
110 } IDocHostContainerVtbl;
112 struct DocHost {
113 IOleClientSite IOleClientSite_iface;
114 IOleInPlaceSiteEx IOleInPlaceSiteEx_iface;
115 IDocHostUIHandler2 IDocHostUIHandler2_iface;
116 IOleDocumentSite IOleDocumentSite_iface;
117 IOleControlSite IOleControlSite_iface;
118 IOleCommandTarget IOleCommandTarget_iface;
119 IDispatch IDispatch_iface;
120 IPropertyNotifySink IPropertyNotifySink_iface;
121 IServiceProvider IServiceProvider_iface;
123 /* Interfaces of InPlaceFrame object */
124 IOleInPlaceFrame IOleInPlaceFrame_iface;
126 IWebBrowser2 *wb;
128 IDispatch *client_disp;
129 IDocHostUIHandler *hostui;
130 IOleInPlaceFrame *frame;
131 IOleCommandTarget *olecmd;
133 IUnknown *document;
134 IOleDocumentView *view;
135 IUnknown *doc_navigate;
137 const IDocHostContainerVtbl *container_vtbl;
139 HWND hwnd;
140 HWND frame_hwnd;
142 struct list task_queue;
144 LPOLESTR url;
146 VARIANT_BOOL silent;
147 VARIANT_BOOL offline;
148 VARIANT_BOOL busy;
150 READYSTATE ready_state;
151 READYSTATE doc_state;
152 DWORD prop_notif_cookie;
153 BOOL is_prop_notif;
155 ShellBrowser *browser_service;
156 IShellUIHelper2 *shell_ui_helper;
158 struct {
159 travellog_entry_t *log;
160 unsigned size;
161 unsigned length;
162 unsigned position;
163 int loading_pos;
164 } travellog;
166 ConnectionPointContainer cps;
167 IEHTMLWindow html_window;
168 NewWindowManager nwm;
171 struct WebBrowser {
172 IUnknown IUnknown_inner;
173 IWebBrowser2 IWebBrowser2_iface;
174 IOleObject IOleObject_iface;
175 IOleInPlaceObject IOleInPlaceObject_iface;
176 IOleControl IOleControl_iface;
177 IPersistStorage IPersistStorage_iface;
178 IPersistMemory IPersistMemory_iface;
179 IPersistStreamInit IPersistStreamInit_iface;
180 IProvideClassInfo2 IProvideClassInfo2_iface;
181 IViewObject2 IViewObject2_iface;
182 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
183 IOleCommandTarget IOleCommandTarget_iface;
184 IServiceProvider IServiceProvider_iface;
185 IDataObject IDataObject_iface;
186 HlinkFrame hlink_frame;
188 LONG ref;
190 INT version;
192 IOleClientSite *client;
193 IOleClientSite *client_closed;
194 IOleContainer *container;
195 IOleInPlaceSiteEx *inplace;
197 IAdviseSink *sink;
198 DWORD sink_aspects;
199 DWORD sink_flags;
201 IOleAdviseHolder *advise_holder;
203 /* window context */
205 HWND frame_hwnd;
206 IOleInPlaceUIWindow *uiwindow;
207 RECT pos_rect;
208 RECT clip_rect;
209 OLEINPLACEFRAMEINFO frameinfo;
210 SIZEL extent;
212 BOOL ui_activated;
214 HWND shell_embedding_hwnd;
216 VARIANT_BOOL register_browser;
217 VARIANT_BOOL visible;
218 VARIANT_BOOL menu_bar;
219 VARIANT_BOOL address_bar;
220 VARIANT_BOOL status_bar;
221 VARIANT_BOOL tool_bar;
222 VARIANT_BOOL full_screen;
223 VARIANT_BOOL theater_mode;
225 DocHost doc_host;
228 struct InternetExplorer {
229 DocHost doc_host;
230 IWebBrowser2 IWebBrowser2_iface;
231 IExternalConnection IExternalConnection_iface;
232 IServiceProvider IServiceProvider_iface;
233 HlinkFrame hlink_frame;
235 LONG ref;
236 LONG extern_ref;
238 HWND frame_hwnd;
239 HWND status_hwnd;
240 HWND toolbar_hwnd;
241 HMENU menu;
242 BOOL nohome;
244 struct list entry;
247 void WebBrowser_OleObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
248 void WebBrowser_ViewObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
249 void WebBrowser_Persist_Init(WebBrowser*) DECLSPEC_HIDDEN;
250 void WebBrowser_ClassInfo_Init(WebBrowser*) DECLSPEC_HIDDEN;
252 void WebBrowser_OleObject_Destroy(WebBrowser*) DECLSPEC_HIDDEN;
254 void DocHost_Init(DocHost*,IWebBrowser2*,const IDocHostContainerVtbl*) DECLSPEC_HIDDEN;
255 void DocHost_Release(DocHost*) DECLSPEC_HIDDEN;
256 void DocHost_ClientSite_Init(DocHost*) DECLSPEC_HIDDEN;
257 void DocHost_ClientSite_Release(DocHost*) DECLSPEC_HIDDEN;
258 void DocHost_Frame_Init(DocHost*) DECLSPEC_HIDDEN;
259 void release_dochost_client(DocHost*) DECLSPEC_HIDDEN;
261 void IEHTMLWindow_Init(DocHost*) DECLSPEC_HIDDEN;
262 void NewWindowManager_Init(DocHost*) DECLSPEC_HIDDEN;
264 void HlinkFrame_Init(HlinkFrame*,IUnknown*,DocHost*) DECLSPEC_HIDDEN;
265 BOOL HlinkFrame_QI(HlinkFrame*,REFIID,void**) DECLSPEC_HIDDEN;
267 HRESULT create_browser_service(DocHost*,ShellBrowser**) DECLSPEC_HIDDEN;
268 void detach_browser_service(ShellBrowser*) DECLSPEC_HIDDEN;
269 HRESULT create_shell_ui_helper(IShellUIHelper2**) DECLSPEC_HIDDEN;
271 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*) DECLSPEC_HIDDEN;
272 void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
274 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN;
275 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
276 HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
277 HRESULT go_back(DocHost*) DECLSPEC_HIDDEN;
278 HRESULT go_forward(DocHost*) DECLSPEC_HIDDEN;
279 HRESULT refresh_document(DocHost*,const VARIANT*) DECLSPEC_HIDDEN;
280 HRESULT get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
281 HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN;
282 void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
283 HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN;
284 void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
285 void activate_document(DocHost*) DECLSPEC_HIDDEN;
286 void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
287 void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
288 void on_commandstate_change(DocHost*,LONG,BOOL) DECLSPEC_HIDDEN;
289 void notify_download_state(DocHost*,BOOL) DECLSPEC_HIDDEN;
290 void update_navigation_commands(DocHost *dochost) DECLSPEC_HIDDEN;
292 #define WM_DOCHOSTTASK (WM_USER+0x300)
293 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
294 void abort_dochost_tasks(DocHost*,task_proc_t) DECLSPEC_HIDDEN;
295 LRESULT process_dochost_tasks(DocHost*) DECLSPEC_HIDDEN;
297 void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN;
298 HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR) DECLSPEC_HIDDEN;
299 void released_obj(void) DECLSPEC_HIDDEN;
300 DWORD release_extern_ref(InternetExplorer*,BOOL) DECLSPEC_HIDDEN;
302 void register_iewindow_class(void) DECLSPEC_HIDDEN;
303 void unregister_iewindow_class(void) DECLSPEC_HIDDEN;
305 #define TID_LIST \
306 XCLSID(WebBrowser) \
307 XCLSID(WebBrowser_V1) \
308 XIID(IWebBrowser2)
310 typedef enum {
311 #define XIID(iface) iface ## _tid,
312 #define XCLSID(class) class ## _tid,
313 TID_LIST
314 #undef XIID
315 #undef XCLSID
316 LAST_tid
317 } tid_t;
319 HRESULT get_typeinfo(tid_t,ITypeInfo**) DECLSPEC_HIDDEN;
321 HRESULT WINAPI CUrlHistory_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
322 HRESULT WINAPI InternetExplorer_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
323 HRESULT WINAPI InternetShortcut_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
324 HRESULT WINAPI WebBrowser_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
325 HRESULT WINAPI WebBrowserV1_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
326 HRESULT WINAPI InternetExplorerManager_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
328 extern IClassFactory InternetExplorerFactory DECLSPEC_HIDDEN;
329 extern IClassFactory InternetExplorerManagerFactory DECLSPEC_HIDDEN;
331 extern LONG module_ref DECLSPEC_HIDDEN;
332 extern HINSTANCE ieframe_instance DECLSPEC_HIDDEN;
334 static inline void lock_module(void) {
335 InterlockedIncrement(&module_ref);
338 static inline void unlock_module(void) {
339 InterlockedDecrement(&module_ref);
342 static inline LPWSTR co_strdupW(LPCWSTR str)
344 WCHAR *ret = CoTaskMemAlloc((lstrlenW(str) + 1)*sizeof(WCHAR));
345 if (ret)
346 lstrcpyW(ret, str);
347 return ret;
350 static inline LPWSTR co_strdupAtoW(LPCSTR str)
352 INT len;
353 WCHAR *ret;
354 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
355 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
356 if (ret)
357 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
358 return ret;
361 static inline LPSTR co_strdupWtoA(LPCWSTR str)
363 INT len;
364 CHAR *ret;
365 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
366 ret = CoTaskMemAlloc(len);
367 if (ret)
368 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
369 return ret;
372 enum SessionOp
374 SESSION_QUERY,
375 SESSION_INCREMENT,
376 SESSION_DECREMENT
379 LONG WINAPI SetQueryNetSessionCount(DWORD session_op);