ooodev.adapter.beans.properties_change_implement module
- class ooodev.adapter.beans.properties_change_implement.PropertiesChangeImplement(component, trigger_args=None, cb=None, listener=None)[source]
Bases:
object
Class for managing Properties Change Events.
This class can be used to extend a class that already implements or uses
com.sun.star.beans.XMultiPropertySet
in some way.- Parameters:
component (XMultiPropertySet) –
trigger_args (GenericArgs | None) –
cb (ListenerEventCallbackT | None) –
listener (PropertiesChangeListener | None) –
- __init__(component, trigger_args=None, cb=None, listener=None)[source]
Constructor
- Parameters:
component (Any) – UNO Component that implements
com.sun.star.beans.XMultiPropertySet
.trigger_args (Dict[str, Any], optional) – Generic Arguments to pass to instances of
PropertyChangeEvents
when they are created. Defaults to None.cb (ListenerEventCallbackT | None) –
listener (PropertiesChangeListener | None) –
- Return type:
None
- add_event_properties_change(names, cb)[source]
Add properties to listen for changes.
- Parameters:
names (Iterable[str]) – One or more property names to listen for changes.
cb (EventArgsCallbackT) – Callback that is invoked when an event is triggered.
- Raises:
ValueError – If names is empty.
- Return type:
None
Note
The callback
EventArgs.event_data
will contain a tuple ofcom.sun.star.beans.PropertyChangeEvent
objects.Each time this method is called, the previous names are removed and the new names are added.
- fire_event_properties_change(names)[source]
Fires a sequence of PropertyChangeEvents
- Parameters:
names (Iterable[str]) – Sequence of property names to fire event for.
- Return type:
None
- property events_listener_properties_change_implement: PropertiesChangeListener
Returns listener
- Return type: