24#include <propertysethelper.hxx>
25#include <com/sun/star/beans/PropertyVetoException.hpp>
26#include <com/sun/star/beans/UnknownPropertyException.hpp>
34 void throwUnknown( std::u16string_view aPropertyName )
36 throw beans::UnknownPropertyException(
37 OUString::Concat(
"PropertySetHelper: property ") +
38 aPropertyName +
" not found."
42 void throwVeto( std::u16string_view aPropertyName )
44 throw beans::PropertyVetoException(
45 OUString::Concat(
"PropertySetHelper: property ") +
46 aPropertyName +
" access was vetoed." );
49 struct EntryComparator
51 bool operator()(
const PropertySetHelper::MapType::MapEntry& rLHS,
52 const PropertySetHelper::MapType::MapEntry& rRHS )
54 return strcmp( rLHS.maKey,
82 aMerged.insert( aMerged.end(),
95 return mpMap->lookup( aPropertyName,
102 return uno::Reference< beans::XPropertySetInfo >();
109 if (!
mpMap || !
mpMap->lookup(aPropertyName, aCallbacks))
111 throwUnknown( aPropertyName );
115 throwVeto( aPropertyName );
125 throwUnknown( aPropertyName );
137 const uno::Reference< beans::XPropertyChangeListener >& )
142 throwUnknown( aPropertyName );
146 const uno::Reference< beans::XVetoableChangeListener >& )
151 throwUnknown( aPropertyName );
std::vector< MapType::MapEntry > InputMap
void addVetoableChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener)
bool isPropertyName(const OUString &aPropertyName) const
Checks whether the given string corresponds to a valid property name.
std::unique_ptr< MapType > mpMap
tools::ValueMap< Callbacks > MapType
void setPropertyValue(const OUString &aPropertyName, const css::uno::Any &aValue)
void addPropertyChangeListener(const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener)
css::uno::Any getPropertyValue(const OUString &PropertyName) const
css::uno::Reference< css::beans::XPropertySetInfo > getPropertySetInfo() const
void initProperties(InputMap &&rMap)
Init helper with new name/value map.
PropertySetHelper()
Create helper with zero properties.
void addProperties(const InputMap &rMap)
Add given properties to helper.
std::set< uno_getMappingFunc > aCallbacks