2018-08-11 12:47:03 +02:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "common/Singleton.hpp"
|
|
|
|
|
2021-05-08 15:57:00 +02:00
|
|
|
#include <pajlada/settings/setting.hpp>
|
2022-12-31 15:41:01 +01:00
|
|
|
#include <QString>
|
2021-05-08 15:57:00 +02:00
|
|
|
|
2018-08-11 12:47:03 +02:00
|
|
|
namespace chatterino {
|
|
|
|
|
2018-08-12 18:54:32 +02:00
|
|
|
enum class Platform : uint8_t;
|
|
|
|
|
2019-05-01 23:21:12 +02:00
|
|
|
enum class ToastReaction {
|
2019-04-27 18:15:41 +02:00
|
|
|
OpenInBrowser = 0,
|
|
|
|
OpenInPlayer = 1,
|
|
|
|
OpenInStreamlink = 2,
|
|
|
|
DontOpen = 3
|
2019-04-27 13:47:13 +02:00
|
|
|
};
|
|
|
|
|
2018-08-11 12:47:03 +02:00
|
|
|
class Toasts final : public Singleton
|
|
|
|
{
|
|
|
|
public:
|
2022-10-30 13:29:43 +01:00
|
|
|
void sendChannelNotification(const QString &channelName,
|
|
|
|
const QString &channelTitle, Platform p);
|
2019-05-01 23:21:12 +02:00
|
|
|
static QString findStringFromReaction(const ToastReaction &reaction);
|
2019-04-27 18:15:41 +02:00
|
|
|
static QString findStringFromReaction(
|
|
|
|
const pajlada::Settings::Setting<int> &reaction);
|
2019-05-01 23:21:12 +02:00
|
|
|
static std::map<ToastReaction, QString> reactionToString;
|
2018-08-12 20:21:21 +02:00
|
|
|
|
2018-08-12 18:54:32 +02:00
|
|
|
static bool isEnabled();
|
2018-08-11 16:11:51 +02:00
|
|
|
|
|
|
|
private:
|
2018-09-01 13:01:54 +02:00
|
|
|
#ifdef Q_OS_WIN
|
2022-10-30 13:29:43 +01:00
|
|
|
void sendWindowsNotification(const QString &channelName,
|
|
|
|
const QString &channelTitle, Platform p);
|
2018-09-01 13:01:54 +02:00
|
|
|
#endif
|
2018-08-11 12:47:03 +02:00
|
|
|
};
|
|
|
|
} // namespace chatterino
|