QuattroSpreadsheet.h Source File documentation

- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

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
35 namespace QuattroSpreadsheetInternal
36 {
37 class Cell;
38 class SpreadSheet;
39 struct State;
40 }
41
42 class QuattroParser;
43
48 class QuattroSpreadsheet
49 {
50 public:
51 friend class QuattroParser;
52
54 QuattroSpreadsheet(QuattroParser &parser);
56 ~QuattroSpreadsheet();
58 void setListener(WKSContentListenerPtr &listen)
59 {
60 m_listener = listen;
61 }
62
63 protected:
65 bool checkFilePosition(long pos);
67 int version() const;
69 bool hasLICSCharacters() const;
70
72 int getNumSpreadsheets() const;
74 void sendSpreadsheet(int sId);
75
77 void sendCellContent(QuattroSpreadsheetInternal::Cell const &cell);
78
80
82 bool readSpreadsheetOpen();
84 bool readSpreadsheetClose();
85
86 //
87 // low level
88 //
90
92 bool readCell();
94 bool readCellFormulaResult();
96 bool readSheetSize();
98 bool readSpreadsheetName();
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
119 private:
120 QuattroSpreadsheet(QuattroSpreadsheet const &orig);
121 QuattroSpreadsheet &operator=(QuattroSpreadsheet const &orig);
123 libwps::DebugFile &ascii()
124 {
125 return m_asciiFile;
126 }
128 RVNGInputStreamPtr m_input;
129 shared_ptr<WKSContentListener> m_listener;
130 QuattroParser &m_mainParser;
133 shared_ptr<QuattroSpreadsheetInternal::State> m_state;
135 libwps::DebugFile &m_asciiFile;
136 };
137
138 #endif /* WPS4_H */
139 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
QuattroSpreadsheet::readUserStyle
bool readUserStyle()
reads a Quattro Pro style ( zone 0xc9)
Definition: QuattroSpreadsheet.cpp:1016
QuattroSpreadsheet::m_input
RVNGInputStreamPtr m_input
the input
Definition: QuattroSpreadsheet.h:128
QuattroSpreadsheet::setListener
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: QuattroSpreadsheet.h:58
QuattroSpreadsheet::m_state
shared_ptr< QuattroSpreadsheetInternal::State > m_state
the internal state
Definition: QuattroSpreadsheet.h:133
QuattroSpreadsheet::~QuattroSpreadsheet
~QuattroSpreadsheet()
destructor
Definition: QuattroSpreadsheet.cpp:488
QuattroSpreadsheet::readHiddenColumns
bool readHiddenColumns()
reads the list of hidden columns zone ( unused )
Definition: QuattroSpreadsheet.cpp:659
libwps::DebugFile
Definition: WPSDebug.h:196
QuattroSpreadsheet::readSpreadsheetClose
bool readSpreadsheetClose()
reads a sheet header zone 0:dd (Quattro Pro wq2)
Definition: QuattroSpreadsheet.cpp:1616
QuattroSpreadsheet::readRowSize
bool readRowSize()
reads the column size ( in points )
Definition: QuattroSpreadsheet.cpp:568
QuattroSpreadsheet::sendSpreadsheet
void sendSpreadsheet(int sId)
send the sId'th spreadsheet
Definition: QuattroSpreadsheet.cpp:2132
QuattroSpreadsheet::ascii
libwps::DebugFile & ascii()
returns the debug file
Definition: QuattroSpreadsheet.h:123
QuattroSpreadsheet::readFormula
bool readFormula(long endPos, Vec2i const &pos, int sheetId, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &error)
Definition: QuattroSpreadsheet.cpp:1774
QuattroSpreadsheet::m_listener
shared_ptr< WKSContentListener > m_listener
Definition: QuattroSpreadsheet.h:129
WKSContentListener.h
QuattroSpreadsheet::readColumnSize
bool readColumnSize()
reads the column size ( in ??? )
Definition: QuattroSpreadsheet.cpp:613
QuattroSpreadsheet::m_mainParser
QuattroParser & m_mainParser
the listener (if set)
Definition: QuattroSpreadsheet.h:131
QuattroSpreadsheet::operator=
QuattroSpreadsheet & operator=(QuattroSpreadsheet const &orig)
QuattroSpreadsheet::readSpreadsheetOpen
bool readSpreadsheetOpen()
reads a sheet header zone 0:dc (Quattro Pro wq2)
Definition: QuattroSpreadsheet.cpp:1576
libwps_internal.h
QuattroSpreadsheet::version
int version() const
return the file version
Definition: QuattroSpreadsheet.cpp:492
QuattroSpreadsheet::checkFilePosition
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: QuattroSpreadsheet.cpp:506
QuattroSpreadsheet::hasLICSCharacters
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition: QuattroSpreadsheet.cpp:499
WKSContentListenerPtr
shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:113
QuattroSpreadsheet::readSpreadsheetName
bool readSpreadsheetName()
reads a sheet name (zone 0xde), unused...
Definition: QuattroSpreadsheet.cpp:1540
QuattroParser
This class parses Quattro Pro spreadsheet: .wq1 and wq2.
Definition: Quattro.h:47
QuattroSpreadsheet::readSheetSize
bool readSheetSize()
reads sheet size
Definition: QuattroSpreadsheet.cpp:529
QuattroSpreadsheet
This class parses Quattro Pro DOS spreadsheet file.
Definition: QuattroSpreadsheet.h:48
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
QuattroSpreadsheet::getNumSpreadsheets
int getNumSpreadsheets() const
returns the number of spreadsheet
Definition: QuattroSpreadsheet.cpp:518
QuattroSpreadsheet::readCellFormulaResult
bool readCellFormulaResult()
reads the result of a text formula
Definition: QuattroSpreadsheet.cpp:1495
QuattroSpreadsheetInternal::Cell
a cellule of a Quattro spreadsheet
Definition: QuattroSpreadsheet.cpp:138
QuattroSpreadsheet::readCellProperty
bool readCellProperty()
reads a Quattro Pro property (zone 0x9d)
Definition: QuattroSpreadsheet.cpp:876
Vec2< int >
QuattroSpreadsheet::QuattroSpreadsheet
QuattroSpreadsheet(QuattroParser &parser)
constructor
Definition: QuattroSpreadsheet.cpp:481
QuattroSpreadsheet::sendCellContent
void sendCellContent(QuattroSpreadsheetInternal::Cell const &cell)
send the cell data
Definition: QuattroSpreadsheet.cpp:2176
WKSContentListener::FormulaInstruction
small class use to define a formula instruction
Definition: WKSContentListener.h:54
QuattroSpreadsheet::readCell
bool readCell()
reads a cell content data
Definition: QuattroSpreadsheet.cpp:1287
WPSDebug.h
QuattroSpreadsheet::readCellStyle
bool readCellStyle()
reads a Quattro Pro cell styles (zone 0xd8)
Definition: QuattroSpreadsheet.cpp:700
QuattroSpreadsheetInternal
Definition: QuattroSpreadsheet.cpp:44
QuattroSpreadsheet::m_asciiFile
libwps::DebugFile & m_asciiFile
the ascii file
Definition: QuattroSpreadsheet.h:135