MacDrawProParser Class Reference documentation

MacDrawProParser Class Referencefinal

the main class to read a MacDraw II file More...

`#include <MacDrawProParser.hxx>`

Inheritance diagram for MacDrawProParser:

## Public Member Functions
| MacDrawProParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor
| ~MacDrawProParser () final
| destructor
bool | checkHeader (MWAWHeader *header, bool strict=false) final
| checks if the document header is correct (or not)
void | parse (librevenge::RVNGDrawingInterface *documentInterface) final
| virtual function used to parse the input
Public Member Functions inherited from MWAWGraphicParser
| ~MWAWGraphicParser () 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::RVNGDrawingInterface *documentInterface)
| creates the listener which will be associated to the document
bool | createZones ()
| finds the different objects zones
bool | readPrintInfo ()
| tries to read the print info zone
bool | readHeaderInfo ()
| tries to the header info zone ( print info + some information about content + prefs ?)
bool | readLayersInfo ()
| tries to the layer info zone
bool | readLayerLibraryCorrespondance ()
| tries to the layer library correspondance zone
bool | readLibrariesInfo ()
| tries to read the library name info zone
bool | findObjectPositions (bool dataZone)
| finds the objet's data/text positions
bool | computeLayersAndLibrariesBoundingBox ()
| computes the layers and libraries bounding box
bool | readStructuredHeaderZone (MWAWEntry const &entry, std::map< int, long > &idToDeltaPosMap)
| tries to read a structured zone header
int | readObject (int depth=0)
| tries to read an object and returns the object id (-1 if error )
bool | readObjectData (MacDrawProParserInternal::Shape &shape, int zId)
| tries to read an object data
bool | readRotationInObjectData (MacDrawProParserInternal::Shape &shape, long endPos, std::string &extra)
| tries to read the rotation
bool | updateGeometryShape (MacDrawProParserInternal::Shape &shape, float cornerWidth)
| tries to update the basic geometric data
bool | readBitmap (MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry)
| tries to read a bitmap data
bool | readTextII (MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry)
| tries to read a text object data in MacDraw II file
bool | readTextPro (MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry)
| tries to read a text object data in MacDraw pro file
bool | readGeometryShapeData (MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry)
| tries to read a basic geometric object data ( line, rect, arc,... )
bool | sendMasterPage ()
| tries to create a master page if needed
bool | sendPage (int page)
| tries to send the layer corresponding a page
bool | send (MacDrawProParserInternal::Library const &library)
| tries to send a library (not functionnal)
bool | send (MacDrawProParserInternal::Layer const &layer)
| tries to send a layer
bool | send (MacDrawProParserInternal::Shape const &shape, MWAWVec2f const &orig, int depth=0)
| tries to send a shape
bool | sendBitmap (MacDrawProParserInternal::Shape const &shape, MWAWPosition const &pos)
| tries to send a bitmap to the listener
bool | sendText (int zoneId)
| tries to send a text zone to the listener
bool | sendMeasure (MWAWEntry const &entry)
| tries to send a line measure to the listener
void | flushExtra ()
| sends the data which have not yet been sent to the listener
Protected Member Functions inherited from MWAWGraphicParser
| MWAWGraphicParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor (protected)
| MWAWGraphicParser (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

## Protected Attributes
std::shared_ptr< MacDrawProParserInternal::State > | m_state
| the state
std::shared_ptr< MacDrawProStyleManager > | m_styleManager
| the style manager state

## Friends
class | MacDrawProStyleManager
class | MacDrawProParserInternal::SubDocument

## Detailed Description

the main class to read a MacDraw II file

## Constructor & Destructor Documentation

## ◆ MacDrawProParser()

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

constructor

## ◆ ~MacDrawProParser()

MacDrawProParser::~MacDrawProParser | ( |  | ) |
| final

destructor

## Member Function Documentation

## ◆ checkHeader()

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

checks if the document header is correct (or not)

Implements MWAWParser.

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

## ◆ computeLayersAndLibrariesBoundingBox()

bool MacDrawProParser::computeLayersAndLibrariesBoundingBox | ( |  | ) |
| protected

computes the layers and libraries bounding box

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

## ◆ createDocument()

void MacDrawProParser::createDocument | ( | librevenge::RVNGDrawingInterface * | documentInterface | ) |
| protected

creates the listener which will be associated to the document

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

## ◆ createZones()

bool MacDrawProParser::createZones | ( |  | ) |
| protected

finds the different objects zones

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

## ◆ findObjectPositions()

bool MacDrawProParser::findObjectPositions | ( | bool | dataZone | ) |
| protected

finds the objet's data/text positions

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

## ◆ flushExtra()

void MacDrawProParser::flushExtra | ( |  | ) |
| protected

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

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

## ◆ init()

void MacDrawProParser::init | ( |  | ) |
| protected

inits all internal variables

Referenced by MacDrawProParser(), and MacDrawProParserInternal::SubDocument.

## ◆ parse()

void MacDrawProParser::parse | ( | librevenge::RVNGDrawingInterface * | documentInterface | ) |
| finalvirtual

virtual function used to parse the input

Implements MWAWGraphicParser.

Referenced by MacDrawProParserInternal::SubDocument.

## ◆ readBitmap()

bool MacDrawProParser::readBitmap | ( | MacDrawProParserInternal::Shape & | shape,
|  | MWAWEntry const & | entry )
| protected

tries to read a bitmap data

Referenced by MacDrawProParserInternal::SubDocument, and readObjectData().

## ◆ readGeometryShapeData()

bool MacDrawProParser::readGeometryShapeData | ( | MacDrawProParserInternal::Shape & | shape,
|  | MWAWEntry const & | entry )
| protected

tries to read a basic geometric object data ( line, rect, arc,... )

Referenced by MacDrawProParserInternal::SubDocument, and readObjectData().

## ◆ readHeaderInfo()

bool MacDrawProParser::readHeaderInfo | ( |  | ) |
| protected

tries to the header info zone ( print info + some information about content + prefs ?)

Referenced by checkHeader(), createZones(), and MacDrawProParserInternal::SubDocument.

## ◆ readLayerLibraryCorrespondance()

bool MacDrawProParser::readLayerLibraryCorrespondance | ( |  | ) |
| protected

tries to the layer library correspondance zone

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

## ◆ readLayersInfo()

bool MacDrawProParser::readLayersInfo | ( |  | ) |
| protected

tries to the layer info zone

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

## ◆ readLibrariesInfo()

bool MacDrawProParser::readLibrariesInfo | ( |  | ) |
| protected

tries to read the library name info zone

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

## ◆ readObject()

int MacDrawProParser::readObject | ( | int | depth = 0 | ) |
| protected

tries to read an object and returns the object id (-1 if error )

Referenced by createZones(), MacDrawProParserInternal::SubDocument, and readObject().

## ◆ readObjectData()

bool MacDrawProParser::readObjectData | ( | MacDrawProParserInternal::Shape & | shape,
|  | int | zId )
| protected

tries to read an object data

Referenced by MacDrawProParserInternal::SubDocument, and readObject().

## ◆ readPrintInfo()

bool MacDrawProParser::readPrintInfo | ( |  | ) |
| protected

tries to read the print info zone

Referenced by MacDrawProParserInternal::SubDocument, and readHeaderInfo().

## ◆ readRotationInObjectData()

bool MacDrawProParser::readRotationInObjectData | ( | MacDrawProParserInternal::Shape & | shape,
|  | long | endPos,
|  | std::string & | extra )
| protected

tries to read the rotation

Referenced by MacDrawProParserInternal::SubDocument, readBitmap(), readGeometryShapeData(), readObjectData(), readTextII(), and readTextPro().

## ◆ readStructuredHeaderZone()

bool MacDrawProParser::readStructuredHeaderZone | ( | MWAWEntry const & | entry,
|  | std::map< int, long > & | idToDeltaPosMap )
| protected

tries to read a structured zone header

Referenced by findObjectPositions(), MacDrawProParserInternal::SubDocument, and readLayerLibraryCorrespondance().

## ◆ readTextII()

bool MacDrawProParser::readTextII | ( | MacDrawProParserInternal::Shape & | shape,
|  | MWAWEntry const & | entry )
| protected

tries to read a text object data in MacDraw II file

Referenced by MacDrawProParserInternal::SubDocument, and readObjectData().

## ◆ readTextPro()

bool MacDrawProParser::readTextPro | ( | MacDrawProParserInternal::Shape & | shape,
|  | MWAWEntry const & | entry )
| protected

tries to read a text object data in MacDraw pro file

Referenced by MacDrawProParserInternal::SubDocument, and readObjectData().

## ◆ send() [1/3]

bool MacDrawProParser::send | ( | MacDrawProParserInternal::Layer const & | layer | ) |
| protected

tries to send a layer

## ◆ send() [2/3]

bool MacDrawProParser::send | ( | MacDrawProParserInternal::Library const & | library | ) |
| protected

tries to send a library (not functionnal)

Referenced by flushExtra(), MacDrawProParserInternal::SubDocument, send(), send(), send(), sendMasterPage(), and sendPage().

## ◆ send() [3/3]

bool MacDrawProParser::send | ( | MacDrawProParserInternal::Shape const & | shape,
|  | MWAWVec2f const & | orig,
|  | int | depth = 0 )
| protected

tries to send a shape

## ◆ sendBitmap()

bool MacDrawProParser::sendBitmap | ( | MacDrawProParserInternal::Shape const & | shape,
|  | MWAWPosition const & | pos )
| protected

tries to send a bitmap to the listener

Referenced by MacDrawProParserInternal::SubDocument, and send().

## ◆ sendMasterPage()

bool MacDrawProParser::sendMasterPage | ( |  | ) |
| protected

tries to create a master page if needed

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

## ◆ sendMeasure()

bool MacDrawProParser::sendMeasure | ( | MWAWEntry const & | entry | ) |
| protected

tries to send a line measure to the listener

Referenced by MacDrawProParserInternal::SubDocument.

## ◆ sendPage()

bool MacDrawProParser::sendPage | ( | int | page | ) |
| protected

tries to send the layer corresponding a page

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

## ◆ sendText()

bool MacDrawProParser::sendText | ( | int | zoneId | ) |
| protected

tries to send a text zone to the listener

Referenced by MacDrawProParserInternal::SubDocument.

## ◆ updateGeometryShape()

bool MacDrawProParser::updateGeometryShape | ( | MacDrawProParserInternal::Shape & | shape,
|  | float | cornerWidth )
| protected

tries to update the basic geometric data

Referenced by MacDrawProParserInternal::SubDocument, and readObject().

## Friends And Related Symbol Documentation

## ◆ MacDrawProParserInternal::SubDocument

friend class MacDrawProParserInternal::SubDocument
| friend

## ◆ MacDrawProStyleManager

friend class MacDrawProStyleManager
| friend

Referenced by checkHeader(), init(), and MacDrawProStyleManager.

## Member Data Documentation

## ◆ m_state

std::shared_ptr<MacDrawProParserInternal::State> MacDrawProParser::m_state
| protected

the state

Referenced by checkHeader(), computeLayersAndLibrariesBoundingBox(), createDocument(), createZones(), findObjectPositions(), flushExtra(), init(), MacDrawProParser(), parse(), readHeaderInfo(), readLayerLibraryCorrespondance(), readLayersInfo(), readLibrariesInfo(), readObject(), readObjectData(), send(), send(), send(), sendMasterPage(), sendPage(), and sendText().

## ◆ m_styleManager

std::shared_ptr<MacDrawProStyleManager> MacDrawProParser::m_styleManager
| protected

the style manager state

Referenced by checkHeader(), createZones(), init(), MacDrawProParser(), readHeaderInfo(), readObject(), and sendText().

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

- MacDrawProParser.hxx
- MacDrawProParser.cxx