configure: Add a check for the QuickTime development headers.
[wine/multimedia.git] / dlls / shdocvw / shdocvw.h
blob3692e15ba4aad173c966d506bca9c5f955cb01f1
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 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)
301 LPWSTR ret = NULL;
303 if(str) {
304 DWORD size;
306 size = (strlenW(str)+1)*sizeof(WCHAR);
307 ret = heap_alloc(size);
308 memcpy(ret, str, size);
311 return ret;
314 static inline LPWSTR co_strdupW(LPCWSTR str)
316 WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
317 if (ret)
318 lstrcpyW(ret, str);
319 return ret;
322 static inline LPWSTR co_strdupAtoW(LPCSTR str)
324 INT len;
325 WCHAR *ret;
326 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
327 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
328 if (ret)
329 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
330 return ret;
333 static inline LPSTR co_strdupWtoA(LPCWSTR str)
335 INT len;
336 CHAR *ret;
337 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
338 ret = CoTaskMemAlloc(len);
339 if (ret)
340 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
341 return ret;
344 #endif /* __WINE_SHDOCVW_H */