mirror-chatterino2/src/singletons/Toasts.hpp
nerix b975900043
refactor: Toast (#4899)
* Fixes a bug where avatars weren't loaded on fresh installations of Chatterino.
* Avatars now update every two weeks.
* Removes misleading `DownlaodManager` (now part of `Toasts.cpp`).
* Refactors usage of WinToast to be easier to read.
* Added version to AUMI.
* Removes manual `QString` → `std::wstring` conversions.
* Removes uses of implicit ASCII casts in `Toasts.cpp`, meaning it can be compiled with `QT_NO_CAST_FROM_ASCII`.
2023-10-17 01:50:18 +00:00

39 lines
932 B
C++

#pragma once
#include "common/Singleton.hpp"
#include <pajlada/settings/setting.hpp>
#include <QString>
namespace chatterino {
enum class Platform : uint8_t;
enum class ToastReaction {
OpenInBrowser = 0,
OpenInPlayer = 1,
OpenInStreamlink = 2,
DontOpen = 3
};
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 bool isEnabled();
private:
#ifdef Q_OS_WIN
void ensureInitialized();
void sendWindowsNotification(const QString &channelName,
const QString &channelTitle, Platform p);
bool initialized_ = false;
#endif
};
} // namespace chatterino