20 #ifndef INCLUDED_COMPHELPER_PROPAGG_HXX
21 #define INCLUDED_COMPHELPER_PROPAGG_HXX
23 #include <config_options.h>
24 #include <com/sun/star/beans/Property.hpp>
25 #include <com/sun/star/beans/PropertyState.hpp>
26 #include <com/sun/star/beans/XPropertiesChangeListener.hpp>
27 #include <com/sun/star/beans/XVetoableChangeListener.hpp>
28 #include <com/sun/star/lang/EventObject.hpp>
56 :nOriginalHandle(_nOriginalHandle) ,nPos(_nPos) ,bAggregate(_bAggregate) { }
58 :nOriginalHandle(-1) ,nPos(-1) ,bAggregate(false) { }
91 #define DEFAULT_AGGREGATE_PROPERTY_ID 10000
95 friend class OPropertySetAggregationHelper;
125 const css::uno::Sequence< css::beans::Property>& _rAggProperties,
131 virtual sal_Bool SAL_CALL fillPropertyMembersByHandle( OUString* _pPropName, sal_Int16* _pAttributes,
132 sal_Int32 _nHandle)
override ;
135 virtual css::uno::Sequence< css::beans::Property> SAL_CALL getProperties()
override;
137 virtual css::beans::Property SAL_CALL getPropertyByName(
const OUString& _rPropertyName)
override;
140 virtual sal_Bool SAL_CALL hasPropertyByName(
const OUString& _rPropertyName)
override ;
142 virtual sal_Int32 SAL_CALL getHandleByName(
const OUString & _rPropertyName)
override;
144 virtual sal_Int32 SAL_CALL fillHandles( sal_Int32* _pHandles,
const css::uno::Sequence< OUString >& _rPropNames )
override;
154 bool fillAggregatePropertyInfoByHandle(OUString* _pPropName, sal_Int32* _pOriginalHandle,
155 sal_Int32 _nHandle)
const;
159 bool getPropertyByHandle( sal_Int32 _nHandle, css::beans::Property& _rProperty )
const;
180 PropertyOrigin classifyProperty(
const OUString& _rName );
183 const css::beans::Property* findPropertyByName(
const OUString& _rName)
const;
189 class PropertyForwarder;
198 class UNLESS_MERGELIBS(COMPHELPER_DLLPUBLIC) OPropertySetAggregationHelper :
public OPropertyStateHelper
199 ,
public css::beans::XPropertiesChangeListener
200 ,
public css::beans::XVetoableChangeListener
202 friend class internal::PropertyForwarder;
205 css::uno::Reference< css::beans::XPropertyState> m_xAggregateState;
206 css::uno::Reference< css::beans::XPropertySet> m_xAggregateSet;
207 css::uno::Reference< css::beans::XMultiPropertySet> m_xAggregateMultiSet;
208 css::uno::Reference< css::beans::XFastPropertySet> m_xAggregateFastSet;
210 std::unique_ptr<internal::PropertyForwarder> m_pForwarder;
211 bool m_bListening : 1;
216 virtual css::uno::Any SAL_CALL
queryInterface(
const css::uno::Type& aType)
override;
219 virtual void SAL_CALL disposing(
const css::lang::EventObject& Source)
override;
222 virtual void SAL_CALL setFastPropertyValue(sal_Int32 nHandle,
const css::uno::Any& aValue)
override;
223 virtual css::uno::Any SAL_CALL getFastPropertyValue(sal_Int32 nHandle)
override;
226 virtual void SAL_CALL addPropertyChangeListener(
const OUString& aPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener >& xListener)
override;
227 virtual void SAL_CALL addVetoableChangeListener(
const OUString& PropertyName,
const css::uno::Reference< css::beans::XVetoableChangeListener >& aListener)
override;
230 virtual void SAL_CALL propertiesChange(
const css::uno::Sequence< css::beans::PropertyChangeEvent >& evt)
override;
233 virtual void SAL_CALL vetoableChange(
const css::beans::PropertyChangeEvent&
aEvent)
override;
236 virtual void SAL_CALL setPropertyValues(
const css::uno::Sequence< OUString >& PropertyNames,
const css::uno::Sequence< css::uno::Any >& Values)
override;
237 virtual void SAL_CALL addPropertiesChangeListener(
const css::uno::Sequence< OUString >& aPropertyNames,
const css::uno::Reference< css::beans::XPropertiesChangeListener >& xListener)
override;
240 virtual css::beans::PropertyState SAL_CALL getPropertyState(
const OUString& PropertyName)
override;
241 virtual void SAL_CALL setPropertyToDefault(
const OUString& PropertyName)
override;
242 virtual css::uno::Any SAL_CALL getPropertyDefault(
const OUString& aPropertyName)
override;
248 virtual ::cppu::IPropertyArrayHelper& SAL_CALL getInfoHelper()
override = 0;
253 virtual sal_Bool SAL_CALL convertFastPropertyValue( css::uno::Any& _rConvertedValue, css::uno::Any& _rOldValue, sal_Int32 _nHandle,
const css::uno::Any& _rValue )
override;
258 virtual void SAL_CALL setFastPropertyValue_NoBroadcast( sal_Int32 _nHandle,
const css::uno::Any& _rValue )
override;
261 virtual ~OPropertySetAggregationHelper()
override;
263 virtual void SAL_CALL getFastPropertyValue(css::uno::Any& rValue, sal_Int32 nHandle)
const override;
266 sal_Int32 getOriginalHandle( sal_Int32 _nHandle )
const;
290 void declareForwardedProperty( sal_Int32 _nHandle );
298 bool isCurrentlyForwardingProperty( sal_Int32 _nHandle )
const;
306 virtual void forwardingPropertyValue( sal_Int32 _nHandle );
314 virtual void forwardedPropertyValue( sal_Int32 _nHandle );
319 void setAggregation(
const css::uno::Reference< css::uno::XInterface >&);
320 void startListening();
327 #endif // INCLUDED_COMPHELPER_PROPAGG_HXX
bool operator==(const OPropertyAccessor &rOb) const
PropertyAccessorMap::const_iterator ConstPropertyAccessorMapIterator
used as callback for an OPropertyArrayAggregationHelper
virtual sal_Int32 getPreferredPropertyId(const OUString &_rName)=0
get the preferred handle for the given property
sal_Int32 nOriginalHandle
OPropertyAccessor(sal_Int32 _nOriginalHandle, sal_Int32 _nPos, bool _bAggregate)
internal::PropertyAccessorMap m_aPropertyAccessors
#define DEFAULT_AGGREGATE_PROPERTY_ID
used for implementing a cppu::IPropertyArrayHelper for classes aggregating property sets ...
std::map< sal_Int32, OPropertyAccessor > PropertyAccessorMap
OUString getPropertyName(sal_Int32 nPropertyType)
bool operator<(const OPropertyAccessor &rOb) const
#define COMPHELPER_DLLPUBLIC
std::vector< css::beans::Property > m_aProperties
css::uno::Any SAL_CALL queryInterface(const css::uno::Type &rType, Interface1 *p1)