WKS4Chart.h Source File documentation

WKS4Chart.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 WKS4_CHART_H
23 #define WKS4_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
36 namespace WKS4ChartInternal
37 {
38 class Chart;
39 struct State;
40
41 }
42
43 class WKS4Parser;
44
49 class WKS4Chart
50 {
51 public:
52 friend class WKS4Parser;
53 friend class WKS4ChartInternal::Chart;
54
56 explicit WKS4Chart(WKS4Parser &parser);
58 ~WKS4Chart();
60 void setListener(WKSContentListenerPtr &listen)
61 {
62 m_listener = listen;
63 }
64
65 protected:
67 bool checkFilePosition(long pos);
69 int version() const;
71 bool hasLICSCharacters() const;
72
74 void resetInput(RVNGInputStreamPtr const &input);
75
77 int getNumCharts() const;
79 void updateChart(WKS4ChartInternal::Chart &chart);
80
82 bool sendCharts();
84 bool sendText(WPSEntry const &entry);
85
87 bool readChart();
88
90 bool readChartAxis();
91
93 bool readChartSeries();
94
96 bool readChartSeriesStyles();
97
99 bool readChartSeriesColorMap();
101 bool readChartName();
102
104 bool readChartDim();
106 bool readChartFont();
108 bool readChart3D();
109
111 bool readChart2Font();
112
114 bool readChartLimit();
115
116 private:
117 WKS4Chart(WKS4Chart const &orig) = delete;
118 WKS4Chart &operator=(WKS4Chart const &orig) = delete;
120 libwps::DebugFile &ascii()
121 {
122 return m_asciiFile;
123 }
125 RVNGInputStreamPtr m_input;
126 std::shared_ptr<WKSContentListener> m_listener;
127 WKS4Parser &m_mainParser;
130 std::shared_ptr<WKS4ChartInternal::State> m_state;
132 libwps::DebugFile &m_asciiFile;
133 };
134
135 #endif /* WPS4_H */
136 /* vim:set shiftwidth=4 softtabstop=4 noexpandtab: */
WKS4Chart::readChartName
bool readChartName()
reads the chart name or title: 41
Definition: WKS4Chart.cpp:718
WKS4Chart::m_asciiFile
libwps::DebugFile & m_asciiFile
the ascii file
Definition: WKS4Chart.h:132
WKS4Chart::m_listener
std::shared_ptr< WKSContentListener > m_listener
Definition: WKS4Chart.h:126
WKS4Chart::sendText
bool sendText(WPSEntry const &entry)
try to send the text
Definition: WKS4Chart.cpp:425
WKS4Chart::readChartLimit
bool readChartLimit()
reads end/begin of chart (only present in windows file): 80,81
Definition: WKS4Chart.cpp:966
WKS4Chart::WKS4Chart
WKS4Chart(WKS4Parser &parser)
constructor
Definition: WKS4Chart.cpp:226
WKS4Chart::hasLICSCharacters
bool hasLICSCharacters() const
returns the true if the file has LICS characters
Definition: WKS4Chart.cpp:262
libwps::DebugFile
Definition: WPSDebug.h:207
WKS4Chart::m_input
RVNGInputStreamPtr m_input
the input
Definition: WKS4Chart.h:125
WKS4Chart::readChartSeries
bool readChartSeries()
reads a list of series definition: zone 0x15
Definition: WKS4Chart.cpp:1242
WKSContentListener.h
WKS4Parser
This class parses Microsoft Works spreadsheet or a database file.
Definition: WKS4.h:48
WKS4Chart::operator=
WKS4Chart & operator=(WKS4Chart const &orig)=delete
WKS4Chart::readChartAxis
bool readChartAxis()
reads the axis(or second yaxis) data: zone 0x14
Definition: WKS4Chart.cpp:989
WKS4Chart::readChartSeriesColorMap
bool readChartSeriesColorMap()
reads the chart&#39;s series color map: zone 0x31
Definition: WKS4Chart.cpp:1375
WKS4Chart::m_state
std::shared_ptr< WKS4ChartInternal::State > m_state
the internal state
Definition: WKS4Chart.h:130
WKS4Chart::~WKS4Chart
~WKS4Chart()
destructor
Definition: WKS4Chart.cpp:235
WKS4Chart::ascii
libwps::DebugFile & ascii()
returns the debug file
Definition: WKS4Chart.h:120
WKS4Chart::readChartFont
bool readChartFont()
reads a structure which seems to define two chart font (only present in windows file): 40 ...
Definition: WKS4Chart.cpp:826
libwps_internal.h
WKS4ChartInternal::Chart
the chart of a WKS4 Pro Dos
Definition: WKS4Chart.cpp:51
WKS4Chart::checkFilePosition
bool checkFilePosition(long pos)
return true if the pos is in the file, update the file size if need
Definition: WKS4Chart.cpp:269
RVNGInputStreamPtr
std::shared_ptr< librevenge::RVNGInputStream > RVNGInputStreamPtr
shared pointer to librevenge::RVNGInputStream
Definition: libwps_internal.h:87
WKS4Chart
This class parses Microsoft Works chart file.
Definition: WKS4Chart.h:49
WKS4Chart::m_mainParser
WKS4Parser & m_mainParser
the listener (if set)
Definition: WKS4Chart.h:128
WKS4ChartInternal
Definition: WKS4Chart.cpp:46
WKS4Chart::updateChart
void updateChart(WKS4ChartInternal::Chart &chart)
update a chart, so that it can be send
Definition: WKS4Chart.cpp:281
WKS4Chart::sendCharts
bool sendCharts()
try to send the charts
Definition: WKS4Chart.cpp:394
WKS4Chart::readChart3D
bool readChart3D()
reads a structure which stores zfront, zfar: 44
Definition: WKS4Chart.cpp:879
WKS4Chart::version
int version() const
return the file version
Definition: WKS4Chart.cpp:255
WKS4Chart::readChartDim
bool readChartDim()
reads a structure which seems to define some dimension (only present in windows file): 35 ...
Definition: WKS4Chart.cpp:758
WKSContentListenerPtr
std::shared_ptr< WKSContentListener > WKSContentListenerPtr
shared pointer to WKSContentListener
Definition: libwps_internal.h:114
WPSEntry
basic class to store an entry in a file This contained :
Definition: WPSEntry.h:38
WKS4Chart::readChart2Font
bool readChart2Font()
reads a structure which seems to define four chart font (only present in windows file): 84 ...
Definition: WKS4Chart.cpp:918
WKS4Chart::readChartSeriesStyles
bool readChartSeriesStyles()
reads the series style: zone 0x16
Definition: WKS4Chart.cpp:1305
WKS4Chart::resetInput
void resetInput(RVNGInputStreamPtr const &input)
reset the main input
Definition: WKS4Chart.cpp:250
WKS4Chart::setListener
void setListener(WKSContentListenerPtr &listen)
sets the listener
Definition: WKS4Chart.h:60
WKS4Chart::getNumCharts
int getNumCharts() const
return the number of chart
Definition: WKS4Chart.cpp:239
WPSDebug.h
WKS4Chart::readChart
bool readChart()
reads a structure which define a chart: 2d(default), 2e(name + value)
Definition: WKS4Chart.cpp:455