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 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_chart2.hxx"
26 
27 #include "DataSource.hxx"
28 #include "LabeledDataSequence.hxx"
29 
30 using ::rtl::OUString;
31 using ::osl::MutexGuard;
32 using ::com::sun::star::uno::Sequence;
33 using ::com::sun::star::uno::Reference;
34 using ::com::sun::star::uno::RuntimeException;
35 using ::com::sun::star::uno::Any;
36 
37 using namespace ::com::sun::star;
38 
39 namespace
40 {
41 static const ::rtl::OUString lcl_aServiceName(
42     RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.comp.chart.DataSource" ));
43 }  // anonymous namespace
44 
45 namespace chart
46 {
47 
DataSource(const Reference<uno::XComponentContext> &)48 DataSource::DataSource(
49     const Reference< uno::XComponentContext > & /*xContext*/ )
50 {}
51 
DataSource(const Sequence<Reference<chart2::data::XLabeledDataSequence>> & rSequences)52 DataSource::DataSource(
53     const Sequence< Reference< chart2::data::XLabeledDataSequence > > & rSequences ) :
54         m_aDataSeq( rSequences )
55 {}
56 
~DataSource()57 DataSource::~DataSource()
58 {}
59 
60 // ____ XDataSource ____
getDataSequences()61 Sequence< Reference< chart2::data::XLabeledDataSequence > > SAL_CALL DataSource::getDataSequences()
62     throw (uno::RuntimeException)
63 {
64     return m_aDataSeq;
65 }
66 
67 // ____ XDataSink ____
setData(const Sequence<Reference<chart2::data::XLabeledDataSequence>> & aData)68 void SAL_CALL DataSource::setData( const Sequence< Reference< chart2::data::XLabeledDataSequence > >& aData )
69     throw (uno::RuntimeException)
70 {
71     m_aDataSeq = aData;
72 }
73 
74 // ================================================================================
75 
getSupportedServiceNames_Static()76 Sequence< OUString > DataSource::getSupportedServiceNames_Static()
77 {
78     Sequence< OUString > aServices( 1 );
79     aServices[ 0 ] = OUString( RTL_CONSTASCII_USTRINGPARAM( "com.sun.star.chart2.data.DataSource" ));
80     return aServices;
81 }
82 
83 // ================================================================================
84 
85 APPHELPER_XSERVICEINFO_IMPL( DataSource, lcl_aServiceName );
86 
87 } // namespace chart
88