merge the formfield patch from ooo-build
[ooovba.git] / sd / source / filter / ppt / propread.hxx
blob45b91be71b55b3dd4d099a866d525e1a3d8dfaec
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: propread.hxx,v $
10 * $Revision: 1.7 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _PROPREAD_HXX_
32 #define _PROPREAD_HXX_
34 #include <tools/solar.h>
35 #include <sot/storage.hxx>
36 #include <tools/gen.hxx>
37 #include <tools/list.hxx>
38 #include <tools/stream.hxx>
39 #include <tools/datetime.hxx>
41 #include <tools/string.hxx>
43 // SummaryInformation
44 #define PID_TITLE 0x02
45 #define PID_SUBJECT 0x03
46 #define PID_AUTHOR 0x04
47 #define PID_KEYWORDS 0x05
48 #define PID_COMMENTS 0x06
49 #define PID_TEMPLATE 0x07
50 #define PID_LASTAUTHOR 0x08
51 #define PID_REVNUMBER 0x09
52 #define PID_EDITTIME 0x0a
53 #define PID_LASTPRINTED_DTM 0x0b
54 #define PID_CREATE_DTM 0x0c
55 #define PID_LASTSAVED_DTM 0x0d
57 // DocumentSummaryInformation
58 #define PID_CATEGORY 0x02
59 #define PID_PRESFORMAT 0x03
60 #define PID_BYTECOUNT 0x04
61 #define PID_LINECOUNT 0x05
62 #define PID_PARACOUNT 0x06
63 #define PID_SLIDECOUNT 0x07
64 #define PID_NOTECOUNT 0x08
65 #define PID_HIDDENCOUNT 0x09
66 #define PID_MMCLIPCOUNT 0x0a
67 #define PID_SCALE 0x0b
68 #define PID_HEADINGPAIR 0x0c
69 #define PID_DOCPARTS 0x0d
70 #define PID_MANAGER 0x0e
71 #define PID_COMPANY 0x0f
72 #define PID_LINKSDIRTY 0x10
74 #define VT_EMPTY 0
75 #define VT_NULL 1
76 #define VT_I2 2
77 #define VT_I4 3
78 #define VT_R4 4
79 #define VT_R8 5
80 #define VT_CY 6
81 #define VT_DATE 7
82 #define VT_BSTR 8
83 #define VT_UI4 9
84 #define VT_ERROR 10
85 #define VT_BOOL 11
86 #define VT_VARIANT 12
87 #define VT_DECIMAL 14
88 #define VT_I1 16
89 #define VT_UI1 17
90 #define VT_UI2 18
91 #define VT_I8 20
92 #define VT_UI8 21
93 #define VT_INT 22
94 #define VT_UINT 23
95 #define VT_LPSTR 30
96 #define VT_LPWSTR 31
97 #define VT_FILETIME 64
98 #define VT_BLOB 65
99 #define VT_STREAM 66
100 #define VT_STORAGE 67
101 #define VT_STREAMED_OBJECT 68
102 #define VT_STORED_OBJECT 69
103 #define VT_BLOB_OBJECT 70
104 #define VT_CF 71
105 #define VT_CLSID 72
106 #define VT_VECTOR 0x1000
107 #define VT_ARRAY 0x2000
108 #define VT_BYREF 0x4000
109 #define VT_TYPEMASK 0xFFF
111 // ------------------------------------------------------------------------
113 class PropItem : public SvMemoryStream
115 sal_uInt16 mnTextEnc;
117 public :
118 PropItem(){};
119 void Clear();
121 void SetTextEncoding( sal_uInt16 nTextEnc ){ mnTextEnc = nTextEnc; };
122 sal_Bool Read( String& rString, sal_uInt32 nType = VT_EMPTY, sal_Bool bDwordAlign = sal_True );
123 PropItem& operator=( PropItem& rPropItem );
125 using SvStream::Read;
128 // ------------------------------------------------------------------------
130 class Dictionary : protected List
132 friend class Section;
134 void AddProperty( UINT32 nId, const String& rString );
136 public :
137 Dictionary(){};
138 ~Dictionary();
139 Dictionary& operator=( Dictionary& rDictionary );
140 UINT32 GetProperty( const String& rPropName );
143 // ------------------------------------------------------------------------
145 class Section : private List
147 sal_uInt16 mnTextEnc;
149 protected:
151 BYTE aFMTID[ 16 ];
153 void AddProperty( sal_uInt32 nId, const sal_uInt8* pBuf, sal_uInt32 nBufSize );
155 public:
156 Section( const sal_uInt8* pFMTID );
157 Section( Section& rSection );
158 ~Section();
160 Section& operator=( Section& rSection );
161 sal_Bool GetProperty( sal_uInt32 nId, PropItem& rPropItem );
162 sal_Bool GetDictionary( Dictionary& rDict );
163 const sal_uInt8* GetFMTID() const { return aFMTID; };
164 void Read( SvStorageStream* pStrm );
167 // ------------------------------------------------------------------------
169 class PropRead : private List
171 sal_Bool mbStatus;
172 SvStorageStream* mpSvStream;
174 sal_uInt16 mnByteOrder;
175 sal_uInt16 mnFormat;
176 sal_uInt16 mnVersionLo;
177 sal_uInt16 mnVersionHi;
178 sal_uInt8 mApplicationCLSID[ 16 ];
180 void AddSection( Section& rSection );
182 public:
183 PropRead( SvStorage& rSvStorage, const String& rName );
184 ~PropRead();
186 PropRead& operator=( PropRead& rPropRead );
187 const Section* GetSection( const BYTE* pFMTID );
188 sal_Bool IsValid() const { return mbStatus; };
189 void Read();
193 #endif