#ifndef BRIGHTNESSFRAME_H
#define BRIGHTNESSFRAME_H

#include <QFrame>
#include <QLabel>
#include <QWidget>
#include <QLabel>
#include "uslider.h"
#include <QMutex>
#include <QFuture>
#include "fixlabel.h"
#include "getBrightnessThread.h"
#include "ukccframe.h"
#include "lightlabel.h"
#include <kslider.h>
using namespace kdk;

class BrightnessFrame : public UkccFrame
{
    Q_OBJECT
public:
    BrightnessFrame(const QString &name, const bool &isBattery, const QString &edidHash = "", QWidget *parent = nullptr);
    ~BrightnessFrame();
    void setTextLabelName(QString text);
    void setTextLabelValue(QString text);
    void setOutputEnable(const bool &enable);
    bool getOutputEnable();
    void runConnectThread(const bool &openFlag);
    bool getSliderEnable();
    void setSliderEnable(const bool &enable);
    void setDDCBrightness(const int &value);
    void updateEdidHash(const QString &edid);
    QString getEdidHash();
    QString getOutputName();
    void setI2cbus(QString busNum);

Q_SIGNALS:
    void sliderEnableChanged();

private:
    FixLabel *labelName = nullptr;
    QLabel *labelValue = nullptr;
    KSlider *slider = nullptr;
    QString outputName;          //屏幕名
    bool    outputEnable;     //该屏幕是否打开
    bool    connectFlag;  //该屏幕是否连接
    QString edidHash;
    QMutex      mLock;
    bool exitFlag;
    bool isBattery;
    LightLabel *labelMsg = nullptr;
    QString i2cBus;
    GetBrightnessThread *mGetBrightnessThread;
};

#endif // BRIGHTNESSFRAME_H
