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