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 {
37 class Cell;
38 class SpreadSheet;
39 struct State;
40 }
41 
42 class QuattroParser;
43 
49 {
50 public:
51  friend class QuattroParser;
52 
54  explicit QuattroSpreadsheet(QuattroParser &parser);
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 
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:
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: */
bool readUserStyle()
reads a Quattro Pro style ( zone 0xc9)
Definition: QuattroSpreadsheet.cpp:1051
RVNGInputStreamPtr m_input
the input
Definition: QuattroSpreadsheet.h:128
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: QuattroSpreadsheet.h:58
shared_ptr< QuattroSpreadsheetInternal::State > m_state
the internal state
Definition: QuattroSpreadsheet.h:133
~QuattroSpreadsheet()
destructor
Definition: QuattroSpreadsheet.cpp:532
bool readHiddenColumns()
reads the list of hidden columns zone ( unused )
Definition: QuattroSpreadsheet.cpp:694
Definition: WPSDebug.h:196
bool readSpreadsheetClose()
reads a sheet header zone 0:dd (Quattro Pro wq2)
Definition: QuattroSpreadsheet.cpp:1653
bool readRowSize()
reads the column size ( in points )
Definition: QuattroSpreadsheet.cpp:615
void sendSpreadsheet(int sId)
send the sId'th spreadsheet
Definition: QuattroSpreadsheet.cpp:2171
libwps::DebugFile & ascii()
returns the debug file
Definition: QuattroSpreadsheet.h:123
bool readFormula(long endPos, Vec2i const &pos, int sheetId, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &error)
Definition: QuattroSpreadsheet.cpp:1811
shared_ptr< WKSContentListener > m_listener
Definition: QuattroSpreadsheet.h:129
bool readColumnSize()
reads the column size ( in ??? )
Definition: QuattroSpreadsheet.cpp:648
QuattroParser & m_mainParser
the listener (if set)
Definition: QuattroSpreadsheet.h:131
QuattroSpreadsheet & operator=(QuattroSpreadsheet const &orig)
bool readSpreadsheetOpen()
reads a sheet header zone 0:dc (Quattro Pro wq2)
Definition: QuattroSpreadsheet.cpp:1613
int version() const
return the file version
Definition: QuattroSpreadsheet.cpp:536
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: QuattroSpreadsheet.cpp:550
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition: QuattroSpreadsheet.cpp:543
shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:129
bool readSpreadsheetName()
reads a sheet name (zone 0xde), unused...
Definition: QuattroSpreadsheet.cpp:1577
This class parses Quattro Pro spreadsheet: .wq1 and wq2.
Definition: Quattro.h:47
bool readSheetSize()
reads sheet size
Definition: QuattroSpreadsheet.cpp:573
This class parses Quattro Pro DOS spreadsheet file.
Definition: QuattroSpreadsheet.h:48
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:102
int getNumSpreadsheets() const
returns the number of spreadsheet
Definition: QuattroSpreadsheet.cpp:562
bool readCellFormulaResult()
reads the result of a text formula
Definition: QuattroSpreadsheet.cpp:1532
a cellule of a Quattro spreadsheet
Definition: QuattroSpreadsheet.cpp:139
bool readCellProperty()
reads a Quattro Pro property (zone 0x9d)
Definition: QuattroSpreadsheet.cpp:911
QuattroSpreadsheet(QuattroParser &parser)
constructor
Definition: QuattroSpreadsheet.cpp:525
void sendCellContent(QuattroSpreadsheetInternal::Cell const &cell)
send the cell data
Definition: QuattroSpreadsheet.cpp:2221
small class use to define a formula instruction
Definition: WKSContentListener.h:56
bool readCell()
reads a cell content data
Definition: QuattroSpreadsheet.cpp:1324
bool readCellStyle()
reads a Quattro Pro cell styles (zone 0xd8)
Definition: QuattroSpreadsheet.cpp:735
Definition: QuattroSpreadsheet.cpp:45
libwps::DebugFile & m_asciiFile
the ascii file
Definition: QuattroSpreadsheet.h:135

Generated on Sat Jul 29 2017 15:32:22 for libwps by doxygen 1.8.8