oleaut32/tests: Skip some tests when OleLoadPictureEx() is not available.
[wine/multimedia.git] / dlls / ieframe / ieframe.h
blobb7a7b02eefb9715c0ed5168b2b2653dfba97c889
1 /*
2 * Header includes for ieframe.dll
4 * Copyright 2011 Jacek Caban for CodeWeavers
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA
21 #include <stdarg.h>
23 #define COBJMACROS
24 #define NONAMELESSUNION
26 #include "windef.h"
27 #include "winbase.h"
28 #include "wingdi.h"
29 #include "winuser.h"
31 #include "ole2.h"
32 #include "olectl.h"
33 #include "shlobj.h"
34 #include "mshtmhst.h"
35 #include "exdisp.h"
36 #include "hlink.h"
37 #include "htiface.h"
38 #include "shdeprecated.h"
39 #include "docobjectservice.h"
41 #include "wine/unicode.h"
42 #include "wine/list.h"
44 typedef struct ConnectionPoint ConnectionPoint;
45 typedef struct DocHost DocHost;
47 typedef struct {
48 IConnectionPointContainer IConnectionPointContainer_iface;
50 ConnectionPoint *wbe2;
51 ConnectionPoint *wbe;
52 ConnectionPoint *pns;
54 IUnknown *impl;
55 } ConnectionPointContainer;
57 typedef struct {
58 IHlinkFrame IHlinkFrame_iface;
59 ITargetFrame2 ITargetFrame2_iface;
60 ITargetFramePriv2 ITargetFramePriv2_iface;
62 IUnknown *outer;
63 DocHost *doc_host;
64 } HlinkFrame;
66 struct _task_header_t;
68 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
69 typedef void (*task_destr_t)(struct _task_header_t*);
71 typedef struct _task_header_t {
72 struct list entry;
73 task_proc_t proc;
74 task_destr_t destr;
75 } task_header_t;
77 typedef struct {
78 IShellBrowser IShellBrowser_iface;
79 IBrowserService IBrowserService_iface;
80 IDocObjectService IDocObjectService_iface;
82 LONG ref;
84 DocHost *doc_host;
85 } ShellBrowser;
87 typedef struct {
88 IHTMLWindow2 IHTMLWindow2_iface;
89 DocHost *doc_host;
90 } IEHTMLWindow;
92 typedef struct {
93 INewWindowManager INewWindowManager_iface;
94 DocHost *doc_host;
95 } NewWindowManager;
97 typedef struct _IDocHostContainerVtbl
99 ULONG (*addref)(DocHost*);
100 ULONG (*release)(DocHost*);
101 void (WINAPI* GetDocObjRect)(DocHost*,RECT*);
102 HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR);
103 void (WINAPI* SetURL)(DocHost*,LPCWSTR);
104 HRESULT (*exec)(DocHost*,const GUID*,DWORD,DWORD,VARIANT*,VARIANT*);
105 } IDocHostContainerVtbl;
107 struct DocHost {
108 IOleClientSite IOleClientSite_iface;
109 IOleInPlaceSiteEx IOleInPlaceSiteEx_iface;
110 IDocHostUIHandler2 IDocHostUIHandler2_iface;
111 IOleDocumentSite IOleDocumentSite_iface;
112 IOleControlSite IOleControlSite_iface;
113 IOleCommandTarget IOleCommandTarget_iface;
114 IDispatch IDispatch_iface;
115 IPropertyNotifySink IPropertyNotifySink_iface;
116 IServiceProvider IServiceProvider_iface;
118 /* Interfaces of InPlaceFrame object */
119 IOleInPlaceFrame IOleInPlaceFrame_iface;
121 IDispatch *disp;
123 IDispatch *client_disp;
124 IDocHostUIHandler *hostui;
125 IOleInPlaceFrame *frame;
127 IUnknown *document;
128 IOleDocumentView *view;
129 IUnknown *doc_navigate;
131 const IDocHostContainerVtbl *container_vtbl;
133 HWND hwnd;
134 HWND frame_hwnd;
136 struct list task_queue;
138 LPOLESTR url;
140 VARIANT_BOOL silent;
141 VARIANT_BOOL offline;
142 VARIANT_BOOL busy;
144 READYSTATE ready_state;
145 READYSTATE doc_state;
146 DWORD prop_notif_cookie;
147 BOOL is_prop_notif;
149 ShellBrowser *browser_service;
151 ConnectionPointContainer cps;
152 IEHTMLWindow html_window;
153 NewWindowManager nwm;
156 struct WebBrowser {
157 IWebBrowser2 IWebBrowser2_iface;
158 IOleObject IOleObject_iface;
159 IOleInPlaceObject IOleInPlaceObject_iface;
160 IOleControl IOleControl_iface;
161 IPersistStorage IPersistStorage_iface;
162 IPersistMemory IPersistMemory_iface;
163 IPersistStreamInit IPersistStreamInit_iface;
164 IProvideClassInfo2 IProvideClassInfo2_iface;
165 IViewObject2 IViewObject2_iface;
166 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
167 IOleCommandTarget IOleCommandTarget_iface;
168 IServiceProvider IServiceProvider_iface;
169 IDataObject IDataObject_iface;
170 HlinkFrame hlink_frame;
172 LONG ref;
174 INT version;
176 IOleClientSite *client;
177 IOleContainer *container;
178 IOleInPlaceSiteEx *inplace;
180 /* window context */
182 HWND frame_hwnd;
183 IOleInPlaceUIWindow *uiwindow;
184 RECT pos_rect;
185 RECT clip_rect;
186 OLEINPLACEFRAMEINFO frameinfo;
187 SIZEL extent;
189 HWND shell_embedding_hwnd;
191 VARIANT_BOOL register_browser;
192 VARIANT_BOOL visible;
193 VARIANT_BOOL menu_bar;
194 VARIANT_BOOL address_bar;
195 VARIANT_BOOL status_bar;
196 VARIANT_BOOL tool_bar;
197 VARIANT_BOOL full_screen;
198 VARIANT_BOOL theater_mode;
200 DocHost doc_host;
203 typedef struct {
204 DocHost doc_host;
206 LONG ref;
208 InternetExplorer *ie;
209 } IEDocHost;
211 struct InternetExplorer {
212 IWebBrowser2 IWebBrowser2_iface;
213 IServiceProvider IServiceProvider_iface;
214 HlinkFrame hlink_frame;
216 LONG ref;
218 HWND frame_hwnd;
219 HWND status_hwnd;
220 HMENU menu;
221 BOOL nohome;
223 struct list entry;
224 IEDocHost *doc_host;
227 void WebBrowser_OleObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
228 void WebBrowser_ViewObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
229 void WebBrowser_Persist_Init(WebBrowser*) DECLSPEC_HIDDEN;
230 void WebBrowser_ClassInfo_Init(WebBrowser*) DECLSPEC_HIDDEN;
232 void WebBrowser_OleObject_Destroy(WebBrowser*) DECLSPEC_HIDDEN;
234 void DocHost_Init(DocHost*,IDispatch*,const IDocHostContainerVtbl*) DECLSPEC_HIDDEN;
235 void DocHost_Release(DocHost*) DECLSPEC_HIDDEN;
236 void DocHost_ClientSite_Init(DocHost*) DECLSPEC_HIDDEN;
237 void DocHost_ClientSite_Release(DocHost*) DECLSPEC_HIDDEN;
238 void DocHost_Frame_Init(DocHost*) DECLSPEC_HIDDEN;
239 void release_dochost_client(DocHost*) DECLSPEC_HIDDEN;
241 void IEHTMLWindow_Init(DocHost*) DECLSPEC_HIDDEN;
242 void NewWindowManager_Init(DocHost*) DECLSPEC_HIDDEN;
244 void HlinkFrame_Init(HlinkFrame*,IUnknown*,DocHost*) DECLSPEC_HIDDEN;
245 BOOL HlinkFrame_QI(HlinkFrame*,REFIID,void**) DECLSPEC_HIDDEN;
247 HRESULT create_browser_service(DocHost*,ShellBrowser**) DECLSPEC_HIDDEN;
248 void detach_browser_service(ShellBrowser*) DECLSPEC_HIDDEN;
250 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*) DECLSPEC_HIDDEN;
251 void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
253 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN;
254 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
255 HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
256 HRESULT get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
257 HRESULT set_dochost_url(DocHost*,const WCHAR*) DECLSPEC_HIDDEN;
258 void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
259 HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN;
260 void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
261 void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
262 void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
264 #define WM_DOCHOSTTASK (WM_USER+0x300)
265 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
266 void abort_dochost_tasks(DocHost*,task_proc_t) DECLSPEC_HIDDEN;
267 LRESULT process_dochost_tasks(DocHost*) DECLSPEC_HIDDEN;
269 void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN;
270 HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR) DECLSPEC_HIDDEN;
271 void released_obj(void) DECLSPEC_HIDDEN;
273 void register_iewindow_class(void) DECLSPEC_HIDDEN;
274 void unregister_iewindow_class(void) DECLSPEC_HIDDEN;
276 HRESULT get_typeinfo(ITypeInfo**) DECLSPEC_HIDDEN;
277 HRESULT register_class_object(BOOL) DECLSPEC_HIDDEN;
279 HRESULT WINAPI CUrlHistory_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
280 HRESULT WINAPI InternetExplorer_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
281 HRESULT WINAPI InternetShortcut_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
282 HRESULT WINAPI TaskbarList_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
283 HRESULT WINAPI WebBrowser_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
284 HRESULT WINAPI WebBrowserV1_Create(IClassFactory*,IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
286 const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
288 extern LONG module_ref DECLSPEC_HIDDEN;
289 extern HINSTANCE ieframe_instance DECLSPEC_HIDDEN;
291 static inline void lock_module(void) {
292 InterlockedIncrement(&module_ref);
295 static inline void unlock_module(void) {
296 InterlockedDecrement(&module_ref);
299 static inline void *heap_alloc(size_t len)
301 return HeapAlloc(GetProcessHeap(), 0, len);
304 static inline void *heap_alloc_zero(size_t len)
306 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
309 static inline void *heap_realloc(void *mem, size_t len)
311 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
314 static inline BOOL heap_free(void *mem)
316 return HeapFree(GetProcessHeap(), 0, mem);
319 static inline LPWSTR heap_strdupW(LPCWSTR str)
321 LPWSTR ret = NULL;
323 if(str) {
324 DWORD size;
326 size = (strlenW(str)+1)*sizeof(WCHAR);
327 ret = heap_alloc(size);
328 if(ret)
329 memcpy(ret, str, size);
332 return ret;
335 static inline LPWSTR co_strdupW(LPCWSTR str)
337 WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
338 if (ret)
339 lstrcpyW(ret, str);
340 return ret;
343 static inline LPWSTR co_strdupAtoW(LPCSTR str)
345 INT len;
346 WCHAR *ret;
347 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
348 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
349 if (ret)
350 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
351 return ret;
354 static inline LPSTR co_strdupWtoA(LPCWSTR str)
356 INT len;
357 CHAR *ret;
358 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
359 ret = CoTaskMemAlloc(len);
360 if (ret)
361 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
362 return ret;