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_DRAWINGML_CHART_SERIESCONVERTER_HXX
21 #define INCLUDED_OOX_DRAWINGML_CHART_SERIESCONVERTER_HXX
23 #include <drawingml/chart/converterbase.hxx>
24 #include <drawingml/chart/seriesmodel.hxx>
26 namespace com::sun::star
{
27 namespace chart2
{ class XDataSeries
; }
28 namespace chart2::data
{ class XLabeledDataSequence
; }
31 namespace oox::drawingml::chart
{
33 class TypeGroupConverter
;
35 // #i66858# enable this when Chart2 supports smoothed lines per data series
36 #define OOX_CHART_SMOOTHED_PER_SERIES 0
39 class DataLabelConverter final
: public ConverterBase
< DataLabelModel
>
42 explicit DataLabelConverter( const ConverterRoot
& rParent
, DataLabelModel
& rModel
);
43 virtual ~DataLabelConverter() override
;
45 /** Converts OOXML data label settings for the passed data point. */
46 void convertFromModel(
47 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
,
48 const TypeGroupConverter
& rTypeGroup
);
52 class DataLabelsConverter final
: public ConverterBase
< DataLabelsModel
>
55 explicit DataLabelsConverter( const ConverterRoot
& rParent
, DataLabelsModel
& rModel
);
56 virtual ~DataLabelsConverter() override
;
58 /** Converts OOXML data label settings for the passed data series. */
59 void convertFromModel(
60 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
,
61 const TypeGroupConverter
& rTypeGroup
);
65 class ErrorBarConverter final
: public ConverterBase
< ErrorBarModel
>
68 explicit ErrorBarConverter( const ConverterRoot
& rParent
, ErrorBarModel
& rModel
);
69 virtual ~ErrorBarConverter() override
;
71 /** Converts an OOXML errorbar and inserts it into the passed data series. */
72 void convertFromModel(
73 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
);
76 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
77 createLabeledDataSequence( ErrorBarModel::SourceType eSourceType
);
81 class TrendlineLabelConverter final
: public ConverterBase
< TrendlineLabelModel
>
84 explicit TrendlineLabelConverter( const ConverterRoot
& rParent
, TrendlineLabelModel
& rModel
);
85 virtual ~TrendlineLabelConverter() override
;
87 /** Converts the OOXML trendline label. */
88 void convertFromModel( PropertySet
& rPropSet
);
92 class TrendlineConverter final
: public ConverterBase
< TrendlineModel
>
95 explicit TrendlineConverter( const ConverterRoot
& rParent
, TrendlineModel
& rModel
);
96 virtual ~TrendlineConverter() override
;
98 /** Converts an OOXML trendline and inserts it into the passed data series. */
99 void convertFromModel(
100 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
);
104 class DataPointConverter final
: public ConverterBase
< DataPointModel
>
107 explicit DataPointConverter( const ConverterRoot
& rParent
, DataPointModel
& rModel
);
108 virtual ~DataPointConverter() override
;
110 /** Converts settings for a data point in the passed series. */
111 void convertFromModel(
112 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
,
113 const TypeGroupConverter
& rTypeGroup
,
114 const SeriesModel
& rSeries
);
118 class SeriesConverter final
: public ConverterBase
< SeriesModel
>
121 explicit SeriesConverter( const ConverterRoot
& rParent
, SeriesModel
& rModel
);
122 virtual ~SeriesConverter() override
;
124 /** Creates a labeled data sequence object from category data link. */
125 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
126 createCategorySequence( const OUString
& rRole
);
127 /** Creates a labeled data sequence object from value data link. */
128 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
129 createValueSequence( const OUString
& rRole
);
130 /** Creates a data series object with initialized source links. */
131 css::uno::Reference
< css::chart2::XDataSeries
>
132 createDataSeries( const TypeGroupConverter
& rTypeGroup
, bool bVaryColorsByPoint
);
135 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
136 createLabeledDataSequence(
137 SeriesModel::SourceType eSourceType
,
138 const OUString
& rRole
,
139 bool bUseTextLabel
);
143 } // namespace oox::drawingml::chart
147 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */