netwerk/system/qt/nsQtNetworkManager.h

Wed, 31 Dec 2014 06:09:35 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Wed, 31 Dec 2014 06:09:35 +0100
changeset 0
6474c204b198
permissions
-rw-r--r--

Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.

     1 /* This Source Code Form is subject to the terms of the Mozilla Public
     2  * License, v. 2.0. If a copy of the MPL was not distributed with this
     3  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
     5 #ifndef NSQTNETWORKMANAGER_H_
     6 #define NSQTNETWORKMANAGER_H_
     8 #include <QNetworkConfigurationManager>
     9 #include <QObject>
    10 #include <QTimer>
    11 #include <QNetworkConfiguration>
    12 #include <QNetworkSession>
    13 #include "nscore.h"
    15 class nsQtNetworkManager;
    19 class nsQtNetworkManager : public QObject
    20 {
    21   Q_OBJECT
    22   public:
    23     static void create();
    24     static void destroy();
    25     virtual ~nsQtNetworkManager();
    27     static nsQtNetworkManager* get() { return gQtNetworkManager; }
    29     static bool IsConnected();
    30     static bool GetLinkStatusKnown();
    31     static void enableInstance();
    32     bool openConnection(const QString&);
    33     bool isOnline();
    34   Q_SIGNALS:
    35     void openConnectionSignal();
    37   public Q_SLOTS:
    38     void closeSession();
    39     void onlineStateChanged(bool);
    41   private Q_SLOTS:
    42     void openSession();
    44   private:
    45     explicit nsQtNetworkManager(QObject* parent = 0);
    47     static nsQtNetworkManager* gQtNetworkManager;
    48     QNetworkSession* networkSession;
    49     QNetworkConfiguration networkConfiguration;
    50     QNetworkConfigurationManager networkConfigurationManager;
    51     QTimer mBlockTimer;
    52     bool mOnline;
    53 };
    55 #endif /* NSQTNETWORKMANAGER_H_ */

mercurial