#pragma once

#include <array>
#include <memory>

#include <QAction>
#include <QIcon>
#include <QMainWindow>
#include <QMenu>
#include <QSystemTrayIcon>
#include <QTimer>

#include "ui_AdaptiveBrightness.h"

class MainWindow : public QMainWindow {
    Q_OBJECT

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

  private:
    void loadIcons();
    void nextIcon();

    Ui::AdaptiveBrightnessClass m_ui;

    std::array<std::unique_ptr<QIcon>, 9> m_noSensorStateIcons;
    std::array<std::unique_ptr<QIcon>, 9> m_sensorStateIcons;
    std::unique_ptr<QIcon> m_errorIcon;

    std::size_t m_currentIcon;
    bool m_visibility;
    QAction* m_showHideAction = nullptr;
    QMenu* m_trayIconMenu = nullptr;
    QSystemTrayIcon* m_trayIcon = nullptr;

    QTimer* m_timer = nullptr;
};
