File indexing completed on 2024-04-28 15:29:13

0001 /*
0002     SPDX-FileCopyrightText: 2019 Piyush Aggarwal <piyushaggarwal002@gmail.com>
0003 
0004     SPDX-License-Identifier: LGPL-2.0-or-later
0005 */
0006 
0007 #ifndef NOTIFYBYSNORE_H
0008 #define NOTIFYBYSNORE_H
0009 
0010 #include "knotificationplugin.h"
0011 
0012 #include <QLocalServer>
0013 #include <QProcess>
0014 #include <QTemporaryDir>
0015 
0016 class NotifyBySnore : public KNotificationPlugin
0017 {
0018     Q_OBJECT
0019 
0020 public:
0021     explicit NotifyBySnore(QObject *parent = nullptr);
0022     ~NotifyBySnore() override;
0023 
0024     QString optionName() override
0025     {
0026         return QStringLiteral("Popup");
0027     }
0028     void notify(KNotification *notification, KNotifyConfig *config) override;
0029     void notifyDeferred(KNotification *notification);
0030     void close(KNotification *notification) override;
0031     void update(KNotification *notification, KNotifyConfig *config) override;
0032 
0033 private:
0034     QHash<int, QPointer<KNotification>> m_notifications;
0035     QLocalServer m_server;
0036     QTemporaryDir m_iconDir;
0037 };
0038 
0039 #endif // NOTIFYBYSNORE_H