File indexing completed on 2024-03-24 17:10:47

0001 /*
0002     SPDX-FileCopyrightText: 2016 Jan Grulich <jgrulich@redhat.com>
0003     SPDX-FileCopyrightText: 2020 Kai Uwe Broulik <kde@broulik.de>
0004 
0005     SPDX-License-Identifier: GPL-2.0-only OR GPL-3.0-only OR LicenseRef-KDE-Accepted-GPL
0006 */
0007 
0008 #ifndef PLASMA_NM_CONNECTIVITY_MONITOR_H
0009 #define PLASMA_NM_CONNECTIVITY_MONITOR_H
0010 
0011 #include <NetworkManagerQt/Manager>
0012 
0013 #include <KNotification>
0014 #include <QObject>
0015 #include <QPointer>
0016 #include <QTimer>
0017 
0018 class ConnectivityMonitor : public QObject
0019 {
0020     Q_OBJECT
0021 public:
0022     explicit ConnectivityMonitor(QObject *parent);
0023     ~ConnectivityMonitor() override;
0024 
0025 private Q_SLOTS:
0026     void connectivityChanged(NetworkManager::Connectivity connectivity);
0027     void checkConnectivity();
0028 
0029 private:
0030     void showLimitedConnectivityNotification();
0031 
0032     QPointer<KNotification> m_notification;
0033 
0034     QTimer m_limitedConnectivityTimer;
0035 };
0036 
0037 #endif // PLASMA_NM_CONNECTIVITY_MONITOR_H