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"
44 /**********************************************************************
45 * Shell Instance Objects
47 extern HRESULT
SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid
,
48 REFIID riid
, LPVOID
*ppvClassObj
);
50 /**********************************************************************
51 * WebBrowser declaration for SHDOCVW.DLL
54 typedef struct ConnectionPoint ConnectionPoint
;
55 typedef struct DocHost DocHost
;
58 const IConnectionPointContainerVtbl
*lpConnectionPointContainerVtbl
;
60 ConnectionPoint
*wbe2
;
65 } ConnectionPointContainer
;
67 struct _task_header_t
;
69 typedef void (*task_proc_t
)(DocHost
*, struct _task_header_t
*);
71 typedef struct _task_header_t
{
76 const IOleClientSiteVtbl
*lpOleClientSiteVtbl
;
77 const IOleInPlaceSiteVtbl
*lpOleInPlaceSiteVtbl
;
78 const IDocHostUIHandler2Vtbl
*lpDocHostUIHandlerVtbl
;
79 const IOleDocumentSiteVtbl
*lpOleDocumentSiteVtbl
;
80 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
81 const IDispatchVtbl
*lpDispatchVtbl
;
82 const IPropertyNotifySinkVtbl
*lpIPropertyNotifySinkVtbl
;
83 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
85 /* Interfaces of InPlaceFrame object */
86 const IOleInPlaceFrameVtbl
*lpOleInPlaceFrameVtbl
;
90 IDispatch
*client_disp
;
91 IDocHostUIHandler
*hostui
;
92 IOleInPlaceFrame
*frame
;
95 IOleDocumentView
*view
;
96 IUnknown
*doc_navigate
;
104 VARIANT_BOOL offline
;
107 READYSTATE ready_state
;
108 READYSTATE doc_state
;
109 DWORD prop_notif_cookie
;
112 ConnectionPointContainer cps
;
116 /* Interfaces available via WebBrowser object */
118 const IWebBrowser2Vtbl
*lpWebBrowser2Vtbl
;
119 const IOleObjectVtbl
*lpOleObjectVtbl
;
120 const IOleInPlaceObjectVtbl
*lpOleInPlaceObjectVtbl
;
121 const IOleControlVtbl
*lpOleControlVtbl
;
122 const IPersistStorageVtbl
*lpPersistStorageVtbl
;
123 const IPersistMemoryVtbl
*lpPersistMemoryVtbl
;
124 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
125 const IProvideClassInfo2Vtbl
*lpProvideClassInfoVtbl
;
126 const IViewObject2Vtbl
*lpViewObjectVtbl
;
127 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
128 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
129 const IHlinkFrameVtbl
*lpHlinkFrameVtbl
;
130 const ITargetFrame2Vtbl
*lpITargetFrame2Vtbl
;
131 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
132 const IDataObjectVtbl
*lpDataObjectVtbl
;
138 IOleClientSite
*client
;
139 IOleContainer
*container
;
140 IOleInPlaceSite
*inplace
;
145 IOleInPlaceUIWindow
*uiwindow
;
148 OLEINPLACEFRAMEINFO frameinfo
;
151 HWND shell_embedding_hwnd
;
153 VARIANT_BOOL register_browser
;
154 VARIANT_BOOL visible
;
155 VARIANT_BOOL menu_bar
;
156 VARIANT_BOOL address_bar
;
157 VARIANT_BOOL status_bar
;
158 VARIANT_BOOL tool_bar
;
159 VARIANT_BOOL full_screen
;
160 VARIANT_BOOL theater_mode
;
165 struct InternetExplorer
{
166 const IWebBrowser2Vtbl
*lpWebBrowser2Vtbl
;
175 #define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
176 #define WEBBROWSER2(x) ((IWebBrowser2*) &(x)->lpWebBrowser2Vtbl)
177 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
178 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
179 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
180 #define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
181 #define PERMEMORY(x) ((IPersistMemory*) &(x)->lpPersistMemoryVtbl)
182 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
183 #define CLASSINFO(x) ((IProvideClassInfo2*) &(x)->lpProvideClassInfoVtbl)
184 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
185 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl);
186 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl);
187 #define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
188 #define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
189 #define HLINKFRAME(x) ((IHlinkFrame*) &(x)->lpHlinkFrameVtbl)
190 #define DATAOBJECT(x) ((IDataObject*) &(x)->lpDataObjectVtbl)
191 #define TARGETFRAME2(x) ((ITargetFrame2*) &(x)->lpITargetFrame2Vtbl)
193 #define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpOleClientSiteVtbl)
194 #define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpOleInPlaceSiteVtbl)
195 #define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpDocHostUIHandlerVtbl)
196 #define DOCHOSTUI2(x) ((IDocHostUIHandler2*) &(x)->lpDocHostUIHandlerVtbl)
197 #define DOCSITE(x) ((IOleDocumentSite*) &(x)->lpOleDocumentSiteVtbl)
198 #define CLDISP(x) ((IDispatch*) &(x)->lpDispatchVtbl)
199 #define PROPNOTIF(x) ((IPropertyNotifySink*) &(x)->lpIPropertyNotifySinkVtbl)
200 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
202 #define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpOleInPlaceFrameVtbl)
204 void WebBrowser_OleObject_Init(WebBrowser
*);
205 void WebBrowser_ViewObject_Init(WebBrowser
*);
206 void WebBrowser_DataObject_Init(WebBrowser
*);
207 void WebBrowser_Persist_Init(WebBrowser
*);
208 void WebBrowser_ClassInfo_Init(WebBrowser
*);
209 void WebBrowser_HlinkFrame_Init(WebBrowser
*);
211 void WebBrowser_OleObject_Destroy(WebBrowser
*);
213 void DocHost_Init(DocHost
*,IDispatch
*);
214 void DocHost_ClientSite_Init(DocHost
*);
215 void DocHost_Frame_Init(DocHost
*);
216 void release_dochost_client(DocHost
*);
218 void DocHost_Release(DocHost
*);
219 void DocHost_ClientSite_Release(DocHost
*);
221 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
222 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
224 HRESULT
WebBrowserV1_Create(IUnknown
*,REFIID
,void**);
225 HRESULT
WebBrowserV2_Create(IUnknown
*,REFIID
,void**);
227 void create_doc_view_hwnd(DocHost
*);
228 void deactivate_document(DocHost
*);
229 HRESULT
dochost_object_available(DocHost
*,IUnknown
*);
230 void call_sink(ConnectionPoint
*,DISPID
,DISPPARAMS
*);
231 HRESULT
navigate_url(DocHost
*,LPCWSTR
,const VARIANT
*,const VARIANT
*,VARIANT
*,VARIANT
*);
232 HRESULT
go_home(DocHost
*);
233 void set_doc_state(DocHost
*,READYSTATE
);
235 #define WM_DOCHOSTTASK (WM_USER+0x300)
236 void push_dochost_task(DocHost
*,task_header_t
*,task_proc_t
,BOOL
);
237 LRESULT
process_dochost_task(DocHost
*,LPARAM
);
239 HRESULT
InternetExplorer_Create(IUnknown
*,REFIID
,void**);
240 void InternetExplorer_WebBrowser_Init(InternetExplorer
*);
242 HRESULT
CUrlHistory_Create(IUnknown
*,REFIID
,void**);
244 HRESULT
InternetShortcut_Create(IUnknown
*,REFIID
,void**);
246 HRESULT
TaskbarList_Create(IUnknown
*,REFIID
,void**);
248 #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
250 /**********************************************************************
251 * Dll lifetime tracking declaration for shdocvw.dll
253 extern LONG SHDOCVW_refCount
;
254 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount
); }
255 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount
); }
257 extern HINSTANCE shdocvw_hinstance
;
258 extern void register_iewindow_class(void);
259 extern void unregister_iewindow_class(void);
261 HRESULT
register_class_object(BOOL
);
262 HRESULT
get_typeinfo(ITypeInfo
**);
263 DWORD
register_iexplore(BOOL
);
265 const char *debugstr_variant(const VARIANT
*);
267 /* memory allocation functions */
269 static inline void *heap_alloc(size_t len
)
271 return HeapAlloc(GetProcessHeap(), 0, len
);
274 static inline void *heap_alloc_zero(size_t len
)
276 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
279 static inline void *heap_realloc(void *mem
, size_t len
)
281 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
284 static inline BOOL
heap_free(void *mem
)
286 return HeapFree(GetProcessHeap(), 0, mem
);
289 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
296 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
297 ret
= heap_alloc(size
);
298 memcpy(ret
, str
, size
);
304 static inline LPWSTR
co_strdupW(LPCWSTR str
)
306 WCHAR
*ret
= CoTaskMemAlloc((strlenW(str
) + 1)*sizeof(WCHAR
));
312 static inline LPWSTR
co_strdupAtoW(LPCSTR str
)
316 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
317 ret
= CoTaskMemAlloc(len
*sizeof(WCHAR
));
319 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
323 static inline LPSTR
co_strdupWtoA(LPCWSTR str
)
327 len
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, 0, 0);
328 ret
= CoTaskMemAlloc(len
);
330 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, len
, 0, 0);
334 #endif /* __WINE_SHDOCVW_H */