import typing

import android.graphics
import android.graphics.fonts
import android.os
import java
import java.chaquopy
import java.lang

class LineBreakConfig(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[LineBreakConfig]] = ...
    HYPHENATION_DISABLED: typing.ClassVar[int] = ...
    HYPHENATION_ENABLED: typing.ClassVar[int] = ...
    HYPHENATION_UNSPECIFIED: typing.ClassVar[int] = ...
    LINE_BREAK_STYLE_AUTO: typing.ClassVar[int] = ...
    LINE_BREAK_STYLE_LOOSE: typing.ClassVar[int] = ...
    LINE_BREAK_STYLE_NONE: typing.ClassVar[int] = ...
    LINE_BREAK_STYLE_NORMAL: typing.ClassVar[int] = ...
    LINE_BREAK_STYLE_NO_BREAK: typing.ClassVar[int] = ...
    LINE_BREAK_STYLE_STRICT: typing.ClassVar[int] = ...
    LINE_BREAK_STYLE_UNSPECIFIED: typing.ClassVar[int] = ...
    LINE_BREAK_WORD_STYLE_AUTO: typing.ClassVar[int] = ...
    LINE_BREAK_WORD_STYLE_NONE: typing.ClassVar[int] = ...
    LINE_BREAK_WORD_STYLE_PHRASE: typing.ClassVar[int] = ...
    LINE_BREAK_WORD_STYLE_UNSPECIFIED: typing.ClassVar[int] = ...
    def describeContents(self) -> int: ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getHyphenation(self) -> int: ...
    def getLineBreakStyle(self) -> int: ...
    def getLineBreakWordStyle(self) -> int: ...
    def hashCode(self) -> int: ...
    def merge(self, config: LineBreakConfig, /) -> LineBreakConfig: ...
    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) -> LineBreakConfig: ...
        def merge(self, config: LineBreakConfig, /) -> LineBreakConfig.Builder: ...
        def setHyphenation(self, hyphenation: int | java.jint | java.lang.Integer, /) -> LineBreakConfig.Builder: ...
        def setLineBreakStyle(self, lineBreakStyle: int | java.jint | java.lang.Integer, /) -> LineBreakConfig.Builder: ...
        def setLineBreakWordStyle(self, lineBreakWordStyle: int | java.jint | java.lang.Integer, /) -> LineBreakConfig.Builder: ...

class LineBreaker(java.lang.Object):
    BREAK_STRATEGY_BALANCED: typing.ClassVar[int] = ...
    BREAK_STRATEGY_HIGH_QUALITY: typing.ClassVar[int] = ...
    BREAK_STRATEGY_SIMPLE: typing.ClassVar[int] = ...
    HYPHENATION_FREQUENCY_FULL: typing.ClassVar[int] = ...
    HYPHENATION_FREQUENCY_NONE: typing.ClassVar[int] = ...
    HYPHENATION_FREQUENCY_NORMAL: typing.ClassVar[int] = ...
    JUSTIFICATION_MODE_INTER_CHARACTER: typing.ClassVar[int] = ...
    JUSTIFICATION_MODE_INTER_WORD: typing.ClassVar[int] = ...
    JUSTIFICATION_MODE_NONE: typing.ClassVar[int] = ...
    def computeLineBreaks(self, measuredPara: MeasuredText, constraints: LineBreaker.ParagraphConstraints, lineNumber: int | java.jint | java.lang.Integer, /) -> LineBreaker.Result: ...

    class Result(java.lang.Object):
        def getEndLineHyphenEdit(self, lineIndex: int | java.jint | java.lang.Integer, /) -> int: ...
        def getLineAscent(self, lineIndex: int | java.jint | java.lang.Integer, /) -> float: ...
        def getLineBreakOffset(self, lineIndex: int | java.jint | java.lang.Integer, /) -> int: ...
        def getLineCount(self) -> int: ...
        def getLineDescent(self, lineIndex: int | java.jint | java.lang.Integer, /) -> float: ...
        def getLineWidth(self, lineIndex: int | java.jint | java.lang.Integer, /) -> float: ...
        def getStartLineHyphenEdit(self, lineIndex: int | java.jint | java.lang.Integer, /) -> int: ...
        def hasLineTab(self, lineIndex: int | java.jint | java.lang.Integer, /) -> bool: ...

    class ParagraphConstraints(java.lang.Object):
        def __init__(self) -> None: ...
        def getDefaultTabStop(self) -> float: ...
        def getFirstWidth(self) -> float: ...
        def getFirstWidthLineCount(self) -> int: ...
        def getTabStops(self) -> java.chaquopy.JavaArrayJFloat: ...
        def getWidth(self) -> float: ...
        def setIndent(self, firstWidth: float | java.jfloat | java.lang.Float, firstWidthLineCount: int | java.jint | java.lang.Integer, /) -> None: ...
        def setTabStops(self, tabStops: java.chaquopy.JavaArrayJFloat, defaultTabStop: float | java.jfloat | java.lang.Float, /) -> None: ...
        def setWidth(self, width: float | java.jfloat | java.lang.Float, /) -> None: ...

    class Builder(java.lang.Object):
        def __init__(self) -> None: ...
        def build(self) -> LineBreaker: ...
        def setBreakStrategy(self, breakStrategy: int | java.jint | java.lang.Integer, /) -> LineBreaker.Builder: ...
        def setHyphenationFrequency(self, hyphenationFrequency: int | java.jint | java.lang.Integer, /) -> LineBreaker.Builder: ...
        def setIndents(self, indents: java.chaquopy.JavaArrayJInt, /) -> LineBreaker.Builder: ...
        def setJustificationMode(self, justificationMode: int | java.jint | java.lang.Integer, /) -> LineBreaker.Builder: ...
        def setUseBoundsForWidth(self, useBoundsForWidth: bool | java.jboolean | java.lang.Boolean, /) -> LineBreaker.Builder: ...

class MeasuredText(java.lang.Object):
    def getBounds(self, start: int | java.jint | java.lang.Integer, end: int | java.jint | java.lang.Integer, rect: android.graphics.Rect, /) -> None: ...
    def getCharWidthAt(self, offset: int | java.jint | java.lang.Integer, /) -> float: ...
    def getFontMetricsInt(self, start: int | java.jint | java.lang.Integer, end: int | java.jint | java.lang.Integer, outMetrics: android.graphics.Paint.FontMetricsInt, /) -> None: ...
    def getWidth(self, start: int | java.jint | java.lang.Integer, end: int | java.jint | java.lang.Integer, /) -> float: ...

    class Builder(java.lang.Object):
        HYPHENATION_MODE_FAST: typing.ClassVar[int] = ...
        HYPHENATION_MODE_NONE: typing.ClassVar[int] = ...
        HYPHENATION_MODE_NORMAL: typing.ClassVar[int] = ...
        @typing.overload
        def __init__(self, text: MeasuredText, /) -> None: ...
        @typing.overload
        def __init__(self, text: java.chaquopy.JavaArrayJChar, /) -> None: ...
        def appendReplacementRun(self, paint: android.graphics.Paint, length: int | java.jint | java.lang.Integer, width: float | java.jfloat | java.lang.Float, /) -> MeasuredText.Builder: ...
        @typing.overload
        def appendStyleRun(self, paint: android.graphics.Paint, length: int | java.jint | java.lang.Integer, isRtl: bool | java.jboolean | java.lang.Boolean, /) -> MeasuredText.Builder: ...
        @typing.overload
        def appendStyleRun(self, paint: android.graphics.Paint, lineBreakConfig: LineBreakConfig, length: int | java.jint | java.lang.Integer, isRtl: bool | java.jboolean | java.lang.Boolean, /) -> MeasuredText.Builder: ...
        def build(self) -> MeasuredText: ...
        @typing.overload
        def setComputeHyphenation(self, mode: int | java.jint | java.lang.Integer, /) -> MeasuredText.Builder: ...
        @typing.overload
        def setComputeHyphenation(self, computeHyphenation: bool | java.jboolean | java.lang.Boolean, /) -> MeasuredText.Builder: ...
        def setComputeLayout(self, computeLayout: bool | java.jboolean | java.lang.Boolean, /) -> MeasuredText.Builder: ...

class PositionedGlyphs(java.lang.Object):
    NO_OVERRIDE: typing.ClassVar[float] = ...
    def equals(self, o: java.lang.Object | int | bool | float | str, /) -> bool: ...
    def getAdvance(self) -> float: ...
    def getAscent(self) -> float: ...
    def getDescent(self) -> float: ...
    def getFakeBold(self, index: int | java.jint | java.lang.Integer, /) -> bool: ...
    def getFakeItalic(self, index: int | java.jint | java.lang.Integer, /) -> bool: ...
    def getFont(self, index: int | java.jint | java.lang.Integer, /) -> android.graphics.fonts.Font: ...
    def getGlyphId(self, index: int | java.jint | java.lang.Integer, /) -> int: ...
    def getGlyphX(self, index: int | java.jint | java.lang.Integer, /) -> float: ...
    def getGlyphY(self, index: int | java.jint | java.lang.Integer, /) -> float: ...
    def getItalicOverride(self, index: int | java.jint | java.lang.Integer, /) -> float: ...
    def getOffsetX(self) -> float: ...
    def getOffsetY(self) -> float: ...
    def getWeightOverride(self, index: int | java.jint | java.lang.Integer, /) -> float: ...
    def glyphCount(self) -> int: ...
    def hashCode(self) -> int: ...
    def toString(self) -> str: ...

class TextRunShaper(java.lang.Object):
    @typing.overload
    @staticmethod
    def shapeTextRun(text: java.lang.CharSequence, start: int | java.jint | java.lang.Integer, count: int | java.jint | java.lang.Integer, contextStart: int | java.jint | java.lang.Integer, contextCount: int | java.jint | java.lang.Integer, xOffset: float | java.jfloat | java.lang.Float, yOffset: float | java.jfloat | java.lang.Float, isRtl: bool | java.jboolean | java.lang.Boolean, paint: android.graphics.Paint, /) -> PositionedGlyphs: ...
    @typing.overload
    @staticmethod
    def shapeTextRun(text: java.chaquopy.JavaArrayJChar, start: int | java.jint | java.lang.Integer, count: int | java.jint | java.lang.Integer, contextStart: int | java.jint | java.lang.Integer, contextCount: int | java.jint | java.lang.Integer, xOffset: float | java.jfloat | java.lang.Float, yOffset: float | java.jfloat | java.lang.Float, isRtl: bool | java.jboolean | java.lang.Boolean, paint: android.graphics.Paint, /) -> PositionedGlyphs: ...
