#ifndef DIMMINGCONTROLLER_H
#define DIMMINGCONTROLLER_H

#include "DataTypeDef.h"
#include <QTimer>
#include <QApplication>
#include <QWidget>
#include <QGraphicsColorizeEffect>

class DimmingController : public QObject {
    Q_OBJECT
public:
    explicit DimmingController(QObject *parent = nullptr);
    ~DimmingController();

    void resetTimer(int timeout = USER_ACTION_TIMEOUT * 1000);

private slots:
    void dimScreen();

    void restoreScreen();

protected:
    bool eventFilter(QObject* watched, QEvent* event) override;

private:
    QTimer m_timer;
    QGraphicsColorizeEffect *m_dimEffect = nullptr;
};

#endif // DIMMINGCONTROLLER_H
