1*de7b3f82SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 3*de7b3f82SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 4*de7b3f82SAndrew Rist * or more contributor license agreements. See the NOTICE file 5*de7b3f82SAndrew Rist * distributed with this work for additional information 6*de7b3f82SAndrew Rist * regarding copyright ownership. The ASF licenses this file 7*de7b3f82SAndrew Rist * to you under the Apache License, Version 2.0 (the 8*de7b3f82SAndrew Rist * "License"); you may not use this file except in compliance 9*de7b3f82SAndrew Rist * with the License. You may obtain a copy of the License at 10*de7b3f82SAndrew Rist * 11*de7b3f82SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12*de7b3f82SAndrew Rist * 13*de7b3f82SAndrew Rist * Unless required by applicable law or agreed to in writing, 14*de7b3f82SAndrew Rist * software distributed under the License is distributed on an 15*de7b3f82SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 16*de7b3f82SAndrew Rist * KIND, either express or implied. See the License for the 17*de7b3f82SAndrew Rist * specific language governing permissions and limitations 18*de7b3f82SAndrew Rist * under the License. 19*de7b3f82SAndrew Rist * 20*de7b3f82SAndrew Rist *************************************************************/ 21*de7b3f82SAndrew Rist 22*de7b3f82SAndrew Rist 23cdf0e10cSrcweir #ifndef CHART_WRAPPEDPROPERTYSET_HXX 24cdf0e10cSrcweir #define CHART_WRAPPEDPROPERTYSET_HXX 25cdf0e10cSrcweir 26cdf0e10cSrcweir #include "WrappedProperty.hxx" 27cdf0e10cSrcweir #include "MutexContainer.hxx" 28cdf0e10cSrcweir #include "charttoolsdllapi.hxx" 29cdf0e10cSrcweir #include <com/sun/star/beans/XMultiPropertySet.hpp> 30cdf0e10cSrcweir #include <com/sun/star/beans/XMultiPropertyStates.hpp> 31cdf0e10cSrcweir #include <com/sun/star/beans/XPropertySet.hpp> 32cdf0e10cSrcweir #include <com/sun/star/beans/XPropertyState.hpp> 33cdf0e10cSrcweir #include <com/sun/star/beans/Property.hpp> 34cdf0e10cSrcweir #include <cppuhelper/implbase4.hxx> 35cdf0e10cSrcweir 36cdf0e10cSrcweir // header for class OPropertyArrayHelper 37cdf0e10cSrcweir #include <cppuhelper/propshlp.hxx> 38cdf0e10cSrcweir 39cdf0e10cSrcweir // header for class OMultiTypeInterfaceContainerHelperInt32 40cdf0e10cSrcweir #include <cppuhelper/propshlp.hxx> 41cdf0e10cSrcweir 42cdf0e10cSrcweir #include <vector> 43cdf0e10cSrcweir 44cdf0e10cSrcweir //............................................................................. 45cdf0e10cSrcweir namespace chart 46cdf0e10cSrcweir { 47cdf0e10cSrcweir //............................................................................. 48cdf0e10cSrcweir 49cdf0e10cSrcweir class OOO_DLLPUBLIC_CHARTTOOLS WrappedPropertySet : 50cdf0e10cSrcweir public MutexContainer 51cdf0e10cSrcweir , public ::cppu::WeakImplHelper4 52cdf0e10cSrcweir < ::com::sun::star::beans::XPropertySet 53cdf0e10cSrcweir , ::com::sun::star::beans::XMultiPropertySet 54cdf0e10cSrcweir , ::com::sun::star::beans::XPropertyState 55cdf0e10cSrcweir , ::com::sun::star::beans::XMultiPropertyStates 56cdf0e10cSrcweir // ,::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface) 57cdf0e10cSrcweir // ,::com::sun::star::uno::XInterface // implemented by WeakImplHelper 58cdf0e10cSrcweir // ,::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper 59cdf0e10cSrcweir > 60cdf0e10cSrcweir { 61cdf0e10cSrcweir public: 62cdf0e10cSrcweir WrappedPropertySet(); 63cdf0e10cSrcweir virtual ~WrappedPropertySet(); 64cdf0e10cSrcweir 65cdf0e10cSrcweir void clearWrappedPropertySet(); 66cdf0e10cSrcweir 67cdf0e10cSrcweir public: 68cdf0e10cSrcweir //XPropertySet 69cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException); 70cdf0e10cSrcweir 71cdf0e10cSrcweir 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); 72cdf0e10cSrcweir 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); 73cdf0e10cSrcweir 74cdf0e10cSrcweir 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); 75cdf0e10cSrcweir 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); 76cdf0e10cSrcweir 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); 77cdf0e10cSrcweir 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); 78cdf0e10cSrcweir 79cdf0e10cSrcweir //XMultiPropertySet 80cdf0e10cSrcweir //getPropertySetInfo() already declared in XPropertySet 81cdf0e10cSrcweir 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); 82cdf0e10cSrcweir 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); 83cdf0e10cSrcweir 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); 84cdf0e10cSrcweir virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException); 85cdf0e10cSrcweir 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); 86cdf0e10cSrcweir 87cdf0e10cSrcweir //XPropertyState 88cdf0e10cSrcweir virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 89cdf0e10cSrcweir 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); 90cdf0e10cSrcweir virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException); 91cdf0e10cSrcweir 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); 92cdf0e10cSrcweir 93cdf0e10cSrcweir //XMultiPropertyStates 94cdf0e10cSrcweir //getPropertyStates() already declared in XPropertyState 95cdf0e10cSrcweir virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException); 96cdf0e10cSrcweir 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); 97cdf0e10cSrcweir 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); 98cdf0e10cSrcweir 99cdf0e10cSrcweir protected: //methods 100cdf0e10cSrcweir /** give all the properties that should be visible to the outer side 101cdf0e10cSrcweir */ 102cdf0e10cSrcweir virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence()=0; 103cdf0e10cSrcweir /** give a list of all properties that need a special treatment; 104cdf0e10cSrcweir properties that are not in this list will be wrapped identical. 105cdf0e10cSrcweir The base class 'WrappedPropertySet' will take ownership on the contained pointer. 106cdf0e10cSrcweir It is not allowed to have duplicate entries in this list. 107cdf0e10cSrcweir */ 108cdf0e10cSrcweir virtual const std::vector< WrappedProperty* > createWrappedProperties()=0; 109cdf0e10cSrcweir 110cdf0e10cSrcweir virtual ::com::sun::star::uno::Reference< 111cdf0e10cSrcweir ::com::sun::star::beans::XPropertySet > getInnerPropertySet() = 0; 112cdf0e10cSrcweir SAL_DLLPRIVATE ::com::sun::star::uno::Reference< 113cdf0e10cSrcweir ::com::sun::star::beans::XPropertyState > getInnerPropertyState(); 114cdf0e10cSrcweir 115cdf0e10cSrcweir ::cppu::IPropertyArrayHelper& getInfoHelper(); 116cdf0e10cSrcweir SAL_DLLPRIVATE tWrappedPropertyMap& getWrappedPropertyMap(); 117cdf0e10cSrcweir 118cdf0e10cSrcweir const WrappedProperty* getWrappedProperty( const ::rtl::OUString& rOuterName ); 119cdf0e10cSrcweir const WrappedProperty* getWrappedProperty( sal_Int32 nHandle ); 120cdf0e10cSrcweir 121cdf0e10cSrcweir protected: //member 122cdf0e10cSrcweir ::com::sun::star::uno::Reference< 123cdf0e10cSrcweir ::com::sun::star::beans::XPropertySetInfo > m_xInfo;//outer PropertySetInfo 124cdf0e10cSrcweir 125cdf0e10cSrcweir ::cppu::OPropertyArrayHelper* m_pPropertyArrayHelper;//holds all possible outer properties 126cdf0e10cSrcweir 127cdf0e10cSrcweir tWrappedPropertyMap* m_pWrappedPropertyMap;//holds all wrapped properties (containing the special mapping from inner to outer properties) 128cdf0e10cSrcweir 129cdf0e10cSrcweir //Container for the XProperyChangedListener. The listeners are inserted by handle. 130cdf0e10cSrcweir //OMultiTypeInterfaceContainerHelperInt32 m_aBoundListenerContainer; 131cdf0e10cSrcweir 132cdf0e10cSrcweir //Container for the XPropertyVetoableListener. The listeners are inserted by handle. 133cdf0e10cSrcweir //OMultiTypeInterfaceContainerHelperInt32 m_aVetoableListenerContainer; 134cdf0e10cSrcweir }; 135cdf0e10cSrcweir 136cdf0e10cSrcweir //............................................................................. 137cdf0e10cSrcweir } //namespace chart 138cdf0e10cSrcweir //............................................................................. 139cdf0e10cSrcweir 140cdf0e10cSrcweir // CHART_WRAPPEDPROPERTYSET_HXX 141cdf0e10cSrcweir #endif 142