ApplePictParser Class Referencefinal

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

#include <ApplePictParser.hxx>

Inheritance diagram for ApplePictParser:
MWAWGraphicParser MWAWParser

Public Types

enum  DrawingMethod {
  D_FRAME , D_PAINT , D_ERASE , D_INVERT ,
  D_FILL , D_TEXT , D_UNDEFINED
}
 the drawing method: frame, paint, ... More...
 

Public Member Functions

 ApplePictParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
 constructor
 
 ~ApplePictParser () 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
 the main parse function
 
- 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

bool readZone ()
 try to read a zone
 
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
 
void drawLine (MWAWVec2i const &pt)
 draw a line from current position to position
 
bool readAndDrawRectangle (DrawingMethod method)
 read the current rectangle and draw it
 
void drawRectangle (DrawingMethod method)
 draw the current rectangle
 
bool readAndDrawRoundRectangle (DrawingMethod method)
 read the current round rectangle and draw it
 
void drawRoundRectangle (DrawingMethod method)
 draw the current round rectangle
 
bool readAndDrawCircle (DrawingMethod method)
 read the current circle and draw it
 
void drawCircle (DrawingMethod method)
 draw the current circle
 
bool readAndDrawPie (DrawingMethod method)
 read the current pie and draw it
 
void drawPie (DrawingMethod method, int startAngle, int dAngle)
 draw the current circle
 
bool readAndDrawPolygon (DrawingMethod method)
 read the current polygon and draw it
 
void drawPolygon (DrawingMethod method)
 draw the current polygon
 
bool readAndDrawText (std::string &text)
 read the current text and draw it
 
void drawText (MWAWEntry const &entry)
 draw a current text
 
void drawBitmap (ApplePictParserInternal::Bitmap const &bitmap)
 draw a bitmap
 
void drawPixmap (ApplePictParserInternal::Pixmap const &pixmap)
 draw a pixmap
 
bool readRGBColor (MWAWColor &color)
 try to read a rgb color
 
bool readBWPattern (MWAWGraphicStyle::Pattern &pattern)
 try to read a bw pattern
 
bool readColorPattern (MWAWGraphicStyle::Pattern &pattern)
 try to read a color pattern
 
bool readRegion (ApplePictParserInternal::Region &region)
 try to read a region
 
bool readBitmap (ApplePictParserInternal::Bitmap &bitmap, bool isPacked, bool hasRgn)
 read a bitmap
 
bool readPixmap (ApplePictParserInternal::Pixmap &pixmap, bool isPacked, bool haColorTable, bool hasRectMode, bool hasRgn)
 read a pixmap
 
bool readQuicktime (MWAWEmbeddedObject &object, MWAWBox2f &bdBox)
 try to read a quicktime zone
 
- 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
 

Static Protected Member Functions

static std::string getDrawingName (DrawingMethod method)
 debug function to print a drawing method
 
static std::string getModeName (int mode)
 debug function to print a mode name
 

Protected Attributes

std::shared_ptr< ApplePictParserInternal::Statem_state
 the state
 

Friends

class ApplePictParserInternal::SubDocument
 

Detailed Description

the main class to read a ApplePict file

Member Enumeration Documentation

◆ DrawingMethod

the drawing method: frame, paint, ...

Enumerator
D_FRAME 
D_PAINT 
D_ERASE 
D_INVERT 
D_FILL 
D_TEXT 
D_UNDEFINED 

Constructor & Destructor Documentation

◆ ApplePictParser()

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

constructor

◆ ~ApplePictParser()

ApplePictParser::~ApplePictParser ( )
final

destructor

Member Function Documentation

◆ checkHeader()

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

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

◆ createDocument()

void ApplePictParser::createDocument ( librevenge::RVNGDrawingInterface *  documentInterface)
protected

creates the listener which will be associated to the document

Referenced by parse().

◆ createZones()

bool ApplePictParser::createZones ( )
protected

finds the different objects zones

Referenced by parse().

◆ drawBitmap()

void ApplePictParser::drawBitmap ( ApplePictParserInternal::Bitmap const &  bitmap)
protected

draw a bitmap

Referenced by readZone().

◆ drawCircle()

void ApplePictParser::drawCircle ( ApplePictParser::DrawingMethod  method)
protected

draw the current circle

Referenced by readAndDrawCircle(), and readZone().

◆ drawLine()

void ApplePictParser::drawLine ( MWAWVec2i const &  pt)
protected

draw a line from current position to position

Referenced by readZone().

◆ drawPie()

void ApplePictParser::drawPie ( DrawingMethod  method,
int  startAngle,
int  dAngle 
)
protected

draw the current circle

Referenced by readAndDrawPie(), and readZone().

◆ drawPixmap()

void ApplePictParser::drawPixmap ( ApplePictParserInternal::Pixmap const &  pixmap)
protected

draw a pixmap

Referenced by readZone().

◆ drawPolygon()

void ApplePictParser::drawPolygon ( ApplePictParser::DrawingMethod  method)
protected

draw the current polygon

Referenced by readAndDrawPolygon(), and readZone().

◆ drawRectangle()

void ApplePictParser::drawRectangle ( ApplePictParser::DrawingMethod  method)
protected

draw the current rectangle

Referenced by readAndDrawRectangle(), and readZone().

◆ drawRoundRectangle()

void ApplePictParser::drawRoundRectangle ( ApplePictParser::DrawingMethod  method)
protected

draw the current round rectangle

Referenced by readAndDrawRoundRectangle(), and readZone().

◆ drawText()

void ApplePictParser::drawText ( MWAWEntry const &  entry)
protected

draw a current text

◆ getDrawingName()

static std::string ApplePictParser::getDrawingName ( DrawingMethod  method)
inlinestaticprotected

◆ getModeName()

std::string ApplePictParser::getModeName ( int  mode)
staticprotected

debug function to print a mode name

Referenced by readBitmap(), readPixmap(), and readZone().

◆ init()

void ApplePictParser::init ( )
protected

inits all internal variables

Referenced by ApplePictParser().

◆ parse()

void ApplePictParser::parse ( librevenge::RVNGDrawingInterface *  documentInterface)
finalvirtual

the main parse function

Implements MWAWGraphicParser.

◆ readAndDrawCircle()

bool ApplePictParser::readAndDrawCircle ( ApplePictParser::DrawingMethod  method)
protected

read the current circle and draw it

Referenced by readZone().

◆ readAndDrawPie()

bool ApplePictParser::readAndDrawPie ( ApplePictParser::DrawingMethod  method)
protected

read the current pie and draw it

Referenced by readZone().

◆ readAndDrawPolygon()

bool ApplePictParser::readAndDrawPolygon ( ApplePictParser::DrawingMethod  method)
protected

read the current polygon and draw it

Referenced by readZone().

◆ readAndDrawRectangle()

bool ApplePictParser::readAndDrawRectangle ( ApplePictParser::DrawingMethod  method)
protected

read the current rectangle and draw it

Referenced by readZone().

◆ readAndDrawRoundRectangle()

bool ApplePictParser::readAndDrawRoundRectangle ( ApplePictParser::DrawingMethod  method)
protected

read the current round rectangle and draw it

Referenced by readZone().

◆ readAndDrawText()

bool ApplePictParser::readAndDrawText ( std::string &  text)
protected

read the current text and draw it

Referenced by readZone().

◆ readBitmap()

bool ApplePictParser::readBitmap ( ApplePictParserInternal::Bitmap bitmap,
bool  isPacked,
bool  hasRgn 
)
protected

read a bitmap

Referenced by readZone().

◆ readBWPattern()

bool ApplePictParser::readBWPattern ( MWAWGraphicStyle::Pattern pattern)
protected

try to read a bw pattern

Referenced by readZone().

◆ readColorPattern()

bool ApplePictParser::readColorPattern ( MWAWGraphicStyle::Pattern pattern)
protected

try to read a color pattern

Referenced by readZone().

◆ readPixmap()

bool ApplePictParser::readPixmap ( ApplePictParserInternal::Pixmap pixmap,
bool  isPacked,
bool  haColorTable,
bool  hasRectMode,
bool  hasRgn 
)
protected

read a pixmap

Referenced by readColorPattern(), and readZone().

◆ readQuicktime()

bool ApplePictParser::readQuicktime ( MWAWEmbeddedObject object,
MWAWBox2f bdBox 
)
protected

try to read a quicktime zone

Referenced by readZone().

◆ readRegion()

bool ApplePictParser::readRegion ( ApplePictParserInternal::Region region)
protected

try to read a region

Referenced by readBitmap(), readPixmap(), and readZone().

◆ readRGBColor()

bool ApplePictParser::readRGBColor ( MWAWColor color)
protected

try to read a rgb color

Referenced by readColorPattern(), and readZone().

◆ readZone()

bool ApplePictParser::readZone ( )
protected

try to read a zone

Referenced by createZones().

Friends And Related Function Documentation

◆ ApplePictParserInternal::SubDocument

Member Data Documentation

◆ m_state


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

Generated on Thu Jan 19 2023 00:00:00 for libmwaw by doxygen 1.9.6