Source code for ooodev.adapter.drawing.control_shape_partial

from __future__ import annotations
from typing import TYPE_CHECKING
import uno

from import XControlShape

from ooodev.adapter.drawing.shape_partial import ShapePartial

    from ooodev.utils.type_var import UnoInterface
    from import XControlModel

[docs]class ControlShapePartial(ShapePartial): """ Partial Class for XControlShape. """ # pylint: disable=unused-argument
[docs] def __init__(self, component: XControlShape, interface: UnoInterface | None = XControlShape) -> None: """ Constructor Args: component (XControlShape): UNO Component that implements ```` interface. interface (UnoInterface, optional): The interface to be validated. Defaults to ``XControlShape``. """ ShapePartial.__init__(self, component, interface) self.__component = component
# region XControlShape
[docs] def get_control(self) -> XControlModel: """ returns the control model of this Shape. """ return self.__component.getControl()
[docs] def set_control(self, control: XControlModel) -> None: """ sets the control model for this Shape. """ self.__component.setControl(control)
# endregion XControlShape