File indexing completed on 2024-05-05 05:38:32

0001 /*
0002     SPDX-FileCopyrightText: 2020 Shah Bhushan <bshah@kde.org>
0003 
0004     SPDX-License-Identifier: LGPL-2.1-only OR LGPL-3.0-only OR LicenseRef-KDE-Accepted-LGPL
0005 */
0006 
0007 #pragma once
0008 
0009 #include "abstractnotificationsmodel.h"
0010 
0011 #include "notificationmanager_export.h"
0012 
0013 #include <qqmlregistration.h>
0014 
0015 namespace NotificationManager
0016 {
0017 // WARNING: this is unstable API and does not provide any API or ABI gurantee for future Plasma releases and can be removed without any further notice
0018 class NOTIFICATIONMANAGER_EXPORT WatchedNotificationsModel : public AbstractNotificationsModel
0019 {
0020     Q_OBJECT
0021     QML_ELEMENT
0022 
0023     Q_PROPERTY(bool valid READ valid NOTIFY validChanged)
0024 
0025 public:
0026     explicit WatchedNotificationsModel();
0027     ~WatchedNotificationsModel();
0028 
0029     Q_INVOKABLE void expire(uint notificationId) override;
0030     Q_INVOKABLE void close(uint notificationId) override;
0031 
0032     Q_INVOKABLE void invokeDefaultAction(uint notificationId, Notifications::InvokeBehavior behavior = Notifications::None) override;
0033     Q_INVOKABLE void invokeAction(uint notificationId, const QString &actionName, Notifications::InvokeBehavior behavior = Notifications::None) override;
0034     Q_INVOKABLE void reply(uint notificationId, const QString &text, Notifications::InvokeBehavior behavior = Notifications::None) override;
0035     bool valid();
0036 
0037 Q_SIGNALS:
0038     void validChanged(bool valid);
0039 
0040 private:
0041     class Private;
0042     Private *const d;
0043     Q_DISABLE_COPY(WatchedNotificationsModel)
0044 };
0045 
0046 }