WKS4.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

WKS4.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 WKS4_H
23 #define WKS4_H
24
25 #include <vector>
26
27 #include <librevenge-stream/librevenge-stream.h>
28 #include "libwps_internal.h"
29 #include "libwps_tools_win.h"
30
31 #include "WKSParser.h"
32
33 namespace WKS4ParserInternal
34 {
35 class SubDocument;
36 struct State;
37 }
38
39 class WKS4Spreadsheet;
40
45 class WKS4Parser : public WKSParser
46 {
47 friend class WKS4ParserInternal::SubDocument;
48 friend class WKS4Spreadsheet;
49 public:
51 WKS4Parser(RVNGInputStreamPtr &input, WPSHeaderPtr &header);
53 ~WKS4Parser();
55 void parse(librevenge::RVNGSpreadsheetInterface *documentInterface);
57 bool checkHeader(WPSHeader *header, bool strict=false);
58
59 protected:
61 bool checkFilePosition(long pos);
63 int version() const;
65 bool hasLICSCharacters() const;
66
67 //
68 // interface with WKS4Spreadsheet
69 //
70
72 bool getColor(int id, uint32_t &color) const;
74 bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const;
75
76
78 shared_ptr<WKSContentListener> createListener(librevenge::RVNGSpreadsheetInterface *interface);
80 void sendHeaderFooter(bool header);
81
82 //
83 // low level
84 //
85
87 bool readZones();
89 bool readZone();
90
92
94 bool readFont();
95
97 bool readPrnt();
98
100 bool readPrn2();
101
103 bool readHeaderFooter(bool header);
104
106 bool readFieldName();
107
109
111 bool readChartName();
112
114 bool readChartDef();
115
117 bool readChartFont();
118
120 bool readChart2Font();
121
123 bool readChartLimit();
124
126 bool readChartList();
127
129 bool readChartUnknown();
130
132
134 bool readUnknown0();
139 bool readUnknown1();
140
141 shared_ptr<WKSContentListener> m_listener;
142 shared_ptr<WKS4ParserInternal::State> m_state;
145 shared_ptr<WKS4Spreadsheet> m_spreadsheetParser;
146 };
147
148 #endif /* WPS4_H */
149 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WKS4Parser::WKS4Parser
WKS4Parser(RVNGInputStreamPtr &input, WPSHeaderPtr &header)
constructor
Definition: WKS4.cpp:191
WKS4ParserInternal
Internal: namespace to define internal class of WKS4Parser.
Definition: WKS4.cpp:49
WKS4Parser::checkFilePosition
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: WKS4.cpp:208
WKS4Parser::readChart2Font
bool readChart2Font()
reads a structure which seems to define four chart font (only present in windows file) ...
Definition: WKS4.cpp:1575
WKS4Parser::readPrn2
bool readPrn2()
reads another printer data. Seem simillar to ZZPrnt
Definition: WKS4.cpp:1303
WKS4Parser::m_listener
shared_ptr< WKSContentListener > m_listener
Definition: WKS4.h:141
WKS4Parser::readUnknown0
bool readUnknown0()
reads some unknown zones 0:7|0:9
Definition: WKS4.cpp:1779
WKS4Parser::readChartDef
bool readChartDef()
reads a structure which seems to define a chart
Definition: WKS4.cpp:1402
WKS4Parser::parse
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface)
called by WPSDocument to parse the file
Definition: WKS4.cpp:250
WKS4ParserInternal::SubDocument
Internal: the subdocument of a WPS4Parser.
Definition: WKS4.cpp:63
libwps_tools_win.h
WKS4Parser::hasLICSCharacters
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition: WKS4.cpp:242
WPSFont
define the font properties
Definition: WPSFont.h:37
WKS4Parser::readChartList
bool readChartList()
reads a list of int/cellule which seems relative to a chart : CHECKME
Definition: WKS4.cpp:1728
WKS4Parser::readChartFont
bool readChartFont()
reads a structure which seems to define two chart font (only present in windows file) ...
Definition: WKS4.cpp:1526
libwps_tools_win::Font::Type
Type
enum Type
Definition: libwps_tools_win.h:47
WKS4Parser
This class parses Microsoft Works spreadsheet or a database file.
Definition: WKS4.h:45
WKS4Parser::readHeaderFooter
bool readHeaderFooter(bool header)
reads the header/footer
Definition: WKS4.cpp:1213
WPSHeaderPtr
shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:102
WKS4Parser::readFont
bool readFont()
reads the fonts
Definition: WKS4.cpp:1104
WKS4Parser::readFieldName
bool readFieldName()
read a list of field name + ...
Definition: WKS4.cpp:1348
WKS4Parser::~WKS4Parser
~WKS4Parser()
destructor
Definition: WKS4.cpp:199
WKS4Parser::readChartUnknown
bool readChartUnknown()
reads an unknown structure which seems relative to a chart : CHECKME
Definition: WKS4.cpp:1649
libwps_internal.h
WKS4Parser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition: WKS4.cpp:316
WKS4Parser::readChartName
bool readChartName()
reads the chart name or title
Definition: WKS4.cpp:1489
WKS4Parser::sendHeaderFooter
void sendHeaderFooter(bool header)
send the header/footer
Definition: WKS4.cpp:1185
WPSHeader
Definition: WPSHeader.h:31
WKS4Parser::m_spreadsheetParser
shared_ptr< WKS4Spreadsheet > m_spreadsheetParser
the spreadsheet manager
Definition: WKS4.h:145
WKS4Parser::version
int version() const
return the file version
Definition: WKS4.cpp:203
WKS4Parser::readPrnt
bool readPrnt()
reads a printer data ?
Definition: WKS4.cpp:1256
WKS4Parser::readChartLimit
bool readChartLimit()
reads end/begin of chart (only present in windows file)
Definition: WKS4.cpp:1626
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:81
WKS4Parser::createListener
shared_ptr< WKSContentListener > createListener(librevenge::RVNGSpreadsheetInterface *interface)
creates the main listener
Definition: WKS4.cpp:291
WKS4Parser::readZones
bool readZones()
finds the different zones (spreadsheet, chart, print, ...)
Definition: WKS4.cpp:389
WKS4Parser::readUnknown1
bool readUnknown1()
reads some unknown spreadsheet zones 0:18|0:19|0:20|0:27|0:2a
Definition: WKS4.cpp:1828
WKS4Parser::readZone
bool readZone()
reads a zone
Definition: WKS4.cpp:425
WKS4Spreadsheet
This class parses Microsoft Works spreadsheet file.
Definition: WKS4Spreadsheet.h:48
WKS4Parser::getColor
bool getColor(int id, uint32_t &color) const
returns the color corresponding to an id
Definition: WKS4.cpp:224
WKS4Parser::getFont
bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
returns the font corresponding to an id
Definition: WKS4.cpp:229
WKS4Parser::m_state
shared_ptr< WKS4ParserInternal::State > m_state
the listener (if set)
Definition: WKS4.h:143
WKSParser
Definition: WKSParser.h:33
WKSParser.h