QuattroDosSpreadsheet.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_DOS_SPREADSHEET_H
23#define QUATTRO_DOS_SPREADSHEET_H
24
25#include <ostream>
26#include <map>
27#include <vector>
28
29#include <librevenge-stream/librevenge-stream.h>
30
31#include "libwps_internal.h"
32
33#include "WPSDebug.h"
34#include "WKSContentListener.h"
35
37{
38class Cell;
39class SpreadSheet;
40struct State;
41}
42
44
50{
51public:
52 friend class QuattroDosParser;
53
60 {
61 m_listener = listen;
62 }
63
64protected:
66 bool checkFilePosition(long pos);
68 int version() const;
69
71 int getNumSpreadsheets() const;
73 librevenge::RVNGString getSheetName(int id) const;
75 void sendSpreadsheet(int sId, std::map<Vec2i,Vec2i> const &chartCellMap);
76
78 void sendCellContent(QuattroDosSpreadsheetInternal::Cell const &cell, int sheetId,
79 int cellChartSheetId=-1, Vec2f const &chartSize=Vec2f());
80
82
87
88 //
89 // low level
90 //
92
94 bool readCell();
98 bool readSheetSize();
100 bool readSpreadsheetName();
102 bool readColumnSize();
104 bool readRowSize();
106 bool readHiddenColumns();
107
109 bool readCellProperty();
111 bool readCellStyle();
113 bool readUserStyle();
114
115 /* reads a cell */
116 bool readCell(Vec2i actPos, WKSContentListener::FormulaInstruction &instr, bool hasSheetId=false, int sheetId=0);
117 /* reads a formula */
118 bool readFormula(long endPos, Vec2i const &pos, int sheetId,
119 std::vector<WKSContentListener::FormulaInstruction> &formula, std::string &error);
120
121private:
126 {
127 return m_asciiFile;
128 }
129
131 std::shared_ptr<WKSContentListener> m_listener;
135 std::shared_ptr<QuattroDosSpreadsheetInternal::State> m_state;
138};
139
140#endif /* WPS4_H */
141/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
This class parses Quattro Pro spreadsheet: .wq1 and wq2.
Definition QuattroDos.h:49
a cellule of a Quattro spreadsheet
Definition QuattroDosSpreadsheet.cpp:154
std::shared_ptr< QuattroDosSpreadsheetInternal::State > m_state
the internal state
Definition QuattroDosSpreadsheet.h:135
bool readSpreadsheetOpen()
reads a sheet header zone 0:dc (Quattro Pro wq2)
Definition QuattroDosSpreadsheet.cpp:1698
bool readHiddenColumns()
reads the list of hidden columns zone ( unused )
Definition QuattroDosSpreadsheet.cpp:796
bool readColumnSize()
reads the column size ( in ??? )
Definition QuattroDosSpreadsheet.cpp:750
QuattroDosSpreadsheet & operator=(QuattroDosSpreadsheet const &orig)=delete
QuattroDosSpreadsheet(QuattroDosSpreadsheet const &orig)=delete
libwps::DebugFile & m_asciiFile
the ascii file
Definition QuattroDosSpreadsheet.h:137
QuattroDosParser & m_mainParser
the listener (if set)
Definition QuattroDosSpreadsheet.h:133
bool readSpreadsheetName()
reads a sheet name (zone 0xde), unused...
Definition QuattroDosSpreadsheet.cpp:1661
bool readCell()
reads a cell content data
Definition QuattroDosSpreadsheet.cpp:1424
librevenge::RVNGString getSheetName(int id) const
returns the name of the id's spreadsheet
Definition QuattroDosSpreadsheet.cpp:665
~QuattroDosSpreadsheet()
destructor
Definition QuattroDosSpreadsheet.cpp:637
libwps::DebugFile & ascii()
returns the debug file
Definition QuattroDosSpreadsheet.h:125
RVNGInputStreamPtr m_input
the input
Definition QuattroDosSpreadsheet.h:130
std::shared_ptr< WKSContentListener > m_listener
Definition QuattroDosSpreadsheet.h:131
void sendCellContent(QuattroDosSpreadsheetInternal::Cell const &cell, int sheetId, int cellChartSheetId=-1, Vec2f const &chartSize=Vec2f())
send the cell data
Definition QuattroDosSpreadsheet.cpp:2310
bool readCellStyle()
reads a Quattro Pro cell styles (zone 0xd8)
Definition QuattroDosSpreadsheet.cpp:837
bool readSheetSize()
reads sheet size
Definition QuattroDosSpreadsheet.cpp:676
int getNumSpreadsheets() const
returns the number of spreadsheet
Definition QuattroDosSpreadsheet.cpp:660
void sendSpreadsheet(int sId, std::map< Vec2i, Vec2i > const &chartCellMap)
send the sId'th spreadsheet
Definition QuattroDosSpreadsheet.cpp:2257
bool readCellFormulaResult()
reads the result of a text formula
Definition QuattroDosSpreadsheet.cpp:1620
QuattroDosSpreadsheet(QuattroDosParser &parser)
constructor
Definition QuattroDosSpreadsheet.cpp:628
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition QuattroDosSpreadsheet.h:59
bool readRowSize()
reads the column size ( in points )
Definition QuattroDosSpreadsheet.cpp:717
bool readUserStyle()
reads a Quattro Pro style ( zone 0xc9)
Definition QuattroDosSpreadsheet.cpp:1165
int version() const
return the file version
Definition QuattroDosSpreadsheet.cpp:641
bool readFormula(long endPos, Vec2i const &pos, int sheetId, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &error)
Definition QuattroDosSpreadsheet.cpp:1903
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition QuattroDosSpreadsheet.cpp:648
bool readCellProperty()
reads a Quattro Pro property (zone 0x9d)
Definition QuattroDosSpreadsheet.cpp:1025
bool readSpreadsheetClose()
reads a sheet header zone 0:dd (Quattro Pro wq2)
Definition QuattroDosSpreadsheet.cpp:1738
friend class QuattroDosParser
Definition QuattroDosSpreadsheet.h:52
Definition WPSDebug.h:208
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition libwps_internal.h:114
Vec2< int > Vec2i
Vec2 of int.
Definition libwps_internal.h:702
Vec2< float > Vec2f
Vec2 of float.
Definition libwps_internal.h:704
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition libwps_internal.h:87
Definition QuattroDosSpreadsheet.cpp:48
the state of QuattroDosSpreadsheet
Definition QuattroDosSpreadsheet.cpp:511
small class use to define a formula instruction
Definition WKSContentListener.h:58

Generated on Sat Jul 19 2025 05:24:39 for libwps by doxygen 1.14.0