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
25 #define WIN32_NO_STATUS
27 #define COM_NO_WINDOWS_H
36 //#include "winuser.h"
49 #include <wine/unicode.h>
53 #define WM_UPDATEADDRBAR (WM_APP+1)
55 /**********************************************************************
56 * Shell Instance Objects
58 extern HRESULT
SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid
,
59 REFIID riid
, LPVOID
*ppvClassObj
);
61 /**********************************************************************
62 * WebBrowser declaration for SHDOCVW.DLL
65 typedef struct ConnectionPoint ConnectionPoint
;
66 typedef struct DocHost DocHost
;
69 const IConnectionPointContainerVtbl
*lpConnectionPointContainerVtbl
;
71 ConnectionPoint
*wbe2
;
76 } ConnectionPointContainer
;
79 const IHlinkFrameVtbl
*lpIHlinkFrameVtbl
;
80 const ITargetFrame2Vtbl
*lpITargetFrame2Vtbl
;
86 struct _task_header_t
;
88 typedef void (*task_proc_t
)(DocHost
*, struct _task_header_t
*);
90 typedef struct _task_header_t
{
94 typedef struct _IDocHostContainerVtbl
96 void (WINAPI
* GetDocObjRect
)(DocHost
*,RECT
*);
97 HRESULT (WINAPI
* SetStatusText
)(DocHost
*,LPCWSTR
);
98 void (WINAPI
* SetURL
)(DocHost
*,LPCWSTR
);
99 HRESULT (*exec
)(DocHost
*,const GUID
*,DWORD
,DWORD
,VARIANT
*,VARIANT
*);
100 } IDocHostContainerVtbl
;
103 const IOleClientSiteVtbl
*lpOleClientSiteVtbl
;
104 const IOleInPlaceSiteVtbl
*lpOleInPlaceSiteVtbl
;
105 const IDocHostUIHandler2Vtbl
*lpDocHostUIHandlerVtbl
;
106 const IOleDocumentSiteVtbl
*lpOleDocumentSiteVtbl
;
107 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
108 const IDispatchVtbl
*lpDispatchVtbl
;
109 const IPropertyNotifySinkVtbl
*lpIPropertyNotifySinkVtbl
;
110 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
112 /* Interfaces of InPlaceFrame object */
113 const IOleInPlaceFrameVtbl
*lpOleInPlaceFrameVtbl
;
117 IDispatch
*client_disp
;
118 IDocHostUIHandler
*hostui
;
119 IOleInPlaceFrame
*frame
;
122 IOleDocumentView
*view
;
123 IUnknown
*doc_navigate
;
125 const IDocHostContainerVtbl
*container_vtbl
;
133 VARIANT_BOOL offline
;
136 READYSTATE ready_state
;
137 READYSTATE doc_state
;
138 DWORD prop_notif_cookie
;
141 ConnectionPointContainer cps
;
145 /* Interfaces available via WebBrowser object */
147 const IWebBrowser2Vtbl
*lpWebBrowser2Vtbl
;
148 const IOleObjectVtbl
*lpOleObjectVtbl
;
149 const IOleInPlaceObjectVtbl
*lpOleInPlaceObjectVtbl
;
150 const IOleControlVtbl
*lpOleControlVtbl
;
151 const IPersistStorageVtbl
*lpPersistStorageVtbl
;
152 const IPersistMemoryVtbl
*lpPersistMemoryVtbl
;
153 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
154 const IProvideClassInfo2Vtbl
*lpProvideClassInfoVtbl
;
155 const IViewObject2Vtbl
*lpViewObjectVtbl
;
156 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
157 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
158 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
159 const IDataObjectVtbl
*lpDataObjectVtbl
;
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
;
193 struct InternetExplorer
{
194 const IWebBrowser2Vtbl
*lpWebBrowser2Vtbl
;
195 HlinkFrame hlink_frame
;
206 #define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
207 #define WEBBROWSER2(x) ((IWebBrowser2*) &(x)->lpWebBrowser2Vtbl)
208 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
209 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
210 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
211 #define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
212 #define PERMEMORY(x) ((IPersistMemory*) &(x)->lpPersistMemoryVtbl)
213 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
214 #define CLASSINFO(x) ((IProvideClassInfo2*) &(x)->lpProvideClassInfoVtbl)
215 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
216 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl);
217 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl);
218 #define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
219 #define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
220 #define DATAOBJECT(x) ((IDataObject*) &(x)->lpDataObjectVtbl)
222 #define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpOleClientSiteVtbl)
223 #define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpOleInPlaceSiteVtbl)
224 #define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpDocHostUIHandlerVtbl)
225 #define DOCHOSTUI2(x) ((IDocHostUIHandler2*) &(x)->lpDocHostUIHandlerVtbl)
226 #define DOCSITE(x) ((IOleDocumentSite*) &(x)->lpOleDocumentSiteVtbl)
227 #define CLDISP(x) ((IDispatch*) &(x)->lpDispatchVtbl)
228 #define PROPNOTIF(x) ((IPropertyNotifySink*) &(x)->lpIPropertyNotifySinkVtbl)
229 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
231 #define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpOleInPlaceFrameVtbl)
233 #define HLINKFRAME(x) ((IHlinkFrame*) &(x)->lpIHlinkFrameVtbl)
234 #define TARGETFRAME2(x) ((ITargetFrame2*) &(x)->lpITargetFrame2Vtbl)
236 void WebBrowser_OleObject_Init(WebBrowser
*);
237 void WebBrowser_ViewObject_Init(WebBrowser
*);
238 void WebBrowser_DataObject_Init(WebBrowser
*);
239 void WebBrowser_Persist_Init(WebBrowser
*);
240 void WebBrowser_ClassInfo_Init(WebBrowser
*);
242 void WebBrowser_OleObject_Destroy(WebBrowser
*);
244 void DocHost_Init(DocHost
*,IDispatch
*,const IDocHostContainerVtbl
*);
245 void DocHost_ClientSite_Init(DocHost
*);
246 void DocHost_Frame_Init(DocHost
*);
247 void release_dochost_client(DocHost
*);
249 void DocHost_Release(DocHost
*);
250 void DocHost_ClientSite_Release(DocHost
*);
252 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
253 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
255 void HlinkFrame_Init(HlinkFrame
*,IUnknown
*,DocHost
*);
256 BOOL
HlinkFrame_QI(HlinkFrame
*,REFIID
,void**);
258 HRESULT
WebBrowserV1_Create(IUnknown
*,REFIID
,void**);
259 HRESULT
WebBrowserV2_Create(IUnknown
*,REFIID
,void**);
261 void create_doc_view_hwnd(DocHost
*);
262 void deactivate_document(DocHost
*);
263 HRESULT
dochost_object_available(DocHost
*,IUnknown
*);
264 void call_sink(ConnectionPoint
*,DISPID
,DISPPARAMS
*);
265 HRESULT
navigate_url(DocHost
*,LPCWSTR
,const VARIANT
*,const VARIANT
*,VARIANT
*,VARIANT
*);
266 HRESULT
go_home(DocHost
*);
267 void set_doc_state(DocHost
*,READYSTATE
);
269 #define WM_DOCHOSTTASK (WM_USER+0x300)
270 void push_dochost_task(DocHost
*,task_header_t
*,task_proc_t
,BOOL
);
271 LRESULT
process_dochost_task(DocHost
*,LPARAM
);
273 HRESULT
InternetExplorer_Create(IUnknown
*,REFIID
,void**);
274 void InternetExplorer_WebBrowser_Init(InternetExplorer
*);
276 HRESULT
CUrlHistory_Create(IUnknown
*,REFIID
,void**);
278 HRESULT
InternetShortcut_Create(IUnknown
*,REFIID
,void**);
280 HRESULT
TaskbarList_Create(IUnknown
*,REFIID
,void**);
282 #define DEFINE_THIS2(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,ifc)))
283 #define DEFINE_THIS(cls,ifc,iface) DEFINE_THIS2(cls,lp ## ifc ## Vtbl,iface)
285 /**********************************************************************
286 * Dll lifetime tracking declaration for shdocvw.dll
288 extern LONG SHDOCVW_refCount
;
289 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount
); }
290 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount
); }
292 extern HINSTANCE shdocvw_hinstance
;
293 extern void register_iewindow_class(void);
294 extern void unregister_iewindow_class(void);
295 extern HRESULT
update_ie_statustext(InternetExplorer
*, LPCWSTR
);
297 HRESULT
register_class_object(BOOL
);
298 HRESULT
get_typeinfo(ITypeInfo
**);
299 DWORD
register_iexplore(BOOL
);
301 const char *debugstr_variant(const VARIANT
*);
303 /* memory allocation functions */
305 static inline void *heap_alloc(size_t len
)
307 return HeapAlloc(GetProcessHeap(), 0, len
);
310 static inline void *heap_alloc_zero(size_t len
)
312 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
315 static inline void *heap_realloc(void *mem
, size_t len
)
317 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
320 static inline BOOL
heap_free(void *mem
)
322 return HeapFree(GetProcessHeap(), 0, mem
);
325 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
332 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
333 ret
= heap_alloc(size
);
334 memcpy(ret
, str
, size
);
340 static inline LPWSTR
co_strdupW(LPCWSTR str
)
342 WCHAR
*ret
= CoTaskMemAlloc((strlenW(str
) + 1)*sizeof(WCHAR
));
348 static inline LPWSTR
co_strdupAtoW(LPCSTR str
)
352 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
353 ret
= CoTaskMemAlloc(len
*sizeof(WCHAR
));
355 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
359 static inline LPSTR
co_strdupWtoA(LPCWSTR str
)
363 len
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, 0, 0);
364 ret
= CoTaskMemAlloc(len
);
366 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, len
, 0, 0);
370 #endif /* __WINE_SHDOCVW_H */