File indexing completed on 2024-04-14 15:32:48

0001 /*
0002     SPDX-FileCopyrightText: 2016 Kai Uwe Broulik <kde@privat.broulik.de>
0003 
0004     SPDX-License-Identifier: GPL-2.0-or-later
0005 */
0006 
0007 #ifndef DRKONQI_STATUSNOTIFIER_H
0008 #define DRKONQI_STATUSNOTIFIER_H
0009 
0010 #include <QObject>
0011 
0012 class QTimer;
0013 
0014 class KStatusNotifierItem;
0015 
0016 class CrashedApplication;
0017 
0018 class StatusNotifier : public QObject
0019 {
0020     Q_OBJECT
0021 
0022 public:
0023     explicit StatusNotifier(QObject *parent = nullptr);
0024     ~StatusNotifier() override;
0025 
0026     bool activationAllowed() const;
0027     void setActivationAllowed(bool allowed);
0028 
0029     void show();
0030     void notify();
0031 
0032     static bool notificationServiceRegistered();
0033 
0034 Q_SIGNALS:
0035     void expired();
0036     void activated();
0037 
0038 private:
0039     static bool canBeRestarted(CrashedApplication *app);
0040 
0041     KStatusNotifierItem *m_sni = nullptr;
0042 
0043     bool m_activationAllowed = true;
0044 
0045     QString m_title;
0046 };
0047 
0048 #endif // DRKONQI_STATUSNOTIFIER_H