1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/netwerk/system/qt/nsQtNetworkManager.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,56 @@ 1.4 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.5 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.6 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.7 + 1.8 +#ifndef NSQTNETWORKMANAGER_H_ 1.9 +#define NSQTNETWORKMANAGER_H_ 1.10 + 1.11 +#include <QNetworkConfigurationManager> 1.12 +#include <QObject> 1.13 +#include <QTimer> 1.14 +#include <QNetworkConfiguration> 1.15 +#include <QNetworkSession> 1.16 +#include "nscore.h" 1.17 + 1.18 +class nsQtNetworkManager; 1.19 + 1.20 + 1.21 + 1.22 +class nsQtNetworkManager : public QObject 1.23 +{ 1.24 + Q_OBJECT 1.25 + public: 1.26 + static void create(); 1.27 + static void destroy(); 1.28 + virtual ~nsQtNetworkManager(); 1.29 + 1.30 + static nsQtNetworkManager* get() { return gQtNetworkManager; } 1.31 + 1.32 + static bool IsConnected(); 1.33 + static bool GetLinkStatusKnown(); 1.34 + static void enableInstance(); 1.35 + bool openConnection(const QString&); 1.36 + bool isOnline(); 1.37 + Q_SIGNALS: 1.38 + void openConnectionSignal(); 1.39 + 1.40 + public Q_SLOTS: 1.41 + void closeSession(); 1.42 + void onlineStateChanged(bool); 1.43 + 1.44 + private Q_SLOTS: 1.45 + void openSession(); 1.46 + 1.47 + private: 1.48 + explicit nsQtNetworkManager(QObject* parent = 0); 1.49 + 1.50 + static nsQtNetworkManager* gQtNetworkManager; 1.51 + QNetworkSession* networkSession; 1.52 + QNetworkConfiguration networkConfiguration; 1.53 + QNetworkConfigurationManager networkConfigurationManager; 1.54 + QTimer mBlockTimer; 1.55 + bool mOnline; 1.56 +}; 1.57 + 1.58 +#endif /* NSQTNETWORKMANAGER_H_ */ 1.59 +