import typing

import android.content
import android.graphics.drawable
import java
import java.chaquopy
import java.io
import java.lang
import java.util
import java.util.concurrent
import org.osmdroid.tileprovider
import org.osmdroid.tileprovider.constants
import org.osmdroid.tileprovider.tilesource

class ArchiveFileFactory(java.lang.Object):
    def __init__(self) -> None: ...
    @staticmethod
    def getArchiveFile(pFile: java.io.File, /) -> IArchiveFile: ...

class ConfigurablePriorityThreadFactory(java.util.concurrent.ThreadFactory):
    def __init__(self, pPriority: int | java.jint | java.lang.Integer, pName: str | java.lang.String, /) -> None: ...
    def newThread(self, pRunnable: java.lang.Runnable, /) -> java.lang.Thread: ...

class DatabaseFileArchive(IArchiveFile):
    def close(self) -> None: ...
    @staticmethod
    def getDatabaseFileArchive(pFile: java.io.File, /) -> DatabaseFileArchive: ...
    def getInputStream(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pTile: org.osmdroid.tileprovider.MapTile, /) -> java.io.InputStream: ...
    def toString(self) -> str: ...

class GEMFFileArchive(IArchiveFile):
    def close(self) -> None: ...
    @staticmethod
    def getGEMFFileArchive(pFile: java.io.File, /) -> GEMFFileArchive: ...
    def getInputStream(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pTile: org.osmdroid.tileprovider.MapTile, /) -> java.io.InputStream: ...
    def toString(self) -> str: ...

class IArchiveFile(java.lang.Object):
    def close(self) -> None: ...
    def getInputStream(self, arg1: org.osmdroid.tileprovider.tilesource.ITileSource, arg2: org.osmdroid.tileprovider.MapTile, /) -> java.io.InputStream: ...

class IFilesystemCache(java.lang.Object):
    def saveFile(self, arg1: org.osmdroid.tileprovider.tilesource.ITileSource, arg2: org.osmdroid.tileprovider.MapTile, arg3: java.io.InputStream, /) -> bool: ...

class INetworkAvailablityCheck(java.lang.Object):
    def getCellularDataNetworkAvailable(self) -> bool: ...
    def getNetworkAvailable(self) -> bool: ...
    def getRouteToPathExists(self, arg1: int | java.jint | java.lang.Integer, /) -> bool: ...
    def getWiFiNetworkAvailable(self) -> bool: ...

class MBTilesFileArchive(IArchiveFile):
    COL_TILES_TILE_COLUMN: typing.ClassVar[str] = ...
    COL_TILES_TILE_DATA: typing.ClassVar[str] = ...
    COL_TILES_TILE_ROW: typing.ClassVar[str] = ...
    COL_TILES_ZOOM_LEVEL: typing.ClassVar[str] = ...
    TABLE_TILES: typing.ClassVar[str] = ...
    def close(self) -> None: ...
    @staticmethod
    def getDatabaseFileArchive(pFile: java.io.File, /) -> MBTilesFileArchive: ...
    def getInputStream(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pTile: org.osmdroid.tileprovider.MapTile, /) -> java.io.InputStream: ...
    def toString(self) -> str: ...

class MapTileDownloader(MapTileModuleProviderBase):
    @typing.overload
    def __init__(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, /) -> None: ...
    @typing.overload
    def __init__(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pFilesystemCache: IFilesystemCache, /) -> None: ...
    @typing.overload
    def __init__(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pFilesystemCache: IFilesystemCache, pNetworkAvailablityCheck: INetworkAvailablityCheck, /) -> None: ...
    @typing.overload
    def __init__(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pFilesystemCache: IFilesystemCache, pNetworkAvailablityCheck: INetworkAvailablityCheck, pThreadPoolSize: int | java.jint | java.lang.Integer, pPendingQueueSize: int | java.jint | java.lang.Integer, /) -> None: ...
    def getMaximumZoomLevel(self) -> int: ...
    def getMinimumZoomLevel(self) -> int: ...
    def getName(self) -> str: ...
    def getThreadGroupName(self) -> str: ...
    def getTileLoader(self) -> java.lang.Runnable: ...
    def getTileSource(self) -> org.osmdroid.tileprovider.tilesource.ITileSource: ...
    def getUsesDataConnection(self) -> bool: ...
    def setTileSource(self, tileSource: org.osmdroid.tileprovider.tilesource.ITileSource, /) -> None: ...

    class TileLoader(MapTileModuleProviderBase.TileLoader):
        def __init__(self, arg1: MapTileDownloader, /) -> None: ...
        def loadTile(self, aState: org.osmdroid.tileprovider.MapTileRequestState, /) -> android.graphics.drawable.Drawable: ...
        def tileLoaded(self, pState: org.osmdroid.tileprovider.MapTileRequestState, pDrawable: android.graphics.drawable.Drawable, /) -> None: ...

class MapTileFileArchiveProvider(MapTileFileStorageProviderBase):
    @typing.overload
    def __init__(self, pRegisterReceiver: org.osmdroid.tileprovider.IRegisterReceiver, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, /) -> None: ...
    @typing.overload
    def __init__(self, pRegisterReceiver: org.osmdroid.tileprovider.IRegisterReceiver, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pArchives: java.chaquopy.JavaArray[IArchiveFile], /) -> None: ...
    def detach(self) -> None: ...
    def getMaximumZoomLevel(self) -> int: ...
    def getMinimumZoomLevel(self) -> int: ...
    def getName(self) -> str: ...
    def getThreadGroupName(self) -> str: ...
    def getTileLoader(self) -> java.lang.Runnable: ...
    def getUsesDataConnection(self) -> bool: ...
    def onMediaMounted(self) -> None: ...
    def onMediaUnmounted(self) -> None: ...
    def setTileSource(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, /) -> None: ...

    class TileLoader(MapTileModuleProviderBase.TileLoader):
        def __init__(self, arg1: MapTileFileArchiveProvider, /) -> None: ...
        def loadTile(self, pState: org.osmdroid.tileprovider.MapTileRequestState, /) -> android.graphics.drawable.Drawable: ...

class MapTileFileStorageProviderBase(MapTileModuleProviderBase):
    def __init__(self, pRegisterReceiver: org.osmdroid.tileprovider.IRegisterReceiver, pThreadPoolSize: int | java.jint | java.lang.Integer, pPendingQueueSize: int | java.jint | java.lang.Integer, /) -> None: ...
    def detach(self) -> None: ...
    def getSdCardAvailable(self) -> bool: ...
    def onMediaMounted(self) -> None: ...
    def onMediaUnmounted(self) -> None: ...

class MapTileFilesystemProvider(MapTileFileStorageProviderBase):
    @typing.overload
    def __init__(self, pRegisterReceiver: org.osmdroid.tileprovider.IRegisterReceiver, /) -> None: ...
    @typing.overload
    def __init__(self, pRegisterReceiver: org.osmdroid.tileprovider.IRegisterReceiver, aTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, /) -> None: ...
    @typing.overload
    def __init__(self, pRegisterReceiver: org.osmdroid.tileprovider.IRegisterReceiver, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pMaximumCachedFileAge: int | java.jlong | java.lang.Long, /) -> None: ...
    @typing.overload
    def __init__(self, pRegisterReceiver: org.osmdroid.tileprovider.IRegisterReceiver, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pMaximumCachedFileAge: int | java.jlong | java.lang.Long, pThreadPoolSize: int | java.jint | java.lang.Integer, pPendingQueueSize: int | java.jint | java.lang.Integer, /) -> None: ...
    def getMaximumZoomLevel(self) -> int: ...
    def getMinimumZoomLevel(self) -> int: ...
    def getName(self) -> str: ...
    def getThreadGroupName(self) -> str: ...
    def getTileLoader(self) -> java.lang.Runnable: ...
    def getUsesDataConnection(self) -> bool: ...
    def setTileSource(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, /) -> None: ...

    class TileLoader(MapTileModuleProviderBase.TileLoader):
        def __init__(self, arg1: MapTileFilesystemProvider, /) -> None: ...
        def loadTile(self, pState: org.osmdroid.tileprovider.MapTileRequestState, /) -> android.graphics.drawable.Drawable: ...

class MapTileModuleProviderBase(org.osmdroid.tileprovider.constants.OpenStreetMapTileProviderConstants):
    mPending: java.util.LinkedHashMap[org.osmdroid.tileprovider.MapTile, org.osmdroid.tileprovider.MapTileRequestState] = ...
    mQueueLockObject: java.lang.Object = ...
    mWorking: java.util.HashMap[org.osmdroid.tileprovider.MapTile, org.osmdroid.tileprovider.MapTileRequestState] = ...
    def __init__(self, pThreadPoolSize: int | java.jint | java.lang.Integer, pPendingQueueSize: int | java.jint | java.lang.Integer, /) -> None: ...
    def detach(self) -> None: ...
    def getMaximumZoomLevel(self) -> int: ...
    def getMinimumZoomLevel(self) -> int: ...
    def getName(self) -> str: ...
    def getThreadGroupName(self) -> str: ...
    def getTileLoader(self) -> java.lang.Runnable: ...
    def getUsesDataConnection(self) -> bool: ...
    def loadMapTileAsync(self, pState: org.osmdroid.tileprovider.MapTileRequestState, /) -> None: ...
    def setTileSource(self, arg1: org.osmdroid.tileprovider.tilesource.ITileSource, /) -> None: ...

    class CantContinueException(java.lang.Exception):
        @typing.overload
        def __init__(self, arg1: MapTileModuleProviderBase, pDetailMessage: str | java.lang.String, /) -> None: ...
        @typing.overload
        def __init__(self, arg1: MapTileModuleProviderBase, pThrowable: java.lang.Throwable, /) -> None: ...

    class TileLoader(java.lang.Runnable):
        def __init__(self, arg1: MapTileModuleProviderBase, /) -> None: ...
        def loadTile(self, arg1: org.osmdroid.tileprovider.MapTileRequestState, /) -> android.graphics.drawable.Drawable: ...
        def nextTile(self) -> org.osmdroid.tileprovider.MapTileRequestState: ...
        def onTileLoaderInit(self) -> None: ...
        def onTileLoaderShutdown(self) -> None: ...
        def run(self) -> None: ...
        def tileLoaded(self, pState: org.osmdroid.tileprovider.MapTileRequestState, pDrawable: android.graphics.drawable.Drawable, /) -> None: ...
        def tileLoadedExpired(self, pState: org.osmdroid.tileprovider.MapTileRequestState, pDrawable: android.graphics.drawable.Drawable, /) -> None: ...
        def tileLoadedFailed(self, pState: org.osmdroid.tileprovider.MapTileRequestState, /) -> None: ...

class NetworkAvailabliltyCheck(INetworkAvailablityCheck):
    def __init__(self, aContext: android.content.Context, /) -> None: ...
    def getCellularDataNetworkAvailable(self) -> bool: ...
    def getNetworkAvailable(self) -> bool: ...
    def getRouteToPathExists(self, hostAddress: int | java.jint | java.lang.Integer, /) -> bool: ...
    def getWiFiNetworkAvailable(self) -> bool: ...

class TileWriter(IFilesystemCache, org.osmdroid.tileprovider.constants.OpenStreetMapTileProviderConstants):
    def __init__(self) -> None: ...
    @staticmethod
    def getUsedCacheSpace() -> int: ...
    def saveFile(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pTile: org.osmdroid.tileprovider.MapTile, pStream: java.io.InputStream, /) -> bool: ...

class ZipFileArchive(IArchiveFile):
    def close(self) -> None: ...
    def getInputStream(self, pTileSource: org.osmdroid.tileprovider.tilesource.ITileSource, pTile: org.osmdroid.tileprovider.MapTile, /) -> java.io.InputStream: ...
    @staticmethod
    def getZipFileArchive(pFile: java.io.File, /) -> ZipFileArchive: ...
    def toString(self) -> str: ...
