import typing

import android.text
import android.text.style
import android.widget
import java
import java.chaquopy
import java.lang
import java.util
import java.util.function
import java.util.regex

class Linkify(java.lang.Object):
    ALL: typing.ClassVar[int] = ...
    EMAIL_ADDRESSES: typing.ClassVar[int] = ...
    MAP_ADDRESSES: typing.ClassVar[int] = ...
    PHONE_NUMBERS: typing.ClassVar[int] = ...
    WEB_URLS: typing.ClassVar[int] = ...
    sPhoneNumberMatchFilter: typing.ClassVar[Linkify.MatchFilter] = ...
    sPhoneNumberTransformFilter: typing.ClassVar[Linkify.TransformFilter] = ...
    sUrlMatchFilter: typing.ClassVar[Linkify.MatchFilter] = ...
    def __init__(self) -> None: ...
    @typing.overload
    @staticmethod
    def addLinks(text: android.text.Spannable, mask: int | java.jint | java.lang.Integer, /) -> bool: ...
    @typing.overload
    @staticmethod
    def addLinks(text: android.widget.TextView, mask: int | java.jint | java.lang.Integer, /) -> bool: ...
    @typing.overload
    @staticmethod
    def addLinks(text: android.text.Spannable, mask: int | java.jint | java.lang.Integer, urlSpanFactory: java.util.function.Function[java.lang.String, android.text.style.URLSpan], /) -> bool: ...
    @typing.overload
    @staticmethod
    def addLinks(text: android.text.Spannable, pattern: java.util.regex.Pattern, scheme: str | java.lang.String, /) -> bool: ...
    @typing.overload
    @staticmethod
    def addLinks(text: android.widget.TextView, pattern: java.util.regex.Pattern, scheme: str | java.lang.String, /) -> None: ...
    @typing.overload
    @staticmethod
    def addLinks(spannable: android.text.Spannable, pattern: java.util.regex.Pattern, scheme: str | java.lang.String, matchFilter: Linkify.MatchFilter, transformFilter: Linkify.TransformFilter, /) -> bool: ...
    @typing.overload
    @staticmethod
    def addLinks(text: android.widget.TextView, pattern: java.util.regex.Pattern, scheme: str | java.lang.String, matchFilter: Linkify.MatchFilter, transformFilter: Linkify.TransformFilter, /) -> None: ...
    @typing.overload
    @staticmethod
    def addLinks(spannable: android.text.Spannable, pattern: java.util.regex.Pattern, defaultScheme: str | java.lang.String, schemes: java.chaquopy.JavaArray[java.lang.String], matchFilter: Linkify.MatchFilter, transformFilter: Linkify.TransformFilter, /) -> bool: ...
    @typing.overload
    @staticmethod
    def addLinks(text: android.widget.TextView, pattern: java.util.regex.Pattern, defaultScheme: str | java.lang.String, schemes: java.chaquopy.JavaArray[java.lang.String], matchFilter: Linkify.MatchFilter, transformFilter: Linkify.TransformFilter, /) -> None: ...
    @typing.overload
    @staticmethod
    def addLinks(spannable: android.text.Spannable, pattern: java.util.regex.Pattern, defaultScheme: str | java.lang.String, schemes: java.chaquopy.JavaArray[java.lang.String], matchFilter: Linkify.MatchFilter, transformFilter: Linkify.TransformFilter, urlSpanFactory: java.util.function.Function[java.lang.String, android.text.style.URLSpan], /) -> bool: ...

    class MatchFilter(java.lang.Object):
        def acceptMatch(self, arg1: java.lang.CharSequence, arg2: int | java.jint | java.lang.Integer, arg3: int | java.jint | java.lang.Integer, /) -> bool: ...

    class TransformFilter(java.lang.Object):
        def transformUrl(self, arg1: java.util.regex.Matcher, arg2: str | java.lang.String, /) -> str: ...

class Rfc822Token(java.lang.Object):
    def __init__(self, name: str | java.lang.String, address: str | java.lang.String, comment: str | java.lang.String, /) -> None: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getAddress(self) -> str | None: ...
    def getComment(self) -> str | None: ...
    def getName(self) -> str | None: ...
    def hashCode(self) -> int: ...
    @staticmethod
    def quoteComment(comment: str | java.lang.String, /) -> str: ...
    @staticmethod
    def quoteName(name: str | java.lang.String, /) -> str: ...
    @staticmethod
    def quoteNameIfNecessary(name: str | java.lang.String, /) -> str: ...
    def setAddress(self, address: str | java.lang.String, /) -> None: ...
    def setComment(self, comment: str | java.lang.String, /) -> None: ...
    def setName(self, name: str | java.lang.String, /) -> None: ...
    def toString(self) -> str: ...

class Rfc822Tokenizer(android.widget.MultiAutoCompleteTextView.Tokenizer):
    def __init__(self) -> None: ...
    def findTokenEnd(self, text: java.lang.CharSequence, cursor: int | java.jint | java.lang.Integer, /) -> int: ...
    def findTokenStart(self, text: java.lang.CharSequence, cursor: int | java.jint | java.lang.Integer, /) -> int: ...
    def terminateToken(self, text: java.lang.CharSequence, /) -> java.lang.CharSequence: ...
    @typing.overload
    @staticmethod
    def tokenize(text: java.lang.CharSequence, /) -> java.chaquopy.JavaArray[Rfc822Token]: ...
    @typing.overload
    @staticmethod
    def tokenize(text: java.lang.CharSequence, out: java.util.Collection[Rfc822Token], /) -> None: ...
