For global classes, GetClassInfo now returns a handle to USER.
[wine] / include / docobj.h
1 #ifndef __WINE__
2 #include "rpc.h"
3 #include "rpcndr.h"
4 #ifndef COM_NO_WINDOWS_H
5 #include "windows.h"
6 #include "ole2.h"
7 #endif
8 #endif
9
10 #ifndef __WINE_DOCOBJ_H
11 #define __WINE_DOCOBJ_H
12
13 #include "winbase.h"
14 #include "windef.h"
15 #include "wingdi.h"
16 #include "winuser.h"
17 #include "ole2.h"
18 #include "wine/obj_oleaut.h"
19
20 /*****************************************************************************
21  * Declare the structures
22  */
23 typedef enum
24 {
25         OLECMDF_SUPPORTED = 0x1,
26         OLECMDF_ENABLED = 0x2,
27         OLECMDF_LATCHED = 0x4,
28         OLECMDF_NINCHED = 0x8
29 } OLECMDF;
30
31 typedef struct _tagOLECMD
32 {
33         ULONG cmdID;
34         DWORD cmdf;
35 } OLECMD;
36
37 typedef struct _tagOLECMDTEXT
38 {
39         DWORD cmdtextf;
40         ULONG cwActual;
41         ULONG cwBuf;
42         WCHAR rgwz[1];
43 } OLECMDTEXT;
44
45 typedef enum 
46
47         PRINTFLAG_MAYBOTHERUSER = 1,
48         PRINTFLAG_PROMPTUSER  = 2,
49         PRINTFLAG_USERMAYCHANGEPRINTER  = 4,
50         PRINTFLAG_RECOMPOSETODEVICE = 8,
51         PRINTFLAG_DONTACTUALLYPRINT = 16,
52         PRINTFLAG_FORCEPROPERTIES = 32,
53         PRINTFLAG_PRINTTOFILE = 64
54 } PRINTFLAG;
55
56 typedef struct tagPAGERANGE
57 {
58         LONG nFromPage;
59         LONG nToPage;
60 } PAGERANGE;
61
62 typedef struct  tagPAGESET
63 {
64         ULONG cbStruct;
65         BOOL fOddPages;
66         BOOL fEvenPages;
67         ULONG cPageRange;
68         PAGERANGE rgPages[ 1 ];
69 } PAGESET;
70
71 typedef enum
72 {
73         OLECMDTEXTF_NONE  = 0,
74         OLECMDTEXTF_NAME  = 1,
75         OLECMDTEXTF_STATUS  = 2
76 } OLECMDTEXTF;
77
78 typedef enum 
79 {
80         OLECMDEXECOPT_DODEFAULT = 0,
81         OLECMDEXECOPT_PROMPTUSER  = 1,
82         OLECMDEXECOPT_DONTPROMPTUSER  = 2,
83         OLECMDEXECOPT_SHOWHELP  = 3
84 } OLECMDEXECOPT;
85
86 typedef enum OLECMDID
87 {
88         OLECMDID_OPEN = 1,
89         OLECMDID_NEW = 2,
90         OLECMDID_SAVE = 3,
91         OLECMDID_SAVEAS = 4,
92         OLECMDID_SAVECOPYAS = 5,
93         OLECMDID_PRINT = 6,
94         OLECMDID_PRINTPREVIEW = 7,
95         OLECMDID_PAGESETUP = 8,
96         OLECMDID_SPELL = 9,
97         OLECMDID_PROPERTIES = 10,
98         OLECMDID_CUT = 11,
99         OLECMDID_COPY = 12,
100         OLECMDID_PASTE = 13,
101         OLECMDID_PASTESPECIAL = 14,
102         OLECMDID_UNDO = 15,
103         OLECMDID_REDO = 16,
104         OLECMDID_SELECTALL = 17,
105         OLECMDID_CLEARSELECTION = 18,
106         OLECMDID_ZOOM = 19,
107         OLECMDID_GETZOOMRANGE = 20,
108         OLECMDID_UPDATECOMMANDS = 21,
109         OLECMDID_REFRESH = 22,
110         OLECMDID_STOP = 23,
111         OLECMDID_HIDETOOLBARS = 24,
112         OLECMDID_SETPROGRESSMAX = 25,
113         OLECMDID_SETPROGRESSPOS = 26,
114         OLECMDID_SETPROGRESSTEXT = 27,
115         OLECMDID_SETTITLE = 28,
116         OLECMDID_SETDOWNLOADSTATE = 29,
117         OLECMDID_STOPDOWNLOAD = 30,
118         OLECMDID_ONTOOLBARACTIVATED = 31,
119         OLECMDID_FIND = 32,
120         OLECMDID_DELETE = 33,
121         OLECMDID_HTTPEQUIV = 34,
122         OLECMDID_HTTPEQUIV_DONE = 35,
123         OLECMDID_ENABLE_INTERACTION = 36,
124         OLECMDID_ONUNLOAD = 37,
125         OLECMDID_PROPERTYBAG2 = 38,
126         OLECMDID_PREREFRESH = 39
127         /* iexplorer uses ... 44 */
128 }       OLECMDID;
129                                                                                                                           
130 #define OLECMDERR_E_FIRST            (OLE_E_LAST+1)
131 #define OLECMDERR_E_NOTSUPPORTED     (OLECMDERR_E_FIRST)
132 #define OLECMDERR_E_DISABLED         (OLECMDERR_E_FIRST+1)
133 #define OLECMDERR_E_NOHELP           (OLECMDERR_E_FIRST+2)
134 #define OLECMDERR_E_CANCELED         (OLECMDERR_E_FIRST+3)
135 #define OLECMDERR_E_UNKNOWNGROUP     (OLECMDERR_E_FIRST+4)
136  
137 /*****************************************************************************
138  * Predeclare the interfaces
139  */
140 DEFINE_GUID(IID_IOleDocument, 0xb722bcc5,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70);
141 typedef struct IOleDocument IOleDocument, *LPOLEDOCUMENT;
142  
143 DEFINE_GUID(IID_IOleDocumentSite, 0xb722bcc7,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70);
144 typedef struct IOleDocumentSite IOleDocumentSite, *LPOLEDOCUMENTSITE;
145  
146 DEFINE_GUID(IID_IOleDocumentView, 0xb722bcc6,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70);
147 typedef struct IOleDocumentView IOleDocumentView, *LPOLEDOCUMENTVIEW;
148  
149 DEFINE_GUID(IID_IEnumOleDocumentViews, 0xb722bcc6,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70);
150 typedef struct IEnumOleDocumentViews IEnumOleDocumentViews, *LPENUMOLEDOCUMENTVIEWS;
151  
152 DEFINE_GUID(IID_IOleCommandTarget, 0xb722bccb,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70);
153 typedef struct IOleCommandTarget IOleCommandTarget, *LPOLECOMMANDTARGET;
154  
155 DEFINE_GUID(IID_IContinueCallback, 0xb722bcca,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70);
156 typedef struct IContinueCallback IContinueCallback, *LPCONTINUECALLBACK;
157  
158 DEFINE_GUID(IID_IPrint, 0xb722bcc9,0x4e68,0x101b,0xa2,0xbc,0x00,0xaa,0x00,0x40,0x47,0x70);
159 typedef struct IPrint IPrint, *LPPRINT;
160  
161  
162 /*****************************************************************************
163  * IOleDocument interface
164  */
165 #define ICOM_INTERFACE IOleDocument
166 #define IOleDocument_METHODS \
167         ICOM_METHOD4(HRESULT,CreateView, IOleInPlaceSite*,pIPSite, IStream*,pstm, DWORD,dwReserved, IOleDocumentView**,ppView) \
168         ICOM_METHOD1(HRESULT,GetDocMiscStatus, DWORD*,pdwStatus) \
169         ICOM_METHOD2(HRESULT,EnumViews, IEnumOleDocumentViews**,ppEnum, IOleDocumentView**,ppView)
170 #define IOleDocument_IMETHODS \
171         IUnknown_IMETHODS \
172         IOleDocument_METHODS
173 ICOM_DEFINE(IOleDocument,IUnknown)
174 #undef ICOM_INTERFACE
175
176 /*** IUnknown methods ***/
177 #define IOleDocument_QueryInterface(p,a,b)      ICOM_CALL2(QueryInterface,p,a,b)
178 #define IOleDocument_AddRef(p)                  ICOM_CALL (AddRef,p)
179 #define IOleDocument_Release(p)                 ICOM_CALL (Release,p)
180 /*** IOleDocument methods ***/
181 #define IOleDocument_CreateView(p,a,b,c,d)      ICOM_CALL4(CreateView,p,a,b,c,d)
182 #define IOleDocument_GetDocMiscStatus(p,a)      ICOM_CALL1(GetDocMiscStatus,p,a)
183 #define IOleDocument_EnumViews(p,a,b)           ICOM_CALL2(EnumViews,p,a,b)
184
185
186 /*****************************************************************************
187  * IOleDocumentSite interface
188  */
189 #define ICOM_INTERFACE IOleDocumentSite
190 #define IOleDocumentSite_METHODS \
191         ICOM_METHOD1(HRESULT,ActivateMe, IOleDocumentView*,pViewToActivate)
192 #define IOleDocumentSite_IMETHODS \
193         IUnknown_IMETHODS \
194         IOleDocumentSite_METHODS
195 ICOM_DEFINE(IOleDocumentSite,IUnknown)
196 #undef ICOM_INTERFACE
197
198 /*** IUnknown methods ***/
199 #define IOleDocumentSite_QueryInterface(p,a,b)      ICOM_CALL2(QueryInterface,p,a,b)
200 #define IOleDocumentSite_AddRef(p)                  ICOM_CALL (AddRef,p)
201 #define IOleDocumentSite_Release(p)                 ICOM_CALL (Release,p)
202 /*** IOleDocumentSite methods ***/
203 #define IOleDocumentSite_ActivateMe(p,a)            ICOM_CALL4(ActivateMe,p,a)
204
205
206 /*****************************************************************************
207  * IOleDocumentSite interface
208  */
209 #define ICOM_INTERFACE IOleDocumentView
210 #define IOleDocumentView_METHODS \
211         ICOM_METHOD1(HRESULT,SetInPlaceSite, IOleInPlaceSite*,pIPSite) \
212         ICOM_METHOD1(HRESULT,GetInPlaceSite, IOleInPlaceSite**,ppIPSite) \
213         ICOM_METHOD1(HRESULT,GetDocument, IUnknown**,ppunk) \
214         ICOM_METHOD1(HRESULT,SetRect, LPRECT,prcView) \
215         ICOM_METHOD1(HRESULT,GetRect, LPRECT,prcView) \
216         ICOM_METHOD4(HRESULT,SetRectComplex, LPRECT,prcView, LPRECT,prcHScroll, LPRECT,prcVScroll, LPRECT,prcSizeBox) \
217         ICOM_METHOD1(HRESULT,Show, BOOL,fShow) \
218         ICOM_METHOD1(HRESULT,UIActivate, BOOL,fUIActivate) \
219         ICOM_METHOD (HRESULT,Open) \
220         ICOM_METHOD1(HRESULT,CloseView, DWORD,dwReserved) \
221         ICOM_METHOD1(HRESULT,SaveViewState, LPSTREAM,pstm) \
222         ICOM_METHOD1(HRESULT,ApplyViewState,LPSTREAM,pstm) \
223         ICOM_METHOD2(HRESULT,Clone, IOleInPlaceSite*,pIPSiteNew, IOleDocumentView**,ppViewNew) 
224 #define IOleDocumentView_IMETHODS \
225         IUnknown_IMETHODS \
226         IOleDocumentView_METHODS
227 ICOM_DEFINE(IOleDocumentView,IUnknown)
228 #undef ICOM_INTERFACE
229
230 /*** IUnknown methods ***/
231 #define IOleDocumentView_QueryInterface(p,a,b)      ICOM_CALL2(QueryInterface,p,a,b)
232 #define IOleDocumentView_AddRef(p)                  ICOM_CALL (AddRef,p)
233 #define IOleDocumentView_Release(p)                 ICOM_CALL (Release,p)
234 /*** IOleDocumentView methods ***/
235 #define IOleDocumentView_SetInPlaceSite(p,a)        ICOM_CALL1(SetInPlaceSite,p,a)
236 #define IOleDocumentView_GetInPlaceSite(p,a)        ICOM_CALL1(GetInPlaceSite,p,a)
237 #define IOleDocumentView_GetDocument(p,a)           ICOM_CALL1(GetDocument,p,a)
238 #define IOleDocumentView_SetRect(p,a)               ICOM_CALL1(SetRect,p,a)
239 #define IOleDocumentView_GetRect(p,a)               ICOM_CALL1(GetRect,p,a)
240 #define IOleDocumentView_GetRectComplex(p,a,b,c,d)  ICOM_CALL4(GetRectComplex,p,a,b,c,d)
241 #define IOleDocumentView_Show(p,a)                  ICOM_CALL1(Show,p,a)
242 #define IOleDocumentView_UIActivate(p,a)            ICOM_CALL1(UIActivate,p,a)
243 #define IOleDocumentView_Open(p)                    ICOM_CALL (Open,p)
244 #define IOleDocumentView_CloseView(p,a)             ICOM_CALL1(CloseView,p,a)
245 #define IOleDocumentView_SaveViewState(p,a)         ICOM_CALL1(SaveViewState,p,a)
246 #define IOleDocumentView_ApplyViewState(p,a)        ICOM_CALL1(ApplyViewState,p,a)
247 #define IOleDocumentView_Clone(p,a,b)               ICOM_CALL2(Clone,p,a,b)
248
249
250 /*****************************************************************************
251  * IOleDocumentSite interface
252  */
253 #define ICOM_INTERFACE IEnumOleDocumentViews
254 #define IEnumOleDocumentViews_METHODS \
255         ICOM_METHOD3(HRESULT,Next, ULONG,cViews, IOleDocumentView**,rgpView, ULONG*,pcFetched) \
256         ICOM_METHOD1(HRESULT,Skip, ULONG,cViews) \
257         ICOM_METHOD (HRESULT,Reset) \
258         ICOM_METHOD1(HRESULT,Clone, IEnumOleDocumentViews**,ppEnum) 
259 #define IEnumOleDocumentViews_IMETHODS \
260         IUnknown_IMETHODS \
261         IEnumOleDocumentViews_METHODS
262 ICOM_DEFINE(IEnumOleDocumentViews,IUnknown)
263 #undef ICOM_INTERFACE
264
265 /*** IUnknown methods ***/
266 #define IEnumOleDocumentViews_QueryInterface(p,a,b)   ICOM_CALL2(QueryInterface,p,a,b)
267 #define IEnumOleDocumentViews_AddRef(p)               ICOM_CALL (AddRef,p)
268 #define IEnumOleDocumentViews_Release(p)              ICOM_CALL (Release,p)
269 /*** IEnumOleDocumentViews methods ***/
270 #define IEnumOleDocumentViews_Next(p,a,b,c)           ICOM_CALL3(Next,p,a,b,c)
271 #define IEnumOleDocumentViews_Skip(p,a)               ICOM_CALL1(Skip,p,a)
272 #define IEnumOleDocumentViews_Reset(p)                ICOM_CALL (Reset,p)
273 #define IEnumOleDocumentViews_Clone(p,a)              ICOM_CALL1(Clone,p,a)
274
275                                   
276 /*****************************************************************************
277  * IOleCommandTarget interface
278  */
279 #define ICOM_INTERFACE IOleCommandTarget
280 #define IOleCommandTarget_METHODS \
281         ICOM_METHOD4(HRESULT,QueryStatus, const GUID*,pguidCmdGroup, ULONG,cCmds, OLECMD*,prgCmds, OLECMDTEXT*,pCmdText) \
282         ICOM_METHOD5(HRESULT,Exec, const GUID*,pguidCmdGroup, DWORD,nCmdID, DWORD,nCmdexecopt, VARIANT*,pvaIn, VARIANT*,pvaOut)
283 #define IOleCommandTarget_IMETHODS \
284         IUnknown_IMETHODS \
285         IOleCommandTarget_METHODS
286 ICOM_DEFINE(IOleCommandTarget,IUnknown)
287 #undef ICOM_INTERFACE
288
289 /*** IUnknown methods ***/
290 #define IOleCommandTarget_QueryInterface(p,a,b)   ICOM_CALL2(QueryInterface,p,a,b)
291 #define IOleCommandTarget_AddRef(p)               ICOM_CALL (AddRef,p)
292 #define IOleCommandTarget_Release(p)              ICOM_CALL (Release,p)
293 /*** IOleCommandTarget methods ***/
294 #define IOleCommandTarget_QueryStatus(p,a,b,c,d)  ICOM_CALL4(QueryStatus,p,a,b,c,d)
295 #define IOleCommandTarget_Exec(p,a,b,c,d,e)       ICOM_CALL5(Exec,p,a,b,c,d,e)
296
297
298 /*****************************************************************************
299  * IContinueCallback interface
300  */
301 #define ICOM_INTERFACE IContinueCallback
302 #define IContinueCallback_METHODS \
303         ICOM_METHOD (HRESULT,FContinue) \
304         ICOM_METHOD3(HRESULT,FContinuePrinting, LONG,nCntPrinted, LONG,nCurPage, WCHAR*,pwszPrintStatus)
305 #define IContinueCallback_IMETHODS \
306         IUnknown_IMETHODS \
307         IContinueCallback_METHODS
308 ICOM_DEFINE(IContinueCallback,IUnknown)
309 #undef ICOM_INTERFACE
310
311 /*** IUnknown methods ***/
312 #define IContinueCallback_QueryInterface(p,a,b)   ICOM_CALL2(QueryInterface,p,a,b)
313 #define IContinueCallback_AddRef(p)               ICOM_CALL (AddRef,p)
314 #define IContinueCallback_Release(p)              ICOM_CALL (Release,p)
315 /*** IContinueCallback methods ***/
316 #define IContinueCallback_FContinue(p)               ICOM_CALL (FContinue,p)
317 #define IContinueCallback_FContinuePrinting(p,a,b,c) ICOM_CALL3(FContinuePrinting,p,a,b,c)
318
319
320 /*****************************************************************************
321  * IPrint interface
322  */
323 #define ICOM_INTERFACE IPrint
324 #define IPrint_METHODS \
325         ICOM_METHOD1(HRESULT,SetInitialPageNum, LONG,nFirstPage) \
326         ICOM_METHOD2(HRESULT,GetPageInfo, LONG*,pnFirstPage, LONG*,pcPages) \
327         ICOM_METHOD8(HRESULT,Print, DWORD,grfFlags, DVTARGETDEVICE**,pptd, PAGESET**,ppPageSet, STGMEDIUM*,pstgmOptions, IContinueCallback*,pcallback, LONG,nFirstPage, LONG*,pcPagesPrinted, LONG*,pnLastPage) 
328 #define IPrint_IMETHODS \
329         IUnknown_IMETHODS \
330         IPrint_METHODS
331 ICOM_DEFINE(IPrint,IUnknown)
332 #undef ICOM_INTERFACE
333                                 
334 /*** IUnknown methods ***/
335 #define IPrint_QueryInterface(p,a,b)   ICOM_CALL2(QueryInterface,p,a,b)
336 #define IPrint_AddRef(p)               ICOM_CALL (AddRef,p)
337 #define IPrint_Release(p)              ICOM_CALL (Release,p)
338 /*** Iprint methods ***/
339 #define IPrint_SetInitialPageNum(p,a)  ICOM_CALL1(SetInitialPageNum,p,a)
340 #define IPrint_GetPageInfo(p,a,b)      ICOM_CALL2(GetPageInfo,p,a,b)
341 #define IPrint_Print(p,a,b,c,d,e,f,g)  ICOM_CALL7(Print,p,a,b,c,d,e,f,g)
342                                 
343                                 
344 #define LPMSODOCUMENT                  LPOLEDOCUMENT
345 #define LPMSODOCUMENTSITE              LPOLEDOCUMENTSITE
346 #define LPMSOVIEW                      LPOLEDOCUMENTVIEW
347 #define LPENUMMSOVIEW                  LPENUMOLEDOCUMENTVIEWS
348 #define LPMSOCOMMANDTARGET             LPOLECOMMANDTARGET
349 #define IID_IMsoDocument               IID_IOleDocument
350 #define IID_IMsoDocumentSite           IID_IOleDocumentSite
351 #define IID_IMsoView                   IID_IOleDocumentView
352 #define IID_IEnumMsoView               IID_IEnumOleDocumentViews
353 #define IID_IMsoCommandTarget          IID_IOleCommandTarget
354                                 
355
356 #endif /* __WINE_DOCOBJ_H */