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 instatiation 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 throw(::com::sun::star::beans::UnknownPropertyException); 78 79 // ____ OPropertySet ____ 80 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); 81 82 // ____ XPropertySet ____ 83 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 84 getPropertySetInfo() 85 throw (::com::sun::star::uno::RuntimeException); 86 87 // virtual sal_Bool SAL_CALL convertFastPropertyValue 88 // ( ::com::sun::star::uno::Any & rConvertedValue, 89 // ::com::sun::star::uno::Any & rOldValue, 90 // sal_Int32 nHandle, 91 // const ::com::sun::star::uno::Any& rValue ) 92 // throw (::com::sun::star::lang::IllegalArgumentException); 93 94 // ____ XTitle ____ 95 virtual ::com::sun::star::uno::Sequence< 96 ::com::sun::star::uno::Reference< 97 ::com::sun::star::chart2::XFormattedString > > SAL_CALL getText() 98 throw (::com::sun::star::uno::RuntimeException); 99 virtual void SAL_CALL setText( const ::com::sun::star::uno::Sequence< 100 ::com::sun::star::uno::Reference< 101 ::com::sun::star::chart2::XFormattedString > >& Strings ) 102 throw (::com::sun::star::uno::RuntimeException); 103 104 // ____ XCloneable ____ 105 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() 106 throw (::com::sun::star::uno::RuntimeException); 107 108 // ____ XModifyBroadcaster ____ 109 virtual void SAL_CALL addModifyListener( 110 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 111 throw (::com::sun::star::uno::RuntimeException); 112 virtual void SAL_CALL removeModifyListener( 113 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 114 throw (::com::sun::star::uno::RuntimeException); 115 116 // ____ XModifyListener ____ 117 virtual void SAL_CALL modified( 118 const ::com::sun::star::lang::EventObject& aEvent ) 119 throw (::com::sun::star::uno::RuntimeException); 120 121 // ____ XEventListener (base of XModifyListener) ____ 122 virtual void SAL_CALL disposing( 123 const ::com::sun::star::lang::EventObject& Source ) 124 throw (::com::sun::star::uno::RuntimeException); 125 126 // ____ OPropertySet ____ 127 virtual void firePropertyChangeEvent(); 128 using OPropertySet::disposing; 129 130 void fireModifyEvent(); 131 132 private: 133 ::com::sun::star::uno::Sequence< 134 ::com::sun::star::uno::Reference< 135 ::com::sun::star::chart2::XFormattedString > > m_aStrings; 136 137 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 138 }; 139 140 } // namespace chart 141 142 // CHART_TITLE_HXX 143 #endif 144