WNParser Class Reference

the main class to read a WriteNow file More...

#include <WNParser.hxx>

Inheritance diagram for WNParser:
MWAWParser

Public Member Functions

 WNParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor More...
 
virtual ~WNParser ()
 destructor More...
 
bool checkHeader (MWAWHeader *header, bool strict=false)
 checks if the document header is correct (or not) More...
 
void parse (WPXDocumentInterface *documentInterface)
 virtual function used to parse the input More...
 
- Public Member Functions inherited from MWAWParser
virtual ~MWAWParser ()
 virtual destructor More...
 
int version () const
 returns the works version More...
 
void setVersion (int vers)
 sets the works version More...
 

Protected Member Functions

void init ()
 inits all internal variables More...
 
void createDocument (WPXDocumentInterface *documentInterface)
 creates the listener which will be associated to the document More...
 
bool createZones ()
 finds the different objects zones More...
 
void getColumnInfo (int &numColumns, int &width) const
 returns the columns information More...
 
void newPage (int number)
 adds a new page More...
 
bool getColor (int colId, MWAWColor &col) const
 returns the color which corresponds to colId More...
 
void sendFootnote (WNEntry const &entry)
 try to send a footnote entry More...
 
bool sendGraphic (int gId, Box2i const &bdbox)
 try to send the graphic zone More...
 
void send (WNEntry const &entry)
 try to send an entry More...
 
bool readDocEntries ()
 try to read the document entries zone v3-v4 More...
 
bool readDocEntriesV2 ()
 try to read the document entries zone v2 More...
 
bool parseGraphicZone (WNEntry const &entry)
 try to read the graphic zone (unknown + list of entries ) and to create the graphic data zone More...
 
bool readColorMap (WNEntry const &entry)
 try to read the colormap zone More...
 
bool readPrintInfo (WNEntry const &entry)
 try to read the print info zone More...
 
bool readGenericUnkn (WNEntry const &entry)
 try to read the last generic zones More...
 
bool sendPicture (WNEntry const &entry, Box2i const &bdbox)
 try to send a picture to the listener More...
 
WNEntry readEntry ()
 read a file entry More...
 
bool checkIfPositionValid (long pos)
 check if a position is inside the file More...
 
- Protected Member Functions inherited from MWAWParser
 MWAWParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor (protected) More...
 
 MWAWParser (MWAWParserStatePtr state)
 constructor using a state More...
 
MWAWParserStatePtr getParserState ()
 returns the parser state More...
 
MWAWHeadergetHeader ()
 returns the header More...
 
MWAWInputStreamPtrgetInput ()
 returns the actual input More...
 
MWAWGraphicListenerPtrgetGraphicListener ()
 returns the graphic listener More...
 
MWAWContentListenerPtrgetListener ()
 returns the listener More...
 
MWAWPageSpan const & getPageSpan () const
 returns the actual page dimension More...
 
MWAWPageSpangetPageSpan ()
 returns the actual page dimension More...
 
double getFormLength () const
 returns the form length More...
 
double getFormWidth () const
 returns the form width More...
 
double getPageLength () const
 returns the page length (form length without margin ) More...
 
double getPageWidth () const
 returns the page width (form width without margin ) More...
 
MWAWRSRCParserPtrgetRSRCParser ()
 returns the rsrc parser More...
 
void setListener (MWAWContentListenerPtr &listener)
 sets the listener More...
 
void resetListener ()
 resets the listener More...
 
MWAWFontConverterPtrgetFontConverter ()
 returns the font converter More...
 
void setFontConverter (MWAWFontConverterPtr fontConverter)
 sets the font convertor More...
 
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document More...
 
void setAsciiName (char const *name)
 Debugging: change the default ascii file. More...
 
std::string const & asciiName () const
 return the ascii file name More...
 

Protected Attributes

shared_ptr
< WNParserInternal::State
m_state
 the state More...
 
shared_ptr< WNEntryManagerm_entryManager
 the list of entry More...
 
shared_ptr< WNTextm_textParser
 the text parser More...
 

Friends

class WNText
 
class WNParserInternal::SubDocument
 

Detailed Description

the main class to read a WriteNow file

Constructor & Destructor Documentation

WNParser::WNParser ( MWAWInputStreamPtr  input,
MWAWRSRCParserPtr  rsrcParser,
MWAWHeader header 
)

constructor

WNParser::~WNParser ( )
virtual

destructor

Member Function Documentation

bool WNParser::checkHeader ( MWAWHeader header,
bool  strict = false 
)
virtual

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

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().

Friends And Related Function Documentation

friend class WNParserInternal::SubDocument
friend
friend class WNText
friend

Referenced by init().

Member Data Documentation

shared_ptr<WNEntryManager> WNParser::m_entryManager
protected
shared_ptr<WNText> WNParser::m_textParser
protected

the text parser

Referenced by createDocument(), createZones(), init(), parse(), and send().


The documentation for this class was generated from the following files:

Generated on Tue Mar 10 2015 17:32:10 for libmwaw by doxygen 1.8.5