QuattroDos.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 QUATTRO_DOS_H
23 #define QUATTRO_DOS_H
24 
25 #include <vector>
26 
27 #include <librevenge-stream/librevenge-stream.h>
28 #include "libwps/libwps.h"
29 
30 #include "libwps_internal.h"
31 #include "libwps_tools_win.h"
32 
33 #include "WKSParser.h"
34 
36 {
37 class SubDocument;
38 struct State;
39 }
40 
41 class QuattroDosChart;
43 
48 class QuattroDosParser final : public WKSParser
49 {
51  friend class QuattroDosChart;
52  friend class QuattroDosSpreadsheet;
53 public:
58  ~QuattroDosParser() final;
60  void parse(librevenge::RVNGSpreadsheetInterface *documentInterface) final;
62  bool checkHeader(WPSHeader *header, bool strict=false);
63 
64 protected:
66  bool checkFilePosition(long pos);
68  int version() const;
72  libwps_tools_win::Font::Type getDefaultFontType() const;
74  bool hasLICSCharacters() const;
76  librevenge::RVNGString getFileName(int fId) const;
77 
78  //
79  // interface with QuattroDosSpreadsheet
80  //
81 
83  bool getColor(int id, WPSColor &color) const;
85  bool getFont(int id, WPSFont &font, libwps_tools_win::Font::Type &type) const;
87  librevenge::RVNGString getSheetName(int id) const;
88 
89  //
90  // interface with QuattroDosChart
91  //
92 
94  bool sendChart(int sheetId, Vec2i const &cell, Vec2f const &chartSize);
95 
97  std::shared_ptr<WKSContentListener> createListener(librevenge::RVNGSpreadsheetInterface *interface);
99  void sendHeaderFooter(bool header);
100 
101  //
102  // low level
103  //
104 
106  bool readZones();
108  bool readZone();
109 
111 
113  bool readUserFonts();
115  bool readFont(WPSFont &font, libwps_tools_win::Font::Type &type);
117  bool readHeaderFooter(bool header);
118 
120  bool readFieldName();
122  bool readFileName();
123 
125  bool readPString(librevenge::RVNGString &string, long maxSize);
127 
129  bool readWindowRecord();
134  bool readUnknown1();
135 
136  std::shared_ptr<WKSContentListener> m_listener;
137  std::shared_ptr<QuattroDosParserInternal::State> m_state;
140  std::shared_ptr<QuattroDosSpreadsheet> m_spreadsheetParser;
142  std::shared_ptr<QuattroDosChart> m_chartParser;
143 };
144 
145 #endif /* WPS4_H */
146 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
This class parses Quattro Pro DOS chart file.
Definition: QuattroDosChart.h:49
Definition: WPSOLEStream.h:33
Internal: namespace to define internal class of QuattroDosParser.
Definition: QuattroDos.cpp:51
This class parses Quattro Pro spreadsheet: .wq1 and wq2.
Definition: QuattroDos.h:48
std::shared_ptr< WKSContentListener > m_listener
Definition: QuattroDosSpreadsheet.h:132
define the font properties
Definition: WPSFont.h:36
librevenge::RVNGString getSheetName(int id) const
returns the name of the id&#39;s spreadsheet
Definition: QuattroDosSpreadsheet.cpp:631
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: QuattroDosSpreadsheet.cpp:614
Internal: the subdocument of a WPS4Parser.
Definition: QuattroDos.cpp:65
Type
enum Type
Definition: libwps_tools_win.h:46
std::shared_ptr< QuattroDosSpreadsheetInternal::State > m_state
the internal state
Definition: QuattroDosSpreadsheet.h:136
int version() const
return the file version
Definition: QuattroDosSpreadsheet.cpp:600
Definition: WPSHeader.h:31
This class parses Quattro Pro DOS spreadsheet file.
Definition: QuattroDosSpreadsheet.h:49
Definition: libwps_tools_win.h:61
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
the class to store a color
Definition: libwps_internal.h:280
friend class QuattroDosParser
Definition: QuattroDosSpreadsheet.h:52
some Windows© classes and tools
Definition: libwps_tools_win.cpp:31
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition: QuattroDosSpreadsheet.cpp:607
std::shared_ptr< WPSHeader > WPSHeaderPtr
shared pointer to WPSHeader
Definition: libwps_internal.h:109
Definition: WKSParser.h:33
Definition: WKSContentListener.h:53

Generated on Thu Apr 26 2018 03:21:13 for libwps by doxygen 1.8.13