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 CHART_DATAINTERPRETER_HXX
28 #define CHART_DATAINTERPRETER_HXX
30 #include "ServiceMacros.hxx"
31 #include <cppuhelper/implbase2.hxx>
32 #include <com/sun/star/chart2/XDataInterpreter.hpp>
33 #include <com/sun/star/lang/XServiceInfo.hpp>
34 #include <com/sun/star/uno/XComponentContext.hpp>
39 class DataInterpreter
: public ::cppu::WeakImplHelper2
<
40 ::com::sun::star::chart2::XDataInterpreter
,
41 ::com::sun::star::lang::XServiceInfo
>
44 explicit DataInterpreter( const ::com::sun::star::uno::Reference
<
45 ::com::sun::star::uno::XComponentContext
> & xContext
);
46 virtual ~DataInterpreter();
48 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>
49 GetComponentContext() const;
51 /// XServiceInfo declarations
52 APPHELPER_XSERVICEINFO_DECL()
54 // convenience methods
55 static ::rtl::OUString
GetRole(
56 const ::com::sun::star::uno::Reference
<
57 ::com::sun::star::chart2::data::XDataSequence
> & xSeq
);
60 const ::com::sun::star::uno::Reference
<
61 ::com::sun::star::chart2::data::XDataSequence
> & xSeq
,
62 const ::rtl::OUString
& rRole
);
64 static ::com::sun::star::uno::Any
GetProperty(
65 const ::com::sun::star::uno::Sequence
<
66 ::com::sun::star::beans::PropertyValue
> & aArguments
,
67 const ::rtl::OUString
& rName
);
69 static bool HasCategories(
70 const ::com::sun::star::uno::Sequence
<
71 ::com::sun::star::beans::PropertyValue
> & rArguments
,
72 const ::com::sun::star::uno::Sequence
<
73 ::com::sun::star::uno::Reference
<
74 ::com::sun::star::chart2::data::XLabeledDataSequence
> > & rData
);
77 // ____ XDataInterpreter ____
78 virtual ::com::sun::star::chart2::InterpretedData SAL_CALL
interpretDataSource(
79 const ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSource
>& xSource
,
80 const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyValue
>& aArguments
,
81 const ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::XDataSeries
> >& aSeriesToReUse
)
82 throw (::com::sun::star::uno::RuntimeException
);
83 virtual ::com::sun::star::chart2::InterpretedData SAL_CALL
reinterpretDataSeries(
84 const ::com::sun::star::chart2::InterpretedData
& aInterpretedData
)
85 throw (::com::sun::star::uno::RuntimeException
);
86 virtual sal_Bool SAL_CALL
isDataCompatible(
87 const ::com::sun::star::chart2::InterpretedData
& aInterpretedData
)
88 throw (::com::sun::star::uno::RuntimeException
);
89 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::chart2::data::XDataSource
> SAL_CALL
mergeInterpretedData(
90 const ::com::sun::star::chart2::InterpretedData
& aInterpretedData
)
91 throw (::com::sun::star::uno::RuntimeException
);
93 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>
99 // CHART_DATAINTERPRETER_HXX