MultiplanParser.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 Multiplan document
36 *
37 */
38#ifndef MULTIPLAN_PARSER
39# define MULTIPLAN_PARSER
40
41#include <vector>
42
43#include "MWAWCell.hxx"
44#include "MWAWDebug.hxx"
45
46#include "MWAWParser.hxx"
47
49{
50struct State;
51
52class SubDocument;
53}
54
61{
63public:
65 MultiplanParser(MWAWInputStreamPtr const &input, MWAWRSRCParserPtr const &rsrcParser, MWAWHeader *header);
67 ~MultiplanParser() final;
68
70 bool checkHeader(MWAWHeader *header, bool strict=false) final;
71
73 void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final;
74
75protected:
77 void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface);
78
80 bool createZones();
81
83 bool readColumnsPos();
85 bool readHeaderFooter();
87 bool readPrinterInfo();
89 bool readPrinterMessage();
90
92 bool readZonesList();
94 bool readZone1(MWAWEntry const &entry);
96 bool readCellDataPosition(MWAWEntry const &entry);
98 bool readLink(int pos, MWAWCellContent::FormulaInstruction &instruction);
100 bool readLinkFilename(int pos, MWAWCellContent::FormulaInstruction &instruction);
102 bool readSharedData(int pos, int cellType, MWAWVec2i const &cellPos, MWAWCellContent &content);
104 bool readName(int pos, MWAWCellContent::FormulaInstruction &instruction);
106 bool readZoneB();
108 bool readZoneC();
109
111 bool sendSpreadsheet();
113 bool sendText(MWAWEntry const &entry);
115 bool sendCell(MWAWVec2i const &cellPos, int pos);
116protected:
118 bool readDouble(double &value);
120 bool readFormula(MWAWVec2i const &cellPos, std::vector<MWAWCellContent::FormulaInstruction> &formula, long endPos, std::string &extra);
121
122 //
123 // data
124 //
125
127 std::shared_ptr<MultiplanParserInternal::State> m_state;
128};
129#endif
130// vim: set filetype=cpp tabstop=2 shiftwidth=2 cindent autoindent smartindent noexpandtab:
Defines MWAWCell (cell content and format)
small class use to define a sheet cell content
Definition: MWAWCell.hxx:394
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:47
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:57
virtual class which defines the ancestor of all spreadsheet zone parser
Definition: MWAWParser.hxx:283
Internal: the subdocument of a MultiplanParserInternal.
Definition: MultiplanParser.cxx:122
the main class to read a Multiplan document
Definition: MultiplanParser.hxx:61
bool checkHeader(MWAWHeader *header, bool strict=false) final
checks if the document header is correct (or not)
Definition: MultiplanParser.cxx:1368
bool readFormula(MWAWVec2i const &cellPos, std::vector< MWAWCellContent::FormulaInstruction > &formula, long endPos, std::string &extra)
try to read a formula
Definition: MultiplanParser.cxx:1069
bool sendSpreadsheet()
try to send the main spreadsheet
Definition: MultiplanParser.cxx:1666
bool readColumnsPos()
read the columns limits pos
Definition: MultiplanParser.cxx:384
bool sendCell(MWAWVec2i const &cellPos, int pos)
try to send a cell
Definition: MultiplanParser.cxx:1454
bool readName(int pos, MWAWCellContent::FormulaInstruction &instruction)
reads a name and returns the cell's instruction
Definition: MultiplanParser.cxx:802
bool sendText(MWAWEntry const &entry)
try to send a text zone
Definition: MultiplanParser.cxx:1428
bool readHeaderFooter()
read the header/footer strings, ...
Definition: MultiplanParser.cxx:269
bool readLinkFilename(int pos, MWAWCellContent::FormulaInstruction &instruction)
read a link filename
Definition: MultiplanParser.cxx:647
bool readSharedData(int pos, int cellType, MWAWVec2i const &cellPos, MWAWCellContent &content)
read a shared data
Definition: MultiplanParser.cxx:695
void createDocument(librevenge::RVNGSpreadsheetInterface *documentInterface)
creates the listener which will be associated to the document
Definition: MultiplanParser.cxx:213
void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final
the main parse function
Definition: MultiplanParser.cxx:185
bool readLink(int pos, MWAWCellContent::FormulaInstruction &instruction)
read a link given a position
Definition: MultiplanParser.cxx:551
~MultiplanParser() final
destructor
Definition: MultiplanParser.cxx:178
bool readPrinterInfo()
read the printer information
Definition: MultiplanParser.cxx:295
bool readCellDataPosition(MWAWEntry const &entry)
read the cell data position
Definition: MultiplanParser.cxx:516
bool readZonesList()
read the spreadsheet zone list
Definition: MultiplanParser.cxx:404
bool createZones()
finds the different objects zones
Definition: MultiplanParser.cxx:245
bool readZoneB()
read an unknown zone
Definition: MultiplanParser.cxx:856
std::shared_ptr< MultiplanParserInternal::State > m_state
the state
Definition: MultiplanParser.hxx:127
bool readZoneC()
read an unknown zone
Definition: MultiplanParser.cxx:906
bool readPrinterMessage()
read the printer message
Definition: MultiplanParser.cxx:362
bool readZone1(MWAWEntry const &entry)
read an unknown zone: two blocks of 60 bytes
Definition: MultiplanParser.cxx:488
bool readDouble(double &value)
try to read a double value
Definition: MultiplanParser.cxx:946
std::shared_ptr< MWAWRSRCParser > MWAWRSRCParserPtr
a smart pointer of MWAWRSRCParser
Definition: libmwaw_internal.hxx:561
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
Internal: the structures of a MultiplanParser.
Definition: MultiplanParser.cxx:58
Definition: MWAWDocument.hxx:57

Generated on Wed May 3 2023 07:18:29 for libmwaw by doxygen 1.9.6