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 {
50 struct State;
51 
52 class SubDocument;
53 }
54 
61 {
63 public:
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 
75 protected:
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);
116 protected:
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:
a function used by MWAWDocument to store the version of document
Definition: MWAWHeader.hxx:56
void parse(MWAWListenerPtr &listener, libmwaw::SubDocumentType type) final
the parser function
Definition: MultiplanParser.cxx:144
Definition: MWAWDocument.hxx:56
Internal: the subdocument of a MultiplanParserInternal.
Definition: MultiplanParser.cxx:121
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
std::shared_ptr< MWAWInputStream > MWAWInputStreamPtr
a smart pointer of MWAWInputStream
Definition: libmwaw_internal.hxx:551
Defines MWAWCell (cell content and format)
Internal: the structures of a MultiplanParser.
Definition: MultiplanParser.cxx:57
basic class to store an entry in a file This contained :
Definition: MWAWEntry.hxx:46
the main class to read a Multiplan document
Definition: MultiplanParser.hxx:60
virtual class which defines the ancestor of all spreadsheet zone parser
Definition: MWAWParser.hxx:282

Generated on Sun Sep 27 2020 08:28:54 for libmwaw by doxygen 1.8.13