Source code for ooodev.adapter.awt.data_transfer_provider_access_partial

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

from import XDataTransferProviderAccess

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

    from import XClipboard
    from import XDragGestureRecognizer
    from import XDragSource
    from import XDropTarget
    from import XWindow
    from ooodev.utils.type_var import UnoInterface

[docs]class DataTransferProviderAccessPartial: """ Partial class for XDataTransferProviderAccess. """
[docs] def __init__( self, component: XDataTransferProviderAccess, interface: UnoInterface | None = XDataTransferProviderAccess ) -> None: """ Constructor Args: component (XDataTransferProviderAccess): UNO Component that implements ```` interface. interface (UnoInterface, optional): The interface to be validated. Defaults to ``XDataTransferProviderAccess``. """ 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 XDataTransferProviderAccess
[docs] def get_clipboard(self, clipboard_name: str) -> XClipboard: """ Gets the specified clipboard. """ return self.__component.getClipboard(clipboard_name)
[docs] def get_drag_gesture_recognizer(self, window: XWindow) -> XDragGestureRecognizer: """ Gets the drag gesture recognizer of the specified window. """ return self.__component.getDragGestureRecognizer(window)
[docs] def get_drag_source(self, window: XWindow) -> XDragSource: """ Gets the drag source of the specified window. """ return self.__component.getDragSource(window)
[docs] def get_drop_target(self, window: XWindow) -> XDropTarget: """ Gets the drop target of the specified window. """ return self.__component.getDropTarget(window)
# endregion XDataTransferProviderAccess