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_LABELEDDATASEQUENCE_HXX 24 #define CHART2_LABELEDDATASEQUENCE_HXX 25 #include "ServiceMacros.hxx" 26 #include "MutexContainer.hxx" 27 #include <comphelper/uno3.hxx> 28 #include <cppuhelper/implbase4.hxx> 29 30 #ifndef _COM_SUN_STAR_CHART2_XLABELEDDATASEQUENCE_HPP_ 31 #include <com/sun/star/chart2/data/XLabeledDataSequence.hpp> 32 #endif 33 #include <com/sun/star/lang/XServiceInfo.hpp> 34 #include <com/sun/star/util/XCloneable.hpp> 35 #include <com/sun/star/uno/XComponentContext.hpp> 36 #include <com/sun/star/util/XModifyBroadcaster.hpp> 37 38 namespace chart 39 { 40 41 namespace impl 42 { 43 typedef cppu::WeakImplHelper4< 44 ::com::sun::star::chart2::data::XLabeledDataSequence, 45 ::com::sun::star::util::XCloneable, 46 ::com::sun::star::util::XModifyBroadcaster, 47 ::com::sun::star::lang::XServiceInfo > 48 LabeledDataSequence_Base; 49 } 50 51 class LabeledDataSequence : 52 public MutexContainer, 53 public impl::LabeledDataSequence_Base 54 { 55 public: 56 explicit LabeledDataSequence( 57 const ::com::sun::star::uno::Reference< 58 ::com::sun::star::uno::XComponentContext > & xContext ); 59 explicit LabeledDataSequence( 60 const ::com::sun::star::uno::Reference< 61 ::com::sun::star::chart2::data::XDataSequence > & rValues ); 62 explicit LabeledDataSequence( 63 const ::com::sun::star::uno::Reference< 64 ::com::sun::star::chart2::data::XDataSequence > & rValues, 65 const ::com::sun::star::uno::Reference< 66 ::com::sun::star::chart2::data::XDataSequence > & rLabels ); 67 68 virtual ~LabeledDataSequence(); 69 70 /// establish methods for factory instatiation 71 APPHELPER_SERVICE_FACTORY_HELPER( LabeledDataSequence ) 72 /// declare XServiceInfo methods 73 APPHELPER_XSERVICEINFO_DECL() 74 75 protected: 76 // ____ XLabeledDataSequence ____ 77 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > SAL_CALL getValues() 78 throw (::com::sun::star::uno::RuntimeException); 79 virtual void SAL_CALL setValues( 80 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xSequence ) 81 throw (::com::sun::star::uno::RuntimeException); 82 virtual ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > SAL_CALL getLabel() 83 throw (::com::sun::star::uno::RuntimeException); 84 virtual void SAL_CALL setLabel( 85 const ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence >& xSequence ) 86 throw (::com::sun::star::uno::RuntimeException); 87 88 // ____ XCloneable ____ 89 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() 90 throw (::com::sun::star::uno::RuntimeException); 91 92 // ____ XModifyBroadcaster ____ 93 virtual void SAL_CALL addModifyListener( 94 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 95 throw (::com::sun::star::uno::RuntimeException); 96 virtual void SAL_CALL removeModifyListener( 97 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 98 throw (::com::sun::star::uno::RuntimeException); 99 100 private: 101 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > m_xData; 102 ::com::sun::star::uno::Reference< ::com::sun::star::chart2::data::XDataSequence > m_xLabel; 103 104 ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext > m_xContext; 105 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 106 }; 107 108 } // namespace chart 109 110 // CHART2_LABELEDDATASEQUENCE_HXX 111 #endif 112