{Start|End}{Doc|Page} go through DCfuncs.
[wine] / include / wine / obj_propertystorage.h
1 /*
2  * Defines the COM interfaces and APIs related to saving properties to file.
3  */
4
5 #ifndef __WINE_WINE_OBJ_PROPERTYSTORAGE_H
6 #define __WINE_WINE_OBJ_PROPERTYSTORAGE_H
7
8 #include "wine/obj_base.h"
9 #include "wine/obj_storage.h"
10
11 #ifdef __cplusplus
12 extern "C" {
13 #endif /* defined(__cplusplus) */
14
15 /*****************************************************************************
16  * Predeclare the interfaces
17  */
18 DEFINE_OLEGUID(IID_IEnumSTATPROPSETSTG, 0x0000013bL, 0, 0);
19 typedef struct IEnumSTATPROPSETSTG IEnumSTATPROPSETSTG,*LPENUMSTATPROPSETSTG;
20
21 DEFINE_OLEGUID(IID_IEnumSTATPROPSTG,    0x00000139L, 0, 0);
22 typedef struct IEnumSTATPROPSTG IEnumSTATPROPSTG,*LPENUMSTATPROPSTG;
23
24 DEFINE_OLEGUID(IID_IPropertySetStorage, 0x0000013aL, 0, 0);
25 typedef struct IPropertySetStorage IPropertySetStorage,*LPPROPERTYSETSTORAGE;
26
27 DEFINE_OLEGUID(IID_IPropertyStorage,    0x00000138L, 0, 0);
28 typedef struct IPropertyStorage IPropertyStorage,*LPPROPERTYSTORAGE;
29
30
31 /*****************************************************************************
32  * Predeclare the structures
33  */
34
35 typedef struct tagSTATPROPSETSTG STATPROPSETSTG;
36 typedef struct tagSTATPROPSTG STATPROPSTG;
37
38 extern const FMTID FMTID_SummaryInformation;
39 extern const FMTID FMTID_DocSummaryInformation;
40 extern const FMTID FMTID_UserDefinedProperties;
41
42 /*****************************************************************************
43  * PROPSPEC structure
44  */
45
46 /* Reserved global Property IDs */
47 #define PID_DICTIONARY  ( 0 )
48
49 #define PID_CODEPAGE    ( 0x1 )
50
51 #define PID_FIRST_USABLE        ( 0x2 )
52
53 #define PID_FIRST_NAME_DEFAULT  ( 0xfff )
54
55 #define PID_LOCALE      ( 0x80000000 )
56
57 #define PID_MODIFY_TIME ( 0x80000001 )
58
59 #define PID_SECURITY    ( 0x80000002 )
60
61 #define PID_ILLEGAL     ( 0xffffffff )
62
63 /* Property IDs for the SummaryInformation Property Set */
64
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 )
84
85
86 #define PRSPEC_LPWSTR   ( 0 )
87 #define PRSPEC_PROPID   ( 1 )
88
89 typedef struct tagPROPSPEC
90 {
91     ULONG ulKind;
92     union 
93     {
94         PROPID propid;
95         LPOLESTR lpwstr;
96     } u;
97 } PROPSPEC;
98
99
100 /*****************************************************************************
101  * STATPROPSETSTG structure
102  */
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
108
109 struct tagSTATPROPSETSTG
110 {
111     FMTID fmtid;
112     CLSID clsid;
113     DWORD grfFlags;
114     FILETIME mtime;
115     FILETIME ctime;
116     FILETIME atime;
117     DWORD dwOSVersion;
118 };
119
120
121 /*****************************************************************************
122  * STATPROPSTG structure
123  */
124 struct tagSTATPROPSTG
125 {
126     LPOLESTR lpwstrName;
127     PROPID propid;
128     VARTYPE vt;
129 };
130
131
132 /*****************************************************************************
133  * IEnumSTATPROPSETSTG interface
134  */
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
146
147 #ifdef ICOM_CINTERFACE
148 /*** IUnknown methods ***/
149 #define IEnumSTATPROPSETSTG_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
150 #define IEnumSTATPROPSETSTG_AddRef(p)             ICOM_CALL (AddRef,p)
151 #define IEnumSTATPROPSETSTG_Release(p)            ICOM_CALL (Release,p)
152 /*** IEnumSTATPROPSETSTG methods ***/
153 #define IEnumSTATPROPSETSTG_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
154 #define IEnumSTATPROPSETSTG_Skip(p,a)     ICOM_CALL1(Skip,p,a)
155 #define IEnumSTATPROPSETSTG_Reset(p)      ICOM_CALL (Reset,p)
156 #define IEnumSTATPROPSETSTG_Clone(p,a)    ICOM_CALL1(Clone,p,a)
157 #endif
158
159
160 /*****************************************************************************
161  * IEnumSTATPROPSTG interface
162  */
163 #define ICOM_INTERFACE IEnumSTATPROPSTG
164 #define IEnumSTATPROPSTG_METHODS \
165     ICOM_METHOD3(HRESULT,Next,  ULONG,celt, STATPROPSTG*,rgelt, ULONG*,pceltFethed) \
166     ICOM_METHOD1(HRESULT,Skip,  ULONG,celt) \
167     ICOM_METHOD (HRESULT,Reset) \
168     ICOM_METHOD1(HRESULT,Clone, IEnumSTATPROPSTG**,ppenum)
169 #define IEnumSTATPROPSTG_IMETHODS \
170                 IUnknown_IMETHODS \
171                 IEnumSTATPROPSTG_METHODS 
172 ICOM_DEFINE(IEnumSTATPROPSTG,IUnknown)
173 #undef ICOM_INTERFACE
174
175 #ifdef ICOM_CINTERFACE
176 /*** IUnknown methods ***/
177 #define IEnumSTATPROPSTG_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
178 #define IEnumSTATPROPSTG_AddRef(p)             ICOM_CALL (AddRef,p)
179 #define IEnumSTATPROPSTG_Release(p)            ICOM_CALL (Release,p)
180 /*** IEnumSTATPROPSTG methods ***/
181 #define IEnumSTATPROPSTG_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
182 #define IEnumSTATPROPSTG_Skip(p,a)     ICOM_CALL1(Skip,p,a)
183 #define IEnumSTATPROPSTG_Reset(p)      ICOM_CALL (Reset,p)
184 #define IEnumSTATPROPSTG_Clone(p,a)    ICOM_CALL1(Clone,p,a)
185 #endif
186
187
188 /*****************************************************************************
189  * IPropertySetStorage interface
190  */
191 #define ICOM_INTERFACE IPropertySetStorage
192 #define IPropertySetStorage_METHODS \
193     ICOM_METHOD5(HRESULT,Create, REFFMTID,rfmtid, const CLSID*,pclsid, DWORD,grfFlags, DWORD,grfMode, IPropertyStorage**,ppprstg) \
194     ICOM_METHOD3(HRESULT,Open,   REFFMTID,rfmtid, DWORD,grfMode, IPropertyStorage**,ppprstg) \
195     ICOM_METHOD1(HRESULT,Delete, REFFMTID,rfmtid) \
196     ICOM_METHOD1(HRESULT,Enum,   IEnumSTATPROPSETSTG**,ppenum)
197 #define IPropertySetStorage_IMETHODS \
198                 IUnknown_IMETHODS \
199                 IPropertySetStorage_METHODS
200 ICOM_DEFINE(IPropertySetStorage,IUnknown)
201 #undef ICOM_INTERFACE
202
203 #ifdef ICOM_CINTERFACE
204 /*** IUnknown methods ***/
205 #define IPropertySetStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
206 #define IPropertySetStorage_AddRef(p)             ICOM_CALL (AddRef,p)
207 #define IPropertySetStorage_Release(p)            ICOM_CALL (Release,p)
208 /*** IPropertySetStorage methods ***/
209 #define IPropertySetStorage_Create(p,a,b,c,d,e) ICOM_CALL5(Create,p,a,b,c,d,e)
210 #define IPropertySetStorage_Open(p,a,b,c)       ICOM_CALL3(Open,p,a,b,c)
211 #define IPropertySetStorage_Delete(p,a)         ICOM_CALL1(Delete,p,a)
212 #define IPropertySetStorage_Enum(p,a)           ICOM_CALL1(Enum,p,a)
213 #endif
214
215
216 /*****************************************************************************
217  * IPropertyStorage interface
218  */
219 typedef struct tagPROPVARIANT PROPVARIANT,*LPPROPVARIANT;
220
221 /* Flags for IPropertySetStorage::Create */
222 #define PROPSETFLAG_DEFAULT     ( 0 )
223 #define PROPSETFLAG_NONSIMPLE   ( 1 )
224 #define PROPSETFLAG_ANSI        ( 2 )
225
226 typedef struct  tagCAUB
227 {
228     ULONG cElems;
229     unsigned char *pElems;
230 } CAUB;
231
232 typedef struct tagCAI
233 {
234     ULONG cElems;
235     short *pElems;
236 } CAI;
237
238 typedef struct tagCAUI
239 {
240     ULONG cElems;
241     USHORT *pElems;
242 } CAUI;
243
244 typedef struct tagCAL
245 {
246     ULONG cElems;
247     long *pElems;
248 } CAL;
249
250 typedef struct tagCAUL
251 {
252     ULONG cElems;
253     ULONG *pElems;
254 } CAUL;
255
256 typedef struct tagCAFLT
257 {
258     ULONG cElems;
259     float *pElems;
260 } CAFLT;
261
262 typedef struct tagCADBL
263 {
264     ULONG cElems;
265     double *pElems;
266 } CADBL;
267
268 typedef struct tagCACY
269 {
270     ULONG cElems;
271     CY *pElems;
272 } CACY;
273
274 typedef struct tagCADATE
275 {
276     ULONG cElems;
277     DATE *pElems;
278 } CADATE;
279
280 typedef struct tagCABSTR
281 {
282     ULONG cElems;
283     BSTR *pElems;
284 } CABSTR;
285
286 typedef struct tagCABOOL
287 {
288     ULONG cElems;
289     VARIANT_BOOL *pElems;
290 } CABOOL;
291
292 typedef struct tagCASCODE
293 {
294     ULONG cElems;
295     SCODE *pElems;
296 } CASCODE;
297
298 typedef struct tagCAPROPVARIANT
299 {
300     ULONG cElems;
301     PROPVARIANT *pElems;
302 } CAPROPVARIANT;
303
304 typedef struct tagCAH
305 {
306     ULONG cElems;
307     LARGE_INTEGER *pElems;
308 } CAH;
309
310 typedef struct tagCAUH
311 {
312     ULONG cElems;
313     ULARGE_INTEGER *pElems;
314 } CAUH;
315
316 typedef struct tagCALPSTR
317 {
318     ULONG cElems;
319     LPSTR *pElems;
320 } CALPSTR;
321
322 typedef struct tagCALPWSTR
323 {
324     ULONG cElems;
325     LPWSTR *pElems;
326 } CALPWSTR;
327
328 typedef struct tagCAFILETIME
329 {
330     ULONG cElems;
331     FILETIME *pElems;
332 } CAFILETIME;
333
334 typedef struct tagCACLIPDATA
335 {
336     ULONG cElems;
337     CLIPDATA *pElems;
338 } CACLIPDATA;
339
340 typedef struct tagCACLSID
341 {
342     ULONG cElems;
343     CLSID *pElems;
344 } CACLSID;
345
346 struct tagPROPVARIANT
347 {
348     VARTYPE vt;
349     WORD wReserved1;
350     WORD wReserved2;
351     WORD wReserved3;
352     union 
353     {
354          /* Empty union arm */ 
355         UCHAR bVal;
356         short iVal;
357         USHORT uiVal;
358         VARIANT_BOOL boolVal;
359 #ifndef __cplusplus
360        /* FIXME: bool is reserved in C++, how can we deal with that ? */
361         _VARIANT_BOOL bool;
362 #endif
363         long lVal;
364         ULONG ulVal;
365         float fltVal;
366         SCODE scode;
367         LARGE_INTEGER hVal;
368         ULARGE_INTEGER uhVal;
369         double dblVal;
370         CY cyVal;
371         DATE date;
372         FILETIME filetime;
373         CLSID *puuid;
374         BLOB blob;
375         CLIPDATA *pclipdata;
376         IStream *pStream;
377         IStorage *pStorage;
378         BSTR bstrVal;
379         LPSTR pszVal;
380         LPWSTR pwszVal;
381         CAUB caub;
382         CAI cai;
383         CAUI caui;
384         CABOOL cabool;
385         CAL cal;
386         CAUL caul;
387         CAFLT caflt;
388         CASCODE cascode;
389         CAH cah;
390         CAUH cauh;
391         CADBL cadbl;
392         CACY cacy;
393         CADATE cadate;
394         CAFILETIME cafiletime;
395         CACLSID cauuid;
396         CACLIPDATA caclipdata;
397         CABSTR cabstr;
398         CALPSTR calpstr;
399         CALPWSTR calpwstr;
400         CAPROPVARIANT capropvar;
401     } u;
402 };
403
404
405 #define ICOM_INTERFACE IPropertyStorage
406 #define IPropertyStorage_METHODS \
407     ICOM_METHOD3(HRESULT,ReadMultiple,        ULONG,cpspec, const PROPSPEC*,rgpspec, PROPVARIANT*,rgpropvar) \
408     ICOM_METHOD4(HRESULT,WriteMultiple,       ULONG,cpspec, const PROPSPEC*,rgpspec, const PROPVARIANT*,rgpropvar, PROPID,propidNameFirst) \
409     ICOM_METHOD2(HRESULT,DeleteMultiple,      ULONG,cpspec, const PROPSPEC*,rgpspec) \
410     ICOM_METHOD2(HRESULT,ReadPropertyNames,   const PROPID*,rgpropid, LPOLESTR*,rglpwstrName) \
411     ICOM_METHOD3(HRESULT,WritePropertyNames,  ULONG,cpropid, const PROPID*,rgpropid, LPOLESTR*,rglpwstrName) \
412     ICOM_METHOD2(HRESULT,DeletePropertyNames, ULONG,cpropid, const PROPID*,rgpropid) \
413     ICOM_METHOD1(HRESULT,Commit,              DWORD,grfCommitFlags) \
414     ICOM_METHOD (HRESULT,Revert) \
415     ICOM_METHOD1(HRESULT,Enum,                IEnumSTATPROPSTG**,ppenum) \
416     ICOM_METHOD3(HRESULT,SetTimes,            const FILETIME*,pctime, const FILETIME*,patime, const FILETIME*,pmtime) \
417     ICOM_METHOD1(HRESULT,SetClass,            REFCLSID,clsid) \
418     ICOM_METHOD1(HRESULT,Stat,                STATPROPSETSTG*,pstatpsstg)
419 #define IPropertyStorage_IMETHODS \
420                 IUnknown_IMETHODS \
421                 IPropertyStorage_METHODS
422 ICOM_DEFINE(IPropertyStorage,IUnknown)
423 #undef ICOM_INTERFACE
424
425 #ifdef ICOM_CINTERFACE
426 /*** IUnknown methods ***/
427 #define IPropertyStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
428 #define IPropertyStorage_AddRef(p)             ICOM_CALL (AddRef,p)
429 #define IPropertyStorage_Release(p)            ICOM_CALL (Release,p)
430 /*** IPropertyStorage methods ***/
431 #define IPropertyStorage_ReadMultiple(p,a,b,c)       ICOM_CALL3(ReadMultiple,p,a,b,c)
432 #define IPropertyStorage_WriteMultiple(p,a,b,c,d)    ICOM_CALL4(WriteMultiple,p,a,b,c,d)
433 #define IPropertyStorage_DeleteMultiple(p,a,b)       ICOM_CALL2(DeleteMultiple,p,a,b)
434 #define IPropertyStorage_ReadPropertyNames(p,a,b)    ICOM_CALL2(ReadPropertyNames,p,a,b)
435 #define IPropertyStorage_WritePropertyNames(p,a,b,c) ICOM_CALL3(WritePropertyNames,p,a,b,c)
436 #define IPropertyStorage_DeletePropertyNames(p,a,b)  ICOM_CALL2(DeletePropertyNames,p,a,b)
437 #define IPropertyStorage_Commit(p,a)                 ICOM_CALL1(Commit,p,a)
438 #define IPropertyStorage_Revert(p)                   ICOM_CALL (Revert,p)
439 #define IPropertyStorage_Enum(p,a)                   ICOM_CALL1(Enum,p,a)
440 #define IPropertyStorage_SetTimes(p,a,b,c)           ICOM_CALL3(SetTimes,p,a,b,c)
441 #define IPropertyStorage_SetClass(p,a)               ICOM_CALL1(SetClass,p,a)
442 #define IPropertyStorage_Stat(p,a)                   ICOM_CALL1(Stat,p,a)
443 #endif
444
445 #ifdef __cplusplus
446 } /* extern "C" */
447 #endif /* defined(__cplusplus) */
448
449 #endif /* __WINE_WINE_OBJ_PROPERTYSTORAGE_H */