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
37 #include "shdeprecated.h"
38 #include "docobjectservice.h"
40 #include "wine/list.h"
42 typedef struct ConnectionPoint ConnectionPoint
;
43 typedef struct DocHost DocHost
;
46 IConnectionPointContainer IConnectionPointContainer_iface
;
48 ConnectionPoint
*wbe2
;
53 } ConnectionPointContainer
;
56 IHlinkFrame IHlinkFrame_iface
;
57 ITargetFrame ITargetFrame_iface
;
58 ITargetFrame2 ITargetFrame2_iface
;
59 ITargetFramePriv2 ITargetFramePriv2_iface
;
60 IWebBrowserPriv2IE9 IWebBrowserPriv2IE9_iface
;
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
{
78 IShellBrowser IShellBrowser_iface
;
79 IBrowserService IBrowserService_iface
;
80 IDocObjectService IDocObjectService_iface
;
88 IHTMLWindow2 IHTMLWindow2_iface
;
93 INewWindowManager INewWindowManager_iface
;
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
;
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
;
128 IDispatch
*client_disp
;
129 IDocHostUIHandler
*hostui
;
130 IOleInPlaceFrame
*frame
;
131 IOleCommandTarget
*olecmd
;
134 IOleDocumentView
*view
;
135 IUnknown
*doc_navigate
;
137 const IDocHostContainerVtbl
*container_vtbl
;
142 struct list task_queue
;
147 VARIANT_BOOL offline
;
150 READYSTATE ready_state
;
151 READYSTATE doc_state
;
152 DWORD prop_notif_cookie
;
155 ShellBrowser
*browser_service
;
156 IShellUIHelper2
*shell_ui_helper
;
159 travellog_entry_t
*log
;
166 ConnectionPointContainer cps
;
167 IEHTMLWindow html_window
;
168 NewWindowManager nwm
;
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
;
192 IOleClientSite
*client
;
193 IOleClientSite
*client_closed
;
194 IOleContainer
*container
;
195 IOleInPlaceSiteEx
*inplace
;
201 IOleAdviseHolder
*advise_holder
;
206 IOleInPlaceUIWindow
*uiwindow
;
209 OLEINPLACEFRAMEINFO frameinfo
;
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
;
228 struct InternetExplorer
{
230 IWebBrowser2 IWebBrowser2_iface
;
231 IExternalConnection IExternalConnection_iface
;
232 IServiceProvider IServiceProvider_iface
;
233 HlinkFrame hlink_frame
;
247 void WebBrowser_OleObject_Init(WebBrowser
*);
248 void WebBrowser_ViewObject_Init(WebBrowser
*);
249 void WebBrowser_Persist_Init(WebBrowser
*);
250 void WebBrowser_ClassInfo_Init(WebBrowser
*);
252 void WebBrowser_OleObject_Destroy(WebBrowser
*);
254 void DocHost_Init(DocHost
*,IWebBrowser2
*,const IDocHostContainerVtbl
*);
255 void DocHost_Release(DocHost
*);
256 void DocHost_ClientSite_Init(DocHost
*);
257 void DocHost_ClientSite_Release(DocHost
*);
258 void DocHost_Frame_Init(DocHost
*);
259 void release_dochost_client(DocHost
*);
261 void IEHTMLWindow_Init(DocHost
*);
262 void NewWindowManager_Init(DocHost
*);
264 void HlinkFrame_Init(HlinkFrame
*,IUnknown
*,DocHost
*);
265 BOOL
HlinkFrame_QI(HlinkFrame
*,REFIID
,void**);
267 HRESULT
create_browser_service(DocHost
*,ShellBrowser
**);
268 void detach_browser_service(ShellBrowser
*);
269 HRESULT
create_shell_ui_helper(IShellUIHelper2
**);
271 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
272 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
274 void call_sink(ConnectionPoint
*,DISPID
,DISPPARAMS
*);
275 HRESULT
navigate_url(DocHost
*,LPCWSTR
,const VARIANT
*,const VARIANT
*,VARIANT
*,VARIANT
*);
276 HRESULT
go_home(DocHost
*);
277 HRESULT
go_back(DocHost
*);
278 HRESULT
go_forward(DocHost
*);
279 HRESULT
refresh_document(DocHost
*,const VARIANT
*);
280 HRESULT
get_window(DocHost
*,IHTMLWindow2
**);
281 HRESULT
get_location_url(DocHost
*,BSTR
*);
282 HRESULT
set_dochost_url(DocHost
*,const WCHAR
*);
283 void handle_navigation_error(DocHost
*,HRESULT
,BSTR
,IHTMLWindow2
*);
284 const WCHAR
*error_url_frag(const WCHAR
*);
285 HRESULT
dochost_object_available(DocHost
*,IUnknown
*);
286 void set_doc_state(DocHost
*,READYSTATE
);
287 void activate_document(DocHost
*);
288 void deactivate_document(DocHost
*);
289 void create_doc_view_hwnd(DocHost
*);
290 void on_commandstate_change(DocHost
*,LONG
,BOOL
);
291 void notify_download_state(DocHost
*,BOOL
);
292 void update_navigation_commands(DocHost
*dochost
);
294 #define WM_DOCHOSTTASK (WM_USER+0x300)
295 void push_dochost_task(DocHost
*,task_header_t
*,task_proc_t
,task_destr_t
,BOOL
);
296 void abort_dochost_tasks(DocHost
*,task_proc_t
);
297 LRESULT
process_dochost_tasks(DocHost
*);
299 void InternetExplorer_WebBrowser_Init(InternetExplorer
*);
300 HRESULT
update_ie_statustext(InternetExplorer
*, LPCWSTR
);
301 void released_obj(void);
302 DWORD
release_extern_ref(InternetExplorer
*,BOOL
);
304 void register_iewindow_class(void);
305 void unregister_iewindow_class(void);
309 XCLSID(WebBrowser_V1) \
313 #define XIID(iface) iface ## _tid,
314 #define XCLSID(class) class ## _tid,
321 HRESULT
get_typeinfo(tid_t
,ITypeInfo
**);
323 HRESULT WINAPI
CUrlHistory_Create(IClassFactory
*,IUnknown
*,REFIID
,void**);
324 HRESULT WINAPI
InternetExplorer_Create(IClassFactory
*,IUnknown
*,REFIID
,void**);
325 HRESULT WINAPI
InternetShortcut_Create(IClassFactory
*,IUnknown
*,REFIID
,void**);
326 HRESULT WINAPI
WebBrowser_Create(IClassFactory
*,IUnknown
*,REFIID
,void**);
327 HRESULT WINAPI
WebBrowserV1_Create(IClassFactory
*,IUnknown
*,REFIID
,void**);
328 HRESULT WINAPI
InternetExplorerManager_Create(IClassFactory
*,IUnknown
*,REFIID
,void**);
330 extern IClassFactory InternetExplorerFactory
;
331 extern IClassFactory InternetExplorerManagerFactory
;
333 extern LONG module_ref
;
334 extern HINSTANCE ieframe_instance
;
336 static inline void lock_module(void) {
337 InterlockedIncrement(&module_ref
);
340 static inline void unlock_module(void) {
341 InterlockedDecrement(&module_ref
);
344 static inline LPWSTR
co_strdupW(LPCWSTR str
)
346 WCHAR
*ret
= CoTaskMemAlloc((lstrlenW(str
) + 1)*sizeof(WCHAR
));
352 static inline LPWSTR
co_strdupAtoW(LPCSTR str
)
356 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
357 ret
= CoTaskMemAlloc(len
*sizeof(WCHAR
));
359 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
363 static inline LPSTR
co_strdupWtoA(LPCWSTR str
)
367 len
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, 0, 0);
368 ret
= CoTaskMemAlloc(len
);
370 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, len
, 0, 0);
381 LONG WINAPI
SetQueryNetSessionCount(DWORD session_op
);