theshell/notificationsWidget/notificationobject.h

55 lines
1.3 KiB
C
Raw Normal View History

2017-09-15 11:31:22 +10:00
#ifndef NOTIFICATIONOBJECT_H
#define NOTIFICATIONOBJECT_H
#include <QObject>
#include "notificationpopup.h"
class NotificationPopup;
class NotificationObject : public QObject
{
Q_OBJECT
public:
enum NotificationCloseReason : uint {
Expired = 1,
Dismissed = 2,
ProgrammaticallyClosed = 3,
Undefined = 4
};
explicit NotificationObject(QString app_name, QString app_icon, QString summary, QString body, QStringList actions, QVariantMap hints, int expire_timeout, QObject *parent = nullptr);
static int currentId;
int getId();
2017-09-15 22:01:19 +10:00
QString getAppIdentifier();
QString getAppName();
QIcon getAppIcon();
QString getSummary();
QString getBody();
2017-09-15 11:31:22 +10:00
signals:
void parametersUpdated();
void actionClicked(QString key);
2017-09-15 22:01:19 +10:00
void closed(NotificationObject::NotificationCloseReason reason);
2017-09-15 11:31:22 +10:00
public slots:
void post();
void setParameters(QString &app_name, QString &app_icon, QString &summary, QString &body, QStringList &actions, QVariantMap &hints, int expire_timeout);
void closeDialog();
void dismiss();
private:
QString appName, appIcon, summary, body;
QStringList actions;
QVariantMap hints;
int timeout;
uint id;
NotificationPopup* dialog;
QIcon appIc, bigIc;
};
#endif // NOTIFICATIONOBJECT_H