1*e3508121SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*e3508121SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*e3508121SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*e3508121SAndrew Rist * distributed with this work for additional information 6*e3508121SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*e3508121SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*e3508121SAndrew Rist * "License"); you may not use this file except in compliance 9*e3508121SAndrew Rist * with the License. You may obtain a copy of the License at 10*e3508121SAndrew Rist * 11*e3508121SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*e3508121SAndrew Rist * 13*e3508121SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*e3508121SAndrew Rist * software distributed under the License is distributed on an 15*e3508121SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*e3508121SAndrew Rist * KIND, either express or implied. See the License for the 17*e3508121SAndrew Rist * specific language governing permissions and limitations 18*e3508121SAndrew Rist * under the License. 19*e3508121SAndrew Rist * 20*e3508121SAndrew Rist *************************************************************/ 21*e3508121SAndrew Rist 22*e3508121SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir #ifndef OOX_DRAWINGML_CHART_SERIESCONVERTER_HXX 25cdf0e10cSrcweir #define OOX_DRAWINGML_CHART_SERIESCONVERTER_HXX 26cdf0e10cSrcweir 27cdf0e10cSrcweir #include "oox/drawingml/chart/converterbase.hxx" 28cdf0e10cSrcweir #include "oox/drawingml/chart/seriesmodel.hxx" 29cdf0e10cSrcweir 30cdf0e10cSrcweir namespace com { namespace sun { namespace star { 31cdf0e10cSrcweir namespace chart2 { class XDataSeries; } 32cdf0e10cSrcweir namespace chart2 { namespace data { class XLabeledDataSequence; } } 33cdf0e10cSrcweir } } } 34cdf0e10cSrcweir 35cdf0e10cSrcweir namespace oox { 36cdf0e10cSrcweir namespace drawingml { 37cdf0e10cSrcweir namespace chart { 38cdf0e10cSrcweir 39cdf0e10cSrcweir class TypeGroupConverter; 40cdf0e10cSrcweir 41cdf0e10cSrcweir // #i66858# enable this when Chart2 supports smoothed lines per data series 42cdf0e10cSrcweir #define OOX_CHART_SMOOTHED_PER_SERIES 0 43cdf0e10cSrcweir 44cdf0e10cSrcweir // ============================================================================ 45cdf0e10cSrcweir 46cdf0e10cSrcweir class DataLabelConverter : public ConverterBase< DataLabelModel > 47cdf0e10cSrcweir { 48cdf0e10cSrcweir public: 49cdf0e10cSrcweir explicit DataLabelConverter( const ConverterRoot& rParent, DataLabelModel& rModel ); 50cdf0e10cSrcweir virtual ~DataLabelConverter(); 51cdf0e10cSrcweir 52cdf0e10cSrcweir /** Converts OOXML data label settings for the passed data point. */ 53cdf0e10cSrcweir void convertFromModel( 54cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries, 55cdf0e10cSrcweir const TypeGroupConverter& rTypeGroup ); 56cdf0e10cSrcweir 57cdf0e10cSrcweir /** Conversion helper for data series and data points. */ 58cdf0e10cSrcweir static void convertLabelFormatting( 59cdf0e10cSrcweir PropertySet& rPropSet, 60cdf0e10cSrcweir ObjectFormatter& rFormatter, 61cdf0e10cSrcweir const DataLabelModelBase& rDataLabel, 62cdf0e10cSrcweir const TypeGroupConverter& rTypeGroup, 63cdf0e10cSrcweir bool bDataSeriesLabel ); 64cdf0e10cSrcweir }; 65cdf0e10cSrcweir 66cdf0e10cSrcweir // ============================================================================ 67cdf0e10cSrcweir 68cdf0e10cSrcweir class DataLabelsConverter : public ConverterBase< DataLabelsModel > 69cdf0e10cSrcweir { 70cdf0e10cSrcweir public: 71cdf0e10cSrcweir explicit DataLabelsConverter( const ConverterRoot& rParent, DataLabelsModel& rModel ); 72cdf0e10cSrcweir virtual ~DataLabelsConverter(); 73cdf0e10cSrcweir 74cdf0e10cSrcweir /** Converts OOXML data label settings for the passed data series. */ 75cdf0e10cSrcweir void convertFromModel( 76cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries, 77cdf0e10cSrcweir const TypeGroupConverter& rTypeGroup ); 78cdf0e10cSrcweir }; 79cdf0e10cSrcweir 80cdf0e10cSrcweir // ============================================================================ 81cdf0e10cSrcweir 82cdf0e10cSrcweir class ErrorBarConverter : public ConverterBase< ErrorBarModel > 83cdf0e10cSrcweir { 84cdf0e10cSrcweir public: 85cdf0e10cSrcweir explicit ErrorBarConverter( const ConverterRoot& rParent, ErrorBarModel& rModel ); 86cdf0e10cSrcweir virtual ~ErrorBarConverter(); 87cdf0e10cSrcweir 88cdf0e10cSrcweir /** Converts an OOXML errorbar and inserts it into the passed data series. */ 89cdf0e10cSrcweir void convertFromModel( 90cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries ); 91cdf0e10cSrcweir 92cdf0e10cSrcweir private: 93cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > 94cdf0e10cSrcweir createLabeledDataSequence( ErrorBarModel::SourceType eSourceType ); 95cdf0e10cSrcweir }; 96cdf0e10cSrcweir 97cdf0e10cSrcweir // ============================================================================ 98cdf0e10cSrcweir 99cdf0e10cSrcweir class TrendlineLabelConverter : public ConverterBase< TrendlineLabelModel > 100cdf0e10cSrcweir { 101cdf0e10cSrcweir public: 102cdf0e10cSrcweir explicit TrendlineLabelConverter( const ConverterRoot& rParent, TrendlineLabelModel& rModel ); 103cdf0e10cSrcweir virtual ~TrendlineLabelConverter(); 104cdf0e10cSrcweir 105cdf0e10cSrcweir /** Converts the OOXML trendline label. */ 106cdf0e10cSrcweir void convertFromModel( PropertySet& rPropSet ); 107cdf0e10cSrcweir }; 108cdf0e10cSrcweir 109cdf0e10cSrcweir // ============================================================================ 110cdf0e10cSrcweir 111cdf0e10cSrcweir class TrendlineConverter : public ConverterBase< TrendlineModel > 112cdf0e10cSrcweir { 113cdf0e10cSrcweir public: 114cdf0e10cSrcweir explicit TrendlineConverter( const ConverterRoot& rParent, TrendlineModel& rModel ); 115cdf0e10cSrcweir virtual ~TrendlineConverter(); 116cdf0e10cSrcweir 117cdf0e10cSrcweir /** Converts an OOXML trendline and inserts it into the passed data series. */ 118cdf0e10cSrcweir void convertFromModel( 119cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries ); 120cdf0e10cSrcweir }; 121cdf0e10cSrcweir 122cdf0e10cSrcweir // ============================================================================ 123cdf0e10cSrcweir 124cdf0e10cSrcweir class DataPointConverter : public ConverterBase< DataPointModel > 125cdf0e10cSrcweir { 126cdf0e10cSrcweir public: 127cdf0e10cSrcweir explicit DataPointConverter( const ConverterRoot& rParent, DataPointModel& rModel ); 128cdf0e10cSrcweir virtual ~DataPointConverter(); 129cdf0e10cSrcweir 130cdf0e10cSrcweir /** Converts settings for a data point in the passed series. */ 131cdf0e10cSrcweir void convertFromModel( 132cdf0e10cSrcweir const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries >& rxDataSeries, 133cdf0e10cSrcweir const TypeGroupConverter& rTypeGroup, 134cdf0e10cSrcweir const SeriesModel& rSeries ); 135cdf0e10cSrcweir }; 136cdf0e10cSrcweir 137cdf0e10cSrcweir // ============================================================================ 138cdf0e10cSrcweir 139cdf0e10cSrcweir class SeriesConverter : public ConverterBase< SeriesModel > 140cdf0e10cSrcweir { 141cdf0e10cSrcweir public: 142cdf0e10cSrcweir explicit SeriesConverter( const ConverterRoot& rParent, SeriesModel& rModel ); 143cdf0e10cSrcweir virtual ~SeriesConverter(); 144cdf0e10cSrcweir 145cdf0e10cSrcweir /** Creates a labeled data sequence object from category data link. */ 146cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > 147cdf0e10cSrcweir createCategorySequence( const ::rtl::OUString& rRole ); 148cdf0e10cSrcweir /** Creates a labeled data sequence object from value data link. */ 149cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > 150cdf0e10cSrcweir createValueSequence( const ::rtl::OUString& rRole ); 151cdf0e10cSrcweir /** Creates a data series object with initialized source links. */ 152cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > 153cdf0e10cSrcweir createDataSeries( const TypeGroupConverter& rTypeGroup, bool bVaryColorsByPoint ); 154cdf0e10cSrcweir 155cdf0e10cSrcweir private: 156cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > 157cdf0e10cSrcweir createLabeledDataSequence( 158cdf0e10cSrcweir SeriesModel::SourceType eSourceType, 159cdf0e10cSrcweir const ::rtl::OUString& rRole, 160cdf0e10cSrcweir bool bUseTextLabel ); 161cdf0e10cSrcweir }; 162cdf0e10cSrcweir 163cdf0e10cSrcweir // ============================================================================ 164cdf0e10cSrcweir 165cdf0e10cSrcweir } // namespace chart 166cdf0e10cSrcweir } // namespace drawingml 167cdf0e10cSrcweir } // namespace oox 168cdf0e10cSrcweir 169cdf0e10cSrcweir #endif 170