the main class to read a WriteNow file More...
#include <WNParser.hxx>
Public Member Functions | |
WNParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header) | |
constructor | |
virtual | ~WNParser () |
destructor | |
bool | checkHeader (MWAWHeader *header, bool strict=false) |
checks if the document header is correct (or not) | |
void | parse (WPXDocumentInterface *documentInterface) |
virtual function used to parse the input | |
Protected Member Functions | |
void | init () |
inits all internal variables | |
void | createDocument (WPXDocumentInterface *documentInterface) |
creates the listener which will be associated to the document | |
bool | createZones () |
finds the different objects zones | |
void | getColumnInfo (int &numColumns, int &width) const |
returns the columns information | |
void | newPage (int number) |
adds a new page | |
bool | getColor (int colId, MWAWColor &col) const |
returns the color which corresponds to colId | |
void | sendFootnote (WNEntry const &entry) |
try to send a footnote entry | |
bool | sendGraphic (int gId, Box2i const &bdbox) |
try to send the graphic zone | |
void | send (WNEntry const &entry) |
try to send an entry | |
bool | readDocEntries () |
try to read the document entries zone v3-v4 | |
bool | readDocEntriesV2 () |
try to read the document entries zone v2 | |
bool | parseGraphicZone (WNEntry const &entry) |
try to read the graphic zone (unknown + list of entries ) and to create the graphic data zone | |
bool | readColorMap (WNEntry const &entry) |
try to read the colormap zone | |
bool | readPrintInfo (WNEntry const &entry) |
try to read the print info zone | |
bool | readGenericUnkn (WNEntry const &entry) |
try to read the last generic zones | |
bool | sendPicture (WNEntry const &entry, Box2i const &bdbox) |
try to send a picture to the listener | |
WNEntry | readEntry () |
read a file entry | |
bool | checkIfPositionValid (long pos) |
check if a position is inside the file | |
Protected Attributes | |
shared_ptr < WNParserInternal::State > | m_state |
the state | |
shared_ptr< WNEntryManager > | m_entryManager |
the list of entry | |
shared_ptr< WNText > | m_textParser |
the text parser | |
Friends | |
class | WNText |
class | WNParserInternal::SubDocument |
the main class to read a WriteNow file
WNParser::WNParser | ( | MWAWInputStreamPtr | input, |
MWAWRSRCParserPtr | rsrcParser, | ||
MWAWHeader * | header | ||
) |
constructor
WNParser::~WNParser | ( | ) | [virtual] |
destructor
bool WNParser::checkHeader | ( | MWAWHeader * | header, |
bool | strict = false |
||
) | [virtual] |
bool WNParser::checkIfPositionValid | ( | long | pos | ) | [protected] |
check if a position is inside the file
Referenced by checkHeader(), WNText::parseZone(), readDocEntriesV2(), and readEntry().
void WNParser::createDocument | ( | WPXDocumentInterface * | documentInterface | ) | [protected] |
creates the listener which will be associated to the document
Referenced by parse().
bool WNParser::createZones | ( | ) | [protected] |
finds the different objects zones
Referenced by parse().
bool WNParser::getColor | ( | int | colId, |
MWAWColor & | col | ||
) | const [protected] |
returns the color which corresponds to colId
Referenced by WNText::readFont(), and WNText::readTable().
void WNParser::getColumnInfo | ( | int & | numColumns, |
int & | width | ||
) | const [protected] |
returns the columns information
Referenced by WNText::createZones(), WNText::numPages(), and WNText::sendZone().
void WNParser::init | ( | ) | [protected] |
inits all internal variables
Referenced by WNParser().
void WNParser::newPage | ( | int | number | ) | [protected] |
adds a new page
Referenced by WNText::send().
void WNParser::parse | ( | WPXDocumentInterface * | documentInterface | ) | [virtual] |
virtual function used to parse the input
Implements MWAWParser.
bool WNParser::parseGraphicZone | ( | WNEntry const & | entry | ) | [protected] |
try to read the graphic zone (unknown + list of entries ) and to create the graphic data zone
Referenced by createZones().
bool WNParser::readColorMap | ( | WNEntry const & | entry | ) | [protected] |
try to read the colormap zone
Referenced by createZones().
bool WNParser::readDocEntries | ( | ) | [protected] |
try to read the document entries zone v3-v4
Referenced by createZones().
bool WNParser::readDocEntriesV2 | ( | ) | [protected] |
try to read the document entries zone v2
Referenced by createZones().
WNEntry WNParser::readEntry | ( | ) | [protected] |
read a file entry
Referenced by parseGraphicZone(), and readDocEntries().
bool WNParser::readGenericUnkn | ( | WNEntry const & | entry | ) | [protected] |
try to read the last generic zones
Referenced by createZones().
bool WNParser::readPrintInfo | ( | WNEntry const & | entry | ) | [protected] |
try to read the print info zone
Referenced by createZones().
void WNParser::send | ( | WNEntry const & | entry | ) | [protected] |
try to send an entry
void WNParser::sendFootnote | ( | WNEntry const & | entry | ) | [protected] |
try to send a footnote entry
Referenced by WNText::send().
bool WNParser::sendGraphic | ( | int | gId, |
Box2i const & | bdbox | ||
) | [protected] |
try to send the graphic zone
Referenced by WNText::send().
bool WNParser::sendPicture | ( | WNEntry const & | entry, |
Box2i const & | bdbox | ||
) | [protected] |
try to send a picture to the listener
Referenced by parse(), and sendGraphic().
friend class WNParserInternal::SubDocument [friend] |
shared_ptr<WNEntryManager> WNParser::m_entryManager [protected] |
the list of entry
Referenced by checkHeader(), createZones(), init(), parse(), parseGraphicZone(), readDocEntries(), and readDocEntriesV2().
shared_ptr<WNParserInternal::State> WNParser::m_state [protected] |
the state
Referenced by checkHeader(), checkIfPositionValid(), createDocument(), getColor(), getColumnInfo(), init(), newPage(), parse(), parseGraphicZone(), readColorMap(), readDocEntries(), readDocEntriesV2(), and sendGraphic().
shared_ptr<WNText> WNParser::m_textParser [protected] |
the text parser
Referenced by createDocument(), createZones(), init(), parse(), and send().