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
35namespace WKS4ParserInternal
36{
37class SubDocument;
38struct State;
39}
40
41class WKS4Spreadsheet;
42
47class WKS4Parser : public WKSParser
48{
50 friend class WKS4Spreadsheet;
51public:
55 char const *password=0);
59 void parse(librevenge::RVNGSpreadsheetInterface *documentInterface);
61 bool checkHeader(WPSHeader *header, bool strict=false);
62
63protected:
65 bool checkFilePosition(long pos);
67 int version() const;
73 bool hasLICSCharacters() const;
76
77 //
78 // interface with WKS4Spreadsheet
79 //
80
82 bool getColor(int id, WPSColor &color) const;
84 bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const;
85
86
88 shared_ptr<WKSContentListener> createListener(librevenge::RVNGSpreadsheetInterface *interface);
90 void sendHeaderFooter(bool header);
91
92 //
93 // low level
94 //
95
97 bool parseFormatStream();
100
102 bool readZones();
104 bool readZone();
106 bool readZoneQuattro();
107
109
111 bool readFont();
112
114 bool readPrnt();
115
117 bool readPrn2();
118
120 bool readHeaderFooter(bool header);
121
123 bool readFieldName();
124
126
128 bool readChartName();
129
131 bool readChartDef();
132
134 bool readChartFont();
135
137 bool readChart2Font();
138
140 bool readChartLimit();
141
143 bool readChartList();
144
146 bool readChartUnknown();
147
149
151 static RVNGInputStreamPtr decodeStream(RVNGInputStreamPtr input, long endPos, std::vector<uint8_t> const &key);
152
154
156 bool readWindowRecord();
161 bool readUnknown1();
162
163 shared_ptr<WKSContentListener> m_listener;
165 shared_ptr<WKS4ParserInternal::State> m_state;
167 shared_ptr<WKS4Spreadsheet> m_spreadsheetParser;
168};
169
170#endif /* WPS4_H */
171/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
Internal: the subdocument of a WPS4Parser.
Definition WKS4.cpp:66
This class parses Microsoft Works spreadsheet or a database file.
Definition WKS4.h:48
bool readChartName()
reads the chart name or title
Definition WKS4.cpp:1755
bool readPrn2()
reads another printer data. Seem simillar to ZZPrnt
Definition WKS4.cpp:1554
shared_ptr< WKSContentListener > createListener(librevenge::RVNGSpreadsheetInterface *interface)
creates the main listener
Definition WKS4.cpp:351
bool readFont()
reads a mswork font
Definition WKS4.cpp:1346
shared_ptr< WKSContentListener > m_listener
Definition WKS4.h:163
bool readWindowRecord()
reads windows record 0:7|0:9
Definition WKS4.cpp:2045
static RVNGInputStreamPtr decodeStream(RVNGInputStreamPtr input, long endPos, std::vector< uint8_t > const &key)
try to decode a stream, if successful, replace the stream'input by the new one
Definition WKS4.cpp:2166
~WKS4Parser()
destructor
Definition WKS4.cpp:230
bool readZone()
reads a zone
Definition WKS4.cpp:582
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition WKS4.cpp:290
bool readPrnt()
reads a printer data ?
Definition WKS4.cpp:1507
bool readChart2Font()
reads a structure which seems to define four chart font (only present in windows file)
Definition WKS4.cpp:1841
bool parseFormatStream()
check for the existence of a format stream, if it exists, parse it
Definition WKS4.cpp:510
bool readHeaderFooter(bool header)
reads the header/footer
Definition WKS4.cpp:1455
libwps::WPSCreator getCreator() const
returns the creator
Definition WKS4.cpp:264
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface)
called by WPSDocument to parse the file
Definition WKS4.cpp:298
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition WKS4.cpp:259
bool readChartLimit()
reads end/begin of chart (only present in windows file)
Definition WKS4.cpp:1892
bool readFieldName()
read a list of field name + ...
Definition WKS4.cpp:1599
void resetMainInput(RVNGInputStreamPtr newInput)
reset the main input
Definition WKS4.cpp:239
bool readZoneQuattro()
reads a Quattro Pro zone
Definition WKS4.cpp:1320
bool getColor(int id, WPSColor &color) const
returns the color corresponding to an id
Definition WKS4.cpp:272
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition WKS4.cpp:376
bool readChartFont()
reads a structure which seems to define two chart font (only present in windows file)
Definition WKS4.cpp:1792
int version() const
return the file version
Definition WKS4.cpp:234
void sendHeaderFooter(bool header)
send the header/footer
Definition WKS4.cpp:1427
bool readChartList()
reads a list of int/cellule which seems relative to a chart : CHECKME
Definition WKS4.cpp:1994
shared_ptr< WKS4ParserInternal::State > m_state
the listener (if set)
Definition WKS4.h:165
bool readUnknown1()
reads some unknown spreadsheet zones 0:18|0:19|0:20|0:27|0:2a
Definition WKS4.cpp:2094
bool readZones()
finds the different zones (spreadsheet, chart, print, ...)
Definition WKS4.cpp:526
bool readChartUnknown()
reads an unknown structure which seems relative to a chart : CHECKME
Definition WKS4.cpp:1915
bool readChartDef()
reads a structure which seems to define a chart
Definition WKS4.cpp:1668
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition WKS4.cpp:246
shared_ptr< WKS4Spreadsheet > m_spreadsheetParser
the spreadsheet manager
Definition WKS4.h:167
bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
returns the font corresponding to an id
Definition WKS4.cpp:277
This class parses Microsoft Works spreadsheet file.
Definition WKS4Spreadsheet.h:49
Definition WKSParser.h:34
define the font properties
Definition WPSFont.h:37
Definition WPSHeader.h:32
Type
enum Type
Definition libwps_tools_win.h:46
@ UNKNOWN
Definition libwps_tools_win.h:61
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition libwps_internal.h:88
shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition libwps_internal.h:110
Internal: namespace to define internal class of WKS4Parser.
Definition WKS4.cpp:52
WPSCreator
Definition WPSDocument.h:48
the class to store a color
Definition libwps_internal.h:274

Generated on Wed Nov 29 2023 19:00:10 for libwps by doxygen 1.9.8