push 83f6eeab4f78cf34cba36fe6c2150f9c23ec0aba
[wine/hacks.git] / dlls / shdocvw / shdocvw.h
blobd4210250f3ea748c9e828dc0ddf51d958ecb4458
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"
41 /**********************************************************************
42 * Shell Instance Objects
44 extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
45 REFIID riid, LPVOID *ppvClassObj);
47 /**********************************************************************
48 * WebBrowser declaration for SHDOCVW.DLL
51 typedef struct ConnectionPoint ConnectionPoint;
53 typedef struct {
54 const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
56 ConnectionPoint *wbe2;
57 ConnectionPoint *wbe;
58 ConnectionPoint *pns;
60 IUnknown *impl;
61 } ConnectionPointContainer;
63 typedef struct {
64 const IOleClientSiteVtbl *lpOleClientSiteVtbl;
65 const IOleInPlaceSiteVtbl *lpOleInPlaceSiteVtbl;
66 const IDocHostUIHandler2Vtbl *lpDocHostUIHandlerVtbl;
67 const IOleDocumentSiteVtbl *lpOleDocumentSiteVtbl;
68 const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
69 const IDispatchVtbl *lpDispatchVtbl;
70 const IServiceProviderVtbl *lpServiceProviderVtbl;
72 /* Interfaces of InPlaceFrame object */
73 const IOleInPlaceFrameVtbl *lpOleInPlaceFrameVtbl;
75 IDispatch *disp;
77 IDispatch *client_disp;
78 IDocHostUIHandler *hostui;
79 IOleInPlaceFrame *frame;
81 IUnknown *document;
82 IOleDocumentView *view;
84 HWND hwnd;
85 HWND frame_hwnd;
87 LPOLESTR url;
89 VARIANT_BOOL silent;
90 VARIANT_BOOL offline;
92 ConnectionPointContainer cps;
93 } DocHost;
95 struct WebBrowser {
96 /* Interfaces available via WebBrowser object */
98 const IWebBrowser2Vtbl *lpWebBrowser2Vtbl;
99 const IOleObjectVtbl *lpOleObjectVtbl;
100 const IOleInPlaceObjectVtbl *lpOleInPlaceObjectVtbl;
101 const IOleControlVtbl *lpOleControlVtbl;
102 const IPersistStorageVtbl *lpPersistStorageVtbl;
103 const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
104 const IProvideClassInfo2Vtbl *lpProvideClassInfoVtbl;
105 const IViewObject2Vtbl *lpViewObjectVtbl;
106 const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl;
107 const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
108 const IHlinkFrameVtbl *lpHlinkFrameVtbl;
110 LONG ref;
112 INT version;
114 IOleClientSite *client;
115 IOleContainer *container;
116 IOleInPlaceSite *inplace;
118 /* window context */
120 HWND frame_hwnd;
121 IOleInPlaceUIWindow *uiwindow;
122 RECT pos_rect;
123 RECT clip_rect;
124 OLEINPLACEFRAMEINFO frameinfo;
125 SIZEL extent;
127 HWND shell_embedding_hwnd;
129 VARIANT_BOOL visible;
130 VARIANT_BOOL menu_bar;
131 VARIANT_BOOL address_bar;
132 VARIANT_BOOL status_bar;
133 VARIANT_BOOL tool_bar;
135 DocHost doc_host;
138 struct InternetExplorer {
139 const IWebBrowser2Vtbl *lpWebBrowser2Vtbl;
141 LONG ref;
143 HWND frame_hwnd;
145 DocHost doc_host;
148 #define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
149 #define WEBBROWSER2(x) ((IWebBrowser2*) &(x)->lpWebBrowser2Vtbl)
150 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
151 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
152 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
153 #define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
154 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
155 #define CLASSINFO(x) ((IProvideClassInfo2*) &(x)->lpProvideClassInfoVtbl)
156 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
157 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl);
158 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl);
159 #define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
160 #define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
161 #define HLINKFRAME(x) ((IHlinkFrame*) &(x)->lpHlinkFrameVtbl)
163 #define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpOleClientSiteVtbl)
164 #define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpOleInPlaceSiteVtbl)
165 #define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpDocHostUIHandlerVtbl)
166 #define DOCHOSTUI2(x) ((IDocHostUIHandler2*) &(x)->lpDocHostUIHandlerVtbl)
167 #define DOCSITE(x) ((IOleDocumentSite*) &(x)->lpOleDocumentSiteVtbl)
168 #define CLDISP(x) ((IDispatch*) &(x)->lpDispatchVtbl)
169 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
171 #define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpOleInPlaceFrameVtbl)
173 void WebBrowser_OleObject_Init(WebBrowser*);
174 void WebBrowser_ViewObject_Init(WebBrowser*);
175 void WebBrowser_Persist_Init(WebBrowser*);
176 void WebBrowser_ClassInfo_Init(WebBrowser*);
177 void WebBrowser_HlinkFrame_Init(WebBrowser*);
179 void WebBrowser_OleObject_Destroy(WebBrowser*);
181 void DocHost_Init(DocHost*,IDispatch*);
182 void DocHost_ClientSite_Init(DocHost*);
183 void DocHost_Frame_Init(DocHost*);
185 void DocHost_Release(DocHost*);
186 void DocHost_ClientSite_Release(DocHost*);
188 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
189 void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
191 HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**);
192 HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**);
194 void create_doc_view_hwnd(DocHost*);
195 void deactivate_document(DocHost*);
196 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*);
197 HRESULT navigate_url(DocHost*,BSTR,const VARIANT*,const VARIANT*,VARIANT*,VARIANT*);
199 HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**);
200 void InternetExplorer_WebBrowser_Init(InternetExplorer*);
202 HRESULT CUrlHistory_Create(IUnknown*,REFIID,void**);
204 #define WB_WM_NAVIGATE2 (WM_USER+100)
206 #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
208 /**********************************************************************
209 * Dll lifetime tracking declaration for shdocvw.dll
211 extern LONG SHDOCVW_refCount;
212 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
213 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
215 extern HINSTANCE shdocvw_hinstance;
216 extern void register_iewindow_class(void);
217 extern void unregister_iewindow_class(void);
219 HRESULT register_class_object(BOOL);
220 HRESULT get_typeinfo(ITypeInfo**);
222 /* memory allocation functions */
224 static inline void *shdocvw_alloc(size_t len)
226 return HeapAlloc(GetProcessHeap(), 0, len);
229 static inline void *shdocvw_realloc(void *mem, size_t len)
231 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
234 static inline BOOL shdocvw_free(void *mem)
236 return HeapFree(GetProcessHeap(), 0, mem);
239 #endif /* __WINE_SHDOCVW_H */