Canvas5StyleManager Class Reference

the main class to read the style part of Canvas 5 file More...

`#include <Canvas5StyleManager.hxx>`

## Classes

struct | CharStyle
| a structure use to store a character style More...
struct | StyleList
| a structure use to store a list of styles More...

## Public Member Functions

| Canvas5StyleManager (Canvas5Parser &parser)
| constructor
virtual | ~Canvas5StyleManager ()
| destructor
int | version () const
| returns the file version
std::shared_ptr< Canvas5Image > | getImageParser () const
| returns the image parser
std::shared_ptr< Canvas5StyleManagerInternal::ColorStyle > | readColorStyle (std::shared_ptr< Canvas5Structure::Stream > stream, unsigned type, long len)
| try to read a color style
bool | updateLineColor (Canvas5StyleManagerInternal::ColorStyle const &color, MWAWGraphicStyle &style)
| try to update the line color given a color style
bool | updateSurfaceColor (Canvas5StyleManagerInternal::ColorStyle const &color, MWAWGraphicStyle &style)
| try to update the surface color given a color style
std::shared_ptr< Canvas5StyleManagerInternal::PenStyle > | readPenStyle (Canvas5Structure::Stream &stream, unsigned type, long len)
| try to read a pen style
bool | updateLine (Canvas5StyleManagerInternal::PenStyle const &pen, MWAWGraphicStyle &style, int &numLines, int lineId, float *offset)
| try to update the line color given a color style
bool | readArrow (std::shared_ptr< Canvas5Structure::Stream > stream, MWAWGraphicStyle::Arrow &arrow, unsigned type, long len)
| try to read an arrow
bool | readCharStyle (Canvas5Structure::Stream &stream, int id, CharStyle &fontIds, bool useFileColors=true)
| try to read a character style, returns a font, a paragraph id and it potential link id
bool | readDash (Canvas5Structure::Stream &stream, std::vector< float > &dashes, unsigned type, long len)
| try to read a dash's array
bool | readStyleEnd (std::shared_ptr< Canvas5Structure::Stream > stream, MWAWFont *font=nullptr, MWAWParagraph *para=nullptr)
| try to read the second part of a style which contains minor paragraph styles, hyphen, ...

## Protected Member Functions

bool | updateLineStyle (int sId, MWAWGraphicStyle &style, int &numLines, int lineId=-1, float *offset=nullptr)
| try to update the line style given the stroke id and returns the number of lines(plin)
bool | updateLineColor (int cId, MWAWGraphicStyle &style)
| try to update the line color given the color id
bool | updateSurfaceColor (int cId, MWAWGraphicStyle &style)
| try to update the surface color given the color id
bool | readArrows (std::shared_ptr< Canvas5Structure::Stream > stream)
| try to read the arrows zones
bool | readCharStyles (std::shared_ptr< Canvas5Structure::Stream > stream)
| try to read the character styles
bool | readInks (std::shared_ptr< Canvas5Structure::Stream > stream)
| try to read the ink color zones
bool | readInks9 (std::shared_ptr< Canvas5Structure::Stream > stream)
| try to read the ink color zones: v9
bool | readColor (Canvas5Structure::Stream &stream, MWAWVariable< MWAWColor > &color, std::string &extra)
| try to read a color: 12 unknown 4 components followed by a type
bool | readDashes (std::shared_ptr< Canvas5Structure::Stream > stream)
| try to read the dashes
bool | readFrameStyles9 (std::shared_ptr< Canvas5Structure::Stream > stream)
| try to read the frame zones: stroke, pen style, arrow, dashes: v9
bool | readFonts (std::shared_ptr< Canvas5Structure::Stream > stream, int numFonts)
| try to read the fonts names
bool | readFormats (std::shared_ptr< Canvas5Structure::Stream > stream)
| read the list of formats, mainly an unit's conversion table
bool | readPenSize (std::shared_ptr< Canvas5Structure::Stream > stream)
| read the pen size (header file)
bool | readPenStyles (std::shared_ptr< Canvas5Structure::Stream > stream)
| read the pen styles
bool | readStrokes (std::shared_ptr< Canvas5Structure::Stream > stream)
| try to read the stroke styles
bool | readParaStyle (std::shared_ptr< Canvas5Structure::Stream > stream, int id, StyleList *styles=nullptr)
| try to read a paragraph style
bool | readParaStyles (std::shared_ptr< Canvas5Structure::Stream > stream)
| try to read the paragraph styles
bool | readGradient (std::shared_ptr< Canvas5Structure::Stream > stream, long len, MWAWGraphicStyle::Gradient &gradient)
| try to read a gradient zone: OBFL
bool | readHatch (std::shared_ptr< Canvas5Structure::Stream > stream, long len, MWAWGraphicStyle::Hatch &hatch, MWAWVariable< MWAWColor > &backColor)
| try to read a hatch zone: htch
std::shared_ptr< Canvas5ImageInternal::VKFLImage > | readSymbol (std::shared_ptr< Canvas5Structure::Stream > stream, long len, MWAWVariable< MWAWColor > &backColor)
| try to read a symbol zone: vkfl/TXUR

## Protected Attributes

MWAWParserStatePtr | m_parserState
| the parser state
std::shared_ptr< Canvas5StyleManagerInternal::State > | m_state
| the state
Canvas5Parser * | m_mainParser
| the main parser;

## Private Member Functions

| Canvas5StyleManager (Canvas5StyleManager const &orig)=delete
Canvas5StyleManager & | operator= (Canvas5StyleManager const &orig)=delete

## Friends

class | Canvas5Graph
class | Canvas5Parser

## Detailed Description

the main class to read the style part of Canvas 5 file

## Constructor & Destructor Documentation

## Canvas5StyleManager() [1/2]

Canvas5StyleManager::Canvas5StyleManager | ( | Canvas5Parser & | parser | ) |

explicit

constructor

Referenced by Canvas5StyleManager(), and operator=().

## ~Canvas5StyleManager()

Canvas5StyleManager::~Canvas5StyleManager | ( |  | ) |

virtual

destructor

## Canvas5StyleManager() [2/2]

Canvas5StyleManager::Canvas5StyleManager | ( | Canvas5StyleManager const & | orig | ) |

private delete

## Member Function Documentation

## getImageParser()

std::shared_ptr< Canvas5Image > Canvas5StyleManager::getImageParser | ( |  | ) | const

returns the image parser

Referenced by readArrow(), readColorStyle(), and readSymbol().

## operator=()

Canvas5StyleManager & Canvas5StyleManager::operator= | ( | Canvas5StyleManager const & | orig | ) |

private delete

## readArrow()

bool Canvas5StyleManager::readArrow | ( | std::shared_ptr< Canvas5Structure::Stream > | stream,
|  | MWAWGraphicStyle::Arrow & | arrow,
|  | unsigned | type,
|  | long | len )

try to read an arrow

## readArrows()

bool Canvas5StyleManager::readArrows | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

try to read the arrows zones

## readCharStyle()

bool Canvas5StyleManager::readCharStyle | ( | Canvas5Structure::Stream & | stream,
|  | int | id,
|  | CharStyle & | fontIds,
|  | bool | useFileColors = true )

try to read a character style, returns a font, a paragraph id and it potential link id

Referenced by readCharStyles().

## readCharStyles()

bool Canvas5StyleManager::readCharStyles | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

try to read the character styles

## readColor()

bool Canvas5StyleManager::readColor | ( | Canvas5Structure::Stream & | stream,
|  | MWAWVariable< MWAWColor > & | color,
|  | std::string & | extra )

protected

try to read a color: 12 unknown 4 components followed by a type

Referenced by readColorStyle(), readGradient(), readHatch(), and readPenStyle().

## readColorStyle()

std::shared_ptr< Canvas5StyleManagerInternal::ColorStyle > Canvas5StyleManager::readColorStyle | ( | std::shared_ptr< Canvas5Structure::Stream > | stream,
|  | unsigned | type,
|  | long | len )

try to read a color style

Referenced by readHatch(), readInks9(), and readSymbol().

## readDash()

bool Canvas5StyleManager::readDash | ( | Canvas5Structure::Stream & | stream,
|  | std::vector< float > & | dashes,
|  | unsigned | type,
|  | long | len )

try to read a dash's array

Referenced by readDashes().

## readDashes()

bool Canvas5StyleManager::readDashes | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

try to read the dashes

## readFonts()

bool Canvas5StyleManager::readFonts | ( | std::shared_ptr< Canvas5Structure::Stream > | stream,
|  | int | numFonts )

protected

try to read the fonts names

## readFormats()

bool Canvas5StyleManager::readFormats | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

read the list of formats, mainly an unit's conversion table

## readFrameStyles9()

bool Canvas5StyleManager::readFrameStyles9 | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

try to read the frame zones: stroke, pen style, arrow, dashes: v9

## readGradient()

bool Canvas5StyleManager::readGradient | ( | std::shared_ptr< Canvas5Structure::Stream > | stream,
|  | long | len,
|  | MWAWGraphicStyle::Gradient & | gradient )

protected

try to read a gradient zone: OBFL

Referenced by readColorStyle().

## readHatch()

bool Canvas5StyleManager::readHatch | ( | std::shared_ptr< Canvas5Structure::Stream > | stream,
|  | long | len,
|  | MWAWGraphicStyle::Hatch & | hatch,
|  | MWAWVariable< MWAWColor > & | backColor )

protected

try to read a hatch zone: htch

Referenced by readColorStyle().

## readInks()

bool Canvas5StyleManager::readInks | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

try to read the ink color zones

## readInks9()

bool Canvas5StyleManager::readInks9 | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

try to read the ink color zones: v9

## readParaStyle()

bool Canvas5StyleManager::readParaStyle | ( | std::shared_ptr< Canvas5Structure::Stream > | stream,
|  | int | id,
|  | Canvas5StyleManager::StyleList * | styles = nullptr )

protected

try to read a paragraph style

Referenced by readParaStyles().

## readParaStyles()

bool Canvas5StyleManager::readParaStyles | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

try to read the paragraph styles

## readPenSize()

bool Canvas5StyleManager::readPenSize | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

read the pen size (header file)

## readPenStyle()

std::shared_ptr< Canvas5StyleManagerInternal::PenStyle > Canvas5StyleManager::readPenStyle | ( | Canvas5Structure::Stream & | stream,
|  | unsigned | type,
|  | long | len )

try to read a pen style

## readPenStyles()

bool Canvas5StyleManager::readPenStyles | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

read the pen styles

## readStrokes()

bool Canvas5StyleManager::readStrokes | ( | std::shared_ptr< Canvas5Structure::Stream > | stream | ) |

protected

try to read the stroke styles

## readStyleEnd()

bool Canvas5StyleManager::readStyleEnd | ( | std::shared_ptr< Canvas5Structure::Stream > | stream,
|  | MWAWFont * | font = nullptr,
|  | MWAWParagraph * | para = nullptr )

try to read the second part of a style which contains minor paragraph styles, hyphen, ...

Referenced by readParaStyle().

## readSymbol()

std::shared_ptr< Canvas5ImageInternal::VKFLImage > Canvas5StyleManager::readSymbol | ( | std::shared_ptr< Canvas5Structure::Stream > | stream,
|  | long | len,
|  | MWAWVariable< MWAWColor > & | backColor )

protected

try to read a symbol zone: vkfl/TXUR

Referenced by readColorStyle().

## updateLine()

bool Canvas5StyleManager::updateLine | ( | Canvas5StyleManagerInternal::PenStyle const & | pen,
|  | MWAWGraphicStyle & | style,
|  | int & | numLines,
|  | int | lineId,
|  | float * | offset )

try to update the line color given a color style

Referenced by updateLineStyle().

## updateLineColor() [1/2]

bool Canvas5StyleManager::updateLineColor | ( | Canvas5StyleManagerInternal::ColorStyle const & | color,
|  | MWAWGraphicStyle & | style )

try to update the line color given a color style

Referenced by updateLineColor().

## updateLineColor() [2/2]

bool Canvas5StyleManager::updateLineColor | ( | int | cId,
|  | MWAWGraphicStyle & | style )

protected

try to update the line color given the color id

## updateLineStyle()

bool Canvas5StyleManager::updateLineStyle | ( | int | sId,
|  | MWAWGraphicStyle & | style,
|  | int & | numLines,
|  | int | lineId = -1,
|  | float * | offset = nullptr )

protected

try to update the line style given the stroke id and returns the number of lines(plin)

Note
  in case of plin, after retrieving the number of lines, use lineId to define the line's style to set and give a offset pointer to retrieve this line offset

## updateSurfaceColor() [1/2]

bool Canvas5StyleManager::updateSurfaceColor | ( | Canvas5StyleManagerInternal::ColorStyle const & | color,
|  | MWAWGraphicStyle & | style )

try to update the surface color given a color style

Referenced by updateSurfaceColor().

## updateSurfaceColor() [2/2]

bool Canvas5StyleManager::updateSurfaceColor | ( | int | cId,
|  | MWAWGraphicStyle & | style )

protected

try to update the surface color given the color id

## version()

int Canvas5StyleManager::version | ( |  | ) | const

returns the file version

Referenced by readArrow(), readCharStyle(), readCharStyles(), readColorStyle(), readDash(), readGradient(), readHatch(), readParaStyle(), readParaStyles(), readPenStyle(), readStyleEnd(), and readSymbol().

## Friends And Related Symbol Documentation

## Canvas5Graph

friend class Canvas5Graph

friend

Referenced by Canvas5Graph.

## Canvas5Parser

friend class Canvas5Parser

friend

Referenced by Canvas5Parser, and Canvas5StyleManager().

## Member Data Documentation

## m_mainParser

Canvas5Parser* Canvas5StyleManager::m_mainParser

protected

the main parser;

Referenced by Canvas5StyleManager(), getImageParser(), readArrows(), readCharStyle(), readCharStyles(), readDash(), readDashes(), readFonts(), readFrameStyles9(), readGradient(), readHatch(), readInks(), readInks9(), readParaStyle(), readParaStyles(), readPenStyle(), readPenStyles(), readStrokes(), readStyleEnd(), and readSymbol().

## m_parserState

MWAWParserStatePtr Canvas5StyleManager::m_parserState

protected

the parser state

Referenced by Canvas5StyleManager(), readCharStyle(), readFonts(), and version().

## m_state

std::shared_ptr<Canvas5StyleManagerInternal::State> Canvas5StyleManager::m_state

protected

the state

Referenced by Canvas5StyleManager(), readCharStyle(), readDashes(), readFrameStyles9(), readInks9(), updateLineColor(), updateLineStyle(), and updateSurfaceColor().

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

- Canvas5StyleManager.hxx
- Canvas5StyleManager.cxx