import typing

import android.app
import android.icu.util
import android.os
import android.util
import android.view
import android.view.autofill
import java
import java.lang
import java.util
import java.util.concurrent
import java.util.function

class TranslationCapability(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[TranslationCapability]] = ...
    STATE_AVAILABLE_TO_DOWNLOAD: typing.ClassVar[int] = ...
    STATE_DOWNLOADING: typing.ClassVar[int] = ...
    STATE_NOT_AVAILABLE: typing.ClassVar[int] = ...
    STATE_ON_DEVICE: typing.ClassVar[int] = ...
    def describeContents(self) -> int: ...
    def getSourceSpec(self) -> TranslationSpec: ...
    def getState(self) -> int: ...
    def getSupportedTranslationFlags(self) -> int: ...
    def getTargetSpec(self) -> TranslationSpec: ...
    def isUiTranslationEnabled(self) -> bool: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class TranslationContext(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[TranslationContext]] = ...
    FLAG_DEFINITIONS: typing.ClassVar[int] = ...
    FLAG_LOW_LATENCY: typing.ClassVar[int] = ...
    FLAG_TRANSLITERATION: typing.ClassVar[int] = ...
    def describeContents(self) -> int: ...
    def getSourceSpec(self) -> TranslationSpec: ...
    def getTargetSpec(self) -> TranslationSpec: ...
    def getTranslationFlags(self) -> int: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        def __init__(self, sourceSpec: TranslationSpec, targetSpec: TranslationSpec, /) -> None: ...
        def build(self) -> TranslationContext: ...
        def setTranslationFlags(self, value: int | java.jint | java.lang.Integer, /) -> TranslationContext.Builder: ...

class TranslationManager(java.lang.Object):
    def addOnDeviceTranslationCapabilityUpdateListener(self, executor: java.util.concurrent.Executor, capabilityListener: java.util.function.Consumer[TranslationCapability], /) -> None: ...
    def createOnDeviceTranslator(self, translationContext: TranslationContext, executor: java.util.concurrent.Executor, callback: java.util.function.Consumer[Translator], /) -> None: ...
    def getOnDeviceTranslationCapabilities(self, sourceFormat: int | java.jint | java.lang.Integer, targetFormat: int | java.jint | java.lang.Integer, /) -> java.util.Set[TranslationCapability]: ...
    def getOnDeviceTranslationSettingsActivityIntent(self) -> android.app.PendingIntent | None: ...
    def removeOnDeviceTranslationCapabilityUpdateListener(self, capabilityListener: java.util.function.Consumer[TranslationCapability], /) -> None: ...

class TranslationRequest(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[TranslationRequest]] = ...
    FLAG_DICTIONARY_RESULT: typing.ClassVar[int] = ...
    FLAG_PARTIAL_RESPONSES: typing.ClassVar[int] = ...
    FLAG_TRANSLATION_RESULT: typing.ClassVar[int] = ...
    FLAG_TRANSLITERATION_RESULT: typing.ClassVar[int] = ...
    def describeContents(self) -> int: ...
    def getFlags(self) -> int: ...
    def getTranslationRequestValues(self) -> java.util.List[TranslationRequestValue]: ...
    def getViewTranslationRequests(self) -> java.util.List[ViewTranslationRequest]: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        def __init__(self) -> None: ...
        def build(self) -> TranslationRequest: ...
        def setFlags(self, value: int | java.jint | java.lang.Integer, /) -> TranslationRequest.Builder: ...
        def setTranslationRequestValues(self, value: java.util.List[TranslationRequestValue], /) -> TranslationRequest.Builder: ...
        def setViewTranslationRequests(self, value: java.util.List[ViewTranslationRequest], /) -> TranslationRequest.Builder: ...

class TranslationRequestValue(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[TranslationRequestValue]] = ...
    def describeContents(self) -> int: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    @staticmethod
    def forText(text: java.lang.CharSequence, /) -> TranslationRequestValue: ...
    def getText(self) -> java.lang.CharSequence | None: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class TranslationResponse(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[TranslationResponse]] = ...
    TRANSLATION_STATUS_CONTEXT_UNSUPPORTED: typing.ClassVar[int] = ...
    TRANSLATION_STATUS_SUCCESS: typing.ClassVar[int] = ...
    TRANSLATION_STATUS_UNKNOWN_ERROR: typing.ClassVar[int] = ...
    def describeContents(self) -> int: ...
    def getTranslationResponseValues(self) -> android.util.SparseArray[TranslationResponseValue]: ...
    def getTranslationStatus(self) -> int: ...
    def getViewTranslationResponses(self) -> android.util.SparseArray[ViewTranslationResponse]: ...
    def isFinalResponse(self) -> bool: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        def __init__(self, translationStatus: int | java.jint | java.lang.Integer, /) -> None: ...
        def build(self) -> TranslationResponse: ...
        def setFinalResponse(self, value: bool | java.jboolean | java.lang.Boolean, /) -> TranslationResponse.Builder: ...
        def setTranslationResponseValue(self, index: int | java.jint | java.lang.Integer, value: TranslationResponseValue, /) -> TranslationResponse.Builder: ...
        def setTranslationResponseValues(self, value: android.util.SparseArray[TranslationResponseValue], /) -> TranslationResponse.Builder: ...
        def setViewTranslationResponse(self, index: int | java.jint | java.lang.Integer, response: ViewTranslationResponse, /) -> TranslationResponse.Builder: ...
        def setViewTranslationResponses(self, value: android.util.SparseArray[ViewTranslationResponse], /) -> TranslationResponse.Builder: ...

class TranslationResponseValue(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[TranslationResponseValue]] = ...
    EXTRA_DEFINITIONS: typing.ClassVar[str] = ...
    STATUS_ERROR: typing.ClassVar[int] = ...
    STATUS_SUCCESS: typing.ClassVar[int] = ...
    def describeContents(self) -> int: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    @staticmethod
    def forError() -> TranslationResponseValue: ...
    def getExtras(self) -> android.os.Bundle: ...
    def getStatusCode(self) -> int: ...
    def getText(self) -> java.lang.CharSequence | None: ...
    def getTransliteration(self) -> java.lang.CharSequence | None: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        def __init__(self, statusCode: int | java.jint | java.lang.Integer, /) -> None: ...
        def build(self) -> TranslationResponseValue: ...
        def setExtras(self, value: android.os.Bundle, /) -> TranslationResponseValue.Builder: ...
        def setText(self, value: java.lang.CharSequence, /) -> TranslationResponseValue.Builder: ...
        def setTransliteration(self, value: java.lang.CharSequence, /) -> TranslationResponseValue.Builder: ...

class TranslationSpec(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[TranslationSpec]] = ...
    DATA_FORMAT_TEXT: typing.ClassVar[int] = ...
    def __init__(self, locale: android.icu.util.ULocale, dataFormat: int | java.jint | java.lang.Integer, /) -> None: ...
    def describeContents(self) -> int: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getDataFormat(self) -> int: ...
    def getLocale(self) -> android.icu.util.ULocale: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

class Translator(java.lang.Object):
    def destroy(self) -> None: ...
    def isDestroyed(self) -> bool: ...
    def translate(self, request: TranslationRequest, cancellationSignal: android.os.CancellationSignal, executor: java.util.concurrent.Executor, callback: java.util.function.Consumer[TranslationResponse], /) -> None: ...

class UiTranslationManager(java.lang.Object):
    def registerUiTranslationStateCallback(self, executor: java.util.concurrent.Executor, callback: UiTranslationStateCallback, /) -> None: ...
    def unregisterUiTranslationStateCallback(self, callback: UiTranslationStateCallback, /) -> None: ...

class UiTranslationStateCallback(java.lang.Object):
    @typing.overload
    def onFinished(self) -> None: ...
    @typing.overload
    def onFinished(self, packageName: str | java.lang.String, /) -> None: ...
    @typing.overload
    def onPaused(self) -> None: ...
    @typing.overload
    def onPaused(self, packageName: str | java.lang.String, /) -> None: ...
    @typing.overload
    def onResumed(self, sourceLocale: android.icu.util.ULocale, targetLocale: android.icu.util.ULocale, /) -> None: ...
    @typing.overload
    def onResumed(self, sourceLocale: android.icu.util.ULocale, targetLocale: android.icu.util.ULocale, packageName: str | java.lang.String, /) -> None: ...
    @typing.overload
    def onStarted(self, sourceLocale: android.icu.util.ULocale, targetLocale: android.icu.util.ULocale, /) -> None: ...
    @typing.overload
    def onStarted(self, sourceLocale: android.icu.util.ULocale, targetLocale: android.icu.util.ULocale, packageName: str | java.lang.String, /) -> None: ...

class ViewTranslationCallback(java.lang.Object):
    def onClearTranslation(self, arg1: android.view.View, /) -> bool: ...
    def onHideTranslation(self, arg1: android.view.View, /) -> bool: ...
    def onShowTranslation(self, arg1: android.view.View, /) -> bool: ...

class ViewTranslationRequest(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[ViewTranslationRequest]] = ...
    ID_TEXT: typing.ClassVar[str] = ...
    def describeContents(self) -> int: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getAutofillId(self) -> android.view.autofill.AutofillId: ...
    def getKeys(self) -> java.util.Set[java.lang.String]: ...
    def getValue(self, key: str | java.lang.String, /) -> TranslationRequestValue: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        @typing.overload
        def __init__(self, autofillId: android.view.autofill.AutofillId, /) -> None: ...
        @typing.overload
        def __init__(self, autofillId: android.view.autofill.AutofillId, virtualChildId: int | java.jlong | java.lang.Long, /) -> None: ...
        def build(self) -> ViewTranslationRequest: ...
        def setValue(self, key: str | java.lang.String, value: TranslationRequestValue, /) -> ViewTranslationRequest.Builder: ...

class ViewTranslationResponse(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[ViewTranslationResponse]] = ...
    def describeContents(self) -> int: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getAutofillId(self) -> android.view.autofill.AutofillId: ...
    def getKeys(self) -> java.util.Set[java.lang.String]: ...
    def getValue(self, key: str | java.lang.String, /) -> TranslationResponseValue: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...
    def writeToParcel(self, dest: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...

    class Builder(java.lang.Object):
        def __init__(self, autofillId: android.view.autofill.AutofillId, /) -> None: ...
        def build(self) -> ViewTranslationResponse: ...
        def setValue(self, key: str | java.lang.String, value: TranslationResponseValue, /) -> ViewTranslationResponse.Builder: ...
