connectionmonitoring/connectionmonitorui/inc/WlanConnectionInfo.h
branchRCL_3
changeset 58 83ca720e2b9a
parent 0 5a93021fdf25
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Represents a WLAN connection
       
    15 *     
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef WLANCONNECTIONINFO_H_INCLUDED
       
    21 #define WLANCONNECTIONINFO_H_INCLUDED
       
    22 
       
    23 // INCLUDES
       
    24 #include "ConnectionInfoBase.h"
       
    25 
       
    26 // CONSTANTS
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class RConnectionMonitor;
       
    30 
       
    31 // Calibration of WLAN signal strength
       
    32 enum TWlanSignalStrength
       
    33     {
       
    34     EWlanSignalStrengthMax = 60,
       
    35     EWlanSignalStrengthGood = 74,
       
    36     EWlanSignalStrengthLow = 87,
       
    37     EWlanSignalStrengthMin = 100,
       
    38     EWlanSignalUnavailable = 9999
       
    39     };
       
    40 
       
    41 // WLAN Network modes
       
    42 enum TWlanNetworkMode
       
    43     {
       
    44     EWlanNetworkModeInfrastructure = 0,
       
    45     EWlanNetworkModeAdHoc,
       
    46     EWlanNetworkModeSecInfrastructure,
       
    47     EWlanNetworkModeUnavailable
       
    48     };
       
    49 
       
    50 // WLAN security modes
       
    51 enum TWlanSecurityMode
       
    52     {
       
    53     EWlanSecurityModeOpenNetwork = 0,
       
    54     EWlanSecurityModeWEP,
       
    55     EWlanSecurityMode8021x,
       
    56     EWlanSecurityModeWPA,
       
    57     EWlanSecurityWpaPsk,
       
    58     EWlanSecurityModeUnavailable
       
    59     };
       
    60 
       
    61 // CONSTANTS
       
    62 
       
    63 const TReal32 KDiffOfWlanSignalStrength = 
       
    64                             EWlanSignalStrengthMin - EWlanSignalStrengthMax;
       
    65 
       
    66 
       
    67 // CLASS DECLARATION
       
    68 /**
       
    69 * Represents a WLAN connection.
       
    70 */
       
    71 class CWlanConnectionInfo : public CConnectionInfoBase
       
    72     {
       
    73     public:
       
    74         /**
       
    75         * Static constructor
       
    76         * @param aConnectionId The id of the given connection.
       
    77         * @param aMonitor for refreshing details
       
    78         * @param aConnectionBearerType the bearer type of connection
       
    79         * @param aEasyWlanIAPName Name of the Easy WLAN access point
       
    80         * @param aActiveWrapper the for refreshing
       
    81         */
       
    82         static CWlanConnectionInfo* NewL( TInt aConnectionId, 
       
    83                               RConnectionMonitor* const aConnectionMonitor,
       
    84                               TConnMonBearerType aConnectionBearerType,
       
    85                               const HBufC* aEasyWlanIAPName,
       
    86                               CActiveWrapper* aActiveWrapper );
       
    87 
       
    88         /**
       
    89         * Destructor
       
    90         */
       
    91         virtual ~CWlanConnectionInfo();
       
    92         
       
    93     public:    
       
    94         /**
       
    95         * Give back a copy of connection. 
       
    96         */
       
    97         virtual CConnectionInfoBase* DeepCopyL();
       
    98     
       
    99         /**
       
   100         * Refreshing all details of connection. Leaves if refreshing 
       
   101         * any of detais is failed.
       
   102         */
       
   103         virtual void RefreshDetailsL();
       
   104 
       
   105         /**
       
   106         * Refresh iListBoxItemText text, connection ListBox has a 
       
   107         * reference to this text.
       
   108         */
       
   109         virtual void RefreshConnectionListBoxItemTextL();
       
   110 
       
   111         /**
       
   112         * Refresh details array of connection. DetailsListBox has a 
       
   113         * reference to this array.
       
   114         */
       
   115         virtual void RefreshDetailsArrayL();
       
   116 
       
   117         /**
       
   118         * Gives back the icon id of connection 
       
   119         * @return the icon id of connection 
       
   120         */
       
   121         virtual TUint GetIconId() const;
       
   122 
       
   123         /**
       
   124         * Gives back the connection is EasyWLAN or not.
       
   125         * @return ETrue if the selected conenction EasyWLAN,
       
   126         * EFalse otherwise
       
   127         */
       
   128         virtual TBool IsEasyWLAN() const;
       
   129         
       
   130         /**
       
   131         * Gives back current Name of Network ( SSID )
       
   132         * @return iNetworkName
       
   133         */
       
   134         virtual HBufC* GetWlanNetworkNameLC() const;
       
   135 
       
   136         /**
       
   137         * Gives back current SignalStrength
       
   138         * @return iSignalStrength
       
   139         */        
       
   140         TWlanSignalStrength GetWlanSignalStrength() const;
       
   141 
       
   142         /**
       
   143         * Gives back current NetworkMode
       
   144         * @return iNetworkMode
       
   145         */
       
   146         TWlanNetworkMode GetWlanNetworkMode() const;
       
   147 
       
   148         /**
       
   149         * Gives back current SecurityMode
       
   150         * @return iSecurityMode
       
   151         */        
       
   152         TWlanSecurityMode GetWlanSecurityMode() const;
       
   153 
       
   154         /**
       
   155         * Gives back current TxPower
       
   156         * @return iTxPower
       
   157         */        
       
   158         TUint GetWlanTxPower() const;
       
   159 
       
   160     protected:  // Constructors
       
   161         /**
       
   162         * Constructor
       
   163         * @param aConnectionId The id of the given connection.
       
   164         * @param aMonitor for refreshing details
       
   165         * @param aConnectionBearerType the bearer type of connection
       
   166         * @param aActiveWrapper the for refreshing
       
   167         */
       
   168         CWlanConnectionInfo( TInt aConnectionId, 
       
   169                              RConnectionMonitor* const aConnectionMonitor,
       
   170                              TConnMonBearerType aConnectionBearerType,
       
   171                              CActiveWrapper* aActiveWrapper );
       
   172 
       
   173         /**
       
   174         * Second phase construction
       
   175         */
       
   176         void ConstructL();
       
   177 
       
   178     protected:
       
   179         /**
       
   180         * Creates an array with requrired details of connection to
       
   181         * the listbox which visulaize details of connection. This member
       
   182         * is called at initialization.
       
   183         */
       
   184         virtual void ToArrayDetailsL();
       
   185 
       
   186         /**
       
   187         * Refreshing NetworkName. Leaves if did not get valid data from
       
   188         * ConnectionMonitor.
       
   189         */
       
   190         void RefreshNetworkNameL();
       
   191         
       
   192         /**
       
   193         * Refreshing SignalStrength. Leaves if did not get valid data from
       
   194         * ConnectionMonitor.
       
   195         */
       
   196         void RefreshSignalStrength();
       
   197 
       
   198         /**
       
   199         * Refreshing NetworkMode. Leaves if did not get valid data from
       
   200         * ConnectionMonitor.
       
   201         */
       
   202         void RefreshNetworkMode();
       
   203 
       
   204         /**
       
   205         * Refreshing SecurityMode. Leaves if did not get valid data from
       
   206         * ConnectionMonitor.
       
   207         */
       
   208         void RefreshSecurityMode();
       
   209 
       
   210         /**
       
   211         * Refreshing TxPower. Leaves if did not get valid data from
       
   212         * ConnectionMonitor.
       
   213         */
       
   214         void RefreshTxPowerL();
       
   215 
       
   216         /**
       
   217         * Gives back the string representation of SignalStrength.
       
   218         */
       
   219         HBufC* ToStringSignalStrengthLC() const;
       
   220 
       
   221         /**
       
   222         * Gives back the string representation of Mode.
       
   223         */
       
   224         HBufC* ToStringNetworkModeLC() const;
       
   225 
       
   226         /**
       
   227         * Gives back the string representation of Security.
       
   228         */
       
   229         HBufC* ToStringSecurityModeLC() const;
       
   230 
       
   231         /**
       
   232         * Gives back the string representation of TxPower.
       
   233         */
       
   234         HBufC* ToStringTxPowerLC() const;
       
   235 
       
   236     private:
       
   237 
       
   238     protected:
       
   239 
       
   240         /**
       
   241         * The name of network (SSID)
       
   242         */
       
   243         TName                       iWlanNetworkName;
       
   244         
       
   245         /**
       
   246         * Signale strength of WLAN connection
       
   247         */
       
   248         TWlanSignalStrength         iSignalStrength;
       
   249         
       
   250         /**
       
   251         * Network mode of WLAN conenction
       
   252         */ 
       
   253         TWlanNetworkMode            iNetworkMode;
       
   254     
       
   255         /**
       
   256         * Security mode of WLAN conenction
       
   257         */ 
       
   258         TWlanSecurityMode           iSecurityMode;
       
   259 
       
   260         /**
       
   261         * TxPower of WLAN conenction
       
   262         */
       
   263         TUint                        iTxPower;
       
   264         
       
   265         /**
       
   266         * ETrue if the selected conenction EasyWLAN
       
   267         */ 
       
   268         TBool                        iEasyWlan;
       
   269     };
       
   270 
       
   271 #endif // WLANCONNECTIONINFO_H_INCLUDED
       
   272 //End of File.