wlanutilities/wlanindicatorplugin/inc/wlanindicatorpluginimplementation.h
changeset 19 10810c91db26
parent 3 ff3b37722600
child 22 498f36116140
equal deleted inserted replaced
3:ff3b37722600 19:10810c91db26
     1 /*
       
     2 * Copyright (c) 2008 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:  Defines the CWlanIndicatorPluginImplementation class
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CWLANINDICATORPLUGINIMPLEMENTATION_H
       
    21 #define CWLANINDICATORPLUGINIMPLEMENTATION_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <AknIndicatorPlugin.h> // CAknIndicatorPlugin
       
    25 #include <wlanmgmtcommon.h>
       
    26 #include <wlanmgmtclient.h>
       
    27 #include <rconnmon.h>
       
    28 
       
    29 //  CONSTANTS
       
    30 const TInt KWlanMaxAccessPointNameLength = 50;
       
    31 
       
    32 //  FORWARD DECLARATIONS
       
    33 class CCoeEnv;
       
    34 
       
    35 //  CLASS DECLARATIONS
       
    36 struct TWliWlanInfo
       
    37     {
       
    38     // Network name (unknown: SSID, known: IAP name), TBuf8
       
    39     TWlanSsid iSsid;
       
    40 
       
    41     //Internet Access Point Id. 0 if the IAP has not been defined. 
       
    42     TUint32 iIapId;
       
    43 
       
    44     // The name of the WLAN IAP, TBuf16
       
    45     TBuf<KWlanMaxAccessPointNameLength> iNetworkName;
       
    46 };
       
    47 
       
    48 
       
    49 /**
       
    50 *  WLAN Indicator Plug-in implementation
       
    51 *
       
    52 *  @since 5.0
       
    53 */
       
    54 class CWlanIndicatorPluginImplementation : public CAknIndicatorPlugin
       
    55                                          
       
    56     {
       
    57         
       
    58     public:  // Constructors and destructor
       
    59 
       
    60         /**
       
    61         * Two-phased constructor.
       
    62         */
       
    63         static CWlanIndicatorPluginImplementation* NewL();
       
    64 
       
    65         /**
       
    66         * Destructor.
       
    67         */
       
    68         ~CWlanIndicatorPluginImplementation();
       
    69         
       
    70 
       
    71     private: // From CAknIndicatorPlugin
       
    72         
       
    73         /**
       
    74          * @see CAknIndicatorPlugin
       
    75          */
       
    76         void HandleIndicatorTapL( const TInt aUid );
       
    77 
       
    78         /**
       
    79          * @see CAknIndicatorPlugin
       
    80          */
       
    81         HBufC* TextL( const TInt aUid, TInt& aTextType );        
       
    82     
       
    83     
       
    84     private:
       
    85 
       
    86         /**
       
    87         * C++ default constructor.
       
    88         */
       
    89         CWlanIndicatorPluginImplementation();
       
    90 
       
    91         /**
       
    92         * By default Symbian 2nd phase constructor is private.
       
    93         */
       
    94         void ConstructL();
       
    95         
       
    96 
       
    97     private: // new functions
       
    98 
       
    99         /**
       
   100         * Creates text for the cases
       
   101         * - "WLAN network found"
       
   102         * - "WLAN networks found"
       
   103         * - "'myNetwork' found"
       
   104         * @return Descriptor for the current "wlan available" case
       
   105         */
       
   106         HBufC* CreateWlanNetworksFoundTextL();
       
   107         
       
   108         /**
       
   109         * Creates text for the "connected" case (open or secure).
       
   110         * @return Descriptor containing the "'myNetwork' connected" text
       
   111         */
       
   112         HBufC* CreateWlanConnectedTextL();
       
   113         
       
   114         /**
       
   115          * Finds the required info for the "networks available" case:
       
   116          * - name of the known network (null if all unknown)
       
   117          * - number of available networks
       
   118          * @param aAvailableCount Number of available networks
       
   119          */
       
   120         HBufC* AvailableNetworksInfoL( TInt& aAvailableCount );
       
   121          
       
   122         /**
       
   123          * Finds the network name based on the IAP id
       
   124          * @param Struct for storing the IAP information
       
   125          */
       
   126         void GetWlanInfoFromIapL( TWliWlanInfo& aWlanInfo );
       
   127         
       
   128         /**
       
   129          * Finds the WLAN connection name.
       
   130          * @return Descriptor containing the name of the connected WLAN nw.
       
   131          */
       
   132         HBufC* ConnectionNameL();
       
   133         
       
   134         /** Finds the WLAN connection id
       
   135          * @return WLAN connection id
       
   136          */
       
   137         TUint FindWlanBearerConnectedL(); 
       
   138         
       
   139         /** Checks if the given connection is WLAN
       
   140          * @param Id of the active connection
       
   141          */
       
   142         TBool CheckIfWlan( TUint aConnectionId ); 
       
   143         
       
   144         /**
       
   145          * Launches WlanSniffer application.
       
   146          */
       
   147         void LaunchWlanSnifferL();        
       
   148         
       
   149 
       
   150     private: // data
       
   151     
       
   152         /**
       
   153          * Ref
       
   154          */
       
   155         CCoeEnv* iCoeEnv;
       
   156         
       
   157         /**
       
   158          * Resource file offset in CoeEnv's resource file list
       
   159          */
       
   160         TInt iResource;
       
   161         
       
   162         /**
       
   163          * Owned. Used for getting connection info
       
   164          */
       
   165         RConnectionMonitor iConnMonitor;
       
   166         
       
   167         /**
       
   168          * Owned. Used for getting WLAN available networks info
       
   169          */
       
   170         CWlanMgmtClient* iWlanMgmtClient;
       
   171         
       
   172 
       
   173     };
       
   174 
       
   175 #endif      // CWLANINDICATORPLUGINIMPLEMENTATION_H
       
   176 
       
   177 // End of File