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_REGRESSIONEQUATION_HXX 24 #define CHART2_REGRESSIONEQUATION_HXX 25 26 #include <com/sun/star/uno/XComponentContext.hpp> 27 #include <com/sun/star/util/XCloneable.hpp> 28 #include <com/sun/star/util/XModifyBroadcaster.hpp> 29 #include <com/sun/star/util/XModifyListener.hpp> 30 #include <com/sun/star/chart2/XTitle.hpp> 31 32 #include "MutexContainer.hxx" 33 #include "OPropertySet.hxx" 34 #include "ServiceMacros.hxx" 35 #include "ModifyListenerHelper.hxx" 36 37 #include <cppuhelper/implbase4.hxx> 38 #include <comphelper/uno3.hxx> 39 40 namespace chart 41 { 42 43 namespace impl 44 { 45 typedef ::cppu::WeakImplHelper4< 46 ::com::sun::star::util::XCloneable, 47 ::com::sun::star::util::XModifyBroadcaster, 48 ::com::sun::star::util::XModifyListener, 49 ::com::sun::star::chart2::XTitle > 50 RegressionEquation_Base; 51 } 52 53 class RegressionEquation : 54 public MutexContainer, 55 public impl::RegressionEquation_Base, 56 public ::property::OPropertySet 57 { 58 public: 59 explicit RegressionEquation( 60 const ::com::sun::star::uno::Reference< 61 ::com::sun::star::uno::XComponentContext > & xContext ); 62 virtual ~RegressionEquation(); 63 64 /// XServiceInfo declarations 65 APPHELPER_XSERVICEINFO_DECL() 66 /// merge XInterface implementations 67 DECLARE_XINTERFACE() 68 /// establish methods for factory instantiation 69 APPHELPER_SERVICE_FACTORY_HELPER( RegressionEquation ) 70 71 protected: 72 explicit RegressionEquation( const RegressionEquation & rOther ); 73 74 // ____ OPropertySet ____ 75 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const; 76 77 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); 78 79 // ____ XPropertySet ____ 80 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 81 getPropertySetInfo(); 82 83 84 // ____ XCloneable ____ 85 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone(); 86 87 // ____ XModifyBroadcaster ____ 88 virtual void SAL_CALL addModifyListener( 89 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ); 90 virtual void SAL_CALL removeModifyListener( 91 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ); 92 93 // ____ XModifyListener ____ 94 virtual void SAL_CALL modified( 95 const ::com::sun::star::lang::EventObject& aEvent ); 96 97 // ____ XEventListener (base of XModifyListener) ____ 98 virtual void SAL_CALL disposing( 99 const ::com::sun::star::lang::EventObject& Source ); 100 101 // ____ XTitle ____ 102 virtual ::com::sun::star::uno::Sequence< 103 ::com::sun::star::uno::Reference< 104 ::com::sun::star::chart2::XFormattedString > > SAL_CALL getText(); 105 virtual void SAL_CALL setText( const ::com::sun::star::uno::Sequence< 106 ::com::sun::star::uno::Reference< 107 ::com::sun::star::chart2::XFormattedString > >& Strings ); 108 109 using ::cppu::OPropertySetHelper::disposing; 110 111 // ____ OPropertySet ____ 112 virtual void firePropertyChangeEvent(); 113 114 void fireModifyEvent(); 115 116 private: 117 ::com::sun::star::uno::Sequence< 118 ::com::sun::star::uno::Reference< 119 ::com::sun::star::chart2::XFormattedString > > m_aStrings; 120 121 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 122 ::com::sun::star::uno::Reference< 123 ::com::sun::star::uno::XComponentContext > 124 m_xContext; 125 }; 126 127 } // namespace chart 128 129 // CHART2_REGRESSIONEQUATION_HXX 130 #endif 131