summaryrefslogtreecommitdiff
path: root/src/lib/xdgnotificationmessage.h
diff options
context:
space:
mode:
authorFabien Proriol <fabien.proriol@kazoe.org>2025-05-25 12:13:31 +0200
committerFabien Proriol <fabien.proriol@kazoe.org>2025-05-25 12:13:31 +0200
commit1dbc0e3c88ba271ba35bc3f82e7864c4f35e1236 (patch)
tree8c491cd196e2eff4c59f8c23f566f7ff26981586 /src/lib/xdgnotificationmessage.h
Initial Commit
Diffstat (limited to 'src/lib/xdgnotificationmessage.h')
-rw-r--r--src/lib/xdgnotificationmessage.h67
1 files changed, 67 insertions, 0 deletions
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 <QObject>
+#include <QVariantMap>
+
+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