nss: upgrade to release 3.73
[LibreOffice.git] / chart2 / source / inc / DataSeriesHelper.hxx
bloba5d7119bff98fbd173a466815019cd9451285a59
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 #pragma once
21 #include "StackMode.hxx"
22 #include "charttoolsdllapi.hxx"
23 #include <com/sun/star/uno/Reference.h>
24 #include <rtl/ustring.hxx>
26 #include <vector>
28 namespace com::sun::star::beans { class XPropertySet; }
29 namespace com::sun::star::chart2 { class XChartType; }
30 namespace com::sun::star::chart2 { class XCoordinateSystem; }
31 namespace com::sun::star::chart2 { class XDataSeries; }
32 namespace com::sun::star::chart2 { class XDiagram; }
33 namespace com::sun::star::chart2::data { class XDataSequence; }
34 namespace com::sun::star::chart2::data { class XDataSource; }
35 namespace com::sun::star::chart2::data { class XLabeledDataSequence; }
36 namespace com::sun::star::uno { class Any; }
37 namespace com::sun::star::uno { template <class E> class Sequence; }
39 namespace chart::DataSeriesHelper
42 OOO_DLLPUBLIC_CHARTTOOLS OUString
43 getRole( const css::uno::Reference<css::chart2::data::XLabeledDataSequence>& xLabeledDataSequence );
45 /** Retrieves the data sequence in the given data source that matches the
46 given role. If more than one sequences match the role, the first match
47 is returned. If no sequence matches, an empty reference is returned.
49 @param aSource
50 The data source containing all data sequences to be searched through.
52 @param aRole
53 The role that is to be filtered out.
55 OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XLabeledDataSequence >
56 getDataSequenceByRole( const css::uno::Reference< css::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 prefix.
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 css::uno::Reference< css::chart2::data::XLabeledDataSequence > >
71 getAllDataSequencesByRole( const css::uno::Sequence< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & aDataSequences,
72 const OUString& aRole );
74 OOO_DLLPUBLIC_CHARTTOOLS
75 std::vector<css::uno::Reference<css::chart2::data::XLabeledDataSequence> >
76 getAllDataSequences(
77 const css::uno::Sequence<css::uno::Reference<css::chart2::XDataSeries> >& aSeries );
79 /** Retrieves all data sequences found in the given data series and puts them
80 into a data source. The order of sequences will match the order of the data
81 series.
83 OOO_DLLPUBLIC_CHARTTOOLS css::uno::Reference< css::chart2::data::XDataSource >
84 getDataSource( const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > > & aSeries );
86 /** Get the label of a series (e.g. for the legend)
88 @param rLabelSequenceRole
89 The data sequence contained in xSeries that has this role will be used
90 to take its label.
92 OOO_DLLPUBLIC_CHARTTOOLS OUString getDataSeriesLabel(
93 const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
94 const OUString & rLabelSequenceRole );
96 /** Get the label of a labeled sequence including necessary automatic generation
98 OOO_DLLPUBLIC_CHARTTOOLS OUString getLabelForLabeledDataSequence(
99 const css::uno::Reference< css::chart2::data::XLabeledDataSequence > & xLabeledSeq );
101 OOO_DLLPUBLIC_CHARTTOOLS void setStackModeAtSeries(
102 const css::uno::Sequence< css::uno::Reference< css::chart2::XDataSeries > > & aSeries,
103 const css::uno::Reference< css::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem,
104 StackMode eStackMode );
106 OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getAttachedAxisIndex(
107 const css::uno::Reference< css::chart2::XDataSeries > & xSeries );
109 /// @param nAxisIndex, if -1 it is determined by the given data series via getAttachedAxisIndex
110 OOO_DLLPUBLIC_CHARTTOOLS sal_Int32 getNumberFormatKeyFromAxis(
111 const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
112 const css::uno::Reference< css::chart2::XCoordinateSystem > & xCorrespondingCoordinateSystem,
113 sal_Int32 nDimensionIndex,
114 sal_Int32 nAxisIndex = -1 );
116 OOO_DLLPUBLIC_CHARTTOOLS
117 css::uno::Reference< css::chart2::XCoordinateSystem >
118 getCoordinateSystemOfSeries(
119 const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
120 const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
122 OOO_DLLPUBLIC_CHARTTOOLS
123 css::uno::Reference< css::chart2::XChartType >
124 getChartTypeOfSeries(
125 const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
126 const css::uno::Reference< css::chart2::XDiagram > & xDiagram );
128 OOO_DLLPUBLIC_CHARTTOOLS void deleteSeries(
129 const css::uno::Reference< css::chart2::XDataSeries > & xSeries,
130 const css::uno::Reference< css::chart2::XChartType > & xChartType );
132 OOO_DLLPUBLIC_CHARTTOOLS void switchSymbolsOnOrOff(
133 const css::uno::Reference< css::beans::XPropertySet > & xSeriesProperties,
134 bool bSymbolsOn, sal_Int32 nSeriesIndex );
136 OOO_DLLPUBLIC_CHARTTOOLS void switchLinesOnOrOff(
137 const css::uno::Reference< css::beans::XPropertySet > & xSeriesProperties,
138 bool bLinesOn );
140 OOO_DLLPUBLIC_CHARTTOOLS
141 void makeLinesThickOrThin( const css::uno::Reference< css::beans::XPropertySet > & xSeriesProperties, bool bThick );
143 OOO_DLLPUBLIC_CHARTTOOLS void setPropertyAlsoToAllAttributedDataPoints(
144 const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
145 const OUString& rPropertyName,
146 const css::uno::Any& rPropertyValue );
148 OOO_DLLPUBLIC_CHARTTOOLS bool hasAttributedDataPointDifferentValue(
149 const css::uno::Reference< css::chart2::XDataSeries >& xSeries,
150 const OUString& rPropertyName,
151 const css::uno::Any& rPropertyValue );
153 OOO_DLLPUBLIC_CHARTTOOLS bool hasUnhiddenData( const css::uno::Reference<
154 css::chart2::XDataSeries >& xSeries );
156 OOO_DLLPUBLIC_CHARTTOOLS
157 sal_Int32 translateIndexFromHiddenToFullSequence( sal_Int32 nClippedIndex, const css::uno::Reference<
158 css::chart2::data::XDataSequence >& xDataSequence, bool bTranslate );
160 OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelsAtSeries( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
162 OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelsAtPoints( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
164 OOO_DLLPUBLIC_CHARTTOOLS bool hasDataLabelAtPoint( const css::uno::Reference< css::chart2::XDataSeries >& xSeries, sal_Int32 nPointIndex );
166 OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelsToSeriesAndAllPoints( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
168 OOO_DLLPUBLIC_CHARTTOOLS void insertDataLabelToPoint( const css::uno::Reference< css::beans::XPropertySet >& xPointPropertySet );
170 OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromSeriesAndAllPoints( const css::uno::Reference< css::chart2::XDataSeries >& xSeries );
172 OOO_DLLPUBLIC_CHARTTOOLS void deleteDataLabelsFromPoint( const css::uno::Reference< css::beans::XPropertySet >& xPointPropertySet );
174 } // namespace chart::DataSeriesHelper
176 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */