2 * Header includes for shdocvw.dll
4 * Copyright 2001 John R. Sheets (for CodeWeavers)
5 * Copyright 2005-2006 Jacek Caban for CodeWeavers
7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Lesser General Public
9 * License as published by the Free Software Foundation; either
10 * version 2.1 of the License, or (at your option) any later version.
12 * This library is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 * Lesser General Public License for more details.
17 * You should have received a copy of the GNU Lesser General Public
18 * License along with this library; if not, write to the Free Software
19 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
22 #ifndef __WINE_SHDOCVW_H
23 #define __WINE_SHDOCVW_H
42 #include "wine/unicode.h"
43 #include "wine/list.h"
47 #define WM_UPDATEADDRBAR (WM_APP+1)
49 /**********************************************************************
50 * Shell Instance Objects
52 extern HRESULT
SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid
,
53 REFIID riid
, LPVOID
*ppvClassObj
) DECLSPEC_HIDDEN
;
55 /**********************************************************************
56 * WebBrowser declaration for SHDOCVW.DLL
59 typedef struct ConnectionPoint ConnectionPoint
;
60 typedef struct DocHost DocHost
;
63 IConnectionPointContainer IConnectionPointContainer_iface
;
65 ConnectionPoint
*wbe2
;
70 } ConnectionPointContainer
;
73 IHlinkFrame IHlinkFrame_iface
;
74 ITargetFrame2 ITargetFrame2_iface
;
80 struct _task_header_t
;
82 typedef void (*task_proc_t
)(DocHost
*, struct _task_header_t
*);
83 typedef void (*task_destr_t
)(struct _task_header_t
*);
85 typedef struct _task_header_t
{
91 typedef struct _IDocHostContainerVtbl
93 ULONG (*addref
)(DocHost
*);
94 ULONG (*release
)(DocHost
*);
95 void (WINAPI
* GetDocObjRect
)(DocHost
*,RECT
*);
96 HRESULT (WINAPI
* SetStatusText
)(DocHost
*,LPCWSTR
);
97 void (WINAPI
* SetURL
)(DocHost
*,LPCWSTR
);
98 HRESULT (*exec
)(DocHost
*,const GUID
*,DWORD
,DWORD
,VARIANT
*,VARIANT
*);
99 } IDocHostContainerVtbl
;
102 IOleClientSite IOleClientSite_iface
;
103 IOleInPlaceSite IOleInPlaceSite_iface
;
104 IDocHostUIHandler2 IDocHostUIHandler2_iface
;
105 IOleDocumentSite IOleDocumentSite_iface
;
106 IOleControlSite IOleControlSite_iface
;
107 IOleCommandTarget IOleCommandTarget_iface
;
108 IDispatch IDispatch_iface
;
109 IPropertyNotifySink IPropertyNotifySink_iface
;
110 IServiceProvider IServiceProvider_iface
;
112 /* Interfaces of InPlaceFrame object */
113 IOleInPlaceFrame IOleInPlaceFrame_iface
;
117 IDispatch
*client_disp
;
118 IDocHostUIHandler
*hostui
;
119 IOleInPlaceFrame
*frame
;
122 IOleDocumentView
*view
;
123 IUnknown
*doc_navigate
;
125 const IDocHostContainerVtbl
*container_vtbl
;
130 struct list task_queue
;
135 VARIANT_BOOL offline
;
138 READYSTATE ready_state
;
139 READYSTATE doc_state
;
140 DWORD prop_notif_cookie
;
143 ConnectionPointContainer cps
;
147 IWebBrowser2 IWebBrowser2_iface
;
148 IOleObject IOleObject_iface
;
149 IOleInPlaceObject IOleInPlaceObject_iface
;
150 IOleControl IOleControl_iface
;
151 IPersistStorage IPersistStorage_iface
;
152 IPersistMemory IPersistMemory_iface
;
153 IPersistStreamInit IPersistStreamInit_iface
;
154 IProvideClassInfo2 IProvideClassInfo2_iface
;
155 IViewObject2 IViewObject2_iface
;
156 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface
;
157 IOleCommandTarget IOleCommandTarget_iface
;
158 IServiceProvider IServiceProvider_iface
;
159 IDataObject IDataObject_iface
;
160 HlinkFrame hlink_frame
;
166 IOleClientSite
*client
;
167 IOleContainer
*container
;
168 IOleInPlaceSite
*inplace
;
173 IOleInPlaceUIWindow
*uiwindow
;
176 OLEINPLACEFRAMEINFO frameinfo
;
179 HWND shell_embedding_hwnd
;
181 VARIANT_BOOL register_browser
;
182 VARIANT_BOOL visible
;
183 VARIANT_BOOL menu_bar
;
184 VARIANT_BOOL address_bar
;
185 VARIANT_BOOL status_bar
;
186 VARIANT_BOOL tool_bar
;
187 VARIANT_BOOL full_screen
;
188 VARIANT_BOOL theater_mode
;
198 InternetExplorer
*ie
;
201 struct InternetExplorer
{
202 IWebBrowser2 IWebBrowser2_iface
;
203 HlinkFrame hlink_frame
;
216 void WebBrowser_OleObject_Init(WebBrowser
*) DECLSPEC_HIDDEN
;
217 void WebBrowser_ViewObject_Init(WebBrowser
*) DECLSPEC_HIDDEN
;
218 void WebBrowser_Persist_Init(WebBrowser
*) DECLSPEC_HIDDEN
;
219 void WebBrowser_ClassInfo_Init(WebBrowser
*) DECLSPEC_HIDDEN
;
221 void WebBrowser_OleObject_Destroy(WebBrowser
*) DECLSPEC_HIDDEN
;
223 void DocHost_Init(DocHost
*,IDispatch
*,const IDocHostContainerVtbl
*) DECLSPEC_HIDDEN
;
224 void DocHost_ClientSite_Init(DocHost
*) DECLSPEC_HIDDEN
;
225 void DocHost_Frame_Init(DocHost
*) DECLSPEC_HIDDEN
;
226 void release_dochost_client(DocHost
*) DECLSPEC_HIDDEN
;
228 void DocHost_Release(DocHost
*) DECLSPEC_HIDDEN
;
229 void DocHost_ClientSite_Release(DocHost
*) DECLSPEC_HIDDEN
;
231 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*) DECLSPEC_HIDDEN
;
232 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*) DECLSPEC_HIDDEN
;
234 void HlinkFrame_Init(HlinkFrame
*,IUnknown
*,DocHost
*) DECLSPEC_HIDDEN
;
235 BOOL
HlinkFrame_QI(HlinkFrame
*,REFIID
,void**) DECLSPEC_HIDDEN
;
237 HRESULT
ShellBrowser_Create(IShellBrowser
**) DECLSPEC_HIDDEN
;
238 HRESULT
WebBrowserV1_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
239 HRESULT
WebBrowserV2_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
241 void create_doc_view_hwnd(DocHost
*) DECLSPEC_HIDDEN
;
242 void deactivate_document(DocHost
*) DECLSPEC_HIDDEN
;
243 HRESULT
dochost_object_available(DocHost
*,IUnknown
*) DECLSPEC_HIDDEN
;
244 void call_sink(ConnectionPoint
*,DISPID
,DISPPARAMS
*) DECLSPEC_HIDDEN
;
245 HRESULT
navigate_url(DocHost
*,LPCWSTR
,const VARIANT
*,const VARIANT
*,VARIANT
*,VARIANT
*) DECLSPEC_HIDDEN
;
246 HRESULT
go_home(DocHost
*) DECLSPEC_HIDDEN
;
247 void set_doc_state(DocHost
*,READYSTATE
) DECLSPEC_HIDDEN
;
248 HRESULT
get_location_url(DocHost
*,BSTR
*) DECLSPEC_HIDDEN
;
249 void handle_navigation_error(DocHost
*,HRESULT
,BSTR
,IHTMLWindow2
*) DECLSPEC_HIDDEN
;
251 #define WM_DOCHOSTTASK (WM_USER+0x300)
252 void push_dochost_task(DocHost
*,task_header_t
*,task_proc_t
,task_destr_t
,BOOL
) DECLSPEC_HIDDEN
;
253 LRESULT
process_dochost_tasks(DocHost
*) DECLSPEC_HIDDEN
;
254 void abort_dochost_tasks(DocHost
*,task_proc_t
) DECLSPEC_HIDDEN
;
256 HRESULT
InternetExplorer_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
257 void InternetExplorer_WebBrowser_Init(InternetExplorer
*) DECLSPEC_HIDDEN
;
259 void released_obj(void) DECLSPEC_HIDDEN
;
261 HRESULT
CUrlHistory_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
263 HRESULT
InternetShortcut_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
265 HRESULT
TaskbarList_Create(IUnknown
*,REFIID
,void**) DECLSPEC_HIDDEN
;
267 /**********************************************************************
268 * Dll lifetime tracking declaration for shdocvw.dll
270 extern LONG SHDOCVW_refCount DECLSPEC_HIDDEN
;
271 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount
); }
272 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount
); }
274 extern HINSTANCE shdocvw_hinstance DECLSPEC_HIDDEN
;
275 extern void register_iewindow_class(void) DECLSPEC_HIDDEN
;
276 extern void unregister_iewindow_class(void) DECLSPEC_HIDDEN
;
277 extern HRESULT
update_ie_statustext(InternetExplorer
*, LPCWSTR
) DECLSPEC_HIDDEN
;
279 HRESULT
register_class_object(BOOL
) DECLSPEC_HIDDEN
;
280 HRESULT
get_typeinfo(ITypeInfo
**) DECLSPEC_HIDDEN
;
281 DWORD
register_iexplore(BOOL
) DECLSPEC_HIDDEN
;
283 const char *debugstr_variant(const VARIANT
*) DECLSPEC_HIDDEN
;
285 /* memory allocation functions */
287 static inline void *heap_alloc(size_t len
)
289 return HeapAlloc(GetProcessHeap(), 0, len
);
292 static inline void *heap_alloc_zero(size_t len
)
294 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
297 static inline void *heap_realloc(void *mem
, size_t len
)
299 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
302 static inline BOOL
heap_free(void *mem
)
304 return HeapFree(GetProcessHeap(), 0, mem
);
307 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
314 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
315 ret
= heap_alloc(size
);
316 memcpy(ret
, str
, size
);
322 static inline LPWSTR
co_strdupW(LPCWSTR str
)
324 WCHAR
*ret
= CoTaskMemAlloc((strlenW(str
) + 1)*sizeof(WCHAR
));
330 static inline LPWSTR
co_strdupAtoW(LPCSTR str
)
334 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
335 ret
= CoTaskMemAlloc(len
*sizeof(WCHAR
));
337 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
341 static inline LPSTR
co_strdupWtoA(LPCWSTR str
)
345 len
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, 0, 0);
346 ret
= CoTaskMemAlloc(len
);
348 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, len
, 0, 0);
352 #endif /* __WINE_SHDOCVW_H */