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