MsWrdParser Class Referencefinal

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

#include <MsWrdParser.hxx>

Inheritance diagram for MsWrdParser:
MWAWTextParser MWAWParser

Public Member Functions

 MsWrdParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
 constructor More...
 
 ~MsWrdParser () final
 destructor More...
 
bool checkHeader (MWAWHeader *header, bool strict=false) final
 checks if the document header is correct (or not) More...
 
void parse (librevenge::RVNGTextInterface *documentInterface) final
 the main parse function More...
 
- Public Member Functions inherited from MWAWTextParser
 ~MWAWTextParser () override
 destructor More...
 
- Public Member Functions inherited from MWAWParser
virtual ~MWAWParser ()
 virtual destructor More...
 
int version () const
 returns the works version More...
 
MWAWParserStatePtr getParserState ()
 returns the parser state More...
 
MWAWHeadergetHeader ()
 returns the header More...
 
MWAWInputStreamPtrgetInput ()
 returns the actual input More...
 
MWAWListenerPtr getMainListener ()
 returns the main listener More...
 
MWAWGraphicListenerPtrgetGraphicListener ()
 returns the graphic listener More...
 
MWAWPresentationListenerPtrgetPresentationListener ()
 returns the presentation listener More...
 
MWAWSpreadsheetListenerPtrgetSpreadsheetListener ()
 returns the spreadsheet listener More...
 
MWAWTextListenerPtrgetTextListener ()
 returns the text listener More...
 
MWAWFontConverterPtrgetFontConverter ()
 returns the font converter More...
 
MWAWFontManagerPtrgetFontManager ()
 returns the font manager 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...
 
libmwaw::DebugFileascii ()
 a DebugFile used to write what we recognize when we parse the document More...
 

Protected Member Functions

void init ()
 inits all internal variables More...
 
void createDocument (librevenge::RVNGTextInterface *documentInterface)
 creates the listener which will be associated to the document More...
 
bool createZones ()
 finds the different zones More...
 
bool readHeaderEndV3 ()
 finish reading the header (v3) More...
 
bool readZoneList ()
 read the list of zones More...
 
bool readPrintInfo (MsWrdEntry &entry)
 read the print info zone More...
 
bool readPrinter (MsWrdEntry &entry)
 read the printer name More...
 
bool readDocSum (MsWrdEntry &entry)
 read the document sumary More...
 
bool readStringsZone (MsWrdEntry &entry, std::vector< std::string > &list)
 read a zone which consists in a list of string More...
 
bool readObjects ()
 read the objects More...
 
bool readObjectList (MsWrdEntry &entry)
 read the object list More...
 
bool readObjectFlags (MsWrdEntry &entry)
 read the object flags More...
 
bool readObject (MsWrdParserInternal::Object &obj)
 read an object More...
 
bool readDocumentInfo (MsWrdEntry &entry)
 read the page dimensions + ? More...
 
bool readZone17 (MsWrdEntry &entry)
 read the zone 17( some bdbox + text position ?) More...
 
bool checkPicturePos (long pos, int type)
 check if a position corresponds or not to a picture entry More...
 
bool readPicture (MsWrdEntry &entry)
 read a picture data More...
 
void sendPicture (long fPos, int cPos, MWAWPosition::AnchorTo anchor=MWAWPosition::Char)
 send a picture More...
 
bool getColor (int id, MWAWColor &col) const
 returns the color corresponding to an id More...
 
void newPage (int number)
 adds a new page More...
 
void sendFootnote (int id)
 try to send a footnote id More...
 
void sendFieldComment (int id)
 try to send a bookmark field id More...
 
void send (int id, libmwaw::SubDocumentType type)
 try to send a footnote, a field to the textParser More...
 
void send (MWAWEntry const &entry)
 try to send a text to the textParser More...
 
void sendSimpleTextZone (MWAWListenerPtr &listener, MWAWEntry const &entry)
 try to send a simple text zone(ie. a comment) More...
 
MsWrdEntry readEntry (std::string type, int id=-1)
 read a file entry More...
 
- Protected Member Functions inherited from MWAWTextParser
 MWAWTextParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
 constructor (protected) More...
 
 MWAWTextParser (MWAWParserStatePtr const &state)
 constructor using a state More...
 
- Protected Member Functions inherited from MWAWParser
 MWAWParser (MWAWParserState::Type type, MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
 constructor (protected) More...
 
 MWAWParser (MWAWParserStatePtr const &state)
 constructor using a state More...
 
void setVersion (int vers)
 sets the document's version More...
 
void setGraphicListener (MWAWGraphicListenerPtr &listener)
 sets the graphic listener More...
 
void resetGraphicListener ()
 resets the listener More...
 
void setPresentationListener (MWAWPresentationListenerPtr &listener)
 sets the presentation listener More...
 
void resetPresentationListener ()
 resets the listener More...
 
void setSpreadsheetListener (MWAWSpreadsheetListenerPtr &listener)
 sets the spreadsheet listener More...
 
void resetSpreadsheetListener ()
 resets the listener More...
 
void setTextListener (MWAWTextListenerPtr &listener)
 sets the text listener More...
 
void resetTextListener ()
 resets the listener 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

std::shared_ptr< MsWrdParserInternal::Statem_state
 the state More...
 
std::multimap< std::string, MsWrdEntrym_entryMap
 the list of entries More...
 
std::shared_ptr< MsWrdTextm_textParser
 the text parser More...
 

Friends

class MsWrdText
 
class MsWrdTextStyles
 
class MsWrdParserInternal::SubDocument
 

Detailed Description

the main class to read a Microsoft Word file

Constructor & Destructor Documentation

◆ MsWrdParser()

MsWrdParser::MsWrdParser ( MWAWInputStreamPtr const &  input,
MWAWRSRCParserPtr const &  rsrcParser,
MWAWHeader header 
)

constructor

◆ ~MsWrdParser()

MsWrdParser::~MsWrdParser ( )
final

destructor

Member Function Documentation

◆ checkHeader()

bool MsWrdParser::checkHeader ( MWAWHeader header,
bool  strict = false 
)
finalvirtual

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

◆ checkPicturePos()

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

check if a position corresponds or not to a picture entry

Referenced by MsWrdTextStyles::readFont().

◆ createDocument()

void MsWrdParser::createDocument ( librevenge::RVNGTextInterface *  documentInterface)
protected

creates the listener which will be associated to the document

Referenced by parse().

◆ createZones()

bool MsWrdParser::createZones ( )
protected

finds the different zones

Referenced by parse().

◆ getColor()

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

returns the color corresponding to an id

Referenced by MsWrdTextStyles::readFont().

◆ init()

void MsWrdParser::init ( )
protected

inits all internal variables

Referenced by MsWrdParser().

◆ newPage()

void MsWrdParser::newPage ( int  number)
protected

adds a new page

Referenced by MsWrdText::sendText().

◆ parse()

void MsWrdParser::parse ( librevenge::RVNGTextInterface *  documentInterface)
finalvirtual

the main parse function

Implements MWAWTextParser.

◆ readDocSum()

bool MsWrdParser::readDocSum ( MsWrdEntry entry)
protected

read the document sumary

Referenced by createZones().

◆ readDocumentInfo()

bool MsWrdParser::readDocumentInfo ( MsWrdEntry entry)
protected

read the page dimensions + ?

Referenced by createZones().

◆ readEntry()

MsWrdEntry MsWrdParser::readEntry ( std::string  type,
int  id = -1 
)
protected

read a file entry

Referenced by readZoneList().

◆ readHeaderEndV3()

bool MsWrdParser::readHeaderEndV3 ( )
protected

finish reading the header (v3)

Referenced by checkHeader().

◆ readObject()

bool MsWrdParser::readObject ( MsWrdParserInternal::Object obj)
protected

read an object

Referenced by readObjects().

◆ readObjectFlags()

bool MsWrdParser::readObjectFlags ( MsWrdEntry entry)
protected

read the object flags

Referenced by readObjects().

◆ readObjectList()

bool MsWrdParser::readObjectList ( MsWrdEntry entry)
protected

read the object list

Referenced by readObjects().

◆ readObjects()

bool MsWrdParser::readObjects ( )
protected

read the objects

Referenced by createZones().

◆ readPicture()

bool MsWrdParser::readPicture ( MsWrdEntry entry)
protected

read a picture data

Referenced by createZones().

◆ readPrinter()

bool MsWrdParser::readPrinter ( MsWrdEntry entry)
protected

read the printer name

Referenced by createZones().

◆ readPrintInfo()

bool MsWrdParser::readPrintInfo ( MsWrdEntry entry)
protected

read the print info zone

Referenced by createZones().

◆ readStringsZone()

bool MsWrdParser::readStringsZone ( MsWrdEntry entry,
std::vector< std::string > &  list 
)
protected

read a zone which consists in a list of string

Referenced by readObjects().

◆ readZone17()

bool MsWrdParser::readZone17 ( MsWrdEntry entry)
protected

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

Referenced by createZones().

◆ readZoneList()

bool MsWrdParser::readZoneList ( )
protected

read the list of zones

Referenced by createZones().

◆ send() [1/2]

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

try to send a footnote, a field to the textParser

◆ send() [2/2]

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

try to send a text to the textParser

◆ sendFieldComment()

void MsWrdParser::sendFieldComment ( int  id)
protected

try to send a bookmark field id

Referenced by MsWrdText::sendText().

◆ sendFootnote()

void MsWrdParser::sendFootnote ( int  id)
protected

try to send a footnote id

Referenced by MsWrdText::sendText().

◆ sendPicture()

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

send a picture

Referenced by MsWrdText::sendText().

◆ sendSimpleTextZone()

void MsWrdParser::sendSimpleTextZone ( MWAWListenerPtr listener,
MWAWEntry const &  entry 
)
protected

try to send a simple text zone(ie. a comment)

Friends And Related Function Documentation

◆ MsWrdParserInternal::SubDocument

friend class MsWrdParserInternal::SubDocument
friend

◆ MsWrdText

friend class MsWrdText
friend

Referenced by init().

◆ MsWrdTextStyles

friend class MsWrdTextStyles
friend

Member Data Documentation

◆ m_entryMap

std::multimap<std::string, MsWrdEntry> MsWrdParser::m_entryMap
protected

◆ m_state

◆ m_textParser

std::shared_ptr<MsWrdText> MsWrdParser::m_textParser
protected

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

Generated for libmwaw by doxygen 1.8.14