File indexing completed on 2024-04-28 09:21:08

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     enum class Activation { NotAllowed, Allowed, AlreadySubmitting };
0024 
0025     explicit StatusNotifier(QObject *parent = nullptr);
0026     ~StatusNotifier() override;
0027 
0028     void show();
0029     void notify(Activation activation);
0030 
0031     static bool notificationServiceRegistered();
0032 
0033 Q_SIGNALS:
0034     void expired();
0035     void activated();
0036     void sentryActivated();
0037 
0038 private:
0039     static bool canBeRestarted(CrashedApplication *app);
0040 
0041     KStatusNotifierItem *m_sni = nullptr;
0042     QString m_title;
0043 };
0044 
0045 #endif // DRKONQI_STATUSNOTIFIER_H