#ifndef AWMSGBOX_H
#define AWMSGBOX_H

#include <QDialog>
#include <mutex>

namespace Ui {
class awMsgBox;
}

#include <QTimer>

enum class MSG_ICON_TYPE
{
    mit_information = 1,
    mit_succeed,
    mit_error
};

class awMsgBox : public QDialog
{
    Q_OBJECT

public:
    explicit awMsgBox(QWidget *parent = nullptr);
    ~awMsgBox();

    void initUI(MSG_ICON_TYPE type);
    void setMsg(QString sMsg);

    static void clear(QWidget *parent = nullptr);
	static std::list< std::shared_ptr<awMsgBox>> vMsgList;
	static std::mutex msgMutex;
private slots:
    void on_btn_awmb_close_clicked();

private:
    Ui::awMsgBox *ui;
    std::shared_ptr<QTimer> m_pTimer;	

};

extern void ShowMsg(QString sMsg, QWidget *parent = nullptr, MSG_ICON_TYPE type = MSG_ICON_TYPE::mit_information);

#endif // AWMSGBOX_H
