File indexing completed on 2024-05-19 15:49:30
0001 /* 0002 SPDX-FileCopyrightText: 2016-2023 Laurent Montel <montel@kde.org> 0003 0004 SPDX-License-Identifier: GPL-2.0-or-later 0005 */ 0006 0007 #pragma once 0008 0009 #include <QObject> 0010 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0011 class QNetworkConfigurationManager; 0012 #endif 0013 namespace TextTranslator 0014 { 0015 /** 0016 * @brief The NetworkManager class 0017 * @author Laurent Montel <montel@kde.org> 0018 */ 0019 class NetworkManager : public QObject 0020 { 0021 Q_OBJECT 0022 public: 0023 explicit NetworkManager(QObject *parent = nullptr); 0024 ~NetworkManager() override; 0025 static NetworkManager *self(); 0026 0027 Q_REQUIRED_RESULT bool isOnline() const; 0028 0029 Q_SIGNALS: 0030 void networkStatusChanged(bool isOnline); 0031 0032 private: 0033 #if QT_VERSION < QT_VERSION_CHECK(6, 0, 0) 0034 QNetworkConfigurationManager *const mNetworkConfigureManager; 0035 #endif 0036 }; 0037 }