ooodev.adapter.awt.item_list_events module

class ooodev.adapter.awt.item_list_events.ItemListEvents(trigger_args=None, cb=None, listener=None, subscriber=None)[source]

Bases: object

Class for managing Change Events.

Parameters:
  • trigger_args (GenericArgs | None) –

  • cb (ListenerEventCallbackT | None) –

  • listener (ItemListListener | None) –

  • subscriber (XItemList | None) –

__init__(trigger_args=None, cb=None, listener=None, subscriber=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 (ItemListListener | None, optional) – Listener that is used to manage events.

  • subscriber (XItemList, optional) – An UNO object that implements the com.sun.star.form.XItemList interface. If passed in then this instance listener is automatically added to it.

Return type:

None

add_event_all_items_removed(cb)[source]

Adds a listener for an event.

Event is invoked when the list has been completely cleared, i.e. after an invocation of XItemList.removeAllItems()

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

Return type:

None

Parameters:

cb (Any) –

add_event_item_list_changed(cb)[source]

Adds a listener for an event.

Event is invoked when the changes to the item list which occurred are too complex to be notified in single events.

Consumers of this event should discard their cached information about the current item list, and completely refresh it from the XItemList’s current state.

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

Return type:

None

Parameters:

cb (Any) –

add_event_item_list_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_list_item_inserted(cb)[source]

Adds a listener for an event.

Event is invoked when an item is inserted into the list.

The callback EventArgs.event_data will contain a UNO com.sun.star.awt.ItemListEvent struct.

Return type:

None

Parameters:

cb (Any) –

add_event_list_item_modified(cb)[source]

Adds a listener for an event.

Event is invoked when an item in the list is modified, i.e. its text or image changed.

The callback EventArgs.event_data will contain a UNO com.sun.star.awt.ItemListEvent struct.

Return type:

None

Parameters:

cb (Any) –

add_event_list_item_removed(cb)[source]

Adds a listener for an event.

Event is invoked when an item is removed from the list.

The callback EventArgs.event_data will contain a UNO com.sun.star.awt.ItemListEvent struct.

Return type:

None

Parameters:

cb (Any) –

remove_event_all_items_removed(cb)[source]

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_item_list_changed(cb)[source]

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_item_list_events_disposing(cb)[source]

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_list_item_inserted(cb)[source]

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_list_item_modified(cb)[source]

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

remove_event_list_item_removed(cb)[source]

Removes a listener for an event

Return type:

None

Parameters:

cb (Any) –

property events_listener_item_list: ItemListListener

Returns listener

Return type:

ItemListListener

ooodev.adapter.awt.item_list_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 ItemListEvents 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.