fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / inc / DataSeriesHelper.hxx
blob1c1e6c0c98b1b3b83276f5fe4deb1d9fcc845049
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef INCLUDED_CHART2_SOURCE_INC_DATASERIESHELPER_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_DATASERIESHELPER_HXX
22 #include <com/sun/star/chart2/data/XDataSequence.hpp>
23 #include <com/sun/star/chart2/data/XDataSource.hpp>
24 #include <com/sun/star/chart2/XDataSeries.hpp>
25 #include <com/sun/star/chart2/XDiagram.hpp>
26 #include <com/sun/star/chart2/XCoordinateSystem.hpp>
27 #include <com/sun/star/chart2/XChartType.hpp>
29 #include "StackMode.hxx"
30 #include "charttoolsdllapi.hxx"
32 #include <functional>
33 #include <vector>
35 namespace chart
38 namespace DataSeriesHelper
41 OOO_DLLPUBLIC_CHARTTOOLS OUString
42 getRole( const css::uno::Reference<css::chart2::data::XLabeledDataSequence>& xLabeledDataSequence );
44 /** Retrieves the data sequence in the given data source that matches the
45 given role. If more than one sequences match the role, the first match
46 is returned. If no sequence matches, an empty reference is returned.
48 @param aSource
49 The data source containing all data sequences to be searched through.
51 @param aRole
52 The role that is to be filtered out.
54 OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence >
55 getDataSequenceByRole( const ::com::sun::star::uno::Reference<
56 ::com::sun::star::chart2::data::XDataSource > & xSource,
57 const OUString& aRole,
58 bool bMatchPrefix = false );
60 /** Retrieves all data sequences in the given data source that match the given
61 role.
63 @param aSource
64 The data source containing all data sequences to be searched through.
66 @param aRole
67 The role that is to be filtered out.
69 OOO_DLLPUBLIC_CHARTTOOLS ::std::vector<
70 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > >
71 getAllDataSequencesByRole( const ::com::sun::star::uno::Sequence<
72 ::com::sun::star::uno::Reference<
73 ::com::sun::star::chart2::data::XLabeledDataSequence > > & aDataSequences,
74 const OUString& aRole,
75 bool bMatchPrefix = false );
77 OOO_DLLPUBLIC_CHARTTOOLS
78 std::vector<css::uno::Reference<css::chart2::data::XLabeledDataSequence> >
79 getAllDataSequences(
80 const css::uno::Sequence<css::uno::Reference<css::chart2::XDataSeries> >& aSeries );
82 /** Retrieves all data sequences found in the given data series and puts them
83 into a data source. The order of sequences will match the order of the data
84 series.
86 OOO_DLLPUBLIC_CHARTTOOLS ::com::sun::star::uno::Reference<
87 ::com::sun::star::chart2::data::XDataSource >
88 getDataSource( const ::com::sun::star::uno::Sequence<
89 ::com::sun::star::uno::Reference<
90 ::com::sun::star::chart2::XDataSeries > > & aSeries );
92 /** Get the label of a series (e.g. for the legend)
94 @param rLabelSequenceRole
95 The data sequence contained in xSeries that has this role will be used
96 to take its label.
98 OOO_DLLPUBLIC_CHARTTOOLS OUString getDataSeriesLabel(
99 const ::com::sun::star::uno::Reference<
100 ::com::sun::star::chart2::XDataSeries > & xSeries,
101 const OUString & rLabelSequenceRole );
103 /** Get the label of a labeled sequence including necessary automatic generation
105 OOO_DLLPUBLIC_CHARTTOOLS OUString getLabelForLabeledDataSequence(
106 const ::com::sun::star::uno::Reference<
107 ::com::sun::star::chart2::data::XLabeledDataSequence > & xLabeledSeq );
109 OOO_DLLPUBLIC_CHARTTOOLS void setStackModeAtSeries(
110 const ::com::sun::star::uno::Sequence<
111 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > > & aSeries,
112 const ::com::sun::star::uno::Reference<
113 ::com::sun::star::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem,
114 StackMode eStackMode );
116 OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getAttachedAxisIndex(
117 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > & xSeries );
119 /// @param nAxisIndex, if -1 it is determined by the given data series via getAttachedAxisIndex
120 OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getNumberFormatKeyFromAxis(
121 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > & xSeries,
122 const ::com::sun::star::uno::Reference<
123 ::com::sun::star::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem,
124 sal_Int32 nDimensionIndex,
125 sal_Int32 nAxisIndex = -1 );
127 OOO_DLLPUBLIC_CHARTTOOLS
128 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XCoordinateSystem >
129 getCoordinateSystemOfSeries(
130 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > & xSeries,
131 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram > & xDiagram );
133 OOO_DLLPUBLIC_CHARTTOOLS
134 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >
135 getChartTypeOfSeries(
136 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > & xSeries,
137 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDiagram > & xDiagram );
139 OOO_DLLPUBLIC_CHARTTOOLS void deleteSeries(
140 const ::com::sun::star::uno::Reference<
141 ::com::sun::star::chart2::XDataSeries > & xSeries,
142 const ::com::sun::star::uno::Reference<
143 ::com::sun::star::chart2::XChartType > & xChartType );
145 OOO_DLLPUBLIC_CHARTTOOLS void switchSymbolsOnOrOff(
146 const ::com::sun::star::uno::Reference<
147 ::com::sun::star::beans::XPropertySet > & xSeriesProperties,
148 bool bSymbolsOn, sal_Int32 nSeriesIndex );
150 OOO_DLLPUBLIC_CHARTTOOLS void switchLinesOnOrOff(
151 const ::com::sun::star::uno::Reference<
152 ::com::sun::star::beans::XPropertySet > & xSeriesProperties,
153 bool bLinesOn );
155 OOO_DLLPUBLIC_CHARTTOOLS
156 void makeLinesThickOrThin( const ::com::sun::star::uno::Reference<
157 ::com::sun::star::beans::XPropertySet > & xSeriesProperties, bool bThick );
159 OOO_DLLPUBLIC_CHARTTOOLS void setPropertyAlsoToAllAttributedDataPoints(
160 const ::com::sun::star::uno::Reference<
161 ::com::sun::star::chart2::XDataSeries >& xSeries,
162 const OUString& rPropertyName,
163 const ::com::sun::star::uno::Any& rPropertyValue );
165 OOO_DLLPUBLIC_CHARTTOOLS bool hasAttributedDataPointDifferentValue(
166 const ::com::sun::star::uno::Reference<
167 ::com::sun::star::chart2::XDataSeries >& xSeries,
168 const OUString& rPropertyName,
169 const ::com::sun::star::uno::Any& rPropertyValue );
171 OOO_DLLPUBLIC_CHARTTOOLS bool areAllSeriesAttachedToSameAxis(
172 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XChartType >& xChartType,
173 sal_Int32 & rOutAxisIndex );
175 OOO_DLLPUBLIC_CHARTTOOLS bool hasUnhiddenData( const ::com::sun::star::uno::Reference<
176 ::com::sun::star::chart2::XDataSeries >& xSeries );
178 OOO_DLLPUBLIC_CHARTTOOLS
179 sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nClippedIndex, const ::com::sun::star::uno::Reference<
180 ::com::sun::star::chart2::data::XDataSequence >& xDataSequence, bool bTranslate );
182 OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelsAtSeries( const ::com::sun::star::uno::Reference<
183 ::com::sun::star::chart2::XDataSeries >& xSeries );
185 OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelsAtPoints( const ::com::sun::star::uno::Reference<
186 ::com::sun::star::chart2::XDataSeries >& xSeries );
188 OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelAtPoint( const ::com::sun::star::uno::Reference<
189 ::com::sun::star::chart2::XDataSeries >& xSeries, sal_Int32 nPointIndex );
191 OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelsToSeriesAndAllPoints( const ::com::sun::star::uno::Reference<
192 ::com::sun::star::chart2::XDataSeries >& xSeries );
194 OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelToPoint( const ::com::sun::star::uno::Reference<
195 ::com::sun::star::beans::XPropertySet >& xPointPropertySet );
197 OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromSeriesAndAllPoints( const ::com::sun::star::uno::Reference<
198 ::com::sun::star::chart2::XDataSeries >& xSeries );
200 OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromPoint( const ::com::sun::star::uno::Reference<
201 ::com::sun::star::beans::XPropertySet >& xPointPropertySet );
203 } // namespace DataSeriesHelper
204 } // namespace chart
206 // INCLUDED_CHART2_SOURCE_INC_DATASERIESHELPER_HXX
207 #endif
209 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */