bump product version to 6.3.0.0.beta1
[LibreOffice.git] / include / oox / export / chartexport.hxx
blobb39b3f52b4554391ee8abb99a67bcac7ff4683fa
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef INCLUDED_OOX_EXPORT_CHARTEXPORT_HXX
21 #define INCLUDED_OOX_EXPORT_CHARTEXPORT_HXX
23 #include <set>
24 #include <vector>
26 #include <com/sun/star/uno/Reference.hxx>
27 #include <com/sun/star/uno/Sequence.hxx>
28 #include <oox/dllapi.h>
29 #include <oox/export/drawingml.hxx>
30 #include <oox/export/utils.hxx>
31 #include <oox/token/tokens.hxx>
32 #include <rtl/ustring.hxx>
33 #include <sal/types.h>
34 #include <sax/fshelper.hxx>
36 namespace com { namespace sun { namespace star {
37 namespace beans {
38 class XPropertySet;
40 namespace chart {
41 class XDiagram;
42 class XChartDocument;
44 namespace chart2 {
45 struct RelativePosition;
46 struct RelativeSize;
47 class XDiagram;
48 class XChartDocument;
49 class XDataSeries;
50 class XChartType;
51 namespace data
53 class XDataSequence;
56 namespace drawing {
57 class XShape;
59 namespace frame {
60 class XModel;
62 }}}
64 namespace oox {
65 namespace core {
66 class XmlFilterBase;
69 namespace oox { namespace drawingml {
71 enum AxesType
73 AXIS_PRIMARY_X = 1,
74 AXIS_PRIMARY_Y = 2,
75 AXIS_PRIMARY_Z = 3,
76 AXIS_SECONDARY_X = 4,
77 AXIS_SECONDARY_Y = 5
80 struct AxisIdPair{
81 AxesType const nAxisType;
82 sal_Int32 const nAxisId;
83 sal_Int32 const nCrossAx;
85 AxisIdPair(AxesType nType, sal_Int32 nId, sal_Int32 nAx)
86 : nAxisType(nType)
87 , nAxisId(nId)
88 , nCrossAx(nAx)
92 class OOX_DLLPUBLIC ChartExport : public DrawingML {
94 public:
95 // first: data sequence for label, second: data sequence for values.
96 typedef ::std::vector< AxisIdPair > AxisVector;
98 private:
99 sal_Int32 const mnXmlNamespace;
100 sal_Int32 mnSeriesCount;
101 css::uno::Reference< css::frame::XModel > mxChartModel;
102 css::uno::Reference< css::chart::XDiagram > mxDiagram;
103 css::uno::Reference< css::chart2::XDiagram > mxNewDiagram;
104 std::shared_ptr<URLTransformer> mpURLTransformer;
106 // members filled by InitRangeSegmentationProperties (retrieved from DataProvider)
107 bool mbHasCategoryLabels; //if the categories are only automatically generated this will be false
109 //css::uno::Reference< css::drawing::XShapes > mxAdditionalShapes;
110 css::uno::Reference< css::chart2::data::XDataSequence > mxCategoriesValues;
112 AxisVector maAxes;
113 bool mbHasZAxis;
114 bool mbIs3DChart;
115 bool mbStacked;
116 bool mbPercent;
118 std::set<sal_Int32> maExportedAxis;
120 private:
121 sal_Int32 getChartType();
123 OUString parseFormula( const OUString& rRange );
124 void InitPlotArea();
126 void ExportContent_();
127 void exportChartSpace( const css::uno::Reference<
128 css::chart::XChartDocument >& rChartDoc,
129 bool bIncludeTable );
130 void exportChart( const css::uno::Reference<
131 css::chart::XChartDocument >& rChartDoc );
132 void exportExternalData( const css::uno::Reference<
133 css::chart::XChartDocument >& rChartDoc );
134 void exportLegend( const css::uno::Reference<
135 css::chart::XChartDocument >& rChartDoc );
136 void exportTitle( const css::uno::Reference<
137 css::drawing::XShape >& xShape );
138 void exportPlotArea( const css::uno::Reference<
139 css::chart::XChartDocument >& rChartDoc );
140 void exportFill( const css::uno::Reference< css::beans::XPropertySet >& xPropSet );
141 void exportGradientFill( const css::uno::Reference< css::beans::XPropertySet >& xPropSet );
142 void exportBitmapFill( const css::uno::Reference< css::beans::XPropertySet >& xPropSet );
143 void exportHatch(const css::uno::Reference<css::beans::XPropertySet>& xPropSet);
144 void exportDataTable( );
146 void exportAreaChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
147 void exportBarChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
148 void exportBubbleChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
149 void exportDoughnutChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
150 void exportLineChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
151 void exportPieChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
152 void exportRadarChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
153 void exportScatterChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
154 void exportScatterChartSeries( const css::uno::Reference< css::chart2::XChartType >& xChartType,
155 css::uno::Sequence<css::uno::Reference<css::chart2::XDataSeries>>* pSeries);
156 void exportStockChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
157 void exportSurfaceChart( const css::uno::Reference< css::chart2::XChartType >& xChartType );
158 void exportHiLowLines();
159 void exportUpDownBars(const css::uno::Reference< css::chart2::XChartType >& xChartType );
161 void exportAllSeries(const css::uno::Reference<css::chart2::XChartType>& xChartType, bool& rPrimaryAxes);
162 void exportSeries(const css::uno::Reference< css::chart2::XChartType >& xChartType,
163 css::uno::Sequence<css::uno::Reference<css::chart2::XDataSeries> >& rSeriesSeq, bool& rPrimaryAxes);
165 void exportVaryColors(const css::uno::Reference<css::chart2::XChartType>& xChartType);
166 void exportCandleStickSeries(
167 const css::uno::Sequence<
168 css::uno::Reference<
169 css::chart2::XDataSeries > > & aSeriesSeq,
170 bool& rPrimaryAxes );
171 void exportSeriesText(
172 const css::uno::Reference< css::chart2::data::XDataSequence >& xValueSeq );
173 void exportSeriesCategory(
174 const css::uno::Reference< css::chart2::data::XDataSequence >& xValueSeq );
175 void exportSeriesValues(
176 const css::uno::Reference< css::chart2::data::XDataSequence >& xValueSeq, sal_Int32 nValueType = XML_val );
177 void exportShapeProps( const css::uno::Reference< css::beans::XPropertySet >& xPropSet );
178 void exportTextProps(const css::uno::Reference< css::beans::XPropertySet >& xPropSet);
179 void exportDataPoints(
180 const css::uno::Reference< css::beans::XPropertySet >& xSeriesProperties,
181 sal_Int32 nSeriesLength, sal_Int32 eChartType );
182 void exportDataLabels( const css::uno::Reference<css::chart2::XDataSeries>& xSeries, sal_Int32 nSeriesLength, sal_Int32 eChartType );
183 void exportGrouping( bool isBar = false );
184 void exportTrendlines( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
185 void exportMarker( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
186 void exportSmooth();
187 void exportFirstSliceAng();
189 void exportErrorBar(const css::uno::Reference< css::beans::XPropertySet >& xErrorBarProps,
190 bool bYError);
192 void exportManualLayout(const css::chart2::RelativePosition& rPos, const css::chart2::RelativeSize& rSize, const bool bIsExcludingDiagramPositioning);
194 void exportAxes( );
195 void exportAxis(const AxisIdPair& rAxisIdPair);
196 void _exportAxis(
197 const css::uno::Reference< css::beans::XPropertySet >& xAxisProp,
198 const css::uno::Reference< css::drawing::XShape >& xAxisTitle,
199 const css::uno::Reference< css::beans::XPropertySet >& xMajorGrid,
200 const css::uno::Reference< css::beans::XPropertySet >& xMinorGrid,
201 sal_Int32 nAxisType,
202 const char* sAxisPos,
203 const AxisIdPair& rAxisIdPair );
204 void exportAxesId(bool bPrimaryAxes, bool bCheckCombinedAxes = false);
205 void exportView3D();
206 bool isDeep3dChart();
208 void exportMissingValueTreatment(const css::uno::Reference<css::beans::XPropertySet>& xPropSet);
210 OUString getNumberFormatCode(sal_Int32 nKey) const;
212 public:
214 ChartExport( sal_Int32 nXmlNamespace, ::sax_fastparser::FSHelperPtr pFS, css::uno::Reference< css::frame::XModel > const & xModel,
215 ::oox::core::XmlFilterBase* pFB, DocumentType eDocumentType );
216 virtual ~ChartExport() {}
218 void SetURLTranslator(const std::shared_ptr<URLTransformer>& pTransformer);
220 const css::uno::Reference< css::frame::XModel >& getModel(){ return mxChartModel; }
222 void WriteChartObj( const css::uno::Reference< css::drawing::XShape >& xShape, sal_Int32 nID, sal_Int32 nChartCount );
224 void ExportContent();
225 void InitRangeSegmentationProperties(
226 const css::uno::Reference<
227 css::chart2::XChartDocument > & xChartDoc );
232 #endif // INCLUDED_OOX_EXPORT_CHARTEXPORT_HXX
234 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */