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 {
90 typedef struct _IDocHostContainerVtbl
92 ULONG (*addref)(DocHost*);
93 ULONG (*release)(DocHost*);
94 void (WINAPI* GetDocObjRect)(DocHost*,RECT*);
95 HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR);
96 void (WINAPI* SetURL)(DocHost*,LPCWSTR);
97 HRESULT (*exec)(DocHost*,const GUID*,DWORD,DWORD,VARIANT*,VARIANT*);
98 } IDocHostContainerVtbl;
101 IOleClientSite IOleClientSite_iface;
102 IOleInPlaceSite IOleInPlaceSite_iface;
103 IDocHostUIHandler2 IDocHostUIHandler2_iface;
104 IOleDocumentSite IOleDocumentSite_iface;
105 IOleControlSite IOleControlSite_iface;
106 IOleCommandTarget IOleCommandTarget_iface;
107 IDispatch IDispatch_iface;
108 IPropertyNotifySink IPropertyNotifySink_iface;
109 IServiceProvider IServiceProvider_iface;
111 /* Interfaces of InPlaceFrame object */
112 IOleInPlaceFrame IOleInPlaceFrame_iface;
116 IDispatch *client_disp;
117 IDocHostUIHandler *hostui;
118 IOleInPlaceFrame *frame;
121 IOleDocumentView *view;
122 IUnknown *doc_navigate;
124 const IDocHostContainerVtbl *container_vtbl;
132 VARIANT_BOOL offline;
135 READYSTATE ready_state;
136 READYSTATE doc_state;
137 DWORD prop_notif_cookie;
140 ConnectionPointContainer cps;
144 IWebBrowser2 IWebBrowser2_iface;
145 IOleObject IOleObject_iface;
146 IOleInPlaceObject IOleInPlaceObject_iface;
147 IOleControl IOleControl_iface;
148 IPersistStorage IPersistStorage_iface;
149 IPersistMemory IPersistMemory_iface;
150 IPersistStreamInit IPersistStreamInit_iface;
151 IProvideClassInfo2 IProvideClassInfo2_iface;
152 IViewObject2 IViewObject2_iface;
153 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
154 IOleCommandTarget IOleCommandTarget_iface;
155 IServiceProvider IServiceProvider_iface;
156 IDataObject IDataObject_iface;
157 HlinkFrame hlink_frame;
163 IOleClientSite *client;
164 IOleContainer *container;
165 IOleInPlaceSite *inplace;
170 IOleInPlaceUIWindow *uiwindow;
173 OLEINPLACEFRAMEINFO frameinfo;
176 HWND shell_embedding_hwnd;
178 VARIANT_BOOL register_browser;
179 VARIANT_BOOL visible;
180 VARIANT_BOOL menu_bar;
181 VARIANT_BOOL address_bar;
182 VARIANT_BOOL status_bar;
183 VARIANT_BOOL tool_bar;
184 VARIANT_BOOL full_screen;
185 VARIANT_BOOL theater_mode;
195 InternetExplorer *ie;
198 struct InternetExplorer {
199 IWebBrowser2 IWebBrowser2_iface;
200 HlinkFrame hlink_frame;
213 void WebBrowser_OleObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
214 void WebBrowser_ViewObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
215 void WebBrowser_Persist_Init(WebBrowser*) DECLSPEC_HIDDEN;
216 void WebBrowser_ClassInfo_Init(WebBrowser*) DECLSPEC_HIDDEN;
218 void WebBrowser_OleObject_Destroy(WebBrowser*) DECLSPEC_HIDDEN;
220 void DocHost_Init(DocHost*,IDispatch*,const IDocHostContainerVtbl*) DECLSPEC_HIDDEN;
221 void DocHost_ClientSite_Init(DocHost*) DECLSPEC_HIDDEN;
222 void DocHost_Frame_Init(DocHost*) DECLSPEC_HIDDEN;
223 void release_dochost_client(DocHost*) DECLSPEC_HIDDEN;
225 void DocHost_Release(DocHost*) DECLSPEC_HIDDEN;
226 void DocHost_ClientSite_Release(DocHost*) DECLSPEC_HIDDEN;
228 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*) DECLSPEC_HIDDEN;
229 void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
231 void HlinkFrame_Init(HlinkFrame*,IUnknown*,DocHost*) DECLSPEC_HIDDEN;
232 BOOL HlinkFrame_QI(HlinkFrame*,REFIID,void**) DECLSPEC_HIDDEN;
234 HRESULT ShellBrowser_Create(IShellBrowser**) DECLSPEC_HIDDEN;
235 HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
236 HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
238 void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
239 void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
240 HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN;
241 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN;
242 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
243 HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
244 void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
245 HRESULT get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
246 void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
248 #define WM_DOCHOSTTASK (WM_USER+0x300)
249 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
250 LRESULT process_dochost_task(DocHost*,LPARAM) DECLSPEC_HIDDEN;
252 HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
253 void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN;
255 void released_obj(void) DECLSPEC_HIDDEN;
257 HRESULT CUrlHistory_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
259 HRESULT InternetShortcut_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
261 HRESULT TaskbarList_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
263 /**********************************************************************
264 * Dll lifetime tracking declaration for shdocvw.dll
266 extern LONG SHDOCVW_refCount DECLSPEC_HIDDEN;
267 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
268 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
270 extern HINSTANCE shdocvw_hinstance DECLSPEC_HIDDEN;
271 extern void register_iewindow_class(void) DECLSPEC_HIDDEN;
272 extern void unregister_iewindow_class(void) DECLSPEC_HIDDEN;
273 extern HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR) DECLSPEC_HIDDEN;
275 HRESULT register_class_object(BOOL) DECLSPEC_HIDDEN;
276 HRESULT get_typeinfo(ITypeInfo**) DECLSPEC_HIDDEN;
277 DWORD register_iexplore(BOOL) DECLSPEC_HIDDEN;
279 const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
281 /* memory allocation functions */
283 static inline void *heap_alloc(size_t len)
285 return HeapAlloc(GetProcessHeap(), 0, len);
288 static inline void *heap_alloc_zero(size_t len)
290 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
293 static inline void *heap_realloc(void *mem, size_t len)
295 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
298 static inline BOOL heap_free(void *mem)
300 return HeapFree(GetProcessHeap(), 0, mem);
303 static inline LPWSTR heap_strdupW(LPCWSTR str)
310 size = (strlenW(str)+1)*sizeof(WCHAR);
311 ret = heap_alloc(size);
312 memcpy(ret, str, size);
318 static inline LPWSTR co_strdupW(LPCWSTR str)
320 WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
326 static inline LPWSTR co_strdupAtoW(LPCSTR str)
330 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
331 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
333 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
337 static inline LPSTR co_strdupWtoA(LPCWSTR str)
341 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
342 ret = CoTaskMemAlloc(len);
344 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
348 #endif /* __WINE_SHDOCVW_H */