fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / chart2 / source / inc / ExplicitCategoriesProvider.hxx
blob38c922b0e67bfddda036371b20ebc4a1b68aa0c5
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 #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"
29 #include <vector>
31 namespace chart
34 struct OOO_DLLPUBLIC_CHARTTOOLS ComplexCategory
36 OUString Text;
37 sal_Int32 Count;
39 ComplexCategory( const OUString& rText, sal_Int32 nCount ) : Text( rText ), Count (nCount)
43 class OOO_DLLPUBLIC_CHARTTOOLS SplitCategoriesProvider
45 public:
46 virtual ~SplitCategoriesProvider();
48 virtual sal_Int32 getLevelCount() const = 0;
49 virtual ::com::sun::star::uno::Sequence< OUString > getStringsForLevel( sal_Int32 nIndex ) const = 0;
52 struct DatePlusIndex
54 DatePlusIndex()
55 : fValue(1.0)
56 , nIndex( -1 )
60 DatePlusIndex( const double& _fValue, sal_Int32 _nIndex )
61 : fValue(_fValue)
62 , nIndex( _nIndex )
66 double fValue;
67 sal_Int32 nIndex;
70 class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider
72 public:
73 ExplicitCategoriesProvider( const ::com::sun::star::uno::Reference<
74 ::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel
75 , ChartModel& rChartModel
77 virtual ~ExplicitCategoriesProvider();
79 void init();
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
90 , ChartModel& rModel
91 , sal_Int32 nIndex );
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;}
106 bool isDateAxis();
107 const std::vector< DatePlusIndex >& getDateCategories();
109 private: //member
110 bool volatile m_bDirty;
111 ::com::sun::star::uno::WeakReference<
112 ::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel;
113 ChartModel& mrModel;
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;
123 bool m_bIsDateAxis;
124 bool m_bIsAutoDate;
125 std::vector< DatePlusIndex > m_aDateCategories;
128 } // namespace chart
130 // INCLUDED_CHART2_SOURCE_INC_EXPLICITCATEGORIESPROVIDER_HXX
131 #endif
133 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */