comparison src/xlsx/xlsxchart_p.h @ 1:93d3106bb9a4

Add qt xlsx library
author Andre Heinecke <andre.heinecke@intevation.de>
date Tue, 22 Mar 2016 10:38:08 +0100
parents
children
comparison
equal deleted inserted replaced
0:49cd5cc0b072 1:93d3106bb9a4
1 /****************************************************************************
2 ** Copyright (c) 2013-2014 Debao Zhang <hello@debao.me>
3 ** All right reserved.
4 **
5 ** Permission is hereby granted, free of charge, to any person obtaining
6 ** a copy of this software and associated documentation files (the
7 ** "Software"), to deal in the Software without restriction, including
8 ** without limitation the rights to use, copy, modify, merge, publish,
9 ** distribute, sublicense, and/or sell copies of the Software, and to
10 ** permit persons to whom the Software is furnished to do so, subject to
11 ** the following conditions:
12 **
13 ** The above copyright notice and this permission notice shall be
14 ** included in all copies or substantial portions of the Software.
15 **
16 ** THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
17 ** EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
18 ** MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
19 ** NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
20 ** LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
21 ** OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
22 ** WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
23 **
24 ****************************************************************************/
25
26 #ifndef QXLSX_CHART_P_H
27 #define QXLSX_CHART_P_H
28
29 //
30 // W A R N I N G
31 // -------------
32 //
33 // This file is not part of the Qt Xlsx API. It exists for the convenience
34 // of the Qt Xlsx. This header file may change from
35 // version to version without notice, or even be removed.
36 //
37 // We mean it.
38 //
39
40 #include "xlsxabstractooxmlfile_p.h"
41 #include "xlsxchart.h"
42
43 #include <QSharedPointer>
44
45 class QXmlStreamReader;
46 class QXmlStreamWriter;
47
48 namespace QXlsx {
49
50 class XlsxSeries
51 {
52 public:
53 //At present, we care about number cell ranges only!
54 QString numberDataSource_numRef; //yval, val
55 QString axDataSource_numRef; //xval, cat
56 };
57
58 class XlsxAxis
59 {
60 public:
61 enum Type
62 {
63 T_Cat,
64 T_Val,
65 T_Date,
66 T_Ser
67 };
68
69 enum Pos
70 {
71 Left,
72 Right,
73 Top,
74 Bottom
75 };
76
77 XlsxAxis(){}
78
79 XlsxAxis(Type t, Pos p, int id, int crossId)
80 :type(t), axisPos(p), axisId(id), crossAx(crossId)
81 {
82 }
83
84 Type type;
85 Pos axisPos; //l,r,b,t
86 int axisId;
87 int crossAx;
88 };
89
90 class ChartPrivate : public AbstractOOXmlFilePrivate
91 {
92 Q_DECLARE_PUBLIC(Chart)
93
94 public:
95 ChartPrivate(Chart *q, Chart::CreateFlag flag);
96 ~ChartPrivate();
97
98 bool loadXmlChart(QXmlStreamReader &reader);
99 bool loadXmlPlotArea(QXmlStreamReader &reader);
100 bool loadXmlXxxChart(QXmlStreamReader &reader);
101 bool loadXmlSer(QXmlStreamReader &reader);
102 QString loadXmlNumRef(QXmlStreamReader &reader);
103 bool loadXmlAxis(QXmlStreamReader &reader);
104
105 void saveXmlChart(QXmlStreamWriter &writer) const;
106 void saveXmlPieChart(QXmlStreamWriter &writer) const;
107 void saveXmlBarChart(QXmlStreamWriter &writer) const;
108 void saveXmlLineChart(QXmlStreamWriter &writer) const;
109 void saveXmlScatterChart(QXmlStreamWriter &writer) const;
110 void saveXmlAreaChart(QXmlStreamWriter &writer) const;
111 void saveXmlDoughnutChart(QXmlStreamWriter &writer) const;
112 void saveXmlSer(QXmlStreamWriter &writer, XlsxSeries *ser, int id) const;
113 void saveXmlAxes(QXmlStreamWriter &writer) const;
114
115 Chart::ChartType chartType;
116
117 QList<QSharedPointer<XlsxSeries> > seriesList;
118 QList<QSharedPointer<XlsxAxis> > axisList;
119
120 AbstractSheet *sheet;
121 };
122
123 } // namespace QXlsx
124
125 #endif // QXLSX_CHART_P_H
This site is hosted by Intevation GmbH (Datenschutzerklärung und Impressum | Privacy Policy and Imprint)