bump product version to 6.3.0.0.beta1
[LibreOffice.git] / sd / source / filter / ppt / propread.hxx
blob6ec04df7d9d4a2cf143e936ea8c57e320bb6f78c
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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
23 #include <map>
24 #include <vector>
25 #include <memory>
27 #include <sal/types.h>
28 #include <sot/storage.hxx>
29 #include <tools/stream.hxx>
31 // SummaryInformation
32 #define PID_TITLE 0x02
33 #define PID_SUBJECT 0x03
34 #define PID_AUTHOR 0x04
35 #define PID_KEYWORDS 0x05
36 #define PID_COMMENTS 0x06
37 #define PID_TEMPLATE 0x07
38 #define PID_LASTAUTHOR 0x08
39 #define PID_REVNUMBER 0x09
40 #define PID_CREATE_DTM 0x0c
42 // DocumentSummaryInformation
43 #define PID_SLIDECOUNT 0x07
44 #define PID_HEADINGPAIR 0x0c
45 #define PID_DOCPARTS 0x0d
47 #define VT_EMPTY 0
48 #define VT_NULL 1
49 #define VT_I2 2
50 #define VT_I4 3
51 #define VT_R4 4
52 #define VT_R8 5
53 #define VT_CY 6
54 #define VT_DATE 7
55 #define VT_BSTR 8
56 #define VT_UI4 9
57 #define VT_ERROR 10
58 #define VT_BOOL 11
59 #define VT_VARIANT 12
60 #define VT_DECIMAL 14
61 #define VT_I1 16
62 #define VT_UI1 17
63 #define VT_UI2 18
64 #define VT_I8 20
65 #define VT_UI8 21
66 #define VT_INT 22
67 #define VT_UINT 23
68 #define VT_LPSTR 30
69 #define VT_LPWSTR 31
70 #define VT_FILETIME 64
71 #define VT_BLOB 65
72 #define VT_STREAM 66
73 #define VT_STORAGE 67
74 #define VT_STREAMED_OBJECT 68
75 #define VT_STORED_OBJECT 69
76 #define VT_BLOB_OBJECT 70
77 #define VT_CF 71
78 #define VT_CLSID 72
79 #define VT_VECTOR 0x1000
80 #define VT_ARRAY 0x2000
81 #define VT_BYREF 0x4000
82 #define VT_TYPEMASK 0xFFF
84 typedef std::map<OUString,sal_uInt32> Dictionary;
86 struct PropEntry
88 sal_uInt32 mnId;
89 sal_uInt32 mnSize;
90 std::unique_ptr<sal_uInt8[]> mpBuf;
92 PropEntry( sal_uInt32 nId, const sal_uInt8* pBuf, sal_uInt32 nBufSize );
93 PropEntry( const PropEntry& rProp );
95 PropEntry& operator=(const PropEntry& rPropEntry);
98 class PropItem : public SvMemoryStream
100 sal_uInt16 mnTextEnc;
102 public:
103 PropItem()
104 : mnTextEnc(RTL_TEXTENCODING_DONTKNOW)
107 void Clear();
109 void SetTextEncoding( sal_uInt16 nTextEnc ){ mnTextEnc = nTextEnc; };
110 bool Read( OUString& rString, sal_uInt32 nType = VT_EMPTY, bool bDwordAlign = true );
111 PropItem& operator=( PropItem& rPropItem );
114 class Section final
116 sal_uInt16 mnTextEnc;
117 std::vector<std::unique_ptr<PropEntry> > maEntries;
119 sal_uInt8 aFMTID[ 16 ];
121 void AddProperty( sal_uInt32 nId, const sal_uInt8* pBuf, sal_uInt32 nBufSize );
123 public:
124 explicit Section( const sal_uInt8* pFMTID );
125 Section( const Section& rSection );
127 Section& operator=( const Section& rSection );
128 bool GetProperty( sal_uInt32 nId, PropItem& rPropItem );
129 void GetDictionary( Dictionary& rDict );
130 const sal_uInt8* GetFMTID() const { return aFMTID; };
131 void Read( SotStorageStream* pStrm );
134 class PropRead
136 bool mbStatus;
137 tools::SvRef<SotStorageStream> mpSvStream;
139 sal_uInt16 mnByteOrder;
140 sal_uInt8 mApplicationCLSID[ 16 ];
141 std::vector<std::unique_ptr<Section> > maSections;
143 public:
144 PropRead( SotStorage& rSvStorage, const OUString& rName );
146 PropRead& operator=( const PropRead& rPropRead );
147 const Section* GetSection( const sal_uInt8* pFMTID );
148 bool IsValid() const { return mbStatus; };
149 void Read();
152 #endif
154 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */