QuattroSpreadsheet.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_SPREADSHEET_H
23#define QUATTRO_SPREADSHEET_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#include "WKSContentListener.h"
34
36{
37class Cell;
38class SpreadSheet;
39struct State;
40}
41
42class QuattroParser;
43
49{
50public:
51 friend class QuattroParser;
52
54 explicit QuattroSpreadsheet(QuattroParser &parser);
59 {
60 m_listener = listen;
61 }
62
63protected:
65 bool checkFilePosition(long pos);
67 int version() const;
69 bool hasLICSCharacters() const;
70
72 int getNumSpreadsheets() const;
74 void sendSpreadsheet(int sId);
75
78
80
85
86 //
87 // low level
88 //
90
92 bool readCell();
96 bool readSheetSize();
100 bool readColumnSize();
102 bool readRowSize();
104 bool readHiddenColumns();
105
107 bool readCellProperty();
109 bool readCellStyle();
111 bool readUserStyle();
112
113 /* reads a cell */
114 bool readCell(Vec2i actPos, WKSContentListener::FormulaInstruction &instr, bool hasSheetId=false, int sheetId=0);
115 /* reads a formula */
116 bool readFormula(long endPos, Vec2i const &pos, int sheetId,
117 std::vector<WKSContentListener::FormulaInstruction> &formula, std::string &error);
118
119private:
124 {
125 return m_asciiFile;
126 }
129 shared_ptr<WKSContentListener> m_listener;
133 shared_ptr<QuattroSpreadsheetInternal::State> m_state;
136};
137
138#endif /* WPS4_H */
139/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
This class parses Quattro Pro spreadsheet: .wq1 and wq2.
Definition Quattro.h:48
a cellule of a Quattro spreadsheet
Definition QuattroSpreadsheet.cpp:140
This class parses Quattro Pro DOS spreadsheet file.
Definition QuattroSpreadsheet.h:49
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition QuattroSpreadsheet.cpp:548
bool readSpreadsheetName()
reads a sheet name (zone 0xde), unused...
Definition QuattroSpreadsheet.cpp:1569
bool readColumnSize()
reads the column size ( in ??? )
Definition QuattroSpreadsheet.cpp:642
bool readSpreadsheetClose()
reads a sheet header zone 0:dd (Quattro Pro wq2)
Definition QuattroSpreadsheet.cpp:1645
bool readFormula(long endPos, Vec2i const &pos, int sheetId, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &error)
Definition QuattroSpreadsheet.cpp:1803
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition QuattroSpreadsheet.cpp:541
shared_ptr< WKSContentListener > m_listener
Definition QuattroSpreadsheet.h:129
QuattroParser & m_mainParser
the listener (if set)
Definition QuattroSpreadsheet.h:131
bool readSheetSize()
reads sheet size
Definition QuattroSpreadsheet.cpp:571
libwps::DebugFile & ascii()
returns the debug file
Definition QuattroSpreadsheet.h:123
bool readHiddenColumns()
reads the list of hidden columns zone ( unused )
Definition QuattroSpreadsheet.cpp:688
bool readRowSize()
reads the column size ( in points )
Definition QuattroSpreadsheet.cpp:609
~QuattroSpreadsheet()
destructor
Definition QuattroSpreadsheet.cpp:530
void sendSpreadsheet(int sId)
send the sId'th spreadsheet
Definition QuattroSpreadsheet.cpp:2161
bool readCell()
reads a cell content data
Definition QuattroSpreadsheet.cpp:1316
libwps::DebugFile & m_asciiFile
the ascii file
Definition QuattroSpreadsheet.h:135
bool readUserStyle()
reads a Quattro Pro style ( zone 0xc9)
Definition QuattroSpreadsheet.cpp:1045
int getNumSpreadsheets() const
returns the number of spreadsheet
Definition QuattroSpreadsheet.cpp:560
shared_ptr< QuattroSpreadsheetInternal::State > m_state
the internal state
Definition QuattroSpreadsheet.h:133
void sendCellContent(QuattroSpreadsheetInternal::Cell const &cell)
send the cell data
Definition QuattroSpreadsheet.cpp:2211
QuattroSpreadsheet(QuattroSpreadsheet const &orig)
RVNGInputStreamPtr m_input
the input
Definition QuattroSpreadsheet.h:128
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition QuattroSpreadsheet.h:58
bool readSpreadsheetOpen()
reads a sheet header zone 0:dc (Quattro Pro wq2)
Definition QuattroSpreadsheet.cpp:1605
int version() const
return the file version
Definition QuattroSpreadsheet.cpp:534
bool readCellStyle()
reads a Quattro Pro cell styles (zone 0xd8)
Definition QuattroSpreadsheet.cpp:729
QuattroSpreadsheet & operator=(QuattroSpreadsheet const &orig)
bool readCellFormulaResult()
reads the result of a text formula
Definition QuattroSpreadsheet.cpp:1524
bool readCellProperty()
reads a Quattro Pro property (zone 0x9d)
Definition QuattroSpreadsheet.cpp:905
Definition WPSDebug.h:197
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition libwps_internal.h:88
shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition libwps_internal.h:115
Definition QuattroSpreadsheet.cpp:46
small class use to define a formula instruction
Definition WKSContentListener.h:57

Generated on Mon Nov 27 2023 04:06:27 for libwps by doxygen 1.9.8