import abc
from .config import QOptionItem as QOptionItem, QUserConfig as QUserConfig
from .logging import QLogger as QLogger, QLogging as QLogging
from .mainwindow import QMainWindow as QMainWindow
from .python_ext import QPostInitObjectMeta as QPostInitObjectMeta
from .qt import QApplication as QApplication, QObject as QObject, QWidget as QWidget
from _typeshed import Incomplete
from packaging.version import Version as Version
from typing import Callable

DATETIME_NOW_STR: Incomplete
PluginName = str

class QMixin:
    @staticmethod
    def checkCompatibility(targetObject) -> bool: ...

class QOptionObserver(QMixin):
    def checkCompatibility(targetObject) -> bool: ...
    @staticmethod
    def onConfChanged(func: Callable | None = None, section: str | None = None, option: str | None = None) -> Callable: ...

class QWidgetOptionObserver(QOptionObserver, metaclass=QPostInitObjectMeta):
    def __post_init__(self, *args, **kwargs) -> None: ...

class QPluginObserver(QMixin):
    ObserveHook: Incomplete
    def __init__(self, *args, **kwargs) -> None: ...
    def requires(self) -> list[PluginName]: ...
    @staticmethod
    def checkCompatibility(targetObject) -> bool: ...
    @staticmethod
    def onPluginAvailable(func: ObserveHook = None, plugin: PluginName | None = None): ...
    @staticmethod
    def onPluginShutdown(func: ObserveHook = None, plugin: PluginName | None = None): ...
    def plugin(self, name: PluginName) -> QPlugin | None: ...

class QPluginWidget(QWidgetOptionObserver):
    def checkCompatibility(targetObject) -> bool: ...

class QPlugin(QPluginObserver, QOptionObserver, QObject, metaclass=abc.ABCMeta):
    def __init__(self, name: PluginName, version: Version, author: str, title: str, description: str, *args, **kwargs) -> None: ...
    def name(self) -> PluginName: ...
    def version(self) -> Version: ...
    def author(self) -> str: ...
    def title(self) -> str: ...
    def description(self) -> str: ...
    def isInitialized(self) -> bool: ...
    def isShutDowned(self) -> bool: ...
    @abc.abstractmethod
    def bootup(self): ...
    @abc.abstractmethod
    def shutdown(self): ...

class QApp:
    __instance__: Incomplete
    __initialized__: bool
    def __new__(cls, *args, **kwargs): ...
    def __init__(self, config: QUserConfig) -> None: ...
    @classmethod
    def instance(cls) -> QApp: ...
    def logger(self) -> QLogger: ...
    def config(self) -> QUserConfig: ...
    def engine(self) -> QEngine: ...
    def mainWindow(self) -> QMainWindow: ...

class QEngine(QObject):
    def __init__(self) -> None: ...
    def load(self, plugin: QPlugin): ...
    def start(self, mainWindow: QMainWindow): ...
    def bootup(self) -> None: ...
    def shutdown(self) -> None: ...
    def get(self, name: PluginName) -> QPlugin: ...
    def has(self, name: PluginName) -> bool: ...
    def all(self) -> list[PluginName]: ...
