MacDrawProParser Class Referencefinal

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

#include <MacDrawProParser.hxx>

Inheritance diagram for MacDrawProParser:
MWAWGraphicParser MWAWParser

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
 
virtual void parse (librevenge::RVNGDrawingInterface *documentInterface)=0
 virtual function used to parse the input
 
- Public Member Functions inherited from MWAWParser
virtual ~MWAWParser ()
 virtual destructor
 
virtual bool checkHeader (MWAWHeader *header, bool strict=false)=0
 virtual function used to check if the document header is correct (or not)
 
int version () const
 returns the works version
 
MWAWParserStatePtr getParserState ()
 returns the parser state
 
MWAWHeadergetHeader ()
 returns the header
 
MWAWInputStreamPtrgetInput ()
 returns the actual input
 
MWAWListenerPtr getMainListener ()
 returns the main listener
 
MWAWGraphicListenerPtrgetGraphicListener ()
 returns the graphic listener
 
MWAWPresentationListenerPtrgetPresentationListener ()
 returns the presentation listener
 
MWAWSpreadsheetListenerPtrgetSpreadsheetListener ()
 returns the spreadsheet listener
 
MWAWTextListenerPtrgetTextListener ()
 returns the text listener
 
MWAWFontConverterPtrgetFontConverter ()
 returns the font converter
 
MWAWFontManagerPtrgetFontManager ()
 returns the font manager
 
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
 
libmwaw::DebugFileascii ()
 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 ()
 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)
 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::Statem_state
 the state
 
std::shared_ptr< MacDrawProStyleManagerm_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 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)
finalvirtual

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(), and readObject().

◆ 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::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(), send(), sendMasterPage(), and sendPage().

◆ 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

◆ MacDrawProStyleManager

friend class MacDrawProStyleManager
friend

Referenced by checkHeader(), and init().

Member Data Documentation

◆ m_state

◆ 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:

Generated on Wed May 3 2023 07:18:29 for libmwaw by doxygen 1.9.6