2 * Defines the COM interfaces and APIs related to saving properties to file.
4 * Copyright (C) the Wine project
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Lesser General Public
8 * License as published by the Free Software Foundation; either
9 * version 2.1 of the License, or (at your option) any later version.
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Lesser General Public License for more details.
16 * You should have received a copy of the GNU Lesser General Public
17 * License along with this library; if not, write to the Free Software
18 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
21 #ifndef __WINE_WINE_OBJ_PROPERTYSTORAGE_H
22 #define __WINE_WINE_OBJ_PROPERTYSTORAGE_H
26 #endif /* defined(__cplusplus) */
28 /*****************************************************************************
29 * Predeclare the interfaces
31 DEFINE_OLEGUID(IID_IEnumSTATPROPSETSTG
, 0x0000013bL
, 0, 0);
32 typedef struct IEnumSTATPROPSETSTG IEnumSTATPROPSETSTG
,*LPENUMSTATPROPSETSTG
;
34 DEFINE_OLEGUID(IID_IEnumSTATPROPSTG
, 0x00000139L
, 0, 0);
35 typedef struct IEnumSTATPROPSTG IEnumSTATPROPSTG
,*LPENUMSTATPROPSTG
;
37 DEFINE_OLEGUID(IID_IPropertySetStorage
, 0x0000013aL
, 0, 0);
38 typedef struct IPropertySetStorage IPropertySetStorage
,*LPPROPERTYSETSTORAGE
;
40 DEFINE_OLEGUID(IID_IPropertyStorage
, 0x00000138L
, 0, 0);
41 typedef struct IPropertyStorage IPropertyStorage
,*LPPROPERTYSTORAGE
;
44 /*****************************************************************************
45 * Predeclare the structures
48 typedef struct tagSTATPROPSETSTG STATPROPSETSTG
;
49 typedef struct tagSTATPROPSTG STATPROPSTG
;
51 extern const FMTID FMTID_SummaryInformation
;
52 extern const FMTID FMTID_DocSummaryInformation
;
53 extern const FMTID FMTID_UserDefinedProperties
;
55 /*****************************************************************************
59 /* Reserved global Property IDs */
60 #define PID_DICTIONARY ( 0 )
62 #define PID_CODEPAGE ( 0x1 )
64 #define PID_FIRST_USABLE ( 0x2 )
66 #define PID_FIRST_NAME_DEFAULT ( 0xfff )
68 #define PID_LOCALE ( 0x80000000 )
70 #define PID_MODIFY_TIME ( 0x80000001 )
72 #define PID_SECURITY ( 0x80000002 )
74 #define PID_ILLEGAL ( 0xffffffff )
76 /* Property IDs for the SummaryInformation Property Set */
78 #define PIDSI_TITLE 0x00000002L /* VT_LPSTR */
79 #define PIDSI_SUBJECT 0x00000003L /* VT_LPSTR */
80 #define PIDSI_AUTHOR 0x00000004L /* VT_LPSTR */
81 #define PIDSI_KEYWORDS 0x00000005L /* VT_LPSTR */
82 #define PIDSI_COMMENTS 0x00000006L /* VT_LPSTR */
83 #define PIDSI_TEMPLATE 0x00000007L /* VT_LPSTR */
84 #define PIDSI_LASTAUTHOR 0x00000008L /* VT_LPSTR */
85 #define PIDSI_REVNUMBER 0x00000009L /* VT_LPSTR */
86 #define PIDSI_EDITTIME 0x0000000aL /* VT_FILETIME (UTC) */
87 #define PIDSI_LASTPRINTED 0x0000000bL /* VT_FILETIME (UTC) */
88 #define PIDSI_CREATE_DTM 0x0000000cL /* VT_FILETIME (UTC) */
89 #define PIDSI_LASTSAVE_DTM 0x0000000dL /* VT_FILETIME (UTC) */
90 #define PIDSI_PAGECOUNT 0x0000000eL /* VT_I4 */
91 #define PIDSI_WORDCOUNT 0x0000000fL /* VT_I4 */
92 #define PIDSI_CHARCOUNT 0x00000010L /* VT_I4 */
93 #define PIDSI_THUMBNAIL 0x00000011L /* VT_CF */
94 #define PIDSI_APPNAME 0x00000012L /* VT_LPSTR */
95 #define PIDSI_DOC_SECURITY 0x00000013L /* VT_I4 */
96 #define PRSPEC_INVALID ( 0xffffffff )
99 #define PRSPEC_LPWSTR ( 0 )
100 #define PRSPEC_PROPID ( 1 )
102 typedef struct tagPROPSPEC
113 /*****************************************************************************
114 * STATPROPSETSTG structure
116 /* Macros for parsing the OS Version of the Property Set Header */
117 #define PROPSETHDR_OSVER_KIND(dwOSVer) HIWORD( (dwOSVer) )
118 #define PROPSETHDR_OSVER_MAJOR(dwOSVer) LOBYTE(LOWORD( (dwOSVer) ))
119 #define PROPSETHDR_OSVER_MINOR(dwOSVer) HIBYTE(LOWORD( (dwOSVer) ))
120 #define PROPSETHDR_OSVERSION_UNKNOWN 0xFFFFFFFF
122 struct tagSTATPROPSETSTG
134 /*****************************************************************************
135 * STATPROPSTG structure
137 struct tagSTATPROPSTG
145 /*****************************************************************************
146 * IEnumSTATPROPSETSTG interface
148 #define ICOM_INTERFACE IEnumSTATPROPSETSTG
149 #define IEnumSTATPROPSETSTG_METHODS \
150 ICOM_METHOD3(HRESULT,Next, ULONG,celt, STATPROPSETSTG*,rgelt, ULONG*,pceltFethed) \
151 ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \
152 ICOM_METHOD (HRESULT,Reset) \
153 ICOM_METHOD1(HRESULT,Clone, IEnumSTATPROPSETSTG**,ppenum)
154 #define IEnumSTATPROPSETSTG_IMETHODS \
156 IEnumSTATPROPSETSTG_METHODS
157 ICOM_DEFINE(IEnumSTATPROPSETSTG
,IUnknown
)
158 #undef ICOM_INTERFACE
160 /*** IUnknown methods ***/
161 #define IEnumSTATPROPSETSTG_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
162 #define IEnumSTATPROPSETSTG_AddRef(p) ICOM_CALL (AddRef,p)
163 #define IEnumSTATPROPSETSTG_Release(p) ICOM_CALL (Release,p)
164 /*** IEnumSTATPROPSETSTG methods ***/
165 #define IEnumSTATPROPSETSTG_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
166 #define IEnumSTATPROPSETSTG_Skip(p,a) ICOM_CALL1(Skip,p,a)
167 #define IEnumSTATPROPSETSTG_Reset(p) ICOM_CALL (Reset,p)
168 #define IEnumSTATPROPSETSTG_Clone(p,a) ICOM_CALL1(Clone,p,a)
171 /*****************************************************************************
172 * IEnumSTATPROPSTG interface
174 #define ICOM_INTERFACE IEnumSTATPROPSTG
175 #define IEnumSTATPROPSTG_METHODS \
176 ICOM_METHOD3(HRESULT,Next, ULONG,celt, STATPROPSTG*,rgelt, ULONG*,pceltFethed) \
177 ICOM_METHOD1(HRESULT,Skip, ULONG,celt) \
178 ICOM_METHOD (HRESULT,Reset) \
179 ICOM_METHOD1(HRESULT,Clone, IEnumSTATPROPSTG**,ppenum)
180 #define IEnumSTATPROPSTG_IMETHODS \
182 IEnumSTATPROPSTG_METHODS
183 ICOM_DEFINE(IEnumSTATPROPSTG
,IUnknown
)
184 #undef ICOM_INTERFACE
186 /*** IUnknown methods ***/
187 #define IEnumSTATPROPSTG_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
188 #define IEnumSTATPROPSTG_AddRef(p) ICOM_CALL (AddRef,p)
189 #define IEnumSTATPROPSTG_Release(p) ICOM_CALL (Release,p)
190 /*** IEnumSTATPROPSTG methods ***/
191 #define IEnumSTATPROPSTG_Next(p,a,b,c) ICOM_CALL3(Next,p,a,b,c)
192 #define IEnumSTATPROPSTG_Skip(p,a) ICOM_CALL1(Skip,p,a)
193 #define IEnumSTATPROPSTG_Reset(p) ICOM_CALL (Reset,p)
194 #define IEnumSTATPROPSTG_Clone(p,a) ICOM_CALL1(Clone,p,a)
197 /*****************************************************************************
198 * IPropertySetStorage interface
200 #define ICOM_INTERFACE IPropertySetStorage
201 #define IPropertySetStorage_METHODS \
202 ICOM_METHOD5(HRESULT,Create, REFFMTID,rfmtid, const CLSID*,pclsid, DWORD,grfFlags, DWORD,grfMode, IPropertyStorage**,ppprstg) \
203 ICOM_METHOD3(HRESULT,Open, REFFMTID,rfmtid, DWORD,grfMode, IPropertyStorage**,ppprstg) \
204 ICOM_METHOD1(HRESULT,Delete, REFFMTID,rfmtid) \
205 ICOM_METHOD1(HRESULT,Enum, IEnumSTATPROPSETSTG**,ppenum)
206 #define IPropertySetStorage_IMETHODS \
208 IPropertySetStorage_METHODS
209 ICOM_DEFINE(IPropertySetStorage
,IUnknown
)
210 #undef ICOM_INTERFACE
212 /*** IUnknown methods ***/
213 #define IPropertySetStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
214 #define IPropertySetStorage_AddRef(p) ICOM_CALL (AddRef,p)
215 #define IPropertySetStorage_Release(p) ICOM_CALL (Release,p)
216 /*** IPropertySetStorage methods ***/
217 #define IPropertySetStorage_Create(p,a,b,c,d,e) ICOM_CALL5(Create,p,a,b,c,d,e)
218 #define IPropertySetStorage_Open(p,a,b,c) ICOM_CALL3(Open,p,a,b,c)
219 #define IPropertySetStorage_Delete(p,a) ICOM_CALL1(Delete,p,a)
220 #define IPropertySetStorage_Enum(p,a) ICOM_CALL1(Enum,p,a)
223 /*****************************************************************************
224 * IPropertyStorage interface
226 typedef struct tagPROPVARIANT PROPVARIANT
,*LPPROPVARIANT
;
228 /* Flags for IPropertySetStorage::Create */
229 #define PROPSETFLAG_DEFAULT ( 0 )
230 #define PROPSETFLAG_NONSIMPLE ( 1 )
231 #define PROPSETFLAG_ANSI ( 2 )
233 typedef struct tagCAUB
236 unsigned char *pElems
;
239 typedef struct tagCAI
245 typedef struct tagCAUI
251 typedef struct tagCAL
257 typedef struct tagCAUL
263 typedef struct tagCAFLT
269 typedef struct tagCADBL
275 typedef struct tagCACY
281 typedef struct tagCADATE
287 typedef struct tagCABSTR
293 typedef struct tagCABOOL
296 VARIANT_BOOL
*pElems
;
299 typedef struct tagCASCODE
305 typedef struct tagCAPROPVARIANT
311 typedef struct tagCAH
314 LARGE_INTEGER
*pElems
;
317 typedef struct tagCAUH
320 ULARGE_INTEGER
*pElems
;
323 typedef struct tagCALPSTR
329 typedef struct tagCALPWSTR
335 typedef struct tagCAFILETIME
341 typedef struct tagCACLIPDATA
347 typedef struct tagCACLSID
353 struct tagPROPVARIANT
361 /* Empty union arm */
365 VARIANT_BOOL boolVal
;
367 /* FIXME: bool is reserved in C++, how can we deal with that ? */
375 ULARGE_INTEGER uhVal
;
401 CAFILETIME cafiletime
;
403 CACLIPDATA caclipdata
;
407 CAPROPVARIANT capropvar
;
412 #define ICOM_INTERFACE IPropertyStorage
413 #define IPropertyStorage_METHODS \
414 ICOM_METHOD3(HRESULT,ReadMultiple, ULONG,cpspec, const PROPSPEC*,rgpspec, PROPVARIANT*,rgpropvar) \
415 ICOM_METHOD4(HRESULT,WriteMultiple, ULONG,cpspec, const PROPSPEC*,rgpspec, const PROPVARIANT*,rgpropvar, PROPID,propidNameFirst) \
416 ICOM_METHOD2(HRESULT,DeleteMultiple, ULONG,cpspec, const PROPSPEC*,rgpspec) \
417 ICOM_METHOD2(HRESULT,ReadPropertyNames, const PROPID*,rgpropid, LPOLESTR*,rglpwstrName) \
418 ICOM_METHOD3(HRESULT,WritePropertyNames, ULONG,cpropid, const PROPID*,rgpropid, LPOLESTR*,rglpwstrName) \
419 ICOM_METHOD2(HRESULT,DeletePropertyNames, ULONG,cpropid, const PROPID*,rgpropid) \
420 ICOM_METHOD1(HRESULT,Commit, DWORD,grfCommitFlags) \
421 ICOM_METHOD (HRESULT,Revert) \
422 ICOM_METHOD1(HRESULT,Enum, IEnumSTATPROPSTG**,ppenum) \
423 ICOM_METHOD3(HRESULT,SetTimes, const FILETIME*,pctime, const FILETIME*,patime, const FILETIME*,pmtime) \
424 ICOM_METHOD1(HRESULT,SetClass, REFCLSID,clsid) \
425 ICOM_METHOD1(HRESULT,Stat, STATPROPSETSTG*,pstatpsstg)
426 #define IPropertyStorage_IMETHODS \
428 IPropertyStorage_METHODS
429 ICOM_DEFINE(IPropertyStorage
,IUnknown
)
430 #undef ICOM_INTERFACE
432 /*** IUnknown methods ***/
433 #define IPropertyStorage_QueryInterface(p,a,b) ICOM_CALL2(QueryInterface,p,a,b)
434 #define IPropertyStorage_AddRef(p) ICOM_CALL (AddRef,p)
435 #define IPropertyStorage_Release(p) ICOM_CALL (Release,p)
436 /*** IPropertyStorage methods ***/
437 #define IPropertyStorage_ReadMultiple(p,a,b,c) ICOM_CALL3(ReadMultiple,p,a,b,c)
438 #define IPropertyStorage_WriteMultiple(p,a,b,c,d) ICOM_CALL4(WriteMultiple,p,a,b,c,d)
439 #define IPropertyStorage_DeleteMultiple(p,a,b) ICOM_CALL2(DeleteMultiple,p,a,b)
440 #define IPropertyStorage_ReadPropertyNames(p,a,b) ICOM_CALL2(ReadPropertyNames,p,a,b)
441 #define IPropertyStorage_WritePropertyNames(p,a,b,c) ICOM_CALL3(WritePropertyNames,p,a,b,c)
442 #define IPropertyStorage_DeletePropertyNames(p,a,b) ICOM_CALL2(DeletePropertyNames,p,a,b)
443 #define IPropertyStorage_Commit(p,a) ICOM_CALL1(Commit,p,a)
444 #define IPropertyStorage_Revert(p) ICOM_CALL (Revert,p)
445 #define IPropertyStorage_Enum(p,a) ICOM_CALL1(Enum,p,a)
446 #define IPropertyStorage_SetTimes(p,a,b,c) ICOM_CALL3(SetTimes,p,a,b,c)
447 #define IPropertyStorage_SetClass(p,a) ICOM_CALL1(SetClass,p,a)
448 #define IPropertyStorage_Stat(p,a) ICOM_CALL1(Stat,p,a)
452 #endif /* defined(__cplusplus) */
454 #endif /* __WINE_WINE_OBJ_PROPERTYSTORAGE_H */