LotusStyleManager.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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 <vector>
27
28 #include <librevenge-stream/librevenge-stream.h>
29
30 #include "libwps_internal.h"
31
32 #include "WPSDebug.h"
33
34 namespace LotusStyleManagerInternal
35 {
36 struct State;
37 }
38
39 class LotusParser;
40
45 class LotusStyleManager
46 {
47 public:
48 friend class LotusParser;
49
51 LotusStyleManager(LotusParser &parser);
53 ~LotusStyleManager();
55 void cleanState();
57 void updateState();
58
60 bool getColor(int cId, WPSColor &color) const;
61
63 bool updateCellStyle(int cellId, WPSCellFormat &format,
64 WPSFont &font, libwps_tools_win::Font::Type &fontType);
66 bool updateFontStyle(int fontId, WPSFont &font, libwps_tools_win::Font::Type &fontType);
68 bool updateLineStyle(int lineId, WPSGraphicStyle &style) const;
70 bool updateSurfaceStyle(int colorId, WPSGraphicStyle &style) const;
72 bool updateGraphicStyle(int graphicId, WPSGraphicStyle &style) const;
73 protected:
75 bool checkFilePosition(long pos);
77 int version() const;
78
79 //
80 // low level
81 //
82
84 bool readCellStyle(long endPos);
86 bool readColorStyle(long endPos);
88 bool readFontStyle(long endPos);
90 bool readFormatStyle(long endPos);
92 bool readLineStyle(long endPos);
94 bool readGraphicStyle(long endPos);
95
97 bool updateShadowStyle(int colorId, WPSGraphicStyle &style) const;
98
99 private:
100 LotusStyleManager(LotusStyleManager const &orig);
101 LotusStyleManager &operator=(LotusStyleManager const &orig);
103 libwps::DebugFile &ascii()
104 {
105 return m_asciiFile;
106 }
108 RVNGInputStreamPtr m_input;
110 LotusParser &m_mainParser;
112 shared_ptr<LotusStyleManagerInternal::State> m_state;
114 libwps::DebugFile &m_asciiFile;
115 };
116
117 #endif /* LOTUS_STYLE_MANAGER_H */
118 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
LotusStyleManager::readCellStyle
bool readCellStyle(long endPos)
reads a cell style
Definition: LotusStyleManager.cpp:888
LotusStyleManager::updateLineStyle
bool updateLineStyle(int lineId, WPSGraphicStyle &style) const
update style using line id
Definition: LotusStyleManager.cpp:498
LotusStyleManager::m_state
shared_ptr< LotusStyleManagerInternal::State > m_state
the internal state
Definition: LotusStyleManager.h:112
LotusStyleManager::readColorStyle
bool readColorStyle(long endPos)
reads a color style
Definition: LotusStyleManager.cpp:513
LotusStyleManager::updateState
void updateState()
update the state (need to be called before asking for style)
Definition: LotusStyleManager.cpp:379
LotusStyleManager::m_asciiFile
libwps::DebugFile & m_asciiFile
the ascii file
Definition: LotusStyleManager.h:114
libwps::DebugFile
Definition: WPSDebug.h:196
WPSFont
define the font properties
Definition: WPSFont.h:36
LotusStyleManager::m_input
RVNGInputStreamPtr m_input
the input
Definition: LotusStyleManager.h:108
LotusStyleManager::LotusStyleManager
LotusStyleManager(LotusParser &parser)
constructor
Definition: LotusStyleManager.cpp:363
LotusStyleManager::ascii
libwps::DebugFile & ascii()
returns the debug file
Definition: LotusStyleManager.h:103
LotusStyleManager::m_mainParser
LotusParser & m_mainParser
the main parser
Definition: LotusStyleManager.h:110
WPSCellFormat
a structure used to defined the cell format
Definition: WPSCell.h:40
libwps_tools_win::Font::Type
Type
enum Type
Definition: libwps_tools_win.h:46
LotusStyleManager::~LotusStyleManager
~LotusStyleManager()
destructor
Definition: LotusStyleManager.cpp:370
LotusStyleManager::updateGraphicStyle
bool updateGraphicStyle(int graphicId, WPSGraphicStyle &style) const
update style using graphic id
Definition: LotusStyleManager.cpp:700
LotusStyleManager::version
int version() const
return the file version
Definition: LotusStyleManager.cpp:397
LotusStyleManager::cleanState
void cleanState()
clean internal state
Definition: LotusStyleManager.cpp:374
LotusParser
This class parses a WK2..WK4 Lotus spreadsheet.
Definition: Lotus.h:47
WPSGraphicStyle
a structure used to define a picture style
Definition: WPSGraphicStyle.h:37
LotusStyleManager::updateShadowStyle
bool updateShadowStyle(int colorId, WPSGraphicStyle &style) const
update style using color id for defining shadow
Definition: LotusStyleManager.cpp:604
LotusStyleManager::getColor
bool getColor(int cId, WPSColor &color) const
returns if possible the color
Definition: LotusStyleManager.cpp:416
LotusStyleManager::checkFilePosition
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: LotusStyleManager.cpp:404
libwps_internal.h
LotusStyleManager::readFormatStyle
bool readFormatStyle(long endPos)
reads a format style
Definition: LotusStyleManager.cpp:814
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:999
LotusStyleManager::readGraphicStyle
bool readGraphicStyle(long endPos)
reads a graphic style
Definition: LotusStyleManager.cpp:631
LotusStyleManager::readLineStyle
bool readLineStyle(long endPos)
reads a line style
Definition: LotusStyleManager.cpp:424
LotusStyleManager
This class parses the Lotus style.
Definition: LotusStyleManager.h:45
LotusStyleManagerInternal
Definition: LotusStyleManager.cpp:46
LotusStyleManager::updateFontStyle
bool updateFontStyle(int fontId, WPSFont &font, libwps_tools_win::Font::Type &fontType)
update a font using the font id
Definition: LotusStyleManager.cpp:794
LotusStyleManager::readFontStyle
bool readFontStyle(long endPos)
reads a font style
Definition: LotusStyleManager.cpp:719
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:82
WPSColor
the class to store a color
Definition: libwps_internal.h:237
LotusStyleManager::operator=
LotusStyleManager & operator=(LotusStyleManager const &orig)
LotusStyleManager::updateSurfaceStyle
bool updateSurfaceStyle(int colorId, WPSGraphicStyle &style) const
update style using color id
Definition: LotusStyleManager.cpp:568
WPSDebug.h