Source code for ooodev.adapter.util.property_replace_partial

from __future__ import annotations
from typing import TYPE_CHECKING, Tuple
import uno
from import XPropertyReplace

from ooodev.adapter.util.replace_descriptor_partial import ReplaceDescriptorPartial

    from ooodev.utils.type_var import UnoInterface
    from import PropertyValue  # struct

[docs]class PropertyReplacePartial(ReplaceDescriptorPartial): """ Partial class for XPropertyReplace. """ # pylint: disable=unused-argument
[docs] def __init__(self, component: XPropertyReplace, interface: UnoInterface | None = XPropertyReplace) -> None: """ Constructor Args: component (XPropertyReplace): UNO Component that implements ```` interface. interface (UnoInterface, optional): The interface to be validated. Defaults to ``XPropertyReplace``. """ ReplaceDescriptorPartial.__init__(self, component, interface=interface) self.__component = component
# region XPropertyReplace
[docs] def get_replace_attributes(self) -> Tuple[PropertyValue, ...]: """ Gets the properties to replace the found occurrences. """ return self.__component.getReplaceAttributes()
[docs] def get_search_attributes(self) -> Tuple[PropertyValue, ...]: """ Get the search attributes. """ return self.__component.getSearchAttributes()
[docs] def set_replace_attributes(self, *attribs: PropertyValue) -> None: """ Sets the properties to replace the found occurrences. Raises: ``UnknownPropertyException`` ``IllegalArgumentException`` """ self.__component.setReplaceAttributes(attribs)
[docs] def set_search_attributes(self, *attribs: PropertyValue) -> None: """ Sets the properties to search for. Raises: ``UnknownPropertyException`` ``IllegalArgumentException`` """ self.__component.setSearchAttributes(attribs)
# endregion XPropertyReplace