FreeHandParser Class Referencefinal

the main class to read a FreeHand v0,v1 file More...

`#include <FreeHandParser.hxx>`

Inheritance diagram for FreeHandParser:

## Public Member Functions
| FreeHandParser (MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
| constructor
| ~FreeHandParser () 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 | readZoneV1 (int zId)
| try to read a zone: version 1
bool | readZoneV2 (int zId)
| try to read a zone: version 2
bool | readScreenMode (FreeHandParserInternal::ScreenMode &screen)
| try to read a special scren mode
bool | readStyleHeader (FreeHandParserInternal::StyleHeader &style)
| try to read a style header
bool | readColor (int zId)
| try to read a color zone
bool | readDash (int zId)
| try to read the dash zone
bool | readFillStyle (int zId)
| try to read a fill zone
bool | readLineStyle (int zId)
| try to read a line style zone
bool | readPostscriptStyle (int zId)
| try to read a postscript zone
bool | readRootGroup (int zId)
| try to read the list of group
bool | readStyleGroup (int zId)
| try to read a style group zone
bool | readGroupV1 (int zId)
| try to read a group zone: version 1
bool | readGroupV2 (int zId)
| try to read a group zone: version 2
bool | readJoinGroup (int zId)
| try to read a join zone (used to put text around path)
bool | readTransformGroup (int zId)
| try to read a node which contain the group transformation
bool | readStringZone (int zId)
| try to read a label/font name zone
bool | readShapeHeader (FreeHandParserInternal::ShapeHeader &shape)
| try to read a shape header
bool | readDataZone (int zId)
| try to read a data zone
bool | readBackgroundPicture (int zId)
| try to read a background picture zone
bool | readPictureZone (int zId)
| try to read a picture node
bool | readShape (int zId)
| try to read a shape
bool | readTextboxV1 (int zId)
| try to read a textbox zone: version 1
bool | readTextboxV2 (int zId)
| try to read a textbox zone: version 2
bool | sendZone (int zId, MWAWTransformation const &transform)
| try to send a zone
bool | sendGroup (FreeHandParserInternal::Shape const &group, MWAWTransformation const &transform)
| try to send a group shape
bool | sendBackgroundPicture (FreeHandParserInternal::Shape const &picture, MWAWTransformation const &transform)
| try to send a background picture
bool | sendPicture (FreeHandParserInternal::Shape const &picture, MWAWTransformation const &transform)
| try to send a picture
bool | sendShape (FreeHandParserInternal::Shape const &shape, MWAWTransformation const &transform)
| try to send a basic shape
bool | sendTextbox (FreeHandParserInternal::Textbox const &textbox, MWAWTransformation const &transform)
| try to send a basic textbox
bool | sendText (int zId)
| try to send the text of a text box
bool | openLayer (int zId)
| try to open a layer
void | closeLayer ()
| try to close a layer
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

## Static Protected Member Functions
static bool | decomposeMatrix (MWAWTransformation const &matrix, float &rotation, MWAWTransformation &transform, MWAWVec2f const &center)
| try to decompose the matrix in a rotation + scaling/translation matrix.

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

## Friends
class | FreeHandParserInternal::SubDocument

## Detailed Description

the main class to read a FreeHand v0,v1 file

## Constructor & Destructor Documentation

## ◆ FreeHandParser()

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

constructor

## ◆ ~FreeHandParser()

FreeHandParser::~FreeHandParser | ( |  | ) |
| final

destructor

## Member Function Documentation

## ◆ checkHeader()

bool FreeHandParser::checkHeader | ( | MWAWHeader * | header,
|  | bool | strict = false )
| final virtual

checks if the document header is correct (or not)

Implements MWAWParser.

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

## ◆ closeLayer()

void FreeHandParser::closeLayer | ( |  | ) |
| protected

try to close a layer

Referenced by FreeHandParserInternal::SubDocument, and sendGroup().

## ◆ createDocument()

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

creates the listener which will be associated to the document

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

## ◆ createZones()

bool FreeHandParser::createZones | ( |  | ) |
| protected

finds the different objects zones

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

## ◆ decomposeMatrix()

bool FreeHandParser::decomposeMatrix | ( | MWAWTransformation const & | matrix,
|  | float & | rotation,
|  | MWAWTransformation & | transform,
|  | MWAWVec2f const & | center )
| static protected

try to decompose the matrix in a rotation + scaling/translation matrix.

Note: because of the y-symetry this function is different from MWAWTransformation::decompose

Referenced by FreeHandParserInternal::SubDocument, sendPicture(), and sendTextbox().

## ◆ flushExtra()

void FreeHandParser::flushExtra | ( |  | ) |
| protected

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

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

## ◆ init()

void FreeHandParser::init | ( |  | ) |
| protected

inits all internal variables

Referenced by FreeHandParser(), and FreeHandParserInternal::SubDocument.

## ◆ openLayer()

bool FreeHandParser::openLayer | ( | int | zId | ) |
| protected

try to open a layer

Referenced by FreeHandParserInternal::SubDocument, openLayer(), and sendGroup().

## ◆ parse()

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

virtual function used to parse the input

Implements MWAWGraphicParser.

Referenced by FreeHandParserInternal::SubDocument.

## ◆ readBackgroundPicture()

bool FreeHandParser::readBackgroundPicture | ( | int | zId | ) |
| protected

try to read a background picture zone

Referenced by FreeHandParserInternal::SubDocument, and readZoneV1().

## ◆ readColor()

bool FreeHandParser::readColor | ( | int | zId | ) |
| protected

try to read a color zone

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readDash()

bool FreeHandParser::readDash | ( | int | zId | ) |
| protected

try to read the dash zone

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readDataZone()

bool FreeHandParser::readDataZone | ( | int | zId | ) |
| protected

try to read a data zone

Referenced by FreeHandParserInternal::SubDocument, and readZoneV2().

## ◆ readFillStyle()

bool FreeHandParser::readFillStyle | ( | int | zId | ) |
| protected

try to read a fill zone

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readGroupV1()

bool FreeHandParser::readGroupV1 | ( | int | zId | ) |
| protected

try to read a group zone: version 1

Referenced by FreeHandParserInternal::SubDocument, and readZoneV1().

## ◆ readGroupV2()

bool FreeHandParser::readGroupV2 | ( | int | zId | ) |
| protected

try to read a group zone: version 2

Referenced by FreeHandParserInternal::SubDocument, and readZoneV2().

## ◆ readJoinGroup()

bool FreeHandParser::readJoinGroup | ( | int | zId | ) |
| protected

try to read a join zone (used to put text around path)

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readLineStyle()

bool FreeHandParser::readLineStyle | ( | int | zId | ) |
| protected

try to read a line style zone

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readPictureZone()

bool FreeHandParser::readPictureZone | ( | int | zId | ) |
| protected

try to read a picture node

Referenced by FreeHandParserInternal::SubDocument, and readZoneV2().

## ◆ readPostscriptStyle()

bool FreeHandParser::readPostscriptStyle | ( | int | zId | ) |
| protected

try to read a postscript zone

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readRootGroup()

bool FreeHandParser::readRootGroup | ( | int | zId | ) |
| protected

try to read the list of group

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readScreenMode()

bool FreeHandParser::readScreenMode | ( | FreeHandParserInternal::ScreenMode & | screen | ) |
| protected

try to read a special scren mode

Referenced by FreeHandParserInternal::SubDocument, readShapeHeader(), and readStyleHeader().

## ◆ readShape()

bool FreeHandParser::readShape | ( | int | zId | ) |
| protected

try to read a shape

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readShapeHeader()

bool FreeHandParser::readShapeHeader | ( | FreeHandParserInternal::ShapeHeader & | shape | ) |
| protected

try to read a shape header

Referenced by FreeHandParserInternal::SubDocument, readBackgroundPicture(), readJoinGroup(), readPictureZone(), readShape(), readTextboxV1(), readTextboxV2(), and readTransformGroup().

## ◆ readStringZone()

bool FreeHandParser::readStringZone | ( | int | zId | ) |
| protected

try to read a label/font name zone

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readStyleGroup()

bool FreeHandParser::readStyleGroup | ( | int | zId | ) |
| protected

try to read a style group zone

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readStyleHeader()

bool FreeHandParser::readStyleHeader | ( | FreeHandParserInternal::StyleHeader & | style | ) |
| protected

try to read a style header

Referenced by FreeHandParserInternal::SubDocument, readColor(), readDash(), readFillStyle(), readLineStyle(), and readPostscriptStyle().

## ◆ readTextboxV1()

bool FreeHandParser::readTextboxV1 | ( | int | zId | ) |
| protected

try to read a textbox zone: version 1

Referenced by FreeHandParserInternal::SubDocument, and readZoneV1().

## ◆ readTextboxV2()

bool FreeHandParser::readTextboxV2 | ( | int | zId | ) |
| protected

try to read a textbox zone: version 2

Referenced by FreeHandParserInternal::SubDocument, and readZoneV2().

## ◆ readTransformGroup()

bool FreeHandParser::readTransformGroup | ( | int | zId | ) |
| protected

try to read a node which contain the group transformation

Referenced by FreeHandParserInternal::SubDocument, readZoneV1(), and readZoneV2().

## ◆ readZoneV1()

bool FreeHandParser::readZoneV1 | ( | int | zId | ) |
| protected

try to read a zone: version 1

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

## ◆ readZoneV2()

bool FreeHandParser::readZoneV2 | ( | int | zId | ) |
| protected

try to read a zone: version 2

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

## ◆ sendBackgroundPicture()

bool FreeHandParser::sendBackgroundPicture | ( | FreeHandParserInternal::Shape const & | picture,
|  | MWAWTransformation const & | transform )
| protected

try to send a background picture

Referenced by FreeHandParserInternal::SubDocument, and sendZone().

## ◆ sendGroup()

bool FreeHandParser::sendGroup | ( | FreeHandParserInternal::Shape const & | group,
|  | MWAWTransformation const & | transform )
| protected

try to send a group shape

Referenced by FreeHandParserInternal::SubDocument, and sendZone().

## ◆ sendPicture()

bool FreeHandParser::sendPicture | ( | FreeHandParserInternal::Shape const & | picture,
|  | MWAWTransformation const & | transform )
| protected

try to send a picture

Referenced by FreeHandParserInternal::SubDocument, and sendZone().

## ◆ sendShape()

bool FreeHandParser::sendShape | ( | FreeHandParserInternal::Shape const & | shape,
|  | MWAWTransformation const & | transform )
| protected

try to send a basic shape

Referenced by FreeHandParserInternal::SubDocument, and sendZone().

## ◆ sendText()

bool FreeHandParser::sendText | ( | int | zId | ) |
| protected

try to send the text of a text box

Referenced by FreeHandParserInternal::SubDocument.

## ◆ sendTextbox()

bool FreeHandParser::sendTextbox | ( | FreeHandParserInternal::Textbox const & | textbox,
|  | MWAWTransformation const & | transform )
| protected

try to send a basic textbox

Referenced by FreeHandParserInternal::SubDocument, and sendZone().

## ◆ sendZone()

bool FreeHandParser::sendZone | ( | int | zId,
|  | MWAWTransformation const & | transform )
| protected

try to send a zone

Referenced by flushExtra(), FreeHandParserInternal::SubDocument, parse(), and sendGroup().

## Friends And Related Symbol Documentation

## ◆ FreeHandParserInternal::SubDocument

friend class FreeHandParserInternal::SubDocument
| friend

## Member Data Documentation

## ◆ m_state

std::shared_ptr<FreeHandParserInternal::State> FreeHandParser::m_state
| protected

the state

Referenced by checkHeader(), closeLayer(), createZones(), flushExtra(), FreeHandParser(), init(), openLayer(), parse(), readBackgroundPicture(), readColor(), readDash(), readDataZone(), readFillStyle(), readGroupV1(), readGroupV2(), readJoinGroup(), readLineStyle(), readPictureZone(), readPostscriptStyle(), readRootGroup(), readShape(), readShapeHeader(), readStringZone(), readStyleGroup(), readStyleHeader(), readTextboxV1(), readTextboxV2(), readTransformGroup(), sendGroup(), sendPicture(), sendShape(), sendText(), and sendZone().

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

- FreeHandParser.hxx
- FreeHandParser.cxx