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
41 #include "wine/unicode.h"
43 /**********************************************************************
44 * Shell Instance Objects
46 extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
47 REFIID riid, LPVOID *ppvClassObj);
49 /**********************************************************************
50 * WebBrowser declaration for SHDOCVW.DLL
53 typedef struct ConnectionPoint ConnectionPoint;
54 typedef struct DocHost DocHost;
57 const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
59 ConnectionPoint *wbe2;
64 } ConnectionPointContainer;
66 struct _task_header_t;
68 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
70 typedef struct _task_header_t {
75 const IOleClientSiteVtbl *lpOleClientSiteVtbl;
76 const IOleInPlaceSiteVtbl *lpOleInPlaceSiteVtbl;
77 const IDocHostUIHandler2Vtbl *lpDocHostUIHandlerVtbl;
78 const IOleDocumentSiteVtbl *lpOleDocumentSiteVtbl;
79 const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
80 const IDispatchVtbl *lpDispatchVtbl;
81 const IPropertyNotifySinkVtbl *lpIPropertyNotifySinkVtbl;
82 const IServiceProviderVtbl *lpServiceProviderVtbl;
84 /* Interfaces of InPlaceFrame object */
85 const IOleInPlaceFrameVtbl *lpOleInPlaceFrameVtbl;
89 IDispatch *client_disp;
90 IDocHostUIHandler *hostui;
91 IOleInPlaceFrame *frame;
94 IOleDocumentView *view;
102 VARIANT_BOOL offline;
105 READYSTATE ready_state;
106 DWORD prop_notif_cookie;
109 ConnectionPointContainer cps;
113 /* Interfaces available via WebBrowser object */
115 const IWebBrowser2Vtbl *lpWebBrowser2Vtbl;
116 const IOleObjectVtbl *lpOleObjectVtbl;
117 const IOleInPlaceObjectVtbl *lpOleInPlaceObjectVtbl;
118 const IOleControlVtbl *lpOleControlVtbl;
119 const IPersistStorageVtbl *lpPersistStorageVtbl;
120 const IPersistMemoryVtbl *lpPersistMemoryVtbl;
121 const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
122 const IProvideClassInfo2Vtbl *lpProvideClassInfoVtbl;
123 const IViewObject2Vtbl *lpViewObjectVtbl;
124 const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl;
125 const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
126 const IHlinkFrameVtbl *lpHlinkFrameVtbl;
127 const IServiceProviderVtbl *lpServiceProviderVtbl;
133 IOleClientSite *client;
134 IOleContainer *container;
135 IOleInPlaceSite *inplace;
140 IOleInPlaceUIWindow *uiwindow;
143 OLEINPLACEFRAMEINFO frameinfo;
146 HWND shell_embedding_hwnd;
148 VARIANT_BOOL register_browser;
149 VARIANT_BOOL visible;
150 VARIANT_BOOL menu_bar;
151 VARIANT_BOOL address_bar;
152 VARIANT_BOOL status_bar;
153 VARIANT_BOOL tool_bar;
154 VARIANT_BOOL full_screen;
155 VARIANT_BOOL theater_mode;
160 struct InternetExplorer {
161 const IWebBrowser2Vtbl *lpWebBrowser2Vtbl;
170 #define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
171 #define WEBBROWSER2(x) ((IWebBrowser2*) &(x)->lpWebBrowser2Vtbl)
172 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
173 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
174 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
175 #define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
176 #define PERMEMORY(x) ((IPersistMemory*) &(x)->lpPersistMemoryVtbl)
177 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
178 #define CLASSINFO(x) ((IProvideClassInfo2*) &(x)->lpProvideClassInfoVtbl)
179 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
180 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl);
181 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl);
182 #define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
183 #define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
184 #define HLINKFRAME(x) ((IHlinkFrame*) &(x)->lpHlinkFrameVtbl)
186 #define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpOleClientSiteVtbl)
187 #define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpOleInPlaceSiteVtbl)
188 #define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpDocHostUIHandlerVtbl)
189 #define DOCHOSTUI2(x) ((IDocHostUIHandler2*) &(x)->lpDocHostUIHandlerVtbl)
190 #define DOCSITE(x) ((IOleDocumentSite*) &(x)->lpOleDocumentSiteVtbl)
191 #define CLDISP(x) ((IDispatch*) &(x)->lpDispatchVtbl)
192 #define PROPNOTIF(x) ((IPropertyNotifySink*) &(x)->lpIPropertyNotifySinkVtbl)
193 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
195 #define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpOleInPlaceFrameVtbl)
197 void WebBrowser_OleObject_Init(WebBrowser*);
198 void WebBrowser_ViewObject_Init(WebBrowser*);
199 void WebBrowser_Persist_Init(WebBrowser*);
200 void WebBrowser_ClassInfo_Init(WebBrowser*);
201 void WebBrowser_HlinkFrame_Init(WebBrowser*);
203 void WebBrowser_OleObject_Destroy(WebBrowser*);
205 void DocHost_Init(DocHost*,IDispatch*);
206 void DocHost_ClientSite_Init(DocHost*);
207 void DocHost_Frame_Init(DocHost*);
209 void DocHost_Release(DocHost*);
210 void DocHost_ClientSite_Release(DocHost*);
212 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
213 void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
215 HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**);
216 HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**);
218 void create_doc_view_hwnd(DocHost*);
219 void deactivate_document(DocHost*);
220 HRESULT dochost_object_available(DocHost*,IUnknown*);
221 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*);
222 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*);
223 HRESULT go_home(DocHost*);
225 #define WM_DOCHOSTTASK (WM_USER+0x300)
226 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,BOOL);
227 LRESULT process_dochost_task(DocHost*,LPARAM);
229 HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**);
230 void InternetExplorer_WebBrowser_Init(InternetExplorer*);
232 HRESULT CUrlHistory_Create(IUnknown*,REFIID,void**);
234 HRESULT InternetShortcut_Create(IUnknown*,REFIID,void**);
236 HRESULT TaskbarList_Create(IUnknown*,REFIID,void**);
238 #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
240 /**********************************************************************
241 * Dll lifetime tracking declaration for shdocvw.dll
243 extern LONG SHDOCVW_refCount;
244 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
245 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
247 extern HINSTANCE shdocvw_hinstance;
248 extern void register_iewindow_class(void);
249 extern void unregister_iewindow_class(void);
251 HRESULT register_class_object(BOOL);
252 HRESULT get_typeinfo(ITypeInfo**);
253 DWORD register_iexplore(BOOL);
255 /* memory allocation functions */
257 static inline void *heap_alloc(size_t len)
259 return HeapAlloc(GetProcessHeap(), 0, len);
262 static inline void *heap_realloc(void *mem, size_t len)
264 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
267 static inline BOOL heap_free(void *mem)
269 return HeapFree(GetProcessHeap(), 0, mem);
272 static inline LPWSTR heap_strdupW(LPCWSTR str)
279 size = (strlenW(str)+1)*sizeof(WCHAR);
280 ret = heap_alloc(size);
281 memcpy(ret, str, size);
287 static inline LPWSTR co_strdupW(LPCWSTR str)
289 WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
295 static inline LPWSTR co_strdupAtoW(LPCSTR str)
299 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
300 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
302 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
306 static inline LPSTR co_strdupWtoA(LPCWSTR str)
310 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
311 ret = CoTaskMemAlloc(len);
313 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
317 #endif /* __WINE_SHDOCVW_H */