Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
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 | 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 | 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 | readColorStyle (std::shared_ptr< WPSStream > stream, long endPos)
| reads a color style More...
bool | readFormatStyle (std::shared_ptr< WPSStream > stream, long endPos)
| reads a format style More...
bool | readLineStyle (std::shared_ptr< WPSStream > stream, long endPos, int vers)
| reads a line style More...
bool | readGraphicStyle (std::shared_ptr< WPSStream > stream, long endPos)
| reads a graphic style More...
bool | readGraphicStyleC9 (std::shared_ptr< WPSStream > stream, long endPos)
| reads a graphic style: fc9, lotus123 More...
bool | readFontStyleA0 (std::shared_ptr< WPSStream > stream, long endPos)
| reads a font style: fa0 More...
bool | readFontStyleF0 (std::shared_ptr< WPSStream > stream, long endPos)
| reads a font style: ff0 (wk4) More...
bool | readCellStyleD2 (std::shared_ptr< WPSStream > stream, long endPos)
| reads a cell style: fd2 (mac 123 or 123) More...
bool | readCellStyleE6 (std::shared_ptr< WPSStream > stream, long endPos)
| reads a cell style: fe6 (wk4) More...
bool | readMenuStyleE7 (std::shared_ptr< WPSStream > stream, long endPos)
| reads the list of style: 32e7 (wk4) More...
bool | readStyleE6 (std::shared_ptr< WPSStream > stream, long endPos)
| reads a style: fe6 (123) More...
bool | readFMTFontName (std::shared_ptr< WPSStream > stream)
| reads a format font name: zones 0xae More...
bool | readFMTFontSize (std::shared_ptr< WPSStream > stream)
| reads a format font sizes zones 0xaf and 0xb1 More...
bool | readFMTFontId (std::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)=delete
LotusStyleManager & | operator= (LotusStyleManager const &orig)=delete

## Private Attributes
LotusParser & | m_mainParser
| the main parser More...
std::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() [1/2]

LotusStyleManager::LotusStyleManager | ( | LotusParser & | parser | ) |
| explicit

constructor

## ◆ ~LotusStyleManager()

LotusStyleManager::~LotusStyleManager | ( |  | ) |

destructor

## ◆ LotusStyleManager() [2/2]

LotusStyleManager::LotusStyleManager | ( | LotusStyleManager const & | orig | ) |
| private delete

## 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 | ) |
| private delete

## ◆ 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(), 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
| ) |  |
| protected

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 Function Documentation

## ◆ LotusParser

friend class LotusParser
| friend

## Member Data Documentation

## ◆ m_mainParser

LotusParser& LotusStyleManager::m_mainParser
| private

the main parser

Referenced by readCellStyleD2(), readCellStyleD2Data(), readCellStyleE6(), readFontStyleA0(), readFontStyleF0(), updateState(), and version().

## ◆ m_state

std::shared_ptr<LotusStyleManagerInternal::State> LotusStyleManager::m_state
| private

the internal state

Referenced by cleanState(), getColor16(), getColor256(), getColor8(), getPattern64(), readCellStyleD2(), readCellStyleD2Data(), readCellStyleE6(), readColorStyle(), readFMTFontId(), readFMTFontName(), readFMTFontSize(), readFontStyleA0(), readFontStyleF0(), readFormatStyle(), readGraphicStyle(), readGraphicStyleC9(), readLineStyle(), readStyleE6(), updateCellStyle(), updateFontStyle(), updateGraphicStyle(), updateLineStyle(), updateShadowStyle(), updateState(), updateSurfaceStyle(), and version().

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

- LotusStyleManager.h
- LotusStyleManager.cpp