LotusStyleManager.h Source File documentation

LotusStyleManager.h
Go to the documentation of this file.
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: t; c-basic-offset: 4 -*- */
2 /* libwps
3 * Version: MPL 2.0 / LGPLv2.1+
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * Major Contributor(s):
10 * Copyright (C) 2006, 2007 Andrew Ziem
11 * Copyright (C) 2003-2005 William Lachance (william.lachance@sympatico.ca)
12 * Copyright (C) 2003 Marc Maurer (uwog@uwog.net)
13 *
14 * For minor contributions see the git repository.
15 *
16 * Alternatively, the contents of this file may be used under the terms
17 * of the GNU Lesser General Public License Version 2.1 or later
18 * (LGPLv2.1+), in which case the provisions of the LGPLv2.1+ are
19 * applicable instead of those above.
20 */
21
22 #ifndef LOTUS_STYLE_MANAGER_H
23 #define LOTUS_STYLE_MANAGER_H
24
25 #include <ostream>
26 #include <set>
27 #include <vector>
28
29 #include <librevenge-stream/librevenge-stream.h>
30
31 #include "libwps_internal.h"
32
33 #include "WPSDebug.h"
34
35 namespace LotusStyleManagerInternal
36 {
37 struct CellStyleEntry;
38 struct State;
39 }
40
41 class LotusParser;
42
47 class LotusStyleManager
48 {
49 public:
50 friend class LotusParser;
51
53 explicit LotusStyleManager(LotusParser &parser);
55 ~LotusStyleManager();
57 void cleanState();
59 void updateState();
60
62 bool getColor8(int cId, WPSColor &color) const;
64 bool getColor16(int cId, WPSColor &color) const;
66 bool getColor256(int cId, WPSColor &color) const;
67
69 bool getPattern48(int id, WPSGraphicStyle::Pattern &pattern) const;
71 bool getPattern64(int id, WPSGraphicStyle::Pattern &pattern) const;
72
74 bool updateCellStyle(int cellId, WPSCellFormat &format,
75 WPSFont &font, libwps_tools_win::Font::Type &fontType);
77 bool updateFontStyle(int fontId, WPSFont &font, libwps_tools_win::Font::Type &fontType);
79 bool updateLineStyle(int lineId, WPSGraphicStyle &style) const;
81 bool updateSurfaceStyle(int colorId, WPSGraphicStyle &style) const;
83 bool updateGraphicStyle(int graphicId, WPSGraphicStyle &style) const;
85 bool updateSurfaceStyle(int fColorId, int bColorId, int patternId, WPSGraphicStyle &style) const;
86 protected:
88 int version() const;
89
90 //
91 // low level
92 //
93
95 bool readColorStyle(std::shared_ptr<WPSStream> stream, long endPos);
97 bool readFormatStyle(std::shared_ptr<WPSStream> stream, long endPos);
99 bool readLineStyle(std::shared_ptr<WPSStream> stream, long endPos, int vers);
101 bool readGraphicStyle(std::shared_ptr<WPSStream> stream, long endPos);
103 bool readGraphicStyleC9(std::shared_ptr<WPSStream> stream, long endPos);
104
105 // 1b style
106
108 bool readFontStyleA0(std::shared_ptr<WPSStream> stream, long endPos);
110 bool readFontStyleF0(std::shared_ptr<WPSStream> stream, long endPos);
112 bool readCellStyleD2(std::shared_ptr<WPSStream> stream, long endPos);
114 bool readCellStyleE6(std::shared_ptr<WPSStream> stream, long endPos);
115
117 static bool readMenuStyleE7(std::shared_ptr<WPSStream> stream, long endPos);
119 bool readStyleE6(std::shared_ptr<WPSStream> stream, long endPos);
120
121 // old fmt style
122
124 bool readFMTFontName(std::shared_ptr<WPSStream> stream);
126 bool readFMTFontSize(std::shared_ptr<WPSStream> stream);
128 bool readFMTFontId(std::shared_ptr<WPSStream> stream);
129
131 bool updateShadowStyle(int colorId, WPSGraphicStyle &style) const;
132
133 //
134 // low level
135 //
136
141 bool readCellStyleD2Data(LotusStyleManagerInternal::CellStyleEntry const &entry, std::set<int> &seen);
142 private:
143 LotusStyleManager(LotusStyleManager const &orig) = delete;
144 LotusStyleManager &operator=(LotusStyleManager const &orig) = delete;
146 LotusParser &m_mainParser;
148 std::shared_ptr<LotusStyleManagerInternal::State> m_state;
149 };
150
151 #endif /* LOTUS_STYLE_MANAGER_H */
152 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
LotusStyleManager::getColor8
bool getColor8(int cId, WPSColor &color) const
returns if possible the color(id between 0 and 7)
Definition: LotusStyleManager.cpp:621
WPSColor::white
static WPSColor white()
return the white color
Definition: libwps_internal.h:311
LotusStyleManagerInternal::FontName::FontName
FontName()
constructor
Definition: LotusStyleManager.cpp:53
WPSCellFormat::VALIGN_DEFAULT
@ VALIGN_DEFAULT
Definition: WPSCell.h:50
LotusStyleManagerInternal::State::m_idToParentStyleMap
std::map< int, int > m_idToParentStyleMap
a map style id to the cell style id
Definition: LotusStyleManager.cpp:430
LotusStyleManagerInternal::GraphicStyle::GraphicStyle
GraphicStyle()
constructor
Definition: LotusStyleManager.cpp:349
LotusStyleManagerInternal::ColorStyle
small struct used to defined color style
Definition: LotusStyleManager.cpp:67
LotusStyleManagerInternal::FormatStyle::m_suffix
std::string m_suffix
the suffix
Definition: LotusStyleManager.cpp:157
LotusStyleManagerInternal::CellStyle::m_wrapping
WPSCellFormat::Wrapping m_wrapping
the wrapping
Definition: LotusStyleManager.cpp:318
LotusStyleManagerInternal::State::m_idColorStyleMap
std::map< int, ColorStyle > m_idColorStyleMap
a map id to color style
Definition: LotusStyleManager.cpp:417
LotusStyleManager::updateShadowStyle
bool updateShadowStyle(int colorId, WPSGraphicStyle &style) const
update style using color id for defining shadow
Definition: LotusStyleManager.cpp:881
WPSGraphicStyle::hasPattern
bool hasPattern() const
returns true if the pattern is defined
Definition: WPSGraphicStyle.h:270
WPS_STRIKEOUT_BIT
#define WPS_STRIKEOUT_BIT
Definition: libwps_internal.h:507
LotusStyleManagerInternal::CellStyle::m_colorStyle
ColorStyle m_colorStyle
the color style
Definition: LotusStyleManager.cpp:310
LotusStyleManagerInternal::CellStyle::m_borders
int m_borders
the borders
Definition: LotusStyleManager.cpp:299
libwps::DebugStream::str
static std::string str()
Definition: WPSDebug.h:200
WPSCellFormat::HALIGN_FULL
@ HALIGN_FULL
Definition: WPSCell.h:47
WPS_BOLD_BIT
#define WPS_BOLD_BIT
Definition: libwps_internal.h:506
WPSCellFormat::VALIGN_CENTER
@ VALIGN_CENTER
Definition: WPSCell.h:50
WPSBorder::Simple
@ Simple
Definition: libwps_internal.h:397
libwps::DebugFile::addPos
static void addPos(long)
Definition: WPSDebug.h:220
LotusStyleManagerInternal::State::getPattern64
static bool getPattern64(int id, WPSGraphicStyle::Pattern &pattern)
returns the pattern corresponding to a pattern id between 1 and 64
Definition: LotusStyleManager.cpp:541
WPSCellFormat::WRAP_WRAP
@ WRAP_WRAP
Definition: WPSCell.h:52
WPSCell.h
LotusStyleManagerInternal::LineStyle::m_width
float m_width
the line width
Definition: LotusStyleManager.cpp:186
WPSGraphicStyle::G_Linear
@ G_Linear
Definition: WPSGraphicStyle.h:45
WPSCellFormat::setVAlignment
void setVAlignment(VerticalAlignment align)
sets the vertical alignement
Definition: WPSCell.h:125
LotusStyleManagerInternal::FontName::m_id
int m_id
the font id
Definition: LotusStyleManager.cpp:62
WPSGraphicStyle::m_gradientAngle
float m_gradientAngle
the gradient angle
Definition: WPSGraphicStyle.h:378
libwps_tools_win::Font::Type
Type
enum Type
Definition: libwps_tools_win.h:46
WPSGraphicStyle::Pattern::m_data
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:192
WPSCellFormat::WRAP_DEFAULT
@ WRAP_DEFAULT
Definition: WPSCell.h:52
WPSGraphicStyle::setShadowColor
void setShadowColor(WPSColor const &col, float opacity=1)
set the shadow color
Definition: WPSGraphicStyle.h:296
LotusStyleManagerInternal::FormatStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, FormatStyle const &format)
operator<<
Definition: LotusStyleManager.cpp:145
LotusStyleManagerInternal::CellStyle::m_extra
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:324
LotusStyleManagerInternal::GraphicStyle::m_lineStyle
LineStyle m_lineStyle
the line style: 123 pc
Definition: LotusStyleManager.cpp:374
WPS_UNDERLINE_BIT
#define WPS_UNDERLINE_BIT
Definition: libwps_internal.h:508
LotusStyleManagerInternal::LineStyle::m_extra
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:192
WPSCellFormat::HALIGN_DEFAULT
@ HALIGN_DEFAULT
Definition: WPSCell.h:47
LotusStyleManagerInternal::CellStyle::m_fontId
int m_fontId
the font id
Definition: LotusStyleManager.cpp:305
WPSBorder::BottomBit
@ BottomBit
Definition: libwps_internal.h:401
LotusStyleManagerInternal::State::getColor8
static bool getColor8(int id, WPSColor &color)
returns a color corresponding to an id between 0 and 7
Definition: LotusStyleManager.cpp:435
LotusStyleManagerInternal::GraphicStyle::m_colorsId
int m_colorsId[4]
the line, shadow, surface, back pattern color id
Definition: LotusStyleManager.cpp:370
LotusStyleManager::readGraphicStyle
bool readGraphicStyle(std::shared_ptr< WPSStream > stream, long endPos)
reads a graphic style
Definition: LotusStyleManager.cpp:908
LotusStyleManagerInternal::ColorStyle::m_extra
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:102
LotusStyleManagerInternal::ColorStyle::m_pattern
WPSGraphicStyle::Pattern m_pattern
the pattern
Definition: LotusStyleManager.cpp:100
LotusStyleManagerInternal::State::m_idLineStyleMap
std::map< int, LineStyle > m_idLineStyleMap
a map id to line style
Definition: LotusStyleManager.cpp:425
LotusStyleManagerInternal::CellStyleEntry::m_entry
WPSEntry m_entry
the zone position
Definition: LotusStyleManager.cpp:342
LotusStyleManager::updateSurfaceStyle
bool updateSurfaceStyle(int colorId, WPSGraphicStyle &style) const
update style using color id
Definition: LotusStyleManager.cpp:802
LotusStyleManager::m_state
std::shared_ptr< LotusStyleManagerInternal::State > m_state
the internal state
Definition: LotusStyleManager.h:148
WPSBorder::m_width
int m_width
the border width
Definition: libwps_internal.h:450
LotusStyleManager
This class parses the Lotus style.
Definition: LotusStyleManager.h:47
libwps_tools_win::Font::unicodeString
static librevenge::RVNGString unicodeString(const unsigned char *p, unsigned long size, Type type, bool skipUnknown=true)
converts a list of character in unicode
Definition: libwps_tools_win.cpp:7283
WPSCellFormat::setTextRotation
void setTextRotation(int rotation)
sets the text rotation angle
Definition: WPSCell.h:146
LotusParser::getDefaultFontType
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition: Lotus.cpp:273
LotusStyleManagerInternal::FontName
small struct used to defined a font name
Definition: LotusStyleManager.cpp:50
LotusStyleManager::operator=
LotusStyleManager & operator=(LotusStyleManager const &orig)=delete
WPS_OUTLINE_BIT
#define WPS_OUTLINE_BIT
Definition: libwps_internal.h:501
WPSColor::isWhite
bool isWhite() const
return true if the color is white
Definition: libwps_internal.h:350
LotusStyleManagerInternal::State::m_idFontStyleMap
std::map< int, FontStyle > m_idFontStyleMap
a map id to font style
Definition: LotusStyleManager.cpp:419
WPSGraphicStyle::m_shadowOffset
Vec2f m_shadowOffset
the shadow offset
Definition: WPSGraphicStyle.h:368
LotusStyleManagerInternal::FontName::m_size
int m_size[2]
the font height, font size
Definition: LotusStyleManager.cpp:64
WPSCellFormat::HALIGN_RIGHT
@ HALIGN_RIGHT
Definition: WPSCell.h:46
WPS_DOUBLE_UNDERLINE_BIT
#define WPS_DOUBLE_UNDERLINE_BIT
Definition: libwps_internal.h:505
WPSFont
define the font properties
Definition: WPSFont.h:36
WPSColor::barycenter
static WPSColor barycenter(float alpha, WPSColor const &colA, float beta, WPSColor const &colB)
return alpha*colA+beta*colB
Definition: libwps_internal.cpp:386
LotusStyleManagerInternal::GraphicStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, GraphicStyle const &graphic)
operator<<
Definition: LotusStyleManager.cpp:358
WPSEntry::valid
bool valid(bool checkId=false) const
returns true if the zone length is positive
Definition: WPSEntry.h:89
WPS_ITALICS_BIT
#define WPS_ITALICS_BIT
Definition: libwps_internal.h:502
LotusStyleManagerInternal::State::State
State()
constructor
Definition: LotusStyleManager.cpp:385
WPSGraphicStyle::m_gradientType
GradientType m_gradientType
the gradient type
Definition: WPSGraphicStyle.h:374
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
Vec2i
Vec2< int > Vec2i
Vec2 of int.
Definition: libwps_internal.h:702
LotusStyleManagerInternal::CellStyleEntry::m_parentId
int m_parentId
the parent style id
Definition: LotusStyleManager.cpp:340
WPSCellFormat::setWrapping
void setWrapping(Wrapping align)
sets the wrapping
Definition: WPSCell.h:135
LotusStyleManager::updateFontStyle
bool updateFontStyle(int fontId, WPSFont &font, libwps_tools_win::Font::Type &fontType)
update a font using the font id
Definition: LotusStyleManager.cpp:1274
LotusStyleManager::getPattern48
bool getPattern48(int id, WPSGraphicStyle::Pattern &pattern) const
returns the pattern corresponding to a pattern id (id between 1 and 48)
WPSGraphicStyle::Pattern::m_dim
Vec2i m_dim
the dimension width x height
Definition: WPSGraphicStyle.h:187
LotusStyleManager::readStyleE6
bool readStyleE6(std::shared_ptr< WPSStream > stream, long endPos)
reads a style: fe6 (123)
Definition: LotusStyleManager.cpp:1954
LotusStyleManagerInternal::CellStyle::m_colorsId
int m_colorsId[2]
the color id : surface, shadow ?
Definition: LotusStyleManager.cpp:303
LotusStyleManagerInternal::State::m_idCellStyleMap
std::map< int, CellStyle > m_idCellStyleMap
a map id to cell style
Definition: LotusStyleManager.cpp:415
LotusStyleManagerInternal::GraphicStyle::m_lineId
int m_lineId
the border line id
Definition: LotusStyleManager.cpp:372
LotusStyleManagerInternal::State::m_idFormatStyleMap
std::map< int, FormatStyle > m_idFormatStyleMap
a map id to format style
Definition: LotusStyleManager.cpp:421
WPSBorder::m_color
WPSColor m_color
the border color
Definition: libwps_internal.h:456
WPSGraphicStyle::Pattern::m_colors
WPSColor m_colors[2]
the two indexed colors
Definition: WPSGraphicStyle.h:190
LotusStyleManagerInternal::FontStyle::m_fontId
int m_fontId
the font id
Definition: LotusStyleManager.cpp:129
Vec2f
Vec2< float > Vec2f
Vec2 of float.
Definition: libwps_internal.h:704
WPSGraphicStyle::Pattern::getAverageColor
bool getAverageColor(WPSColor &col) const
return the average color
Definition: WPSGraphicStyle.cpp:61
LotusStyleManager::readCellStyleE6
bool readCellStyleE6(std::shared_ptr< WPSStream > stream, long endPos)
reads a cell style: fe6 (wk4)
Definition: LotusStyleManager.cpp:1767
LotusStyleManagerInternal::State
the state of LotusStyleManager
Definition: LotusStyleManager.cpp:382
LotusStyleManager::readMenuStyleE7
static bool readMenuStyleE7(std::shared_ptr< WPSStream > stream, long endPos)
reads the list of style: 32e7 (wk4)
Definition: LotusStyleManager.cpp:2261
LotusStyleManagerInternal::FontStyle::m_extra
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:131
LotusStyleManagerInternal::GraphicStyle::m_extra
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:378
WPSBorder::TopBit
@ TopBit
Definition: libwps_internal.h:401
LotusStyleManagerInternal::CellStyle::m_vAlign
WPSCellFormat::VerticalAlignment m_vAlign
the vertical align
Definition: LotusStyleManager.cpp:316
WPS_DEBUG_MSG
#define WPS_DEBUG_MSG(M)
Definition: libwps_internal.h:134
libwps::readU32
uint32_t readU32(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:76
WPSFont::m_color
WPSColor m_color
the font color
Definition: WPSFont.h:91
LotusParser
This class parses a wk3,wk4,123 Lotus spreadsheet.
Definition: Lotus.h:72
LotusParser::version
int version() const
return the file version
Definition: Lotus.cpp:265
WPSEntry::setBegin
void setBegin(long off)
sets the begin offset
Definition: WPSEntry.h:57
LotusStyleManager::readFMTFontSize
bool readFMTFontSize(std::shared_ptr< WPSStream > stream)
reads a format font sizes zones 0xaf and 0xb1
Definition: LotusStyleManager.cpp:2209
LotusStyleManagerInternal::State::m_idFontNameMap
std::map< int, FontName > m_idFontNameMap
a map id to font name style
Definition: LotusStyleManager.cpp:428
LotusStyleManagerInternal::CellStyleEntry::m_stream
std::shared_ptr< WPSStream > m_stream
the main strem
Definition: LotusStyleManager.cpp:338
LotusStyleManagerInternal::LineStyle::m_color
WPSColor m_color
the line color
Definition: LotusStyleManager.cpp:188
LotusStyleManagerInternal::FontStyle::m_font
WPSFont m_font
the font
Definition: LotusStyleManager.cpp:125
LotusStyleManager::readCellStyleD2Data
bool readCellStyleD2Data(LotusStyleManagerInternal::CellStyleEntry const &entry, std::set< int > &seen)
really reads the cell style: fd2 (123)
Definition: LotusStyleManager.cpp:1371
libwps_tools_win::Font::UNKNOWN
@ UNKNOWN
Definition: libwps_tools_win.h:63
WPSCellFormat::WRAP_NO_WRAP
@ WRAP_NO_WRAP
Definition: WPSCell.h:52
LotusStyleManager::version
int version() const
return the file version
Definition: LotusStyleManager.cpp:614
WPSCellFormat::VALIGN_BOTTOM
@ VALIGN_BOTTOM
Definition: WPSCell.h:50
WPSBorder::Dot
@ Dot
Definition: libwps_internal.h:397
WPSFont.h
LotusStyleManagerInternal::ColorStyle::ColorStyle
ColorStyle()
constructor
Definition: LotusStyleManager.cpp:70
WPSBorder::RightBit
@ RightBit
Definition: libwps_internal.h:401
WPSEntry.h
WPSGraphicStyle
a structure used to define a picture style
Definition: WPSGraphicStyle.h:37
WPSFont::m_attributes
uint32_t m_attributes
the font attributes defined as a set of bits
Definition: WPSFont.h:87
WPSFont::m_spacing
double m_spacing
font spacing
Definition: WPSFont.h:89
LotusStyleManager.h
libwps::DebugFile::addNote
static void addNote(char const *)
Definition: WPSDebug.h:221
LotusStyleManagerInternal::CellStyle::m_bordersStyle
WPSBorder m_bordersStyle[4]
the cell border
Definition: LotusStyleManager.cpp:322
LotusStyleManagerInternal::State::m_isUpdated
bool m_isUpdated
a flag to know if updateState was launched
Definition: LotusStyleManager.cpp:413
LotusStyleManagerInternal::State::getColor256
static bool getColor256(int id, WPSColor &color)
returns a color corresponding to an id
Definition: LotusStyleManager.cpp:467
LotusStyleManager::readFMTFontId
bool readFMTFontId(std::shared_ptr< WPSStream > stream)
reads a format font id zone: 0xb0
Definition: LotusStyleManager.cpp:2158
WPSEntry::begin
long begin() const
returns the begin offset
Definition: WPSEntry.h:73
LotusStyleManager::readColorStyle
bool readColorStyle(std::shared_ptr< WPSStream > stream, long endPos)
reads a color style
Definition: LotusStyleManager.cpp:744
LotusStyleManagerInternal::FormatStyle::FormatStyle
FormatStyle()
constructor
Definition: LotusStyleManager.cpp:138
LotusStyleManagerInternal::CellStyle::CellStyle
CellStyle(libwps_tools_win::Font::Type fontType)
constructor
Definition: LotusStyleManager.cpp:199
LotusStyleManagerInternal::ColorStyle::m_colors
WPSColor m_colors[4]
the color id : unknown0, unknown1, line, surface
Definition: LotusStyleManager.cpp:96
WPSFont::m_size
double m_size
font size
Definition: WPSFont.h:85
WPSCellFormat
a structure used to defined the cell format
Definition: WPSCell.h:40
WPSBorder::m_style
Style m_style
the border style
Definition: libwps_internal.h:446
LotusStyleManager::readFontStyleF0
bool readFontStyleF0(std::shared_ptr< WPSStream > stream, long endPos)
reads a font style: ff0 (wk4)
Definition: LotusStyleManager.cpp:1183
LotusStyleManagerInternal::FontStyle::m_fontType
libwps_tools_win::Font::Type m_fontType
the font type
Definition: LotusStyleManager.cpp:127
LotusStyleManagerInternal::State::getColor16
static bool getColor16(int id, WPSColor &color)
returns a color corresponding to an id between 0 and 15
Definition: LotusStyleManager.cpp:451
WPSGraphicStyle::m_gradientStopList
std::vector< GradientStop > m_gradientStopList
the list of gradient limits
Definition: WPSGraphicStyle.h:376
WPSBorder::Dash
@ Dash
Definition: libwps_internal.h:397
WPSCellFormat::HALIGN_LEFT
@ HALIGN_LEFT
Definition: WPSCell.h:46
Lotus.h
WPSCellFormat::VALIGN_TOP
@ VALIGN_TOP
Definition: WPSCell.h:50
WPSCellFormat::setHAlignment
void setHAlignment(HorizontalAlignment align)
sets the horizontal alignement
Definition: WPSCell.h:114
LotusStyleManager::getPattern64
bool getPattern64(int id, WPSGraphicStyle::Pattern &pattern) const
returns the pattern corresponding to a pattern id (id between 1 and 64)
Definition: LotusStyleManager.cpp:636
WPSCellFormat::VerticalAlignment
VerticalAlignment
the default vertical alignement.
Definition: WPSCell.h:50
LotusStyleManager::readFontStyleA0
bool readFontStyleA0(std::shared_ptr< WPSStream > stream, long endPos)
reads a font style: fa0
Definition: LotusStyleManager.cpp:1105
WPSEntry::length
long length() const
returns the length of the zone
Definition: WPSEntry.h:83
LotusStyleManagerInternal::FontName::m_name
std::string m_name
the font name
Definition: LotusStyleManager.cpp:60
LotusParser::getFont
bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
returns the font corresponding to an id
Definition: Lotus.cpp:278
LotusStyleManagerInternal::FontStyle
small struct used to defined font style
Definition: LotusStyleManager.cpp:106
libwps::DebugStream
Definition: WPSDebug.h:191
WPSCellFormat::HorizontalAlignment
HorizontalAlignment
the default horizontal alignement.
Definition: WPSCell.h:46
libwps::readU8
uint8_t readU8(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:40
WPSBorder
a border list
Definition: libwps_internal.h:394
WPSGraphicStyle::GradientStop
a structure used to define the gradient limit
Definition: WPSGraphicStyle.h:48
libwps_tools_win.h
LotusStyleManagerInternal::State::getPattern48
static bool getPattern48(int id, WPSGraphicStyle::Pattern &pattern)
returns the pattern corresponding to a pattern id between 1 and 48
Definition: LotusStyleManager.cpp:514
WPSGraphicStyle::setSurfaceColor
void setSurfaceColor(WPSColor const &col, float opacity=1)
set the surface color
Definition: WPSGraphicStyle.h:254
LotusStyleManagerInternal::CellStyleEntry
small struct used to defined cell style file entry
Definition: LotusStyleManager.cpp:328
LotusStyleManager::updateState
void updateState()
update the state (need to be called before asking for style)
Definition: LotusStyleManager.cpp:597
LotusStyleManagerInternal::State::m_idToCellStyleEntryMap
std::map< int, CellStyleEntry > m_idToCellStyleEntryMap
a map cell style id to the cell style entry
Definition: LotusStyleManager.cpp:432
LotusStyleManagerInternal::State::m_version
int m_version
the file version
Definition: LotusStyleManager.cpp:411
WPSEntry::setEnd
void setEnd(long e)
sets the end offset
Definition: WPSEntry.h:67
WPSCellFormat::setFont
void setFont(WPSFont const &font)
sets the font
Definition: WPSCell.h:104
libwps::readU16
uint16_t readU16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:64
LotusStyleManager::~LotusStyleManager
~LotusStyleManager()
destructor
Definition: LotusStyleManager.cpp:588
LotusStyleManager::updateCellStyle
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:2005
libwps_tools_win::Language::name
std::string name(long id)
returns the name given Windows© id
Definition: libwps_tools_win.cpp:7332
WPSGraphicStyle::m_lineColor
WPSColor m_lineColor
the line color
Definition: WPSGraphicStyle.h:355
LotusStyleManagerInternal::CellStyle::m_formatId
int m_formatId
the format id
Definition: LotusStyleManager.cpp:307
WPSGraphicStyle::hasGradient
bool hasGradient(bool complex=false) const
returns true if the gradient is defined
Definition: WPSGraphicStyle.h:275
WPSBorder::Double
@ Double
Definition: libwps_internal.h:399
LotusStyleManagerInternal::LineStyle::LineStyle
LineStyle()
constructor
Definition: LotusStyleManager.cpp:166
LotusStyleManager::LotusStyleManager
LotusStyleManager(LotusParser &parser)
constructor
Definition: LotusStyleManager.cpp:582
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
LotusStyleManagerInternal::FontStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, FontStyle const &font)
operator<<
Definition: LotusStyleManager.cpp:117
WPSGraphicStyle::Pattern::empty
bool empty() const
return true if we does not have a pattern
Definition: WPSGraphicStyle.h:117
WPSBorder::LeftBit
@ LeftBit
Definition: libwps_internal.h:401
LotusStyleManagerInternal::FontStyle::FontStyle
FontStyle(libwps_tools_win::Font::Type fontType)
constructor
Definition: LotusStyleManager.cpp:109
LotusStyleManager::cleanState
void cleanState()
clean internal state
Definition: LotusStyleManager.cpp:592
WPSBorder::m_type
Type m_type
the border repetition
Definition: libwps_internal.h:448
WPSDebug.h
libwps::DebugFile::addDelimiter
static void addDelimiter(long, char)
Definition: WPSDebug.h:222
LotusStyleManagerInternal::CellStyle::m_rotation
int m_rotation
the rotation
Definition: LotusStyleManager.cpp:320
LotusStyleManagerInternal::CellStyle::m_fontStyle
FontStyle m_fontStyle
the font style
Definition: LotusStyleManager.cpp:312
WPSBorder::None
@ None
Definition: libwps_internal.h:397
LotusStyleManager::m_mainParser
LotusParser & m_mainParser
the main parser
Definition: LotusStyleManager.h:146
LotusStyleManagerInternal::CellStyle::m_bordersId
int m_bordersId[4]
the border line id
Definition: LotusStyleManager.cpp:301
libwps::read16
int16_t read16(librevenge::RVNGInputStream *input)
Definition: libwps_internal.cpp:71
LotusStyleManager::readFMTFontName
bool readFMTFontName(std::shared_ptr< WPSStream > stream)
reads a format font name: zones 0xae
Definition: LotusStyleManager.cpp:2095
LotusStyleManagerInternal::FormatStyle::m_extra
std::string m_extra
extra data
Definition: LotusStyleManager.cpp:159
libwps_internal.h
LotusStyleManagerInternal::FormatStyle::m_prefix
std::string m_prefix
the prefix
Definition: LotusStyleManager.cpp:155
WKSContentListener.h
WPSGraphicStyle::Pattern
a basic pattern used in a WPSGraphicStyle:
Definition: WPSGraphicStyle.h:88
WPSColor
the class to store a color
Definition: libwps_internal.h:280
LotusStyleManager::readCellStyleD2
bool readCellStyleD2(std::shared_ptr< WPSStream > stream, long endPos)
reads a cell style: fd2 (mac 123 or 123)
Definition: LotusStyleManager.cpp:1637
LotusStyleManagerInternal::State::m_idGraphicStyleMap
std::map< int, GraphicStyle > m_idGraphicStyleMap
a map id to graphic style
Definition: LotusStyleManager.cpp:423
WPSGraphicShape.h
WPS_SHADOW_BIT
#define WPS_SHADOW_BIT
Definition: libwps_internal.h:503
libwps_tools_win::Font::getFontType
static Type getFontType(librevenge::RVNGString &name)
returns the type of the font using the fontName
Definition: libwps_tools_win.cpp:39
WPSStream.h
LotusStyleManagerInternal::LineStyle::m_dashId
int m_dashId
the dash id
Definition: LotusStyleManager.cpp:190
WPSBorder::LargeDot
@ LargeDot
Definition: libwps_internal.h:397
LotusStyleManager::updateGraphicStyle
bool updateGraphicStyle(int graphicId, WPSGraphicStyle &style) const
update style using graphic id
Definition: LotusStyleManager.cpp:1078
LotusStyleManagerInternal::CellStyleEntry::CellStyleEntry
CellStyleEntry(std::shared_ptr< WPSStream > const &stream)
constructor
Definition: LotusStyleManager.cpp:331
LotusStyleManager::readFormatStyle
bool readFormatStyle(std::shared_ptr< WPSStream > stream, long endPos)
reads a format style
Definition: LotusStyleManager.cpp:1294
WPSCellFormat::setBorders
void setBorders(int wh, WPSBorder const &border)
sets the cell border: wh=WPSBorder::LeftBit|...
Definition: WPSCell.cpp:143
LotusStyleManagerInternal::CellStyle
small struct used to defined cell style
Definition: LotusStyleManager.cpp:196
LotusStyleManagerInternal::CellStyle::m_hAlign
WPSCellFormat::HorizontalAlignment m_hAlign
the horizontal align
Definition: LotusStyleManager.cpp:314
WPSCellFormat::Wrapping
Wrapping
the wrapping
Definition: WPSCell.h:52
libwps::DebugFile
Definition: WPSDebug.h:207
LotusStyleManagerInternal::GraphicStyle::m_patternId
int m_patternId
the patten id: 123 pc
Definition: LotusStyleManager.cpp:376
LotusStyleManager::readLineStyle
bool readLineStyle(std::shared_ptr< WPSStream > stream, long endPos, int vers)
reads a line style
Definition: LotusStyleManager.cpp:644
WPSGraphicStyle.h
LotusStyleManagerInternal
Definition: LotusStyleManager.cpp:47
WPSGraphicStyle::m_lineWidth
float m_lineWidth
the linewidth
Definition: WPSGraphicStyle.h:345
WPSCellFormat::setBackgroundColor
void setBackgroundColor(WPSColor const &color)
set the background color
Definition: WPSCell.h:235
LotusStyleManagerInternal::CellStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, CellStyle const &cell)
operator<<
Definition: LotusStyleManager.cpp:219
LotusStyleManagerInternal::ColorStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, ColorStyle const &color)
operator<<
Definition: LotusStyleManager.cpp:79
LotusStyleManager::getColor16
bool getColor16(int cId, WPSColor &color) const
returns if possible the color(id between 0 and 15)
Definition: LotusStyleManager.cpp:626
WPSGraphicStyle::Pattern::getUniqueColor
bool getUniqueColor(WPSColor &col) const
check if the pattern has only one color; if so returns true...
Definition: WPSGraphicStyle.cpp:45
WPSGraphicStyle::setPattern
void setPattern(Pattern const &pat)
set the pattern
Definition: WPSGraphicStyle.h:265
WPSGraphicStyle::m_pattern
Pattern m_pattern
the pattern if it exists
Definition: WPSGraphicStyle.h:371
WPSColor::black
static WPSColor black()
return the back color
Definition: libwps_internal.h:306
LotusStyleManagerInternal::LineStyle
small struct used to defined line style
Definition: LotusStyleManager.cpp:163
LotusStyleManagerInternal::LineStyle::operator<<
friend std::ostream & operator<<(std::ostream &o, LineStyle const &line)
operator<<
Definition: LotusStyleManager.cpp:174
WPSColor::isBlack
bool isBlack() const
return true if the color is black
Definition: libwps_internal.h:345
WPSFont::m_name
librevenge::RVNGString m_name
font name
Definition: WPSFont.h:83
WPSCellFormat::HALIGN_CENTER
@ HALIGN_CENTER
Definition: WPSCell.h:46
LotusStyleManager::updateLineStyle
bool updateLineStyle(int lineId, WPSGraphicStyle &style) const
update style using line id
Definition: LotusStyleManager.cpp:729
LotusStyleManagerInternal::GraphicStyle
small struct used to defined graphic style
Definition: LotusStyleManager.cpp:346
LotusStyleManager::getColor256
bool getColor256(int cId, WPSColor &color) const
returns if possible the color(id between 0 and 255)
Definition: LotusStyleManager.cpp:631
LotusStyleManager::readGraphicStyleC9
bool readGraphicStyleC9(std::shared_ptr< WPSStream > stream, long endPos)
reads a graphic style: fc9, lotus123
Definition: LotusStyleManager.cpp:980
LotusStyleManagerInternal::ColorStyle::m_patternId
int m_patternId
the pattern id
Definition: LotusStyleManager.cpp:98
LotusStyleManagerInternal::FormatStyle
small struct used to defined format style
Definition: LotusStyleManager.cpp:135