More include optimisations and fixes.
[wine.git] / include / wine / obj_propertystorage.h
blobeed3a55849a7299b18b354f6e4c3ca0f751b7d01
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 /*****************************************************************************
12 * Predeclare the interfaces
14 DEFINE_OLEGUID(IID_IEnumSTATPROPSETSTG, 0x0000013bL, 0, 0);
15 typedef struct IEnumSTATPROPSETSTG IEnumSTATPROPSETSTG,*LPENUMSTATPROPSETSTG;
17 DEFINE_OLEGUID(IID_IEnumSTATPROPSTG, 0x00000139L, 0, 0);
18 typedef struct IEnumSTATPROPSTG IEnumSTATPROPSTG,*LPENUMSTATPROPSTG;
20 DEFINE_OLEGUID(IID_IPropertySetStorage, 0x0000013aL, 0, 0);
21 typedef struct IPropertySetStorage IPropertySetStorage,*LPPROPERTYSETSTORAGE;
23 DEFINE_OLEGUID(IID_IPropertyStorage, 0x00000138L, 0, 0);
24 typedef struct IPropertyStorage IPropertyStorage,*LPPROPERTYSTORAGE;
27 /*****************************************************************************
28 * Predeclare the structures
31 typedef struct tagSTATPROPSETSTG STATPROPSETSTG;
32 typedef struct tagSTATPROPSTG STATPROPSTG;
35 /*****************************************************************************
36 * PROPSPEC structure
39 // Reserved global Property IDs
40 #define PID_DICTIONARY ( 0 )
42 #define PID_CODEPAGE ( 0x1 )
44 #define PID_FIRST_USABLE ( 0x2 )
46 #define PID_FIRST_NAME_DEFAULT ( 0xfff )
48 #define PID_LOCALE ( 0x80000000 )
50 #define PID_MODIFY_TIME ( 0x80000001 )
52 #define PID_SECURITY ( 0x80000002 )
54 #define PID_ILLEGAL ( 0xffffffff )
56 // Property IDs for the SummaryInformation Property Set
58 #define PIDSI_TITLE 0x00000002L // VT_LPSTR
59 #define PIDSI_SUBJECT 0x00000003L // VT_LPSTR
60 #define PIDSI_AUTHOR 0x00000004L // VT_LPSTR
61 #define PIDSI_KEYWORDS 0x00000005L // VT_LPSTR
62 #define PIDSI_COMMENTS 0x00000006L // VT_LPSTR
63 #define PIDSI_TEMPLATE 0x00000007L // VT_LPSTR
64 #define PIDSI_LASTAUTHOR 0x00000008L // VT_LPSTR
65 #define PIDSI_REVNUMBER 0x00000009L // VT_LPSTR
66 #define PIDSI_EDITTIME 0x0000000aL // VT_FILETIME (UTC)
67 #define PIDSI_LASTPRINTED 0x0000000bL // VT_FILETIME (UTC)
68 #define PIDSI_CREATE_DTM 0x0000000cL // VT_FILETIME (UTC)
69 #define PIDSI_LASTSAVE_DTM 0x0000000dL // VT_FILETIME (UTC)
70 #define PIDSI_PAGECOUNT 0x0000000eL // VT_I4
71 #define PIDSI_WORDCOUNT 0x0000000fL // VT_I4
72 #define PIDSI_CHARCOUNT 0x00000010L // VT_I4
73 #define PIDSI_THUMBNAIL 0x00000011L // VT_CF
74 #define PIDSI_APPNAME 0x00000012L // VT_LPSTR
75 #define PIDSI_DOC_SECURITY 0x00000013L // VT_I4
76 #define PRSPEC_INVALID ( 0xffffffff )
79 #define PRSPEC_LPWSTR ( 0 )
80 #define PRSPEC_PROPID ( 1 )
82 typedef struct tagPROPSPEC
84 ULONG ulKind;
85 union
87 PROPID propid;
88 LPOLESTR lpwstr;
89 } u;
90 } PROPSPEC;
93 /*****************************************************************************
94 * STATPROPSETSTG structure
96 /* Macros for parsing the OS Version of the Property Set Header */
97 #define PROPSETHDR_OSVER_KIND(dwOSVer) HIWORD( (dwOSVer) )
98 #define PROPSETHDR_OSVER_MAJOR(dwOSVer) LOBYTE(LOWORD( (dwOSVer) ))
99 #define PROPSETHDR_OSVER_MINOR(dwOSVer) HIBYTE(LOWORD( (dwOSVer) ))
100 #define PROPSETHDR_OSVERSION_UNKNOWN 0xFFFFFFFF
102 struct tagSTATPROPSETSTG
104 FMTID fmtid;
105 CLSID clsid;
106 DWORD grfFlags;
107 FILETIME mtime;
108 FILETIME ctime;
109 FILETIME atime;
110 DWORD dwOSVersion;
114 /*****************************************************************************
115 * STATPROPSTG structure
117 struct tagSTATPROPSTG
119 LPOLESTR lpwstrName;
120 PROPID propid;
121 VARTYPE vt;
125 /*****************************************************************************
126 * IEnumSTATPROPSETSTG interface
128 #define ICOM_INTERFACE IEnumSTATPROPSETSTG
129 #define IEnumSTATPROPSETSTG_METHODS \
130 ICOM_METHOD3(HRESULT,Next, ULONG,celt, STATPROPSETSTG*,rgelt, ULONG*,pceltFethed); \
131 ICOM_METHOD1(HRESULT,Skip, ULONG,celt); \
132 ICOM_METHOD (HRESULT,Reset); \
133 ICOM_METHOD1(HRESULT,Clone, IEnumSTATPROPSETSTG**,ppenum);
134 #define IEnumSTATPROPSETSTG_IMETHODS \
135 ICOM_INHERITS(IEnumSTATPROPSETSTG,IUnknown)
136 ICOM_DEFINE(IEnumSTATPROPSETSTG,IUnknown)
137 #undef ICOM_INTERFACE
139 #ifdef ICOM_CINTERFACE
140 /*** IUnknown methods ***/
141 #define IEnumSTATPROPSETSTG_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
142 #define IEnumSTATPROPSETSTG_AddRef(p) ICOM_CALL (AddRef,p)
143 #define IEnumSTATPROPSETSTG_Release(p) ICOM_CALL (Release,p)
144 /*** IEnumSTATPROPSETSTG methods ***/
145 #define IEnumSTATPROPSETSTG_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
146 #define IEnumSTATPROPSETSTG_Skip(p,a) ICOM_CALL1(Skip,p,a)
147 #define IEnumSTATPROPSETSTG_Reset(p) ICOM_CALL (Reset,p)
148 #define IEnumSTATPROPSETSTG_Clone(p,a) ICOM_CALL1(Clone,p,a)
149 #endif
152 /*****************************************************************************
153 * IEnumSTATPROPSTG interface
155 #define ICOM_INTERFACE IEnumSTATPROPSTG
156 #define IEnumSTATPROPSTG_METHODS \
157 ICOM_METHOD3(HRESULT,Next, ULONG,celt, STATPROPSTG*,rgelt, ULONG*,pceltFethed); \
158 ICOM_METHOD1(HRESULT,Skip, ULONG,celt); \
159 ICOM_METHOD (HRESULT,Reset); \
160 ICOM_METHOD1(HRESULT,Clone, IEnumSTATPROPSTG**,ppenum);
161 #define IEnumSTATPROPSTG_IMETHODS \
162 ICOM_INHERITS(IEnumSTATPROPSTG,IUnknown)
163 ICOM_DEFINE(IEnumSTATPROPSTG,IUnknown)
164 #undef ICOM_INTERFACE
166 #ifdef ICOM_CINTERFACE
167 /*** IUnknown methods ***/
168 #define IEnumSTATPROPSTG_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
169 #define IEnumSTATPROPSTG_AddRef(p) ICOM_CALL (AddRef,p)
170 #define IEnumSTATPROPSTG_Release(p) ICOM_CALL (Release,p)
171 /*** IEnumSTATPROPSTG methods ***/
172 #define IEnumSTATPROPSTG_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
173 #define IEnumSTATPROPSTG_Skip(p,a) ICOM_CALL1(Skip,p,a)
174 #define IEnumSTATPROPSTG_Reset(p) ICOM_CALL (Reset,p)
175 #define IEnumSTATPROPSTG_Clone(p,a) ICOM_CALL1(Clone,p,a)
176 #endif
179 /*****************************************************************************
180 * IPropertySetStorage interface
182 #define ICOM_INTERFACE IPropertySetStorage
183 #define IPropertySetStorage_METHODS \
184 ICOM_METHOD5(HRESULT,Create, REFFMTID,rfmtid, const CLSID*,pclsid, DWORD,grfFlags, DWORD,grfMode, IPropertyStorage**,ppprstg); \
185 ICOM_METHOD3(HRESULT,Open, REFFMTID,rfmtid, DWORD,grfMode, IPropertyStorage**,ppprstg); \
186 ICOM_METHOD1(HRESULT,Delete, REFFMTID,rfmtid); \
187 ICOM_METHOD1(HRESULT,Enum, IEnumSTATPROPSETSTG**,ppenum);
188 #define IPropertySetStorage_IMETHODS \
189 ICOM_INHERITS(IPropertySetStorage,IUnknown)
190 ICOM_DEFINE(IPropertySetStorage,IUnknown)
191 #undef ICOM_INTERFACE
193 #ifdef ICOM_CINTERFACE
194 /*** IUnknown methods ***/
195 #define IPropertySetStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
196 #define IPropertySetStorage_AddRef(p) ICOM_CALL (AddRef,p)
197 #define IPropertySetStorage_Release(p) ICOM_CALL (Release,p)
198 /*** IPropertySetStorage methods ***/
199 #define IPropertySetStorage_Create(p,a,b,c,d,e) ICOM_CALL5(Create,p,a,b,c,d,e)
200 #define IPropertySetStorage_Open(p,a,b,c) ICOM_CALL3(Open,p,a,b,c)
201 #define IPropertySetStorage_Delete(p,a) ICOM_CALL1(Delete,p,a)
202 #define IPropertySetStorage_Enum(p,a) ICOM_CALL1(Enum,p,a)
203 #endif
206 /*****************************************************************************
207 * IPropertyStorage interface
209 typedef struct tagPROPVARIANT PROPVARIANT,*LPPROPVARIANT;
211 // Flags for IPropertySetStorage::Create
212 #define PROPSETFLAG_DEFAULT ( 0 )
213 #define PROPSETFLAG_NONSIMPLE ( 1 )
214 #define PROPSETFLAG_ANSI ( 2 )
216 typedef struct tagCAUB
218 ULONG cElems;
219 unsigned char *pElems;
220 } CAUB;
222 typedef struct tagCAI
224 ULONG cElems;
225 short *pElems;
226 } CAI;
228 typedef struct tagCAUI
230 ULONG cElems;
231 USHORT *pElems;
232 } CAUI;
234 typedef struct tagCAL
236 ULONG cElems;
237 long *pElems;
238 } CAL;
240 typedef struct tagCAUL
242 ULONG cElems;
243 ULONG *pElems;
244 } CAUL;
246 typedef struct tagCAFLT
248 ULONG cElems;
249 float *pElems;
250 } CAFLT;
252 typedef struct tagCADBL
254 ULONG cElems;
255 double *pElems;
256 } CADBL;
258 typedef struct tagCACY
260 ULONG cElems;
261 CY *pElems;
262 } CACY;
264 typedef struct tagCADATE
266 ULONG cElems;
267 DATE *pElems;
268 } CADATE;
270 typedef struct tagCABSTR
272 ULONG cElems;
273 BSTR *pElems;
274 } CABSTR;
276 typedef struct tagCABOOL
278 ULONG cElems;
279 VARIANT_BOOL *pElems;
280 } CABOOL;
282 typedef struct tagCASCODE
284 ULONG cElems;
285 SCODE *pElems;
286 } CASCODE;
288 typedef struct tagCAPROPVARIANT
290 ULONG cElems;
291 PROPVARIANT *pElems;
292 } CAPROPVARIANT;
294 typedef struct tagCAH
296 ULONG cElems;
297 LARGE_INTEGER *pElems;
298 } CAH;
300 typedef struct tagCAUH
302 ULONG cElems;
303 ULARGE_INTEGER *pElems;
304 } CAUH;
306 typedef struct tagCALPSTR
308 ULONG cElems;
309 LPSTR *pElems;
310 } CALPSTR;
312 typedef struct tagCALPWSTR
314 ULONG cElems;
315 LPWSTR *pElems;
316 } CALPWSTR;
318 typedef struct tagCAFILETIME
320 ULONG cElems;
321 FILETIME *pElems;
322 } CAFILETIME;
324 typedef struct tagCACLIPDATA
326 ULONG cElems;
327 CLIPDATA *pElems;
328 } CACLIPDATA;
330 typedef struct tagCACLSID
332 ULONG cElems;
333 CLSID *pElems;
334 } CACLSID;
336 struct tagPROPVARIANT
338 VARTYPE vt;
339 WORD wReserved1;
340 WORD wReserved2;
341 WORD wReserved3;
342 union
344 /* Empty union arm */
345 UCHAR bVal;
346 short iVal;
347 USHORT uiVal;
348 VARIANT_BOOL boolVal;
349 #ifndef __cplusplus
350 /* FIXME: bool is reserved in C++, how can we deal with that ? */
351 _VARIANT_BOOL bool;
352 #endif
353 long lVal;
354 ULONG ulVal;
355 float fltVal;
356 SCODE scode;
357 LARGE_INTEGER hVal;
358 ULARGE_INTEGER uhVal;
359 double dblVal;
360 CY cyVal;
361 DATE date;
362 FILETIME filetime;
363 CLSID *puuid;
364 BLOB blob;
365 CLIPDATA *pclipdata;
366 IStream *pStream;
367 IStorage *pStorage;
368 BSTR bstrVal;
369 LPSTR pszVal;
370 LPWSTR pwszVal;
371 CAUB caub;
372 CAI cai;
373 CAUI caui;
374 CABOOL cabool;
375 CAL cal;
376 CAUL caul;
377 CAFLT caflt;
378 CASCODE cascode;
379 CAH cah;
380 CAUH cauh;
381 CADBL cadbl;
382 CACY cacy;
383 CADATE cadate;
384 CAFILETIME cafiletime;
385 CACLSID cauuid;
386 CACLIPDATA caclipdata;
387 CABSTR cabstr;
388 CALPSTR calpstr;
389 CALPWSTR calpwstr;
390 CAPROPVARIANT capropvar;
391 } u;
395 #define ICOM_INTERFACE IPropertyStorage
396 #define IPropertyStorage_METHODS \
397 ICOM_METHOD3(HRESULT,ReadMultiple, ULONG,cpspec, const PROPSPEC*,rgpspec, PROPVARIANT*,rgpropvar); \
398 ICOM_METHOD4(HRESULT,WriteMultiple, ULONG,cpspec, const PROPSPEC*,rgpspec, const PROPVARIANT*,rgpropvar, PROPID,propidNameFirst); \
399 ICOM_METHOD2(HRESULT,DeleteMultiple, ULONG,cpspec, const PROPSPEC*,rgpspec); \
400 ICOM_METHOD2(HRESULT,ReadPropertyNames, const PROPID*,rgpropid, LPOLESTR*,rglpwstrName); \
401 ICOM_METHOD3(HRESULT,WritePropertyNames, ULONG,cpropid, const PROPID*,rgpropid, LPOLESTR*,rglpwstrName); \
402 ICOM_METHOD2(HRESULT,DeletePropertyNames, ULONG,cpropid, const PROPID*,rgpropid); \
403 ICOM_METHOD1(HRESULT,Commit, DWORD,grfCommitFlags); \
404 ICOM_METHOD (HRESULT,Revert); \
405 ICOM_METHOD1(HRESULT,Enum, IEnumSTATPROPSTG**,ppenum); \
406 ICOM_METHOD3(HRESULT,SetTimes, const FILETIME*,pctime, const FILETIME*,patime, const FILETIME*,pmtime); \
407 ICOM_METHOD1(HRESULT,SetClass, REFCLSID,clsid); \
408 ICOM_METHOD1(HRESULT,Stat, STATPROPSETSTG*,pstatpsstg);
409 #define IPropertyStorage_IMETHODS \
410 ICOM_INHERITS(IPropertyStorage,IUnknown)
411 ICOM_DEFINE(IPropertyStorage,IUnknown)
412 #undef ICOM_INTERFACE
414 #ifdef ICOM_CINTERFACE
415 /*** IUnknown methods ***/
416 #define IPropertyStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
417 #define IPropertyStorage_AddRef(p) ICOM_CALL (AddRef,p)
418 #define IPropertyStorage_Release(p) ICOM_CALL (Release,p)
419 /*** IPropertyStorage methods ***/
420 #define IPropertyStorage_ReadMultiple(p,a,b,c) ICOM_CALL3(ReadMultiple,p,a,b,c)
421 #define IPropertyStorage_WriteMultiple(p,a,b,c,d) ICOM_CALL4(WriteMultiple,p,a,b,c,d)
422 #define IPropertyStorage_DeleteMultiple(p,a,b) ICOM_CALL2(DeleteMultiple,p,a,b)
423 #define IPropertyStorage_ReadPropertyNames(p,a,b) ICOM_CALL2(ReadPropertyNames,p,a,b)
424 #define IPropertyStorage_WritePropertyNames(p,a,b,c) ICOM_CALL3(WritePropertyNames,p,a,b,c)
425 #define IPropertyStorage_DeletePropertyNames(p,a,b) ICOM_CALL2(DeletePropertyNames,p,a,b)
426 #define IPropertyStorage_Commit(p,a) ICOM_CALL1(Commit,p,a)
427 #define IPropertyStorage_Revert(p) ICOM_CALL (Revert,p)
428 #define IPropertyStorage_Enum(p,a) ICOM_CALL1(Enum,p,a)
429 #define IPropertyStorage_SetTimes(p,a,b,c) ICOM_CALL3(SetTimes,p,a,b,c)
430 #define IPropertyStorage_SetClass(p,a) ICOM_CALL1(SetClass,p,a)
431 #define IPropertyStorage_Stat(p,a) ICOM_CALL1(Stat,p,a)
432 #endif
435 #endif /* __WINE_WINE_OBJ_PROPERTYSTORAGE_H */