browsercore/core/network/WebNetworkConnectionManager.h
changeset 3 0954f5dd2cd0
parent 0 1450b09d0cfd
child 9 b39122337a00
equal deleted inserted replaced
1:b0dd75e285d2 3:0954f5dd2cd0
     1 /*
     1 /*
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     2 * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
     4 *
     9 * Initial Contributors:
     5 * This program is free software: you can redistribute it and/or modify
    10 * Nokia Corporation - initial contribution.
     6 * it under the terms of the GNU Lesser General Public License as published by
       
     7 * the Free Software Foundation, version 2.1 of the License.
       
     8 * 
       
     9 * This program is distributed in the hope that it will be useful,
       
    10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
       
    11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
       
    12 * GNU Lesser General Public License for more details.
    11 *
    13 *
    12 * Contributors:
    14 * You should have received a copy of the GNU Lesser General Public License
       
    15 * along with this program.  If not, 
       
    16 * see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
    13 *
    17 *
    14 * Description: 
    18 * Description:
    15 *
    19 *
    16 */
    20 */
    17 
    21 
    18 
       
    19 #ifndef WEBNETWORKCONNECTIONMANAGER_H_
    22 #ifndef WEBNETWORKCONNECTIONMANAGER_H_
    20 #define WEBNETWORKCONNECTIONMANAGER_H_
    23 #define WEBNETWORKCONNECTIONMANAGER_H_
    21 
    24 #include "brtglobal.h"
    22 #include <qnetworkconfigmanager.h>
    25 #include <qnetworkconfigmanager.h>
    23 #include <qnetworksession.h>
    26 #include <qnetworksession.h>
    24 #include "WebNetworkSession.h"
    27 #ifdef QT_MOBILITY_SYSINFO
       
    28 #include <qsysteminfo.h>
       
    29 #endif // QT_MOBILITY_SYSINFO
    25 
    30 
    26 QTM_USE_NAMESPACE
    31 QTM_USE_NAMESPACE
    27 
    32 
    28 namespace WRT {
    33 namespace WRT {
       
    34 	
       
    35 class WebNetworkSession;
    29 
    36 
    30 class WebNetworkConnectionManager : public QObject
    37 class WRT_BROWSER_EXPORT WebNetworkConnectionManager : public QObject
    31 {
    38 {
    32     Q_OBJECT
    39     Q_OBJECT
    33     
    40     
    34 public:
    41 public:
    35     WebNetworkConnectionManager(QObject *parent = 0);
    42     WebNetworkConnectionManager(QObject *parent = 0);
    36     virtual ~WebNetworkConnectionManager();
    43     virtual ~WebNetworkConnectionManager();
       
    44     
    37     void updateConfigurations();
    45     void updateConfigurations();
    38     QNetworkConfiguration defaultConfiguration() const;
    46     QNetworkConfiguration defaultConfiguration() const;
    39     void createSession(QNetworkConfiguration config);
    47     void createSession(QNetworkConfiguration config);
    40     void deleteSession();
    48     void deleteSession();
    41     
    49     bool isOfflined() const { return m_offlined; }
    42 private Q_SLOTS:
    50 
    43     void configurationUpdateCompleted();
    51 #ifdef QT_MOBILITY_SYSINFO
    44     void configurationAdded(const QNetworkConfiguration& config);
    52 Q_SIGNALS:
    45     void configurationRemoved(const QNetworkConfiguration& config);
    53 	  void networkOnlineStateChanged(bool isOnline);
    46     void onlineStateChanged(bool isOnline);
    54 	  void networkSessionNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName);
    47     void configurationChanged(const QNetworkConfiguration& config);
    55 #endif // QT_MOBILITY_SYSINFO
       
    56 
       
    57 protected Q_SLOTS:
       
    58     virtual void handleConfigurationUpdateCompleted();
       
    59     virtual void handleConfigurationAdded(const QNetworkConfiguration& config);
       
    60     virtual void handleConfigurationRemoved(const QNetworkConfiguration& config);
       
    61     virtual void handleOnlineStateChanged(bool isOnline);
       
    62     virtual void handleConfigurationChanged(const QNetworkConfiguration& config);
       
    63     virtual void handleSessionConfigurationChanged(const QNetworkConfiguration &config);
    48        
    64        
    49 private:
    65 private:
       
    66 #ifdef QT_MOBILITY_SYSINFO
       
    67 	  void initializeMapString(void);
       
    68 	  
       
    69 	  QMap<QString, QSystemNetworkInfo::NetworkMode> m_mapStringNetworkMode; 
       
    70 #endif // QT_MOBILITY_SYSINFO
       
    71 
    50     QNetworkConfigurationManager m_NetworkConfigurationManager;
    72     QNetworkConfigurationManager m_NetworkConfigurationManager;
    51     WebNetworkSession *m_WebNetworkSession;
    73     WebNetworkSession *m_WebNetworkSession;
       
    74     bool m_offlined;
    52 };
    75 };
    53 }
       
    54 
    76 
       
    77 } // namesspace WRT
    55 #endif /* WEBNETWORKCONNECTIONMANAGER_H_ */
    78 #endif /* WEBNETWORKCONNECTIONMANAGER_H_ */