wlanutilities/wlansniffer/mainapplication/src/wsfconnecteddetailscontroller.cpp
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:  Implementation of TWsfConnectedDetailsController.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //  CLASS HEADER
       
    20 #include "wsfconnecteddetailscontroller.h"
       
    21 
       
    22 //  EXTERNAL INCLUDES
       
    23 
       
    24 //  INTERNAL INCLUDES
       
    25 #include "wsfconnecteddetailsmodel.h"
       
    26 #include "wsfwlaninfo.h"
       
    27 #include "wsfwlaninfoarray.h"
       
    28 #include "wsfconnecteddetailsdialog.h"
       
    29 
       
    30 #include "wsflogger.h"
       
    31 
       
    32 
       
    33 //  LOCAL DEFINITIONS
       
    34 #ifdef _DEBUG
       
    35     _LIT( KDetailsViewControllerPanic, "TWsfConnectedDetailsController" );
       
    36     #define _ASSERTD( cond ) __ASSERT_DEBUG( (cond), \
       
    37             User::Panic( KDetailsViewControllerPanic, __LINE__) )
       
    38 #else
       
    39     #define _ASSERTD( cond ) {}
       
    40 #endif //_DEBUG
       
    41 
       
    42 
       
    43 
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // void TWsfConnectedDetailsController::SetWlanListL
       
    47 // ---------------------------------------------------------------------------
       
    48 //
       
    49 void TWsfConnectedDetailsController::SetWlanListL(
       
    50                                         CWsfWlanInfoArray* aWlanArray, 
       
    51                                         const TDesC8& aSelectedWlanSsid )
       
    52     {
       
    53     LOG_ENTERFN( "TWsfConnectedDetailsController::SetWlanListL" );
       
    54     _ASSERTD( aWlanArray );
       
    55         
       
    56     //Get selected Wlan info 
       
    57     TWsfWlanInfo* info = aWlanArray->Match( aSelectedWlanSsid, 
       
    58                                          aWlanArray->Count() );
       
    59 
       
    60     CDesCArray* formattedList = NULL;                                         
       
    61                                          
       
    62     // if view active && and something to show
       
    63     if ( iDialog && iModel)
       
    64         {
       
    65         // Update model
       
    66         formattedList = iModel->FormatWlanInfoL( info, aWlanArray );
       
    67 
       
    68         //Draw view
       
    69         iDialog->UpdateListBox( formattedList );
       
    70         }
       
    71     }
       
    72     
       
    73 // ---------------------------------------------------------------------------
       
    74 // void TWsfConnectedDetailsController::WlanListChangedL
       
    75 // ---------------------------------------------------------------------------
       
    76 //
       
    77 void TWsfConnectedDetailsController::WlanListChangedL( 
       
    78                                         CWsfWlanInfoArray* aWlanArray )
       
    79     {
       
    80     LOG_ENTERFN( "TWsfConnectedDetailsController::WlanListChangedL" );    
       
    81     _ASSERTD( aWlanArray );
       
    82                     
       
    83     //If view active
       
    84     if ( iDialog && iModel )
       
    85         {
       
    86         //Get selected Wlan info 
       
    87         TWsfWlanInfo* info = aWlanArray->Match( iModel->WlanSsid(), 
       
    88                                              aWlanArray->Count() );
       
    89 
       
    90         CDesCArray* formattedList = NULL;
       
    91         
       
    92         //Current info found from new list
       
    93         // Update model
       
    94         formattedList = iModel->FormatWlanInfoL( info, aWlanArray );
       
    95             
       
    96         //Draw view            
       
    97         iDialog->UpdateListBox( formattedList );
       
    98         }
       
    99     }
       
   100 
       
   101 // ---------------------------------------------------------------------------
       
   102 // void TWsfConnectedDetailsController::RefreshL
       
   103 // ---------------------------------------------------------------------------
       
   104 //
       
   105 void TWsfConnectedDetailsController::RefreshL()
       
   106     {
       
   107     LOG_ENTERFN( "TWsfConnectedDetailsController::RefreshL" );
       
   108     
       
   109     if ( iDialog && iModel)
       
   110         {        
       
   111         CDesCArray* formattedDetails = iModel->GetWlanDetails();
       
   112         
       
   113         iDialog->UpdateListBox( formattedDetails );
       
   114         }
       
   115     }
       
   116     
       
   117 // ---------------------------------------------------------------------------
       
   118 // void TWsfConnectedDetailsController::UpdateActiveTimeL
       
   119 // ---------------------------------------------------------------------------
       
   120 //
       
   121 void TWsfConnectedDetailsController::UpdateActiveTimeL()
       
   122     {
       
   123     LOG_ENTERFN( "TWsfConnectedDetailsController::UpdateActiveTimeL" );
       
   124     if (iModel)
       
   125         {
       
   126         iModel->RefreshCurrentWlanInfoL();
       
   127         RefreshL();
       
   128         }
       
   129     }
       
   130 
       
   131 void TWsfConnectedDetailsController::SetPartner( 
       
   132                                     MWsfDetailsViewPartner& /*aPartner*/ )
       
   133     {
       
   134     }
       
   135 
       
   136 // End of file