Public Member Functions | Protected Member Functions | Protected Attributes | Friends | List of all members
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 More...
| ~MacDrawProParser () final
| destructor More...
bool | checkHeader (MWAWHeader *header, bool strict=false) final
| checks if the document header is correct (or not) More...
void | parse (librevenge::RVNGDrawingInterface *documentInterface) final
| virtual function used to parse the input More...
Public Member Functions inherited from MWAWGraphicParser
| ~MWAWGraphicParser () 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...
MWAWHeader * | getHeader ()
| returns the header More...
MWAWInputStreamPtr & | getInput ()
| returns the actual input More...
MWAWListenerPtr | getMainListener ()
| returns the main listener More...
MWAWGraphicListenerPtr & | getGraphicListener ()
| returns the graphic listener More...
MWAWPresentationListenerPtr & | getPresentationListener ()
| returns the presentation listener More...
MWAWSpreadsheetListenerPtr & | getSpreadsheetListener ()
| returns the spreadsheet listener More...
MWAWTextListenerPtr & | getTextListener ()
| returns the text listener More...
MWAWFontConverterPtr & | getFontConverter ()
| returns the font converter More...
MWAWFontManagerPtr & | getFontManager ()
| returns the font manager More...
MWAWPageSpan const & | getPageSpan () const
| returns the actual page dimension More...
MWAWPageSpan & | getPageSpan ()
| 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...
MWAWRSRCParserPtr & | getRSRCParser ()
| returns the rsrc parser More...
libmwaw::DebugFile & | ascii ()
| 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::RVNGDrawingInterface *documentInterface)
| creates the listener which will be associated to the document More...
bool | createZones ()
| finds the different objects zones More...
bool | readPrintInfo ()
| tries to read the print info zone More...
bool | readHeaderInfo ()
| tries to the header info zone ( print info + some information about content + prefs ?) More...
bool | readLayersInfo ()
| tries to the layer info zone More...
bool | readLayerLibraryCorrespondance ()
| tries to the layer library correspondance zone More...
bool | readLibrariesInfo ()
| tries to read the library name info zone More...
bool | findObjectPositions (bool dataZone)
| finds the objet's data/text positions More...
bool | computeLayersAndLibrariesBoundingBox ()
| computes the layers and libraries bounding box More...
bool | readStructuredHeaderZone (MWAWEntry const &entry, std::map< int, long > &idToDeltaPosMap)
| tries to read a structured zone header More...
int | readObject ()
| tries to read an object and returns the object id (-1 if error ) More...
bool | readObjectData (MacDrawProParserInternal::Shape &shape, int zId)
| tries to read an object data More...
bool | readRotationInObjectData (MacDrawProParserInternal::Shape &shape, long endPos, std::string &extra)
| tries to read the rotation More...
bool | updateGeometryShape (MacDrawProParserInternal::Shape &shape, float cornerWidth)
| tries to update the basic geometric data More...
bool | readBitmap (MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry)
| tries to read a bitmap data More...
bool | readTextII (MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry)
| tries to read a text object data in MacDraw II file More...
bool | readTextPro (MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry)
| tries to read a text object data in MacDraw pro file More...
bool | readGeometryShapeData (MacDrawProParserInternal::Shape &shape, MWAWEntry const &entry)
| tries to read a basic geometric object data ( line, rect, arc,... ) More...
bool | sendMasterPage ()
| tries to create a master page if needed More...
bool | sendPage (int page)
| tries to send the layer corresponding a page More...
bool | send (MacDrawProParserInternal::Library const &library)
| tries to send a library (not functionnal) More...
bool | send (MacDrawProParserInternal::Layer const &layer)
| tries to send a layer More...
bool | send (MacDrawProParserInternal::Shape const &shape, MWAWVec2f const &orig)
| tries to send a shape More...
bool | sendBitmap (MacDrawProParserInternal::Shape const &shape, MWAWPosition const &pos)
| tries to send a bitmap to the listener More...
bool | sendText (int zoneId)
| tries to send a text zone to the listener More...
bool | sendMeasure (MWAWEntry const &entry)
| tries to send a line measure to the listener More...
void | flushExtra ()
| sends the data which have not yet been sent to the listener More...
Protected Member Functions inherited from MWAWGraphicParser
| MWAWGraphicParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor (protected) More...
| MWAWGraphicParser (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< MacDrawProParserInternal::State > | m_state
| the state More...
std::shared_ptr< MacDrawProStyleManager > | m_styleManager
| the style manager state More...

## 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`
| ) |  |
| final virtual

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

## ◆ computeLayersAndLibrariesBoundingBox()

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

computes the layers and libraries bounding box

Referenced by createZones().

## ◆ createDocument()

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

creates the listener which will be associated to the document

Referenced by parse().

## ◆ createZones()

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

finds the different objects zones

Referenced by parse().

## ◆ findObjectPositions()

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

finds the objet's data/text positions

Referenced by createZones().

## ◆ flushExtra()

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

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

Referenced by parse().

## ◆ init()

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

inits all internal variables

Referenced by MacDrawProParser().

## ◆ parse()

void MacDrawProParser::parse | ( | librevenge::RVNGDrawingInterface * | documentInterface | ) |
| final virtual

virtual function used to parse the input

Implements MWAWGraphicParser.

## ◆ readBitmap()

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

tries to read a bitmap data

Referenced by 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 readObjectData().

## ◆ readHeaderInfo()

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

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

Referenced by checkHeader(), and createZones().

## ◆ readLayerLibraryCorrespondance()

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

tries to the layer library correspondance zone

Referenced by createZones().

## ◆ readLayersInfo()

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

tries to the layer info zone

Referenced by createZones().

## ◆ readLibrariesInfo()

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

tries to read the library name info zone

Referenced by createZones().

## ◆ readObject()

int MacDrawProParser::readObject | ( |  | ) |
| protected

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

Referenced by createZones().

## ◆ readObjectData()

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

tries to read an object data

Referenced by readObject().

## ◆ readPrintInfo()

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

tries to read the print info zone

Referenced by readHeaderInfo().

## ◆ readRotationInObjectData()

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

tries to read the rotation

Referenced by 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(), 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 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 readObjectData().

## ◆ send() [1/3]

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

tries to send a library (not functionnal)

Referenced by flushExtra(), send(), sendMasterPage(), and sendPage().

## ◆ send() [2/3]

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

tries to send a layer

## ◆ send() [3/3]

bool MacDrawProParser::send | ( | MacDrawProParserInternal::Shape const & | shape,
|  | MWAWVec2f const & | orig
| ) |  |
| 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 send().

## ◆ sendMasterPage()

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

tries to create a master page if needed

Referenced by parse().

## ◆ sendMeasure()

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

tries to send a line measure to the listener

## ◆ sendPage()

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

tries to send the layer corresponding a page

Referenced by parse().

## ◆ sendText()

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

tries to send a text zone to the listener

## ◆ updateGeometryShape()

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

tries to update the basic geometric data

Referenced by readObject().

## Friends And Related Function Documentation

## ◆ MacDrawProParserInternal::SubDocument

friend class MacDrawProParserInternal::SubDocument
| friend

## ◆ MacDrawProStyleManager

friend class MacDrawProStyleManager
| friend

Referenced by checkHeader(), and init().

## 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(), parse(), readHeaderInfo(), readLayerLibraryCorrespondance(), readLayersInfo(), readLibrariesInfo(), readObject(), readObjectData(), send(), sendMasterPage(), sendPage(), and sendText().

## ◆ m_styleManager

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

the style manager state

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

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

- MacDrawProParser.hxx
- MacDrawProParser.cxx