MSWParser Class Reference

the main class to read a Microsoft Word file More...

#include <MSWParser.hxx>

Inheritance diagram for MSWParser:
MWAWParser

Public Member Functions

 MSWParser (MWAWInputStreamPtr input, MWAWRSRCParserPtr rsrcParser, MWAWHeader *header)
 constructor
virtual ~MSWParser ()
 destructor
bool checkHeader (MWAWHeader *header, bool strict=false)
 checks if the document header is correct (or not)
void parse (WPXDocumentInterface *documentInterface)
 the main parse function
- 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 zones
bool readHeaderEndV3 ()
 finish reading the header (v3)
bool readZoneList ()
 read the list of zones
bool readPrintInfo (MSWEntry &entry)
 read the print info zone
bool readPrinter (MSWEntry &entry)
 read the printer name
bool readDocSum (MSWEntry &entry)
 read the document sumary
bool readStringsZone (MSWEntry &entry, std::vector< std::string > &list)
 read a zone which consists in a list of string
bool readObjects ()
 read the objects
bool readObjectList (MSWEntry &entry)
 read the object list
bool readObjectFlags (MSWEntry &entry)
 read the object flags
bool readObject (MSWParserInternal::Object &obj)
 read an object
bool readDocumentInfo (MSWEntry &entry)
 read the page dimensions + ?
bool readZone17 (MSWEntry &entry)
 read the zone 17( some bdbox + text position ?)
bool checkPicturePos (long pos, int type)
 check if a position corresponds or not to a picture entry
bool readPicture (MSWEntry &entry)
 read a picture data
void sendPicture (long fPos, int cPos, MWAWPosition::AnchorTo anchor=MWAWPosition::Char)
 send a picture
bool getColor (int id, MWAWColor &col) const
 returns the color corresponding to an id
void newPage (int number)
 adds a new page
void sendFootnote (int id)
 try to send a footnote id
void sendFieldComment (int id)
 try to send a bookmark field id
void send (int id, libmwaw::SubDocumentType type)
 try to send a footnote, a field to the textParser
void send (MWAWEntry const &entry)
 try to send a text to the textParser
bool isFilePos (long pos)
 check if an entry is in file
MSWEntry readEntry (std::string type, int id=-1)
 read a file entry
- 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
< MSWParserInternal::State
m_state
 the state
std::multimap< std::string,
MSWEntry
m_entryMap
 the list of entries
shared_ptr< MSWTextm_textParser
 the text parser

Friends

class MSWText
class MSWTextStyles
class MSWParserInternal::SubDocument

Detailed Description

the main class to read a Microsoft Word file

Constructor & Destructor Documentation

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

constructor

MSWParser::~MSWParser ( )
virtual

destructor

Member Function Documentation

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

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

bool MSWParser::checkPicturePos ( long  pos,
int  type 
)
protected

check if a position corresponds or not to a picture entry

Referenced by MSWTextStyles::readFont().

void MSWParser::createDocument ( WPXDocumentInterface *  documentInterface)
protected

creates the listener which will be associated to the document

Referenced by parse().

bool MSWParser::createZones ( )
protected

finds the different zones

Referenced by parse().

bool MSWParser::getColor ( int  id,
MWAWColor col 
) const
protected

returns the color corresponding to an id

Referenced by MSWTextStyles::readFont().

void MSWParser::init ( )
protected

inits all internal variables

Referenced by MSWParser().

void MSWParser::newPage ( int  number)
protected

adds a new page

Referenced by MSWText::sendText().

void MSWParser::parse ( WPXDocumentInterface *  documentInterface)
virtual

the main parse function

Implements MWAWParser.

bool MSWParser::readDocSum ( MSWEntry entry)
protected

read the document sumary

Referenced by createZones().

bool MSWParser::readDocumentInfo ( MSWEntry entry)
protected

read the page dimensions + ?

Referenced by createZones().

MSWEntry MSWParser::readEntry ( std::string  type,
int  id = -1 
)
protected

read a file entry

Referenced by readZoneList().

bool MSWParser::readHeaderEndV3 ( )
protected

finish reading the header (v3)

Referenced by checkHeader().

bool MSWParser::readObject ( MSWParserInternal::Object obj)
protected

read an object

Referenced by readObjects().

bool MSWParser::readObjectFlags ( MSWEntry entry)
protected

read the object flags

Referenced by readObjects().

bool MSWParser::readObjectList ( MSWEntry entry)
protected

read the object list

Referenced by readObjects().

bool MSWParser::readObjects ( )
protected

read the objects

Referenced by createZones().

bool MSWParser::readPicture ( MSWEntry entry)
protected

read a picture data

Referenced by createZones().

bool MSWParser::readPrinter ( MSWEntry entry)
protected

read the printer name

Referenced by createZones().

bool MSWParser::readPrintInfo ( MSWEntry entry)
protected

read the print info zone

Referenced by createZones().

bool MSWParser::readStringsZone ( MSWEntry entry,
std::vector< std::string > &  list 
)
protected

read a zone which consists in a list of string

Referenced by readObjects().

bool MSWParser::readZone17 ( MSWEntry entry)
protected

read the zone 17( some bdbox + text position ?)

Referenced by createZones().

bool MSWParser::readZoneList ( )
protected

read the list of zones

Referenced by createZones().

void MSWParser::send ( int  id,
libmwaw::SubDocumentType  type 
)
protected

try to send a footnote, a field to the textParser

void MSWParser::send ( MWAWEntry const &  entry)
protected

try to send a text to the textParser

void MSWParser::sendFieldComment ( int  id)
protected

try to send a bookmark field id

Referenced by MSWText::sendText().

void MSWParser::sendFootnote ( int  id)
protected

try to send a footnote id

Referenced by MSWText::sendText().

void MSWParser::sendPicture ( long  fPos,
int  cPos,
MWAWPosition::AnchorTo  anchor = MWAWPosition::Char 
)
protected

send a picture

Referenced by MSWText::sendText().

Friends And Related Function Documentation

friend class MSWParserInternal::SubDocument
friend
friend class MSWText
friend

Referenced by init().

friend class MSWTextStyles
friend

Member Data Documentation

std::multimap<std::string, MSWEntry> MSWParser::m_entryMap
protected
shared_ptr<MSWText> MSWParser::m_textParser
protected

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

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