#ifndef ABSTRACTNOTIFICATIONBACKEND_HPP #define ABSTRACTNOTIFICATIONBACKEND_HPP #include "tool/AbstractObject.hpp" #include #include #include struct ToastButton { QString label; QString argument; ToastButton(QString title, QString arg) { label = title; argument = arg; } }; class AbstractNotificationBackend : public QObject, public AbstractObject { Q_OBJECT public: AbstractNotificationBackend(QObject *parent = Q_NULLPTR); ~AbstractNotificationBackend() = default; enum NotificationType { ReceivedMessage, ReceivedCall // ReceivedFileMessage, // SnapshotWasTaken, // RecordingCompleted }; struct Notification { Notification(int type, int timeout = 0) { this->type = NotificationType(type); this->timeout = timeout; } int getTimeout() const { return timeout; } private: int type; int timeout; }; protected: virtual void sendNotification(const QString &title = QString(), const QString &message = QString(), const QList &actions = {}) = 0; virtual void sendNotification(NotificationType type, QVariantMap data) = 0; static const QHash Notifications; signals: void toastActivated(const QString &args); private: DECLARE_ABSTRACT_OBJECT }; #endif // ABSTRACTNOTIFICATIONBACKEND_HPP