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
{ namespace sun
{ namespace star
{
27 namespace chart2
{ class XDataSeries
; }
28 namespace chart2
{ namespace data
{ class XLabeledDataSequence
; } }
35 class TypeGroupConverter
;
37 // #i66858# enable this when Chart2 supports smoothed lines per data series
38 #define OOX_CHART_SMOOTHED_PER_SERIES 0
41 class DataLabelConverter
: public ConverterBase
< DataLabelModel
>
44 explicit DataLabelConverter( const ConverterRoot
& rParent
, DataLabelModel
& rModel
);
45 virtual ~DataLabelConverter() override
;
47 /** Converts OOXML data label settings for the passed data point. */
48 void convertFromModel(
49 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
,
50 const TypeGroupConverter
& rTypeGroup
, const PropertySet
& rSeriesPropSet
);
54 class DataLabelsConverter
: public ConverterBase
< DataLabelsModel
>
57 explicit DataLabelsConverter( const ConverterRoot
& rParent
, DataLabelsModel
& rModel
);
58 virtual ~DataLabelsConverter() override
;
60 /** Converts OOXML data label settings for the passed data series. */
61 void convertFromModel(
62 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
,
63 const TypeGroupConverter
& rTypeGroup
);
67 class ErrorBarConverter
: public ConverterBase
< ErrorBarModel
>
70 explicit ErrorBarConverter( const ConverterRoot
& rParent
, ErrorBarModel
& rModel
);
71 virtual ~ErrorBarConverter() override
;
73 /** Converts an OOXML errorbar and inserts it into the passed data series. */
74 void convertFromModel(
75 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
);
78 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
79 createLabeledDataSequence( ErrorBarModel::SourceType eSourceType
);
83 class TrendlineLabelConverter
: public ConverterBase
< TrendlineLabelModel
>
86 explicit TrendlineLabelConverter( const ConverterRoot
& rParent
, TrendlineLabelModel
& rModel
);
87 virtual ~TrendlineLabelConverter() override
;
89 /** Converts the OOXML trendline label. */
90 void convertFromModel( PropertySet
& rPropSet
);
94 class TrendlineConverter
: public ConverterBase
< TrendlineModel
>
97 explicit TrendlineConverter( const ConverterRoot
& rParent
, TrendlineModel
& rModel
);
98 virtual ~TrendlineConverter() override
;
100 /** Converts an OOXML trendline and inserts it into the passed data series. */
101 void convertFromModel(
102 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
);
106 class DataPointConverter
: public ConverterBase
< DataPointModel
>
109 explicit DataPointConverter( const ConverterRoot
& rParent
, DataPointModel
& rModel
);
110 virtual ~DataPointConverter() override
;
112 /** Converts settings for a data point in the passed series. */
113 void convertFromModel(
114 const css::uno::Reference
< css::chart2::XDataSeries
>& rxDataSeries
,
115 const TypeGroupConverter
& rTypeGroup
,
116 const SeriesModel
& rSeries
);
120 class SeriesConverter
: public ConverterBase
< SeriesModel
>
123 explicit SeriesConverter( const ConverterRoot
& rParent
, SeriesModel
& rModel
);
124 virtual ~SeriesConverter() override
;
126 /** Creates a labeled data sequence object from category data link. */
127 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
128 createCategorySequence( const OUString
& rRole
);
129 /** Creates a labeled data sequence object from value data link. */
130 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
131 createValueSequence( const OUString
& rRole
);
132 /** Creates a data series object with initialized source links. */
133 css::uno::Reference
< css::chart2::XDataSeries
>
134 createDataSeries( const TypeGroupConverter
& rTypeGroup
, bool bVaryColorsByPoint
);
137 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
138 createLabeledDataSequence(
139 SeriesModel::SourceType eSourceType
,
140 const OUString
& rRole
,
141 bool bUseTextLabel
);
146 } // namespace drawingml
151 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */