#ifndef MSGBOX_H
#define MSGBOX_H

#include <QThread>
#include <QMessageBox>

class MsgBox : public QObject
{
   Q_OBJECT
   typedef enum {
      mbt_about = 0,
      mbt_aboutqt = 1,
      mbt_critical = 2,
      mbt_information = 3,
      mbt_question = 4,
      mbt_warning = 5
   } MSGBOXTYPE;
//protected:

 public:

   MsgBox(QObject * parent = 0);

   void about(QWidget * parent, const QString &title, const QString &text);
   void aboutQt(QWidget *parent, const QString &title = QString());

   int critical(QWidget * parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);
   int information(QWidget * parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);

   int question(QWidget * parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::StandardButtons(QMessageBox::Yes | QMessageBox::No), QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);

   int warning(QWidget * parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons = QMessageBox::Ok, QMessageBox::StandardButton defaultButton = QMessageBox::NoButton);


signals:
    void msgbox_sig(MSGBOXTYPE type, QWidget * parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton);

private slots:
    void on_msgbox(MSGBOXTYPE type, QWidget * parent, const QString &title, const QString &text, QMessageBox::StandardButtons buttons, QMessageBox::StandardButton defaultButton);
private:
    int m_btnres;
};

#endif // MSGBOX_H
