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
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
- Public Member Functions inherited from MWAWParser
virtual ~MWAWParser ()
 virtual destructor
int version () const
 returns the works version
void setVersion (int vers)
 sets the works version

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 Member Functions inherited from MWAWParser
 MWAWParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor (protected)
 MWAWParser (MWAWParserStatePtr state)
 constructor using a state
MWAWParserStatePtr getParserState ()
 returns the parser state
MWAWHeadergetHeader ()
 returns the header
MWAWInputStreamPtrgetInput ()
 returns the actual input
MWAWContentListenerPtrgetListener ()
 returns the listener
MWAWPageSpan const & getPageSpan () const
 returns the actual page dimension
MWAWPageSpangetPageSpan ()
 returns the actual page dimension
double getFormLength () const
 returns the form length
double getFormWidth () const
 returns the form width
double getPageLength () const
 returns the page length (form length without margin )
double getPageWidth () const
 returns the page width (form width without margin )
MWAWRSRCParserPtrgetRSRCParser ()
 returns the rsrc parser
void setListener (MWAWContentListenerPtr &listener)
 sets the listener
void resetListener ()
 resets the listener
MWAWFontConverterPtrgetFontConverter ()
 returns the font converter
void setFontConverter (MWAWFontConverterPtr fontConverter)
 sets the font convertor
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document
void setAsciiName (char const *name)
 Debugging: change the default ascii file.
std::string const & asciiName () const
 return the ascii file name

Protected Attributes

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

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 Wed May 22 2013 18:12:46 for libmwaw by doxygen 1.8.1.2