- Main Page
- Namespaces
- Classes
- Files

- File List
- File Members

Lotus.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 LOTUS_H
23 #define LOTUS_H
24
25 #include <vector>
26
27 #include <librevenge-stream/librevenge-stream.h>
28 #include "libwps_internal.h"
29 #include "libwps_tools_win.h"
30
31 #include "WKSParser.h"
32
33 namespace LotusParserInternal
34 {
35 class SubDocument;
36 struct State;
37 }
38
39 class LotusGraph;
40 class LotusSpreadsheet;
41 class LotusStyleManager;
42
47 class LotusParser : public WKSParser
48 {
49 friend class LotusParserInternal::SubDocument;
50 friend class LotusGraph;
51 friend class LotusSpreadsheet;
52 friend class LotusStyleManager;
53 public:
55 LotusParser(RVNGInputStreamPtr &input, WPSHeaderPtr &header,
56 libwps_tools_win::Font::Type encoding=libwps_tools_win::Font::UNKNOWN);
58 ~LotusParser();
60 void parse(librevenge::RVNGSpreadsheetInterface *documentInterface);
62 bool checkHeader(WPSHeader *header, bool strict=false);
63
64 protected:
66 bool checkFilePosition(long pos);
68 int version() const;
69
70 //
71 // interface
72 //
73
75 bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const;
79 libwps_tools_win::Font::Type getDefaultFontType() const;
80
81 //
82 // interface with LotusGraph
83 //
84
86 bool hasGraphics(int sheetId) const;
88 void sendGraphics(int sheetId);
89
91 shared_ptr<WKSContentListener> createListener(librevenge::RVNGSpreadsheetInterface *interface);
92
93 //
94 // low level
95 //
96
98 bool readZones();
100 bool readDataZone();
102 bool readZone();
103
105
107 bool readMacFontName(long endPos);
109 bool readFMTFontName();
111 bool readLinkZone();
113 bool readDocumentInfoMac(long endPos);
114
116
118 bool readChartDefinition();
120 bool readChartName();
121
123
124
125 shared_ptr<WKSContentListener> m_listener;
126 shared_ptr<LotusParserInternal::State> m_state;
129 shared_ptr<LotusStyleManager> m_styleManager;
131 shared_ptr<LotusGraph> m_graphParser;
133 shared_ptr<LotusSpreadsheet> m_spreadsheetParser;
134 };
135
136 #endif /* LOTUS_H */
137 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
LotusStyleManager::m_state
shared_ptr< LotusStyleManagerInternal::State > m_state
the internal state
Definition: LotusStyleManager.h:112
libwps_tools_win.h
WPSFont
define the font properties
Definition: WPSFont.h:36
LotusStyleManager::LotusParser
friend class LotusParser
Definition: LotusStyleManager.h:48
libwps_tools_win::Font::Type
Type
enum Type
Definition: libwps_tools_win.h:46
LotusStyleManager::version
int version() const
return the file version
Definition: LotusStyleManager.cpp:397
LotusGraph
This class parses Microsoft Works graph file.
Definition: LotusGraph.h:50
LotusParser
This class parses a WK2..WK4 Lotus spreadsheet.
Definition: Lotus.h:47
WPSHeaderPtr
shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:108
LotusParserInternal::SubDocument
Internal: the subdocument of a LotusParser.
Definition: Lotus.cpp:65
LotusStyleManager::checkFilePosition
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: LotusStyleManager.cpp:404
libwps_internal.h
WPSHeader
Definition: WPSHeader.h:31
LotusStyleManager
This class parses the Lotus style.
Definition: LotusStyleManager.h:45
libwps_tools_win::Font::UNKNOWN
Definition: libwps_tools_win.h:61
LotusParserInternal
Internal: namespace to define internal class of LotusParser.
Definition: Lotus.cpp:51
LotusParser::m_styleManager
shared_ptr< LotusStyleManager > m_styleManager
the style manager
Definition: Lotus.h:129
RVNGInputStreamPtr
shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
LotusSpreadsheet
This class parses Microsoft Works spreadsheet file.
Definition: LotusSpreadsheet.h:50
LotusParser::m_listener
shared_ptr< WKSContentListener > m_listener
Definition: Lotus.h:125
WKSParser
Definition: WKSParser.h:33
LotusParser::m_graphParser
shared_ptr< LotusGraph > m_graphParser
the graph manager
Definition: Lotus.h:131
LotusParser::m_spreadsheetParser
shared_ptr< LotusSpreadsheet > m_spreadsheetParser
the spreadsheet manager
Definition: Lotus.h:133
WKSParser.h