d3dcompiler: Move blob and strip functions to blob.c.
[wine.git] / dlls / shdocvw / shdocvw.h
blob7a68499e85ca1de131c1c4cdab53cc8dccd308bb
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"
40 #include "htiframe.h"
42 #include "wine/unicode.h"
43 #include "wine/list.h"
44 #include "resource.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;
62 typedef struct {
63 IConnectionPointContainer IConnectionPointContainer_iface;
65 ConnectionPoint *wbe2;
66 ConnectionPoint *wbe;
67 ConnectionPoint *pns;
69 IUnknown *impl;
70 } ConnectionPointContainer;
72 typedef struct {
73 IHlinkFrame IHlinkFrame_iface;
74 ITargetFrame2 ITargetFrame2_iface;
76 IUnknown *outer;
77 DocHost *doc_host;
78 } HlinkFrame;
80 struct _task_header_t;
82 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
84 typedef struct _task_header_t {
85 task_proc_t proc;
86 } 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;
98 struct DocHost {
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;
112 IDispatch *disp;
114 IDispatch *client_disp;
115 IDocHostUIHandler *hostui;
116 IOleInPlaceFrame *frame;
118 IUnknown *document;
119 IOleDocumentView *view;
120 IUnknown *doc_navigate;
122 const IDocHostContainerVtbl *container_vtbl;
124 HWND hwnd;
125 HWND frame_hwnd;
127 LPOLESTR url;
129 VARIANT_BOOL silent;
130 VARIANT_BOOL offline;
131 VARIANT_BOOL busy;
133 READYSTATE ready_state;
134 READYSTATE doc_state;
135 DWORD prop_notif_cookie;
136 BOOL is_prop_notif;
138 ConnectionPointContainer cps;
141 struct WebBrowser {
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;
157 LONG ref;
159 INT version;
161 IOleClientSite *client;
162 IOleContainer *container;
163 IOleInPlaceSite *inplace;
165 /* window context */
167 HWND frame_hwnd;
168 IOleInPlaceUIWindow *uiwindow;
169 RECT pos_rect;
170 RECT clip_rect;
171 OLEINPLACEFRAMEINFO frameinfo;
172 SIZEL extent;
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;
185 DocHost doc_host;
188 typedef struct {
189 DocHost doc_host;
191 LONG ref;
193 InternetExplorer *ie;
194 } IEDocHost;
196 struct InternetExplorer {
197 IWebBrowser2 IWebBrowser2_iface;
198 HlinkFrame hlink_frame;
200 LONG ref;
202 HWND frame_hwnd;
203 HWND status_hwnd;
204 HMENU menu;
205 BOOL nohome;
207 struct list entry;
208 IEDocHost *doc_host;
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 ShellBrowser_Create(IShellBrowser**);
233 HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**);
234 HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**);
236 void create_doc_view_hwnd(DocHost*);
237 void deactivate_document(DocHost*);
238 HRESULT dochost_object_available(DocHost*,IUnknown*);
239 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*);
240 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*);
241 HRESULT go_home(DocHost*);
242 void set_doc_state(DocHost*,READYSTATE);
243 HRESULT get_location_url(DocHost*,BSTR*);
244 void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*);
246 #define WM_DOCHOSTTASK (WM_USER+0x300)
247 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,BOOL);
248 LRESULT process_dochost_task(DocHost*,LPARAM);
250 HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**);
251 void InternetExplorer_WebBrowser_Init(InternetExplorer*);
253 void released_obj(void);
255 HRESULT CUrlHistory_Create(IUnknown*,REFIID,void**);
257 HRESULT InternetShortcut_Create(IUnknown*,REFIID,void**);
259 HRESULT TaskbarList_Create(IUnknown*,REFIID,void**);
261 /**********************************************************************
262 * Dll lifetime tracking declaration for shdocvw.dll
264 extern LONG SHDOCVW_refCount;
265 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
266 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
268 extern HINSTANCE shdocvw_hinstance;
269 extern void register_iewindow_class(void);
270 extern void unregister_iewindow_class(void);
271 extern HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR);
273 HRESULT register_class_object(BOOL);
274 HRESULT get_typeinfo(ITypeInfo**);
275 DWORD register_iexplore(BOOL);
277 const char *debugstr_variant(const VARIANT*);
279 /* memory allocation functions */
281 static inline void *heap_alloc(size_t len)
283 return HeapAlloc(GetProcessHeap(), 0, len);
286 static inline void *heap_alloc_zero(size_t len)
288 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
291 static inline void *heap_realloc(void *mem, size_t len)
293 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
296 static inline BOOL heap_free(void *mem)
298 return HeapFree(GetProcessHeap(), 0, mem);
301 static inline LPWSTR heap_strdupW(LPCWSTR str)
303 LPWSTR ret = NULL;
305 if(str) {
306 DWORD size;
308 size = (strlenW(str)+1)*sizeof(WCHAR);
309 ret = heap_alloc(size);
310 memcpy(ret, str, size);
313 return ret;
316 static inline LPWSTR co_strdupW(LPCWSTR str)
318 WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
319 if (ret)
320 lstrcpyW(ret, str);
321 return ret;
324 static inline LPWSTR co_strdupAtoW(LPCSTR str)
326 INT len;
327 WCHAR *ret;
328 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
329 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
330 if (ret)
331 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
332 return ret;
335 static inline LPSTR co_strdupWtoA(LPCWSTR str)
337 INT len;
338 CHAR *ret;
339 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
340 ret = CoTaskMemAlloc(len);
341 if (ret)
342 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
343 return ret;
346 #endif /* __WINE_SHDOCVW_H */