Class QiPartial

class ooodev.utils.partial.qi_partial.QiPartial(component, lo_inst=None)[source]
Parameters:
  • component (Any) –

  • lo_inst (LoInst | None) –

__init__(component, lo_inst=None)[source]
Parameters:
  • component (Any) –

  • lo_inst (LoInst | None) –

qi(atype: Type[ooodev.utils.partial.qi_partial.T])[source]
qi(atype: Type[ooodev.utils.partial.qi_partial.T], raise_err: Literal[True]) ooodev.utils.partial.qi_partial.T
qi(atype: Type[ooodev.utils.partial.qi_partial.T], raise_err: Literal[False])
qi(atype, raise_err=False)

Generic method that get an interface instance from an object.

Parameters:
  • atype (T) – Interface type to query obj for. Any Uno class that starts with ‘X’ such as XInterface

  • raise_err (bool, optional) – If True then raises MissingInterfaceError if result is None. Default False

Raises:

MissingInterfaceError – If ‘raise_err’ is ‘True’ and result is None

Returns:

instance of interface if supported; Otherwise, None

Return type:

T | None

Note

When raise_err=True return value will never be None.