import typing

import android.app
import android.content
import android.content.pm
import android.graphics
import android.graphics.drawable
import android.os
import android.util
import android.view
import android.widget
import java
import java.chaquopy
import java.lang
import java.util
import java.util.concurrent

class AppWidgetHost(java.lang.Object):
    def __init__(self, context: android.content.Context, hostId: int | java.jint | java.lang.Integer, /) -> None: ...
    def allocateAppWidgetId(self) -> int: ...
    def clearViews(self) -> None: ...
    def createView(self, context: android.content.Context, appWidgetId: int | java.jint | java.lang.Integer, appWidget: AppWidgetProviderInfo, /) -> AppWidgetHostView: ...
    @staticmethod
    def deleteAllHosts() -> None: ...
    def deleteAppWidgetId(self, appWidgetId: int | java.jint | java.lang.Integer, /) -> None: ...
    def deleteHost(self) -> None: ...
    def getAppWidgetIds(self) -> java.chaquopy.JavaArrayJInt: ...
    def onAppWidgetRemoved(self, appWidgetId: int | java.jint | java.lang.Integer, /) -> None: ...
    def onCreateView(self, context: android.content.Context, appWidgetId: int | java.jint | java.lang.Integer, appWidget: AppWidgetProviderInfo, /) -> AppWidgetHostView: ...
    def onProviderChanged(self, appWidgetId: int | java.jint | java.lang.Integer, appWidget: AppWidgetProviderInfo, /) -> None: ...
    def onProvidersChanged(self) -> None: ...
    def startAppWidgetConfigureActivityForResult(self, activity: android.app.Activity, appWidgetId: int | java.jint | java.lang.Integer, intentFlags: int | java.jint | java.lang.Integer, requestCode: int | java.jint | java.lang.Integer, options: android.os.Bundle, /) -> None: ...
    def startListening(self) -> None: ...
    def stopListening(self) -> None: ...

class AppWidgetHostView(android.widget.FrameLayout):
    @typing.overload
    def __init__(self, context: android.content.Context, /) -> None: ...
    @typing.overload
    def __init__(self, context: android.content.Context, animationIn: int | java.jint | java.lang.Integer, animationOut: int | java.jint | java.lang.Integer, /) -> None: ...
    def dispatchDraw(self, canvas: android.graphics.Canvas, /) -> None: ...
    def dispatchRestoreInstanceState(self, container: android.util.SparseArray[android.os.Parcelable], /) -> None: ...
    def dispatchSaveInstanceState(self, container: android.util.SparseArray[android.os.Parcelable], /) -> None: ...
    def generateLayoutParams(self, attrs: android.util.AttributeSet, /) -> android.widget.FrameLayout.LayoutParams: ...
    def getAppWidgetId(self) -> int: ...
    def getAppWidgetInfo(self) -> AppWidgetProviderInfo: ...
    @staticmethod
    def getDefaultPaddingForWidget(context: android.content.Context, component: android.content.ComponentName, padding: android.graphics.Rect, /) -> android.graphics.Rect: ...
    def getDefaultView(self) -> android.view.View: ...
    def getErrorView(self) -> android.view.View: ...
    def onLayout(self, changed: bool | java.jboolean | java.lang.Boolean, left: int | java.jint | java.lang.Integer, top: int | java.jint | java.lang.Integer, right: int | java.jint | java.lang.Integer, bottom: int | java.jint | java.lang.Integer, /) -> None: ...
    def onWindowFocusChanged(self, hasWindowFocus: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def prepareView(self, view: android.view.View, /) -> None: ...
    def resetColorResources(self) -> None: ...
    def setAppWidget(self, appWidgetId: int | java.jint | java.lang.Integer, info: AppWidgetProviderInfo, /) -> None: ...
    def setColorResources(self, colorMapping: android.util.SparseIntArray, /) -> None: ...
    def setExecutor(self, executor: java.util.concurrent.Executor, /) -> None: ...
    def setOnLightBackground(self, onLightBackground: bool | java.jboolean | java.lang.Boolean, /) -> None: ...
    def updateAppWidget(self, remoteViews: android.widget.RemoteViews, /) -> None: ...
    def updateAppWidgetOptions(self, options: android.os.Bundle, /) -> None: ...
    @typing.overload
    def updateAppWidgetSize(self, newOptions: android.os.Bundle, sizes: java.util.List[android.util.SizeF], /) -> None: ...
    @typing.overload
    def updateAppWidgetSize(self, newOptions: android.os.Bundle, minWidth: int | java.jint | java.lang.Integer, minHeight: int | java.jint | java.lang.Integer, maxWidth: int | java.jint | java.lang.Integer, maxHeight: int | java.jint | java.lang.Integer, /) -> None: ...

class AppWidgetManager(java.lang.Object):
    ACTION_APPWIDGET_BIND: typing.ClassVar[str] = ...
    ACTION_APPWIDGET_CONFIGURE: typing.ClassVar[str] = ...
    ACTION_APPWIDGET_DELETED: typing.ClassVar[str] = ...
    ACTION_APPWIDGET_DISABLED: typing.ClassVar[str] = ...
    ACTION_APPWIDGET_ENABLED: typing.ClassVar[str] = ...
    ACTION_APPWIDGET_HOST_RESTORED: typing.ClassVar[str] = ...
    ACTION_APPWIDGET_OPTIONS_CHANGED: typing.ClassVar[str] = ...
    ACTION_APPWIDGET_PICK: typing.ClassVar[str] = ...
    ACTION_APPWIDGET_RESTORED: typing.ClassVar[str] = ...
    ACTION_APPWIDGET_UPDATE: typing.ClassVar[str] = ...
    EXTRA_APPWIDGET_ID: typing.ClassVar[str] = ...
    EXTRA_APPWIDGET_IDS: typing.ClassVar[str] = ...
    EXTRA_APPWIDGET_OLD_IDS: typing.ClassVar[str] = ...
    EXTRA_APPWIDGET_OPTIONS: typing.ClassVar[str] = ...
    EXTRA_APPWIDGET_PREVIEW: typing.ClassVar[str] = ...
    EXTRA_APPWIDGET_PROVIDER: typing.ClassVar[str] = ...
    EXTRA_APPWIDGET_PROVIDER_PROFILE: typing.ClassVar[str] = ...
    EXTRA_CUSTOM_EXTRAS: typing.ClassVar[str] = ...
    EXTRA_CUSTOM_INFO: typing.ClassVar[str] = ...
    EXTRA_HOST_ID: typing.ClassVar[str] = ...
    INVALID_APPWIDGET_ID: typing.ClassVar[int] = ...
    META_DATA_APPWIDGET_PROVIDER: typing.ClassVar[str] = ...
    OPTION_APPWIDGET_HOST_CATEGORY: typing.ClassVar[str] = ...
    OPTION_APPWIDGET_MAX_HEIGHT: typing.ClassVar[str] = ...
    OPTION_APPWIDGET_MAX_WIDTH: typing.ClassVar[str] = ...
    OPTION_APPWIDGET_MIN_HEIGHT: typing.ClassVar[str] = ...
    OPTION_APPWIDGET_MIN_WIDTH: typing.ClassVar[str] = ...
    OPTION_APPWIDGET_RESTORE_COMPLETED: typing.ClassVar[str] = ...
    OPTION_APPWIDGET_SIZES: typing.ClassVar[str] = ...
    @typing.overload
    def bindAppWidgetIdIfAllowed(self, appWidgetId: int | java.jint | java.lang.Integer, provider: android.content.ComponentName, /) -> bool: ...
    @typing.overload
    def bindAppWidgetIdIfAllowed(self, appWidgetId: int | java.jint | java.lang.Integer, provider: android.content.ComponentName, options: android.os.Bundle, /) -> bool: ...
    @typing.overload
    def bindAppWidgetIdIfAllowed(self, appWidgetId: int | java.jint | java.lang.Integer, user: android.os.UserHandle, provider: android.content.ComponentName, options: android.os.Bundle, /) -> bool: ...
    def getAppWidgetIds(self, provider: android.content.ComponentName, /) -> java.chaquopy.JavaArrayJInt: ...
    def getAppWidgetInfo(self, appWidgetId: int | java.jint | java.lang.Integer, /) -> AppWidgetProviderInfo | None: ...
    def getAppWidgetOptions(self, appWidgetId: int | java.jint | java.lang.Integer, /) -> android.os.Bundle: ...
    def getInstalledProviders(self) -> java.util.List[AppWidgetProviderInfo]: ...
    def getInstalledProvidersForPackage(self, packageName: str | java.lang.String, profile: android.os.UserHandle, /) -> java.util.List[AppWidgetProviderInfo]: ...
    def getInstalledProvidersForProfile(self, profile: android.os.UserHandle, /) -> java.util.List[AppWidgetProviderInfo]: ...
    @staticmethod
    def getInstance(context: android.content.Context, /) -> AppWidgetManager: ...
    def getWidgetPreview(self, provider: android.content.ComponentName, profile: android.os.UserHandle, widgetCategory: int | java.jint | java.lang.Integer, /) -> android.widget.RemoteViews | None: ...
    def isRequestPinAppWidgetSupported(self) -> bool: ...
    @typing.overload
    def notifyAppWidgetViewDataChanged(self, appWidgetId: int | java.jint | java.lang.Integer, viewId: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def notifyAppWidgetViewDataChanged(self, appWidgetIds: java.chaquopy.JavaArrayJInt, viewId: int | java.jint | java.lang.Integer, /) -> None: ...
    @typing.overload
    def partiallyUpdateAppWidget(self, appWidgetId: int | java.jint | java.lang.Integer, views: android.widget.RemoteViews, /) -> None: ...
    @typing.overload
    def partiallyUpdateAppWidget(self, appWidgetIds: java.chaquopy.JavaArrayJInt, views: android.widget.RemoteViews, /) -> None: ...
    def removeWidgetPreview(self, provider: android.content.ComponentName, widgetCategories: int | java.jint | java.lang.Integer, /) -> None: ...
    def requestPinAppWidget(self, provider: android.content.ComponentName, extras: android.os.Bundle, successCallback: android.app.PendingIntent, /) -> bool: ...
    def setWidgetPreview(self, provider: android.content.ComponentName, widgetCategories: int | java.jint | java.lang.Integer, preview: android.widget.RemoteViews, /) -> bool: ...
    @typing.overload
    def updateAppWidget(self, appWidgetId: int | java.jint | java.lang.Integer, views: android.widget.RemoteViews, /) -> None: ...
    @typing.overload
    def updateAppWidget(self, provider: android.content.ComponentName, views: android.widget.RemoteViews, /) -> None: ...
    @typing.overload
    def updateAppWidget(self, appWidgetIds: java.chaquopy.JavaArrayJInt, views: android.widget.RemoteViews, /) -> None: ...
    def updateAppWidgetOptions(self, appWidgetId: int | java.jint | java.lang.Integer, options: android.os.Bundle, /) -> None: ...
    def updateAppWidgetProviderInfo(self, provider: android.content.ComponentName, metaDataKey: str | java.lang.String, /) -> None: ...

class AppWidgetProvider(android.content.BroadcastReceiver):
    def __init__(self) -> None: ...
    def onAppWidgetOptionsChanged(self, context: android.content.Context, appWidgetManager: AppWidgetManager, appWidgetId: int | java.jint | java.lang.Integer, newOptions: android.os.Bundle, /) -> None: ...
    def onDeleted(self, context: android.content.Context, appWidgetIds: java.chaquopy.JavaArrayJInt, /) -> None: ...
    def onDisabled(self, context: android.content.Context, /) -> None: ...
    def onEnabled(self, context: android.content.Context, /) -> None: ...
    def onReceive(self, context: android.content.Context, intent: android.content.Intent, /) -> None: ...
    def onRestored(self, context: android.content.Context, oldWidgetIds: java.chaquopy.JavaArrayJInt, newWidgetIds: java.chaquopy.JavaArrayJInt, /) -> None: ...
    def onUpdate(self, context: android.content.Context, appWidgetManager: AppWidgetManager, appWidgetIds: java.chaquopy.JavaArrayJInt, /) -> None: ...

class AppWidgetProviderInfo(android.os.Parcelable):
    CREATOR: typing.ClassVar[android.os.Parcelable.Creator[AppWidgetProviderInfo]] = ...
    RESIZE_BOTH: typing.ClassVar[int] = ...
    RESIZE_HORIZONTAL: typing.ClassVar[int] = ...
    RESIZE_NONE: typing.ClassVar[int] = ...
    RESIZE_VERTICAL: typing.ClassVar[int] = ...
    WIDGET_CATEGORY_HOME_SCREEN: typing.ClassVar[int] = ...
    WIDGET_CATEGORY_KEYGUARD: typing.ClassVar[int] = ...
    WIDGET_CATEGORY_NOT_KEYGUARD: typing.ClassVar[int] = ...
    WIDGET_CATEGORY_SEARCHBOX: typing.ClassVar[int] = ...
    WIDGET_FEATURE_CONFIGURATION_OPTIONAL: typing.ClassVar[int] = ...
    WIDGET_FEATURE_HIDE_FROM_PICKER: typing.ClassVar[int] = ...
    WIDGET_FEATURE_RECONFIGURABLE: typing.ClassVar[int] = ...
    autoAdvanceViewId: int = ...
    configure: android.content.ComponentName = ...
    descriptionRes: int = ...
    generatedPreviewCategories: int = ...
    icon: int = ...
    initialKeyguardLayout: int = ...
    initialLayout: int = ...
    label: str = ...
    maxResizeHeight: int = ...
    maxResizeWidth: int = ...
    minHeight: int = ...
    minResizeHeight: int = ...
    minResizeWidth: int = ...
    minWidth: int = ...
    previewImage: int = ...
    previewLayout: int = ...
    provider: android.content.ComponentName = ...
    resizeMode: int = ...
    targetCellHeight: int = ...
    targetCellWidth: int = ...
    updatePeriodMillis: int = ...
    widgetCategory: int = ...
    widgetFeatures: int = ...
    @typing.overload
    def __init__(self) -> None: ...
    @typing.overload
    def __init__(self, in_: android.os.Parcel, /) -> None: ...
    def clone(self) -> AppWidgetProviderInfo: ...
    def describeContents(self) -> int: ...
    def getActivityInfo(self) -> android.content.pm.ActivityInfo: ...
    def getProfile(self) -> android.os.UserHandle: ...
    def loadDescription(self, context: android.content.Context, /) -> java.lang.CharSequence | None: ...
    def loadIcon(self, context: android.content.Context, density: int | java.jint | java.lang.Integer, /) -> android.graphics.drawable.Drawable: ...
    def loadLabel(self, packageManager: android.content.pm.PackageManager, /) -> str: ...
    def loadPreviewImage(self, context: android.content.Context, density: int | java.jint | java.lang.Integer, /) -> android.graphics.drawable.Drawable | None: ...
    def toString(self) -> str: ...
    def writeToParcel(self, out: android.os.Parcel, flags: int | java.jint | java.lang.Integer, /) -> None: ...
