LotusStyleManager Class Reference

This class parses the Lotus style. More...

#include <LotusStyleManager.h>

Public Member Functions

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

Protected Member Functions

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

Private Member Functions

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

Private Attributes

LotusParserm_mainParser
 the main parser More...
 
shared_ptr
< LotusStyleManagerInternal::State
m_state
 the internal state More...
 

Friends

class LotusParser
 

Detailed Description

This class parses the Lotus style.

Constructor & Destructor Documentation

LotusStyleManager::LotusStyleManager ( LotusParser parser)
explicit

constructor

LotusStyleManager::~LotusStyleManager ( )

destructor

LotusStyleManager::LotusStyleManager ( LotusStyleManager const &  orig)
private

Member Function Documentation

void LotusStyleManager::cleanState ( )

clean internal state

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

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

Referenced by readCellStyleE6().

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().

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

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

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

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

Referenced by updateCellStyle().

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

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

Referenced by updateSurfaceStyle().

LotusStyleManager& LotusStyleManager::operator= ( LotusStyleManager const &  orig)
private
bool LotusStyleManager::readCellStyleD2 ( shared_ptr< WPSStream stream,
long  endPos 
)
protected

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

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

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

reads a cell style: fe6 (wk4)

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

reads a color style

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

reads a format font id zone: 0xb0

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

reads a format font name: zones 0xae

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

reads a format font sizes zones 0xaf and 0xb1

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

reads a font style: fa0

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

reads a font style: ff0 (wk4)

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

reads a format style

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

reads a graphic style

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

reads a graphic style: fc9, lotus123

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

reads a line style

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

reads the list of style: 32e7 (wk4)

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

reads a style: fe6 (123)

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

update a cell format using the cell id

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().

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

update style using graphic id

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

update style using line id

Referenced by updateGraphicStyle().

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

update style using color id for defining shadow

Referenced by updateGraphicStyle().

void LotusStyleManager::updateState ( )

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

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

update style using color id

Referenced by updateGraphicStyle().

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

update style using front/back color and pattern id

int LotusStyleManager::version ( ) const
protected

return the file version

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

Friends And Related Function Documentation

friend class LotusParser
friend

Member Data Documentation

LotusParser& LotusStyleManager::m_mainParser
private

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

Generated on Wed Apr 11 2018 00:19:13 for libwps by doxygen 1.8.5