This class parses Works version 2 through 4. More...
#include <WPS4.h>
 
  
 | Public Member Functions | |
| WPS4Parser (RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN) | |
| constructor  More... | |
| ~WPS4Parser () | |
| destructor  More... | |
| void | parse (librevenge::RVNGTextInterface *documentInterface) | 
| called by WPSDocument to parse the file  More... | |
| bool | checkHeader (WPSHeader *header, bool strict=false) | 
| checks if the document header is correct (or not)  More... | |
|  Public Member Functions inherited from WPSParser | |
| WPSParser (RVNGInputStreamPtr &input, WPSHeaderPtr &header) | |
| virtual | ~WPSParser () | 
| Protected Member Functions | |
| bool | getColor (int id, WPSColor &color) const | 
| color  More... | |
| void | setSizeFile (long sz) | 
| sets the file size ( filled by WPS4Text )  More... | |
| bool | checkFilePosition (long pos) | 
| return true if the pos is in the file, update the file size if need  More... | |
| void | newPage (int number) | 
| adds a new page  More... | |
| void | setListener (shared_ptr< WPSContentListener > listener) | 
| set the listener  More... | |
| bool | createStructures () | 
| tries to parse the main zone, ...  More... | |
| bool | createOLEStructures () | 
| tries to parse the different OLE zones ( except the main zone )  More... | |
| shared_ptr< WPSContentListener > | createListener (librevenge::RVNGTextInterface *interface) | 
| creates the main listener  More... | |
| float | pageHeight () const | 
| returns the page height, ie. paper size less margin (in inches)  More... | |
| float | pageWidth () const | 
| returns the page width, ie. paper size less margin (in inches)  More... | |
| int | numColumns () const | 
| returns the number of columns  More... | |
| libwps_tools_win::Font::Type | getDefaultFontType () const | 
| returns the default font type, ie.  More... | |
| libwps_tools_win::Font::Type | getOEMFontType () const | 
| returns the document codepage ( given from the file OEM field )  More... | |
| void | createDocument (WPSEntry const &entry, libwps::SubDocumentType type) | 
| creates a document for a comment entry and then send the data  More... | |
| void | createNote (WPSEntry const &entry, librevenge::RVNGString const &label) | 
| creates a document for a footnote entry with label and then send the data  More... | |
| void | createTextBox (WPSEntry const &entry, WPSPosition const &pos, librevenge::RVNGPropertyList &extras) | 
| creates a textbox and then send the data  More... | |
| void | send (WPSEntry const &entry, libwps::SubDocumentType type) | 
| sends text corresponding to the entry to the listener (via WPS4Text)  More... | |
| int | readObject (RVNGInputStreamPtr input, WPSEntry const &entry) | 
| tries to read a picture ( via its WPS4Graph )  More... | |
| void | sendObject (WPSPosition const &position, int id) | 
| sends an object with given id ( via its WPS4Graph )  More... | |
| bool | findZones () | 
| finds the different zones (text, print, ...) and updates nameMultiMap  More... | |
| bool | parseEntry (std::string const &name) | 
| parses an entry  More... | |
| bool | readDocDim () | 
| tries to read the document dimension  More... | |
| bool | readPrnt (WPSEntry const &entry) | 
| tries to read the printer information  More... | |
| bool | readDocWindowsInfo (WPSEntry const &entry) | 
| reads the additional windows info  More... | |
|  Protected Member Functions inherited from WPSParser | |
| RVNGInputStreamPtr & | getInput () | 
| RVNGInputStreamPtr | getFileInput () | 
| WPSHeaderPtr & | getHeader () | 
| int | version () const | 
| void | setVersion (int vers) | 
| libwps::DebugFile & | ascii () | 
| a DebugFile used to write what we recognize when we parse the document  More... | |
| NameMultiMap & | getNameEntryMap () | 
| NameMultiMap const & | getNameEntryMap () const | 
| Protected Attributes | |
| shared_ptr< WPSContentListener > | m_listener | 
| shared_ptr< WPS4Graph > | m_graphParser | 
| the graph parser  More... | |
| shared_ptr< WPS4Text > | m_textParser | 
| the text parser  More... | |
| shared_ptr< WPS4ParserInternal::State > | m_state | 
| the internal state  More... | |
| Friends | |
| class | WPS4ParserInternal::SubDocument | 
| class | WPS4Graph | 
| class | WPS4Text | 
| Additional Inherited Members | |
|  Public Types inherited from WPSParser | |
| typedef std::multimap< std::string, WPSEntry > | NameMultiMap | 
| a map to retrieve a file entry by name  More... | |
This class parses Works version 2 through 4.
| WPS4Parser::WPS4Parser | ( | RVNGInputStreamPtr & | input, | 
| WPSHeaderPtr & | header, | ||
| libwps_tools_win::Font::Type | encoding = libwps_tools_win::Font::UNKNOWN | ||
| ) | 
constructor
| WPS4Parser::~WPS4Parser | ( | ) | 
destructor
| 
 | protected | 
return true if the pos is in the file, update the file size if need
Referenced by checkHeader(), findZones(), and parseEntry().
| bool WPS4Parser::checkHeader | ( | WPSHeader * | header, | 
| bool | strict = false | ||
| ) | 
checks if the document header is correct (or not)
Referenced by parse().
| 
 | protected | 
creates a document for a comment entry and then send the data
Referenced by WPS4Text::readText().
| 
 | protected | 
creates the main listener
Referenced by parse().
| 
 | protected | 
creates a document for a footnote entry with label and then send the data
Referenced by WPS4Text::readText().
| 
 | protected | 
tries to parse the different OLE zones ( except the main zone )
Referenced by parse().
| 
 | protected | 
tries to parse the main zone, ...
Referenced by parse().
| 
 | protected | 
creates a textbox and then send the data
Referenced by WPS4Text::readText().
| 
 | protected | 
finds the different zones (text, print, ...) and updates nameMultiMap
Referenced by createStructures().
| 
 | protected | 
color
Referenced by readDocWindowsInfo(), WPS4Text::readFont(), and WPS4Text::readParagraph().
| 
 | protected | 
returns the default font type, ie.
the encoding given by the constructor if given or the encoding deduiced from the version.
Referenced by WPS4Text::footNotesDataParser(), WPS4Text::readFont(), and WPS4Text::readFontNames().
| 
 | protected | 
returns the document codepage ( given from the file OEM field )
| 
 | protected | 
adds a new page
Referenced by WPS4Text::readText().
| 
 | protected | 
returns the number of columns
Referenced by WPS4Text::readText().
| 
 | protected | 
returns the page height, ie. paper size less margin (in inches)
| 
 | protected | 
returns the page width, ie. paper size less margin (in inches)
| 
 | virtual | 
called by WPSDocument to parse the file
Implements WPSParser.
| 
 | protected | 
parses an entry
reads a zone offset and a zone size and checks if this entry is valid
Referenced by findZones(), and WPS4Text::readEntries().
| 
 | protected | 
tries to read the document dimension
Referenced by findZones().
| 
 | protected | 
reads the additional windows info
Referenced by createStructures().
| 
 | protected | 
tries to read a picture ( via its WPS4Graph )
Referenced by WPS4Text::objectDataParser(), and WPS4Graph::setListener().
| 
 | protected | 
tries to read the printer information
Referenced by createStructures().
| 
 | protected | 
sends text corresponding to the entry to the listener (via WPS4Text)
Referenced by WPS4ParserInternal::SubDocument::parse().
| 
 | protected | 
sends an object with given id ( via its WPS4Graph )
The object is sent as a character with given size position
Referenced by WPS4Text::readText(), WPS4Text::sendObjects(), and WPS4Graph::setListener().
| 
 | protected | 
set the listener
Referenced by parse().
| 
 | protected | 
sets the file size ( filled by WPS4Text )
Referenced by WPS4Text::readEntries().
| 
 | friend | 
Referenced by WPS4Graph::ascii(), and WPS4Parser().
| 
 | friend | 
| 
 | friend | 
Referenced by WPS4Parser().
| 
 | protected | 
the graph parser
Referenced by createListener(), createOLEStructures(), createStructures(), newPage(), parse(), readObject(), sendObject(), setListener(), and WPS4Parser().
| 
 | protected | 
Referenced by createDocument(), createNote(), createTextBox(), newPage(), parse(), send(), WPS4Graph::setListener(), setListener(), and WPS4Text::setListener().
| 
 | protected | 
the internal state
Referenced by checkFilePosition(), createListener(), findZones(), getColor(), getDefaultFontType(), getOEMFontType(), newPage(), numColumns(), pageHeight(), pageWidth(), readDocDim(), setSizeFile(), and WPS4Parser().
| 
 | protected | 
the text parser
Referenced by createListener(), createStructures(), findZones(), parse(), send(), setListener(), and WPS4Parser().