BeginDeferWindowPos should allow zero count.
[wine.git] / include / wine / obj_propertystorage.h
blob9b4c3fee01a932efa76579a24cda8960c918a575
1 /*
2 * Defines the COM interfaces and APIs related to saving properties to file.
3 */
5 #ifndef __WINE_WINE_OBJ_PROPERTYSTORAGE_H
6 #define __WINE_WINE_OBJ_PROPERTYSTORAGE_H
8 #include "wine/obj_base.h"
9 #include "wine/obj_storage.h"
11 #ifdef __cplusplus
12 extern "C" {
13 #endif /* defined(__cplusplus) */
15 /*****************************************************************************
16 * Predeclare the interfaces
18 DEFINE_OLEGUID(IID_IEnumSTATPROPSETSTG, 0x0000013bL, 0, 0);
19 typedef struct IEnumSTATPROPSETSTG IEnumSTATPROPSETSTG,*LPENUMSTATPROPSETSTG;
21 DEFINE_OLEGUID(IID_IEnumSTATPROPSTG, 0x00000139L, 0, 0);
22 typedef struct IEnumSTATPROPSTG IEnumSTATPROPSTG,*LPENUMSTATPROPSTG;
24 DEFINE_OLEGUID(IID_IPropertySetStorage, 0x0000013aL, 0, 0);
25 typedef struct IPropertySetStorage IPropertySetStorage,*LPPROPERTYSETSTORAGE;
27 DEFINE_OLEGUID(IID_IPropertyStorage, 0x00000138L, 0, 0);
28 typedef struct IPropertyStorage IPropertyStorage,*LPPROPERTYSTORAGE;
31 /*****************************************************************************
32 * Predeclare the structures
35 typedef struct tagSTATPROPSETSTG STATPROPSETSTG;
36 typedef struct tagSTATPROPSTG STATPROPSTG;
38 extern const FMTID FMTID_SummaryInformation;
39 extern const FMTID FMTID_DocSummaryInformation;
40 extern const FMTID FMTID_UserDefinedProperties;
42 /*****************************************************************************
43 * PROPSPEC structure
46 /* Reserved global Property IDs */
47 #define PID_DICTIONARY ( 0 )
49 #define PID_CODEPAGE ( 0x1 )
51 #define PID_FIRST_USABLE ( 0x2 )
53 #define PID_FIRST_NAME_DEFAULT ( 0xfff )
55 #define PID_LOCALE ( 0x80000000 )
57 #define PID_MODIFY_TIME ( 0x80000001 )
59 #define PID_SECURITY ( 0x80000002 )
61 #define PID_ILLEGAL ( 0xffffffff )
63 /* Property IDs for the SummaryInformation Property Set */
65 #define PIDSI_TITLE 0x00000002L /* VT_LPSTR */
66 #define PIDSI_SUBJECT 0x00000003L /* VT_LPSTR */
67 #define PIDSI_AUTHOR 0x00000004L /* VT_LPSTR */
68 #define PIDSI_KEYWORDS 0x00000005L /* VT_LPSTR */
69 #define PIDSI_COMMENTS 0x00000006L /* VT_LPSTR */
70 #define PIDSI_TEMPLATE 0x00000007L /* VT_LPSTR */
71 #define PIDSI_LASTAUTHOR 0x00000008L /* VT_LPSTR */
72 #define PIDSI_REVNUMBER 0x00000009L /* VT_LPSTR */
73 #define PIDSI_EDITTIME 0x0000000aL /* VT_FILETIME (UTC) */
74 #define PIDSI_LASTPRINTED 0x0000000bL /* VT_FILETIME (UTC) */
75 #define PIDSI_CREATE_DTM 0x0000000cL /* VT_FILETIME (UTC) */
76 #define PIDSI_LASTSAVE_DTM 0x0000000dL /* VT_FILETIME (UTC) */
77 #define PIDSI_PAGECOUNT 0x0000000eL /* VT_I4 */
78 #define PIDSI_WORDCOUNT 0x0000000fL /* VT_I4 */
79 #define PIDSI_CHARCOUNT 0x00000010L /* VT_I4 */
80 #define PIDSI_THUMBNAIL 0x00000011L /* VT_CF */
81 #define PIDSI_APPNAME 0x00000012L /* VT_LPSTR */
82 #define PIDSI_DOC_SECURITY 0x00000013L /* VT_I4 */
83 #define PRSPEC_INVALID ( 0xffffffff )
86 #define PRSPEC_LPWSTR ( 0 )
87 #define PRSPEC_PROPID ( 1 )
89 typedef struct tagPROPSPEC
91 ULONG ulKind;
92 union
94 PROPID propid;
95 LPOLESTR lpwstr;
96 } u;
97 } PROPSPEC;
100 /*****************************************************************************
101 * STATPROPSETSTG structure
103 /* Macros for parsing the OS Version of the Property Set Header */
104 #define PROPSETHDR_OSVER_KIND(dwOSVer) HIWORD( (dwOSVer) )
105 #define PROPSETHDR_OSVER_MAJOR(dwOSVer) LOBYTE(LOWORD( (dwOSVer) ))
106 #define PROPSETHDR_OSVER_MINOR(dwOSVer) HIBYTE(LOWORD( (dwOSVer) ))
107 #define PROPSETHDR_OSVERSION_UNKNOWN 0xFFFFFFFF
109 struct tagSTATPROPSETSTG
111 FMTID fmtid;
112 CLSID clsid;
113 DWORD grfFlags;
114 FILETIME mtime;
115 FILETIME ctime;
116 FILETIME atime;
117 DWORD dwOSVersion;
121 /*****************************************************************************
122 * STATPROPSTG structure
124 struct tagSTATPROPSTG
126 LPOLESTR lpwstrName;
127 PROPID propid;
128 VARTYPE vt;
132 /*****************************************************************************
133 * IEnumSTATPROPSETSTG interface
135 #define ICOM_INTERFACE IEnumSTATPROPSETSTG
136 #define IEnumSTATPROPSETSTG_METHODS \
137 ICOM_METHOD3(HRESULT,Next, ULONG,celt, STATPROPSETSTG*,rgelt, ULONG*,pceltFethed) \
138 ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \
139 ICOM_METHOD (HRESULT,Reset) \
140 ICOM_METHOD1(HRESULT,Clone, IEnumSTATPROPSETSTG**,ppenum)
141 #define IEnumSTATPROPSETSTG_IMETHODS \
142 IUnknown_IMETHODS \
143 IEnumSTATPROPSETSTG_METHODS
144 ICOM_DEFINE(IEnumSTATPROPSETSTG,IUnknown)
145 #undef ICOM_INTERFACE
147 /*** IUnknown methods ***/
148 #define IEnumSTATPROPSETSTG_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
149 #define IEnumSTATPROPSETSTG_AddRef(p) ICOM_CALL (AddRef,p)
150 #define IEnumSTATPROPSETSTG_Release(p) ICOM_CALL (Release,p)
151 /*** IEnumSTATPROPSETSTG methods ***/
152 #define IEnumSTATPROPSETSTG_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
153 #define IEnumSTATPROPSETSTG_Skip(p,a) ICOM_CALL1(Skip,p,a)
154 #define IEnumSTATPROPSETSTG_Reset(p) ICOM_CALL (Reset,p)
155 #define IEnumSTATPROPSETSTG_Clone(p,a) ICOM_CALL1(Clone,p,a)
158 /*****************************************************************************
159 * IEnumSTATPROPSTG interface
161 #define ICOM_INTERFACE IEnumSTATPROPSTG
162 #define IEnumSTATPROPSTG_METHODS \
163 ICOM_METHOD3(HRESULT,Next, ULONG,celt, STATPROPSTG*,rgelt, ULONG*,pceltFethed) \
164 ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \
165 ICOM_METHOD (HRESULT,Reset) \
166 ICOM_METHOD1(HRESULT,Clone, IEnumSTATPROPSTG**,ppenum)
167 #define IEnumSTATPROPSTG_IMETHODS \
168 IUnknown_IMETHODS \
169 IEnumSTATPROPSTG_METHODS
170 ICOM_DEFINE(IEnumSTATPROPSTG,IUnknown)
171 #undef ICOM_INTERFACE
173 /*** IUnknown methods ***/
174 #define IEnumSTATPROPSTG_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
175 #define IEnumSTATPROPSTG_AddRef(p) ICOM_CALL (AddRef,p)
176 #define IEnumSTATPROPSTG_Release(p) ICOM_CALL (Release,p)
177 /*** IEnumSTATPROPSTG methods ***/
178 #define IEnumSTATPROPSTG_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
179 #define IEnumSTATPROPSTG_Skip(p,a) ICOM_CALL1(Skip,p,a)
180 #define IEnumSTATPROPSTG_Reset(p) ICOM_CALL (Reset,p)
181 #define IEnumSTATPROPSTG_Clone(p,a) ICOM_CALL1(Clone,p,a)
184 /*****************************************************************************
185 * IPropertySetStorage interface
187 #define ICOM_INTERFACE IPropertySetStorage
188 #define IPropertySetStorage_METHODS \
189 ICOM_METHOD5(HRESULT,Create, REFFMTID,rfmtid, const CLSID*,pclsid, DWORD,grfFlags, DWORD,grfMode, IPropertyStorage**,ppprstg) \
190 ICOM_METHOD3(HRESULT,Open, REFFMTID,rfmtid, DWORD,grfMode, IPropertyStorage**,ppprstg) \
191 ICOM_METHOD1(HRESULT,Delete, REFFMTID,rfmtid) \
192 ICOM_METHOD1(HRESULT,Enum, IEnumSTATPROPSETSTG**,ppenum)
193 #define IPropertySetStorage_IMETHODS \
194 IUnknown_IMETHODS \
195 IPropertySetStorage_METHODS
196 ICOM_DEFINE(IPropertySetStorage,IUnknown)
197 #undef ICOM_INTERFACE
199 /*** IUnknown methods ***/
200 #define IPropertySetStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
201 #define IPropertySetStorage_AddRef(p) ICOM_CALL (AddRef,p)
202 #define IPropertySetStorage_Release(p) ICOM_CALL (Release,p)
203 /*** IPropertySetStorage methods ***/
204 #define IPropertySetStorage_Create(p,a,b,c,d,e) ICOM_CALL5(Create,p,a,b,c,d,e)
205 #define IPropertySetStorage_Open(p,a,b,c) ICOM_CALL3(Open,p,a,b,c)
206 #define IPropertySetStorage_Delete(p,a) ICOM_CALL1(Delete,p,a)
207 #define IPropertySetStorage_Enum(p,a) ICOM_CALL1(Enum,p,a)
210 /*****************************************************************************
211 * IPropertyStorage interface
213 typedef struct tagPROPVARIANT PROPVARIANT,*LPPROPVARIANT;
215 /* Flags for IPropertySetStorage::Create */
216 #define PROPSETFLAG_DEFAULT ( 0 )
217 #define PROPSETFLAG_NONSIMPLE ( 1 )
218 #define PROPSETFLAG_ANSI ( 2 )
220 typedef struct tagCAUB
222 ULONG cElems;
223 unsigned char *pElems;
224 } CAUB;
226 typedef struct tagCAI
228 ULONG cElems;
229 short *pElems;
230 } CAI;
232 typedef struct tagCAUI
234 ULONG cElems;
235 USHORT *pElems;
236 } CAUI;
238 typedef struct tagCAL
240 ULONG cElems;
241 long *pElems;
242 } CAL;
244 typedef struct tagCAUL
246 ULONG cElems;
247 ULONG *pElems;
248 } CAUL;
250 typedef struct tagCAFLT
252 ULONG cElems;
253 float *pElems;
254 } CAFLT;
256 typedef struct tagCADBL
258 ULONG cElems;
259 double *pElems;
260 } CADBL;
262 typedef struct tagCACY
264 ULONG cElems;
265 CY *pElems;
266 } CACY;
268 typedef struct tagCADATE
270 ULONG cElems;
271 DATE *pElems;
272 } CADATE;
274 typedef struct tagCABSTR
276 ULONG cElems;
277 BSTR *pElems;
278 } CABSTR;
280 typedef struct tagCABOOL
282 ULONG cElems;
283 VARIANT_BOOL *pElems;
284 } CABOOL;
286 typedef struct tagCASCODE
288 ULONG cElems;
289 SCODE *pElems;
290 } CASCODE;
292 typedef struct tagCAPROPVARIANT
294 ULONG cElems;
295 PROPVARIANT *pElems;
296 } CAPROPVARIANT;
298 typedef struct tagCAH
300 ULONG cElems;
301 LARGE_INTEGER *pElems;
302 } CAH;
304 typedef struct tagCAUH
306 ULONG cElems;
307 ULARGE_INTEGER *pElems;
308 } CAUH;
310 typedef struct tagCALPSTR
312 ULONG cElems;
313 LPSTR *pElems;
314 } CALPSTR;
316 typedef struct tagCALPWSTR
318 ULONG cElems;
319 LPWSTR *pElems;
320 } CALPWSTR;
322 typedef struct tagCAFILETIME
324 ULONG cElems;
325 FILETIME *pElems;
326 } CAFILETIME;
328 typedef struct tagCACLIPDATA
330 ULONG cElems;
331 CLIPDATA *pElems;
332 } CACLIPDATA;
334 typedef struct tagCACLSID
336 ULONG cElems;
337 CLSID *pElems;
338 } CACLSID;
340 struct tagPROPVARIANT
342 VARTYPE vt;
343 WORD wReserved1;
344 WORD wReserved2;
345 WORD wReserved3;
346 union
348 /* Empty union arm */
349 UCHAR bVal;
350 short iVal;
351 USHORT uiVal;
352 VARIANT_BOOL boolVal;
353 #ifndef __cplusplus
354 /* FIXME: bool is reserved in C++, how can we deal with that ? */
355 _VARIANT_BOOL bool;
356 #endif
357 long lVal;
358 ULONG ulVal;
359 float fltVal;
360 SCODE scode;
361 LARGE_INTEGER hVal;
362 ULARGE_INTEGER uhVal;
363 double dblVal;
364 CY cyVal;
365 DATE date;
366 FILETIME filetime;
367 CLSID *puuid;
368 BLOB blob;
369 CLIPDATA *pclipdata;
370 IStream *pStream;
371 IStorage *pStorage;
372 BSTR bstrVal;
373 LPSTR pszVal;
374 LPWSTR pwszVal;
375 CAUB caub;
376 CAI cai;
377 CAUI caui;
378 CABOOL cabool;
379 CAL cal;
380 CAUL caul;
381 CAFLT caflt;
382 CASCODE cascode;
383 CAH cah;
384 CAUH cauh;
385 CADBL cadbl;
386 CACY cacy;
387 CADATE cadate;
388 CAFILETIME cafiletime;
389 CACLSID cauuid;
390 CACLIPDATA caclipdata;
391 CABSTR cabstr;
392 CALPSTR calpstr;
393 CALPWSTR calpwstr;
394 CAPROPVARIANT capropvar;
395 } u;
399 #define ICOM_INTERFACE IPropertyStorage
400 #define IPropertyStorage_METHODS \
401 ICOM_METHOD3(HRESULT,ReadMultiple, ULONG,cpspec, const PROPSPEC*,rgpspec, PROPVARIANT*,rgpropvar) \
402 ICOM_METHOD4(HRESULT,WriteMultiple, ULONG,cpspec, const PROPSPEC*,rgpspec, const PROPVARIANT*,rgpropvar, PROPID,propidNameFirst) \
403 ICOM_METHOD2(HRESULT,DeleteMultiple, ULONG,cpspec, const PROPSPEC*,rgpspec) \
404 ICOM_METHOD2(HRESULT,ReadPropertyNames, const PROPID*,rgpropid, LPOLESTR*,rglpwstrName) \
405 ICOM_METHOD3(HRESULT,WritePropertyNames, ULONG,cpropid, const PROPID*,rgpropid, LPOLESTR*,rglpwstrName) \
406 ICOM_METHOD2(HRESULT,DeletePropertyNames, ULONG,cpropid, const PROPID*,rgpropid) \
407 ICOM_METHOD1(HRESULT,Commit, DWORD,grfCommitFlags) \
408 ICOM_METHOD (HRESULT,Revert) \
409 ICOM_METHOD1(HRESULT,Enum, IEnumSTATPROPSTG**,ppenum) \
410 ICOM_METHOD3(HRESULT,SetTimes, const FILETIME*,pctime, const FILETIME*,patime, const FILETIME*,pmtime) \
411 ICOM_METHOD1(HRESULT,SetClass, REFCLSID,clsid) \
412 ICOM_METHOD1(HRESULT,Stat, STATPROPSETSTG*,pstatpsstg)
413 #define IPropertyStorage_IMETHODS \
414 IUnknown_IMETHODS \
415 IPropertyStorage_METHODS
416 ICOM_DEFINE(IPropertyStorage,IUnknown)
417 #undef ICOM_INTERFACE
419 /*** IUnknown methods ***/
420 #define IPropertyStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
421 #define IPropertyStorage_AddRef(p) ICOM_CALL (AddRef,p)
422 #define IPropertyStorage_Release(p) ICOM_CALL (Release,p)
423 /*** IPropertyStorage methods ***/
424 #define IPropertyStorage_ReadMultiple(p,a,b,c) ICOM_CALL3(ReadMultiple,p,a,b,c)
425 #define IPropertyStorage_WriteMultiple(p,a,b,c,d) ICOM_CALL4(WriteMultiple,p,a,b,c,d)
426 #define IPropertyStorage_DeleteMultiple(p,a,b) ICOM_CALL2(DeleteMultiple,p,a,b)
427 #define IPropertyStorage_ReadPropertyNames(p,a,b) ICOM_CALL2(ReadPropertyNames,p,a,b)
428 #define IPropertyStorage_WritePropertyNames(p,a,b,c) ICOM_CALL3(WritePropertyNames,p,a,b,c)
429 #define IPropertyStorage_DeletePropertyNames(p,a,b) ICOM_CALL2(DeletePropertyNames,p,a,b)
430 #define IPropertyStorage_Commit(p,a) ICOM_CALL1(Commit,p,a)
431 #define IPropertyStorage_Revert(p) ICOM_CALL (Revert,p)
432 #define IPropertyStorage_Enum(p,a) ICOM_CALL1(Enum,p,a)
433 #define IPropertyStorage_SetTimes(p,a,b,c) ICOM_CALL3(SetTimes,p,a,b,c)
434 #define IPropertyStorage_SetClass(p,a) ICOM_CALL1(SetClass,p,a)
435 #define IPropertyStorage_Stat(p,a) ICOM_CALL1(Stat,p,a)
437 #ifdef __cplusplus
438 } /* extern "C" */
439 #endif /* defined(__cplusplus) */
441 #endif /* __WINE_WINE_OBJ_PROPERTYSTORAGE_H */