merged tag ooo/OOO330_m14
[LibreOffice.git] / chart2 / source / inc / WrappedPropertySet.hxx
blob03cfea84f502bb6add50d8954b6e68df0292c1a6
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
27 #ifndef CHART_WRAPPEDPROPERTYSET_HXX
28 #define CHART_WRAPPEDPROPERTYSET_HXX
30 #include "WrappedProperty.hxx"
31 #include "MutexContainer.hxx"
32 #include "charttoolsdllapi.hxx"
33 #include <com/sun/star/beans/XMultiPropertySet.hpp>
34 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
35 #include <com/sun/star/beans/XPropertySet.hpp>
36 #include <com/sun/star/beans/XPropertyState.hpp>
37 #include <com/sun/star/beans/Property.hpp>
38 #include <cppuhelper/implbase4.hxx>
40 // header for class OPropertyArrayHelper
41 #include <cppuhelper/propshlp.hxx>
43 // header for class OMultiTypeInterfaceContainerHelperInt32
44 #include <cppuhelper/propshlp.hxx>
46 #include <vector>
48 //.............................................................................
49 namespace chart
51 //.............................................................................
53 class OOO_DLLPUBLIC_CHARTTOOLS WrappedPropertySet :
54 public MutexContainer
55 , public ::cppu::WeakImplHelper4
56 < ::com::sun::star::beans::XPropertySet
57 , ::com::sun::star::beans::XMultiPropertySet
58 , ::com::sun::star::beans::XPropertyState
59 , ::com::sun::star::beans::XMultiPropertyStates
60 // ,::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface)
61 // ,::com::sun::star::uno::XInterface // implemented by WeakImplHelper
62 // ,::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper
65 public:
66 WrappedPropertySet();
67 virtual ~WrappedPropertySet();
69 void clearWrappedPropertySet();
71 public:
72 //XPropertySet
73 virtual ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertySetInfo > SAL_CALL getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException);
75 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);
76 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);
78 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);
79 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);
80 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);
81 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);
83 //XMultiPropertySet
84 //getPropertySetInfo() already declared in XPropertySet
85 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);
86 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);
87 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);
88 virtual void SAL_CALL removePropertiesChangeListener( const ::com::sun::star::uno::Reference< ::com::sun::star::beans::XPropertiesChangeListener >& xListener ) throw (::com::sun::star::uno::RuntimeException);
89 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);
91 //XPropertyState
92 virtual ::com::sun::star::beans::PropertyState SAL_CALL getPropertyState( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
93 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);
94 virtual void SAL_CALL setPropertyToDefault( const ::rtl::OUString& PropertyName ) throw (::com::sun::star::beans::UnknownPropertyException, ::com::sun::star::uno::RuntimeException);
95 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);
97 //XMultiPropertyStates
98 //getPropertyStates() already declared in XPropertyState
99 virtual void SAL_CALL setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException);
100 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);
101 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);
103 protected: //methods
104 /** give all the properties that should be visible to the outer side
106 virtual const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::Property >& getPropertySequence()=0;
107 /** give a list of all properties that need a special treatment;
108 properties that are not in this list will be wrapped identical.
109 The base class 'WrappedPropertySet' will take ownership on the contained pointer.
110 It is not allowed to have duplicate entries in this list.
112 virtual const std::vector< WrappedProperty* > createWrappedProperties()=0;
114 virtual ::com::sun::star::uno::Reference<
115 ::com::sun::star::beans::XPropertySet > getInnerPropertySet() = 0;
116 SAL_DLLPRIVATE ::com::sun::star::uno::Reference<
117 ::com::sun::star::beans::XPropertyState > getInnerPropertyState();
119 ::cppu::IPropertyArrayHelper& getInfoHelper();
120 SAL_DLLPRIVATE tWrappedPropertyMap& getWrappedPropertyMap();
122 const WrappedProperty* getWrappedProperty( const ::rtl::OUString& rOuterName );
123 const WrappedProperty* getWrappedProperty( sal_Int32 nHandle );
125 protected: //member
126 ::com::sun::star::uno::Reference<
127 ::com::sun::star::beans::XPropertySetInfo > m_xInfo;//outer PropertySetInfo
129 ::cppu::OPropertyArrayHelper* m_pPropertyArrayHelper;//holds all possible outer properties
131 tWrappedPropertyMap* m_pWrappedPropertyMap;//holds all wrapped properties (containing the special mapping from inner to outer properties)
133 //Container for the XProperyChangedListener. The listeners are inserted by handle.
134 //OMultiTypeInterfaceContainerHelperInt32 m_aBoundListenerContainer;
136 //Container for the XPropertyVetoableListener. The listeners are inserted by handle.
137 //OMultiTypeInterfaceContainerHelperInt32 m_aVetoableListenerContainer;
140 //.............................................................................
141 } //namespace chart
142 //.............................................................................
144 // CHART_WRAPPEDPROPERTYSET_HXX
145 #endif