File indexing completed on 2024-02-25 17:31:01

0001 /*
0002  * SPDX-FileCopyrightText: 2016 Red Hat Inc
0003  *
0004  * SPDX-License-Identifier: LGPL-2.0-or-later
0005  *
0006  * SPDX-FileCopyrightText: 2016 Jan Grulich <jgrulich@redhat.com>
0007  */
0008 
0009 #ifndef XDG_DESKTOP_PORTAL_KDE_NOTIFICATION_H
0010 #define XDG_DESKTOP_PORTAL_KDE_NOTIFICATION_H
0011 
0012 #include <QDBusAbstractAdaptor>
0013 #include <QDBusObjectPath>
0014 
0015 #include <KNotification>
0016 
0017 class NotificationPortal : public QDBusAbstractAdaptor
0018 {
0019     Q_OBJECT
0020     Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.Notification")
0021 public:
0022     explicit NotificationPortal(QObject *parent);
0023     ~NotificationPortal() override;
0024 
0025 public Q_SLOTS:
0026     void AddNotification(const QString &app_id, const QString &id, const QVariantMap &notification);
0027     void RemoveNotification(const QString &app_id, const QString &id);
0028 private Q_SLOTS:
0029     void notificationActivated(uint action);
0030     void notificationClosed();
0031 
0032 private:
0033     QHash<QString, KNotification *> m_notifications;
0034 };
0035 
0036 #endif // XDG_DESKTOP_PORTAL_KDE_NOTIFICATION_H