summaryrefslogtreecommitdiff
path: root/src/lib/xdgnotifier.h
diff options
context:
space:
mode:
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