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/libwps.h"
29
30 #include "libwps_internal.h"
31 #include "libwps_tools_win.h"
32
33 #include "WKSParser.h"
34
35 namespace WKS4ParserInternal
36 {
37 class SubDocument;
38 struct State;
39 }
40
41 class WKS4Spreadsheet;
42
47 class WKS4Parser : public WKSParser
48 {
49 friend class WKS4ParserInternal::SubDocument;
50 friend class WKS4Spreadsheet;
51 public:
53 WKS4Parser(RVNGInputStreamPtr &input, WPSHeaderPtr &header,
54 libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN);
56 ~WKS4Parser();
58 void parse(librevenge::RVNGSpreadsheetInterface *documentInterface);
60 bool checkHeader(WPSHeader *header, bool strict=false);
61
62 protected:
64 bool checkFilePosition(long pos);
66 int version() const;
70 libwps_tools_win::Font::Type getDefaultFontType() const;
72 bool hasLICSCharacters() const;
74 libwps::WPSCreator getCreator() const;
75
76 //
77 // interface with WKS4Spreadsheet
78 //
79
81 bool getColor(int id, WPSColor &color) const;
83 bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const;
84
85
87 shared_ptr<WKSContentListener> createListener(librevenge::RVNGSpreadsheetInterface *interface);
89 void sendHeaderFooter(bool header);
90
91 //
92 // low level
93 //
94
96 bool readZones();
98 bool readZone();
100 bool readZoneQuattro();
101
103
105 bool readFont();
106
108 bool readPrnt();
109
111 bool readPrn2();
112
114 bool readHeaderFooter(bool header);
115
117 bool readFieldName();
118
120
122 bool readChartName();
123
125 bool readChartDef();
126
128 bool readChartFont();
129
131 bool readChart2Font();
132
134 bool readChartLimit();
135
137 bool readChartList();
138
140 bool readChartUnknown();
141
143
145 bool readWindowRecord();
150 bool readUnknown1();
151
152 shared_ptr<WKSContentListener> m_listener;
153 shared_ptr<WKS4ParserInternal::State> m_state;
156 shared_ptr<WKS4Spreadsheet> m_spreadsheetParser;
157 };
158
159 #endif /* WPS4_H */
160 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WKS4ParserInternal
Internal: namespace to define internal class of WKS4Parser.
Definition: WKS4.cpp:49
WKS4Parser::m_listener
shared_ptr< WKSContentListener > m_listener
Definition: WKS4.h:152
WKS4ParserInternal::SubDocument
Internal: the subdocument of a WPS4Parser.
Definition: WKS4.cpp:63
libwps_tools_win.h
WPSFont
define the font properties
Definition: WPSFont.h:36
libwps_tools_win::Font::Type
Type
enum Type
Definition: libwps_tools_win.h:46
WKS4Parser
This class parses Microsoft Works spreadsheet or a database file.
Definition: WKS4.h:47
WPSHeaderPtr
shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:108
libwps_internal.h
WKS4Spreadsheet::m_state
shared_ptr< WKS4SpreadsheetInternal::State > m_state
the internal state
Definition: WKS4Spreadsheet.h:145
WPSHeader
Definition: WPSHeader.h:31
libwps_tools_win::Font::UNKNOWN
Definition: libwps_tools_win.h:61
WKS4Parser::m_spreadsheetParser
shared_ptr< WKS4Spreadsheet > m_spreadsheetParser
the spreadsheet manager
Definition: WKS4.h:156
libwps::WPSCreator
WPSCreator
Definition: WPSDocument.h:48
WKS4Spreadsheet::version
int version() const
return the file version
Definition: WKS4Spreadsheet.cpp:474
libwps.h
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
WPSColor
the class to store a color
Definition: libwps_internal.h:266
WKS4Spreadsheet::checkFilePosition
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: WKS4Spreadsheet.cpp:488
WKS4Spreadsheet
This class parses Microsoft Works spreadsheet file.
Definition: WKS4Spreadsheet.h:48
WKS4Spreadsheet::hasLICSCharacters
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition: WKS4Spreadsheet.cpp:481
WKS4Spreadsheet::WKS4Parser
friend class WKS4Parser
Definition: WKS4Spreadsheet.h:51
WKSParser
Definition: WKSParser.h:33
WKSParser.h