1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: propread.hxx,v $
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>
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
97 #define VT_FILETIME 64
100 #define VT_STORAGE 67
101 #define VT_STREAMED_OBJECT 68
102 #define VT_STORED_OBJECT 69
103 #define VT_BLOB_OBJECT 70
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
;
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
);
139 Dictionary
& operator=( Dictionary
& rDictionary
);
140 UINT32
GetProperty( const String
& rPropName
);
143 // ------------------------------------------------------------------------
145 class Section
: private List
147 sal_uInt16 mnTextEnc
;
153 void AddProperty( sal_uInt32 nId
, const sal_uInt8
* pBuf
, sal_uInt32 nBufSize
);
156 Section( const sal_uInt8
* pFMTID
);
157 Section( Section
& rSection
);
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
172 SvStorageStream
* mpSvStream
;
174 sal_uInt16 mnByteOrder
;
176 sal_uInt16 mnVersionLo
;
177 sal_uInt16 mnVersionHi
;
178 sal_uInt8 mApplicationCLSID
[ 16 ];
180 void AddSection( Section
& rSection
);
183 PropRead( SvStorage
& rSvStorage
, const String
& rName
);
186 PropRead
& operator=( PropRead
& rPropRead
);
187 const Section
* GetSection( const BYTE
* pFMTID
);
188 sal_Bool
IsValid() const { return mbStatus
; };