libwps: WPS8.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

# WPS8.h

Go to the documentation of this file.

    00001 /* libwpd
    00002  * Copyright (C) 2006, 2007 Andrew Ziem
    00003  * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
    00004  * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
    00005  *
    00006  * This library is free software; you can redistribute it and/or
    00007  * modify it under the terms of the GNU Library General Public
    00008  * License as published by the Free Software Foundation; either
    00009  * version 2 of the License, or (at your option) any later version.
    00010  *
    00011  * This library is distributed in the hope that it will be useful,
    00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
    00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
    00014  * Library General Public License for more details.
    00015  *
    00016  * You should have received a copy of the GNU Library General Public
    00017  * License along with this library; if not, write to the Free Software
    00018  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA
    00019  *
    00020  */
    00021
    00022 #ifndef WPS8_H
    00023 #define WPS8_H
    00024
    00025 #include <vector>
    00026 #include <list>
    00027 #include <map>
    00028 #include <libwpd/WPXString.h>
    00029
    00030 #include "libwps_internal.h"
    00031 #include "WPS.h"
    00032 #include "WPSContentListener.h"
    00033 #include "WPSStream.h"
    00034 #include "WPSParser.h"
    00035
    00041 class HeaderIndexEntries
    00042 {
    00043 public:
    00044         uint32_t offset;
    00045         uint32_t length;
    00046 };
    00047
    00048 typedef std::multimap <std::string, HeaderIndexEntries> HeaderIndexMultiMap; /* string is name */
    00049
    00050 class WPS8ContentListener : public WPSContentListener
    00051 {
    00052 public:
    00053         WPS8ContentListener(std::list<WPSPageSpan> &pageList, WPXHLListenerImpl *listenerImpl);
    00054         ~WPS8ContentListener();
    00055
    00056         void attributeChange(const bool isOn, const uint8_t attribute);
    00057
    00058 private:
    00059         WPS8ContentListener(const WPS8ContentListener&);
    00060         WPS8ContentListener& operator=(const WPS8ContentListener&);
    00061 };
    00062
    00063 class WPS8Parser : public WPSParser
    00064 {
    00065 public:
    00066         WPS8Parser(WPSInputStream *input, WPSHeader * header);
    00067         ~WPS8Parser();
    00068
    00069         void parse(WPXHLListenerImpl *listenerImpl);
    00070 private:
    00071         void readFontsTable(WPSInputStream * input);
    00072         void appendUTF16LE(WPSInputStream *input, WPS8ContentListener *listener);
    00073         void readText(WPSInputStream * input, WPS8ContentListener *listener);
    00074         bool readFODPage(WPSInputStream * input, std::vector<FOD> * FODs, uint16_t page_size);
    00075         void parseHeaderIndexEntry(WPSInputStream * input);
    00076         void parseHeaderIndex(WPSInputStream * input);
    00077         void parsePages(std::list<WPSPageSpan> &pageList, WPSInputStream *input);
    00078         void parse(WPSInputStream *stream, WPS8ContentListener *listener);
    00079         void propertyChangeTextAttribute(const uint32_t newTextAttributeBits, const uint8_t attribute, const uint32_t bit, WPS8ContentListener *listener);
    00080         void propertyChangeDelta(uint32_t newTextAttributeBits, WPS8ContentListener *listener);
    00081         void propertyChange(std::string rgchProp, WPS8ContentListener *listener);
    00082         uint32_t offset_eot; /* stream offset to end of text */
    00083         uint32_t oldTextAttributeBits;
    00084         HeaderIndexMultiMap headerIndexTable;
    00085         std::vector<FOD> CHFODs; /* CHaracter FOrmatting Descriptors */
    00086         std::vector<std::string> fonts;
    00087 };
    00088
    00089
    00090 #endif /* WPS8_H */