1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: WrappedPropertySet.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef CHART_WRAPPEDPROPERTYSET_HXX
31 #define CHART_WRAPPEDPROPERTYSET_HXX
33 #include "WrappedProperty.hxx"
34 #include "MutexContainer.hxx"
35 #include "charttoolsdllapi.hxx"
36 #include <com/sun/star/beans/XMultiPropertySet.hpp>
37 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
38 #include <com/sun/star/beans/XPropertySet.hpp>
39 #include <com/sun/star/beans/XPropertyState.hpp>
40 #include <com/sun/star/beans/Property.hpp>
41 #include <cppuhelper/implbase4.hxx>
43 // header for class OPropertyArrayHelper
44 #include <cppuhelper/propshlp.hxx>
46 // header for class OMultiTypeInterfaceContainerHelperInt32
47 #include <cppuhelper/propshlp.hxx>
51 //.............................................................................
54 //.............................................................................
56 class OOO_DLLPUBLIC_CHARTTOOLS WrappedPropertySet
:
58 , public ::cppu::WeakImplHelper4
59 < ::com::sun::star::beans::XPropertySet
60 , ::com::sun::star::beans::XMultiPropertySet
61 , ::com::sun::star::beans::XPropertyState
62 , ::com::sun::star::beans::XMultiPropertyStates
63 // ,::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface)
64 // ,::com::sun::star::uno::XInterface // implemented by WeakImplHelper
65 // ,::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper
70 virtual ~WrappedPropertySet();
72 void clearWrappedPropertySet();
76 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException
);
78 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
);
79 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
);
81 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
);
82 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
);
83 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
);
84 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
);
87 //getPropertySetInfo() already declared in XPropertySet
88 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
);
89 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
);
90 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
);
91 virtual void SAL_CALL
removePropertiesChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
);
92 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
);
95 virtual ::com::sun::star::beans::PropertyState SAL_CALL
getPropertyState( const ::rtl::OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
);
96 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
);
97 virtual void SAL_CALL
setPropertyToDefault( const ::rtl::OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
);
98 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
);
100 //XMultiPropertyStates
101 //getPropertyStates() already declared in XPropertyState
102 virtual void SAL_CALL
setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException
);
103 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
);
104 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
);
107 /** give all the properties that should be visible to the outer side
109 virtual const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& getPropertySequence()=0;
110 /** give a list of all properties that need a special treatment;
111 properties that are not in this list will be wrapped identical.
112 The base class 'WrappedPropertySet' will take ownership on the contained pointer.
113 It is not allowed to have duplicate entries in this list.
115 virtual const std::vector
< WrappedProperty
* > createWrappedProperties()=0;
117 virtual ::com::sun::star::uno::Reference
<
118 ::com::sun::star::beans::XPropertySet
> getInnerPropertySet() = 0;
119 SAL_DLLPRIVATE ::com::sun::star::uno::Reference
<
120 ::com::sun::star::beans::XPropertyState
> getInnerPropertyState();
122 ::cppu::IPropertyArrayHelper
& getInfoHelper();
123 SAL_DLLPRIVATE tWrappedPropertyMap
& getWrappedPropertyMap();
125 const WrappedProperty
* getWrappedProperty( const ::rtl::OUString
& rOuterName
);
126 const WrappedProperty
* getWrappedProperty( sal_Int32 nHandle
);
129 ::com::sun::star::uno::Reference
<
130 ::com::sun::star::beans::XPropertySetInfo
> m_xInfo
;//outer PropertySetInfo
132 ::cppu::OPropertyArrayHelper
* m_pPropertyArrayHelper
;//holds all possible outer properties
134 tWrappedPropertyMap
* m_pWrappedPropertyMap
;//holds all wrapped properties (containing the special mapping from inner to outer properties)
136 //Container for the XProperyChangedListener. The listeners are inserted by handle.
137 //OMultiTypeInterfaceContainerHelperInt32 m_aBoundListenerContainer;
139 //Container for the XPropertyVetoableListener. The listeners are inserted by handle.
140 //OMultiTypeInterfaceContainerHelperInt32 m_aVetoableListenerContainer;
143 //.............................................................................
145 //.............................................................................
147 // CHART_WRAPPEDPROPERTYSET_HXX