#ifndef CMESSAGEBOX_H
#define CMESSAGEBOX_H

#include "fancydialog.h"

class QVBoxLayout;
class QHBoxLayout;
class QPushButton;
class QLabel;

class CMessageBox : public FancyDialog
{
    Q_OBJECT
public:
    enum MessageType {TipBox, WarningBox, ErrorBox};
    explicit CMessageBox(QWidget* parent = nullptr);
    ~CMessageBox();

    void setMessageType(MessageType type);
    void setButtonNum(int num);
    void setText(const QString& text);

    int exec();

private:
    void initialize();
    void createConnections();

private slots:
    void slotClickButton();

private:
    QWidget* m_pCentralWidget;
    QVBoxLayout* m_pMainVLayout;

    QHBoxLayout* m_pMiddlHLayout;
    QLabel* m_pLogoLabel;
    QLabel* m_pTextLabel;

    QHBoxLayout* m_pButtonHLayout;
    QPushButton* m_pSubmitButton;
    QPushButton* m_pCancelButton;

    MessageType m_eMessageType;
};

#endif // CMESSAGEBOX_H
