00001 /* libwpg 00002 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org) 00003 * Copyright (C) 2004 Marc Oude Kotte (marc@solcon.nl) 00004 * 00005 * This library is free software; you can redistribute it and/or 00006 * modify it under the terms of the GNU Library General Public 00007 * License as published by the Free Software Foundation; either 00008 * version 2 of the License, or (at your option) any later version. 00009 * 00010 * This library is distributed in the hope that it will be useful, 00011 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00012 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00013 * Library General Public License for more details. 00014 * 00015 * You should have received a copy of the GNU Library General Public 00016 * License along with this library; if not, write to the 00017 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, 00018 * Boston, MA 02111-1301 USA 00019 * 00020 * For further information visit http://libwpg.sourceforge.net 00021 */ 00022 00023 /* "This product is not manufactured, approved, or supported by 00024 * Corel Corporation or Corel Corporation Limited." 00025 */ 00026 00027 #ifndef __WPGHEADER_H__ 00028 #define __WPGHEADER_H__ 00029 00030 #include <libwpd/WPXStream.h> 00031 00032 class WPGHeader 00033 { 00034 public: 00035 WPGHeader(); 00036 00037 bool load(WPXInputStream *input); 00038 00039 bool isSupported() const; 00040 00041 unsigned long startOfDocument() const; 00042 00043 int majorVersion() const; 00044 00045 private: 00046 unsigned char m_identifier[4]; // should always be 0xFF followed by "WPC" 00047 unsigned long m_startOfDocument; // index into file 00048 unsigned char m_productType; // should always be 1 for WPG files 00049 unsigned char m_fileType; // should always be 22 for WPG files 00050 unsigned char m_majorVersion; // 2 for WPG 8.0 files 00051 unsigned char m_minorVersion; // 0 for WPG 8.0 files 00052 unsigned int m_encryptionKey; // 0 when not encrypted 00053 unsigned int m_startOfPacketData; // unused, since according to the docs no packets are defined 00054 unsigned char m_entryCount; // number of entries in extension 00055 unsigned char m_resourceComplete; // resource completeness indicator 00056 unsigned int m_encryptionBlockOffset; // encryption block offset 00057 unsigned long m_fileSize; // size of the entire wpg file 00058 unsigned int m_encryptVersion; // encryption version information 00059 }; 00060 00061 #endif // WPGHEADER