MacWrtParser Class Reference documentation

MacWrtParser Class Referencefinal

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

`#include <MacWrtParser.hxx>`

Inheritance diagram for MacWrtParser:

## Public Member Functions
| MacWrtParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor
| ~MacWrtParser () final
| destructor
bool | checkHeader (MWAWHeader *header, bool strict=false) final
| checks if the document header is correct (or not)
void | parse (librevenge::RVNGTextInterface *documentInterface) final
| virtual function used to parse the input
Public Member Functions inherited from MWAWTextParser
| ~MWAWTextParser () override
| destructor
Public Member Functions inherited from MWAWParser
virtual | ~MWAWParser ()
| virtual destructor
int | version () const
| returns the works version
MWAWParserStatePtr | getParserState ()
| returns the parser state
MWAWHeader * | getHeader ()
| returns the header
MWAWInputStreamPtr & | getInput ()
| returns the actual input
MWAWListenerPtr | getMainListener ()
| returns the main listener
MWAWGraphicListenerPtr & | getGraphicListener ()
| returns the graphic listener
MWAWPresentationListenerPtr & | getPresentationListener ()
| returns the presentation listener
MWAWSpreadsheetListenerPtr & | getSpreadsheetListener ()
| returns the spreadsheet listener
MWAWTextListenerPtr & | getTextListener ()
| returns the text listener
MWAWFontConverterPtr & | getFontConverter ()
| returns the font converter
MWAWFontManagerPtr & | getFontManager ()
| returns the font manager
MWAWPageSpan const & | getPageSpan () const
| returns the actual page dimension
MWAWPageSpan & | getPageSpan ()
| 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 )
MWAWRSRCParserPtr & | getRSRCParser ()
| returns the rsrc parser
libmwaw::DebugFile & | ascii ()
| a DebugFile used to write what we recognize when we parse the document

## Protected Member Functions
void | init ()
| inits all internal variables
void | createDocument (librevenge::RVNGTextInterface *documentInterface)
| creates the listener which will be associated to the document
bool | sendWindow (int zone)
| send a zone ( 0: MAIN ZONE, 1 : HEADER, 2 : FOOTER )
bool | createZones ()
| finds the different objects zones
bool | createZonesV3 ()
| finds the different objects zones (version <= 3)
bool | readPrintInfo ()
| read the print info zone
bool | readWindowsInfo (int wh)
| read the windows zone
bool | readLinesHeight (MWAWEntry const &entry, std::vector< int > &firstParagLine, std::vector< int > &linesHeight)
| read the line height
bool | readInformationsV3 (int numInfo, std::vector< MacWrtParserInternal::Information > &informations)
| read the information ( version <= 3)
bool | readInformations (MWAWEntry const &entry, std::vector< MacWrtParserInternal::Information > &informations)
| read the information
bool | readParagraph (MacWrtParserInternal::Information const &info)
| read a paragraph
bool | readGraphic (MacWrtParserInternal::Information const &info)
| read a graphics
bool | readText (MacWrtParserInternal::Information const &info, std::vector< int > const &lineHeight)
| read a text zone
bool | readPageBreak (MacWrtParserInternal::Information const &info)
| read a page break zone ( version <= 3)
bool | checkFreeList ()
| check the free list
void | newPage (int number)
| adds a new page
Protected Member Functions inherited from MWAWTextParser
| MWAWTextParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor (protected)
| MWAWTextParser (MWAWParserStatePtr const &state)
| constructor using a state
Protected Member Functions inherited from MWAWParser
| MWAWParser (MWAWParserState::Type type, MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor (protected)
| MWAWParser (MWAWParserStatePtr const &state)
| constructor using a state
void | setVersion (int vers)
| sets the document's version
void | setGraphicListener (MWAWGraphicListenerPtr &listener)
| sets the graphic listener
void | resetGraphicListener ()
| resets the listener
void | setPresentationListener (MWAWPresentationListenerPtr &listener)
| sets the presentation listener
void | resetPresentationListener ()
| resets the listener
void | setSpreadsheetListener (MWAWSpreadsheetListenerPtr &listener)
| sets the spreadsheet listener
void | resetSpreadsheetListener ()
| resets the listener
void | setTextListener (MWAWTextListenerPtr &listener)
| sets the text listener
void | resetTextListener ()
| resets the listener
void | setAsciiName (char const *name)
| Debugging: change the default ascii file.
std::string const & | asciiName () const
| return the ascii file name

## Static Protected Member Functions
static bool | isMagicPic (librevenge::RVNGBinaryData const &dt)
| test if a graphic is empty.

## Protected Attributes
std::shared_ptr< MacWrtParserInternal::State > | m_state
| the state

## Friends
class | MacWrtParserInternal::SubDocument

## Detailed Description

the main class to read a MacWrite file

## Constructor & Destructor Documentation

## ◆ MacWrtParser()

MacWrtParser::MacWrtParser | ( | MWAWInputStreamPtr const & | input,
|  | MWAWRSRCParserPtr const & | rsrcParser,
|  | MWAWHeader * | header )

constructor

## ◆ ~MacWrtParser()

MacWrtParser::~MacWrtParser | ( |  | ) |
| final

destructor

## Member Function Documentation

## ◆ checkFreeList()

bool MacWrtParser::checkFreeList | ( |  | ) |
| protected

check the free list

Referenced by createZones(), and MacWrtParserInternal::SubDocument.

## ◆ checkHeader()

bool MacWrtParser::checkHeader | ( | MWAWHeader * | header,
|  | bool | strict = false )
| finalvirtual

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by MacWrtParserInternal::SubDocument, and parse().

## ◆ createDocument()

void MacWrtParser::createDocument | ( | librevenge::RVNGTextInterface * | documentInterface | ) |
| protected

creates the listener which will be associated to the document

Referenced by MacWrtParserInternal::SubDocument, and parse().

## ◆ createZones()

bool MacWrtParser::createZones | ( |  | ) |
| protected

finds the different objects zones

Referenced by MacWrtParserInternal::SubDocument, and parse().

## ◆ createZonesV3()

bool MacWrtParser::createZonesV3 | ( |  | ) |
| protected

finds the different objects zones (version <= 3)

Referenced by MacWrtParserInternal::SubDocument, and parse().

## ◆ init()

void MacWrtParser::init | ( |  | ) |
| protected

inits all internal variables

Referenced by MacWrtParser(), and MacWrtParserInternal::SubDocument.

## ◆ isMagicPic()

bool MacWrtParser::isMagicPic | ( | librevenge::RVNGBinaryData const & | dt | ) |
| staticprotected

test if a graphic is empty.

In v5, some empty graphic are added before a page break, so it better to remove them

Referenced by MacWrtParserInternal::SubDocument, and readGraphic().

## ◆ newPage()

void MacWrtParser::newPage | ( | int | number | ) |
| protected

adds a new page

Referenced by MacWrtParserInternal::SubDocument, and sendWindow().

## ◆ parse()

void MacWrtParser::parse | ( | librevenge::RVNGTextInterface * | documentInterface | ) |
| finalvirtual

virtual function used to parse the input

Implements MWAWTextParser.

Referenced by MacWrtParserInternal::SubDocument.

## ◆ readGraphic()

bool MacWrtParser::readGraphic | ( | MacWrtParserInternal::Information const & | info | ) |
| protected

read a graphics

Referenced by MacWrtParserInternal::SubDocument, and sendWindow().

## ◆ readInformations()

bool MacWrtParser::readInformations | ( | MWAWEntry const & | entry,
|  | std::vector< MacWrtParserInternal::Information > & | informations )
| protected

read the information

Referenced by MacWrtParserInternal::SubDocument, and readWindowsInfo().

## ◆ readInformationsV3()

bool MacWrtParser::readInformationsV3 | ( | int | numInfo,
|  | std::vector< MacWrtParserInternal::Information > & | informations )
| protected

read the information ( version <= 3)

Referenced by createZonesV3(), and MacWrtParserInternal::SubDocument.

## ◆ readLinesHeight()

bool MacWrtParser::readLinesHeight | ( | MWAWEntry const & | entry,
|  | std::vector< int > & | firstParagLine,
|  | std::vector< int > & | linesHeight )
| protected

read the line height

Referenced by MacWrtParserInternal::SubDocument, readText(), and readWindowsInfo().

## ◆ readPageBreak()

bool MacWrtParser::readPageBreak | ( | MacWrtParserInternal::Information const & | info | ) |
| protected

read a page break zone ( version <= 3)

Referenced by MacWrtParserInternal::SubDocument, and sendWindow().

## ◆ readParagraph()

bool MacWrtParser::readParagraph | ( | MacWrtParserInternal::Information const & | info | ) |
| protected

read a paragraph

Referenced by MacWrtParserInternal::SubDocument, and sendWindow().

## ◆ readPrintInfo()

bool MacWrtParser::readPrintInfo | ( |  | ) |
| protected

read the print info zone

Referenced by checkHeader(), createZones(), createZonesV3(), and MacWrtParserInternal::SubDocument.

## ◆ readText()

bool MacWrtParser::readText | ( | MacWrtParserInternal::Information const & | info,
|  | std::vector< int > const & | lineHeight )
| protected

read a text zone

Referenced by MacWrtParserInternal::SubDocument, and sendWindow().

## ◆ readWindowsInfo()

bool MacWrtParser::readWindowsInfo | ( | int | wh | ) |
| protected

read the windows zone

Referenced by checkHeader(), createZones(), createZonesV3(), and MacWrtParserInternal::SubDocument.

## ◆ sendWindow()

bool MacWrtParser::sendWindow | ( | int | zone | ) |
| protected

send a zone ( 0: MAIN ZONE, 1 : HEADER, 2 : FOOTER )

Referenced by createDocument(), MacWrtParserInternal::SubDocument, and parse().

## Friends And Related Symbol Documentation

## ◆ MacWrtParserInternal::SubDocument

friend class MacWrtParserInternal::SubDocument
| friend

## Member Data Documentation

## ◆ m_state

std::shared_ptr<MacWrtParserInternal::State> MacWrtParser::m_state
| protected

the state

Referenced by checkFreeList(), checkHeader(), createDocument(), createZones(), createZonesV3(), init(), MacWrtParser(), newPage(), parse(), readText(), readWindowsInfo(), and sendWindow().

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

- MacWrtParser.hxx
- MacWrtParser.cxx