From 1dbc0e3c88ba271ba35bc3f82e7864c4f35e1236 Mon Sep 17 00:00:00 2001 From: Fabien Proriol Date: Sun, 25 May 2025 12:13:31 +0200 Subject: Initial Commit --- src/lib/xdgnotificationmessage.h | 67 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 src/lib/xdgnotificationmessage.h (limited to 'src/lib/xdgnotificationmessage.h') diff --git a/src/lib/xdgnotificationmessage.h b/src/lib/xdgnotificationmessage.h new file mode 100644 index 0000000..8e62cab --- /dev/null +++ b/src/lib/xdgnotificationmessage.h @@ -0,0 +1,67 @@ +#ifndef NOTIFYMESSAGE_H +#define NOTIFYMESSAGE_H + +#include +#include + +namespace xdg { + class NotificationMessage : public QObject + { + Q_OBJECT + + QString m_appName; + QString m_appIcon; + QString m_summary; + QString m_body; + QStringList m_actions; + QVariantMap m_hints; + uint m_id; + int m_timeout; + + + public: + explicit NotificationMessage( + const QString &app_name, + const QString &app_icon, + const QString &summary, + const QString &body, + const QStringList &actions, + const QVariantMap &hints, + int timeout, + QObject *parent = nullptr); + + void update( + const QString &app_name, + const QString &app_icon, + const QString &summary, + const QString &body, + const QStringList &actions, + const QVariantMap &hints, + int timeout); + + void setId(uint id); + + QString appName() const; + QString appIcon() const; + QString summary() const; + QString body() const; + QStringList actions() const; + QVariantMap hints() const; + uint id() const; + + private slots: + void _expired(); + + signals: + void appNameChanged(QString appName); + void appIconChanged(QString appIcon); + void summaryChanged(QString summary); + void bodyChanged(QString body); + void actionsChanged(QStringList actions); + void hintsChanged(QVariantMap hints); + void timeoutChanged(int timeout); + void expired(QObject *obj); + }; +} + +#endif // NOTIFYMESSAGE_H -- cgit v1.2.3