1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_SD_SOURCE_FILTER_PPT_PROPREAD_HXX
21 #define INCLUDED_SD_SOURCE_FILTER_PPT_PROPREAD_HXX
24 #include <boost/ptr_container/ptr_vector.hpp>
26 #include <sal/types.h>
27 #include <sot/storage.hxx>
28 #include <tools/stream.hxx>
31 #define PID_TITLE 0x02
32 #define PID_SUBJECT 0x03
33 #define PID_AUTHOR 0x04
34 #define PID_KEYWORDS 0x05
35 #define PID_COMMENTS 0x06
36 #define PID_TEMPLATE 0x07
37 #define PID_LASTAUTHOR 0x08
38 #define PID_REVNUMBER 0x09
39 #define PID_CREATE_DTM 0x0c
41 // DocumentSummaryInformation
42 #define PID_SLIDECOUNT 0x07
43 #define PID_HEADINGPAIR 0x0c
44 #define PID_DOCPARTS 0x0d
69 #define VT_FILETIME 64
73 #define VT_STREAMED_OBJECT 68
74 #define VT_STORED_OBJECT 69
75 #define VT_BLOB_OBJECT 70
78 #define VT_VECTOR 0x1000
79 #define VT_ARRAY 0x2000
80 #define VT_BYREF 0x4000
81 #define VT_TYPEMASK 0xFFF
83 typedef std::map
<OUString
,sal_uInt32
> Dictionary
;
92 PropEntry( sal_uInt32 nId
, const sal_uInt8
* pBuf
, sal_uInt32 nBufSize
, sal_uInt16 nTextEnc
);
93 PropEntry( const PropEntry
& rProp
);
94 ~PropEntry() { delete[] mpBuf
; } ;
96 PropEntry
& operator=(const PropEntry
& rPropEntry
);
99 class PropItem
: public SvMemoryStream
101 sal_uInt16 mnTextEnc
;
105 : mnTextEnc(RTL_TEXTENCODING_DONTKNOW
)
110 void SetTextEncoding( sal_uInt16 nTextEnc
){ mnTextEnc
= nTextEnc
; };
111 bool Read( OUString
& rString
, sal_uInt32 nType
= VT_EMPTY
, bool bDwordAlign
= true );
112 PropItem
& operator=( PropItem
& rPropItem
);
114 using SvStream::Read
;
119 sal_uInt16 mnTextEnc
;
120 boost::ptr_vector
<PropEntry
> maEntries
;
124 sal_uInt8 aFMTID
[ 16 ];
126 void AddProperty( sal_uInt32 nId
, const sal_uInt8
* pBuf
, sal_uInt32 nBufSize
);
129 Section( const sal_uInt8
* pFMTID
);
130 Section( const Section
& rSection
);
132 Section
& operator=( const Section
& rSection
);
133 bool GetProperty( sal_uInt32 nId
, PropItem
& rPropItem
);
134 void GetDictionary( Dictionary
& rDict
);
135 const sal_uInt8
* GetFMTID() const { return aFMTID
; };
136 void Read( SotStorageStream
* pStrm
);
142 tools::SvRef
<SotStorageStream
> mpSvStream
;
144 sal_uInt16 mnByteOrder
;
146 sal_uInt16 mnVersionLo
;
147 sal_uInt16 mnVersionHi
;
148 sal_uInt8 mApplicationCLSID
[ 16 ];
149 boost::ptr_vector
<Section
> maSections
;
151 void AddSection( Section
& rSection
);
154 PropRead( SotStorage
& rSvStorage
, const OUString
& rName
);
156 PropRead
& operator=( const PropRead
& rPropRead
);
157 const Section
* GetSection( const sal_uInt8
* pFMTID
);
158 bool IsValid() const { return mbStatus
; };
164 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */