2 * Defines the COM interfaces and APIs related to saving properties to file.
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 /*****************************************************************************
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
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
114 /*****************************************************************************
115 * STATPROPSTG structure
117 struct tagSTATPROPSTG
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)
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)
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)
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
219 unsigned char *pElems
;
222 typedef struct tagCAI
228 typedef struct tagCAUI
234 typedef struct tagCAL
240 typedef struct tagCAUL
246 typedef struct tagCAFLT
252 typedef struct tagCADBL
258 typedef struct tagCACY
264 typedef struct tagCADATE
270 typedef struct tagCABSTR
276 typedef struct tagCABOOL
279 VARIANT_BOOL
*pElems
;
282 typedef struct tagCASCODE
288 typedef struct tagCAPROPVARIANT
294 typedef struct tagCAH
297 LARGE_INTEGER
*pElems
;
300 typedef struct tagCAUH
303 ULARGE_INTEGER
*pElems
;
306 typedef struct tagCALPSTR
312 typedef struct tagCALPWSTR
318 typedef struct tagCAFILETIME
324 typedef struct tagCACLIPDATA
330 typedef struct tagCACLSID
336 struct tagPROPVARIANT
344 /* Empty union arm */
348 VARIANT_BOOL boolVal
;
350 /* FIXME: bool is reserved in C++, how can we deal with that ? */
358 ULARGE_INTEGER uhVal
;
384 CAFILETIME cafiletime
;
386 CACLIPDATA caclipdata
;
390 CAPROPVARIANT capropvar
;
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)
435 #endif /* __WINE_WINE_OBJ_PROPERTYSTORAGE_H */