xref: /trunk/main/chart2/source/inc/DataSource.hxx (revision de7b3f82)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 
23 #ifndef CHART2_DATASOURCE_HXX
24 #define CHART2_DATASOURCE_HXX
25 
26 #include <com/sun/star/lang/XServiceInfo.hpp>
27 #include <com/sun/star/chart2/data/XDataSource.hpp>
28 #include <com/sun/star/chart2/data/XDataSink.hpp>
29 #include <com/sun/star/uno/XComponentContext.hpp>
30 #include <cppuhelper/implbase3.hxx>
31 #include <comphelper/uno3.hxx>
32 #include "ServiceMacros.hxx"
33 
34 namespace chart
35 {
36 
37 class DataSource : public
38     ::cppu::WeakImplHelper3<
39         ::com::sun::star::lang::XServiceInfo,
40         ::com::sun::star::chart2::data::XDataSource,
41         ::com::sun::star::chart2::data::XDataSink >
42 {
43 public:
44     explicit DataSource(
45         const ::com::sun::star::uno::Reference<
46             ::com::sun::star::uno::XComponentContext > & xContext );
47 	explicit DataSource(
48         const ::com::sun::star::uno::Sequence<
49             ::com::sun::star::uno::Reference<
50                 ::com::sun::star::chart2::data::XLabeledDataSequence > > & rSequences );
51 
52 	virtual ~DataSource();
53 
54     /// establish methods for factory instatiation
55 	APPHELPER_SERVICE_FACTORY_HELPER( DataSource )
56     /// declare XServiceInfo methods
57     APPHELPER_XSERVICEINFO_DECL()
58 
59 protected:
60     // ____ XDataSource ____
61     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > > SAL_CALL
62         getDataSequences()
63         throw (::com::sun::star::uno::RuntimeException);
64 
65     // ____ XDataSink ____
66     virtual void SAL_CALL setData( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XLabeledDataSequence > >& aData )
67         throw (::com::sun::star::uno::RuntimeException);
68 
69 private:
70     ::com::sun::star::uno::Sequence<
71         ::com::sun::star::uno::Reference<
72             ::com::sun::star::chart2::data::XLabeledDataSequence > >
73         m_aDataSeq;
74 };
75 
76 } //  namespace chart
77 
78 // CHART2_DATASOURCE_HXX
79 #endif
80