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
42 class DataLabelConverter
: public ConverterBase
< DataLabelModel
>
45 explicit DataLabelConverter( const ConverterRoot
& rParent
, DataLabelModel
& rModel
);
46 virtual ~DataLabelConverter();
48 /** Converts OOXML data label settings for the passed data point. */
49 void convertFromModel(
50 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
>& rxDataSeries
,
51 const TypeGroupConverter
& rTypeGroup
);
53 /** Conversion helper for data series and data points. */
54 static void convertLabelFormatting(
55 PropertySet
& rPropSet
,
56 ObjectFormatter
& rFormatter
,
57 const DataLabelModelBase
& rDataLabel
,
58 const TypeGroupConverter
& rTypeGroup
,
59 bool bDataSeriesLabel
);
64 class DataLabelsConverter
: public ConverterBase
< DataLabelsModel
>
67 explicit DataLabelsConverter( const ConverterRoot
& rParent
, DataLabelsModel
& rModel
);
68 virtual ~DataLabelsConverter();
70 /** Converts OOXML data label settings for the passed data series. */
71 void convertFromModel(
72 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
>& rxDataSeries
,
73 const TypeGroupConverter
& rTypeGroup
);
78 class ErrorBarConverter
: public ConverterBase
< ErrorBarModel
>
81 explicit ErrorBarConverter( const ConverterRoot
& rParent
, ErrorBarModel
& rModel
);
82 virtual ~ErrorBarConverter();
84 /** Converts an OOXML errorbar and inserts it into the passed data series. */
85 void convertFromModel(
86 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
>& rxDataSeries
);
89 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XLabeledDataSequence
>
90 createLabeledDataSequence( ErrorBarModel::SourceType eSourceType
);
95 class TrendlineLabelConverter
: public ConverterBase
< TrendlineLabelModel
>
98 explicit TrendlineLabelConverter( const ConverterRoot
& rParent
, TrendlineLabelModel
& rModel
);
99 virtual ~TrendlineLabelConverter();
101 /** Converts the OOXML trendline label. */
102 void convertFromModel( PropertySet
& rPropSet
);
107 class TrendlineConverter
: public ConverterBase
< TrendlineModel
>
110 explicit TrendlineConverter( const ConverterRoot
& rParent
, TrendlineModel
& rModel
);
111 virtual ~TrendlineConverter();
113 /** Converts an OOXML trendline and inserts it into the passed data series. */
114 void convertFromModel(
115 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
>& rxDataSeries
);
120 class DataPointConverter
: public ConverterBase
< DataPointModel
>
123 explicit DataPointConverter( const ConverterRoot
& rParent
, DataPointModel
& rModel
);
124 virtual ~DataPointConverter();
126 /** Converts settings for a data point in the passed series. */
127 void convertFromModel(
128 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
>& rxDataSeries
,
129 const TypeGroupConverter
& rTypeGroup
,
130 const SeriesModel
& rSeries
);
135 class SeriesConverter
: public ConverterBase
< SeriesModel
>
138 explicit SeriesConverter( const ConverterRoot
& rParent
, SeriesModel
& rModel
);
139 virtual ~SeriesConverter();
141 /** Creates a labeled data sequence object from category data link. */
142 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XLabeledDataSequence
>
143 createCategorySequence( const OUString
& rRole
);
144 /** Creates a labeled data sequence object from value data link. */
145 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XLabeledDataSequence
>
146 createValueSequence( const OUString
& rRole
);
147 /** Creates a data series object with initialized source links. */
148 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
>
149 createDataSeries( const TypeGroupConverter
& rTypeGroup
, bool bVaryColorsByPoint
);
152 ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XLabeledDataSequence
>
153 createLabeledDataSequence(
154 SeriesModel::SourceType eSourceType
,
155 const OUString
& rRole
,
156 bool bUseTextLabel
);
162 } // namespace drawingml
167 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */