LibreOffice Module chart2 (master) 1
ExplicitCategoriesProvider.hxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
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/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
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 .
18 */
19#pragma once
20
21#include "charttoolsdllapi.hxx"
22#include <unotools/weakref.hxx>
23#include <com/sun/star/uno/Reference.h>
24#include <com/sun/star/uno/Sequence.h>
25
26#include <utility>
27#include <vector>
28
29namespace chart { class ChartModel; }
30namespace com::sun::star::chart2 { class XCoordinateSystem; }
31namespace com::sun::star::chart2::data { class XDataSequence; }
32namespace com::sun::star::chart2::data { class XLabeledDataSequence; }
33namespace com::sun::star::uno { class Any; }
34
35namespace chart
36{
37class BaseCoordinateSystem;
38class LabeledDataSequence;
39
41{
42 OUString Text;
43 sal_Int32 Count;
44
45 ComplexCategory( OUString aText, sal_Int32 nCount ) : Text(std::move( aText )), Count (nCount)
46 {}
47};
48
50{
51public:
53
54 virtual sal_Int32 getLevelCount() const = 0;
55 virtual css::uno::Sequence< OUString > getStringsForLevel( sal_Int32 nIndex ) const = 0;
56};
57
59{
60public:
62 , ChartModel& rChartModel
63 );
65
66 void init();
67
68 css::uno::Reference< css::chart2::data::XDataSequence > getOriginalCategories();
69
70 css::uno::Sequence< OUString > const & getSimpleCategories();
71 const std::vector<ComplexCategory>* getCategoriesByLevel( sal_Int32 nLevel );
72
73 static OUString getCategoryByIndex(
75 , ChartModel& rModel
76 , sal_Int32 nIndex );
77
78 static css::uno::Sequence< OUString > getExplicitSimpleCategories(
79 const SplitCategoriesProvider& rSplitCategoriesProvider );
80
81 static void convertCategoryAnysToText( css::uno::Sequence< OUString >& rOutTexts
82 , const css::uno::Sequence< css::uno::Any >& rInAnys
83 , ChartModel& rModel );
84
85 bool hasComplexCategories() const;
86 sal_Int32 getCategoryLevelCount() const;
87
88 const std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence> >&
89 getSplitCategoriesList() const { return m_aSplitCategoriesList;}
90
91 bool isDateAxis();
92 const std::vector< double >& getDateCategories();
93
94private:
97
98 bool volatile m_bDirty;
100 ChartModel& mrModel;
101 css::uno::Reference< css::chart2::data::XLabeledDataSequence> m_xOriginalCategories;
102
104 css::uno::Sequence< OUString > m_aExplicitCategories;
105 std::vector< std::vector< ComplexCategory > > m_aComplexCats;
106 std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence> > m_aSplitCategoriesList;
107
110 std::vector< double > m_aDateCategories;
111};
112
113} // namespace chart
114
115/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
FILE * init(int, char **)
#define OOO_DLLPUBLIC_CHARTTOOLS
css::uno::Sequence< OUString > m_aExplicitCategories
ExplicitCategoriesProvider(const rtl::Reference< ::chart::BaseCoordinateSystem > &xCooSysModel, ChartModel &rChartModel)
const std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & getSplitCategoriesList() const
unotools::WeakReference< ::chart::BaseCoordinateSystem > m_xCooSysModel
std::vector< std::vector< ComplexCategory > > m_aComplexCats
ExplicitCategoriesProvider(ExplicitCategoriesProvider const &)=delete
std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > m_aSplitCategoriesList
css::uno::Reference< css::chart2::data::XLabeledDataSequence > m_xOriginalCategories
virtual css::uno::Sequence< OUString > getStringsForLevel(sal_Int32 nIndex) const =0
virtual sal_Int32 getLevelCount() const =0
int nCount
ComplexCategory(OUString aText, sal_Int32 nCount)
Count