JazzSSParser.hxx
Go to the documentation of this file.
1 /* -*- Mode: C++; c-default-style: "k&r"; indent-tabs-mode: nil; tab-width: 2; c-basic-offset: 2 -*- */
2 
3 /* libmwaw
4 * Version: MPL 2.0 / LGPLv2+
5 *
6 * The contents of this file are subject to the Mozilla Public License Version
7 * 2.0 (the "License"); you may not use this file except in compliance with
8 * the License or as specified alternatively below. You may obtain a copy of
9 * the License at http://www.mozilla.org/MPL/
10 *
11 * Software distributed under the License is distributed on an "AS IS" basis,
12 * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
13 * for the specific language governing rights and limitations under the
14 * License.
15 *
16 * Major Contributor(s):
17 * Copyright (C) 2002 William Lachance (wrlach@gmail.com)
18 * Copyright (C) 2002,2004 Marc Maurer (uwog@uwog.net)
19 * Copyright (C) 2004-2006 Fridrich Strba (fridrich.strba@bluewin.ch)
20 * Copyright (C) 2006, 2007 Andrew Ziem
21 * Copyright (C) 2011, 2012 Alonso Laurent (alonso@loria.fr)
22 *
23 *
24 * All Rights Reserved.
25 *
26 * For minor contributions see the git repository.
27 *
28 * Alternatively, the contents of this file may be used under the terms of
29 * the GNU Lesser General Public License Version 2 or later (the "LGPLv2+"),
30 * in which case the provisions of the LGPLv2+ are applicable
31 * instead of those above.
32 */
33 
34 /*
35  * Parser to convert spreadsheet Jazz document and some database
36  *
37  */
38 #ifndef JAZZ_SS_PARSER
39 # define JAZZ_SS_PARSER
40 
41 #include <string>
42 #include <vector>
43 
44 #include "MWAWCell.hxx"
45 #include "MWAWDebug.hxx"
46 
47 #include "MWAWParser.hxx"
48 
49 namespace JazzSSParserInternal
50 {
51 struct State;
52 
53 class SubDocument;
54 }
55 
66 class JazzSSParser final : public MWAWSpreadsheetParser
67 {
69 public:
71  JazzSSParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
73  ~JazzSSParser() final;
74 
76  bool checkHeader(MWAWHeader *header, bool strict=false) final;
77 
79  void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final;
80 
81 protected:
83  void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface);
84 
86  bool createZones();
87 
89  bool sendSpreadsheet();
90 
91  //
92  // low level
93  //
95 
97  bool readZone11(long endPos);
99  bool readCell(int id, long endPos);
101  bool readSheetSize(long endPos);
103  bool readDocument(long endPos);
104 
105  /* reads a cell */
106  bool readCell(MWAWVec2i actPos, MWAWCellContent::FormulaInstruction &instr);
107  /* reads a formula */
108  bool readFormula(long endPos, MWAWVec2i const &pos,
109  std::vector<MWAWCellContent::FormulaInstruction> &formula,
110  std::string &error);
111 
112 protected:
113 
114  //
115  // data
116  //
117 
119  std::shared_ptr<JazzSSParserInternal::State> m_state;
120 };
121 #endif
122 // vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
bool readSheetSize(long endPos)
reads sheet size
Definition: JazzSSParser.cxx:750
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface)
creates the listener which will be associated to the document
Definition: JazzSSParser.cxx:196
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
bool readCell(int id, long endPos)
reads a cell content data
Definition: JazzSSParser.cxx:477
Definition: MWAWDocument.hxx:56
bool createZones()
finds the different objects zones
Definition: JazzSSParser.cxx:220
bool readFormula(long endPos, MWAWVec2i const &pos, std::vector< MWAWCellContent::FormulaInstruction > &formula, std::string &error)
Definition: JazzSSParser.cxx:887
std::shared_ptr< JazzSSParserInternal::State > m_state
the state
Definition: JazzSSParser.hxx:119
the main class to read a Jazz spreadsheet v1 (Lotus) document and some databases. ...
Definition: JazzSSParser.hxx:66
small class use to define a sheet cell content
Definition: MWAWCell.hxx:393
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:561
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final
the main parse function
Definition: JazzSSParser.cxx:168
Internal: the structures of a JazzSSParser.
Definition: JazzSSParser.cxx:58
Internal: the subdocument of a JazzSSParserInternal.
Definition: JazzSSParser.cxx:104
JazzSSParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header)
constructor
Definition: JazzSSParser.cxx:152
bool readDocument(long endPos)
read the basic document zones (zone 15): selection, columns&#39; width, default font, preferences...
Definition: JazzSSParser.cxx:371
bool sendSpreadsheet()
sends the spreadsheet
Definition: JazzSSParser.cxx:1139
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
~JazzSSParser() final
destructor
Definition: JazzSSParser.cxx:161
Defines MWAWCell (cell content and format)
virtual class which defines the ancestor of all spreadsheet zone parser
Definition: MWAWParser.hxx:282
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: JazzSSParser.cxx:1086
bool readZone11(long endPos)
reads a query/name/range... data (zone 11)
Definition: JazzSSParser.cxx:319

Generated for libmwaw by doxygen 1.8.14