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 .
19 #ifndef INCLUDED_CHART2_SOURCE_INC_DATASERIESHELPER_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_DATASERIESHELPER_HXX
22 #include "StackMode.hxx"
23 #include "charttoolsdllapi.hxx"
24 #include <com/sun/star/uno/Reference.h>
25 #include <rtl/ustring.hxx>
29 namespace com
{ namespace sun
{ namespace star
{ namespace beans
{ class XPropertySet
; } } } }
30 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ class XChartType
; } } } }
31 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ class XCoordinateSystem
; } } } }
32 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ class XDataSeries
; } } } }
33 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ class XDiagram
; } } } }
34 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ namespace data
{ class XDataSequence
; } } } } }
35 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ namespace data
{ class XDataSource
; } } } } }
36 namespace com
{ namespace sun
{ namespace star
{ namespace chart2
{ namespace data
{ class XLabeledDataSequence
; } } } } }
37 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{ class Any
; } } } }
38 namespace com
{ namespace sun
{ namespace star
{ namespace uno
{ template <class E
> class Sequence
; } } } }
43 namespace DataSeriesHelper
46 OOO_DLLPUBLIC_CHARTTOOLS OUString
47 getRole( const css::uno::Reference
<css::chart2::data::XLabeledDataSequence
>& xLabeledDataSequence
);
49 /** Retrieves the data sequence in the given data source that matches the
50 given role. If more than one sequences match the role, the first match
51 is returned. If no sequence matches, an empty reference is returned.
54 The data source containing all data sequences to be searched through.
57 The role that is to be filtered out.
59 OOO_DLLPUBLIC_CHARTTOOLS
css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
60 getDataSequenceByRole( const css::uno::Reference
< css::chart2::data::XDataSource
> & xSource
,
61 const OUString
& aRole
,
62 bool bMatchPrefix
= false );
64 /** Retrieves all data sequences in the given data source that match the given
68 The data source containing all data sequences to be searched through.
71 The role that is to be filtered out.
73 OOO_DLLPUBLIC_CHARTTOOLS
std::vector
<
74 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
> >
75 getAllDataSequencesByRole( const css::uno::Sequence
< css::uno::Reference
< css::chart2::data::XLabeledDataSequence
> > & aDataSequences
,
76 const OUString
& aRole
);
78 OOO_DLLPUBLIC_CHARTTOOLS
79 std::vector
<css::uno::Reference
<css::chart2::data::XLabeledDataSequence
> >
81 const css::uno::Sequence
<css::uno::Reference
<css::chart2::XDataSeries
> >& aSeries
);
83 /** Retrieves all data sequences found in the given data series and puts them
84 into a data source. The order of sequences will match the order of the data
87 OOO_DLLPUBLIC_CHARTTOOLS
css::uno::Reference
< css::chart2::data::XDataSource
>
88 getDataSource( const css::uno::Sequence
< css::uno::Reference
< css::chart2::XDataSeries
> > & aSeries
);
90 /** Get the label of a series (e.g. for the legend)
92 @param rLabelSequenceRole
93 The data sequence contained in xSeries that has this role will be used
96 OOO_DLLPUBLIC_CHARTTOOLS OUString
getDataSeriesLabel(
97 const css::uno::Reference
< css::chart2::XDataSeries
> & xSeries
,
98 const OUString
& rLabelSequenceRole
);
100 /** Get the label of a labeled sequence including necessary automatic generation
102 OOO_DLLPUBLIC_CHARTTOOLS OUString
getLabelForLabeledDataSequence(
103 const css::uno::Reference
< css::chart2::data::XLabeledDataSequence
> & xLabeledSeq
);
105 OOO_DLLPUBLIC_CHARTTOOLS
void setStackModeAtSeries(
106 const css::uno::Sequence
< css::uno::Reference
< css::chart2::XDataSeries
> > & aSeries
,
107 const css::uno::Reference
< css::chart2::XCoordinateSystem
> & xCorrespondingCoordinateSystem
,
108 StackMode eStackMode
);
110 OOO_DLLPUBLIC_CHARTTOOLS sal_Int32
getAttachedAxisIndex(
111 const css::uno::Reference
< css::chart2::XDataSeries
> & xSeries
);
113 /// @param nAxisIndex, if -1 it is determined by the given data series via getAttachedAxisIndex
114 OOO_DLLPUBLIC_CHARTTOOLS sal_Int32
getNumberFormatKeyFromAxis(
115 const css::uno::Reference
< css::chart2::XDataSeries
> & xSeries
,
116 const css::uno::Reference
< css::chart2::XCoordinateSystem
> & xCorrespondingCoordinateSystem
,
117 sal_Int32 nDimensionIndex
,
118 sal_Int32 nAxisIndex
= -1 );
120 OOO_DLLPUBLIC_CHARTTOOLS
121 css::uno::Reference
< css::chart2::XCoordinateSystem
>
122 getCoordinateSystemOfSeries(
123 const css::uno::Reference
< css::chart2::XDataSeries
> & xSeries
,
124 const css::uno::Reference
< css::chart2::XDiagram
> & xDiagram
);
126 OOO_DLLPUBLIC_CHARTTOOLS
127 css::uno::Reference
< css::chart2::XChartType
>
128 getChartTypeOfSeries(
129 const css::uno::Reference
< css::chart2::XDataSeries
> & xSeries
,
130 const css::uno::Reference
< css::chart2::XDiagram
> & xDiagram
);
132 OOO_DLLPUBLIC_CHARTTOOLS
void deleteSeries(
133 const css::uno::Reference
< css::chart2::XDataSeries
> & xSeries
,
134 const css::uno::Reference
< css::chart2::XChartType
> & xChartType
);
136 OOO_DLLPUBLIC_CHARTTOOLS
void switchSymbolsOnOrOff(
137 const css::uno::Reference
< css::beans::XPropertySet
> & xSeriesProperties
,
138 bool bSymbolsOn
, sal_Int32 nSeriesIndex
);
140 OOO_DLLPUBLIC_CHARTTOOLS
void switchLinesOnOrOff(
141 const css::uno::Reference
< css::beans::XPropertySet
> & xSeriesProperties
,
144 OOO_DLLPUBLIC_CHARTTOOLS
145 void makeLinesThickOrThin( const css::uno::Reference
< css::beans::XPropertySet
> & xSeriesProperties
, bool bThick
);
147 OOO_DLLPUBLIC_CHARTTOOLS
void setPropertyAlsoToAllAttributedDataPoints(
148 const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
,
149 const OUString
& rPropertyName
,
150 const css::uno::Any
& rPropertyValue
);
152 OOO_DLLPUBLIC_CHARTTOOLS
bool hasAttributedDataPointDifferentValue(
153 const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
,
154 const OUString
& rPropertyName
,
155 const css::uno::Any
& rPropertyValue
);
157 OOO_DLLPUBLIC_CHARTTOOLS
bool hasUnhiddenData( const css::uno::Reference
<
158 css::chart2::XDataSeries
>& xSeries
);
160 OOO_DLLPUBLIC_CHARTTOOLS
161 sal_Int32
translateIndexFromHiddenToFullSequence( sal_Int32 nClippedIndex
, const css::uno::Reference
<
162 css::chart2::data::XDataSequence
>& xDataSequence
, bool bTranslate
);
164 OOO_DLLPUBLIC_CHARTTOOLS
bool hasDataLabelsAtSeries( const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
);
166 OOO_DLLPUBLIC_CHARTTOOLS
bool hasDataLabelsAtPoints( const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
);
168 OOO_DLLPUBLIC_CHARTTOOLS
bool hasDataLabelAtPoint( const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
, sal_Int32 nPointIndex
);
170 OOO_DLLPUBLIC_CHARTTOOLS
void insertDataLabelsToSeriesAndAllPoints( const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
);
172 OOO_DLLPUBLIC_CHARTTOOLS
void insertDataLabelToPoint( const css::uno::Reference
< css::beans::XPropertySet
>& xPointPropertySet
);
174 OOO_DLLPUBLIC_CHARTTOOLS
void deleteDataLabelsFromSeriesAndAllPoints( const css::uno::Reference
< css::chart2::XDataSeries
>& xSeries
);
176 OOO_DLLPUBLIC_CHARTTOOLS
void deleteDataLabelsFromPoint( const css::uno::Reference
< css::beans::XPropertySet
>& xPointPropertySet
);
178 } // namespace DataSeriesHelper
181 // INCLUDED_CHART2_SOURCE_INC_DATASERIESHELPER_HXX
184 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */