Class BasePropertySet

class ooodev.uno_helper.base_class.base_property_set.BasePropertySet(*args, **kwargs)[source]

Bases: Base, XPropertySet

Provides information about and access to the properties from an implementation.

There are three types of properties:

You can listen to changes of bound properties with the XPropertyChangeListener and you can veto changes of constrained properties with the XVetoableChangeListener.

To implement inaccurate name access, you must support the interface XExactName.

See also

API XPropertySet

Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

Any

__init__(*args, **kwargs)
Parameters:
  • args (Any) –

  • kwargs (Any) –

Return type:

None

acquire()
Return type:

None

addPropertyChangeListener(listener, prop_name='')[source]

Adds an XPropertyChangeListener to the specified property.

An empty name registers the listener to all bound properties. If the property is not bound, the behavior is not specified.

It is suggested to allow multiple registration of the same listener, thus for each time a listener is added, it has to be removed.

Raises:
  • com.sun.star.beans.UnknownPropertyExceptionUnknownPropertyException

  • com.sun.star.lang.WrappedTargetExceptionWrappedTargetException

Return type:

None

Parameters:
  • listener (XPropertyChangeListener) –

  • prop_name (str) –

addVetoableChangeListener(listener, prop_name='')[source]

Adds an XVetoableChangeListener to the specified property with the name PropertyName.

An empty name registers the listener to all constrained properties. If the property is not constrained, the behavior is not specified.

Raises:
  • com.sun.star.beans.UnknownPropertyExceptionUnknownPropertyException

  • com.sun.star.lang.WrappedTargetExceptionWrappedTargetException

Return type:

None

Parameters:
  • listener (com.sun.star.beans.XVetoableChangeListener) –

  • prop_name (str) –

getPropertySetInfo()[source]

Gets the complete information of the properties provided by this object.

Returns:

Property set info.

Return type:

XPropertySetInfo

getPropertyValue(name)[source]

Gets a property value.

Raises:
  • com.sun.star.beans.UnknownPropertyExceptionUnknownPropertyException

  • com.sun.star.lang.WrappedTargetExceptionWrappedTargetException

Return type:

Any

Parameters:

name (str) –

queryInterface(a_type)
Return type:

Any

Parameters:

a_type (Any) –

release()
Return type:

None

removePropertyChangeListener(listener, prop_name='')[source]

removes an XPropertyChangeListener from the listener list.

It is a noop if the listener is not registered.

It is suggested to allow multiple registration of the same listener, thus for each time a listener is added, it has to be removed.

Raises:
  • com.sun.star.beans.UnknownPropertyExceptionUnknownPropertyException

  • com.sun.star.lang.WrappedTargetExceptionWrappedTargetException

Return type:

None

Parameters:
  • listener (com.sun.star.beans.XPropertyChangeListener) –

  • prop_name (str) –

removeVetoableChangeListener(listener, prop_name='')[source]

removes an XVetoableChangeListener from the listener list.

It is a noop if the listener is not registered.

Raises:
  • com.sun.star.beans.UnknownPropertyExceptionUnknownPropertyException

  • com.sun.star.lang.WrappedTargetExceptionWrappedTargetException

Return type:

None

Parameters:
  • listener (com.sun.star.beans.XVetoableChangeListener) –

  • prop_name (str) –

setPropertyValue(name, value)[source]

Sets the value of the property with the specified name.

If it is a bound property the value will be changed before the change event is fired. If it is a constrained property a vetoable event is fired before the property value can be changed.

Raises:
  • com.sun.star.beans.UnknownPropertyExceptionUnknownPropertyException

  • com.sun.star.beans.PropertyVetoExceptionPropertyVetoException

  • com.sun.star.lang.IllegalArgumentExceptionIllegalArgumentException

  • com.sun.star.lang.WrappedTargetExceptionWrappedTargetException

Return type:

None

Parameters:
  • name (str) –

  • value (Any) –