1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: DataInterpreter.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART_DATAINTERPRETER_HXX
31 #define CHART_DATAINTERPRETER_HXX
33 #include "ServiceMacros.hxx"
34 #include <cppuhelper/implbase2.hxx>
35 #include <com/sun/star/chart2/XDataInterpreter.hpp>
36 #include <com/sun/star/lang/XServiceInfo.hpp>
37 #include <com/sun/star/uno/XComponentContext.hpp>
42 class DataInterpreter
: public ::cppu::WeakImplHelper2
<
43 ::com::sun::star::chart2::XDataInterpreter
,
44 ::com::sun::star::lang::XServiceInfo
>
47 explicit DataInterpreter( const ::com::sun::star::uno::Reference
<
48 ::com::sun::star::uno::XComponentContext
> & xContext
);
49 virtual ~DataInterpreter();
51 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>
52 GetComponentContext() const;
54 /// XServiceInfo declarations
55 APPHELPER_XSERVICEINFO_DECL()
57 // convenience methods
58 static ::rtl::OUString
GetRole(
59 const ::com::sun::star::uno::Reference
<
60 ::com::sun::star::chart2::data::XDataSequence
> & xSeq
);
63 const ::com::sun::star::uno::Reference
<
64 ::com::sun::star::chart2::data::XDataSequence
> & xSeq
,
65 const ::rtl::OUString
& rRole
);
67 static ::com::sun::star::uno::Any
GetProperty(
68 const ::com::sun::star::uno::Sequence
<
69 ::com::sun::star::beans::PropertyValue
> & aArguments
,
70 const ::rtl::OUString
& rName
);
72 static bool HasCategories(
73 const ::com::sun::star::uno::Sequence
<
74 ::com::sun::star::beans::PropertyValue
> & rArguments
,
75 const ::com::sun::star::uno::Sequence
<
76 ::com::sun::star::uno::Reference
<
77 ::com::sun::star::chart2::data::XLabeledDataSequence
> > & rData
);
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
);
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
);
89 virtual sal_Bool SAL_CALL
isDataCompatible(
90 const ::com::sun::star::chart2::InterpretedData
& aInterpretedData
)
91 throw (::com::sun::star::uno::RuntimeException
);
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
);
96 ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>
102 // CHART_DATAINTERPRETER_HXX