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 
36 {
37 struct CellStyleEntry;
38 struct State;
39 }
40 
41 class LotusParser;
42 
48 {
49 public:
50  friend class LotusParser;
51 
53  explicit LotusStyleManager(LotusParser &parser);
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  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;
148  std::shared_ptr<LotusStyleManagerInternal::State> m_state;
149 };
150 
151 #endif /* LOTUS_STYLE_MANAGER_H */
152 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
define the font properties
Definition: WPSFont.h:36
LotusParser & m_mainParser
the main parser
Definition: LotusStyleManager.h:146
a structure used to defined the cell format
Definition: WPSCell.h:40
friend class LotusStyleManager
Definition: Lotus.h:78
Type
enum Type
Definition: libwps_tools_win.h:46
int version() const
return the file version
Definition: Lotus.cpp:265
This class parses a wk3,wk4,123 Lotus spreadsheet.
Definition: Lotus.h:72
a structure used to define a picture style
Definition: WPSGraphicStyle.h:37
This class parses the Lotus style.
Definition: LotusStyleManager.h:47
Definition: LotusStyleManager.cpp:47
the class to store a color
Definition: libwps_internal.h:280
WKSParser & operator=(const WKSParser &)=delete
a basic pattern used in a WPSGraphicStyle:
Definition: WPSGraphicStyle.h:88
small struct used to defined cell style file entry
Definition: LotusStyleManager.cpp:326
std::shared_ptr< LotusStyleManagerInternal::State > m_state
the internal state
Definition: LotusStyleManager.h:148

Generated on Mon Feb 11 2019 22:32:02 for libwps by doxygen 1.8.13