1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
19 #ifndef INCLUDED_CHART2_SOURCE_INC_WRAPPEDPROPERTYSET_HXX
20 #define INCLUDED_CHART2_SOURCE_INC_WRAPPEDPROPERTYSET_HXX
22 #include "WrappedProperty.hxx"
23 #include "MutexContainer.hxx"
24 #include "charttoolsdllapi.hxx"
25 #include <com/sun/star/beans/XMultiPropertySet.hpp>
26 #include <com/sun/star/beans/XMultiPropertyStates.hpp>
27 #include <com/sun/star/beans/XPropertySet.hpp>
28 #include <com/sun/star/beans/XPropertyState.hpp>
29 #include <com/sun/star/beans/Property.hpp>
30 #include <cppuhelper/implbase4.hxx>
31 #include <cppuhelper/propshlp.hxx>
39 class OOO_DLLPUBLIC_CHARTTOOLS WrappedPropertySet
:
41 , public ::cppu::WeakImplHelper4
42 < ::com::sun::star::beans::XPropertySet
43 , ::com::sun::star::beans::XMultiPropertySet
44 , ::com::sun::star::beans::XPropertyState
45 , ::com::sun::star::beans::XMultiPropertyStates
46 // ,::com::sun::star::uno::XWeak // implemented by WeakImplHelper(optional interface)
47 // ,::com::sun::star::uno::XInterface // implemented by WeakImplHelper
48 // ,::com::sun::star::lang::XTypeProvider // implemented by WeakImplHelper
53 virtual ~WrappedPropertySet();
55 void clearWrappedPropertySet();
59 virtual ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertySetInfo
> SAL_CALL
getPropertySetInfo( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
61 virtual void SAL_CALL
setPropertyValue( const 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
, std::exception
) SAL_OVERRIDE
;
62 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyValue( const OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
64 virtual void SAL_CALL
addPropertyChangeListener( const 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
, std::exception
) SAL_OVERRIDE
;
65 virtual void SAL_CALL
removePropertyChangeListener( const 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
, std::exception
) SAL_OVERRIDE
;
66 virtual void SAL_CALL
addVetoableChangeListener( const 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
, std::exception
) SAL_OVERRIDE
;
67 virtual void SAL_CALL
removeVetoableChangeListener( const 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
, std::exception
) SAL_OVERRIDE
;
70 //getPropertySetInfo() already declared in XPropertySet
71 virtual void SAL_CALL
setPropertyValues( const ::com::sun::star::uno::Sequence
< 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
, std::exception
) SAL_OVERRIDE
;
72 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> SAL_CALL
getPropertyValues( const ::com::sun::star::uno::Sequence
< OUString
>& aPropertyNames
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
73 virtual void SAL_CALL
addPropertiesChangeListener( const ::com::sun::star::uno::Sequence
< OUString
>& aPropertyNames
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
74 virtual void SAL_CALL
removePropertiesChangeListener( const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
75 virtual void SAL_CALL
firePropertiesChangeEvent( const ::com::sun::star::uno::Sequence
< OUString
>& aPropertyNames
, const ::com::sun::star::uno::Reference
< ::com::sun::star::beans::XPropertiesChangeListener
>& xListener
) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
78 virtual ::com::sun::star::beans::PropertyState SAL_CALL
getPropertyState( const OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
79 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::PropertyState
> SAL_CALL
getPropertyStates( const ::com::sun::star::uno::Sequence
< OUString
>& aPropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
80 virtual void SAL_CALL
setPropertyToDefault( const OUString
& PropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
81 virtual ::com::sun::star::uno::Any SAL_CALL
getPropertyDefault( const OUString
& aPropertyName
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
83 //XMultiPropertyStates
84 //getPropertyStates() already declared in XPropertyState
85 virtual void SAL_CALL
setAllPropertiesToDefault( ) throw (::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
86 virtual void SAL_CALL
setPropertiesToDefault( const ::com::sun::star::uno::Sequence
< OUString
>& aPropertyNames
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
87 virtual ::com::sun::star::uno::Sequence
< ::com::sun::star::uno::Any
> SAL_CALL
getPropertyDefaults( const ::com::sun::star::uno::Sequence
< OUString
>& aPropertyNames
) throw (::com::sun::star::beans::UnknownPropertyException
, ::com::sun::star::lang::WrappedTargetException
, ::com::sun::star::uno::RuntimeException
, std::exception
) SAL_OVERRIDE
;
90 /** give all the properties that should be visible to the outer side
92 virtual const ::com::sun::star::uno::Sequence
< ::com::sun::star::beans::Property
>& getPropertySequence()=0;
93 /** give a list of all properties that need a special treatment;
94 properties that are not in this list will be wrapped identical.
95 The base class 'WrappedPropertySet' will take ownership on the contained pointer.
96 It is not allowed to have duplicate entries in this list.
98 virtual const std::vector
< WrappedProperty
* > createWrappedProperties()=0;
100 virtual ::com::sun::star::uno::Reference
<
101 ::com::sun::star::beans::XPropertySet
> getInnerPropertySet() = 0;
102 SAL_DLLPRIVATE ::com::sun::star::uno::Reference
<
103 ::com::sun::star::beans::XPropertyState
> getInnerPropertyState();
105 ::cppu::IPropertyArrayHelper
& getInfoHelper();
106 SAL_DLLPRIVATE tWrappedPropertyMap
& getWrappedPropertyMap();
108 const WrappedProperty
* getWrappedProperty( const OUString
& rOuterName
);
109 const WrappedProperty
* getWrappedProperty( sal_Int32 nHandle
);
112 ::com::sun::star::uno::Reference
<
113 ::com::sun::star::beans::XPropertySetInfo
> m_xInfo
;//outer PropertySetInfo
115 ::cppu::OPropertyArrayHelper
* m_pPropertyArrayHelper
;//holds all possible outer properties
117 tWrappedPropertyMap
* m_pWrappedPropertyMap
;//holds all wrapped properties (containing the special mapping from inner to outer properties)
119 //Container for the XProperyChangedListener. The listeners are inserted by handle.
120 //OMultiTypeInterfaceContainerHelperInt32 m_aBoundListenerContainer;
122 //Container for the XPropertyVetoableListener. The listeners are inserted by handle.
123 //OMultiTypeInterfaceContainerHelperInt32 m_aVetoableListenerContainer;
128 // INCLUDED_CHART2_SOURCE_INC_WRAPPEDPROPERTYSET_HXX
131 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */