mirror of
https://github.com/QuasarApp/Snake.git
synced 2025-04-26 09:44:40 +00:00
40 lines
951 B
C++
40 lines
951 B
C++
#ifndef NOTIFICATIONSERVICE_H
|
|
#define NOTIFICATIONSERVICE_H
|
|
|
|
#include "notificationdata.h"
|
|
|
|
#include <QObject>
|
|
|
|
class NotificationService: public QObject
|
|
{
|
|
Q_OBJECT
|
|
|
|
Q_PROPERTY(NotificationData notify READ notify NOTIFY notifyChanged)
|
|
Q_PROPERTY(QList<NotificationData> history READ history NOTIFY notifyChanged)
|
|
|
|
private:
|
|
explicit NotificationService(QObject *ptr = nullptr);
|
|
|
|
NotificationData _notify;
|
|
QList<NotificationData> _history;
|
|
|
|
public:
|
|
NotificationData notify() const;
|
|
void setNotify(const NotificationData ¬ify);
|
|
Q_INVOKABLE void setNotify(const QString& title = "",
|
|
const QString& text = "",
|
|
const QString& img = "",
|
|
int type = NotificationData::Normal);
|
|
|
|
static NotificationService* getService();
|
|
|
|
const QList<NotificationData> & history() const;
|
|
|
|
signals:
|
|
void notifyChanged();
|
|
};
|
|
|
|
|
|
|
|
#endif // NOTIFICATIONSERVICE_H
|