import typing

import android.graphics
import android.graphics.pdf.content
import android.graphics.pdf.models
import android.graphics.pdf.models.selection
import android.os
import java
import java.chaquopy
import java.io
import java.lang
import java.util

class LoadParams(java.lang.Object):
    def getPassword(self) -> str | None: ...

    class Builder(java.lang.Object):
        def __init__(self) -> None: ...
        def build(self) -> LoadParams: ...
        def setPassword(self, password: str | java.lang.String, /) -> LoadParams.Builder: ...

class PdfDocument(java.lang.Object):
    def __init__(self) -> None: ...
    def close(self) -> None: ...
    def finalize(self) -> None: ...
    def finishPage(self, page: PdfDocument.Page, /) -> None: ...
    def getPages(self) -> java.util.List[PdfDocument.PageInfo]: ...
    def startPage(self, pageInfo: PdfDocument.PageInfo, /) -> PdfDocument.Page: ...
    def writeTo(self, out: java.io.OutputStream, /) -> None: ...

    class PageInfo(java.lang.Object):
        def getContentRect(self) -> android.graphics.Rect: ...
        def getPageHeight(self) -> int: ...
        def getPageNumber(self) -> int: ...
        def getPageWidth(self) -> int: ...

        class Builder(java.lang.Object):
            def __init__(self, pageWidth: int | java.jint | java.lang.Integer, pageHeight: int | java.jint | java.lang.Integer, pageNumber: int | java.jint | java.lang.Integer, /) -> None: ...
            def create(self) -> PdfDocument.PageInfo: ...
            def setContentRect(self, contentRect: android.graphics.Rect, /) -> PdfDocument.PageInfo.Builder: ...

    class Page(java.lang.Object):
        def getCanvas(self) -> android.graphics.Canvas: ...
        def getInfo(self) -> PdfDocument.PageInfo: ...

class PdfRenderer(java.lang.AutoCloseable):
    DOCUMENT_LINEARIZED_TYPE_LINEARIZED: typing.ClassVar[int] = ...
    DOCUMENT_LINEARIZED_TYPE_NON_LINEARIZED: typing.ClassVar[int] = ...
    PDF_FORM_TYPE_ACRO_FORM: typing.ClassVar[int] = ...
    PDF_FORM_TYPE_NONE: typing.ClassVar[int] = ...
    PDF_FORM_TYPE_XFA_FOREGROUND: typing.ClassVar[int] = ...
    PDF_FORM_TYPE_XFA_FULL: typing.ClassVar[int] = ...
    @typing.overload
    def __init__(self, fileDescriptor: android.os.ParcelFileDescriptor, /) -> None: ...
    @typing.overload
    def __init__(self, fileDescriptor: android.os.ParcelFileDescriptor, params: LoadParams, /) -> None: ...
    def close(self) -> None: ...
    def finalize(self) -> None: ...
    def getDocumentLinearizationType(self) -> int: ...
    def getPageCount(self) -> int: ...
    def getPdfFormType(self) -> int: ...
    def openPage(self, index: int | java.jint | java.lang.Integer, /) -> PdfRenderer.Page: ...
    def shouldScaleForPrinting(self) -> bool: ...
    def write(self, destination: android.os.ParcelFileDescriptor, removePasswordProtection: bool | java.jboolean | java.lang.Boolean, /) -> None: ...

    class Page(java.lang.AutoCloseable):
        RENDER_MODE_FOR_DISPLAY: typing.ClassVar[int] = ...
        RENDER_MODE_FOR_PRINT: typing.ClassVar[int] = ...
        def applyEdit(self, editRecord: android.graphics.pdf.models.FormEditRecord, /) -> java.util.List[android.graphics.Rect]: ...
        def close(self) -> None: ...
        def finalize(self) -> None: ...
        def getFormWidgetInfoAtIndex(self, widgetIndex: int | java.jint | java.lang.Integer, /) -> android.graphics.pdf.models.FormWidgetInfo: ...
        def getFormWidgetInfoAtPosition(self, x: int | java.jint | java.lang.Integer, y: int | java.jint | java.lang.Integer, /) -> android.graphics.pdf.models.FormWidgetInfo: ...
        @typing.overload
        def getFormWidgetInfos(self) -> java.util.List[android.graphics.pdf.models.FormWidgetInfo]: ...
        @typing.overload
        def getFormWidgetInfos(self, types: java.chaquopy.JavaArrayJInt, /) -> java.util.List[android.graphics.pdf.models.FormWidgetInfo]: ...
        def getGotoLinks(self) -> java.util.List[android.graphics.pdf.content.PdfPageGotoLinkContent]: ...
        def getHeight(self) -> int: ...
        def getImageContents(self) -> java.util.List[android.graphics.pdf.content.PdfPageImageContent]: ...
        def getIndex(self) -> int: ...
        def getLinkContents(self) -> java.util.List[android.graphics.pdf.content.PdfPageLinkContent]: ...
        def getTextContents(self) -> java.util.List[android.graphics.pdf.content.PdfPageTextContent]: ...
        def getWidth(self) -> int: ...
        @typing.overload
        def render(self, destination: android.graphics.Bitmap, destClip: android.graphics.Rect, transform: android.graphics.Matrix, renderMode: int | java.jint | java.lang.Integer, /) -> None: ...
        @typing.overload
        def render(self, destination: android.graphics.Bitmap, destClip: android.graphics.Rect, transform: android.graphics.Matrix, params: RenderParams, /) -> None: ...
        def searchText(self, query: str | java.lang.String, /) -> java.util.List[android.graphics.pdf.models.PageMatchBounds]: ...
        def selectContent(self, start: android.graphics.pdf.models.selection.SelectionBoundary, stop: android.graphics.pdf.models.selection.SelectionBoundary, /) -> android.graphics.pdf.models.selection.PageSelection: ...

class PdfRendererPreV(java.lang.AutoCloseable):
    DOCUMENT_LINEARIZED_TYPE_LINEARIZED: typing.ClassVar[int] = ...
    DOCUMENT_LINEARIZED_TYPE_NON_LINEARIZED: typing.ClassVar[int] = ...
    PDF_FORM_TYPE_ACRO_FORM: typing.ClassVar[int] = ...
    PDF_FORM_TYPE_NONE: typing.ClassVar[int] = ...
    PDF_FORM_TYPE_XFA_FOREGROUND: typing.ClassVar[int] = ...
    PDF_FORM_TYPE_XFA_FULL: typing.ClassVar[int] = ...
    @typing.overload
    def __init__(self, fileDescriptor: android.os.ParcelFileDescriptor, /) -> None: ...
    @typing.overload
    def __init__(self, fileDescriptor: android.os.ParcelFileDescriptor, params: LoadParams, /) -> None: ...
    def close(self) -> None: ...
    def finalize(self) -> None: ...
    def getDocumentLinearizationType(self) -> int: ...
    def getPageCount(self) -> int: ...
    def getPdfFormType(self) -> int: ...
    def openPage(self, index: int | java.jint | java.lang.Integer, /) -> PdfRendererPreV.Page: ...
    def write(self, destination: android.os.ParcelFileDescriptor, removePasswordProtection: bool | java.jboolean | java.lang.Boolean, /) -> None: ...

    class Page(java.lang.AutoCloseable):
        def applyEdit(self, editRecord: android.graphics.pdf.models.FormEditRecord, /) -> java.util.List[android.graphics.Rect]: ...
        def close(self) -> None: ...
        def finalize(self) -> None: ...
        def getFormWidgetInfoAtIndex(self, annotationIndex: int | java.jint | java.lang.Integer, /) -> android.graphics.pdf.models.FormWidgetInfo: ...
        def getFormWidgetInfoAtPosition(self, x: int | java.jint | java.lang.Integer, y: int | java.jint | java.lang.Integer, /) -> android.graphics.pdf.models.FormWidgetInfo: ...
        @typing.overload
        def getFormWidgetInfos(self) -> java.util.List[android.graphics.pdf.models.FormWidgetInfo]: ...
        @typing.overload
        def getFormWidgetInfos(self, types: java.chaquopy.JavaArrayJInt, /) -> java.util.List[android.graphics.pdf.models.FormWidgetInfo]: ...
        def getGotoLinks(self) -> java.util.List[android.graphics.pdf.content.PdfPageGotoLinkContent]: ...
        def getHeight(self) -> int: ...
        def getImageContents(self) -> java.util.List[android.graphics.pdf.content.PdfPageImageContent]: ...
        def getIndex(self) -> int: ...
        def getLinkContents(self) -> java.util.List[android.graphics.pdf.content.PdfPageLinkContent]: ...
        def getTextContents(self) -> java.util.List[android.graphics.pdf.content.PdfPageTextContent]: ...
        def getWidth(self) -> int: ...
        def render(self, destination: android.graphics.Bitmap, destClip: android.graphics.Rect, transform: android.graphics.Matrix, params: RenderParams, /) -> None: ...
        def searchText(self, query: str | java.lang.String, /) -> java.util.List[android.graphics.pdf.models.PageMatchBounds]: ...
        def selectContent(self, start: android.graphics.pdf.models.selection.SelectionBoundary, stop: android.graphics.pdf.models.selection.SelectionBoundary, /) -> android.graphics.pdf.models.selection.PageSelection: ...

class RenderParams(java.lang.Object):
    FLAG_RENDER_HIGHLIGHT_ANNOTATIONS: typing.ClassVar[int] = ...
    FLAG_RENDER_TEXT_ANNOTATIONS: typing.ClassVar[int] = ...
    RENDER_MODE_FOR_DISPLAY: typing.ClassVar[int] = ...
    RENDER_MODE_FOR_PRINT: typing.ClassVar[int] = ...
    def getRenderFlags(self) -> int: ...
    def getRenderMode(self) -> int: ...

    class Builder(java.lang.Object):
        def __init__(self, renderMode: int | java.jint | java.lang.Integer, /) -> None: ...
        def build(self) -> RenderParams: ...
        @typing.overload
        def setRenderFlags(self, renderFlags: int | java.jint | java.lang.Integer, /) -> RenderParams.Builder: ...
        @typing.overload
        def setRenderFlags(self, renderFlags: int | java.jint | java.lang.Integer, mask: int | java.jint | java.lang.Integer, /) -> RenderParams.Builder: ...
