ooodev.adapter.beans.property_change_implement module

class ooodev.adapter.beans.property_change_implement.PropertyChangeImplement(component, trigger_args=None, cb=None)[source]

Bases: object

Class for managing Property Change Events.

This class can be used to extend a class that already implements or uses com.sun.star.beans.XPropertySet in some way.

Parameters:
  • component (XPropertySet) –

  • trigger_args (GenericArgs | None) –

  • cb (ListenerEventCallbackT | None) –

__init__(component, trigger_args=None, cb=None)[source]

Constructor

Parameters:
  • component (XPropertySet) – UNO Component that implements com.sun.star.beans.XPropertySet.

  • trigger_args (GenericArgs, optional) – Args that are passed to events when they are triggered.

  • cb (ListenerEventCallbackT | None, optional) – Callback that is invoked when an event is added or removed.

Return type:

None

add_event_property_change(name, cb)[source]

Adds a listener for an event.

Event is invoked when property is changed.

The callback EventArgs.event_data will contain a com.sun.star.beans.PropertyChangeEvent struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

add_event_property_change_events_disposing(name, cb)[source]

Adds a listener for an event.

Event is invoked when the property listener is about to be disposed.

The callback EventArgs.event_data will contain a UNO com.sun.star.lang.EventObject struct.

Parameters:
  • name (str) – Property Name

  • cb (EventArgsCallbackT) – Callback

Return type:

None

remove_event_property_change(name)[source]

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None

remove_event_property_change_events_disposing(name)[source]

Removes a listener for an event

Parameters:

name (str) – Property Name

Return type:

None