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_UPDOWNBARWRAPPER_HXX 28 #define CHART_UPDOWNBARWRAPPER_HXX 29 30 #include "ServiceMacros.hxx" 31 #include "MutexContainer.hxx" 32 #include <cppuhelper/interfacecontainer.hxx> 33 34 35 #include <com/sun/star/chart2/XDiagram.hpp> 36 37 // header for class OPropertyArrayHelper 38 #include <cppuhelper/propshlp.hxx> 39 #include <cppuhelper/implbase6.hxx> 40 #include <com/sun/star/beans/XMultiPropertySet.hpp> 41 #include <com/sun/star/beans/XMultiPropertyStates.hpp> 42 #include <com/sun/star/beans/XPropertyState.hpp> 43 #include <com/sun/star/lang/XComponent.hpp> 44 #include <com/sun/star/lang/XServiceInfo.hpp> 45 #include <com/sun/star/uno/XComponentContext.hpp> 46 47 #include <boost/shared_ptr.hpp> 48 49 namespace chart 50 { 51 52 namespace wrapper 53 { 54 55 class Chart2ModelContact; 56 57 class UpDownBarWrapper : public MutexContainer 58 , public ::cppu::WeakImplHelper6 59 < ::com::sun::star::lang::XComponent 60 , ::com::sun::star::lang::XServiceInfo 61 , ::com::sun::star::beans::XPropertySet 62 , ::com::sun::star::beans::XMultiPropertySet 63 , ::com::sun::star::beans::XPropertyState 64 , ::com::sun::star::beans::XMultiPropertyStates 65 // , ::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface) 66 // , ::com::sun::star::uno::XInterface // implemented by WeakImplHelper 67 // , ::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper 68 > 69 { 70 public: 71 UpDownBarWrapper( bool bUp, ::boost::shared_ptr< Chart2ModelContact > spChart2ModelContact ); 72 virtual ~UpDownBarWrapper(); 73 74 /// XServiceInfo declarations 75 APPHELPER_XSERVICEINFO_DECL() 76 77 // ____ XComponent ____ 78 virtual void SAL_CALL dispose() 79 throw (::com::sun::star::uno::RuntimeException); 80 virtual void SAL_CALL addEventListener( const ::com::sun::star::uno::Reference< 81 ::com::sun::star::lang::XEventListener >& xListener ) 82 throw (::com::sun::star::uno::RuntimeException); 83 virtual void SAL_CALL removeEventListener( const ::com::sun::star::uno::Reference< 84 ::com::sun::star::lang::XEventListener >& aListener ) 85 throw (::com::sun::star::uno::RuntimeException); 86 87 //XPropertySet 88 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException); 89 90 virtual void SAL_CALL setPropertyValue( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Any& aValue ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 91 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyValue( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 92 93 virtual void SAL_CALL addPropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& xListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 94 virtual void SAL_CALL removePropertyChangeListener( const ::rtl::OUString& aPropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 95 virtual void SAL_CALL addVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 96 virtual void SAL_CALL removeVetoableChangeListener( const ::rtl::OUString& PropertyName, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XVetoableChangeListener >& aListener ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 97 98 //XMultiPropertySet 99 //getPropertySetInfo() already declared in XPropertySet 100 virtual void SAL_CALL setPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aValues ) throw (::com::sun::star::beans::PropertyVetoException, ::com::sun::star::lang::IllegalArgumentException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 101 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyValues( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::uno::RuntimeException); 102 virtual void SAL_CALL addPropertiesChangeListener( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 103 virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 104 virtual void SAL_CALL firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 105 106 //XPropertyState 107 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 108 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyState > SAL_CALL getPropertyStates( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 109 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 110 virtual ::com::sun::star::uno::Any SAL_CALL getPropertyDefault( const ::rtl::OUString& aPropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 111 112 //XMultiPropertyStates 113 //getPropertyStates() already declared in XPropertyState 114 virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); 115 virtual void SAL_CALL setPropertiesToDefault( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 116 virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any > SAL_CALL getPropertyDefaults( const ::com::sun::star::uno::Sequence< ::rtl::OUString >& aPropertyNames ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::lang::WrappedTargetException, ::com::sun::star::uno::RuntimeException); 117 118 private: //methods 119 ::cppu::IPropertyArrayHelper& getInfoHelper(); 120 121 private: //member 122 ::boost::shared_ptr< Chart2ModelContact > m_spChart2ModelContact; 123 ::cppu::OInterfaceContainerHelper m_aEventListenerContainer; 124 125 rtl::OUString m_aPropertySetName; 126 }; 127 128 } // namespace wrapper 129 } // namespace chart 130 131 // CHART_UPDOWNBARWRAPPER_HXX 132 #endif 133