#ifndef STATUSWIDGET_H
#define STATUSWIDGET_H

#include <QWidget>
#include <QSettings>
#include <QPropertyAnimation>
#include <QMap>
#include <QGraphicsOpacityEffect>

#include "models/patchdownloader.h"

namespace Ui {
class StatusWidget;
}

class LotroDatManager;

class StatusWidget : public QWidget
{
    Q_OBJECT

public:
    explicit StatusWidget(QSettings* settings, PatchDownloader* patch_downloader, LotroDatManager* lotro_dat_manager, QWidget *parent = 0);
    ~StatusWidget();

public slots:
    void updateFontsSizes();

protected:
    void resizeEvent(QResizeEvent *event) override;

private slots:
    void onPatchDownloaderStarted();
    void onPatchDownloaderFinished();
    void onPatchDownloaderProgressChanged(QList<PatchDownloadData>);

    void updatePatchStatus(QString patch_name, QString status);

    void on_game_button_clicked();

    void setToolTipToWeeklyCodeHelp();
    void setToolTipToWeeklyCodeComplete();
    void setToolTipToNewsHelp();
    void setToolTipToServersStatus();
    void resetToolTip();

    void fadeBetweenToolTips(QWidget* next_tooltip);



private:
    Ui::StatusWidget *ui;

    QSettings* app_settings;
    PatchDownloader* patch_updater;
    LotroDatManager* lotro_manager;

    QMap<QString, QGraphicsOpacityEffect*> tooltip_effects;
    QMap<QString, QPropertyAnimation*> tooltip_animations;
    QWidget* active_tooltip;

    QTime last_progress_update_time;
};

#endif // STATUSWIDGET_H
