File: OdfChartReader.h

package info (click to toggle)
calligra 1%3A25.04.2%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 309,164 kB
  • sloc: cpp: 667,890; xml: 126,105; perl: 2,724; python: 2,497; yacc: 1,817; ansic: 1,326; sh: 1,223; lex: 1,107; javascript: 495; makefile: 24
file content (90 lines) | stat: -rw-r--r-- 3,133 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
/* This file is part of the KDE project

   SPDX-FileCopyrightText: 2012-2014 Inge Wallin <inge@lysator.liu.se>

   SPDX-License-Identifier: LGPL-2.0-or-later
*/

#ifndef ODFCHARTREADER_H
#define ODFCHARTREADER_H

// Qt
#include <QHash>
#include <QString>

// Calligra
#include <KoXmlStreamReader.h>

// this library
#include "OdfReaderInternals.h"
#include "koodfreader_export.h"

class QSizeF;

class OdfReader;
class OdfChartReaderBackend;
class OdfReaderContext;

/** @brief Read the XML tree of the content of an ODT file.
 *
 * The OdfChartReader is used to traverse (read) the chart contents of
 * an ODF file using an XML stream reader.  For every XML element that
 * the reading process comes across it will call a specific function
 * in a backend class: @see OdfChartReaderBackend.  The OdfChartReader
 * is used as a common way to read chart content and is called from all
 * readers for different ODF formats.  @see OdtReader, @see OdsReader,
 * @see OdpReader.
 */
class KOODFREADER_EXPORT OdfChartReader
{
public:
    OdfChartReader();
    ~OdfChartReader();

    void setParent(OdfReader *parent);
    void setBackend(OdfChartReaderBackend *backend);
    void setContext(OdfReaderContext *context);

    // ----------------------------------------------------------------
    // element reader functions

    DECLARE_READER_FUNCTION(OfficeChart);
    DECLARE_READER_FUNCTION(ChartChart); // ODF 1.2  11.1

    DECLARE_READER_FUNCTION(ChartFooter); // ODF 1.2  11.2.3
    DECLARE_READER_FUNCTION(ChartSubtitle); // ODF 1.2  11.2.2
    DECLARE_READER_FUNCTION(ChartTitle); // ODF 1.2  11.2.1
    DECLARE_READER_FUNCTION(ChartLegend); // ODF 1.2  11.3
    DECLARE_READER_FUNCTION(ChartPlotArea); // ODF 1.2  11.4
    DECLARE_READER_FUNCTION(ChartWall); // ODF 1.2  11.6
    DECLARE_READER_FUNCTION(ChartFloor); // ODF 1.2  11.7
    DECLARE_READER_FUNCTION(ChartAxis); // ODF 1.2  11.8
    DECLARE_READER_FUNCTION(ChartCategories); // ODF 1.2  11.9
    DECLARE_READER_FUNCTION(ChartGrid); // ODF 1.2  11.10
    DECLARE_READER_FUNCTION(ChartSeries); // ODF 1.2  11.11
    DECLARE_READER_FUNCTION(ChartDomain); // ODF 1.2  11.12
    DECLARE_READER_FUNCTION(ChartDataPoint); // ODF 1.2  11.13
    DECLARE_READER_FUNCTION(ChartDataLabel); // ODF 1.2  11.14
    DECLARE_READER_FUNCTION(ChartMeanValue); // ODF 1.2  11.15
    DECLARE_READER_FUNCTION(ChartErrorIndicator); // ODF 1.2  11.16
    DECLARE_READER_FUNCTION(ChartRegressionCurve); // ODF 1.2  11.17
    DECLARE_READER_FUNCTION(ChartEquation); // ODF 1.2  11.18
    DECLARE_READER_FUNCTION(ChartStockGainMarker); // ODF 1.2  11.19
    DECLARE_READER_FUNCTION(ChartStockLossMarker); // ODF 1.2  11.20
    DECLARE_READER_FUNCTION(ChartStockRangeLine); // ODF 1.2  11.21

protected:
    // ----------------------------------------------------------------
    // Other functions

    // FIXME: Move this to a common file (OdfReaderUtils?)
    void readUnknownElement(KoXmlStreamReader &reader);

private:
    OdfReader *m_parent; // The OdfReader controlling this one.

    OdfChartReaderBackend *m_backend;
    OdfReaderContext *m_context;
};

#endif // ODFCHARTREADER_H