shdocvw: Get rid of Mozilla ActiveX control dependency.
[wine/dcerpc.git] / dlls / shdocvw / shdocvw.h
blob4b0732359f059be27349e86c50764b1fca8589e5
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 COM_NO_WINDOWS_H
26 #define COBJMACROS
28 #include <stdarg.h>
30 #include "windef.h"
31 #include "winbase.h"
32 #include "wingdi.h"
33 #include "winuser.h"
35 #include "ole2.h"
36 #include "olectl.h"
37 #include "shlobj.h"
38 #include "exdisp.h"
39 #include "mshtmhst.h"
40 #include "hlink.h"
42 /**********************************************************************
43 * Shell Instance Objects
45 extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid,
46 REFIID riid, LPVOID *ppvClassObj);
48 /**********************************************************************
49 * WebBrowser declaration for SHDOCVW.DLL
52 typedef struct ConnectionPoint ConnectionPoint;
54 typedef struct {
55 const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
57 ConnectionPoint *wbe2;
58 ConnectionPoint *wbe;
59 ConnectionPoint *pns;
61 IUnknown *impl;
62 } ConnectionPointContainer;
64 typedef struct {
65 const IOleClientSiteVtbl *lpOleClientSiteVtbl;
66 const IOleInPlaceSiteVtbl *lpOleInPlaceSiteVtbl;
67 const IDocHostUIHandler2Vtbl *lpDocHostUIHandlerVtbl;
68 const IOleDocumentSiteVtbl *lpOleDocumentSiteVtbl;
69 const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
70 const IDispatchVtbl *lpDispatchVtbl;
71 const IServiceProviderVtbl *lpServiceProviderVtbl;
73 /* Interfaces of InPlaceFrame object */
74 const IOleInPlaceFrameVtbl *lpOleInPlaceFrameVtbl;
76 IDispatch *disp;
78 IUnknown *document;
79 IOleDocumentView *view;
80 IDocHostUIHandler *hostui;
82 HWND hwnd;
83 HWND frame_hwnd;
85 LPOLESTR url;
87 ConnectionPointContainer cps;
88 } DocHost;
90 typedef struct {
91 /* Interfaces available via WebBrowser object */
93 const IWebBrowser2Vtbl *lpWebBrowser2Vtbl;
94 const IOleObjectVtbl *lpOleObjectVtbl;
95 const IOleInPlaceObjectVtbl *lpOleInPlaceObjectVtbl;
96 const IOleControlVtbl *lpOleControlVtbl;
97 const IPersistStorageVtbl *lpPersistStorageVtbl;
98 const IPersistStreamInitVtbl *lpPersistStreamInitVtbl;
99 const IProvideClassInfo2Vtbl *lpProvideClassInfoVtbl;
100 const IViewObject2Vtbl *lpViewObjectVtbl;
101 const IOleInPlaceActiveObjectVtbl *lpOleInPlaceActiveObjectVtbl;
102 const IOleCommandTargetVtbl *lpOleCommandTargetVtbl;
103 const IHlinkFrameVtbl *lpHlinkFrameVtbl;
105 LONG ref;
107 INT version;
109 IOleClientSite *client;
110 IOleContainer *container;
111 IOleInPlaceSite *inplace;
113 /* window context */
115 HWND iphwnd;
116 HWND frame_hwnd;
117 IOleInPlaceFrame *frame;
118 IOleInPlaceUIWindow *uiwindow;
119 RECT pos_rect;
120 RECT clip_rect;
121 OLEINPLACEFRAMEINFO frameinfo;
123 HWND shell_embedding_hwnd;
125 VARIANT_BOOL visible;
126 VARIANT_BOOL menu_bar;
127 VARIANT_BOOL address_bar;
128 VARIANT_BOOL status_bar;
129 VARIANT_BOOL tool_bar;
131 DocHost doc_host;
132 } WebBrowser;
134 typedef struct {
135 const IWebBrowser2Vtbl *lpWebBrowser2Vtbl;
137 LONG ref;
139 HWND frame_hwnd;
141 DocHost doc_host;
142 } InternetExplorer;
144 #define WEBBROWSER(x) ((IWebBrowser*) &(x)->lpWebBrowser2Vtbl)
145 #define WEBBROWSER2(x) ((IWebBrowser2*) &(x)->lpWebBrowser2Vtbl)
146 #define OLEOBJ(x) ((IOleObject*) &(x)->lpOleObjectVtbl)
147 #define INPLACEOBJ(x) ((IOleInPlaceObject*) &(x)->lpOleInPlaceObjectVtbl)
148 #define CONTROL(x) ((IOleControl*) &(x)->lpOleControlVtbl)
149 #define PERSTORAGE(x) ((IPersistStorage*) &(x)->lpPersistStorageVtbl)
150 #define PERSTRINIT(x) ((IPersistStreamInit*) &(x)->lpPersistStreamInitVtbl)
151 #define CLASSINFO(x) ((IProvideClassInfo2*) &(x)->lpProvideClassInfoVtbl)
152 #define CONPTCONT(x) ((IConnectionPointContainer*) &(x)->lpConnectionPointContainerVtbl)
153 #define VIEWOBJ(x) ((IViewObject*) &(x)->lpViewObjectVtbl);
154 #define VIEWOBJ2(x) ((IViewObject2*) &(x)->lpViewObjectVtbl);
155 #define ACTIVEOBJ(x) ((IOleInPlaceActiveObject*) &(x)->lpOleInPlaceActiveObjectVtbl)
156 #define OLECMD(x) ((IOleCommandTarget*) &(x)->lpOleCommandTargetVtbl)
157 #define HLINKFRAME(x) ((IHlinkFrame*) &(x)->lpHlinkFrameVtbl)
159 #define CLIENTSITE(x) ((IOleClientSite*) &(x)->lpOleClientSiteVtbl)
160 #define INPLACESITE(x) ((IOleInPlaceSite*) &(x)->lpOleInPlaceSiteVtbl)
161 #define DOCHOSTUI(x) ((IDocHostUIHandler*) &(x)->lpDocHostUIHandlerVtbl)
162 #define DOCHOSTUI2(x) ((IDocHostUIHandler2*) &(x)->lpDocHostUIHandlerVtbl)
163 #define DOCSITE(x) ((IOleDocumentSite*) &(x)->lpOleDocumentSiteVtbl)
164 #define CLDISP(x) ((IDispatch*) &(x)->lpDispatchVtbl)
165 #define SERVPROV(x) ((IServiceProvider*) &(x)->lpServiceProviderVtbl)
167 #define INPLACEFRAME(x) ((IOleInPlaceFrame*) &(x)->lpOleInPlaceFrameVtbl)
169 void WebBrowser_OleObject_Init(WebBrowser*);
170 void WebBrowser_ViewObject_Init(WebBrowser*);
171 void WebBrowser_Persist_Init(WebBrowser*);
172 void WebBrowser_ClassInfo_Init(WebBrowser*);
173 void WebBrowser_HlinkFrame_Init(WebBrowser*);
175 void WebBrowser_OleObject_Destroy(WebBrowser*);
177 void DocHost_Init(DocHost*,IDispatch*);
178 void DocHost_ClientSite_Init(DocHost*);
179 void DocHost_Frame_Init(DocHost*);
181 void DocHost_Release(DocHost*);
182 void DocHost_ClientSite_Release(DocHost*);
184 void ConnectionPointContainer_Init(ConnectionPointContainer*,IUnknown*);
185 void ConnectionPointContainer_Destroy(ConnectionPointContainer*);
187 HRESULT WebBrowserV1_Create(IUnknown*,REFIID,void**);
188 HRESULT WebBrowserV2_Create(IUnknown*,REFIID,void**);
190 void create_doc_view_hwnd(DocHost*);
191 void deactivate_document(DocHost*);
192 void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*);
193 HRESULT navigate_url(DocHost*,LPCWSTR,PBYTE,ULONG,LPWSTR);
195 HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**);
196 void InternetExplorer_WebBrowser_Init(InternetExplorer*);
198 #define WB_WM_NAVIGATE2 (WM_USER+100)
200 #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
202 /**********************************************************************
203 * Dll lifetime tracking declaration for shdocvw.dll
205 extern LONG SHDOCVW_refCount;
206 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
207 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
209 extern HINSTANCE shdocvw_hinstance;
210 extern void register_iewindow_class(void);
211 extern void unregister_iewindow_class(void);
213 HRESULT register_class_object(BOOL);
215 /* memory allocation functions */
217 static inline void *shdocvw_alloc(size_t len)
219 return HeapAlloc(GetProcessHeap(), 0, len);
222 static inline void *shdocvw_realloc(void *mem, size_t len)
224 return HeapReAlloc(GetProcessHeap(), 0, mem, len);
227 static inline BOOL shdocvw_free(void *mem)
229 return HeapFree(GetProcessHeap(), 0, mem);
232 #endif /* __WINE_SHDOCVW_H */