1 /* libwpg
2 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
3 * Copyright (C) 2004 Marc Oude Kotte (marc@solcon.nl)
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Library General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Library General Public License for more details.
14 *
15 * You should have received a copy of the GNU Library General Public
16 * License along with this library; if not, write to the
17 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02111-1301 USA
19 *
20 * For further information visit http://libwpg.sourceforge.net
21 */
23 /* "This product is not manufactured, approved, or supported by
24 * Corel Corporation or Corel Corporation Limited."
25 */
27 #ifndef __WPGHEADER_H__
28 #define __WPGHEADER_H__
30 #include "WPGStream.h"
32 using namespace libwpg;
34 class WPGHeader
35 {
36 public:
37 WPGHeader();
39 bool load(WPGInputStream *input);
41 bool isSupported() const;
43 unsigned long startOfDocument() const;
45 int majorVersion() const;
47 private:
48 unsigned char m_identifier[4]; // should always be 0xFF followed by "WPC"
49 unsigned long m_startOfDocument; // index into file
50 unsigned char m_productType; // should always be 1 for WPG files
51 unsigned char m_fileType; // should always be 22 for WPG files
52 unsigned char m_majorVersion; // 2 for WPG 8.0 files
53 unsigned char m_minorVersion; // 0 for WPG 8.0 files
54 unsigned int m_encryptionKey; // 0 when not encrypted
55 unsigned int m_startOfPacketData; // unused, since according to the docs no packets are defined
56 unsigned char m_entryCount; // number of entries in extension
57 unsigned char m_resourceComplete; // resource completeness indicator
58 unsigned int m_encryptionBlockOffset; // encryption block offset
59 unsigned long m_fileSize; // size of the entire wpg file
60 unsigned int m_encryptVersion; // encryption version information
61 };
63 #endif // WPGHEADER