2018-08-09 15:41:03 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/SignalVector.hpp"
|
|
|
|
#include "singletons/Settings.hpp"
|
|
|
|
|
|
|
|
namespace chatterino {
|
|
|
|
|
|
|
|
class Settings;
|
|
|
|
class Paths;
|
|
|
|
|
|
|
|
class NotificationModel;
|
|
|
|
|
2018-08-12 18:54:32 +02:00
|
|
|
enum class Platform : uint8_t {
|
|
|
|
Twitch = 0, // 0
|
|
|
|
Mixer = 1, // 1
|
|
|
|
HitBox = 2, // 2
|
|
|
|
};
|
|
|
|
|
2018-08-09 15:41:03 +02:00
|
|
|
class NotificationController final : public Singleton
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual void initialize(Settings &settings, Paths &paths) override;
|
|
|
|
|
2018-08-12 18:54:32 +02:00
|
|
|
bool isChannelNotified(const QString &channelName, Platform p);
|
2018-08-09 15:41:03 +02:00
|
|
|
|
2018-08-12 18:54:32 +02:00
|
|
|
void updateChannelNotification(const QString &channelName, Platform p);
|
2018-08-12 15:29:40 +02:00
|
|
|
void addChannelNotification(const QString &channelName,
|
|
|
|
UnsortedSignalVector<QString> &vector);
|
|
|
|
void removeChannelNotification(const QString &channelName,
|
|
|
|
UnsortedSignalVector<QString> &vector);
|
2018-08-09 15:41:03 +02:00
|
|
|
|
2018-08-12 18:54:32 +02:00
|
|
|
UnsortedSignalVector<QString> getVector(Platform p);
|
2018-08-09 15:41:03 +02:00
|
|
|
|
2018-08-12 15:29:40 +02:00
|
|
|
UnsortedSignalVector<QString> twitchVector;
|
|
|
|
UnsortedSignalVector<QString> mixerVector;
|
|
|
|
|
2018-08-12 18:54:32 +02:00
|
|
|
NotificationModel *createModel(QObject *parent, Platform p);
|
2018-08-09 15:41:03 +02:00
|
|
|
|
|
|
|
private:
|
|
|
|
bool initialized_ = false;
|
2018-08-12 15:29:40 +02:00
|
|
|
ChatterinoSetting<std::vector<QString>> twitchSetting_ = {
|
|
|
|
"/notifications/twitch"};
|
|
|
|
ChatterinoSetting<std::vector<QString>> mixerSetting_ = {
|
|
|
|
"/notifications/mixer"};
|
2018-08-09 15:41:03 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace chatterino
|