shdocvw.h 7.32 KB
Newer Older
1
/*
2 3
 * Header includes for shdocvw.dll
 *
4
 * Copyright 2001 John R. Sheets (for CodeWeavers)
5
 * Copyright 2005-2006 Jacek Caban for CodeWeavers
6 7 8 9 10 11 12 13 14 15 16 17 18 19
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
20 21
 */

22 23 24
#ifndef __WINE_SHDOCVW_H
#define __WINE_SHDOCVW_H

25
#define COM_NO_WINDOWS_H
26 27
#define COBJMACROS

28 29 30
#include <stdarg.h>

#include "windef.h"
31
#include "winbase.h"
32
#include "wingdi.h"
33 34
#include "winuser.h"

35 36 37
#include "ole2.h"
#include "olectl.h"
#include "shlobj.h"
38
#include "exdisp.h"
39
#include "mshtmhst.h"
40
#include "hlink.h"
41

42 43 44 45 46
/**********************************************************************
 * Shell Instance Objects
 */
extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, 
    REFIID riid, LPVOID *ppvClassObj);
47 48

/**********************************************************************
49
 * WebBrowser declaration for SHDOCVW.DLL
50
 */
51 52 53

typedef struct ConnectionPoint ConnectionPoint;

54
typedef struct {
55
    const IOleClientSiteVtbl      *lpOleClientSiteVtbl;
56
    const IOleInPlaceSiteVtbl     *lpOleInPlaceSiteVtbl;
57
    const IDocHostUIHandler2Vtbl  *lpDocHostUIHandlerVtbl;
58
    const IOleDocumentSiteVtbl    *lpOleDocumentSiteVtbl;
59
    const IOleCommandTargetVtbl   *lpOleCommandTargetVtbl;
60
    const IDispatchVtbl           *lpDispatchVtbl;
61
    const IServiceProviderVtbl    *lpServiceProviderVtbl;
62

63 64 65
    /* Interfaces of InPlaceFrame object */
    const IOleInPlaceFrameVtbl          *lpOleInPlaceFrameVtbl;

66 67
    IDispatch *disp;

68 69
    IUnknown *document;
    IOleDocumentView *view;
70 71
    IDocHostUIHandler *hostui;

72 73
    HWND hwnd;
    HWND frame_hwnd;
74

75 76
    LPOLESTR url;

77 78 79 80 81
    /* Connection points */

    ConnectionPoint *cp_wbe2;
    ConnectionPoint *cp_wbe;
    ConnectionPoint *cp_pns;
82 83
} DocHost;

84
typedef struct {
85 86
    /* Interfaces available via WebBrowser object */

87
    const IWebBrowser2Vtbl              *lpWebBrowser2Vtbl;
88 89 90 91 92 93 94
    const IOleObjectVtbl                *lpOleObjectVtbl;
    const IOleInPlaceObjectVtbl         *lpOleInPlaceObjectVtbl;
    const IOleControlVtbl               *lpOleControlVtbl;
    const IPersistStorageVtbl           *lpPersistStorageVtbl;
    const IPersistStreamInitVtbl        *lpPersistStreamInitVtbl;
    const IProvideClassInfo2Vtbl        *lpProvideClassInfoVtbl;
    const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
95
    const IViewObject2Vtbl              *lpViewObjectVtbl;
96
    const IOleInPlaceActiveObjectVtbl   *lpOleInPlaceActiveObjectVtbl;
97
    const IOleCommandTargetVtbl         *lpWBOleCommandTargetVtbl;
98
    const IHlinkFrameVtbl               *lpHlinkFrameVtbl;
99

100
    LONG ref;
101 102

    IOleClientSite *client;
103
    IOleContainer *container;
104
    IOleInPlaceSite *inplace;
105 106 107 108 109 110 111 112 113 114

    /* window context */

    HWND iphwnd;
    HWND frame_hwnd;
    IOleInPlaceFrame *frame;
    IOleInPlaceUIWindow *uiwindow;
    RECT pos_rect;
    RECT clip_rect;
    OLEINPLACEFRAMEINFO frameinfo;
115

116 117
    HWND shell_embedding_hwnd;

118
    VARIANT_BOOL visible;
119
    VARIANT_BOOL menu_bar;
120
    VARIANT_BOOL address_bar;
121
    VARIANT_BOOL status_bar;
122
    VARIANT_BOOL tool_bar;
123

124
    DocHost doc_host;
125 126
} WebBrowser;

127 128 129 130 131 132 133 134 135 136
typedef struct {
    const IWebBrowser2Vtbl *lpWebBrowser2Vtbl;

    LONG ref;

    HWND frame_hwnd;

    DocHost doc_host;
} InternetExplorer;

137 138
#define WEBBROWSER(x)   ((IWebBrowser*)                 &(x)->lpWebBrowser2Vtbl)
#define WEBBROWSER2(x)  ((IWebBrowser2*)                &(x)->lpWebBrowser2Vtbl)
139 140 141 142 143 144 145
#define OLEOBJ(x)       ((IOleObject*)                  &(x)->lpOleObjectVtbl)
#define INPLACEOBJ(x)   ((IOleInPlaceObject*)           &(x)->lpOleInPlaceObjectVtbl)
#define CONTROL(x)      ((IOleControl*)                 &(x)->lpOleControlVtbl)
#define PERSTORAGE(x)   ((IPersistStorage*)             &(x)->lpPersistStorageVtbl)
#define PERSTRINIT(x)   ((IPersistStreamInit*)          &(x)->lpPersistStreamInitVtbl)
#define CLASSINFO(x)    ((IProvideClassInfo2*)          &(x)->lpProvideClassInfoVtbl)
#define CONPTCONT(x)    ((IConnectionPointContainer*)   &(x)->lpConnectionPointContainerVtbl)
146 147
#define VIEWOBJ(x)      ((IViewObject*)                 &(x)->lpViewObjectVtbl);
#define VIEWOBJ2(x)     ((IViewObject2*)                &(x)->lpViewObjectVtbl);
148
#define ACTIVEOBJ(x)    ((IOleInPlaceActiveObject*)     &(x)->lpOleInPlaceActiveObjectVtbl)
149
#define WBOLECMD(x)     ((IOleCommandTarget*)           &(x)->lpWBOleCommandTargetVtbl)
150
#define HLINKFRAME(x)   ((IHlinkFrame*)                 &(x)->lpHlinkFrameVtbl)
151

152
#define CLIENTSITE(x)   ((IOleClientSite*)              &(x)->lpOleClientSiteVtbl)
153
#define INPLACESITE(x)  ((IOleInPlaceSite*)             &(x)->lpOleInPlaceSiteVtbl)
154 155
#define DOCHOSTUI(x)    ((IDocHostUIHandler*)           &(x)->lpDocHostUIHandlerVtbl)
#define DOCHOSTUI2(x)   ((IDocHostUIHandler2*)          &(x)->lpDocHostUIHandlerVtbl)
156
#define DOCSITE(x)      ((IOleDocumentSite*)            &(x)->lpOleDocumentSiteVtbl)
157
#define CLOLECMD(x)     ((IOleCommandTarget*)           &(x)->lpOleCommandTargetVtbl)
158
#define CLDISP(x)       ((IDispatch*)                   &(x)->lpDispatchVtbl)
159
#define SERVPROV(x)     ((IServiceProvider*)            &(x)->lpServiceProviderVtbl)
160

161 162
#define INPLACEFRAME(x) ((IOleInPlaceFrame*)            &(x)->lpOleInPlaceFrameVtbl)

163
void WebBrowser_OleObject_Init(WebBrowser*);
164
void WebBrowser_ViewObject_Init(WebBrowser*);
165
void WebBrowser_Persist_Init(WebBrowser*);
166
void WebBrowser_ClassInfo_Init(WebBrowser*);
167
void WebBrowser_Events_Init(WebBrowser*);
168
void WebBrowser_HlinkFrame_Init(WebBrowser*);
169

170 171
void WebBrowser_OleObject_Destroy(WebBrowser*);

172
void DocHost_Init(DocHost*,IDispatch*);
173
void DocHost_ClientSite_Init(DocHost*);
174
void DocHost_Events_Init(DocHost*);
175
void DocHost_Frame_Init(DocHost*);
176

177 178 179
void DocHost_Release(DocHost*);
void DocHost_ClientSite_Release(DocHost*);
void DocHost_Events_Release(DocHost*);
180

181
HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
182

183
void create_doc_view_hwnd(DocHost*);
184
void deactivate_document(DocHost*);
185
void call_sink(ConnectionPoint*,DISPID,DISPPARAMS*);
186
HRESULT navigate_url(DocHost*,LPCWSTR,PBYTE,ULONG,LPWSTR);
Jacek Caban's avatar
Jacek Caban committed
187

188 189
HRESULT create_mozctl(REFIID,void**);

190 191 192
HRESULT InternetExplorer_Create(IUnknown*,REFIID,void**);
void InternetExplorer_WebBrowser_Init(InternetExplorer*);

Jacek Caban's avatar
Jacek Caban committed
193 194
#define WB_WM_NAVIGATE2 (WM_USER+100)

195 196
#define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))

197 198 199 200
/**********************************************************************
 * Dll lifetime tracking declaration for shdocvw.dll
 */
extern LONG SHDOCVW_refCount;
201 202
static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
203

204
extern HINSTANCE shdocvw_hinstance;
205 206
extern void register_iewindow_class(void);
extern void unregister_iewindow_class(void);
207

208 209
HRESULT register_class_object(BOOL);

210
#endif /* __WINE_SHDOCVW_H */