Source code for ooodev.adapter.drawing.draw_view_partial

from __future__ import annotations
from typing import Any, TYPE_CHECKING
import uno
from import XDrawView

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

    from import XDrawPage
    from ooodev.utils.type_var import UnoInterface

[docs]class DrawViewPartial: """Partial class for XDrawView interface.""" # Does no implement any methods.
[docs] def __init__(self, component: XDrawView, interface: UnoInterface | None = XDrawView) -> None: """ Constructor Args: component (XDrawView): UNO Component that implements ```` interface. interface (UnoInterface, optional): The interface to be validated. Defaults to ``XDrawView``. """ 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 XDrawView
[docs] def get_current_page(self) -> XDrawPage: """ Gets the current page. """ return self.__component.getCurrentPage()
[docs] def set_current_page(self, page: XDrawPage) -> None: """ Sets the current page. """ self.__component.setCurrentPage(page)
# endregion XDrawView