wlanutilities/wlansniffer/mainapplication/inc/wsfmainviewmodel.h
branchRCL_3
changeset 24 63be7eb3fc78
parent 23 b852595f5cbe
child 25 f28ada11abbf
equal deleted inserted replaced
23:b852595f5cbe 24:63be7eb3fc78
     1 /*
       
     2 * Copyright (c) 2007-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:  Class header for CWsfMainViewModel
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_WSFMAINVIEWMODEL_H
       
    19 #define C_WSFMAINVIEWMODEL_H
       
    20 
       
    21 //  EXTERNAL INCLUDES
       
    22 #include <e32base.h>
       
    23 #include <badesca.h>
       
    24 #include <gulicon.h>
       
    25 #include <AknIconArray.h>
       
    26 #include "wsfwlaninfo.h"
       
    27 
       
    28 
       
    29 
       
    30 //  FORWARD DECLARATIONS
       
    31 class CWsfWlanInfoArray;
       
    32 class CCoeEnv;
       
    33 
       
    34 //  CLASS DEFINITION
       
    35 /**
       
    36  * View (Main view) level model.
       
    37  *  
       
    38  * @since S60 5.0
       
    39  * @lib wlansniffer.exe
       
    40  */
       
    41 NONSHARABLE_CLASS( CWsfMainViewModel ): public CBase
       
    42     {
       
    43     public:     // Constructors and destructor
       
    44         
       
    45         /**
       
    46          * Two-phased constructor
       
    47          * @since S60 5.0 
       
    48          * @return instance of CWsfMainViewModel class
       
    49          */
       
    50         static CWsfMainViewModel* NewL();
       
    51         
       
    52         /**
       
    53          * Two-phased constructor. Leaves the object on CleanupStack
       
    54          * @since S60 5.0 
       
    55          * @return instance of CWsfMainViewModel class
       
    56          */
       
    57         static CWsfMainViewModel* NewLC();
       
    58         
       
    59         /**
       
    60          * Destructor of CWsfMainViewModel class
       
    61          * @since S60 5.0     
       
    62          */
       
    63         ~CWsfMainViewModel();
       
    64 
       
    65     private:    // Constructors
       
    66         
       
    67         /**
       
    68          * Default C++ constructor 
       
    69          * @since S60 5.0 
       
    70          */
       
    71         CWsfMainViewModel();
       
    72         
       
    73         /**
       
    74          * 2nd phase constructor
       
    75          * @since S60 5.0 
       
    76          */
       
    77         void ConstructL();
       
    78 
       
    79     public:     // New methods
       
    80 
       
    81         /**
       
    82         * Creates array for the listbox.
       
    83         * @param Array of WLAN that will be formatted. 
       
    84         */
       
    85         void FormatWlanListL( CWsfWlanInfoArray* aWlanList );
       
    86         
       
    87         /*
       
    88         * Returns WLAN list that has already formatted
       
    89         * @return Formatted WLAN list 
       
    90         */        
       
    91         CDesCArrayFlat* GetWlanList();        
       
    92         
       
    93         /**
       
    94         * 
       
    95         * @return non-formatted WLAN list
       
    96         */
       
    97         CWsfWlanInfoArray* GetInfoArray();
       
    98         
       
    99         /**
       
   100         * Store Ssid of selected WLAN
       
   101         * Get ownership of parameter
       
   102         * @param aSsid WLAN name
       
   103         */
       
   104         void SetSelectedWlan( HBufC8* aSsid );
       
   105 
       
   106         /**
       
   107         * Return Ssid of selected WLAN
       
   108         * @return WLAN name
       
   109         */
       
   110         const TDesC8& SelectedWlan();
       
   111 
       
   112         /**
       
   113         * Stored current listbox index
       
   114         * @param aIndex Listbox iden
       
   115         */        
       
   116         void SetSelectedIndex( TInt aIndex );
       
   117 
       
   118         /**
       
   119         * Return stored index listbox
       
   120         * @return Previously stored listbox index
       
   121         */        
       
   122         TInt SelectedIndex();
       
   123 
       
   124         /**
       
   125         * Returns navipane text
       
   126         * @return Navipane text
       
   127         */        
       
   128         HBufC* FormatNaviPaneLC();  
       
   129 
       
   130     private:    // New methods        
       
   131         
       
   132         /**
       
   133          * Format the Hidden WLANs for the listbox.(text and icon)
       
   134          * @since S60 v5.0
       
   135          * @param aWlan - Reference to wlaninfo
       
   136          * @param aItem - Listbox item
       
   137          */     
       
   138         void FormatHiddenWlanItemL( TWsfWlanInfo& aWlan, TDes& aItem );
       
   139 
       
   140         /**
       
   141          * Format the WlanInfo (visible networks) items for the 
       
   142          * listbox.(text and icon)
       
   143          * @since S60 v5.0
       
   144          * @param aWlan - reference to wlaninfo
       
   145          * @param aItem - listbox item
       
   146          */  
       
   147         void FormatVisibleWlanItemL( TWsfWlanInfo& aWlan, TDes& aItem );
       
   148         
       
   149     private:    // Data
       
   150        
       
   151         /**
       
   152         * The wlaninfo array we are currently working on. 
       
   153         * Not Own. (Ref.)
       
   154         */
       
   155         CWsfWlanInfoArray* iWlanInfoArray;
       
   156         
       
   157         /**
       
   158          * Coe env for loading string from resource
       
   159          * Not Own. (Ref.)
       
   160          */
       
   161         CCoeEnv* iCoeEnv;
       
   162 
       
   163         /**
       
   164         * List that contains the WLAN items 
       
   165         * Own.
       
   166         */
       
   167         CDesCArrayFlat* iFormattedWlanList;  
       
   168         
       
   169         /**
       
   170         * Store name of focused WLAN 
       
   171         * Own.
       
   172         */
       
   173         HBufC8* iSelectedWlan;
       
   174         
       
   175         /**
       
   176         * Index of the selected listbox item.
       
   177         */
       
   178         TInt iListboxIndex;
       
   179         
       
   180         /**
       
   181          * It contains the number of the Visible WLANs
       
   182          */
       
   183         TUint iVisibleWlans;
       
   184     };
       
   185 
       
   186 
       
   187 
       
   188 #endif      //  C_WSFMAINVIEWMODEL_H
       
   189 
       
   190 // End of file