LotusStyleManager Class Reference

This class parses the Lotus style. More...

#include <LotusStyleManager.h>

Public Member Functions

 LotusStyleManager (LotusParser &parser)
 constructor
 
 ~LotusStyleManager ()
 destructor
 
void cleanState ()
 clean internal state
 
void updateState ()
 update the state (need to be called before asking for style)
 
bool getColor8 (int cId, WPSColor &color) const
 returns if possible the color(id between 0 and 7)
 
bool getColor16 (int cId, WPSColor &color) const
 returns if possible the color(id between 0 and 15)
 
bool getColor256 (int cId, WPSColor &color) const
 returns if possible the color(id between 0 and 255)
 
bool getPattern48 (int id, WPSGraphicStyle::Pattern &pattern) const
 returns the pattern corresponding to a pattern id (id between 1 and 48)
 
bool getPattern64 (int id, WPSGraphicStyle::Pattern &pattern) const
 returns the pattern corresponding to a pattern id (id between 1 and 64)
 
bool updateCellStyle (int cellId, WPSCellFormat &format, WPSFont &font, libwps_tools_win::Font::Type &fontType)
 update a cell format using the cell id
 
bool updateFontStyle (int fontId, WPSFont &font, libwps_tools_win::Font::Type &fontType)
 update a font using the font id
 
bool updateLineStyle (int lineId, WPSGraphicStyle &style) const
 update style using line id
 
bool updateSurfaceStyle (int colorId, WPSGraphicStyle &style) const
 update style using color id
 
bool updateGraphicStyle (int graphicId, WPSGraphicStyle &style) const
 update style using graphic id
 
bool updateSurfaceStyle (int fColorId, int bColorId, int patternId, WPSGraphicStyle &style) const
 update style using front/back color and pattern id
 

Protected Member Functions

int version () const
 return the file version
 
bool readColorStyle (std::shared_ptr< WPSStream > stream, long endPos)
 reads a color style
 
bool readFormatStyle (std::shared_ptr< WPSStream > stream, long endPos)
 reads a format style
 
bool readLineStyle (std::shared_ptr< WPSStream > stream, long endPos, int vers)
 reads a line style
 
bool readGraphicStyle (std::shared_ptr< WPSStream > stream, long endPos)
 reads a graphic style
 
bool readGraphicStyleC9 (std::shared_ptr< WPSStream > stream, long endPos)
 reads a graphic style: fc9, lotus123
 
bool readFontStyleA0 (std::shared_ptr< WPSStream > stream, long endPos)
 reads a font style: fa0
 
bool readFontStyleF0 (std::shared_ptr< WPSStream > stream, long endPos)
 reads a font style: ff0 (wk4)
 
bool readCellStyleD2 (std::shared_ptr< WPSStream > stream, long endPos)
 reads a cell style: fd2 (mac 123 or 123)
 
bool readCellStyleE6 (std::shared_ptr< WPSStream > stream, long endPos)
 reads a cell style: fe6 (wk4)
 
bool readStyleE6 (std::shared_ptr< WPSStream > stream, long endPos)
 reads a style: fe6 (123)
 
bool readFMTFontName (std::shared_ptr< WPSStream > stream)
 reads a format font name: zones 0xae
 
bool readFMTFontSize (std::shared_ptr< WPSStream > stream)
 reads a format font sizes zones 0xaf and 0xb1
 
bool readFMTFontId (std::shared_ptr< WPSStream > stream)
 reads a format font id zone: 0xb0
 
bool updateShadowStyle (int colorId, WPSGraphicStyle &style) const
 update style using color id for defining shadow
 
bool readCellStyleD2Data (LotusStyleManagerInternal::CellStyleEntry const &entry, std::set< int > &seen)
 really reads the cell style: fd2 (123)
 

Static Protected Member Functions

static bool readMenuStyleE7 (std::shared_ptr< WPSStream > stream, long endPos)
 reads the list of style: 32e7 (wk4)
 

Private Member Functions

 LotusStyleManager (LotusStyleManager const &orig)=delete
 
LotusStyleManageroperator= (LotusStyleManager const &orig)=delete
 

Private Attributes

LotusParserm_mainParser
 the main parser
 
std::shared_ptr< LotusStyleManagerInternal::Statem_state
 the internal state
 

Friends

class LotusParser
 

Detailed Description

This class parses the Lotus style.

Constructor & Destructor Documentation

◆ LotusStyleManager() [1/2]

LotusStyleManager::LotusStyleManager ( LotusParser parser)
explicit

constructor

◆ ~LotusStyleManager()

LotusStyleManager::~LotusStyleManager ( )

destructor

◆ LotusStyleManager() [2/2]

LotusStyleManager::LotusStyleManager ( LotusStyleManager const &  orig)
privatedelete

Member Function Documentation

◆ cleanState()

void LotusStyleManager::cleanState ( )

clean internal state

◆ getColor16()

bool LotusStyleManager::getColor16 ( int  cId,
WPSColor color 
) const

returns if possible the color(id between 0 and 15)

Referenced by readCellStyleE6().

◆ getColor256()

bool LotusStyleManager::getColor256 ( int  cId,
WPSColor color 
) const

returns if possible the color(id between 0 and 255)

Referenced by readCellStyleE6(), readFontStyleA0(), readFontStyleF0(), readGraphicStyleC9(), and updateSurfaceStyle().

◆ getColor8()

bool LotusStyleManager::getColor8 ( int  cId,
WPSColor color 
) const

returns if possible the color(id between 0 and 7)

◆ getPattern48()

bool LotusStyleManager::getPattern48 ( int  id,
WPSGraphicStyle::Pattern pattern 
) const

returns the pattern corresponding to a pattern id (id between 1 and 48)

Referenced by updateCellStyle().

◆ getPattern64()

bool LotusStyleManager::getPattern64 ( int  id,
WPSGraphicStyle::Pattern pattern 
) const

returns the pattern corresponding to a pattern id (id between 1 and 64)

Referenced by updateSurfaceStyle().

◆ operator=()

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

◆ readCellStyleD2()

bool LotusStyleManager::readCellStyleD2 ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a cell style: fd2 (mac 123 or 123)

◆ readCellStyleD2Data()

bool LotusStyleManager::readCellStyleD2Data ( LotusStyleManagerInternal::CellStyleEntry const &  entry,
std::set< int > &  seen 
)
protected

really reads the cell style: fd2 (123)

\note this function normally called when all the styles are read, so it can reliably recover its data

Referenced by readCellStyleD2(), readCellStyleD2Data(), and updateCellStyle().

◆ readCellStyleE6()

bool LotusStyleManager::readCellStyleE6 ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a cell style: fe6 (wk4)

◆ readColorStyle()

bool LotusStyleManager::readColorStyle ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a color style

◆ readFMTFontId()

bool LotusStyleManager::readFMTFontId ( std::shared_ptr< WPSStream stream)
protected

reads a format font id zone: 0xb0

◆ readFMTFontName()

bool LotusStyleManager::readFMTFontName ( std::shared_ptr< WPSStream stream)
protected

reads a format font name: zones 0xae

◆ readFMTFontSize()

bool LotusStyleManager::readFMTFontSize ( std::shared_ptr< WPSStream stream)
protected

reads a format font sizes zones 0xaf and 0xb1

◆ readFontStyleA0()

bool LotusStyleManager::readFontStyleA0 ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a font style: fa0

◆ readFontStyleF0()

bool LotusStyleManager::readFontStyleF0 ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a font style: ff0 (wk4)

◆ readFormatStyle()

bool LotusStyleManager::readFormatStyle ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a format style

◆ readGraphicStyle()

bool LotusStyleManager::readGraphicStyle ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a graphic style

◆ readGraphicStyleC9()

bool LotusStyleManager::readGraphicStyleC9 ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a graphic style: fc9, lotus123

◆ readLineStyle()

bool LotusStyleManager::readLineStyle ( std::shared_ptr< WPSStream stream,
long  endPos,
int  vers 
)
protected

reads a line style

◆ readMenuStyleE7()

bool LotusStyleManager::readMenuStyleE7 ( std::shared_ptr< WPSStream stream,
long  endPos 
)
staticprotected

reads the list of style: 32e7 (wk4)

◆ readStyleE6()

bool LotusStyleManager::readStyleE6 ( std::shared_ptr< WPSStream stream,
long  endPos 
)
protected

reads a style: fe6 (123)

◆ updateCellStyle()

bool LotusStyleManager::updateCellStyle ( int  cellId,
WPSCellFormat format,
WPSFont font,
libwps_tools_win::Font::Type fontType 
)

update a cell format using the cell id

◆ updateFontStyle()

bool LotusStyleManager::updateFontStyle ( int  fontId,
WPSFont font,
libwps_tools_win::Font::Type fontType 
)

update a font using the font id

Referenced by readCellStyleE6(), and updateCellStyle().

◆ updateGraphicStyle()

bool LotusStyleManager::updateGraphicStyle ( int  graphicId,
WPSGraphicStyle style 
) const

update style using graphic id

◆ updateLineStyle()

bool LotusStyleManager::updateLineStyle ( int  lineId,
WPSGraphicStyle style 
) const

update style using line id

Referenced by updateGraphicStyle().

◆ updateShadowStyle()

bool LotusStyleManager::updateShadowStyle ( int  colorId,
WPSGraphicStyle style 
) const
protected

update style using color id for defining shadow

Referenced by updateGraphicStyle().

◆ updateState()

void LotusStyleManager::updateState ( )

update the state (need to be called before asking for style)

◆ updateSurfaceStyle() [1/2]

bool LotusStyleManager::updateSurfaceStyle ( int  colorId,
WPSGraphicStyle style 
) const

update style using color id

Referenced by updateGraphicStyle().

◆ updateSurfaceStyle() [2/2]

bool LotusStyleManager::updateSurfaceStyle ( int  fColorId,
int  bColorId,
int  patternId,
WPSGraphicStyle style 
) const

update style using front/back color and pattern id

◆ version()

int LotusStyleManager::version ( ) const
protected

return the file version

Referenced by readCellStyleD2(), updateCellStyle(), updateGraphicStyle(), and updateSurfaceStyle().

Friends And Related Symbol Documentation

◆ LotusParser

friend class LotusParser
friend

Member Data Documentation

◆ m_mainParser

LotusParser& LotusStyleManager::m_mainParser
private

◆ m_state


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

Generated on Thu Jul 20 2023 00:00:00 for libwps by doxygen 1.9.7