Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028 #ifndef __WPGXPARSER_H__
00029 #define __WPGXPARSER_H__
00030
00031 #include "WPGPaintInterface.h"
00032 #include <libwpd-stream/WPXStream.h>
00033 #include <libwpd/libwpd.h>
00034 #include "WPGColor.h"
00035
00036 #include <map>
00037
00038 class WPGXParser
00039 {
00040 public:
00041 WPGXParser(WPXInputStream *input, libwpg::WPGPaintInterface *painter);
00042 WPGXParser(const WPGXParser &parser);
00043 virtual ~WPGXParser() {};
00044 virtual bool parse() = 0;
00045
00046 unsigned char readU8();
00047 unsigned short readU16();
00048 unsigned int readU32();
00049 short readS16();
00050 int readS32();
00051 unsigned int readVariableLengthInteger();
00052 WPGXParser &operator=(const WPGXParser &parser);
00053
00054 protected:
00055 WPXInputStream *m_input;
00056 libwpg::WPGPaintInterface *m_painter;
00057 std::map<int,libwpg::WPGColor> m_colorPalette;
00058 };
00059
00060 class WPGTextDataHandler : public ::WPXDocumentInterface
00061 {
00062 public:
00063 WPGTextDataHandler(libwpg::WPGPaintInterface *painter) :
00064 m_painter(painter),
00065 m_fontName("Times New Roman"),
00066 m_paragraphStyle(),
00067 m_textStyle() {}
00068
00069 ~WPGTextDataHandler() {}
00070 void setDocumentMetaData(const WPXPropertyList & ) {}
00071
00072 void startDocument() {}
00073 void endDocument() {}
00074
00075 void startSubDocument() {}
00076 void endSubDocument();
00077
00078 void definePageStyle(const WPXPropertyList & ) {}
00079 void openPageSpan(const WPXPropertyList & ) {}
00080 void closePageSpan() {}
00081 void openHeader(const WPXPropertyList & ) {}
00082 void closeHeader() {}
00083 void openFooter(const WPXPropertyList & ) {}
00084 void closeFooter() {}
00085
00086 void defineParagraphStyle(const WPXPropertyList & , const WPXPropertyListVector & ) {}
00087 void openParagraph(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops);
00088 void closeParagraph();
00089
00090 void defineCharacterStyle(const WPXPropertyList & ) {}
00091 void openSpan(const WPXPropertyList &propList);
00092 void closeSpan();
00093
00094 void defineSectionStyle(const WPXPropertyList & , const WPXPropertyListVector & ) {}
00095 void openSection(const WPXPropertyList & , const WPXPropertyListVector & ) {}
00096 void closeSection() {}
00097
00098 void insertTab();
00099 void insertSpace();
00100 void insertText(const WPXString &text);
00101 void insertLineBreak();
00102 void insertField(const WPXString & , const WPXPropertyList & ) {}
00103
00104 void defineOrderedListLevel(const WPXPropertyList & ) {}
00105 void defineUnorderedListLevel(const WPXPropertyList & ) {}
00106 void openOrderedListLevel(const WPXPropertyList & ) {}
00107 void openUnorderedListLevel(const WPXPropertyList & ) {}
00108 void closeOrderedListLevel() {}
00109 void closeUnorderedListLevel() {}
00110 void openListElement(const WPXPropertyList &propList, const WPXPropertyListVector &tabStops);
00111 void closeListElement();
00112
00113 void openFootnote(const WPXPropertyList & ) {}
00114 void closeFootnote() {}
00115 void openEndnote(const WPXPropertyList & ) {}
00116 void closeEndnote() {}
00117 void openComment(const WPXPropertyList & ) {}
00118 void closeComment() {}
00119 void openTextBox(const WPXPropertyList & ) {}
00120 void closeTextBox() {}
00121
00122 void openTable(const WPXPropertyList & , const WPXPropertyListVector & ) {}
00123 void openTableRow(const WPXPropertyList & ) {}
00124 void closeTableRow() {}
00125 void openTableCell(const WPXPropertyList & ) {}
00126 void closeTableCell() {}
00127 void insertCoveredTableCell(const WPXPropertyList & ) {}
00128 void closeTable() {}
00129
00130 void openFrame(const WPXPropertyList & ) {}
00131 void closeFrame() {}
00132
00133 void insertBinaryObject(const WPXPropertyList & , const WPXBinaryData & ) {}
00134 void insertEquation(const WPXPropertyList & , const WPXString & ) {}
00135
00136 private:
00137 libwpg::WPGPaintInterface *m_painter;
00138 ::WPXString m_fontName;
00139 ::WPXPropertyList m_paragraphStyle, m_textStyle;
00140
00141 WPGTextDataHandler(const WPGTextDataHandler &);
00142 WPGTextDataHandler &operator=(const WPGTextDataHandler &);
00143 };
00144
00145
00146 #endif // __WPGXPARSER_H__
00147