phonesettings/cpphonesettingsplugins/cpnetworkplugin/src/cpnetworkstatus.h
changeset 45 6b911d05207e
child 65 2a5d4ab426d3
equal deleted inserted replaced
37:ba76fc04e6c2 45:6b911d05207e
       
     1 /*
       
     2  * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
       
     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  *
       
     9  * Initial Contributors:
       
    10  * Nokia Corporation - initial contribution.
       
    11  *
       
    12  * Contributors:
       
    13  *
       
    14  * Description:  
       
    15  *   
       
    16  */
       
    17 
       
    18 #ifndef CPNETWORKSTATUS_H
       
    19 #define CPNETWORKSTATUS_H
       
    20 
       
    21 #include <qobject.h>
       
    22 #include <qsysteminfo.h>
       
    23 
       
    24 using namespace QtMobility;
       
    25 
       
    26 class CpSettingFormItemData;
       
    27 class HbIcon;
       
    28 
       
    29 class CpNetworkStatus 
       
    30     : public QObject
       
    31 
       
    32 {
       
    33     Q_OBJECT
       
    34 
       
    35 public:
       
    36     
       
    37     CpNetworkStatus();
       
    38     
       
    39     ~CpNetworkStatus();
       
    40     
       
    41     QString statusText() const;
       
    42     
       
    43     HbIcon statusIcon() const;
       
    44     
       
    45     void setSettingFormItemData(CpSettingFormItemData *data);
       
    46     
       
    47 public slots:
       
    48 
       
    49     void networkNameChanged(
       
    50             QSystemNetworkInfo::NetworkMode mode, 
       
    51             const QString &netName);
       
    52     
       
    53     void networkStatusChanged(
       
    54             QSystemNetworkInfo::NetworkMode mode, 
       
    55             QSystemNetworkInfo::NetworkStatus status);
       
    56     
       
    57 private:
       
    58     
       
    59     QString statusIconLocicalName() const;
       
    60     
       
    61     bool connectedToNetwork() const;
       
    62     
       
    63 private:
       
    64     
       
    65     QScopedPointer<QSystemNetworkInfo> m_networkInfo;
       
    66     
       
    67     QScopedPointer<QSystemDeviceInfo> m_deviceInfo;
       
    68         
       
    69     // Not own
       
    70     CpSettingFormItemData *m_settingFormItemData;
       
    71     
       
    72 };
       
    73 
       
    74 #endif  // CPNETWORKSTATUS_H