merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / inc / ExplicitCategoriesProvider.hxx
blob18d54eb6e2ad2b6eda28db56d7f122ac874bc4f7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org. If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
26 ************************************************************************/
27 #ifndef CHART2_VIEW_EXPLICITCATEGORIESPROVIDER_HXX
28 #define CHART2_VIEW_EXPLICITCATEGORIESPROVIDER_HXX
30 #include "ServiceMacros.hxx"
31 #include <cppuhelper/implbase1.hxx>
32 #include <cppuhelper/weakref.hxx>
33 #include <com/sun/star/chart2/XCoordinateSystem.hpp>
34 #include <com/sun/star/chart2/data/XTextualDataSequence.hpp>
35 #include <com/sun/star/frame/XModel.hpp>
36 #include "charttoolsdllapi.hxx"
38 #include <vector>
40 namespace chart
43 struct OOO_DLLPUBLIC_CHARTTOOLS ComplexCategory
45 rtl::OUString Text;
46 sal_Int32 Count;
48 ComplexCategory( const rtl::OUString& rText, sal_Int32 nCount ) : Text( rText ), Count (nCount)
52 class OOO_DLLPUBLIC_CHARTTOOLS SplitCategoriesProvider
54 public:
55 virtual ~SplitCategoriesProvider();
57 virtual sal_Int32 getLevelCount() const = 0;
58 virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > getStringsForLevel( sal_Int32 nIndex ) const = 0;
61 class OOO_DLLPUBLIC_CHARTTOOLS ExplicitCategoriesProvider
63 public:
64 ExplicitCategoriesProvider( const ::com::sun::star::uno::Reference<
65 ::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel
66 , const ::com::sun::star::uno::Reference<
67 ::com::sun::star::frame::XModel >& xChartModel
69 virtual ~ExplicitCategoriesProvider();
71 void init();
73 ::com::sun::star::uno::Sequence< ::rtl::OUString > getSimpleCategories();
74 ::std::vector< ComplexCategory > getCategoriesByLevel( sal_Int32 nLevel );
76 static ::rtl::OUString getCategoryByIndex(
77 const ::com::sun::star::uno::Reference<
78 ::com::sun::star::chart2::XCoordinateSystem >& xCooSysModel
79 , const ::com::sun::star::uno::Reference<
80 ::com::sun::star::frame::XModel >& xChartModel
81 , sal_Int32 nIndex );
83 static ::com::sun::star::uno::Sequence< ::rtl::OUString > getExplicitSimpleCategories(
84 const SplitCategoriesProvider& rSplitCategoriesProvider );
86 bool hasComplexCategories() const;
87 sal_Int32 getCategoryLevelCount() const;
89 const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
90 ::com::sun::star::chart2::data::XLabeledDataSequence> >& getSplitCategoriesList();
92 private: //member
93 ::com::sun::star::uno::Sequence< ::rtl::OUString > m_aExplicitCategories;
94 ::std::vector< ::std::vector< ComplexCategory > > m_aComplexCats;
95 bool volatile m_bDirty;
97 ::com::sun::star::uno::WeakReference<
98 ::com::sun::star::chart2::XCoordinateSystem > m_xCooSysModel;
99 ::com::sun::star::uno::Reference<
100 ::com::sun::star::chart2::data::XLabeledDataSequence> m_xOriginalCategories;
101 ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference<
102 ::com::sun::star::chart2::data::XLabeledDataSequence> > m_aSplitCategoriesList;
105 } // namespace chart
107 // CHART2_VIEW_EXPLICITCATEGORIESPROVIDER_HXX
108 #endif