LibreOffice Module chart2 (master) 1
DataInterpreter.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 "DataSeries.hxx"
23#include <com/sun/star/lang/XServiceInfo.hpp>
24#include <com/sun/star/beans/PropertyValue.hpp>
25#include <com/sun/star/chart2/data/XDataSource.hpp>
26#include <rtl/ref.hxx>
27#include <vector>
28
29namespace chart
30{
31class DataSeries;
32class DataSource;
33class LabeledDataSequence;
34
39{
40 std::vector< std::vector< rtl::Reference<::chart::DataSeries> > > Series;
41 css::uno::Reference< css::chart2::data::XLabeledDataSequence > Categories;
42};
43
47class SAL_DLLPUBLIC_RTTI DataInterpreter : public ::cppu::WeakImplHelper<
48 css::lang::XServiceInfo >
49{
50public:
51 explicit DataInterpreter();
52 virtual ~DataInterpreter() override;
53
55 virtual OUString SAL_CALL getImplementationName() override;
56 virtual sal_Bool SAL_CALL supportsService( const OUString& ServiceName ) override;
57 virtual css::uno::Sequence< OUString > SAL_CALL getSupportedServiceNames() override;
58
59 // convenience methods
60 static OUString GetRole( const css::uno::Reference< css::chart2::data::XDataSequence > & xSeq );
61
62 static void SetRole(
63 const css::uno::Reference< css::chart2::data::XDataSequence > & xSeq,
64 const OUString & rRole );
65
66 static css::uno::Any GetProperty(
67 const css::uno::Sequence<css::beans::PropertyValue > & aArguments,
68 std::u16string_view rName );
69
70 static bool HasCategories(
71 const css::uno::Sequence< css::beans::PropertyValue > & rArguments,
72 const std::vector< css::uno::Reference< css::chart2::data::XLabeledDataSequence > > & rData );
73
74 static bool UseCategoriesAsX(
75 const css::uno::Sequence< css::beans::PropertyValue > & rArguments );
76
77 static std::vector<css::uno::Reference< css::chart2::data::XLabeledDataSequence >> getDataSequences(
78 const css::uno::Reference< css::chart2::data::XDataSource >& xSource);
79
80 // ____ DataInterpreter ____
99 virtual InterpretedData interpretDataSource(
100 const css::uno::Reference< css::chart2::data::XDataSource >& xSource,
101 const css::uno::Sequence< css::beans::PropertyValue >& aArguments,
102 const std::vector< rtl::Reference< ::chart::DataSeries > >& aSeriesToReUse );
103
107 virtual InterpretedData reinterpretDataSeries(
108 const InterpretedData& aInterpretedData );
109
119 virtual bool isDataCompatible(
120 const InterpretedData& aInterpretedData );
121
129 static rtl::Reference< ::chart::DataSource > mergeInterpretedData(
130 const InterpretedData& aInterpretedData );
131
148 virtual css::uno::Any getChartTypeSpecificData(
149 const OUString& sKey );
150};
151
152} // namespace chart
153
154/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
offers tooling to interpret different data sources in a structural and chart-type-dependent way.
Sequence< PropertyValue > aArguments
css::uno::Sequence< OUString > getSupportedServiceNames()
OUString getImplementationName()
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
UNOTOOLS_DLLPUBLIC css::uno::Any GetProperty(OUString const &url, OUString const &property)
offers tooling to interpret different data sources in a structural and chart-type-dependent way.
std::vector< std::vector< rtl::Reference<::chart::DataSeries > > > Series
css::uno::Reference< css::chart2::data::XLabeledDataSequence > Categories
unsigned char sal_Bool