WKS4Spreadsheet.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 WKS4_SPREADSHEET_H
23#define WKS4_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 WKS4Parser;
43
49{
50public:
51 friend class WKS4Parser;
52
54 explicit WKS4Spreadsheet(WKS4Parser &parser);
59 {
60 m_listener = listen;
61 }
62
63protected:
65 bool checkFilePosition(long pos);
67 int version() const;
69 bool hasLICSCharacters() const;
72
74 int getNumSpreadsheets() const;
76 void sendSpreadsheet(int sId);
77
80
82
84 bool readReportOpen();
86 bool readReportClose();
87
89 bool readFilterOpen();
91 bool readFilterClose();
92
93 //
94 // low level
95 //
97
99 bool readCell();
103 bool readSheetSize();
105 bool readColumnSize();
107 bool readHiddenColumns();
108
117
121 bool readMsWorksRowSize();
125 bool readMsWorksStyle();
126
127 /* reads a cell */
129 /* reads a formula */
130 bool readFormula(long endPos, Vec2i const &pos,
131 std::vector<WKSContentListener::FormulaInstruction> &formula, std::string &error);
132
133private:
138 {
139 return m_asciiFile;
140 }
143 shared_ptr<WKSContentListener> m_listener;
147 shared_ptr<WKS4SpreadsheetInternal::State> m_state;
150};
151
152#endif /* WPS4_H */
153/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
This class parses Microsoft Works spreadsheet or a database file.
Definition WKS4.h:48
a cellule of a WKS4 spreadsheet
Definition WKS4Spreadsheet.cpp:175
This class parses Microsoft Works spreadsheet file.
Definition WKS4Spreadsheet.h:49
libwps::DebugFile & m_asciiFile
the ascii file
Definition WKS4Spreadsheet.h:149
~WKS4Spreadsheet()
destructor
Definition WKS4Spreadsheet.cpp:492
bool readMsWorksDOSPageBreak()
reads a page break (in a dos file)
Definition WKS4Spreadsheet.cpp:1346
bool readFilterClose()
reads the filter's end zone 11:54
Definition WKS4Spreadsheet.cpp:2191
bool readReportOpen()
reads the report's header zone 17:54
Definition WKS4Spreadsheet.cpp:2225
bool readMsWorksDOSCellExtraProperty()
reads the actual cell addendum properties ( contains at least the color)
Definition WKS4Spreadsheet.cpp:1272
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition WKS4Spreadsheet.h:58
libwps::DebugFile & ascii()
returns the debug file
Definition WKS4Spreadsheet.h:137
bool readMsWorksPageBreak()
reads a page break
Definition WKS4Spreadsheet.cpp:742
bool readHiddenColumns()
reads the list of hidden columns zone ( unused )
Definition WKS4Spreadsheet.cpp:622
int getNumSpreadsheets() const
returns the number of spreadsheet
Definition WKS4Spreadsheet.cpp:527
void resetInput(RVNGInputStreamPtr input)
reset the main input
Definition WKS4Spreadsheet.cpp:496
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition WKS4Spreadsheet.cpp:515
bool readMsWorksRowSize()
reads the row size ( in ???)
Definition WKS4Spreadsheet.cpp:705
WKS4Spreadsheet & operator=(WKS4Spreadsheet const &orig)
bool readFilterOpen()
reads the filter's header zone 10:54
Definition WKS4Spreadsheet.cpp:2165
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition WKS4Spreadsheet.cpp:508
void sendCellContent(WKS4SpreadsheetInternal::Cell const &cell)
send the cell data
Definition WKS4Spreadsheet.cpp:2380
bool readFormula(long endPos, Vec2i const &pos, std::vector< WKSContentListener::FormulaInstruction > &formula, std::string &error)
Definition WKS4Spreadsheet.cpp:1884
void sendSpreadsheet(int sId)
send the sId'th spreadsheet
Definition WKS4Spreadsheet.cpp:2330
shared_ptr< WKS4SpreadsheetInternal::State > m_state
the internal state
Definition WKS4Spreadsheet.h:147
bool readCellFormulaResult()
reads the result of a text formula
Definition WKS4Spreadsheet.cpp:1719
bool readMsWorksDOSCellProperty()
reads actualCell properties
Definition WKS4Spreadsheet.cpp:1016
bool readReportClose()
reads the report's end zone 18:54
Definition WKS4Spreadsheet.cpp:2296
bool readMsWorksStyle()
reads a style
Definition WKS4Spreadsheet.cpp:772
bool readColumnSize()
reads the column size ( in ??? )
Definition WKS4Spreadsheet.cpp:576
bool readMsWorksDOSFieldProperty()
reads a field property
Definition WKS4Spreadsheet.cpp:1185
RVNGInputStreamPtr m_input
the input
Definition WKS4Spreadsheet.h:142
bool readSheetSize()
reads sheet size
Definition WKS4Spreadsheet.cpp:538
WKS4Spreadsheet(WKS4Spreadsheet const &orig)
WKS4Parser & m_mainParser
the listener (if set)
Definition WKS4Spreadsheet.h:145
int version() const
return the file version
Definition WKS4Spreadsheet.cpp:501
bool readCell()
reads a cell content data
Definition WKS4Spreadsheet.cpp:1379
bool readMsWorksColumnSize()
reads the column size ( in ???)
Definition WKS4Spreadsheet.cpp:666
shared_ptr< WKSContentListener > m_listener
Definition WKS4Spreadsheet.h:143
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 WKS4Spreadsheet.cpp:46
small class use to define a formula instruction
Definition WKSContentListener.h:57

Generated on Wed Nov 29 2023 19:00:10 for libwps by doxygen 1.9.8