File indexing completed on 2024-05-12 05:04:09
0001 // SPDX-FileCopyrightText: 2022 Carl Schwan <carl@carlschwan.eu> 0002 // SPDX-License-Identifier: GPL-3.0-or-later 0003 0004 #pragma once 0005 0006 #include "post.h" 0007 0008 class QNetworkAccessManager; 0009 0010 /// Handles desktop notifications using KNotification 0011 class NotificationHandler : public QObject 0012 { 0013 Q_OBJECT 0014 0015 public: 0016 explicit NotificationHandler(QNetworkAccessManager *nam, QObject *parent = nullptr); 0017 0018 /// Display a new notification for an account 0019 /// \param notification The shared handle for the notification 0020 /// \param account The account the notification belongs to 0021 void handle(std::shared_ptr<Notification> notification, AbstractAccount *account); 0022 0023 private: 0024 QNetworkAccessManager *m_nam; 0025 };