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