#ifndef GLOBALSIGNAL_H
#define GLOBALSIGNAL_H

#include <QObject>
#include <QSize>
#include "../deviceitem.h"
#include "../uninstallitem.h"

class GlobalSignal : public QObject {
Q_OBJECT
public:
    static GlobalSignal *getInstance();

signals:

    void themeChangeSignal();

    void getHwInfoComplete();

    void updateInstallContentSucceed();

    void getHwInfoFailed();

    void uncheckCheckBox(int num);   // num = 0 取消安装checkbox、num = 1 取消升级checkbox

    void checkAllChildenCheckboxState(int num);  // 同上

    void switchInstallPage();

    void installDriver(DeviceItem *item, QString driverName);

    void switchUninstallPage();        // 有可删除的驱动，切换到删除界面

    void switchNoUninstallPage();      // 无可删除的驱动，切换到无可删除界面

    void uninstallDriver(UninstallItem *item, QString driverName);

    void addToUninstallSignal(HardWareInfo hardWareInfo);     // 下载新驱动成功后，发出此信号，添加到删除界面

    void addToinstallSignal(HardWareInfo hardWareInfo);

    void quitEventLoop();

    void reDetectSignal();

private:
    explicit GlobalSignal(QObject *parent = nullptr);

    static GlobalSignal *instance;

    ~GlobalSignal();
};

#define g_signal GlobalSignal::getInstance()

#endif // GLOBALSIGNAL_H
