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 More...
 
virtual ~Canvas5StyleManager ()
 destructor More...
 
int version () const
 returns the file version More...
 
std::shared_ptr< Canvas5ImagegetImageParser () const
 returns the image parser More...
 
std::shared_ptr< Canvas5StyleManagerInternal::ColorStylereadColorStyle (std::shared_ptr< Canvas5Structure::Stream > stream, unsigned type, long len)
 try to read a color style More...
 
bool updateLineColor (Canvas5StyleManagerInternal::ColorStyle const &color, MWAWGraphicStyle &style)
 try to update the line color given a color style More...
 
bool updateSurfaceColor (Canvas5StyleManagerInternal::ColorStyle const &color, MWAWGraphicStyle &style)
 try to update the surface color given a color style More...
 
std::shared_ptr< Canvas5StyleManagerInternal::PenStylereadPenStyle (Canvas5Structure::Stream &stream, unsigned type, long len)
 try to read a pen style More...
 
bool updateLine (Canvas5StyleManagerInternal::PenStyle const &pen, MWAWGraphicStyle &style, int &numLines, int lineId, float *offset)
 try to update the line color given a color style More...
 
bool readArrow (std::shared_ptr< Canvas5Structure::Stream > stream, MWAWGraphicStyle::Arrow &arrow, unsigned type, long len)
 try to read an arrow More...
 
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 More...
 
bool readDash (Canvas5Structure::Stream &stream, std::vector< float > &dashes, unsigned type, long len)
 try to read a dash's array More...
 
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, ... More...
 

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

Protected Attributes

MWAWParserStatePtr m_parserState
 the parser state More...
 
std::shared_ptr< Canvas5StyleManagerInternal::Statem_state
 the state More...
 
Canvas5Parserm_mainParser
 the main parser; More...
 

Private Member Functions

 Canvas5StyleManager (Canvas5StyleManager const &orig)=delete
 
Canvas5StyleManageroperator= (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

◆ ~Canvas5StyleManager()

Canvas5StyleManager::~Canvas5StyleManager ( )
virtual

destructor

◆ Canvas5StyleManager() [2/2]

Canvas5StyleManager::Canvas5StyleManager ( Canvas5StyleManager const &  orig)
privatedelete

Member Function Documentation

◆ getImageParser()

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

returns the image parser

Referenced by readArrow(), and readColorStyle().

◆ operator=()

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

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

◆ 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

Friends And Related Function Documentation

◆ Canvas5Graph

friend class Canvas5Graph
friend

◆ Canvas5Parser

friend class Canvas5Parser
friend

Member Data Documentation

◆ m_mainParser

◆ m_parserState

MWAWParserStatePtr Canvas5StyleManager::m_parserState
protected

the parser state

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

◆ m_state

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

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

Generated for libmwaw by doxygen 1.8.14