Line data Source code
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 : #ifndef INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_DATAINTERPRETER_HXX
20 : #define INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_DATAINTERPRETER_HXX
21 :
22 : #include "ServiceMacros.hxx"
23 : #include <cppuhelper/implbase2.hxx>
24 : #include <com/sun/star/chart2/XDataInterpreter.hpp>
25 : #include <com/sun/star/lang/XServiceInfo.hpp>
26 : #include <com/sun/star/uno/XComponentContext.hpp>
27 :
28 : namespace chart
29 : {
30 :
31 : class DataInterpreter : public ::cppu::WeakImplHelper2<
32 : ::com::sun::star::chart2::XDataInterpreter,
33 : ::com::sun::star::lang::XServiceInfo >
34 : {
35 : public:
36 : explicit DataInterpreter( const ::com::sun::star::uno::Reference<
37 : ::com::sun::star::uno::XComponentContext > & xContext );
38 : virtual ~DataInterpreter();
39 :
40 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
41 274 : GetComponentContext() const { return m_xContext;}
42 :
43 : /// XServiceInfo declarations
44 : APPHELPER_XSERVICEINFO_DECL()
45 :
46 : // convenience methods
47 : static OUString GetRole(
48 : const ::com::sun::star::uno::Reference<
49 : ::com::sun::star::chart2::data::XDataSequence > & xSeq );
50 :
51 : static void SetRole(
52 : const ::com::sun::star::uno::Reference<
53 : ::com::sun::star::chart2::data::XDataSequence > & xSeq,
54 : const OUString & rRole );
55 :
56 : static ::com::sun::star::uno::Any GetProperty(
57 : const ::com::sun::star::uno::Sequence<
58 : ::com::sun::star::beans::PropertyValue > & aArguments,
59 : const OUString & rName );
60 :
61 : static bool HasCategories(
62 : const ::com::sun::star::uno::Sequence<
63 : ::com::sun::star::beans::PropertyValue > & rArguments,
64 : const ::com::sun::star::uno::Sequence<
65 : ::com::sun::star::uno::Reference<
66 : ::com::sun::star::chart2::data::XLabeledDataSequence > > & rData );
67 :
68 : static bool UseCategoriesAsX(
69 : const ::com::sun::star::uno::Sequence<
70 : ::com::sun::star::beans::PropertyValue > & rArguments );
71 :
72 : protected:
73 : // ____ XDataInterpreter ____
74 : virtual ::com::sun::star::chart2::InterpretedData SAL_CALL interpretDataSource(
75 : const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource >& xSource,
76 : const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& aArguments,
77 : const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::XDataSeries > >& aSeriesToReUse )
78 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
79 : virtual ::com::sun::star::chart2::InterpretedData SAL_CALL reinterpretDataSeries(
80 : const ::com::sun::star::chart2::InterpretedData& aInterpretedData )
81 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
82 : virtual sal_Bool SAL_CALL isDataCompatible(
83 : const ::com::sun::star::chart2::InterpretedData& aInterpretedData )
84 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
85 : virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSource > SAL_CALL mergeInterpretedData(
86 : const ::com::sun::star::chart2::InterpretedData& aInterpretedData )
87 : throw (::com::sun::star::uno::RuntimeException, std::exception) SAL_OVERRIDE;
88 :
89 : ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >
90 : m_xContext;
91 : };
92 :
93 : } // namespace chart
94 :
95 : // INCLUDED_CHART2_SOURCE_MODEL_TEMPLATE_DATAINTERPRETER_HXX
96 : #endif
97 :
98 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|