FWParser Class Reference

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

#include <FWParser.hxx>

Inheritance diagram for FWParser:
MWAWParser

Public Member Functions

 FWParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor
virtual ~FWParser ()
 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
bool createFileZones ()
 create the file zone ( first step of create zones)
void flushExtra ()
 sends the data which have not yet been sent to the listener
void newPage (int number)
 adds a new page
bool readDocPosition ()
 find the last position of the document and read data
bool readFileZoneFlags (shared_ptr< FWEntry > zone)
 try to read the file zones main flags
bool readFileZonePos (shared_ptr< FWEntry > zone)
 try to read the file zones position
bool readDocZoneData (shared_ptr< FWEntry > zone)
 try to read the zone containing the data of each doc zone (ie. Zone0)
bool readDocZoneStruct (shared_ptr< FWEntry > zone)
 try to read the zone which stores the structure of zone0, ... (ie. Zone1)
int getNumDocZoneStruct () const
 returns the number of zone struct
bool readGraphic (shared_ptr< FWEntry > zone)
 check if a zone is a graphic zone, ...
bool sendGraphic (shared_ptr< FWEntry > zone)
 send a graphic to a listener (if it exists)
bool readDocInfo (shared_ptr< FWEntry > zone)
 try to read zone2, a zone which stores the document information zone, ...
bool readEndDocInfo (shared_ptr< FWEntry > zone)
 try to read the end of zone2 (only v2) ?
bool readCitationDocInfo (shared_ptr< FWEntry > zone)
 try to read the list of citation (at the end of doc info)
bool readPrintInfo (shared_ptr< FWEntry > zone)
 try read the print info zone
void sendText (int docId, libmwaw::SubDocumentType type, MWAWNote::Type which=MWAWNote::FootNote)
 try to send a footnote/endnote entry
void sendGraphic (int docId)
 try to send a graphic
void sendVariable (int docId)
 try to send a variable, in pratice do nothing
void sendReference (int docId)
 try to send a reference, in pratice do nothing
bool send (int fileId)
 ask the text parser to send a zone
bool readDoc1314Data (shared_ptr< FWEntry > zone, FWParserInternal::DocZoneData &doc)
 try to read the data of zone 13 or 14 (unknown zone)
bool readGraphicData (shared_ptr< FWEntry > zone, FWParserInternal::DocZoneData &doc)
 try to read the graphic data
bool readReferenceData (shared_ptr< FWEntry > zone)
 try to read the reference data
bool readDocDataHeader (shared_ptr< FWEntry > zone, FWParserInternal::DocZoneData &doc)
 try to read the data header of a classical zone
bool readGenericDocData (shared_ptr< FWEntry > zone, FWParserInternal::DocZoneData &doc)
 try to read the data of a zone which begins with a generic header
- 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
< FWParserInternal::State
m_state
 the state
shared_ptr< FWTextm_textParser
 the text parser

Friends

class FWText
class FWParserInternal::SubDocument

Detailed Description

the main class to read a FullWrite file

Constructor & Destructor Documentation

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

constructor

FWParser::~FWParser ( )
virtual

destructor

Member Function Documentation

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

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

void FWParser::createDocument ( WPXDocumentInterface *  documentInterface)
protected

creates the listener which will be associated to the document

Referenced by parse().

bool FWParser::createFileZones ( )
protected

create the file zone ( first step of create zones)

Referenced by createZones().

bool FWParser::createZones ( )
protected

finds the different objects zones

Referenced by parse().

void FWParser::flushExtra ( )
protected

sends the data which have not yet been sent to the listener

Referenced by parse().

int FWParser::getNumDocZoneStruct ( ) const
protected

returns the number of zone struct

Referenced by FWText::readItem().

void FWParser::init ( )
protected

inits all internal variables

Referenced by FWParser().

void FWParser::newPage ( int  number)
protected

adds a new page

Referenced by FWText::send(), and FWText::sendMainText().

void FWParser::parse ( WPXDocumentInterface *  documentInterface)
virtual

virtual function used to parse the input

Implements MWAWParser.

bool FWParser::readCitationDocInfo ( shared_ptr< FWEntry zone)
protected

try to read the list of citation (at the end of doc info)

Referenced by readEndDocInfo().

bool FWParser::readDoc1314Data ( shared_ptr< FWEntry zone,
FWParserInternal::DocZoneData doc 
)
protected

try to read the data of zone 13 or 14 (unknown zone)

Referenced by readDocZoneData().

bool FWParser::readDocDataHeader ( shared_ptr< FWEntry zone,
FWParserInternal::DocZoneData doc 
)
protected

try to read the data header of a classical zone

Referenced by readDoc1314Data(), readDocZoneData(), readGenericDocData(), and readGraphicData().

bool FWParser::readDocInfo ( shared_ptr< FWEntry zone)
protected

try to read zone2, a zone which stores the document information zone, ...

Referenced by createZones().

bool FWParser::readDocPosition ( )
protected

find the last position of the document and read data

Referenced by checkHeader().

bool FWParser::readDocZoneData ( shared_ptr< FWEntry zone)
protected

try to read the zone containing the data of each doc zone (ie. Zone0)

Referenced by createZones().

bool FWParser::readDocZoneStruct ( shared_ptr< FWEntry zone)
protected

try to read the zone which stores the structure of zone0, ... (ie. Zone1)

Referenced by createZones().

bool FWParser::readEndDocInfo ( shared_ptr< FWEntry zone)
protected

try to read the end of zone2 (only v2) ?

Referenced by readDocInfo().

bool FWParser::readFileZoneFlags ( shared_ptr< FWEntry zone)
protected

try to read the file zones main flags

-1: generic, -2: null, other fId

Referenced by createFileZones().

bool FWParser::readFileZonePos ( shared_ptr< FWEntry zone)
protected

try to read the file zones position

Referenced by createFileZones().

bool FWParser::readGenericDocData ( shared_ptr< FWEntry zone,
FWParserInternal::DocZoneData doc 
)
protected

try to read the data of a zone which begins with a generic header

Referenced by readDocZoneData().

bool FWParser::readGraphic ( shared_ptr< FWEntry zone)
protected

check if a zone is a graphic zone, ...

Referenced by createZones().

bool FWParser::readGraphicData ( shared_ptr< FWEntry zone,
FWParserInternal::DocZoneData doc 
)
protected

try to read the graphic data

Referenced by readDocZoneData().

bool FWParser::readPrintInfo ( shared_ptr< FWEntry zone)
protected

try read the print info zone

Referenced by readDocInfo().

bool FWParser::readReferenceData ( shared_ptr< FWEntry zone)
protected

try to read the reference data

Referenced by readDocZoneData().

bool FWParser::send ( int  fileId)
protected

ask the text parser to send a zone

bool FWParser::sendGraphic ( shared_ptr< FWEntry zone)
protected

send a graphic to a listener (if it exists)

Referenced by flushExtra(), FWText::send(), sendGraphic(), and sendVariable().

void FWParser::sendGraphic ( int  docId)
protected

try to send a graphic

void FWParser::sendReference ( int  docId)
protected

try to send a reference, in pratice do nothing

Referenced by FWText::send().

void FWParser::sendText ( int  docId,
libmwaw::SubDocumentType  type,
MWAWNote::Type  which = MWAWNote::FootNote 
)
protected

try to send a footnote/endnote entry

Referenced by FWText::send().

void FWParser::sendVariable ( int  docId)
protected

try to send a variable, in pratice do nothing

in this case, the content seems to be a textbox which contains the field display, but as in general this zone is not read correctly (ie. the field is not found ) and as sending textbox is not implemented, better to stop here...

Referenced by FWText::send().

Friends And Related Function Documentation

friend class FWParserInternal::SubDocument
friend
friend class FWText
friend

Referenced by init().

Member Data Documentation

shared_ptr<FWText> FWParser::m_textParser
protected

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

Generated on Wed May 22 2013 18:12:39 for libmwaw by doxygen 1.8.1.2