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 explicit 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::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
libwps::DebugFile
Definition: WPSDebug.h:196
QuattroSpreadsheet::ascii
libwps::DebugFile & ascii()
returns the debug file
Definition: QuattroSpreadsheet.h:123
QuattroSpreadsheet::m_listener
shared_ptr< WKSContentListener > m_listener
Definition: QuattroSpreadsheet.h:129
WKSContentListener.h
QuattroParser::hasLICSCharacters
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition: Quattro.cpp:240
libwps_internal.h
QuattroParser::version
int version() const
return the file version
Definition: Quattro.cpp:196
WKSContentListenerPtr
shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:113
QuattroParser
This class parses Quattro Pro spreadsheet: .wq1 and wq2.
Definition: Quattro.h:47
QuattroParser::m_listener
shared_ptr< WKSContentListener > m_listener
Definition: Quattro.h:126
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
QuattroSpreadsheet
This class parses Quattro Pro DOS spreadsheet file.
Definition: QuattroSpreadsheet.h:48
QuattroParser::QuattroSpreadsheet
friend class QuattroSpreadsheet
Definition: Quattro.h:50
WKSParser::operator=
WKSParser & operator=(const WKSParser &)
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
WKSParser::m_asciiFile
libwps::DebugFile m_asciiFile
the debug file
Definition: WKSParser.h:75
QuattroSpreadsheetInternal::Cell
a cellule of a Quattro spreadsheet
Definition: QuattroSpreadsheet.cpp:138
Vec2< int >
WKSContentListener::FormulaInstruction
small class use to define a formula instruction
Definition: WKSContentListener.h:54
WPSDebug.h
QuattroSpreadsheetInternal
Definition: QuattroSpreadsheet.cpp:44
QuattroSpreadsheet::m_asciiFile
libwps::DebugFile & m_asciiFile
the ascii file
Definition: QuattroSpreadsheet.h:135