msi: Implement the UnregisterExtensionInfo standard action.
[wine.git] / dlls / shdocvw / shdocvw.h
blob1184298dca93de142a5499e874defd3236003542
1 /*
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 COBJMACROS
27 #include <stdarg.h>
29 #include "windef.h"
30 #include "winbase.h"
31 #include "wingdi.h"
32 #include "winuser.h"
34 #include "ole2.h"
35 #include "olectl.h"
36 #include "shlobj.h"
37 #include "exdisp.h"
38 #include "mshtmhst.h"
39 #include "hlink.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;
56 typedef struct {
57 const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
59 ConnectionPoint *wbe2;
60 ConnectionPoint *wbe;
61 ConnectionPoint *pns;
63 IUnknown *impl;
64 } ConnectionPointContainer;
66 struct _task_header_t;
68 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
70 typedef struct _task_header_t {
71 task_proc_t proc;
72 } task_header_t;
74 struct DocHost {
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;
87 IDispatch *disp;
89 IDispatch *client_disp;
90 IDocHostUIHandler *hostui;
91 IOleInPlaceFrame *frame;
93 IUnknown *document;
94 IOleDocumentView *view;
95 IUnknown *doc_navigate;
97 HWND hwnd;
98 HWND frame_hwnd;
100 LPOLESTR url;
102 VARIANT_BOOL silent;
103 VARIANT_BOOL offline;
104 VARIANT_BOOL busy;
106 READYSTATE ready_state;
107 READYSTATE doc_state;
108 DWORD prop_notif_cookie;
109 BOOL is_prop_notif;
111 ConnectionPointContainer cps;
114 struct WebBrowser {
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;
131 LONG ref;
133 INT version;
135 IOleClientSite *client;
136 IOleContainer *container;
137 IOleInPlaceSite *inplace;
139 /* window context */
141 HWND frame_hwnd;
142 IOleInPlaceUIWindow *uiwindow;
143 RECT pos_rect;
144 RECT clip_rect;
145 OLEINPLACEFRAMEINFO frameinfo;
146 SIZEL extent;
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;
159 DocHost doc_host;
162 struct InternetExplorer {
163 const IWebBrowser2Vtbl *lpWebBrowser2Vtbl;
165 LONG ref;
167 HWND frame_hwnd;
169 DocHost doc_host;
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)
285 LPWSTR ret = NULL;
287 if(str) {
288 DWORD size;
290 size = (strlenW(str)+1)*sizeof(WCHAR);
291 ret = heap_alloc(size);
292 memcpy(ret, str, size);
295 return ret;
298 static inline LPWSTR co_strdupW(LPCWSTR str)
300 WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
301 if (ret)
302 lstrcpyW(ret, str);
303 return ret;
306 static inline LPWSTR co_strdupAtoW(LPCSTR str)
308 INT len;
309 WCHAR *ret;
310 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
311 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
312 if (ret)
313 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
314 return ret;
317 static inline LPSTR co_strdupWtoA(LPCWSTR str)
319 INT len;
320 CHAR *ret;
321 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
322 ret = CoTaskMemAlloc(len);
323 if (ret)
324 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
325 return ret;
328 #endif /* __WINE_SHDOCVW_H */