dmstyle: Remove an unused function declaration.
[wine.git] / dlls / shdocvw / shdocvw.h
blobf960a1aef752d11aa7b3c7cd834bc18b31587dcf
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) DECLSPEC_HIDDEN;
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*);
83 typedef void (*task_destr_t)(struct _task_header_t*);
85 typedef struct _task_header_t {
86 struct list entry;
87 task_proc_t proc;
88 task_destr_t destr;
89 } task_header_t;
91 typedef struct _IDocHostContainerVtbl
93 ULONG (*addref)(DocHost*);
94 ULONG (*release)(DocHost*);
95 void (WINAPI* GetDocObjRect)(DocHost*,RECT*);
96 HRESULT (WINAPI* SetStatusText)(DocHost*,LPCWSTR);
97 void (WINAPI* SetURL)(DocHost*,LPCWSTR);
98 HRESULT (*exec)(DocHost*,const GUID*,DWORD,DWORD,VARIANT*,VARIANT*);
99 } IDocHostContainerVtbl;
101 struct DocHost {
102 IOleClientSite IOleClientSite_iface;
103 IOleInPlaceSiteEx IOleInPlaceSiteEx_iface;
104 IDocHostUIHandler2 IDocHostUIHandler2_iface;
105 IOleDocumentSite IOleDocumentSite_iface;
106 IOleControlSite IOleControlSite_iface;
107 IOleCommandTarget IOleCommandTarget_iface;
108 IDispatch IDispatch_iface;
109 IPropertyNotifySink IPropertyNotifySink_iface;
110 IServiceProvider IServiceProvider_iface;
112 /* Interfaces of InPlaceFrame object */
113 IOleInPlaceFrame IOleInPlaceFrame_iface;
115 IDispatch *disp;
117 IDispatch *client_disp;
118 IDocHostUIHandler *hostui;
119 IOleInPlaceFrame *frame;
121 IUnknown *document;
122 IOleDocumentView *view;
123 IUnknown *doc_navigate;
125 const IDocHostContainerVtbl *container_vtbl;
127 HWND hwnd;
128 HWND frame_hwnd;
130 struct list task_queue;
132 LPOLESTR url;
134 VARIANT_BOOL silent;
135 VARIANT_BOOL offline;
136 VARIANT_BOOL busy;
138 READYSTATE ready_state;
139 READYSTATE doc_state;
140 DWORD prop_notif_cookie;
141 BOOL is_prop_notif;
143 ConnectionPointContainer cps;
146 struct WebBrowser {
147 IWebBrowser2 IWebBrowser2_iface;
148 IOleObject IOleObject_iface;
149 IOleInPlaceObject IOleInPlaceObject_iface;
150 IOleControl IOleControl_iface;
151 IPersistStorage IPersistStorage_iface;
152 IPersistMemory IPersistMemory_iface;
153 IPersistStreamInit IPersistStreamInit_iface;
154 IProvideClassInfo2 IProvideClassInfo2_iface;
155 IViewObject2 IViewObject2_iface;
156 IOleInPlaceActiveObject IOleInPlaceActiveObject_iface;
157 IOleCommandTarget IOleCommandTarget_iface;
158 IServiceProvider IServiceProvider_iface;
159 IDataObject IDataObject_iface;
160 HlinkFrame hlink_frame;
162 LONG ref;
164 INT version;
166 IOleClientSite *client;
167 IOleContainer *container;
168 IOleInPlaceSiteEx *inplace;
170 /* window context */
172 HWND frame_hwnd;
173 IOleInPlaceUIWindow *uiwindow;
174 RECT pos_rect;
175 RECT clip_rect;
176 OLEINPLACEFRAMEINFO frameinfo;
177 SIZEL extent;
179 HWND shell_embedding_hwnd;
181 VARIANT_BOOL register_browser;
182 VARIANT_BOOL visible;
183 VARIANT_BOOL menu_bar;
184 VARIANT_BOOL address_bar;
185 VARIANT_BOOL status_bar;
186 VARIANT_BOOL tool_bar;
187 VARIANT_BOOL full_screen;
188 VARIANT_BOOL theater_mode;
190 DocHost doc_host;
193 typedef struct {
194 DocHost doc_host;
196 LONG ref;
198 InternetExplorer *ie;
199 } IEDocHost;
201 struct InternetExplorer {
202 IWebBrowser2 IWebBrowser2_iface;
203 HlinkFrame hlink_frame;
205 LONG ref;
207 HWND frame_hwnd;
208 HWND status_hwnd;
209 HMENU menu;
210 BOOL nohome;
212 struct list entry;
213 IEDocHost *doc_host;
216 void WebBrowser_OleObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
217 void WebBrowser_ViewObject_Init(WebBrowser*) DECLSPEC_HIDDEN;
218 void WebBrowser_Persist_Init(WebBrowser*) DECLSPEC_HIDDEN;
219 void WebBrowser_ClassInfo_Init(WebBrowser*) DECLSPEC_HIDDEN;
221 void WebBrowser_OleObject_Destroy(WebBrowser*) DECLSPEC_HIDDEN;
223 void DocHost_Init(DocHost*,IDispatch*,const IDocHostContainerVtbl*) DECLSPEC_HIDDEN;
224 void DocHost_ClientSite_Init(DocHost*) DECLSPEC_HIDDEN;
225 void DocHost_Frame_Init(DocHost*) DECLSPEC_HIDDEN;
226 void release_dochost_client(DocHost*) DECLSPEC_HIDDEN;
228 void DocHost_Release(DocHost*) DECLSPEC_HIDDEN;
229 void DocHost_ClientSite_Release(DocHost*) DECLSPEC_HIDDEN;
231 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*) DECLSPEC_HIDDEN;
232 void ConnectionPointContainer_Destroy(ConnectionPointContainer*) DECLSPEC_HIDDEN;
234 void HlinkFrame_Init(HlinkFrame*,IUnknown*,DocHost*) DECLSPEC_HIDDEN;
235 BOOL HlinkFrame_QI(HlinkFrame*,REFIID,void**) DECLSPEC_HIDDEN;
237 HRESULT ShellBrowser_Create(IShellBrowser**) DECLSPEC_HIDDEN;
238 HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
239 HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
241 void create_doc_view_hwnd(DocHost*) DECLSPEC_HIDDEN;
242 void deactivate_document(DocHost*) DECLSPEC_HIDDEN;
243 HRESULT dochost_object_available(DocHost*,IUnknown*) DECLSPEC_HIDDEN;
244 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*) DECLSPEC_HIDDEN;
245 HRESULT navigate_url(DocHost*,LPCWSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*) DECLSPEC_HIDDEN;
246 HRESULT go_home(DocHost*) DECLSPEC_HIDDEN;
247 void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
248 HRESULT get_location_url(DocHost*,BSTR*) DECLSPEC_HIDDEN;
249 void handle_navigation_error(DocHost*,HRESULT,BSTR,IHTMLWindow2*) DECLSPEC_HIDDEN;
251 #define WM_DOCHOSTTASK (WM_USER+0x300)
252 void push_dochost_task(DocHost*,task_header_t*,task_proc_t,task_destr_t,BOOL) DECLSPEC_HIDDEN;
253 LRESULT process_dochost_tasks(DocHost*) DECLSPEC_HIDDEN;
254 void abort_dochost_tasks(DocHost*,task_proc_t) DECLSPEC_HIDDEN;
256 HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**) DECLSPEC_HIDDEN;
257 void InternetExplorer_WebBrowser_Init(InternetExplorer*) DECLSPEC_HIDDEN;
259 void released_obj(void) DECLSPEC_HIDDEN;
261 /**********************************************************************
262 * Dll lifetime tracking declaration for shdocvw.dll
264 extern LONG SHDOCVW_refCount DECLSPEC_HIDDEN;
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 DECLSPEC_HIDDEN;
269 extern void register_iewindow_class(void) DECLSPEC_HIDDEN;
270 extern void unregister_iewindow_class(void) DECLSPEC_HIDDEN;
271 extern HRESULT update_ie_statustext(InternetExplorer*, LPCWSTR) DECLSPEC_HIDDEN;
273 HINSTANCE get_ieframe_instance(void) DECLSPEC_HIDDEN;
275 HRESULT register_class_object(BOOL) DECLSPEC_HIDDEN;
276 HRESULT get_typeinfo(ITypeInfo**) DECLSPEC_HIDDEN;
277 DWORD register_iexplore(BOOL) DECLSPEC_HIDDEN;
279 const char *debugstr_variant(const VARIANT*) DECLSPEC_HIDDEN;
281 /* memory allocation functions */
283 static inline void *heap_alloc(size_t len)
285 return HeapAlloc(GetProcessHeap(), 0, len);
288 static inline void *heap_alloc_zero(size_t len)
290 return HeapAlloc(GetProcessHeap(), HEAP_ZERO_MEMORY, len);
293 static inline void *heap_realloc(void *mem, size_t len)
295 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
298 static inline BOOL heap_free(void *mem)
300 return HeapFree(GetProcessHeap(), 0, mem);
303 static inline LPWSTR heap_strdupW(LPCWSTR str)
305 LPWSTR ret = NULL;
307 if(str) {
308 DWORD size;
310 size = (strlenW(str)+1)*sizeof(WCHAR);
311 ret = heap_alloc(size);
312 memcpy(ret, str, size);
315 return ret;
318 static inline LPWSTR co_strdupW(LPCWSTR str)
320 WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
321 if (ret)
322 lstrcpyW(ret, str);
323 return ret;
326 static inline LPWSTR co_strdupAtoW(LPCSTR str)
328 INT len;
329 WCHAR *ret;
330 len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
331 ret = CoTaskMemAlloc(len*sizeof(WCHAR));
332 if (ret)
333 MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
334 return ret;
337 static inline LPSTR co_strdupWtoA(LPCWSTR str)
339 INT len;
340 CHAR *ret;
341 len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
342 ret = CoTaskMemAlloc(len);
343 if (ret)
344 WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
345 return ret;
348 #endif /* __WINE_SHDOCVW_H */