ooodev.adapter.beans.vetoable_change_collection module
- class ooodev.adapter.beans.vetoable_change_collection.VetoableChangeCollection(component, generic_args=None)[source]
Bases:
object
Class for managing Adding and removing Vetoable Change Listeners.
- Parameters:
component (XPropertySet) –
generic_args (GenericArgs | None) –
- __init__(component, generic_args=None)[source]
Constructor
- Parameters:
component (Any) – UNO Component that implements
com.sun.star.beans.XPropertySet
.generic_args (Dict[str, Any], optional) – Generic Arguments to pass to instances of
PropertyChangeEvents
when they are created. Defaults to None.
- Return type:
None
- add_vetoable_listener(name, events=None)[source]
Add vetoable property listener
- Parameters:
name (str) – Property Name
events (VetoableChangeEvents | None, optional) – Instance to pass to UNO. Defaults to None.
- Raises:
ValueError – If name is empty.
ValueError – If name has already been added for the current listener.
- Returns:
Vetoable Change Events
- Return type:
Note
The returned instance, in most cases, would be used to subscribe to callbacks.
- create_vetoable_change_events(name, **kwargs)[source]
Creates a vetoable change events that can be used to add/remove listeners.
Any generic args passed into the constructor are also passed into the constructor of the
VetoableChangeEvents
.- Parameters:
name (str) – Property Name
kwargs (Any) – Keyword Arguments to pass to the
GenericArgs
constructor.
- Raises:
ValueError – If name is empty
- Returns:
Vetoable Change Events
- Return type:
- remove_vetoable_listener(name, events)[source]
Remove Property Listener
- Parameters:
name (str) – Property Name
events (VetoableChangeEvents) – Property Change Events
- Raises:
ValueError – If name is empty
- Returns:
True
on success; Otherwise,False
.- Return type:
bool