summaryrefslogtreecommitdiff
path: root/src/lib/xdgnotifier.h
blob: 7147626eea012ebd986d26262521fb36a050e4ea (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
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