Go to the documentation of this file.
22 #ifndef LOTUS_STYLE_MANAGER_H
23 #define LOTUS_STYLE_MANAGER_H
29 #include <librevenge-stream/librevenge-stream.h>
37 struct CellStyleEntry;
95 bool readColorStyle(std::shared_ptr<WPSStream> stream,
long endPos);
99 bool readLineStyle(std::shared_ptr<WPSStream> stream,
long endPos,
int vers);
119 bool readStyleE6(std::shared_ptr<WPSStream> stream,
long endPos);
148 std::shared_ptr<LotusStyleManagerInternal::State>
m_state;
bool getColor8(int cId, WPSColor &color) const
returns if possible the color(id between 0 and 7)
Definition: LotusStyleManager.cpp:619
static WPSColor white()
return the white color
Definition: libwps_internal.h:311
FontName()
constructor
Definition: LotusStyleManager.cpp:53
std::map< int, int > m_idToParentStyleMap
a map style id to the cell style id
Definition: LotusStyleManager.cpp:428
GraphicStyle()
constructor
Definition: LotusStyleManager.cpp:347
small struct used to defined color style
Definition: LotusStyleManager.cpp:67
bool getColor16(int id, WPSColor &color) const
returns a color corresponding to an id between 0 and 15
Definition: LotusStyleManager.cpp:449
WPSCellFormat::Wrapping m_wrapping
the wrapping
Definition: LotusStyleManager.cpp:316
std::map< int, ColorStyle > m_idColorStyleMap
a map id to color style
Definition: LotusStyleManager.cpp:415
bool updateShadowStyle(int colorId, WPSGraphicStyle &style) const
update style using color id for defining shadow
Definition: LotusStyleManager.cpp:879
bool hasPattern() const
returns true if the pattern is defined
Definition: WPSGraphicStyle.h:267
#define WPS_STRIKEOUT_BIT
Definition: libwps_internal.h:507
ColorStyle m_colorStyle
the color style
Definition: LotusStyleManager.cpp:308
int m_borders
the borders
Definition: LotusStyleManager.cpp:297
static std::string str()
Definition: WPSDebug.h:200
#define WPS_BOLD_BIT
Definition: libwps_internal.h:506
Definition: libwps_internal.h:397
static void addPos(long)
Definition: WPSDebug.h:220
float m_width
the line width
Definition: LotusStyleManager.cpp:186
Definition: WPSGraphicStyle.h:45
int m_id
the font id
Definition: LotusStyleManager.cpp:62
float m_gradientAngle
the gradient angle
Definition: WPSGraphicStyle.h:375
std::vector< unsigned char > m_data
the pattern data: a sequence of data: p[0..7,0],p[8..15,0]...p[0..7,1],p[8..15,1],...
Definition: WPSGraphicStyle.h:191
void setShadowColor(WPSColor const &col, float opacity=1)
set the shadow color
Definition: WPSGraphicStyle.h:293
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:322
bool getPattern48(int id, WPSGraphicStyle::Pattern &pattern) const
returns the pattern corresponding to a pattern id between 1 and 48
Definition: LotusStyleManager.cpp:512
LineStyle m_lineStyle
the line style: 123 pc
Definition: LotusStyleManager.cpp:372
#define WPS_UNDERLINE_BIT
Definition: libwps_internal.h:508
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:192
int m_fontId
the font id
Definition: LotusStyleManager.cpp:303
Definition: libwps_internal.h:401
int m_colorsId[4]
the line, shadow, surface, back pattern color id
Definition: LotusStyleManager.cpp:368
bool readGraphicStyle(std::shared_ptr< WPSStream > stream, long endPos)
reads a graphic style
Definition: LotusStyleManager.cpp:906
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:102
WPSGraphicStyle::Pattern m_pattern
the pattern
Definition: LotusStyleManager.cpp:100
std::map< int, LineStyle > m_idLineStyleMap
a map id to line style
Definition: LotusStyleManager.cpp:423
WPSEntry m_entry
the zone position
Definition: LotusStyleManager.cpp:340
bool updateSurfaceStyle(int colorId, WPSGraphicStyle &style) const
update style using color id
Definition: LotusStyleManager.cpp:800
std::shared_ptr< LotusStyleManagerInternal::State > m_state
the internal state
Definition: LotusStyleManager.h:148
int m_width
the border width
Definition: libwps_internal.h:450
This class parses the Lotus style.
Definition: LotusStyleManager.h:47
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition: Lotus.cpp:273
small struct used to defined a font name
Definition: LotusStyleManager.cpp:50
LotusStyleManager & operator=(LotusStyleManager const &orig)=delete
#define WPS_OUTLINE_BIT
Definition: libwps_internal.h:501
bool isWhite() const
return true if the color is white
Definition: libwps_internal.h:350
std::map< int, FontStyle > m_idFontStyleMap
a map id to font style
Definition: LotusStyleManager.cpp:417
Vec2f m_shadowOffset
the shadow offset
Definition: WPSGraphicStyle.h:365
int m_size[2]
the font height, font size
Definition: LotusStyleManager.cpp:64
#define WPS_DOUBLE_UNDERLINE_BIT
Definition: libwps_internal.h:505
define the font properties
Definition: WPSFont.h:36
static WPSColor barycenter(float alpha, WPSColor const &colA, float beta, WPSColor const &colB)
return alpha*colA+beta*colB
Definition: libwps_internal.cpp:386
friend std::ostream & operator<<(std::ostream &o, GraphicStyle const &graphic)
operator<<
Definition: LotusStyleManager.cpp:356
bool valid(bool checkId=false) const
returns true if the zone length is positive
Definition: WPSEntry.h:87
#define WPS_ITALICS_BIT
Definition: libwps_internal.h:502
State()
constructor
Definition: LotusStyleManager.cpp:383
GradientType m_gradientType
the gradient type
Definition: WPSGraphicStyle.h:371
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:702
int m_parentId
the parent style id
Definition: LotusStyleManager.cpp:338
bool updateFontStyle(int fontId, WPSFont &font, libwps_tools_win::Font::Type &fontType)
update a font using the font id
Definition: LotusStyleManager.cpp:1272
bool getPattern48(int id, WPSGraphicStyle::Pattern &pattern) const
returns the pattern corresponding to a pattern id (id between 1 and 48)
Vec2i m_dim
the dimension width x height
Definition: WPSGraphicStyle.h:186
bool readStyleE6(std::shared_ptr< WPSStream > stream, long endPos)
reads a style: fe6 (123)
Definition: LotusStyleManager.cpp:1952
int m_colorsId[2]
the color id : surface, shadow ?
Definition: LotusStyleManager.cpp:301
std::map< int, CellStyle > m_idCellStyleMap
a map id to cell style
Definition: LotusStyleManager.cpp:413
int m_lineId
the border line id
Definition: LotusStyleManager.cpp:370
std::map< int, FormatStyle > m_idFormatStyleMap
a map id to format style
Definition: LotusStyleManager.cpp:419
WPSColor m_color
the border color
Definition: libwps_internal.h:456
WPSColor m_colors[2]
the two indexed colors
Definition: WPSGraphicStyle.h:189
int m_fontId
the font id
Definition: LotusStyleManager.cpp:129
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:704
bool getAverageColor(WPSColor &col) const
return the average color
Definition: WPSGraphicStyle.cpp:61
bool readCellStyleE6(std::shared_ptr< WPSStream > stream, long endPos)
reads a cell style: fe6 (wk4)
Definition: LotusStyleManager.cpp:1765
the state of LotusStyleManager
Definition: LotusStyleManager.cpp:380
bool readMenuStyleE7(std::shared_ptr< WPSStream > stream, long endPos)
reads the list of style: 32e7 (wk4)
Definition: LotusStyleManager.cpp:2259
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:131
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:376
Definition: libwps_internal.h:401
WPSCellFormat::VerticalAlignment m_vAlign
the vertical align
Definition: LotusStyleManager.cpp:314
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:76
This class parses a wk3,wk4,123 Lotus spreadsheet.
Definition: Lotus.h:72
int version() const
return the file version
Definition: Lotus.cpp:265
void setBegin(long off)
sets the begin offset
Definition: WPSEntry.h:55
bool readFMTFontSize(std::shared_ptr< WPSStream > stream)
reads a format font sizes zones 0xaf and 0xb1
Definition: LotusStyleManager.cpp:2207
std::map< int, FontName > m_idFontNameMap
a map id to font name style
Definition: LotusStyleManager.cpp:426
bool getColor8(int id, WPSColor &color) const
returns a color corresponding to an id between 0 and 7
Definition: LotusStyleManager.cpp:433
std::shared_ptr< WPSStream > m_stream
the main strem
Definition: LotusStyleManager.cpp:336
WPSColor m_color
the line color
Definition: LotusStyleManager.cpp:188
WPSFont m_font
the font
Definition: LotusStyleManager.cpp:125
bool readCellStyleD2Data(LotusStyleManagerInternal::CellStyleEntry const &entry, std::set< int > &seen)
really reads the cell style: fd2 (123)
Definition: LotusStyleManager.cpp:1369
int version() const
return the file version
Definition: LotusStyleManager.cpp:612
Definition: libwps_internal.h:397
ColorStyle()
constructor
Definition: LotusStyleManager.cpp:70
Definition: libwps_internal.h:401
a structure used to define a picture style
Definition: WPSGraphicStyle.h:37
uint32_t m_attributes
the font attributes defined as a set of bits
Definition: WPSFont.h:85
static void addNote(char const *)
Definition: WPSDebug.h:221
WPSBorder m_bordersStyle[4]
the cell border
Definition: LotusStyleManager.cpp:320
bool m_isUpdated
a flag to know if updateState was launched
Definition: LotusStyleManager.cpp:411
bool readFMTFontId(std::shared_ptr< WPSStream > stream)
reads a format font id zone: 0xb0
Definition: LotusStyleManager.cpp:2156
long begin() const
returns the begin offset
Definition: WPSEntry.h:71
bool readColorStyle(std::shared_ptr< WPSStream > stream, long endPos)
reads a color style
Definition: LotusStyleManager.cpp:742
CellStyle(libwps_tools_win::Font::Type fontType)
constructor
Definition: LotusStyleManager.cpp:199
WPSColor m_colors[4]
the color id : unknown0, unknown1, line, surface
Definition: LotusStyleManager.cpp:96
Style m_style
the border style
Definition: libwps_internal.h:446
bool readFontStyleF0(std::shared_ptr< WPSStream > stream, long endPos)
reads a font style: ff0 (wk4)
Definition: LotusStyleManager.cpp:1181
libwps_tools_win::Font::Type m_fontType
the font type
Definition: LotusStyleManager.cpp:127
std::vector< GradientStop > m_gradientStopList
the list of gradient limits
Definition: WPSGraphicStyle.h:373
Definition: libwps_internal.h:397
bool getPattern64(int id, WPSGraphicStyle::Pattern &pattern) const
returns the pattern corresponding to a pattern id (id between 1 and 64)
Definition: LotusStyleManager.cpp:634
bool readFontStyleA0(std::shared_ptr< WPSStream > stream, long endPos)
reads a font style: fa0
Definition: LotusStyleManager.cpp:1103
long length() const
returns the length of the zone
Definition: WPSEntry.h:81
std::string m_name
the font name
Definition: LotusStyleManager.cpp:60
bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
returns the font corresponding to an id
Definition: Lotus.cpp:278
small struct used to defined font style
Definition: LotusStyleManager.cpp:106
Definition: WPSDebug.h:191
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
a border list
Definition: libwps_internal.h:394
a structure used to define the gradient limit
Definition: WPSGraphicStyle.h:48
void setSurfaceColor(WPSColor const &col, float opacity=1)
set the surface color
Definition: WPSGraphicStyle.h:251
small struct used to defined cell style file entry
Definition: LotusStyleManager.cpp:326
void updateState()
update the state (need to be called before asking for style)
Definition: LotusStyleManager.cpp:595
std::map< int, CellStyleEntry > m_idToCellStyleEntryMap
a map cell style id to the cell style entry
Definition: LotusStyleManager.cpp:430
int m_version
the file version
Definition: LotusStyleManager.cpp:409
void setEnd(long e)
sets the end offset
Definition: WPSEntry.h:65
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
~LotusStyleManager()
destructor
Definition: LotusStyleManager.cpp:586
bool updateCellStyle(int cellId, WPSCellFormat &format, WPSFont &font, libwps_tools_win::Font::Type &fontType)
update a cell format using the cell id
Definition: LotusStyleManager.cpp:2003
WPSColor m_lineColor
the line color
Definition: WPSGraphicStyle.h:352
int m_formatId
the format id
Definition: LotusStyleManager.cpp:305
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: WPSGraphicStyle.h:272
Definition: libwps_internal.h:399
LineStyle()
constructor
Definition: LotusStyleManager.cpp:166
LotusStyleManager(LotusParser &parser)
constructor
Definition: LotusStyleManager.cpp:580
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
friend std::ostream & operator<<(std::ostream &o, FontStyle const &font)
operator<<
Definition: LotusStyleManager.cpp:117
bool empty() const
return true if we does not have a pattern
Definition: WPSGraphicStyle.h:116
Definition: libwps_internal.h:401
FontStyle(libwps_tools_win::Font::Type fontType)
constructor
Definition: LotusStyleManager.cpp:109
void cleanState()
clean internal state
Definition: LotusStyleManager.cpp:590
Type m_type
the border repetition
Definition: libwps_internal.h:448
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
int m_rotation
the rotation
Definition: LotusStyleManager.cpp:318
FontStyle m_fontStyle
the font style
Definition: LotusStyleManager.cpp:310
Definition: libwps_internal.h:397
LotusParser & m_mainParser
the main parser
Definition: LotusStyleManager.h:146
int m_bordersId[4]
the border line id
Definition: LotusStyleManager.cpp:299
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
bool readFMTFontName(std::shared_ptr< WPSStream > stream)
reads a format font name: zones 0xae
Definition: LotusStyleManager.cpp:2093
a basic pattern used in a WPSGraphicStyle:
Definition: WPSGraphicStyle.h:88
the class to store a color
Definition: libwps_internal.h:280
bool readCellStyleD2(std::shared_ptr< WPSStream > stream, long endPos)
reads a cell style: fd2 (mac 123 or 123)
Definition: LotusStyleManager.cpp:1635
std::map< int, GraphicStyle > m_idGraphicStyleMap
a map id to graphic style
Definition: LotusStyleManager.cpp:421
#define WPS_SHADOW_BIT
Definition: libwps_internal.h:503
int m_dashId
the dash id
Definition: LotusStyleManager.cpp:190
Definition: libwps_internal.h:397
bool updateGraphicStyle(int graphicId, WPSGraphicStyle &style) const
update style using graphic id
Definition: LotusStyleManager.cpp:1076
CellStyleEntry(std::shared_ptr< WPSStream > const &stream)
constructor
Definition: LotusStyleManager.cpp:329
bool readFormatStyle(std::shared_ptr< WPSStream > stream, long endPos)
reads a format style
Definition: LotusStyleManager.cpp:1292
small struct used to defined cell style
Definition: LotusStyleManager.cpp:196
WPSCellFormat::HorizontalAlignment m_hAlign
the horizontal align
Definition: LotusStyleManager.cpp:312
Definition: WPSDebug.h:207
int m_patternId
the patten id: 123 pc
Definition: LotusStyleManager.cpp:374
bool getPattern64(int id, WPSGraphicStyle::Pattern &pattern) const
returns the pattern corresponding to a pattern id between 1 and 64
Definition: LotusStyleManager.cpp:539
bool readLineStyle(std::shared_ptr< WPSStream > stream, long endPos, int vers)
reads a line style
Definition: LotusStyleManager.cpp:642
Definition: LotusStyleManager.cpp:47
float m_lineWidth
the linewidth
Definition: WPSGraphicStyle.h:342
friend std::ostream & operator<<(std::ostream &o, CellStyle const &cell)
operator<<
Definition: LotusStyleManager.cpp:219
friend std::ostream & operator<<(std::ostream &o, ColorStyle const &color)
operator<<
Definition: LotusStyleManager.cpp:79
bool getColor16(int cId, WPSColor &color) const
returns if possible the color(id between 0 and 15)
Definition: LotusStyleManager.cpp:624
bool getUniqueColor(WPSColor &col) const
check if the pattern has only one color; if so returns true...
Definition: WPSGraphicStyle.cpp:45
void setPattern(Pattern const &pat)
set the pattern
Definition: WPSGraphicStyle.h:262
Pattern m_pattern
the pattern if it exists
Definition: WPSGraphicStyle.h:368
static WPSColor black()
return the back color
Definition: libwps_internal.h:306
small struct used to defined line style
Definition: LotusStyleManager.cpp:163
friend std::ostream & operator<<(std::ostream &o, LineStyle const &line)
operator<<
Definition: LotusStyleManager.cpp:174
bool isBlack() const
return true if the color is black
Definition: libwps_internal.h:345
librevenge::RVNGString m_name
font name
Definition: WPSFont.h:81
bool updateLineStyle(int lineId, WPSGraphicStyle &style) const
update style using line id
Definition: LotusStyleManager.cpp:727
small struct used to defined graphic style
Definition: LotusStyleManager.cpp:344
bool getColor256(int cId, WPSColor &color) const
returns if possible the color(id between 0 and 255)
Definition: LotusStyleManager.cpp:629
bool readGraphicStyleC9(std::shared_ptr< WPSStream > stream, long endPos)
reads a graphic style: fc9, lotus123
Definition: LotusStyleManager.cpp:978
bool getColor256(int id, WPSColor &color) const
returns a color corresponding to an id
Definition: LotusStyleManager.cpp:465
int m_patternId
the pattern id
Definition: LotusStyleManager.cpp:98
Generated on Sat Oct 6 2018 17:10:15 for libwps by
doxygen 1.8.16