JazzSSParser.hxx Source File documentation

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
49namespace JazzSSParserInternal
50{
51struct State;
52
53class SubDocument;
54}
55
66 class JazzSSParser final : public MWAWSpreadsheetParser
67{
68 friend class JazzSSParserInternal::SubDocument;
69public:
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
81protected:
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
112protected:
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:
MWAWCell.hxx
Defines MWAWCell (cell content and format)
MWAWDebug.hxx
MWAWParser.hxx
JazzSSParserInternal::SubDocument
Internal: the subdocument of a JazzSSParserInternal.
Definition: JazzSSParser.cxx:105
JazzSSParser
the main class to read a Jazz spreadsheet v1 (Lotus) document and some databases.
Definition: JazzSSParser.hxx:67
JazzSSParser::readZone11
bool readZone11(long endPos)
reads a query/name/range... data (zone 11)
Definition: JazzSSParser.cxx:319
JazzSSParser::checkHeader
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: JazzSSParser.cxx:1083
JazzSSParser::readDocument
bool readDocument(long endPos)
read the basic document zones (zone 15): selection, columns' width, default font, preferences....
Definition: JazzSSParser.cxx:371
JazzSSParser::readFormula
bool readFormula(long endPos, MWAWVec2i const &pos, std::vector< MWAWCellContent::FormulaInstruction > &formula, std::string &error)
Definition: JazzSSParser.cxx:884
JazzSSParser::~JazzSSParser
~JazzSSParser() final
destructor
Definition: JazzSSParser.cxx:161
JazzSSParser::createDocument
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface)
creates the listener which will be associated to the document
Definition: JazzSSParser.cxx:196
JazzSSParser::m_state
std::shared_ptr< JazzSSParserInternal::State > m_state
the state
Definition: JazzSSParser.hxx:119
JazzSSParser::createZones
bool createZones()
finds the different objects zones
Definition: JazzSSParser.cxx:220
JazzSSParser::readCell
bool readCell(int id, long endPos)
reads a cell content data
Definition: JazzSSParser.cxx:477
JazzSSParser::readSheetSize
bool readSheetSize(long endPos)
reads sheet size
Definition: JazzSSParser.cxx:750
JazzSSParser::sendSpreadsheet
bool sendSpreadsheet()
sends the spreadsheet
Definition: JazzSSParser.cxx:1136
JazzSSParser::parse
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final
the main parse function
Definition: JazzSSParser.cxx:168
MWAWCellContent
small class use to define a sheet cell content
Definition: MWAWCell.hxx:394
MWAWHeader
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:57
MWAWSpreadsheetParser
virtual class which defines the ancestor of all spreadsheet zone parser
Definition: MWAWParser.hxx:283
MWAWVec2< int >
MWAWRSRCParserPtr
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:561
MWAWInputStreamPtr
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
JazzSSParserInternal
Internal: the structures of a JazzSSParser.
Definition: JazzSSParser.cxx:59
librevenge
Definition: MWAWDocument.hxx:57