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_EXPLICITCATEGORIESPROVIDER_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_EXPLICITCATEGORIESPROVIDER_HXX
22 #include <cppuhelper/implbase1.hxx>
23 #include <cppuhelper/weakref.hxx>
24 #include <com/sun/star/chart2/XCoordinateSystem.hpp>
25 #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
26 #include "charttoolsdllapi.hxx"
27 #include "ChartModel.hxx"
34 struct OOO_DLLPUBLIC_CHARTTOOLS ComplexCategory
39 ComplexCategory( const OUString
& rText
, sal_Int32 nCount
) : Text( rText
), Count (nCount
)
43 class OOO_DLLPUBLIC_CHARTTOOLS SplitCategoriesProvider
46 virtual ~SplitCategoriesProvider();
48 virtual sal_Int32
getLevelCount() const = 0;
49 virtual ::com::sun::star::uno::Sequence
< OUString
> getStringsForLevel( sal_Int32 nIndex
) const = 0;
60 DatePlusIndex( const double& _fValue
, sal_Int32 _nIndex
)
70 class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider
73 ExplicitCategoriesProvider( const ::com::sun::star::uno::Reference
<
74 ::com::sun::star::chart2::XCoordinateSystem
>& xCooSysModel
75 , ChartModel
& rChartModel
77 virtual ~ExplicitCategoriesProvider();
81 ::com::sun::star::uno::Reference
<
82 ::com::sun::star::chart2::data::XDataSequence
> getOriginalCategories();
84 ::com::sun::star::uno::Sequence
< OUString
> getSimpleCategories();
85 const std::vector
<ComplexCategory
>* getCategoriesByLevel( sal_Int32 nLevel
);
87 static OUString
getCategoryByIndex(
88 const ::com::sun::star::uno::Reference
<
89 ::com::sun::star::chart2::XCoordinateSystem
>& xCooSysModel
93 static ::com::sun::star::uno::Sequence
< OUString
> getExplicitSimpleCategories(
94 const SplitCategoriesProvider
& rSplitCategoriesProvider
);
96 static void convertCategoryAnysToText( ::com::sun::star::uno::Sequence
< OUString
>& rOutTexts
97 , const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& rInAnys
98 , ChartModel
& rModel
);
100 bool hasComplexCategories() const;
101 sal_Int32
getCategoryLevelCount() const;
103 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
<
104 ::com::sun::star::chart2::data::XLabeledDataSequence
> >& getSplitCategoriesList() { return m_aSplitCategoriesList
;}
107 const std::vector
< DatePlusIndex
>& getDateCategories();
110 bool volatile m_bDirty
;
111 ::com::sun::star::uno::WeakReference
<
112 ::com::sun::star::chart2::XCoordinateSystem
> m_xCooSysModel
;
114 ::com::sun::star::uno::Reference
<
115 ::com::sun::star::chart2::data::XLabeledDataSequence
> m_xOriginalCategories
;
117 bool m_bIsExplicitCategoriesInited
;
118 ::com::sun::star::uno::Sequence
< OUString
> m_aExplicitCategories
;
119 ::std::vector
< ::std::vector
< ComplexCategory
> > m_aComplexCats
;
120 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
<
121 ::com::sun::star::chart2::data::XLabeledDataSequence
> > m_aSplitCategoriesList
;
125 std::vector
< DatePlusIndex
> m_aDateCategories
;
130 // INCLUDED_CHART2_SOURCE_INC_EXPLICITCATEGORIESPROVIDER_HXX
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */