Quattro.h Source File documentation

Quattro.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 QUATTRO_H
23#define QUATTRO_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 QuattroParserInternal
36{
37class SubDocument;
38struct State;
39}
40
41class QuattroSpreadsheet;
42
47 class QuattroParser : public WKSParser
48{
49 friend class QuattroParserInternal::SubDocument;
50 friend class QuattroSpreadsheet;
51public:
53 QuattroParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header,
54 libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN);
56 ~QuattroParser();
58 void parse(librevenge::RVNGSpreadsheetInterface *documentInterface);
60 bool checkHeader(WPSHeader *header, bool strict=false);
61
62protected:
64 bool checkFilePosition(long pos);
66 int version() const;
70 libwps_tools_win::Font::Type getDefaultFontType() const;
72 bool hasLICSCharacters() const;
73
74 //
75 // interface with QuattroSpreadsheet
76 //
77
79 bool getColor(int id, WPSColor &color) const;
81 bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const;
82
84 shared_ptr<WKSContentListener> createListener(librevenge::RVNGSpreadsheetInterface *interface);
86 void sendHeaderFooter(bool header);
87
88 //
89 // low level
90 //
91
93 bool readZones();
95 bool readZone();
96
98
100 bool readUserFonts();
101
103 bool readHeaderFooter(bool header);
104
106 bool readFieldName();
107
109
111 bool readChartName();
112
114 bool readChartDef();
115
117
119 bool readWindowRecord();
124 bool readUnknown1();
125
126 shared_ptr<WKSContentListener> m_listener;
128 shared_ptr<QuattroParserInternal::State> m_state;
130 shared_ptr<QuattroSpreadsheet> m_spreadsheetParser;
131};
132
133#endif /* WPS4_H */
134/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WKSParser.h
QuattroParserInternal::SubDocument
Internal: the subdocument of a WPS4Parser.
Definition Quattro.cpp:64
QuattroParser::parse
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface)
called by WPSDocument to parse the file
Definition Quattro.cpp:248
QuattroParser::QuattroParser
QuattroParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header, libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN)
constructor
Definition Quattro.cpp:183
QuattroParser::version
int version() const
return the file version
Definition Quattro.cpp:196
QuattroParser::QuattroSpreadsheet
friend class QuattroSpreadsheet
Definition Quattro.h:50
QuattroParser::~QuattroParser
~QuattroParser()
destructor
Definition Quattro.cpp:192
QuattroParser::readFieldName
bool readFieldName()
read a list of field name + ...
Definition Quattro.cpp:914
QuattroParser::m_state
shared_ptr< QuattroParserInternal::State > m_state
the listener (if set)
Definition Quattro.h:128
QuattroParser::m_spreadsheetParser
shared_ptr< QuattroSpreadsheet > m_spreadsheetParser
the spreadsheet manager
Definition Quattro.h:130
QuattroParser::readHeaderFooter
bool readHeaderFooter(bool header)
reads the header/footer
Definition Quattro.cpp:862
QuattroParser::createListener
shared_ptr< WKSContentListener > createListener(librevenge::RVNGSpreadsheetInterface *interface)
creates the main listener
Definition Quattro.cpp:292
QuattroParser::getFont
bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const
returns the font corresponding to an id
Definition Quattro.cpp:227
QuattroParser::getColor
bool getColor(int id, WPSColor &color) const
returns the color corresponding to an id
Definition Quattro.cpp:222
QuattroParser::checkFilePosition
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition Quattro.cpp:201
QuattroParser::readWindowRecord
bool readWindowRecord()
reads windows record 0:7|0:9
Definition Quattro.cpp:1111
QuattroParser::m_listener
shared_ptr< WKSContentListener > m_listener
Definition Quattro.h:126
QuattroParser::readZone
bool readZone()
reads a zone
Definition Quattro.cpp:425
QuattroParser::sendHeaderFooter
void sendHeaderFooter(bool header)
send the header/footer
Definition Quattro.cpp:834
QuattroParser::readZones
bool readZones()
finds the different zones (spreadsheet, chart, print, ...)
Definition Quattro.cpp:388
QuattroParser::checkHeader
bool checkHeader(WPSHeader *header, bool strict=false)
checks if the document header is correct (or not)
Definition Quattro.cpp:317
QuattroParser::readChartDef
bool readChartDef()
reads a structure which seems to define a chart
Definition Quattro.cpp:981
QuattroParser::readUnknown1
bool readUnknown1()
reads some unknown spreadsheet zones 0:18|0:19|0:20|0:27|0:2a
Definition Quattro.cpp:1160
QuattroParser::readUserFonts
bool readUserFonts()
reads the user fonts
Definition Quattro.cpp:764
QuattroParser::getDefaultFontType
libwps_tools_win::Font::Type getDefaultFontType() const
returns the default font type, ie.
Definition Quattro.cpp:214
QuattroParser::readChartName
bool readChartName()
reads the chart name or title
Definition Quattro.cpp:1068
QuattroParser::hasLICSCharacters
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition Quattro.cpp:240
QuattroSpreadsheet
This class parses Quattro Pro DOS spreadsheet file.
Definition QuattroSpreadsheet.h:49
WKSParser::WKSParser
WKSParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header)
Definition WKSParser.cpp:30
WPSFont
define the font properties
Definition WPSFont.h:37
WPSHeader
Definition WPSHeader.h:32
libwps_tools_win::Font::Type
Type
enum Type
Definition libwps_tools_win.h:46
libwps_tools_win::Font::UNKNOWN
@ UNKNOWN
Definition libwps_tools_win.h:61
libwps.h
libwps_internal.h
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition libwps_internal.h:88
WPSHeaderPtr
shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition libwps_internal.h:110
libwps_tools_win.h
QuattroParserInternal
Internal: namespace to define internal class of QuattroParser.
Definition Quattro.cpp:50
QuattroParserInternal::State
the state of QuattroParser
Definition Quattro.cpp:113
WPSColor
the class to store a color
Definition libwps_internal.h:274