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
;
95 IUnknown
*doc_navigate
;
103 VARIANT_BOOL offline
;
106 READYSTATE ready_state
;
107 READYSTATE doc_state
;
108 DWORD prop_notif_cookie
;
111 ConnectionPointContainer cps
;
115 /* Interfaces available via WebBrowser object */
117 const IWebBrowser2Vtbl
*lpWebBrowser2Vtbl
;
118 const IOleObjectVtbl
*lpOleObjectVtbl
;
119 const IOleInPlaceObjectVtbl
*lpOleInPlaceObjectVtbl
;
120 const IOleControlVtbl
*lpOleControlVtbl
;
121 const IPersistStorageVtbl
*lpPersistStorageVtbl
;
122 const IPersistMemoryVtbl
*lpPersistMemoryVtbl
;
123 const IPersistStreamInitVtbl
*lpPersistStreamInitVtbl
;
124 const IProvideClassInfo2Vtbl
*lpProvideClassInfoVtbl
;
125 const IViewObject2Vtbl
*lpViewObjectVtbl
;
126 const IOleInPlaceActiveObjectVtbl
*lpOleInPlaceActiveObjectVtbl
;
127 const IOleCommandTargetVtbl
*lpOleCommandTargetVtbl
;
128 const IHlinkFrameVtbl
*lpHlinkFrameVtbl
;
129 const IServiceProviderVtbl
*lpServiceProviderVtbl
;
135 IOleClientSite
*client
;
136 IOleContainer
*container
;
137 IOleInPlaceSite
*inplace
;
142 IOleInPlaceUIWindow
*uiwindow
;
145 OLEINPLACEFRAMEINFO frameinfo
;
148 HWND shell_embedding_hwnd
;
150 VARIANT_BOOL register_browser
;
151 VARIANT_BOOL visible
;
152 VARIANT_BOOL menu_bar
;
153 VARIANT_BOOL address_bar
;
154 VARIANT_BOOL status_bar
;
155 VARIANT_BOOL tool_bar
;
156 VARIANT_BOOL full_screen
;
157 VARIANT_BOOL theater_mode
;
162 struct InternetExplorer
{
163 const IWebBrowser2Vtbl
*lpWebBrowser2Vtbl
;
172 #define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
173 #define WEBBROWSER2(x) ((IWebBrowser2*) &(x)->lpWebBrowser2Vtbl)
174 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
175 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
176 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
177 #define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
178 #define PERMEMORY(x) ((IPersistMemory*) &(x)->lpPersistMemoryVtbl)
179 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
180 #define CLASSINFO(x) ((IProvideClassInfo2*) &(x)->lpProvideClassInfoVtbl)
181 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
182 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl);
183 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl);
184 #define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
185 #define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
186 #define HLINKFRAME(x) ((IHlinkFrame*) &(x)->lpHlinkFrameVtbl)
188 #define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpOleClientSiteVtbl)
189 #define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpOleInPlaceSiteVtbl)
190 #define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpDocHostUIHandlerVtbl)
191 #define DOCHOSTUI2(x) ((IDocHostUIHandler2*) &(x)->lpDocHostUIHandlerVtbl)
192 #define DOCSITE(x) ((IOleDocumentSite*) &(x)->lpOleDocumentSiteVtbl)
193 #define CLDISP(x) ((IDispatch*) &(x)->lpDispatchVtbl)
194 #define PROPNOTIF(x) ((IPropertyNotifySink*) &(x)->lpIPropertyNotifySinkVtbl)
195 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
197 #define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpOleInPlaceFrameVtbl)
199 void WebBrowser_OleObject_Init(WebBrowser
*);
200 void WebBrowser_ViewObject_Init(WebBrowser
*);
201 void WebBrowser_Persist_Init(WebBrowser
*);
202 void WebBrowser_ClassInfo_Init(WebBrowser
*);
203 void WebBrowser_HlinkFrame_Init(WebBrowser
*);
205 void WebBrowser_OleObject_Destroy(WebBrowser
*);
207 void DocHost_Init(DocHost
*,IDispatch
*);
208 void DocHost_ClientSite_Init(DocHost
*);
209 void DocHost_Frame_Init(DocHost
*);
210 void release_dochost_client(DocHost
*);
212 void DocHost_Release(DocHost
*);
213 void DocHost_ClientSite_Release(DocHost
*);
215 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
216 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
218 HRESULT
WebBrowserV1_Create(IUnknown
*,REFIID
,void**);
219 HRESULT
WebBrowserV2_Create(IUnknown
*,REFIID
,void**);
221 void create_doc_view_hwnd(DocHost
*);
222 void deactivate_document(DocHost
*);
223 HRESULT
dochost_object_available(DocHost
*,IUnknown
*);
224 void call_sink(ConnectionPoint
*,DISPID
,DISPPARAMS
*);
225 HRESULT
navigate_url(DocHost
*,LPCWSTR
,const VARIANT
*,const VARIANT
*,VARIANT
*,VARIANT
*);
226 HRESULT
go_home(DocHost
*);
227 void set_doc_state(DocHost
*,READYSTATE
);
229 #define WM_DOCHOSTTASK (WM_USER+0x300)
230 void push_dochost_task(DocHost
*,task_header_t
*,task_proc_t
,BOOL
);
231 LRESULT
process_dochost_task(DocHost
*,LPARAM
);
233 HRESULT
InternetExplorer_Create(IUnknown
*,REFIID
,void**);
234 void InternetExplorer_WebBrowser_Init(InternetExplorer
*);
236 HRESULT
CUrlHistory_Create(IUnknown
*,REFIID
,void**);
238 HRESULT
InternetShortcut_Create(IUnknown
*,REFIID
,void**);
240 HRESULT
TaskbarList_Create(IUnknown
*,REFIID
,void**);
242 #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
244 /**********************************************************************
245 * Dll lifetime tracking declaration for shdocvw.dll
247 extern LONG SHDOCVW_refCount
;
248 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount
); }
249 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount
); }
251 extern HINSTANCE shdocvw_hinstance
;
252 extern void register_iewindow_class(void);
253 extern void unregister_iewindow_class(void);
255 HRESULT
register_class_object(BOOL
);
256 HRESULT
get_typeinfo(ITypeInfo
**);
257 DWORD
register_iexplore(BOOL
);
259 const char *debugstr_variant(const VARIANT
*);
261 /* memory allocation functions */
263 static inline void *heap_alloc(size_t len
)
265 return HeapAlloc(GetProcessHeap(), 0, len
);
268 static inline void *heap_alloc_zero(size_t len
)
270 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
273 static inline void *heap_realloc(void *mem
, size_t len
)
275 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
278 static inline BOOL
heap_free(void *mem
)
280 return HeapFree(GetProcessHeap(), 0, mem
);
283 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
290 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
291 ret
= heap_alloc(size
);
292 memcpy(ret
, str
, size
);
298 static inline LPWSTR
co_strdupW(LPCWSTR str
)
300 WCHAR
*ret
= CoTaskMemAlloc((strlenW(str
) + 1)*sizeof(WCHAR
));
306 static inline LPWSTR
co_strdupAtoW(LPCSTR str
)
310 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
311 ret
= CoTaskMemAlloc(len
*sizeof(WCHAR
));
313 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
317 static inline LPSTR
co_strdupWtoA(LPCWSTR str
)
321 len
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, 0, 0);
322 ret
= CoTaskMemAlloc(len
);
324 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, len
, 0, 0);
328 #endif /* __WINE_SHDOCVW_H */