
from qgis.PyQt.QtWidgets import QMessageBox


def info_qt(parent, header, msg):
    """
    Displays an information window.

    :param parent:
    :param header:
    :param msg:
    :return:
    """

    QMessageBox.information(
        parent,
        header,
        msg
    )


def warn_qt(parent, header, msg):
    """
    Displays a warning window.

    :param parent:
    :param header:
    :param msg:
    :return:
    """

    QMessageBox.warning(
        parent,
        header,
        msg
    )


def question_qt(parent, header, msg) -> bool:
    """
    Displays a question window, asking the user whether to proceed.

    :param parent:
    :param header:
    :param msg:
    :return: whether the user chose to proceed.
    """

    return QMessageBox.question(
        parent,
        header,
        msg,
        QMessageBox.StandardButton.Yes | QMessageBox.StandardButton.No
    ) == QMessageBox.StandardButton.Yes


def error_qt(
    parent,
    header,
    msg
):
    """
    Displays an error_qt window.

    :param parent:
    :param header:
    :param msg:
    :return:
    """

    QMessageBox.critical(
        parent,
        header,
        msg
    )
