browsercore/core/network/WebNetworkConnectionManager.h
author hgs
Fri, 15 Oct 2010 17:30:59 -0400
changeset 16 3c88a81ff781
parent 9 b39122337a00
permissions -rw-r--r--
201041
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     1
/*
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     2
* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     3
* All rights reserved.
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
     4
*
3
hgs
parents: 0
diff changeset
     5
* This program is free software: you can redistribute it and/or modify
hgs
parents: 0
diff changeset
     6
* it under the terms of the GNU Lesser General Public License as published by
hgs
parents: 0
diff changeset
     7
* the Free Software Foundation, version 2.1 of the License.
hgs
parents: 0
diff changeset
     8
* 
hgs
parents: 0
diff changeset
     9
* This program is distributed in the hope that it will be useful,
hgs
parents: 0
diff changeset
    10
* but WITHOUT ANY WARRANTY; without even the implied warranty of
hgs
parents: 0
diff changeset
    11
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
hgs
parents: 0
diff changeset
    12
* GNU Lesser General Public License for more details.
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    13
*
3
hgs
parents: 0
diff changeset
    14
* You should have received a copy of the GNU Lesser General Public License
hgs
parents: 0
diff changeset
    15
* along with this program.  If not, 
hgs
parents: 0
diff changeset
    16
* see "http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html/".
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    17
*
3
hgs
parents: 0
diff changeset
    18
* Description:
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    19
*
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    20
*/
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    21
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    22
#ifndef WEBNETWORKCONNECTIONMANAGER_H_
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    23
#define WEBNETWORKCONNECTIONMANAGER_H_
3
hgs
parents: 0
diff changeset
    24
#include "brtglobal.h"
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    25
#include <qnetworkconfigmanager.h>
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    26
#include <qnetworksession.h>
3
hgs
parents: 0
diff changeset
    27
#ifdef QT_MOBILITY_SYSINFO
hgs
parents: 0
diff changeset
    28
#include <qsysteminfo.h>
16
hgs
parents: 9
diff changeset
    29
QTM_USE_NAMESPACE
3
hgs
parents: 0
diff changeset
    30
#endif // QT_MOBILITY_SYSINFO
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    31
16
hgs
parents: 9
diff changeset
    32
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    33
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    34
namespace WRT {
3
hgs
parents: 0
diff changeset
    35
	
hgs
parents: 0
diff changeset
    36
class WebNetworkSession;
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    37
3
hgs
parents: 0
diff changeset
    38
class WRT_BROWSER_EXPORT WebNetworkConnectionManager : public QObject
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    39
{
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    40
    Q_OBJECT
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    41
    
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    42
public:
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    43
    WebNetworkConnectionManager(QObject *parent = 0);
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    44
    virtual ~WebNetworkConnectionManager();
3
hgs
parents: 0
diff changeset
    45
    
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    46
    void updateConfigurations();
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    47
    QNetworkConfiguration defaultConfiguration() const;
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    48
    void createSession(QNetworkConfiguration config);
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    49
    void deleteSession();
3
hgs
parents: 0
diff changeset
    50
    bool isOfflined() const { return m_offlined; }
hgs
parents: 0
diff changeset
    51
hgs
parents: 0
diff changeset
    52
#ifdef QT_MOBILITY_SYSINFO
hgs
parents: 0
diff changeset
    53
Q_SIGNALS:
hgs
parents: 0
diff changeset
    54
	  void networkOnlineStateChanged(bool isOnline);
hgs
parents: 0
diff changeset
    55
	  void networkSessionNameChanged(QSystemNetworkInfo::NetworkMode mode, const QString &netName);
hgs
parents: 0
diff changeset
    56
#endif // QT_MOBILITY_SYSINFO
hgs
parents: 0
diff changeset
    57
hgs
parents: 0
diff changeset
    58
protected Q_SLOTS:
hgs
parents: 0
diff changeset
    59
    virtual void handleConfigurationUpdateCompleted();
hgs
parents: 0
diff changeset
    60
    virtual void handleConfigurationAdded(const QNetworkConfiguration& config);
hgs
parents: 0
diff changeset
    61
    virtual void handleConfigurationRemoved(const QNetworkConfiguration& config);
hgs
parents: 0
diff changeset
    62
    virtual void handleOnlineStateChanged(bool isOnline);
hgs
parents: 0
diff changeset
    63
    virtual void handleConfigurationChanged(const QNetworkConfiguration& config);
hgs
parents: 0
diff changeset
    64
    virtual void handleSessionConfigurationChanged(const QNetworkConfiguration &config);
9
hgs
parents: 3
diff changeset
    65
    virtual void handleSessionRoamingRejected();
hgs
parents: 3
diff changeset
    66
    virtual void handleHideSecureIcon();
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    67
       
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    68
private:
3
hgs
parents: 0
diff changeset
    69
#ifdef QT_MOBILITY_SYSINFO
hgs
parents: 0
diff changeset
    70
	  void initializeMapString(void);
hgs
parents: 0
diff changeset
    71
	  
hgs
parents: 0
diff changeset
    72
	  QMap<QString, QSystemNetworkInfo::NetworkMode> m_mapStringNetworkMode; 
hgs
parents: 0
diff changeset
    73
#endif // QT_MOBILITY_SYSINFO
hgs
parents: 0
diff changeset
    74
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    75
    QNetworkConfigurationManager m_NetworkConfigurationManager;
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    76
    WebNetworkSession *m_WebNetworkSession;
3
hgs
parents: 0
diff changeset
    77
    bool m_offlined;
9
hgs
parents: 3
diff changeset
    78
    bool m_roamingRejected;
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    79
};
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    80
3
hgs
parents: 0
diff changeset
    81
} // namesspace WRT
0
1450b09d0cfd Revision: 201015
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff changeset
    82
#endif /* WEBNETWORKCONNECTIONMANAGER_H_ */