1 /************************************************************************* 2 * 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * Copyright 2000, 2010 Oracle and/or its affiliates. 6 * 7 * OpenOffice.org - a multi-platform office productivity suite 8 * 9 * This file is part of OpenOffice.org. 10 * 11 * OpenOffice.org is free software: you can redistribute it and/or modify 12 * it under the terms of the GNU Lesser General Public License version 3 13 * only, as published by the Free Software Foundation. 14 * 15 * OpenOffice.org is distributed in the hope that it will be useful, 16 * but WITHOUT ANY WARRANTY; without even the implied warranty of 17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18 * GNU Lesser General Public License version 3 for more details 19 * (a copy is included in the LICENSE file that accompanied this code). 20 * 21 * You should have received a copy of the GNU Lesser General Public License 22 * version 3 along with OpenOffice.org. If not, see 23 * <http://www.openoffice.org/license.html> 24 * for a copy of the LGPLv3 License. 25 * 26 ************************************************************************/ 27 #ifndef CHART_TITLE_HXX 28 #define CHART_TITLE_HXX 29 30 #include "ServiceMacros.hxx" 31 #include "ModifyListenerHelper.hxx" 32 #include "OPropertySet.hxx" 33 #include "MutexContainer.hxx" 34 #include <cppuhelper/implbase5.hxx> 35 #include <comphelper/uno3.hxx> 36 #include <com/sun/star/chart2/XTitle.hpp> 37 #include <com/sun/star/lang/XServiceInfo.hpp> 38 #include <com/sun/star/uno/XComponentContext.hpp> 39 #include <com/sun/star/util/XCloneable.hpp> 40 41 namespace chart 42 { 43 44 namespace impl 45 { 46 typedef ::cppu::WeakImplHelper5< 47 ::com::sun::star::chart2::XTitle, 48 ::com::sun::star::lang::XServiceInfo, 49 ::com::sun::star::util::XCloneable, 50 ::com::sun::star::util::XModifyBroadcaster, 51 ::com::sun::star::util::XModifyListener > 52 Title_Base; 53 } 54 55 class Title : 56 public MutexContainer, 57 public impl::Title_Base, 58 public ::property::OPropertySet 59 { 60 public: 61 Title( ::com::sun::star::uno::Reference< 62 ::com::sun::star::uno::XComponentContext > const & xContext ); 63 virtual ~Title(); 64 65 /// establish methods for factory instatiation 66 APPHELPER_SERVICE_FACTORY_HELPER( Title ) 67 68 /// XServiceInfo declarations 69 APPHELPER_XSERVICEINFO_DECL() 70 71 /// merge XInterface implementations 72 DECLARE_XINTERFACE() 73 /// merge XTypeProvider implementations 74 DECLARE_XTYPEPROVIDER() 75 76 protected: 77 explicit Title( const Title & rOther ); 78 79 // ____ OPropertySet ____ 80 virtual ::com::sun::star::uno::Any GetDefaultValue( sal_Int32 nHandle ) const 81 throw(::com::sun::star::beans::UnknownPropertyException); 82 83 // ____ OPropertySet ____ 84 virtual ::cppu::IPropertyArrayHelper & SAL_CALL getInfoHelper(); 85 86 // ____ XPropertySet ____ 87 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL 88 getPropertySetInfo() 89 throw (::com::sun::star::uno::RuntimeException); 90 91 // virtual sal_Bool SAL_CALL convertFastPropertyValue 92 // ( ::com::sun::star::uno::Any & rConvertedValue, 93 // ::com::sun::star::uno::Any & rOldValue, 94 // sal_Int32 nHandle, 95 // const ::com::sun::star::uno::Any& rValue ) 96 // throw (::com::sun::star::lang::IllegalArgumentException); 97 98 // ____ XTitle ____ 99 virtual ::com::sun::star::uno::Sequence< 100 ::com::sun::star::uno::Reference< 101 ::com::sun::star::chart2::XFormattedString > > SAL_CALL getText() 102 throw (::com::sun::star::uno::RuntimeException); 103 virtual void SAL_CALL setText( const ::com::sun::star::uno::Sequence< 104 ::com::sun::star::uno::Reference< 105 ::com::sun::star::chart2::XFormattedString > >& Strings ) 106 throw (::com::sun::star::uno::RuntimeException); 107 108 // ____ XCloneable ____ 109 virtual ::com::sun::star::uno::Reference< ::com::sun::star::util::XCloneable > SAL_CALL createClone() 110 throw (::com::sun::star::uno::RuntimeException); 111 112 // ____ XModifyBroadcaster ____ 113 virtual void SAL_CALL addModifyListener( 114 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 115 throw (::com::sun::star::uno::RuntimeException); 116 virtual void SAL_CALL removeModifyListener( 117 const ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener >& aListener ) 118 throw (::com::sun::star::uno::RuntimeException); 119 120 // ____ XModifyListener ____ 121 virtual void SAL_CALL modified( 122 const ::com::sun::star::lang::EventObject& aEvent ) 123 throw (::com::sun::star::uno::RuntimeException); 124 125 // ____ XEventListener (base of XModifyListener) ____ 126 virtual void SAL_CALL disposing( 127 const ::com::sun::star::lang::EventObject& Source ) 128 throw (::com::sun::star::uno::RuntimeException); 129 130 // ____ OPropertySet ____ 131 virtual void firePropertyChangeEvent(); 132 using OPropertySet::disposing; 133 134 void fireModifyEvent(); 135 136 private: 137 ::com::sun::star::uno::Sequence< 138 ::com::sun::star::uno::Reference< 139 ::com::sun::star::chart2::XFormattedString > > m_aStrings; 140 141 ::com::sun::star::uno::Reference< ::com::sun::star::util::XModifyListener > m_xModifyEventForwarder; 142 }; 143 144 } // namespace chart 145 146 // CHART_TITLE_HXX 147 #endif 148