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"
46 #define WM_UPDATEADDRBAR (WM_APP+1)
48 /**********************************************************************
49 * Shell Instance Objects
51 extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
52 REFIID riid, LPVOID *ppvClassObj);
54 /**********************************************************************
55 * WebBrowser declaration for SHDOCVW.DLL
58 typedef struct ConnectionPoint ConnectionPoint;
59 typedef struct DocHost DocHost;
62 IConnectionPointContainer IConnectionPointContainer_iface;
64 ConnectionPoint *wbe2;
69 } ConnectionPointContainer;
72 IHlinkFrame IHlinkFrame_iface;
73 ITargetFrame2 ITargetFrame2_iface;
79 struct _task_header_t;
81 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
83 typedef struct _task_header_t {
87 typedef struct _IDocHostContainerVtbl
89 void (WINAPI* GetDocObjRect)(DocHost*,RECT*);
90 HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR);
91 void (WINAPI* SetURL)(DocHost*,LPCWSTR);
92 HRESULT (*exec)(DocHost*,const GUID*,DWORD,DWORD,VARIANT*,VARIANT*);
93 } IDocHostContainerVtbl;
96 IOleClientSite IOleClientSite_iface;
97 IOleInPlaceSite IOleInPlaceSite_iface;
98 IDocHostUIHandler2 IDocHostUIHandler2_iface;
99 IOleDocumentSite IOleDocumentSite_iface;
100 IOleControlSite IOleControlSite_iface;
101 IOleCommandTarget IOleCommandTarget_iface;
102 IDispatch IDispatch_iface;
103 IPropertyNotifySink IPropertyNotifySink_iface;
104 IServiceProvider IServiceProvider_iface;
106 /* Interfaces of InPlaceFrame object */
107 IOleInPlaceFrame IOleInPlaceFrame_iface;
111 IDispatch *client_disp;
112 IDocHostUIHandler *hostui;
113 IOleInPlaceFrame *frame;
116 IOleDocumentView *view;
117 IUnknown *doc_navigate;
119 const IDocHostContainerVtbl *container_vtbl;
127 VARIANT_BOOL offline;
130 READYSTATE ready_state;
131 READYSTATE doc_state;
132 DWORD prop_notif_cookie;
135 ConnectionPointContainer cps;
139 IWebBrowser2 IWebBrowser2_iface;
140 IOleObject IOleObject_iface;
141 IOleInPlaceObject IOleInPlaceObject_iface;
142 IOleControl IOleControl_iface;
143 IPersistStorage IPersistStorage_iface;
144 IPersistMemory IPersistMemory_iface;
145 IPersistStreamInit IPersistStreamInit_iface;
146 IProvideClassInfo2 IProvideClassInfo2_iface;
147 IViewObject2 IViewObject2_iface;
148 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
149 IOleCommandTarget IOleCommandTarget_iface;
150 IServiceProvider IServiceProvider_iface;
151 IDataObject IDataObject_iface;
152 HlinkFrame hlink_frame;
158 IOleClientSite *client;
159 IOleContainer *container;
160 IOleInPlaceSite *inplace;
165 IOleInPlaceUIWindow *uiwindow;
168 OLEINPLACEFRAMEINFO frameinfo;
171 HWND shell_embedding_hwnd;
173 VARIANT_BOOL register_browser;
174 VARIANT_BOOL visible;
175 VARIANT_BOOL menu_bar;
176 VARIANT_BOOL address_bar;
177 VARIANT_BOOL status_bar;
178 VARIANT_BOOL tool_bar;
179 VARIANT_BOOL full_screen;
180 VARIANT_BOOL theater_mode;
185 struct InternetExplorer {
186 IWebBrowser2 IWebBrowser2_iface;
187 HlinkFrame hlink_frame;
198 void WebBrowser_OleObject_Init(WebBrowser*);
199 void WebBrowser_ViewObject_Init(WebBrowser*);
200 void WebBrowser_Persist_Init(WebBrowser*);
201 void WebBrowser_ClassInfo_Init(WebBrowser*);
203 void WebBrowser_OleObject_Destroy(WebBrowser*);
205 void DocHost_Init(DocHost*,IDispatch*,const IDocHostContainerVtbl*);
206 void DocHost_ClientSite_Init(DocHost*);
207 void DocHost_Frame_Init(DocHost*);
208 void release_dochost_client(DocHost*);
210 void DocHost_Release(DocHost*);
211 void DocHost_ClientSite_Release(DocHost*);
213 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
214 void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
216 void HlinkFrame_Init(HlinkFrame*,IUnknown*,DocHost*);
217 BOOL HlinkFrame_QI(HlinkFrame*,REFIID,void**);
219 HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**);
220 HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**);
222 void create_doc_view_hwnd(DocHost*);
223 void deactivate_document(DocHost*);
224 HRESULT dochost_object_available(DocHost*,IUnknown*);
225 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*);
226 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*);
227 HRESULT go_home(DocHost*);
228 void set_doc_state(DocHost*,READYSTATE);
230 #define WM_DOCHOSTTASK (WM_USER+0x300)
231 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,BOOL);
232 LRESULT process_dochost_task(DocHost*,LPARAM);
234 HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**);
235 void InternetExplorer_WebBrowser_Init(InternetExplorer*);
237 HRESULT CUrlHistory_Create(IUnknown*,REFIID,void**);
239 HRESULT InternetShortcut_Create(IUnknown*,REFIID,void**);
241 HRESULT TaskbarList_Create(IUnknown*,REFIID,void**);
243 /**********************************************************************
244 * Dll lifetime tracking declaration for shdocvw.dll
246 extern LONG SHDOCVW_refCount;
247 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
248 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
250 extern HINSTANCE shdocvw_hinstance;
251 extern void register_iewindow_class(void);
252 extern void unregister_iewindow_class(void);
253 extern HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR);
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 */