This class parses Works version 2 through 4. More...
#include <WPS4.h>
Public Member Functions | |
| WPS4Parser (WPXInputStreamPtr &input, WPSHeaderPtr &header) | |
| constructor | |
| ~WPS4Parser () | |
| destructor | |
| void | parse (WPXDocumentInterface *documentInterface) |
| called by WPSDocument to parse the file | |
Public Member Functions inherited from WPSParser | |
| WPSParser (WPXInputStreamPtr &input, WPSHeaderPtr &header) | |
| virtual | ~WPSParser () |
Protected Types | |
| typedef std::multimap < std::string, WPSEntry > | NameMultiMap |
| a map to retrieve a file entry by name | |
Protected Member Functions | |
| int | version () const |
| version | |
| bool | getColor (int id, uint32_t &color) const |
| color | |
| long | getSizeFile () const |
| returns the file size (or the ole zone size) | |
| void | setSizeFile (long sz) |
| sets the file size ( filled by WPS4Text ) | |
| bool | checkInFile (long pos) |
| return true if the pos is in the file, update the file size if need | |
| void | newPage (int number) |
| adds a new page | |
| void | setListener (shared_ptr< WPS4ContentListener > listener) |
| set the listener | |
| bool | createStructures () |
| tries to parse the main zone, ... | |
| bool | createOLEStructures () |
| tries to parse the different OLE zones ( except the main zone ) | |
| shared_ptr< WPS4ContentListener > | createListener (WPXDocumentInterface *interface) |
| creates the main listener | |
| float | pageHeight () const |
| returns the page height, ie. paper size less margin (in inches) | |
| float | pageWidth () const |
| returns the page width, ie. paper size less margin (in inches) | |
| int | numColumns () const |
| returns the number of columns | |
| void | createDocument (WPSEntry const &entry, libwps::SubDocumentType type) |
| creates a document for a comment entry and then send the data | |
| void | createNote (WPSEntry const &entry, WPXString const &label) |
| creates a document for a footnote entry with label and then send the data | |
| void | createTextBox (WPSEntry const &entry, WPSPosition const &pos, WPXPropertyList &extras) |
| creates a textbox and then send the data | |
| void | send (WPSEntry const &entry, libwps::SubDocumentType type) |
| sends text corresponding to the entry to the listener (via WPS4MNText) | |
| int | readObject (WPXInputStreamPtr input, WPSEntry const &entry) |
| tries to read a picture ( via its WPS4Graph ) | |
| void | sendObject (Vec2f const &size, int id) |
| sends an object with given id ( via its WPS4Graph ) | |
| bool | findZones () |
| finds the different zones (text, print, ...) and updates nameMultiMap | |
| bool | parseEntry (std::string const &name) |
| parses an entry | |
| bool | readDocDim () |
| tries to read the document dimension | |
| bool | readPrnt (WPSEntry const &entry) |
| tries to read the printer information | |
| bool | readDocWindowsInfo (WPSEntry const &entry) |
| reads the additional windows info | |
| libwps::DebugFile & | ascii () |
| a DebugFile used to write what we recognize when we parse the document | |
Protected Member Functions inherited from WPSParser | |
| WPSHeaderPtr & | getHeader () |
| WPXInputStreamPtr & | getInput () |
Protected Attributes | |
| shared_ptr< WPS4ContentListener > | m_listener |
| shared_ptr< WPS4Graph > | m_graphParser |
| the graph parser | |
| shared_ptr< WPS4Text > | m_textParser |
| the text parser | |
| shared_ptr < WPS4ParserInternal::State > | m_state |
| the internal state | |
| NameMultiMap | m_nameMultiMap |
| a map to retrieve a file entry by name | |
| libwps::DebugFile | m_asciiFile |
| the debug file | |
Friends | |
| class | WPS4ParserInternal::SubDocument |
| class | WPS4Graph |
| class | WPS4Text |
This class parses Works version 2 through 4.
|
protected |
a map to retrieve a file entry by name
| WPS4Parser::WPS4Parser | ( | WPXInputStreamPtr & | input, |
| WPSHeaderPtr & | header | ||
| ) |
constructor
| WPS4Parser::~WPS4Parser | ( | ) |
destructor
|
inlineprotected |
a DebugFile used to write what we recognize when we parse the document
Referenced by findZones(), parse(), parseEntry(), readDocDim(), readDocWindowsInfo(), and readPrnt().
|
protected |
return true if the pos is in the file, update the file size if need
Referenced by parseEntry().
|
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 file size (or the ole zone size)
Referenced by WPS4Text::objectDataParser().
|
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)
Referenced by WPS4Text::readText().
|
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().
|
protected |
tries to read the printer information
Referenced by createStructures().
|
protected |
sends text corresponding to the entry to the listener (via WPS4MNText)
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 size
Referenced by WPS4Text::readText().
|
protected |
set the listener
Referenced by parse().
|
protected |
sets the file size ( filled by WPS4Text )
Referenced by WPS4Text::readEntries().
|
protected |
version
Referenced by findZones(), WPS4Graph::version(), and WPS4Text::version().
|
friend |
Referenced by WPS4Parser().
|
friend |
|
friend |
Referenced by WPS4Parser().
|
protected |
|
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(), and setListener().
|
protected |
a map to retrieve a file entry by name
Referenced by createStructures(), WPS4Text::findFDPStructures(), WPS4Text::getFooterEntry(), WPS4Text::getHeaderEntry(), parseEntry(), WPS4Text::readEntries(), and WPS4Text::readStructures().
|
protected |
the internal state
Referenced by checkInFile(), createListener(), findZones(), getColor(), getSizeFile(), newPage(), numColumns(), pageHeight(), pageWidth(), readDocDim(), setSizeFile(), version(), and WPS4Parser().
|
protected |
the text parser
Referenced by createListener(), createStructures(), findZones(), parse(), send(), setListener(), and WPS4Parser().