Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 2 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 3 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 4 | |
michael@0 | 5 | #ifndef NSQTNETWORKMANAGER_H_ |
michael@0 | 6 | #define NSQTNETWORKMANAGER_H_ |
michael@0 | 7 | |
michael@0 | 8 | #include <QNetworkConfigurationManager> |
michael@0 | 9 | #include <QObject> |
michael@0 | 10 | #include <QTimer> |
michael@0 | 11 | #include <QNetworkConfiguration> |
michael@0 | 12 | #include <QNetworkSession> |
michael@0 | 13 | #include "nscore.h" |
michael@0 | 14 | |
michael@0 | 15 | class nsQtNetworkManager; |
michael@0 | 16 | |
michael@0 | 17 | |
michael@0 | 18 | |
michael@0 | 19 | class nsQtNetworkManager : public QObject |
michael@0 | 20 | { |
michael@0 | 21 | Q_OBJECT |
michael@0 | 22 | public: |
michael@0 | 23 | static void create(); |
michael@0 | 24 | static void destroy(); |
michael@0 | 25 | virtual ~nsQtNetworkManager(); |
michael@0 | 26 | |
michael@0 | 27 | static nsQtNetworkManager* get() { return gQtNetworkManager; } |
michael@0 | 28 | |
michael@0 | 29 | static bool IsConnected(); |
michael@0 | 30 | static bool GetLinkStatusKnown(); |
michael@0 | 31 | static void enableInstance(); |
michael@0 | 32 | bool openConnection(const QString&); |
michael@0 | 33 | bool isOnline(); |
michael@0 | 34 | Q_SIGNALS: |
michael@0 | 35 | void openConnectionSignal(); |
michael@0 | 36 | |
michael@0 | 37 | public Q_SLOTS: |
michael@0 | 38 | void closeSession(); |
michael@0 | 39 | void onlineStateChanged(bool); |
michael@0 | 40 | |
michael@0 | 41 | private Q_SLOTS: |
michael@0 | 42 | void openSession(); |
michael@0 | 43 | |
michael@0 | 44 | private: |
michael@0 | 45 | explicit nsQtNetworkManager(QObject* parent = 0); |
michael@0 | 46 | |
michael@0 | 47 | static nsQtNetworkManager* gQtNetworkManager; |
michael@0 | 48 | QNetworkSession* networkSession; |
michael@0 | 49 | QNetworkConfiguration networkConfiguration; |
michael@0 | 50 | QNetworkConfigurationManager networkConfigurationManager; |
michael@0 | 51 | QTimer mBlockTimer; |
michael@0 | 52 | bool mOnline; |
michael@0 | 53 | }; |
michael@0 | 54 | |
michael@0 | 55 | #endif /* NSQTNETWORKMANAGER_H_ */ |
michael@0 | 56 |