mirror of https://github.com/Qortal/Brooklyn
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
47 lines
1.2 KiB
47 lines
1.2 KiB
/* |
|
SPDX-FileCopyrightText: 2018-2019 Kai Uwe Broulik <[email protected]> |
|
|
|
SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL |
|
*/ |
|
|
|
#pragma once |
|
|
|
#include "notification.h" |
|
#include "server.h" |
|
|
|
#include <QDateTime> |
|
#include <QTimer> |
|
|
|
class QTimer; |
|
|
|
namespace NotificationManager |
|
{ |
|
class Q_DECL_HIDDEN AbstractNotificationsModel::Private |
|
{ |
|
public: |
|
explicit Private(AbstractNotificationsModel *q); |
|
~Private(); |
|
|
|
void onNotificationAdded(const Notification ¬ification); |
|
void onNotificationReplaced(uint replacedId, const Notification ¬ification); |
|
void onNotificationRemoved(uint notificationId, Server::CloseReason reason); |
|
|
|
void setupNotificationTimeout(const Notification ¬ification); |
|
|
|
void removeRows(const QVector<int> &rows); |
|
|
|
AbstractNotificationsModel *q; |
|
|
|
QVector<Notification> notifications; |
|
// Fallback timeout to ensure all notifications expire eventually |
|
// otherwise when it isn't shown to the user and doesn't expire |
|
// an app might wait indefinitely for the notification to do so |
|
QHash<uint /*notificationId*/, QTimer *> notificationTimeouts; |
|
|
|
QVector<uint /*notificationId*/> pendingRemovals; |
|
QTimer pendingRemovalTimer; |
|
|
|
QDateTime lastRead; |
|
}; |
|
|
|
}
|
|
|