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 CHART2_VIEW_EXPLICITCATEGORIESPROVIDER_HXX
20 #define CHART2_VIEW_EXPLICITCATEGORIESPROVIDER_HXX
22 #include "ServiceMacros.hxx"
23 #include <cppuhelper/implbase1.hxx>
24 #include <cppuhelper/weakref.hxx>
25 #include <com/sun/star/chart2/XCoordinateSystem.hpp>
26 #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
27 #include <com/sun/star/frame/XModel.hpp>
28 #include "charttoolsdllapi.hxx"
35 struct OOO_DLLPUBLIC_CHARTTOOLS ComplexCategory
40 ComplexCategory( const OUString
& rText
, sal_Int32 nCount
) : Text( rText
), Count (nCount
)
44 class OOO_DLLPUBLIC_CHARTTOOLS SplitCategoriesProvider
47 virtual ~SplitCategoriesProvider();
49 virtual sal_Int32
getLevelCount() const = 0;
50 virtual ::com::sun::star::uno::Sequence
< OUString
> getStringsForLevel( sal_Int32 nIndex
) const = 0;
61 DatePlusIndex( const double& _fValue
, sal_Int32 _nIndex
)
71 class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider
74 ExplicitCategoriesProvider( const ::com::sun::star::uno::Reference
<
75 ::com::sun::star::chart2::XCoordinateSystem
>& xCooSysModel
76 , const ::com::sun::star::uno::Reference
<
77 ::com::sun::star::frame::XModel
>& xChartModel
79 virtual ~ExplicitCategoriesProvider();
83 ::com::sun::star::uno::Reference
<
84 ::com::sun::star::chart2::data::XDataSequence
> getOriginalCategories();
86 ::com::sun::star::uno::Sequence
< OUString
> getSimpleCategories();
87 const std::vector
<ComplexCategory
>* getCategoriesByLevel( sal_Int32 nLevel
);
89 static OUString
getCategoryByIndex(
90 const ::com::sun::star::uno::Reference
<
91 ::com::sun::star::chart2::XCoordinateSystem
>& xCooSysModel
92 , const ::com::sun::star::uno::Reference
<
93 ::com::sun::star::frame::XModel
>& xChartModel
96 static ::com::sun::star::uno::Sequence
< OUString
> getExplicitSimpleCategories(
97 const SplitCategoriesProvider
& rSplitCategoriesProvider
);
99 static void convertCategoryAnysToText( ::com::sun::star::uno::Sequence
< OUString
>& rOutTexts
100 , const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
>& rInAnys
101 , ::com::sun::star::uno::Reference
< ::com::sun::star::frame::XModel
> xChartModel
);
103 bool hasComplexCategories() const;
104 sal_Int32
getCategoryLevelCount() const;
106 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
<
107 ::com::sun::star::chart2::data::XLabeledDataSequence
> >& getSplitCategoriesList();
110 const std::vector
< DatePlusIndex
>& getDateCategories();
113 bool volatile m_bDirty
;
114 ::com::sun::star::uno::WeakReference
<
115 ::com::sun::star::chart2::XCoordinateSystem
> m_xCooSysModel
;
116 ::com::sun::star::uno::WeakReference
<
117 ::com::sun::star::frame::XModel
> m_xChartModel
;
118 ::com::sun::star::uno::Reference
<
119 ::com::sun::star::chart2::data::XLabeledDataSequence
> m_xOriginalCategories
;
121 bool m_bIsExplicitCategoriesInited
;
122 ::com::sun::star::uno::Sequence
< OUString
> m_aExplicitCategories
;
123 ::std::vector
< ::std::vector
< ComplexCategory
> > m_aComplexCats
;
124 ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
<
125 ::com::sun::star::chart2::data::XLabeledDataSequence
> > m_aSplitCategoriesList
;
129 std::vector
< DatePlusIndex
> m_aDateCategories
;
134 // CHART2_VIEW_EXPLICITCATEGORIESPROVIDER_HXX
137 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */