LibreOffice Module canvas (master)  1
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
canvas::PropertySetHelper Class Reference

Really simplistic XPropertySet helper for properties. More...

#include <propertysethelper.hxx>

Classes

struct  Callbacks
 
class  MakeMap
 

Public Types

typedef std::function< css::uno::Any()> GetterType
 
typedef std::function< void(const css::uno::Any &)> SetterType
 
typedef tools::ValueMap< CallbacksMapType
 
typedef std::vector< MapType::MapEntryInputMap
 

Public Member Functions

 PropertySetHelper ()
 Create helper with zero properties. More...
 
void initProperties (const InputMap &rMap)
 Init helper with new name/value map. More...
 
void addProperties (const InputMap &rMap)
 Add given properties to helper. More...
 
bool isPropertyName (const OUString &aPropertyName) const
 Checks whether the given string corresponds to a valid property name. More...
 
css::uno::Reference< css::beans::XPropertySetInfo > getPropertySetInfo () const
 
void setPropertyValue (const OUString &aPropertyName, const css::uno::Any &aValue)
 
css::uno::Any getPropertyValue (const OUString &PropertyName) const
 
void addPropertyChangeListener (const OUString &aPropertyName, const css::uno::Reference< css::beans::XPropertyChangeListener > &xListener)
 
void addVetoableChangeListener (const OUString &aPropertyName, const css::uno::Reference< css::beans::XVetoableChangeListener > &xListener)
 

Private Attributes

std::unique_ptr< MapTypempMap
 
InputMap maMapEntries
 

Detailed Description

Really simplistic XPropertySet helper for properties.

This class provides easy access to properties, referenced via ASCII strings. The name/property modification callbacks pairs are passed into this class via a vector. Each time a property is set or queried, the corresponding getter or setter callback is called.

Use this class as a delegate for the corresponding XPropertySet methods, and take care of UNO XInterface and lock handling by yourself.

The core responsibility of this class is the name/value mapping for property sets.

Definition at line 52 of file propertysethelper.hxx.

Member Typedef Documentation

typedef std::function<css::uno::Any ()> canvas::PropertySetHelper::GetterType

Definition at line 55 of file propertysethelper.hxx.

Definition at line 63 of file propertysethelper.hxx.

Definition at line 62 of file propertysethelper.hxx.

typedef std::function<void (const css::uno::Any&)> canvas::PropertySetHelper::SetterType

Definition at line 56 of file propertysethelper.hxx.

Constructor & Destructor Documentation

canvas::PropertySetHelper::PropertySetHelper ( )

Create helper with zero properties.

Definition at line 58 of file propertysethelper.cxx.

Member Function Documentation

void canvas::PropertySetHelper::addProperties ( const InputMap rMap)

Add given properties to helper.

Parameters
rMapVector of name/function pointers. Each name is offered as a property, and reading/writing to this property is passed on to the given function pointer. These name/function pairs are added to the already existing ones.

Definition at line 79 of file propertysethelper.cxx.

References initProperties(), and maMapEntries.

Referenced by canvas::BufferedGraphicDeviceBase< Base, DeviceHelper, Mutex, UnambiguousBase >::BufferedGraphicDeviceBase().

void canvas::PropertySetHelper::addPropertyChangeListener ( const OUString &  aPropertyName,
const css::uno::Reference< css::beans::XPropertyChangeListener > &  xListener 
)
void canvas::PropertySetHelper::addVetoableChangeListener ( const OUString &  aPropertyName,
const css::uno::Reference< css::beans::XVetoableChangeListener > &  xListener 
)
uno::Reference< beans::XPropertySetInfo > canvas::PropertySetHelper::getPropertySetInfo ( ) const
uno::Any canvas::PropertySetHelper::getPropertyValue ( const OUString &  PropertyName) const
void canvas::PropertySetHelper::initProperties ( const InputMap rMap)

Init helper with new name/value map.

Parameters
rMapVector of name/function pointers. Each name is offered as a property, and reading/writing to this property is passed on to the given function pointer.

Definition at line 64 of file propertysethelper.cxx.

References maMapEntries, and mpMap.

Referenced by addProperties(), and canvas::GraphicDeviceBase< Base, DeviceHelper, Mutex, UnambiguousBase >::GraphicDeviceBase().

bool canvas::PropertySetHelper::isPropertyName ( const OUString &  aPropertyName) const

Checks whether the given string corresponds to a valid property name.

Returns
true, if the given name maps to a known property.

Definition at line 89 of file propertysethelper.cxx.

References mpMap.

void canvas::PropertySetHelper::setPropertyValue ( const OUString &  aPropertyName,
const css::uno::Any &  aValue 
)

Member Data Documentation

InputMap canvas::PropertySetHelper::maMapEntries
private

Definition at line 140 of file propertysethelper.hxx.

Referenced by addProperties(), and initProperties().

std::unique_ptr<MapType> canvas::PropertySetHelper::mpMap
private

Definition at line 139 of file propertysethelper.hxx.

Referenced by getPropertyValue(), initProperties(), and isPropertyName().


The documentation for this class was generated from the following files: