1 /* libwpg
2 * Copyright (C) 2006 Ariya Hidayat (ariya@kde.org)
3 * Copyright (C) 2004 Marc Oude Kotte (marc@solcon.nl)
4 * Copyright (C) 2005 Fridrich Strba (fridrich.strba@bluewin.ch)
5 *
6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version.
10 *
11 * This library is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Library General Public License for more details.
15 *
16 * You should have received a copy of the GNU Library General Public
17 * License along with this library; if not, write to the
18 * Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
19 * Boston, MA 02111-1301 USA
20 *
21 * For further information visit http://libwpg.sourceforge.net
22 */
24 /* "This product is not manufactured, approved, or supported by
25 * Corel Corporation or Corel Corporation Limited."
26 */
28 #ifndef __WPGXPARSER_H__
29 #define __WPGXPARSER_H__
31 #include "WPGPaintInterface.h"
32 #include "WPGStream.h"
33 #include "WPGColor.h"
35 #include <map>
37 using namespace libwpg;
39 class WPGXParser
40 {
41 public:
42 WPGXParser(WPGInputStream *input, WPGPaintInterface* painter);
43 virtual ~WPGXParser() {}
44 virtual bool parse() = 0;
46 unsigned char readU8();
47 unsigned short readU16();
48 unsigned long readU32();
49 char readS8();
50 short readS16();
51 long readS32();
52 unsigned int readVariableLengthInteger();
54 protected:
55 WPGInputStream* m_input;
56 WPGPaintInterface* m_painter;
57 std::map<int,WPGColor> m_colorPalette;
58 };
60 #endif // __WPGXPARSER_H__