1/*
2 SPDX-FileCopyrightText: 2005-2006 Olivier Goffart <ogoffart at kde.org>
3 SPDX-FileCopyrightText: 2008 Dmitry Suzdalev <dimsuz@gmail.com>
4 SPDX-FileCopyrightText: 2014 Martin Klapetek <mklapetek@kde.org>
5 SPDX-FileCopyrightText: 2016 Jan Grulich <jgrulich@redhat.com>
6
7 SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
8*/
9
10#ifndef NOTIFYBYPORTAL_H
11#define NOTIFYBYPORTAL_H
12
13#include "knotificationplugin.h"
14
15#include <QVariantList>
16
17#include <memory>
18
19class KNotification;
20class NotifyByPortalPrivate;
21
22class NotifyByPortal : public KNotificationPlugin
23{
24 Q_OBJECT
25public:
26 explicit NotifyByPortal(QObject *parent = nullptr);
27 ~NotifyByPortal() override;
28
29 QString optionName() override
30 {
31 return QStringLiteral("Popup");
32 }
33 void notify(KNotification *notification, const KNotifyConfig &notifyConfig) override;
34 void close(KNotification *notification) override;
35 void update(KNotification *notification, const KNotifyConfig &notifyConfig) override;
36
37private Q_SLOTS:
38
39 // slot to catch appearance or disappearance of org.freedesktop.Desktop DBus service
40 void onServiceOwnerChanged(const QString &, const QString &, const QString &);
41
42 void onPortalNotificationActionInvoked(const QString &, const QString &, const QVariantList &);
43
44private:
45 std::unique_ptr<NotifyByPortalPrivate> const d;
46};
47
48#endif
49

source code of knotifications/src/notifybyportal.h