# coding: utf-8
#
# Copyright 2023 :Barry-Thomas-Paul: Moss
#
# Licensed under the Apache License, Version 2.0 (the "License")
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http: // www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#
# Interface Class
# this is a auto generated file generated by Cheetah
# Libre Office Version: 7.4
# Namespace: com.sun.star.awt
from __future__ import annotations
import typing
from abc import abstractmethod
from ..uno.x_interface import XInterface as XInterface_8f010a43
if typing.TYPE_CHECKING:
    from .selection import Selection as Selection_84d609fa
    from .x_text_listener import XTextListener as XTextListener_b04d0b97

class XTextComponent(XInterface_8f010a43):
    """
    gives access to the text of a component and makes it possible to register event listeners.

    See Also:
        `API XTextComponent <https://api.libreoffice.org/docs/idl/ref/interfacecom_1_1sun_1_1star_1_1awt_1_1XTextComponent.html>`_
    """
    __ooo_ns__: str = 'com.sun.star.awt'
    __ooo_full_ns__: str = 'com.sun.star.awt.XTextComponent'
    __ooo_type_name__: str = 'interface'
    __pyunointerface__: str = 'com.sun.star.awt.XTextComponent'

    @abstractmethod
    def addTextListener(self, l: XTextListener_b04d0b97) -> None:
        """
        registers a text event listener.
        """
        ...
    @abstractmethod
    def getMaxTextLen(self) -> int:
        """
        returns the currently set maximum text length.
        """
        ...
    @abstractmethod
    def getSelectedText(self) -> str:
        """
        returns the currently selected text.
        """
        ...
    @abstractmethod
    def getSelection(self) -> Selection_84d609fa:
        """
        returns the current user selection.
        """
        ...
    @abstractmethod
    def getText(self) -> str:
        """
        returns the text of the component.
        """
        ...
    @abstractmethod
    def insertText(self, Sel: Selection_84d609fa, Text: str) -> None:
        """
        inserts text at the specified position.
        """
        ...
    @abstractmethod
    def isEditable(self) -> bool:
        """
        returns if the text is editable by the user.
        """
        ...
    @abstractmethod
    def removeTextListener(self, l: XTextListener_b04d0b97) -> None:
        """
        unregisters a text event listener.
        """
        ...
    @abstractmethod
    def setEditable(self, bEditable: bool) -> None:
        """
        makes the text editable for the user or read-only.
        """
        ...
    @abstractmethod
    def setMaxTextLen(self, nLen: int) -> None:
        """
        sets the maximum text length.
        """
        ...
    @abstractmethod
    def setSelection(self, aSelection: Selection_84d609fa) -> None:
        """
        sets the user selection.
        """
        ...
    @abstractmethod
    def setText(self, aText: str) -> None:
        """
        sets the text of the component.
        """
        ...

__all__ = ['XTextComponent']


