FreeHandParser Class Reference documentation

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

## 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. More...

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

## 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`
| ) |  |
| finalvirtual

checks if the document header is correct (or not)

Implements MWAWParser.

Referenced by parse().

## ◆ closeLayer()

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

try to close a layer

Referenced by sendGroup().

## ◆ createDocument()

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

creates the listener which will be associated to the document

Referenced by parse().

## ◆ createZones()

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

finds the different objects zones

Referenced by parse().

## ◆ decomposeMatrix()

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

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

## ◆ flushExtra()

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

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

Referenced by parse().

## ◆ init()

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

inits all internal variables

Referenced by FreeHandParser().

## ◆ openLayer()

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

try to open a layer

Referenced by sendGroup().

## ◆ parse()

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

virtual function used to parse the input

Implements MWAWGraphicParser.

## ◆ readBackgroundPicture()

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

try to read a background picture zone

Referenced by readZoneV1().

## ◆ readColor()

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

try to read a color zone

Referenced by readZoneV1(), and readZoneV2().

## ◆ readDash()

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

try to read the dash zone

Referenced by readZoneV1(), and readZoneV2().

## ◆ readDataZone()

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

try to read a data zone

Referenced by readZoneV2().

## ◆ readFillStyle()

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

try to read a fill zone

Referenced by readZoneV1(), and readZoneV2().

## ◆ readGroupV1()

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

try to read a group zone: version 1

Referenced by readZoneV1().

## ◆ readGroupV2()

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

try to read a group zone: version 2

Referenced by readZoneV2().

## ◆ readJoinGroup()

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

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

Referenced by readZoneV1(), and readZoneV2().

## ◆ readLineStyle()

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

try to read a line style zone

Referenced by readZoneV1(), and readZoneV2().

## ◆ readPictureZone()

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

try to read a picture node

Referenced by readZoneV2().

## ◆ readPostscriptStyle()

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

try to read a postscript zone

Referenced by readZoneV1(), and readZoneV2().

## ◆ readRootGroup()

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

try to read the list of group

Referenced by readZoneV1(), and readZoneV2().

## ◆ readScreenMode()

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

try to read a special scren mode

Referenced by readShapeHeader(), and readStyleHeader().

## ◆ readShape()

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

try to read a shape

Referenced by readZoneV1(), and readZoneV2().

## ◆ readShapeHeader()

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

try to read a shape header

Referenced by 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 readZoneV1(), and readZoneV2().

## ◆ readStyleGroup()

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

try to read a style group zone

Referenced by readZoneV1(), and readZoneV2().

## ◆ readStyleHeader()

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

try to read a style header

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

## ◆ readTextboxV1()

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

try to read a textbox zone: version 1

Referenced by readZoneV1().

## ◆ readTextboxV2()

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

try to read a textbox zone: version 2

Referenced by readZoneV2().

## ◆ readTransformGroup()

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

try to read a node which contain the group transformation

Referenced by readZoneV1(), and readZoneV2().

## ◆ readZoneV1()

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

try to read a zone: version 1

Referenced by createZones().

## ◆ readZoneV2()

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

try to read a zone: version 2

Referenced by createZones().

## ◆ sendBackgroundPicture()

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

try to send a background picture

Referenced by sendZone().

## ◆ sendGroup()

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

try to send a group shape

Referenced by sendZone().

## ◆ sendPicture()

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

try to send a picture

Referenced by sendZone().

## ◆ sendShape()

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

try to send a basic shape

Referenced by sendZone().

## ◆ sendText()

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

try to send the text of a text box

## ◆ sendTextbox()

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

try to send a basic textbox

Referenced by sendZone().

## ◆ sendZone()

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

try to send a zone

Referenced by flushExtra(), parse(), and sendGroup().

## Friends And Related Function 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(), 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