Changeset View
Changeset View
Standalone View
Standalone View
src/notification.h
Show All 15 Lines | |||||
16 | * | 16 | * | ||
17 | * Authors: | 17 | * Authors: | ||
18 | * Jan Grulich <jgrulich@redhat.com> | 18 | * Jan Grulich <jgrulich@redhat.com> | ||
19 | */ | 19 | */ | ||
20 | 20 | | |||
21 | #ifndef XDG_DESKTOP_PORTAL_KDE_NOTIFICATION_H | 21 | #ifndef XDG_DESKTOP_PORTAL_KDE_NOTIFICATION_H | ||
22 | #define XDG_DESKTOP_PORTAL_KDE_NOTIFICATION_H | 22 | #define XDG_DESKTOP_PORTAL_KDE_NOTIFICATION_H | ||
23 | 23 | | |||
24 | #include <QObject> | 24 | #include <QDBusAbstractAdaptor> | ||
25 | #include <QDBusObjectPath> | 25 | #include <QDBusObjectPath> | ||
26 | 26 | | |||
27 | #include <KNotification> | 27 | #include <KNotification> | ||
28 | 28 | | |||
29 | class Notification : public QObject | 29 | class NotificationPortal : public QDBusAbstractAdaptor | ||
30 | { | 30 | { | ||
31 | Q_OBJECT | 31 | Q_OBJECT | ||
32 | Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.Notification") | 32 | Q_CLASSINFO("D-Bus Interface", "org.freedesktop.impl.portal.Notification") | ||
33 | public: | 33 | public: | ||
34 | Notification(QObject *parent = 0); | 34 | NotificationPortal(QObject *parent); | ||
35 | ~Notification(); | 35 | ~NotificationPortal(); | ||
36 | 36 | | |||
37 | public Q_SLOTS: | 37 | public Q_SLOTS: | ||
38 | void addNotification(const QString &app_id, | 38 | void AddNotification(const QString &app_id, | ||
39 | const QString &id, | 39 | const QString &id, | ||
40 | const QVariantMap ¬ification); | 40 | const QVariantMap ¬ification); | ||
41 | void removeNotification(const QString &app_id, | 41 | void RemoveNotification(const QString &app_id, | ||
42 | const QString &id); | 42 | const QString &id); | ||
43 | private Q_SLOTS: | 43 | private Q_SLOTS: | ||
44 | void notificationActivated(uint action); | 44 | void notificationActivated(uint action); | ||
45 | void notificationClosed(); | 45 | void notificationClosed(); | ||
46 | 46 | | |||
47 | private: | 47 | private: | ||
48 | QHash<QString, KNotification*> m_notifications; | 48 | QHash<QString, KNotification*> m_notifications; | ||
49 | }; | 49 | }; | ||
50 | 50 | | |||
51 | #endif // XDG_DESKTOP_PORTAL_KDE_NOTIFICATION_H | 51 | #endif // XDG_DESKTOP_PORTAL_KDE_NOTIFICATION_H |