QuattroDosChart.h Source File documentation

QuattroDosChart.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_CHART_H
23#define QUATTRO_DOS_CHART_H
24
25#include <ostream>
26#include <map>
27#include <vector>
28
29#include <librevenge-stream/librevenge-stream.h>
30
31#include "libwps_internal.h"
32
33#include "WPSDebug.h"
34#include "WKSContentListener.h"
35
36namespace QuattroDosChartInternal
37{
38class Chart;
39struct State;
40
41}
42
43class QuattroDosParser;
44
49 class QuattroDosChart
50{
51public:
52 friend class QuattroDosParser;
53 friend class QuattroDosChartInternal::Chart;
54
56 explicit QuattroDosChart(QuattroDosParser &parser);
58 ~QuattroDosChart();
60 void setListener(WKSContentListenerPtr &listen)
61 {
62 m_listener = listen;
63 }
65 bool readChartSetType();
67 bool readChartName();
69 bool readChart();
70
72 int getNumSpreadsheets() const;
74 void getChartPositionMap(int sheetId, std::map<Vec2i,Vec2i> &cellMap) const;
76 bool sendChart(int sheetId, Vec2i const &cell, Vec2f const &chartSize);
77protected:
79 bool checkFilePosition(long pos);
81 int version() const;
82
84 bool sendText(WPSEntry const &entry);
86 bool updateSpreadsheetNames(QuattroDosChartInternal::Chart &chart);
87private:
88 QuattroDosChart(QuattroDosChart const &orig) = delete;
89 QuattroDosChart &operator=(QuattroDosChart const &orig) = delete;
91 libwps::DebugFile &ascii()
92 {
93 return m_asciiFile;
94 }
96 RVNGInputStreamPtr m_input;
97 std::shared_ptr<WKSContentListener> m_listener;
99 QuattroDosParser &m_mainParser;
101 std::shared_ptr<QuattroDosChartInternal::State> m_state;
103 libwps::DebugFile &m_asciiFile;
104};
105
106#endif /* WPS4_H */
107/* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WKSContentListener.h
WPSDebug.h
QuattroDosChartInternal::Chart
the chart of a Quattro Pro Dos
Definition QuattroDosChart.cpp:53
QuattroDosChart
This class parses Quattro Pro DOS chart file.
Definition QuattroDosChart.h:50
QuattroDosChart::m_state
std::shared_ptr< QuattroDosChartInternal::State > m_state
the internal state
Definition QuattroDosChart.h:101
QuattroDosChart::readChartSetType
bool readChartSetType()
reads the chart type: b8(3d) or ca(bubble)
Definition QuattroDosChart.cpp:294
QuattroDosChart::getNumSpreadsheets
int getNumSpreadsheets() const
returns the number of spreadsheet
Definition QuattroDosChart.cpp:182
QuattroDosChart::m_asciiFile
libwps::DebugFile & m_asciiFile
the ascii file
Definition QuattroDosChart.h:103
QuattroDosChart::getChartPositionMap
void getChartPositionMap(int sheetId, std::map< Vec2i, Vec2i > &cellMap) const
returns the list of cell's begin to end corresponding to a chart
Definition QuattroDosChart.cpp:196
QuattroDosChart::~QuattroDosChart
~QuattroDosChart()
destructor
Definition QuattroDosChart.cpp:159
QuattroDosChart::m_listener
std::shared_ptr< WKSContentListener > m_listener
Definition QuattroDosChart.h:97
QuattroDosChart::QuattroDosChart
QuattroDosChart(QuattroDosChart const &orig)=delete
QuattroDosChart::setListener
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition QuattroDosChart.h:60
QuattroDosChart::QuattroDosChart
QuattroDosChart(QuattroDosParser &parser)
constructor
Definition QuattroDosChart.cpp:150
QuattroDosChart::ascii
libwps::DebugFile & ascii()
returns the debug file
Definition QuattroDosChart.h:91
QuattroDosChart::operator=
QuattroDosChart & operator=(QuattroDosChart const &orig)=delete
QuattroDosChart::readChartName
bool readChartName()
reads the chart name: b9
Definition QuattroDosChart.cpp:323
QuattroDosChart::m_input
RVNGInputStreamPtr m_input
the input
Definition QuattroDosChart.h:96
QuattroDosChart::m_mainParser
QuattroDosParser & m_mainParser
the listener (if set)
Definition QuattroDosChart.h:99
QuattroDosChart::sendText
bool sendText(WPSEntry const &entry)
try to send the text
Definition QuattroDosChart.cpp:267
QuattroDosChart::checkFilePosition
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition QuattroDosChart.cpp:170
QuattroDosChart::sendChart
bool sendChart(int sheetId, Vec2i const &cell, Vec2f const &chartSize)
try to send the chart corresponding to sheetId and a position
Definition QuattroDosChart.cpp:237
QuattroDosChart::updateSpreadsheetNames
bool updateSpreadsheetNames(QuattroDosChartInternal::Chart &chart)
update the chart spreadsheet name
Definition QuattroDosChart.cpp:208
QuattroDosChart::version
int version() const
return the file version
Definition QuattroDosChart.cpp:163
QuattroDosChart::readChart
bool readChart()
reads a structure which define a chart: 2d(default), 2e(name + value)
Definition QuattroDosChart.cpp:355
QuattroDosParser
This class parses Quattro Pro spreadsheet: .wq1 and wq2.
Definition QuattroDos.h:49
Vec2< int >
WPSEntry
basic class to store an entry in a file This contained :
Definition WPSEntry.h:39
libwps::DebugFile
Definition WPSDebug.h:208
libwps_internal.h
WKSContentListenerPtr
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition libwps_internal.h:114
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition libwps_internal.h:87
QuattroDosChartInternal
Definition QuattroDosChart.cpp:47