#ifndef LOGICBURNIMAGE_H
#define LOGICBURNIMAGE_H

#include <QObject>
#include <QMutex>

class LogicBurnImage : public QObject
{
    Q_OBJECT
public:
    static LogicBurnImage *instance();
public:
    LogicBurnImage(const LogicBurnImage*)=delete;
    LogicBurnImage *operator =(const LogicBurnImage*)=delete;
public:
    void init();
    void destroy() { delete this; }
public:
    QIcon mediumIcon(int);
    QString display(int);
    QString tooltip(int);
public slots:
    void onNewISOPath(QString);
    void onNewBurner(int);
private:
    explicit LogicBurnImage(QObject *parent = nullptr);
    ~LogicBurnImage();
private:
    bool check();
private slots:
    void slotsNewBurner(void *);
    void slotsDeleteBurner(void *);
    void slotsBurnImage();
    void slotsSetting();
private:
    static LogicBurnImage *m_oInstance;
    static QMutex          m_oMutex;
private:
    QString                m_oISOPath;
    int                    m_iBurner;
    QStringList            m_oISOPaths;
    QList<void *>          m_oBurners;
signals:
    // log
    void info(QString); void warn(QString);
    void error(QString); void debug(QString);
    // logic
    void newISOPath(QString);
    void newBurner(QString, QString);
    void deleteBurner(int);
    void enableBurner(bool);
    void enableBusness(bool);
    void isoError(QString);
    void burnerError(QString);
    void ready(QString);
    void setting(void *);
};
#define BURNIMAGE LogicBurnImage::instance()
#endif // LOGICBURNIMAGE_H
