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
);
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
*);
84 typedef struct _task_header_t
{
88 typedef struct _IDocHostContainerVtbl
90 ULONG (*addref
)(DocHost
*);
91 ULONG (*release
)(DocHost
*);
92 void (WINAPI
* GetDocObjRect
)(DocHost
*,RECT
*);
93 HRESULT (WINAPI
* SetStatusText
)(DocHost
*,LPCWSTR
);
94 void (WINAPI
* SetURL
)(DocHost
*,LPCWSTR
);
95 HRESULT (*exec
)(DocHost
*,const GUID
*,DWORD
,DWORD
,VARIANT
*,VARIANT
*);
96 } IDocHostContainerVtbl
;
99 IOleClientSite IOleClientSite_iface
;
100 IOleInPlaceSite IOleInPlaceSite_iface
;
101 IDocHostUIHandler2 IDocHostUIHandler2_iface
;
102 IOleDocumentSite IOleDocumentSite_iface
;
103 IOleControlSite IOleControlSite_iface
;
104 IOleCommandTarget IOleCommandTarget_iface
;
105 IDispatch IDispatch_iface
;
106 IPropertyNotifySink IPropertyNotifySink_iface
;
107 IServiceProvider IServiceProvider_iface
;
109 /* Interfaces of InPlaceFrame object */
110 IOleInPlaceFrame IOleInPlaceFrame_iface
;
114 IDispatch
*client_disp
;
115 IDocHostUIHandler
*hostui
;
116 IOleInPlaceFrame
*frame
;
119 IOleDocumentView
*view
;
120 IUnknown
*doc_navigate
;
122 const IDocHostContainerVtbl
*container_vtbl
;
130 VARIANT_BOOL offline
;
133 READYSTATE ready_state
;
134 READYSTATE doc_state
;
135 DWORD prop_notif_cookie
;
138 ConnectionPointContainer cps
;
142 IWebBrowser2 IWebBrowser2_iface
;
143 IOleObject IOleObject_iface
;
144 IOleInPlaceObject IOleInPlaceObject_iface
;
145 IOleControl IOleControl_iface
;
146 IPersistStorage IPersistStorage_iface
;
147 IPersistMemory IPersistMemory_iface
;
148 IPersistStreamInit IPersistStreamInit_iface
;
149 IProvideClassInfo2 IProvideClassInfo2_iface
;
150 IViewObject2 IViewObject2_iface
;
151 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface
;
152 IOleCommandTarget IOleCommandTarget_iface
;
153 IServiceProvider IServiceProvider_iface
;
154 IDataObject IDataObject_iface
;
155 HlinkFrame hlink_frame
;
161 IOleClientSite
*client
;
162 IOleContainer
*container
;
163 IOleInPlaceSite
*inplace
;
168 IOleInPlaceUIWindow
*uiwindow
;
171 OLEINPLACEFRAMEINFO frameinfo
;
174 HWND shell_embedding_hwnd
;
176 VARIANT_BOOL register_browser
;
177 VARIANT_BOOL visible
;
178 VARIANT_BOOL menu_bar
;
179 VARIANT_BOOL address_bar
;
180 VARIANT_BOOL status_bar
;
181 VARIANT_BOOL tool_bar
;
182 VARIANT_BOOL full_screen
;
183 VARIANT_BOOL theater_mode
;
193 InternetExplorer
*ie
;
196 struct InternetExplorer
{
197 IWebBrowser2 IWebBrowser2_iface
;
198 HlinkFrame hlink_frame
;
211 void WebBrowser_OleObject_Init(WebBrowser
*);
212 void WebBrowser_ViewObject_Init(WebBrowser
*);
213 void WebBrowser_Persist_Init(WebBrowser
*);
214 void WebBrowser_ClassInfo_Init(WebBrowser
*);
216 void WebBrowser_OleObject_Destroy(WebBrowser
*);
218 void DocHost_Init(DocHost
*,IDispatch
*,const IDocHostContainerVtbl
*);
219 void DocHost_ClientSite_Init(DocHost
*);
220 void DocHost_Frame_Init(DocHost
*);
221 void release_dochost_client(DocHost
*);
223 void DocHost_Release(DocHost
*);
224 void DocHost_ClientSite_Release(DocHost
*);
226 void ConnectionPointContainer_Init(ConnectionPointContainer
*,IUnknown
*);
227 void ConnectionPointContainer_Destroy(ConnectionPointContainer
*);
229 void HlinkFrame_Init(HlinkFrame
*,IUnknown
*,DocHost
*);
230 BOOL
HlinkFrame_QI(HlinkFrame
*,REFIID
,void**);
232 HRESULT
WebBrowserV1_Create(IUnknown
*,REFIID
,void**);
233 HRESULT
WebBrowserV2_Create(IUnknown
*,REFIID
,void**);
235 void create_doc_view_hwnd(DocHost
*);
236 void deactivate_document(DocHost
*);
237 HRESULT
dochost_object_available(DocHost
*,IUnknown
*);
238 void call_sink(ConnectionPoint
*,DISPID
,DISPPARAMS
*);
239 HRESULT
navigate_url(DocHost
*,LPCWSTR
,const VARIANT
*,const VARIANT
*,VARIANT
*,VARIANT
*);
240 HRESULT
go_home(DocHost
*);
241 void set_doc_state(DocHost
*,READYSTATE
);
242 HRESULT
get_location_url(DocHost
*,BSTR
*);
244 #define WM_DOCHOSTTASK (WM_USER+0x300)
245 void push_dochost_task(DocHost
*,task_header_t
*,task_proc_t
,BOOL
);
246 LRESULT
process_dochost_task(DocHost
*,LPARAM
);
248 HRESULT
InternetExplorer_Create(IUnknown
*,REFIID
,void**);
249 void InternetExplorer_WebBrowser_Init(InternetExplorer
*);
251 void released_obj(void);
253 HRESULT
CUrlHistory_Create(IUnknown
*,REFIID
,void**);
255 HRESULT
InternetShortcut_Create(IUnknown
*,REFIID
,void**);
257 HRESULT
TaskbarList_Create(IUnknown
*,REFIID
,void**);
259 /**********************************************************************
260 * Dll lifetime tracking declaration for shdocvw.dll
262 extern LONG SHDOCVW_refCount
;
263 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount
); }
264 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount
); }
266 extern HINSTANCE shdocvw_hinstance
;
267 extern void register_iewindow_class(void);
268 extern void unregister_iewindow_class(void);
269 extern HRESULT
update_ie_statustext(InternetExplorer
*, LPCWSTR
);
271 HRESULT
register_class_object(BOOL
);
272 HRESULT
get_typeinfo(ITypeInfo
**);
273 DWORD
register_iexplore(BOOL
);
275 const char *debugstr_variant(const VARIANT
*);
277 /* memory allocation functions */
279 static inline void *heap_alloc(size_t len
)
281 return HeapAlloc(GetProcessHeap(), 0, len
);
284 static inline void *heap_alloc_zero(size_t len
)
286 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY
, len
);
289 static inline void *heap_realloc(void *mem
, size_t len
)
291 return HeapReAlloc(GetProcessHeap(), 0, mem
, len
);
294 static inline BOOL
heap_free(void *mem
)
296 return HeapFree(GetProcessHeap(), 0, mem
);
299 static inline LPWSTR
heap_strdupW(LPCWSTR str
)
306 size
= (strlenW(str
)+1)*sizeof(WCHAR
);
307 ret
= heap_alloc(size
);
308 memcpy(ret
, str
, size
);
314 static inline LPWSTR
co_strdupW(LPCWSTR str
)
316 WCHAR
*ret
= CoTaskMemAlloc((strlenW(str
) + 1)*sizeof(WCHAR
));
322 static inline LPWSTR
co_strdupAtoW(LPCSTR str
)
326 len
= MultiByteToWideChar(CP_ACP
, 0, str
, -1, NULL
, 0);
327 ret
= CoTaskMemAlloc(len
*sizeof(WCHAR
));
329 MultiByteToWideChar(CP_ACP
, 0, str
, -1, ret
, len
);
333 static inline LPSTR
co_strdupWtoA(LPCWSTR str
)
337 len
= WideCharToMultiByte(CP_ACP
, 0, str
, -1, NULL
, 0, 0, 0);
338 ret
= CoTaskMemAlloc(len
);
340 WideCharToMultiByte(CP_ACP
, 0, str
, -1, ret
, len
, 0, 0);
344 #endif /* __WINE_SHDOCVW_H */