ReactOS  0.4.13-dev-551-gf37fb1f
ieframe.h
Go to the documentation of this file.
1 /*
2  * Header includes for ieframe.dll
3  *
4  * Copyright 2011 Jacek Caban for CodeWeavers
5  *
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.
10  *
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.
15  *
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
19  */
20 
21 #pragma once
22 
23 #include <stdarg.h>
24 
25 #define COBJMACROS
26 
27 #include "windef.h"
28 #include "winbase.h"
29 #include "wingdi.h"
30 #include "winuser.h"
31 #ifdef __REACTOS__
32 #include <wincon.h>
33 #endif
34 
35 #include "ole2.h"
36 #include "olectl.h"
37 #include "shlobj.h"
38 #include "mshtmhst.h"
39 #include "exdisp.h"
40 #include "hlink.h"
41 #include "htiface.h"
42 #include "shdeprecated.h"
43 #include "docobjectservice.h"
44 
45 #include "wine/unicode.h"
46 #include "wine/heap.h"
47 #include "wine/list.h"
48 
50 typedef struct DocHost DocHost;
51 
52 typedef struct {
54 
58 
61 
62 typedef struct {
68 
71 } HlinkFrame;
72 
73 struct _task_header_t;
74 
75 typedef void (*task_proc_t)(DocHost*, struct _task_header_t*);
76 typedef void (*task_destr_t)(struct _task_header_t*);
77 
78 typedef struct _task_header_t {
79  struct list entry;
83 
84 typedef struct {
88 
90 
92 } ShellBrowser;
93 
94 typedef struct {
97 } IEHTMLWindow;
98 
99 typedef struct {
103 
104 typedef struct {
108 
110 {
116  void (*set_url)(DocHost*,const WCHAR*);
118 
119 struct DocHost {
129 
130  /* Interfaces of InPlaceFrame object */
132 
133  IWebBrowser2 *wb;
134 
139 
143 
145 
148 
149  struct list task_queue;
150 
152 
156 
157  READYSTATE ready_state;
158  READYSTATE doc_state;
161 
163  IShellUIHelper2 *shell_ui_helper;
164 
165  struct {
167  unsigned size;
168  unsigned length;
169  unsigned position;
171  } travellog;
172 
176 };
177 
178 struct WebBrowser {
179  IWebBrowser2 IWebBrowser2_iface;
193 
195 
197 
202 
206 
207  /* window context */
208 
213  OLEINPLACEFRAMEINFO frameinfo;
215 
217 
226 
228 };
229 
232  IWebBrowser2 IWebBrowser2_iface;
236 
239 
245 
246  struct list entry;
247 };
248 
253 
255 
256 void DocHost_Init(DocHost*,IWebBrowser2*,const IDocHostContainerVtbl*) DECLSPEC_HIDDEN;
262 
265 
268 
272 
275 
286 void set_doc_state(DocHost*,READYSTATE) DECLSPEC_HIDDEN;
292 
293 #define WM_DOCHOSTTASK (WM_USER+0x300)
297 
300 void released_obj(void) DECLSPEC_HIDDEN;
302 
305 
306 #define TID_LIST \
307  XCLSID(WebBrowser) \
308  XCLSID(WebBrowser_V1) \
309  XIID(IWebBrowser2)
310 
311 typedef enum {
312 #define XIID(iface) iface ## _tid,
313 #define XCLSID(class) class ## _tid,
314 TID_LIST
315 #undef XIID
316 #undef XCLSID
318 } tid_t;
319 
321 
328 
331 
334 
335 static inline void lock_module(void) {
337 }
338 
339 static inline void unlock_module(void) {
341 }
342 
344 {
345  LPWSTR ret = NULL;
346 
347  if(str) {
348  DWORD size;
349 
350  size = (strlenW(str)+1)*sizeof(WCHAR);
351  ret = heap_alloc(size);
352  if(ret)
353  memcpy(ret, str, size);
354  }
355 
356  return ret;
357 }
358 
359 static inline LPWSTR co_strdupW(LPCWSTR str)
360 {
361  WCHAR *ret = CoTaskMemAlloc((strlenW(str) + 1)*sizeof(WCHAR));
362  if (ret)
363  lstrcpyW(ret, str);
364  return ret;
365 }
366 
368 {
369  INT len;
370  WCHAR *ret;
371  len = MultiByteToWideChar(CP_ACP, 0, str, -1, NULL, 0);
372  ret = CoTaskMemAlloc(len*sizeof(WCHAR));
373  if (ret)
374  MultiByteToWideChar(CP_ACP, 0, str, -1, ret, len);
375  return ret;
376 }
377 
379 {
380  INT len;
381  CHAR *ret;
382  len = WideCharToMultiByte(CP_ACP, 0, str, -1, NULL, 0, 0, 0);
384  if (ret)
385  WideCharToMultiByte(CP_ACP, 0, str, -1, ret, len, 0, 0);
386  return ret;
387 }
HRESULT WINAPI InternetExplorer_Create(IClassFactory *, IUnknown *, REFIID, void **) DECLSPEC_HIDDEN
Definition: iexplore.c:837
IPersistStreamInit IPersistStreamInit_iface
Definition: ieframe.h:185
IWebBrowserPriv2IE9 IWebBrowserPriv2IE9_iface
Definition: ieframe.h:67
VARIANT_BOOL busy
Definition: ieframe.h:155
IProvideClassInfo2 IProvideClassInfo2_iface
Definition: ieframe.h:186
IClassFactory InternetExplorerManagerFactory
Definition: ieframe_main.c:253
#define HRESULT
Definition: msvc.h:9
IDocObjectService IDocObjectService_iface
Definition: ieframe.h:87
IShellUIHelper2 * shell_ui_helper
Definition: ieframe.h:163
task_proc_t proc
Definition: ieframe.h:80
IOleClientSite * client
Definition: ieframe.h:198
IOleClientSite IOleClientSite_iface
Definition: ieframe.h:120
LONG ref
Definition: ieframe.h:194
IConnectionPointContainer IConnectionPointContainer_iface
Definition: ieframe.h:53
#define REFIID
Definition: guiddef.h:113
LPOLESTR url
Definition: ieframe.h:151
ConnectionPoint * wbe
Definition: ieframe.h:56
struct png_info_def **typedef void(__cdecl typeof(png_destroy_read_struct))(struct png_struct_def **
Definition: typeof.h:49
WINE_UNICODE_INLINE unsigned int strlenW(const WCHAR *str)
Definition: unicode.h:212
BOOL HlinkFrame_QI(HlinkFrame *, REFIID, void **) DECLSPEC_HIDDEN
Definition: navigate.c:1661
void(* get_docobj_rect)(DocHost *, RECT *)
Definition: ieframe.h:113
#define WideCharToMultiByte
Definition: compat.h:101
void push_dochost_task(DocHost *, task_header_t *, task_proc_t, task_destr_t, BOOL) DECLSPEC_HIDDEN
Definition: dochost.c:39
void DocHost_ClientSite_Release(DocHost *) DECLSPEC_HIDDEN
Definition: client.c:722
const WCHAR * LPCWSTR
Definition: xmlstorage.h:185
void DocHost_Frame_Init(DocHost *) DECLSPEC_HIDDEN
Definition: frame.c:182
static INewWindowManager NewWindowManager
Definition: htmldoc.c:900
void released_obj(void) DECLSPEC_HIDDEN
Definition: iexplore.c:946
Implementation of IShellBrowserImpl interface in explorer child windows.
Definition: ieframe.h:84
OLEINPLACEFRAMEINFO frameinfo
Definition: ieframe.h:213
IOleDocumentSite IOleDocumentSite_iface
Definition: ieframe.h:123
IStream * stream
Definition: ieframe.h:106
#define CP_ACP
Definition: compat.h:99
tid_t
Definition: ieframe.h:311
char CHAR
Definition: xmlstorage.h:175
unsigned position
Definition: ieframe.h:169
READYSTATE doc_state
Definition: ieframe.h:158
void HlinkFrame_Init(HlinkFrame *, IUnknown *, DocHost *) DECLSPEC_HIDDEN
Definition: navigate.c:1689
VARIANT_BOOL menu_bar
Definition: ieframe.h:220
WCHAR * url
Definition: ieframe.h:105
void(* on_command_state_change)(DocHost *, LONG, BOOL)
Definition: ieframe.h:115
HWND frame_hwnd
Definition: ieframe.h:147
HRESULT WINAPI CUrlHistory_Create(IClassFactory *, IUnknown *, REFIID, void **) DECLSPEC_HIDDEN
Definition: urlhist.c:126
DocHost doc_host
Definition: ieframe.h:227
ULONG(* addref)(DocHost *)
Definition: ieframe.h:111
const IDocHostContainerVtbl * container_vtbl
Definition: ieframe.h:144
DocHost * doc_host
Definition: ieframe.h:70
IHTMLWindow2 IHTMLWindow2_iface
Definition: ieframe.h:95
void WebBrowser_Persist_Init(WebBrowser *) DECLSPEC_HIDDEN
Definition: persist.c:279
HRESULT update_ie_statustext(InternetExplorer *, LPCWSTR) DECLSPEC_HIDDEN
Definition: iexplore.c:63
ITargetFrame2 ITargetFrame2_iface
Definition: ieframe.h:65
HINSTANCE ieframe_instance
Definition: ieframe_main.c:32
HRESULT WINAPI WebBrowserV1_Create(IClassFactory *, IUnknown *, REFIID, void **) DECLSPEC_HIDDEN
Definition: webbrowser.c:1264
ITargetFramePriv2 ITargetFramePriv2_iface
Definition: ieframe.h:66
IClassFactory InternetExplorerFactory DECLSPEC_HIDDEN
Definition: ieframe.h:330
ConnectionPoint * pns
Definition: ieframe.h:57
DWORD sink_flags
Definition: ieframe.h:205
void call_sink(ConnectionPoint *, DISPID, DISPPARAMS *) DECLSPEC_HIDDEN
Definition: events.c:391
IOleInPlaceFrame * frame
Definition: ieframe.h:137
OLECHAR * BSTR
Definition: compat.h:1934
__IHTMLWindow2_FWD_DEFINED__ typedef interface IHTMLWindow2 IHTMLWindow2
Definition: mshtmhst.idl:64
LONG module_ref
Definition: ieframe_main.c:31
VARIANT_BOOL silent
Definition: ieframe.h:153
int loading_pos
Definition: ieframe.h:170
IOleCommandTarget IOleCommandTarget_iface
Definition: ieframe.h:125
IOleInPlaceObject IOleInPlaceObject_iface
Definition: ieframe.h:181
char * LPSTR
Definition: xmlstorage.h:182
void ConnectionPointContainer_Destroy(ConnectionPointContainer *) DECLSPEC_HIDDEN
Definition: events.c:442
static LPOLESTR
Definition: stg_prop.c:27
ULONG(* release)(DocHost *)
Definition: ieframe.h:112
#define BOOL
Definition: nt_native.h:43
IDispatch IDispatch_iface
Definition: ieframe.h:126
VARIANT_BOOL theater_mode
Definition: ieframe.h:225
int32_t INT
Definition: typedefs.h:56
short VARIANT_BOOL
Definition: compat.h:1931
IOleInPlaceSiteEx * inplace
Definition: ieframe.h:201
static void * heap_alloc(size_t len)
Definition: appwiz.h:65
IDataObject IDataObject_iface
Definition: ieframe.h:191
IOleCommandTarget IOleCommandTarget_iface
Definition: ieframe.h:189
IAdviseSink * sink
Definition: ieframe.h:203
VARIANT_BOOL full_screen
Definition: ieframe.h:224
unsigned length
Definition: ieframe.h:168
void(* task_proc_t)(DocHost *, struct _task_header_t *)
Definition: ieframe.h:75
IWebBrowser2 IWebBrowser2_iface
Definition: ieframe.h:232
VARIANT_BOOL offline
Definition: ieframe.h:154
ConnectionPointContainer cps
Definition: ieframe.h:173
IWebBrowser2 * wb
Definition: ieframe.h:133
void DocHost_Release(DocHost *) DECLSPEC_HIDDEN
Definition: dochost.c:1127
void WebBrowser_OleObject_Init(WebBrowser *) DECLSPEC_HIDDEN
Definition: oleobject.c:1199
void handle_navigation_error(DocHost *, HRESULT, BSTR, IHTMLWindow2 *) DECLSPEC_HIDDEN
Definition: navigate.c:310
void register_iewindow_class(void) DECLSPEC_HIDDEN
Definition: iexplore.c:713
void DocHost_ClientSite_Init(DocHost *) DECLSPEC_HIDDEN
Definition: client.c:712
HRESULT get_typeinfo(tid_t, ITypeInfo **) DECLSPEC_HIDDEN
Definition: ieframe_main.c:61
IOleObject IOleObject_iface
Definition: ieframe.h:180
VARIANT_BOOL visible
Definition: ieframe.h:219
unsigned int BOOL
Definition: ntddk_ex.h:94
long LONG
Definition: pedump.c:60
IEHTMLWindow html_window
Definition: ieframe.h:174
DWORD sink_aspects
Definition: ieframe.h:204
VARIANT_BOOL status_bar
Definition: ieframe.h:222
SIZEL extent
Definition: ieframe.h:214
void unregister_iewindow_class(void) DECLSPEC_HIDDEN
Definition: iexplore.c:735
HlinkFrame hlink_frame
Definition: ieframe.h:235
void WebBrowser_OleObject_Destroy(WebBrowser *) DECLSPEC_HIDDEN
Definition: oleobject.c:1222
DWORD prop_notif_cookie
Definition: ieframe.h:159
void update_navigation_commands(DocHost *dochost) DECLSPEC_HIDDEN
Definition: dochost.c:106
READYSTATE ready_state
Definition: ieframe.h:157
const WCHAR * str
IBrowserService IBrowserService_iface
Definition: ieframe.h:86
void set_doc_state(DocHost *, READYSTATE) DECLSPEC_HIDDEN
Definition: dochost.c:235
HWND toolbar_hwnd
Definition: ieframe.h:242
INewWindowManager INewWindowManager_iface
Definition: ieframe.h:100
struct list task_queue
Definition: ieframe.h:149
HRESULT go_home(DocHost *) DECLSPEC_HIDDEN
Definition: navigate.c:1060
smooth NULL
Definition: ftsmooth.c:416
BOOL is_prop_notif
Definition: ieframe.h:160
static LPWSTR co_strdupAtoW(LPCSTR str)
Definition: ieframe.h:367
travellog_entry_t * log
Definition: ieframe.h:166
IOleInPlaceFrame IOleInPlaceFrame_iface
Definition: ieframe.h:131
Definition: ieframe.h:104
HRESULT go_forward(DocHost *) DECLSPEC_HIDDEN
Definition: navigate.c:1127
HRESULT create_shell_ui_helper(IShellUIHelper2 **) DECLSPEC_HIDDEN
IUnknown * outer
Definition: ieframe.h:69
struct _IDocHostContainerVtbl IDocHostContainerVtbl
IUnknown * document
Definition: ieframe.h:140
const char * LPCSTR
Definition: xmlstorage.h:183
#define TID_LIST
Definition: ieframe.h:306
HWND shell_embedding_hwnd
Definition: ieframe.h:216
void(* task_destr_t)(struct _task_header_t *)
Definition: ieframe.h:76
static IHlinkFrame HlinkFrame
Definition: htmldoc.c:852
void WebBrowser_ClassInfo_Init(WebBrowser *) DECLSPEC_HIDDEN
Definition: classinfo.c:100
IViewObject2 IViewObject2_iface
Definition: ieframe.h:187
RECT clip_rect
Definition: ieframe.h:212
GLsizeiptr size
Definition: glext.h:5919
IPropertyNotifySink IPropertyNotifySink_iface
Definition: ieframe.h:127
void InternetExplorer_WebBrowser_Init(InternetExplorer *) DECLSPEC_HIDDEN
Definition: ie.c:839
__wchar_t WCHAR
Definition: xmlstorage.h:180
LONG HRESULT
Definition: typedefs.h:77
HRESULT create_browser_service(DocHost *, ShellBrowser **) DECLSPEC_HIDDEN
Definition: shellbrowser.c:924
struct _task_header_t task_header_t
void on_commandstate_change(DocHost *, LONG, BOOL) DECLSPEC_HIDDEN
Definition: dochost.c:83
HlinkFrame hlink_frame
Definition: ieframe.h:192
#define WINAPI
Definition: msvc.h:8
static void unlock_module(void)
Definition: ieframe.h:339
unsigned long DWORD
Definition: ntddk_ex.h:95
IPersistMemory IPersistMemory_iface
Definition: ieframe.h:184
HRESULT set_dochost_url(DocHost *, const WCHAR *) DECLSPEC_HIDDEN
Definition: navigate.c:130
IHlinkFrame IHlinkFrame_iface
Definition: ieframe.h:63
struct DocHost::@406 travellog
IWebBrowser2 IWebBrowser2_iface
Definition: ieframe.h:179
IServiceProvider IServiceProvider_iface
Definition: ieframe.h:128
DWORD release_extern_ref(InternetExplorer *, BOOL) DECLSPEC_HIDDEN
Definition: ie.c:723
void detach_browser_service(ShellBrowser *) DECLSPEC_HIDDEN
Definition: shellbrowser.c:943
int ret
DocHost doc_host
Definition: ieframe.h:231
void release_dochost_client(DocHost *) DECLSPEC_HIDDEN
Definition: dochost.c:602
VARIANT_BOOL register_browser
Definition: ieframe.h:218
HWND hwnd
Definition: ieframe.h:146
IOleInPlaceActiveObject IOleInPlaceActiveObject_iface
Definition: ieframe.h:188
#define InterlockedDecrement
Definition: armddk.h:52
HRESULT navigate_url(DocHost *, LPCWSTR, const VARIANT *, const VARIANT *, VARIANT *, VARIANT *) DECLSPEC_HIDDEN
Definition: navigate.c:936
void NewWindowManager_Init(DocHost *) DECLSPEC_HIDDEN
IOleInPlaceSiteEx IOleInPlaceSiteEx_iface
Definition: ieframe.h:121
IServiceProvider IServiceProvider_iface
Definition: ieframe.h:234
#define memcpy(s1, s2, n)
Definition: mkisofs.h:878
GLenum GLsizei len
Definition: glext.h:6722
Definition: _list.h:228
void IEHTMLWindow_Init(DocHost *) DECLSPEC_HIDDEN
Definition: iehtmlwnd.c:692
struct list entry
Definition: ieframe.h:79
ConnectionPoint * wbe2
Definition: ieframe.h:55
HWND frame_hwnd
Definition: ieframe.h:209
LRESULT process_dochost_tasks(DocHost *) DECLSPEC_HIDDEN
Definition: dochost.c:55
IOleControl IOleControl_iface
Definition: ieframe.h:182
IOleClientSite * client_closed
Definition: ieframe.h:199
void ConnectionPointContainer_Init(ConnectionPointContainer *, IUnknown *) DECLSPEC_HIDDEN
Definition: events.c:431
IClassFactory InternetExplorerFactory
Definition: ieframe_main.c:243
static VARIANTARG static DISPID
Definition: ordinal.c:49
HWND status_hwnd
Definition: ieframe.h:241
#define InterlockedIncrement
Definition: armddk.h:53
HRESULT go_back(DocHost *) DECLSPEC_HIDDEN
Definition: navigate.c:1117
#define lstrcpyW
Definition: compat.h:406
void notify_download_state(DocHost *, BOOL) DECLSPEC_HIDDEN
Definition: navigate.c:149
IOleContainer * container
Definition: ieframe.h:200
IExternalConnection IExternalConnection_iface
Definition: ieframe.h:233
HRESULT dochost_object_available(DocHost *, IUnknown *) DECLSPEC_HIDDEN
Definition: dochost.c:305
IServiceProvider IServiceProvider_iface
Definition: ieframe.h:190
struct list entry
Definition: ieframe.h:246
INT version
Definition: ieframe.h:196
IOleInPlaceUIWindow * uiwindow
Definition: ieframe.h:210
LONG ref
Definition: ieframe.h:89
IDocHostUIHandler * hostui
Definition: ieframe.h:136
unsigned size
Definition: ieframe.h:167
#define MultiByteToWideChar
Definition: compat.h:100
IOleCommandTarget * olecmd
Definition: ieframe.h:138
IShellBrowser IShellBrowser_iface
Definition: ieframe.h:85
HRESULT get_location_url(DocHost *, BSTR *) DECLSPEC_HIDDEN
Definition: navigate.c:1137
void DocHost_Init(DocHost *, IWebBrowser2 *, const IDocHostContainerVtbl *) DECLSPEC_HIDDEN
Definition: dochost.c:1105
static LPWSTR co_strdupW(LPCWSTR str)
Definition: ieframe.h:359
static void lock_module(void)
Definition: ieframe.h:335
void(* set_url)(DocHost *, const WCHAR *)
Definition: ieframe.h:116
DocHost * doc_host
Definition: ieframe.h:91
void WebBrowser_ViewObject_Init(WebBrowser *) DECLSPEC_HIDDEN
Definition: view.c:253
VARIANT_BOOL address_bar
Definition: ieframe.h:221
struct stdole::DISPPARAMS DISPPARAMS
task_destr_t destr
Definition: ieframe.h:81
void abort_dochost_tasks(DocHost *, task_proc_t) DECLSPEC_HIDDEN
Definition: dochost.c:70
HRESULT WINAPI InternetExplorerManager_Create(IClassFactory *, IUnknown *, REFIID, void **) DECLSPEC_HIDDEN
Definition: iexplore.c:926
unsigned int ULONG
Definition: retypes.h:1
IOleControlSite IOleControlSite_iface
Definition: ieframe.h:124
HRESULT(* set_status_text)(DocHost *, const WCHAR *)
Definition: ieframe.h:114
IOleDocumentView * view
Definition: ieframe.h:141
IDispatch * client_disp
Definition: ieframe.h:135
IUnknown * doc_navigate
Definition: ieframe.h:142
HRESULT WINAPI WebBrowser_Create(IClassFactory *, IUnknown *, REFIID, void **) DECLSPEC_HIDDEN
Definition: webbrowser.c:1269
DocHost * doc_host
Definition: ieframe.h:101
RECT pos_rect
Definition: ieframe.h:211
ITargetFrame ITargetFrame_iface
Definition: ieframe.h:64
WCHAR * LPWSTR
Definition: xmlstorage.h:184
LONG_PTR LRESULT
Definition: windef.h:209
void create_doc_view_hwnd(DocHost *) DECLSPEC_HIDDEN
Definition: dochost.c:480
IPersistStorage IPersistStorage_iface
Definition: ieframe.h:183
HRESULT WINAPI InternetShortcut_Create(IClassFactory *, IUnknown *, REFIID, void **) DECLSPEC_HIDDEN
Definition: intshcut.c:824
DocHost * doc_host
Definition: ieframe.h:96
static const CLSID *static CLSID *static const GUID VARIANT VARIANT *static IServiceProvider DWORD *static HMENU
Definition: ordinal.c:60
IDocHostUIHandler2 IDocHostUIHandler2_iface
Definition: ieframe.h:122
static LPSTR co_strdupWtoA(LPCWSTR str)
Definition: ieframe.h:378
LPVOID WINAPI CoTaskMemAlloc(SIZE_T size)
Definition: ifs.c:406
static LPWSTR heap_strdupW(LPCWSTR str)
Definition: ieframe.h:343
ShellBrowser * browser_service
Definition: ieframe.h:162
struct ConnectionPointContainer ConnectionPointContainer
HRESULT refresh_document(DocHost *, const VARIANT *) DECLSPEC_HIDDEN
Definition: dochost.c:573
VARIANT_BOOL tool_bar
Definition: ieframe.h:223
void deactivate_document(DocHost *) DECLSPEC_HIDDEN
Definition: dochost.c:511
static IShellBrowser ShellBrowser
Definition: htmldoc.c:3702
NewWindowManager nwm
Definition: ieframe.h:175