1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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
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
{
45 struct RelativePosition
;
69 namespace oox
{ namespace drawingml
{
85 AxisIdPair(AxesType nType
, sal_Int32 nId
, sal_Int32 nAx
)
92 class OOX_DLLPUBLIC ChartExport
: public DrawingML
{
95 // first: data sequence for label, second: data sequence for values.
96 typedef ::std::vector
< AxisIdPair
> AxisVector
;
99 sal_Int32 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
;
105 // members filled by InitRangeSegmentationProperties (retrieved from DataProvider)
106 bool mbHasCategoryLabels
; //if the categories are only automatically generated this will be false
107 OUString msChartAddress
;
109 //css::uno::Reference< css::drawing::XShapes > mxAdditionalShapes;
110 css::uno::Reference
< css::chart2::data::XDataSequence
> mxCategoriesValues
;
118 std::set
<sal_Int32
> maExportedAxis
;
121 sal_Int32
getChartType();
123 OUString
parseFormula( const OUString
& rRange
);
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( );
139 void exportPlotAreaShapeProps( const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
);
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 exportDataTable( );
145 void exportAreaChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
146 void exportBarChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
147 void exportBubbleChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
148 void exportDoughnutChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
149 void exportLineChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
150 void exportPieChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
151 void exportRadarChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
152 void exportScatterChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
153 void exportStockChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
154 void exportSurfaceChart( const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
155 void exportHiLowLines();
156 void exportUpDownBars(const css::uno::Reference
< css::chart2::XChartType
>& xChartType
);
158 void exportAllSeries(const css::uno::Reference
<css::chart2::XChartType
>& xChartType
, bool& rPrimaryAxes
);
159 void exportSeries(const css::uno::Reference
< css::chart2::XChartType
>& xChartType
,
160 css::uno::Sequence
<css::uno::Reference
<css::chart2::XDataSeries
> >& rSeriesSeq
, bool& rPrimaryAxes
);
162 void exportVaryColors(const css::uno::Reference
<css::chart2::XChartType
>& xChartType
);
163 void exportCandleStickSeries(
164 const css::uno::Sequence
<
166 css::chart2::XDataSeries
> > & aSeriesSeq
,
167 bool& rPrimaryAxes
);
168 void exportSeriesText(
169 const css::uno::Reference
< css::chart2::data::XDataSequence
>& xValueSeq
);
170 void exportSeriesCategory(
171 const css::uno::Reference
< css::chart2::data::XDataSequence
>& xValueSeq
);
172 void exportSeriesValues(
173 const css::uno::Reference
< css::chart2::data::XDataSequence
>& xValueSeq
, sal_Int32 nValueType
= XML_val
);
174 void exportShapeProps( const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
);
175 void exportTextProps(const css::uno::Reference
< css::beans::XPropertySet
>& xPropSet
);
176 void exportDataPoints(
177 const css::uno::Reference
< css::beans::XPropertySet
>& xSeriesProperties
,
178 sal_Int32 nSeriesLength
);
179 void exportDataLabels( const css::uno::Reference
<css::chart2::XDataSeries
>& xSeries
, sal_Int32 nSeriesLength
, sal_Int32 eChartType
);
180 void exportGrouping( bool isBar
= false );
181 void exportTrendlines( const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
);
182 void exportMarker( const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
);
184 void exportFirstSliceAng();
186 void exportErrorBar(const css::uno::Reference
< css::beans::XPropertySet
>& xErrorBarProps
,
189 void exportManualLayout(const css::chart2::RelativePosition
& rPos
, const css::chart2::RelativeSize
& rSize
);
192 void exportAxis(const AxisIdPair
& rAxisIdPair
);
194 const css::uno::Reference
< css::beans::XPropertySet
>& xAxisProp
,
195 const css::uno::Reference
< css::drawing::XShape
>& xAxisTitle
,
196 const css::uno::Reference
< css::beans::XPropertySet
>& xMajorGrid
,
197 const css::uno::Reference
< css::beans::XPropertySet
>& xMinorGrid
,
199 const char* sAxisPos
,
200 const AxisIdPair
& rAxisIdPair
);
201 void exportAxesId(bool bPrimaryAxes
);
203 bool isDeep3dChart();
205 void exportMissingValueTreatment(const css::uno::Reference
<css::beans::XPropertySet
>& xPropSet
);
207 OUString
getNumberFormatCode(sal_Int32 nKey
) const;
211 ChartExport( sal_Int32 nXmlNamespace
, ::sax_fastparser::FSHelperPtr pFS
, css::uno::Reference
< css::frame::XModel
>& xModel
,
212 ::oox::core::XmlFilterBase
* pFB
, DocumentType eDocumentType
);
213 virtual ~ChartExport() {}
215 sal_Int32
GetChartID( );
216 const css::uno::Reference
< css::frame::XModel
>& getModel(){ return mxChartModel
; }
218 void WriteChartObj( const css::uno::Reference
< css::drawing::XShape
>& xShape
, sal_Int32 nChartCount
);
220 void ExportContent();
221 void InitRangeSegmentationProperties(
222 const css::uno::Reference
<
223 css::chart2::XChartDocument
> & xChartDoc
);
228 #endif // INCLUDED_OOX_EXPORT_CHARTEXPORT_HXX
230 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */