mirror-chatterino2/src/singletons/Toasts.hpp

38 lines
932 B
C++
Raw Normal View History

2018-08-11 12:47:03 +02:00
#pragma once
#include "common/Singleton.hpp"
#include <pajlada/settings/setting.hpp>
#include <QString>
2018-08-11 12:47:03 +02:00
namespace chatterino {
2018-08-12 18:54:32 +02:00
enum class Platform : uint8_t;
enum class ToastReaction {
OpenInBrowser = 0,
OpenInPlayer = 1,
OpenInStreamlink = 2,
DontOpen = 3
};
2018-08-11 12:47:03 +02:00
class Toasts final : public Singleton
{
public:
void sendChannelNotification(const QString &channelName,
const QString &channelTitle, Platform p);
static QString findStringFromReaction(const ToastReaction &reaction);
static QString findStringFromReaction(
const pajlada::Settings::Setting<int> &reaction);
static std::map<ToastReaction, QString> reactionToString;
2018-08-12 18:54:32 +02:00
static bool isEnabled();
private:
2018-09-01 13:01:54 +02:00
#ifdef Q_OS_WIN
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