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/xdgnotifier.h | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 src/lib/xdgnotifier.h (limited to 'src/lib/xdgnotifier.h') 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 +#include + +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 -- cgit v1.2.3