Better windows handling.
[wine] / dlls / shdocvw / shdocvw.h
1 /*
2  * Header includes for shdocvw.dll
3  *
4  * Copyright 2001 John R. Sheets (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., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
19  */
20
21 #ifndef __WINE_SHDOCVW_H
22 #define __WINE_SHDOCVW_H
23
24 #define COM_NO_WINDOWS_H
25 #define COBJMACROS
26
27 #include <stdarg.h>
28
29 #include "windef.h"
30 #include "winbase.h"
31 #include "wingdi.h"
32 #include "winuser.h"
33
34 #include "ole2.h"
35 #include "olectl.h"
36 #include "shlobj.h"
37 #include "exdisp.h"
38 #include "mshtmhst.h"
39
40 /**********************************************************************
41  * IClassFactory declaration for SHDOCVW.DLL
42  */
43 typedef struct
44 {
45     /* IUnknown fields */
46     const IClassFactoryVtbl *lpVtbl;
47     LONG ref;
48 } IClassFactoryImpl;
49
50 extern IClassFactoryImpl SHDOCVW_ClassFactory;
51
52 /**********************************************************************
53  * Shell Instance Objects
54  */
55 extern HRESULT SHDOCVW_GetShellInstanceObjectClassObject(REFCLSID rclsid, 
56     REFIID riid, LPVOID *ppvClassObj);
57
58 /**********************************************************************
59  * WebBrowser declaration for SHDOCVW.DLL
60  */
61 typedef struct {
62     /* Interfaces available via WebBrowser object */
63
64     const IWebBrowser2Vtbl              *lpWebBrowser2Vtbl;
65     const IOleObjectVtbl                *lpOleObjectVtbl;
66     const IOleInPlaceObjectVtbl         *lpOleInPlaceObjectVtbl;
67     const IOleControlVtbl               *lpOleControlVtbl;
68     const IPersistStorageVtbl           *lpPersistStorageVtbl;
69     const IPersistStreamInitVtbl        *lpPersistStreamInitVtbl;
70     const IProvideClassInfo2Vtbl        *lpProvideClassInfoVtbl;
71     const IQuickActivateVtbl            *lpQuickActivateVtbl;
72     const IConnectionPointContainerVtbl *lpConnectionPointContainerVtbl;
73     const IViewObject2Vtbl              *lpViewObjectVtbl;
74
75     /* Interfaces available for embeded document */
76
77     const IOleClientSiteVtbl            *lpOleClientSiteVtbl;
78     const IOleInPlaceSiteVtbl           *lpOleInPlaceSiteVtbl;
79     const IDocHostUIHandler2Vtbl        *lpDocHostUIHandlerVtbl;
80
81     /* Interfaces of InPlaceFrame object */
82
83     const IOleInPlaceFrameVtbl          *lpOleInPlaceFrameVtbl;
84
85     LONG ref;
86
87     IUnknown *document;
88
89     IOleClientSite *client;
90     IOleContainer *container;
91
92     /* window context */
93
94     HWND iphwnd;
95     HWND frame_hwnd;
96     IOleInPlaceFrame *frame;
97     IOleInPlaceUIWindow *uiwindow;
98     RECT pos_rect;
99     RECT clip_rect;
100     OLEINPLACEFRAMEINFO frameinfo;
101
102     HWND doc_view_hwnd;
103     HWND shell_embedding_hwnd;
104
105     /* Connection points */
106
107     IConnectionPoint *cp_wbe2;
108     IConnectionPoint *cp_wbe;
109     IConnectionPoint *cp_pns;
110 } WebBrowser;
111
112 #define WEBBROWSER(x)   ((IWebBrowser*)                 &(x)->lpWebBrowser2Vtbl)
113 #define WEBBROWSER2(x)  ((IWebBrowser2*)                &(x)->lpWebBrowser2Vtbl)
114 #define OLEOBJ(x)       ((IOleObject*)                  &(x)->lpOleObjectVtbl)
115 #define INPLACEOBJ(x)   ((IOleInPlaceObject*)           &(x)->lpOleInPlaceObjectVtbl)
116 #define CONTROL(x)      ((IOleControl*)                 &(x)->lpOleControlVtbl)
117 #define PERSTORAGE(x)   ((IPersistStorage*)             &(x)->lpPersistStorageVtbl)
118 #define PERSTRINIT(x)   ((IPersistStreamInit*)          &(x)->lpPersistStreamInitVtbl)
119 #define CLASSINFO(x)    ((IProvideClassInfo2*)          &(x)->lpProvideClassInfoVtbl)
120 #define QUICKACT(x)     ((IQuickActivate*)              &(x)->lpQuickActivateVtbl)
121 #define CONPTCONT(x)    ((IConnectionPointContainer*)   &(x)->lpConnectionPointContainerVtbl)
122 #define VIEWOBJ(x)      ((IViewObject*)                 &(x)->lpViewObjectVtbl);
123 #define VIEWOBJ2(x)     ((IViewObject2*)                &(x)->lpViewObjectVtbl);
124
125 #define CLIENTSITE(x)   ((IOleClientSite*)              &(x)->lpOleClientSiteVtbl)
126 #define INPLACESITE(x)  ((IOleInPlaceSite*)             &(x)->lpOleInPlaceSiteVtbl)
127 #define DOCHOSTUI(x)    ((IDocHostUIHandler*)           &(x)->lpDocHostUIHandlerVtbl)
128 #define DOCHOSTUI2(x)   ((IDocHostUIHandler2*)          &(x)->lpDocHostUIHandlerVtbl)
129
130 #define INPLACEFRAME(x) ((IOleInPlaceFrame*)            &(x)->lpOleInPlaceFrameVtbl)
131
132 void WebBrowser_OleObject_Init(WebBrowser*);
133 void WebBrowser_ViewObject_Init(WebBrowser*);
134 void WebBrowser_Persist_Init(WebBrowser*);
135 void WebBrowser_ClassInfo_Init(WebBrowser*);
136 void WebBrowser_Misc_Init(WebBrowser*);
137 void WebBrowser_Events_Init(WebBrowser*);
138
139 void WebBrowser_ClientSite_Init(WebBrowser*);
140 void WebBrowser_DocHost_Init(WebBrowser*);
141
142 void WebBrowser_Frame_Init(WebBrowser*);
143
144 void WebBrowser_OleObject_Destroy(WebBrowser*);
145 void WebBrowser_Events_Destroy(WebBrowser*);
146
147 HRESULT WebBrowser_Create(IUnknown*,REFIID,void**);
148
149 void create_doc_view_hwnd(WebBrowser *This);
150
151 #define DEFINE_THIS(cls,ifc,iface) ((cls*)((BYTE*)(iface)-offsetof(cls,lp ## ifc ## Vtbl)))
152
153 /**********************************************************************
154  * Dll lifetime tracking declaration for shdocvw.dll
155  */
156 extern LONG SHDOCVW_refCount;
157 static inline void SHDOCVW_LockModule(void) { InterlockedIncrement( &SHDOCVW_refCount ); }
158 static inline void SHDOCVW_UnlockModule(void) { InterlockedDecrement( &SHDOCVW_refCount ); }
159
160 extern HINSTANCE shdocvw_hinstance;
161
162 #endif /* __WINE_SHDOCVW_H */