michael@0: /* This Source Code Form is subject to the terms of the Mozilla Public michael@0: * License, v. 2.0. If a copy of the MPL was not distributed with this michael@0: * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ michael@0: michael@0: #ifndef NSQTNETWORKMANAGER_H_ michael@0: #define NSQTNETWORKMANAGER_H_ michael@0: michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include michael@0: #include "nscore.h" michael@0: michael@0: class nsQtNetworkManager; michael@0: michael@0: michael@0: michael@0: class nsQtNetworkManager : public QObject michael@0: { michael@0: Q_OBJECT michael@0: public: michael@0: static void create(); michael@0: static void destroy(); michael@0: virtual ~nsQtNetworkManager(); michael@0: michael@0: static nsQtNetworkManager* get() { return gQtNetworkManager; } michael@0: michael@0: static bool IsConnected(); michael@0: static bool GetLinkStatusKnown(); michael@0: static void enableInstance(); michael@0: bool openConnection(const QString&); michael@0: bool isOnline(); michael@0: Q_SIGNALS: michael@0: void openConnectionSignal(); michael@0: michael@0: public Q_SLOTS: michael@0: void closeSession(); michael@0: void onlineStateChanged(bool); michael@0: michael@0: private Q_SLOTS: michael@0: void openSession(); michael@0: michael@0: private: michael@0: explicit nsQtNetworkManager(QObject* parent = 0); michael@0: michael@0: static nsQtNetworkManager* gQtNetworkManager; michael@0: QNetworkSession* networkSession; michael@0: QNetworkConfiguration networkConfiguration; michael@0: QNetworkConfigurationManager networkConfigurationManager; michael@0: QTimer mBlockTimer; michael@0: bool mOnline; michael@0: }; michael@0: michael@0: #endif /* NSQTNETWORKMANAGER_H_ */ michael@0: