ooodev.adapter.view.selection_change_events module

class ooodev.adapter.view.selection_change_events.SelectionChangeEvents(trigger_args=None, cb=None, listener=None, doc=None)[source]

Bases: object

Class for managing Selection Change Events.

This class is usually inherited by control classes that implement com.sun.star.view.XSelectionChangeListener.

Parameters:
__init__(trigger_args=None, cb=None, listener=None, doc=None)[source]

Constructor

Parameters:
  • trigger_args (GenericArgs, optional) – Args that are passed to events when they are triggered. This only applies if the listener is not passed.

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

  • listener (SelectionChangeListener | None, optional) – Listener that is used to manage events.

  • doc (Any, Optional) – Office Document. If document is passed then SelectionChangeListener instance is automatically added.

Return type:

None

add_event_selection_change_events_disposing(cb)[source]

Adds a listener for an event.

Event is invoked when the broadcaster is about to be disposed.

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

Return type:

None

Parameters:

cb (Any) –

add_event_selection_changed(cb)[source]

Adds a listener for an event.

Event is invoked when the selection changes.

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

Return type:

None

Parameters:

cb (Any) –

remove_event_selection_change_events_disposing(cb)[source]

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_selection_changed(cb)[source]

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

property events_listener_selection_change: SelectionChangeListener

Returns listener

Return type:

SelectionChangeListener

ooodev.adapter.view.selection_change_events.on_lazy_cb(source, event)[source]

Callback that is invoked when an event is added or removed.

This method is generally used to add the listener to the component in a lazy manner. This means this callback will only be called once in the lifetime of the component.

Parameters:
  • source (Any) – Expected to be an instance of SelectionChangeEvents that is a partial class of a component based class.

  • event (ListenerEventArgs) – Event arguments.

Return type:

None

Warning

This method is intended for internal use only.