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