#ifndef PICUPLOADERGUI_H
#define PICUPLOADERGUI_H

#include <QDialog>

class CPICUploader;

namespace Ui {
class CPICUploaderGui;
}

class CPICUploaderGui : public QDialog
{
    Q_OBJECT

public:
    enum eUploaderGuiEvents
    {
        UPLOADER_GUI_HEARTBEAT_BTN_CLICK_EVENT,
        UPLOADER_GUI_FLASH_ERASE_BTN_CLICK_EVENT,
        UPLOADER_GUI_INIT_UPLOAD_BTN_CLICK_EVENT,
        UPLOADER_GUI_GET_STATE_BTN_CLICK_EVENT,
        UPLOADER_GUI_SEND_DATA_CHUNK_BTN_CLICK_EVENT,
        UPLOADER_GUI_UPLOAD_FINISHED_BTN_CLICK_EVENT,
        UPLOADER_GUI_EXECUTE_UPGRADE_BTN_CLICK_EVENT,
        UPLOADER_GUI_ABORT_BTN_CLICK_EVENT,
        UPLOADER_GUI_AUTOMATIC_UPDATE_START_BTN_CLICK_EVENT,
        UPLOADER_GUI_CHECK_FLASH_CLICK_EVENT,
        UPLOADER_GUI_GET_STORED_FIRMWARE_INFO_CLICK_EVENT,

        UPLOADER_GUI_MAX_EVENT
    };


public:
    explicit CPICUploaderGui(QWidget *parent = nullptr);
    ~CPICUploaderGui();

    void SetHexFileStats(QString Stats);
    void UploaderSocketConnected();
    void UploaderSocketDisconnected();
    void AddTextToLogScreen(QString Text);
    void SetUploadProgressSettings(int max);
    void TickProgressBar();
    void ResetProgressBar();


    CPICUploader *mProgramHandle;

private:
    Ui::CPICUploaderGui *ui;
    QString mLogScreenText;

public slots:
    void OpenHexFileBtnClicked(bool);
    void ConnectBtnClicked(bool);
    void SendSingleCmdCliked(bool);
    void ClearLogScreen(bool);
    void ShowHexFileInfoClicked(bool);
};

#endif // PICUPLOADERGUI_H
