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 .
21 #include "StackMode.hxx"
22 #include "charttoolsdllapi.hxx"
23 #include <com/sun/star/uno/Reference.h>
24 #include <rtl/ustring.hxx>
25 #include <rtl/ref.hxx>
29 namespace com::sun::star::beans
{ class XPropertySet
; }
30 namespace com::sun::star::chart2
{ class XChartType
; }
31 namespace com::sun::star::chart2
{ class XCoordinateSystem
; }
32 namespace com::sun::star::chart2
{ class XDataSeries
; }
33 namespace com::sun::star::chart2
{ class XDiagram
; }
34 namespace com::sun::star::chart2::data
{ class XDataSequence
; }
35 namespace com::sun::star::chart2::data
{ class XDataSource
; }
36 namespace com::sun::star::chart2::data
{ class XLabeledDataSequence
; }
37 namespace com::sun::star::uno
{ class Any
; }
38 namespace com::sun::star::uno
{ template <class E
> class Sequence
; }
39 namespace chart
{ class BaseCoordinateSystem
; }
40 namespace chart
{ class ChartType
; }
41 namespace chart
{ class DataSource
; }
42 namespace chart
{ class Diagram
; }
43 namespace chart
{ class DataSeries
; }
44 namespace chart
{ class LabeledDataSequence
; }
46 namespace chart::DataSeriesHelper
49 OOO_DLLPUBLIC_CHARTTOOLS OUString
50 getRole( const css::uno::Reference
<css::chart2::data::XLabeledDataSequence
>& xLabeledDataSequence
);
52 /** Retrieves the data sequence in the given data source that matches the
53 given role. If more than one sequences match the role, the first match
54 is returned. If no sequence matches, an empty reference is returned.
57 The data source containing all data sequences to be searched through.
60 The role that is to be filtered out.
62 OOO_DLLPUBLIC_CHARTTOOLS
css::uno::Reference
< css::chart2::data::XLabeledDataSequence
>
63 getDataSequenceByRole( const css::uno::Reference
< css::chart2::data::XDataSource
> & xSource
,
64 const OUString
& aRole
,
65 bool bMatchPrefix
= false );
67 /** Retrieves all data sequences in the given data source that match the given
71 The data source containing all data sequences to be searched through.
74 The role that is to be filtered out.
76 OOO_DLLPUBLIC_CHARTTOOLS
std::vector
<
77 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
> >
78 getAllDataSequencesByRole( const css::uno::Sequence
< css::uno::Reference
< css::chart2::data::XLabeledDataSequence
> > & aDataSequences
,
79 const OUString
& aRole
);
80 OOO_DLLPUBLIC_CHARTTOOLS
std::vector
<
81 css::uno::Reference
< css::chart2::data::XLabeledDataSequence
> >
82 getAllDataSequencesByRole( const std::vector
< css::uno::Reference
< css::chart2::data::XLabeledDataSequence
> > & aDataSequences
,
83 const OUString
& aRole
);
85 OOO_DLLPUBLIC_CHARTTOOLS
86 std::vector
< css::uno::Reference
< css::chart2::data::XLabeledDataSequence
> >
88 const std::vector
<rtl::Reference
<::chart::DataSeries
> >& aSeries
);
90 /** Retrieves all data sequences found in the given data series and puts them
91 into a data source. The order of sequences will match the order of the data
94 OOO_DLLPUBLIC_CHARTTOOLS
rtl::Reference
< ::chart::DataSource
>
95 getDataSource( const std::vector
< rtl::Reference
< ::chart::DataSeries
> > & aSeries
);
97 OOO_DLLPUBLIC_CHARTTOOLS
void setStackModeAtSeries(
98 const std::vector
< rtl::Reference
< ::chart::DataSeries
> > & aSeries
,
99 const rtl::Reference
< ::chart::BaseCoordinateSystem
> & xCorrespondingCoordinateSystem
,
100 StackMode eStackMode
);
102 OOO_DLLPUBLIC_CHARTTOOLS sal_Int32
getAttachedAxisIndex(
103 const rtl::Reference
< ::chart::DataSeries
> & xSeries
);
105 /// @param nAxisIndex, if -1 it is determined by the given data series via getAttachedAxisIndex
106 OOO_DLLPUBLIC_CHARTTOOLS sal_Int32
getNumberFormatKeyFromAxis(
107 const rtl::Reference
< ::chart::DataSeries
> & xSeries
,
108 const rtl::Reference
< ::chart::BaseCoordinateSystem
> & xCorrespondingCoordinateSystem
,
109 sal_Int32 nDimensionIndex
,
110 sal_Int32 nAxisIndex
= -1 );
112 OOO_DLLPUBLIC_CHARTTOOLS
113 rtl::Reference
< ::chart::BaseCoordinateSystem
>
114 getCoordinateSystemOfSeries(
115 const rtl::Reference
< ::chart::DataSeries
> & xSeries
,
116 const rtl::Reference
< ::chart::Diagram
> & xDiagram
);
118 OOO_DLLPUBLIC_CHARTTOOLS
119 rtl::Reference
< ::chart::ChartType
>
120 getChartTypeOfSeries(
121 const rtl::Reference
< ::chart::DataSeries
> & xSeries
,
122 const rtl::Reference
< ::chart::Diagram
> & xDiagram
);
124 OOO_DLLPUBLIC_CHARTTOOLS
void deleteSeries(
125 const rtl::Reference
< ::chart::DataSeries
> & xSeries
,
126 const rtl::Reference
< ::chart::ChartType
> & xChartType
);
128 OOO_DLLPUBLIC_CHARTTOOLS
void switchSymbolsOnOrOff(
129 const rtl::Reference
< ::chart::DataSeries
> & xSeries
,
130 bool bSymbolsOn
, sal_Int32 nSeriesIndex
);
132 OOO_DLLPUBLIC_CHARTTOOLS
void switchLinesOnOrOff(
133 const rtl::Reference
< ::chart::DataSeries
> & xSeries
,
136 OOO_DLLPUBLIC_CHARTTOOLS
137 void makeLinesThickOrThin( const rtl::Reference
< ::chart::DataSeries
> & xSeries
, bool bThick
);
139 OOO_DLLPUBLIC_CHARTTOOLS
void setPropertyAlsoToAllAttributedDataPoints(
140 const rtl::Reference
< ::chart::DataSeries
>& xSeries
,
141 const OUString
& rPropertyName
,
142 const css::uno::Any
& rPropertyValue
);
145 OOO_DLLPUBLIC_CHARTTOOLS
bool hasAttributedDataPointDifferentValue(
146 const rtl::Reference
< ::chart::DataSeries
>& xSeries
,
147 const OUString
& rPropertyName
,
148 const css::uno::Any
& rPropertyValue
);
150 OOO_DLLPUBLIC_CHARTTOOLS
151 sal_Int32
translateIndexFromHiddenToFullSequence( sal_Int32 nClippedIndex
, const css::uno::Reference
<
152 css::chart2::data::XDataSequence
>& xDataSequence
, bool bTranslate
);
154 OOO_DLLPUBLIC_CHARTTOOLS
bool hasDataLabelsAtSeries( const rtl::Reference
< ::chart::DataSeries
>& xSeries
);
156 OOO_DLLPUBLIC_CHARTTOOLS
bool hasDataLabelsAtPoints( const rtl::Reference
< ::chart::DataSeries
>& xSeries
);
158 OOO_DLLPUBLIC_CHARTTOOLS
bool hasDataLabelAtPoint( const rtl::Reference
< ::chart::DataSeries
>& xSeries
, sal_Int32 nPointIndex
);
160 OOO_DLLPUBLIC_CHARTTOOLS
void insertDataLabelsToSeriesAndAllPoints( const rtl::Reference
< ::chart::DataSeries
>& xSeries
);
162 OOO_DLLPUBLIC_CHARTTOOLS
void insertDataLabelToPoint( const css::uno::Reference
< css::beans::XPropertySet
>& xPointPropertySet
);
164 OOO_DLLPUBLIC_CHARTTOOLS
void deleteDataLabelsFromSeriesAndAllPoints( const rtl::Reference
< ::chart::DataSeries
>& xSeries
);
166 OOO_DLLPUBLIC_CHARTTOOLS
void deleteDataLabelsFromPoint( const css::uno::Reference
< css::beans::XPropertySet
>& xPointPropertySet
);
168 } // namespace chart::DataSeriesHelper
170 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */