summaryrefslogtreecommitdiff
path: root/src/lib/xdgnotifier.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/xdgnotifier.h
Initial Commit
Diffstat (limited to 'src/lib/xdgnotifier.h')
-rw-r--r--src/lib/xdgnotifier.h28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/lib/xdgnotifier.h b/src/lib/xdgnotifier.h
new file mode 100644
index 0000000..7147626
--- /dev/null
+++ b/src/lib/xdgnotifier.h
@@ -0,0 +1,28 @@
+#ifndef NOTIFIER_H
+#define NOTIFIER_H
+
+#include <QObject>
+#include <QDBusConnection>
+
+class OrgFreedesktopNotificationsInterface;
+
+class XdgNotifier : public QObject
+{
+ Q_OBJECT
+ OrgFreedesktopNotificationsInterface *m_iface;
+ int m_lastid;
+public:
+ explicit XdgNotifier(QObject *parent = nullptr);
+
+public slots:
+ void notifyTextOnly(QString summary, QString body, bool replace);
+ void notifyWithActions(QString summary, QString body, bool replace, QStringList actions);
+ void notify(const QString &summary, const QString &body, bool replace, const QStringList &actions, int timeout);
+ void closeNotification();
+
+signals:
+ void actionInvoked(QString action);
+ void notificationClosed(QString reason);
+};
+
+#endif // NOTIFIER_H