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_WRAPPEDPROPERTY_HXX 24 #define CHART_WRAPPEDPROPERTY_HXX 25 26 #include <com/sun/star/beans/XPropertySet.hpp> 27 #include <com/sun/star/beans/XPropertyState.hpp> 28 #include "charttoolsdllapi.hxx" 29 30 #include <map> 31 32 //............................................................................. 33 namespace chart 34 { 35 //............................................................................. 36 37 class OOO_DLLPUBLIC_CHARTTOOLS WrappedProperty 38 { 39 /** The property visible to the outer PropertySet in the PropertySetWrapper may have a different name, type and value than 40 a corresponding property of the inner PropertySet. Use this class to do the conversion between the two. 41 */ 42 public: 43 WrappedProperty( const ::rtl::OUString& rOuterName, const ::rtl::OUString& rInnerName ); 44 virtual ~WrappedProperty(); 45 46 const ::rtl::OUString& getOuterName() const; 47 virtual ::rtl::OUString getInnerName() const; 48 49 virtual void setPropertyValue( const ::com::sun::star::uno::Any& rOuterValue, const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const; 50 51 virtual ::com::sun::star::uno::Any getPropertyValue( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySet >& xInnerPropertySet ) const; 52 53 virtual void setPropertyToDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const; 54 55 virtual ::com::sun::star::uno::Any getPropertyDefault( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const; 56 57 virtual ::com::sun::star::beans::PropertyState getPropertyState( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertyState >& xInnerPropertyState ) const; 58 59 protected: 60 virtual ::com::sun::star::uno::Any convertInnerToOuterValue( const ::com::sun::star::uno::Any& rInnerValue ) const; 61 virtual ::com::sun::star::uno::Any convertOuterToInnerValue( const ::com::sun::star::uno::Any& rOuterValue ) const; 62 63 protected: 64 ::rtl::OUString m_aOuterName; 65 ::rtl::OUString m_aInnerName; 66 }; 67 68 //............................................................................. 69 70 typedef ::std::map< sal_Int32, const WrappedProperty* > tWrappedPropertyMap; 71 72 //............................................................................. 73 } //namespace chart 74 //............................................................................. 75 76 // CHART_WRAPPEDPROPERTY_HXX 77 #endif 78