Source code for ooodev.adapter.form.database_parameter_broadcaster_partial

from __future__ import annotations
from typing import Any, TYPE_CHECKING

from import XDatabaseParameterBroadcaster

from ooodev.exceptions import ex as mEx
from ooodev.loader import lo as mLo

    from import XDatabaseParameterListener
    from ooodev.utils.type_var import UnoInterface

[docs]class DatabaseParameterBroadcasterPartial: """ Partial Class for ``XDatabaseParameterBroadcaster``. """
[docs] def __init__( self, component: XDatabaseParameterBroadcaster, interface: UnoInterface | None = XDatabaseParameterBroadcaster ) -> None: """ Constructor Args: component (XDatabaseParameterBroadcaster): UNO Component that implements ````. interface (UnoInterface, optional): The interface to be validated. Defaults to ``None``. """ def validate(comp: Any, obj_type: Any) -> None: if obj_type is None: return if not mLo.Lo.is_uno_interfaces(comp, obj_type): raise mEx.MissingInterfaceError(obj_type) validate(component, interface) self.__component = component
# region XDatabaseParameterBroadcaster
[docs] def add_parameter_listener(self, listener: XDatabaseParameterListener) -> None: """ Adds the specified listener, to allow it to fill in necessary parameter values. """ self.__component.addParameterListener(listener)
[docs] def remove_parameter_listener(self, listener: XDatabaseParameterListener) -> None: """ Removes the specified listener. """ self.__component.removeParameterListener(listener)
# endregion XDatabaseParameterBroadcaster