#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QThread>

#include <libusb-1.0/libusb.h>

QT_BEGIN_NAMESPACE
namespace Ui {
class MainWindow;
}
QT_END_NAMESPACE

class MProMonitorThread : public QThread
{
    Q_OBJECT

public:
    void stop();

protected:
    void run();

private:
    bool runtag;
};

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    MainWindow(QWidget *parent = nullptr);
    ~MainWindow();

protected slots:
    void onRefresh();
    void onMonitor();

protected:
    QString requestUSBScreenID(struct libusb_device_handle *usbd);
    QString requestUSBScreenInfo(struct libusb_device_handle *usbd);
    void clearScreen(struct libusb_device_handle *usbd);

private:
    Ui::MainWindow *ui;
    MProMonitorThread monitor_thread;
};
#endif // MAINWINDOW_H
