connectionutilities/ConnectionDialogs/cconndlg/src/SelectConnectionDialog.cpp
branchRCL_3
changeset 58 83ca720e2b9a
equal deleted inserted replaced
57:05bc53fe583b 58:83ca720e2b9a
       
     1 /*
       
     2 * Copyright (c) 2002 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 class CSelectConnectionDialog.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "SelectConnectionDialog.h"
       
    21 #include "ConnectionInfo.h"
       
    22 #include "ConnectionInfoArray.h"
       
    23 #include "ConnectionDialogsLogger.h"
       
    24 #include "ActiveSelectExplicit.h"
       
    25 #include "ExpiryTimer.h"
       
    26 #include "ConnectionDialogs.hrh"
       
    27 
       
    28 
       
    29 #include "ConnDlgPlugin.h"
       
    30 #include <CConnDlgPlugin.rsg>
       
    31 
       
    32 #include <uikon/eiksrvui.h>
       
    33 
       
    34 #include <AknsFrameBackgroundControlContext.h>
       
    35 #include <aknsoundsystem.h>
       
    36 #include <AknsDrawUtils.h>
       
    37 #include <aknnotewrappers.h>
       
    38 #include <StringLoader.h>
       
    39 #include <eiklbi.h>
       
    40 
       
    41 // CONST DECLARATIONS
       
    42 
       
    43 #if defined(_DEBUG)
       
    44 _LIT( KErrNullPointer, "NULL pointer" );
       
    45 #endif
       
    46 
       
    47 
       
    48 
       
    49 // ================= MEMBER FUNCTIONS =======================
       
    50 //
       
    51 // ---------------------------------------------------------
       
    52 // CSelectConnectionDialog::CSelectConnectionDialog
       
    53 // ---------------------------------------------------------
       
    54 //
       
    55 CSelectConnectionDialog::CSelectConnectionDialog( 
       
    56                                         MEikSrvNotifierBase2* aPlugin,
       
    57                                         TInt aRefreshInterval,
       
    58                                         TUint32 aBearerSet, 
       
    59                                         TBool aIsWLANFeatureSupported,
       
    60                                         TUint aDefaultCMId )
       
    61 : CAknListQueryDialog( &iDummy ),
       
    62   iPlugin( ( CConnDlgSelectConnectionPlugin* )aPlugin ),
       
    63   iFromOkToExit( EFalse ),
       
    64   iActiveSelectExplicit( NULL ),
       
    65   iRefreshInterval( aRefreshInterval ),
       
    66   iBearerSet( aBearerSet ),
       
    67   iIsWLANFeatureSupported( aIsWLANFeatureSupported ),
       
    68   iDefaultCMId( aDefaultCMId )
       
    69     {
       
    70     }
       
    71 
       
    72 
       
    73 // ---------------------------------------------------------
       
    74 // CSelectConnectionDialog::NewL
       
    75 // ---------------------------------------------------------
       
    76 //
       
    77 CSelectConnectionDialog* CSelectConnectionDialog::NewL( 
       
    78                                                 MEikSrvNotifierBase2* aPlugin,
       
    79                                                 TInt aRefreshInterval,
       
    80                                                 TUint32 aBearerSet, 
       
    81                                                 TBool aIsWLANFeatureSupported, 
       
    82                                                 TUint aDefaultCMId )
       
    83     {
       
    84     CSelectConnectionDialog* self = new( ELeave ) CSelectConnectionDialog( 
       
    85                                                     aPlugin,
       
    86                                                     aRefreshInterval,
       
    87                                                     aBearerSet, 
       
    88                                                     aIsWLANFeatureSupported, 
       
    89                                                     aDefaultCMId );
       
    90     CleanupStack::PushL( self );
       
    91     self->ConstructL();
       
    92     CleanupStack::Pop( self );
       
    93 
       
    94     return self;
       
    95     }
       
    96 
       
    97 
       
    98 // ---------------------------------------------------------
       
    99 // CSelectConnectionDialog::ConstructL()
       
   100 // ---------------------------------------------------------
       
   101 //
       
   102 void CSelectConnectionDialog::ConstructL()
       
   103     {
       
   104     }
       
   105 
       
   106 
       
   107 // ---------------------------------------------------------
       
   108 // CSelectConnectionDialog::~CSelectConnectionDialog()
       
   109 // ---------------------------------------------------------
       
   110 //
       
   111 CSelectConnectionDialog::~CSelectConnectionDialog()
       
   112     {
       
   113     CLOG_ENTERFN( "CSelectConnectionDialog::~CSelectConnectionDialog " );
       
   114     iIapIDs.Close();
       
   115     iDestIDs.Close();
       
   116     STATIC_CAST( CEikServAppUi*, 
       
   117                 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( EFalse );
       
   118     delete iExpiryTimer;
       
   119     CLOG_LEAVEFN( "CSelectConnectionDialog::~CSelectConnectionDialog " );
       
   120     }
       
   121 
       
   122 
       
   123 // ---------------------------------------------------------
       
   124 // CSelectConnectionDialog::PreLayoutDynInitL()
       
   125 // ---------------------------------------------------------
       
   126 //
       
   127 void CSelectConnectionDialog::PreLayoutDynInitL()
       
   128     {
       
   129     CLOG_ENTERFN( "CSelectConnectionDialog::PreLayoutDynInitL " );  
       
   130     
       
   131     CAknListQueryDialog::PreLayoutDynInitL();
       
   132 
       
   133     SetOwnershipType( ELbmDoesNotOwnItemArray );
       
   134     SetIconArrayL( iIcons );
       
   135 
       
   136     STATIC_CAST( CEikServAppUi*, 
       
   137                 CCoeEnv::Static()->AppUi() )->SuppressAppSwitching( ETrue );
       
   138     
       
   139     // Hide Options button if single-click enabled
       
   140     //
       
   141     if ( static_cast< CAknAppUi* >( iCoeEnv->AppUi() )->IsSingleClickCompatible() )
       
   142         {
       
   143         CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
       
   144         cba->MakeCommandVisible( EAknSoftkeyOptions, EFalse );
       
   145         cba->DrawDeferred();
       
   146         }
       
   147 
       
   148     iExpiryTimer = CExpiryTimer::NewL( *this );
       
   149     iExpiryTimer->Start();
       
   150     
       
   151     CLOG_LEAVEFN( "CSelectConnectionDialog::PreLayoutDynInitL " );      
       
   152     }
       
   153 
       
   154 
       
   155 // ---------------------------------------------------------
       
   156 // CSelectConnectionDialog::OkToExitL
       
   157 // ---------------------------------------------------------
       
   158 //
       
   159 TBool CSelectConnectionDialog::OkToExitL( TInt aButtonId )
       
   160     {
       
   161     CLOG_ENTERFN( "CSelectConnectionDialog::OkToExitL " );      
       
   162     
       
   163     TBool result( EFalse );
       
   164     TInt completeCode( KErrNone );
       
   165     
       
   166     if ( aButtonId == EAknSoftkeySelect || aButtonId == EAknSoftkeyOk ||
       
   167          aButtonId == EAknSoftkeyDone )
       
   168         {
       
   169         CLOG_WRITE( "OkToExitL Ok-ed" );  
       
   170         TInt index = ListBox()->CurrentItemIndex();
       
   171         if ( iIapIDs[index] == 0 && iDestIDs[index] == 0 ) 
       
   172             {      // Uncategorized
       
   173             ProcessCommandL( ESelectConnectionCmdChooseMethod );
       
   174             }
       
   175         else
       
   176             {
       
   177             iPlugin->SetElementIDL( iIapIDs[index], iDestIDs[index] );
       
   178             result = ETrue;
       
   179             }
       
   180         }
       
   181     else if ( aButtonId == EAknSoftkeyCancel )
       
   182         {
       
   183         CLOG_WRITE( "OkToExitL Cancel" );  
       
   184         completeCode = KErrCancel;
       
   185         result = ETrue;
       
   186         }
       
   187     else if ( aButtonId == EAknSoftkeyOptions )
       
   188         {
       
   189         DisplayMenuL();
       
   190         }
       
   191         
       
   192     if ( result )
       
   193         {
       
   194         iFromOkToExit = ETrue;        
       
   195         
       
   196         __ASSERT_DEBUG( iPlugin, User::Panic( KErrNullPointer, KErrNone ) );
       
   197         CLOG_WRITE( "OkToExitL Going to CompleteL" );  
       
   198         iPlugin->CompleteL( completeCode );
       
   199         CLOG_WRITE( "OkToExitL Returned from CompleteL" );  
       
   200         }
       
   201 
       
   202     CLOG_LEAVEFN( "CSelectConnectionDialog::OkToExitL " );      
       
   203 
       
   204     return result;
       
   205     }
       
   206 
       
   207 
       
   208 // ---------------------------------------------------------
       
   209 // CSelectConnectionDialog::PrepareAndRunLD
       
   210 // ---------------------------------------------------------
       
   211 //    
       
   212 void CSelectConnectionDialog::PrepareAndRunLD( CConnectionInfoArray* aIAP,
       
   213                                                CArrayPtr< CGulIcon >* aIcons,
       
   214                                                TBool aIsReallyRefreshing,
       
   215                                                const TInt aHighlightedItem )
       
   216     {
       
   217     PrepareLC( R_SELECT_CONNECTION_QUERY );
       
   218     RefreshDialogL( aIAP, aIcons, aIsReallyRefreshing, aHighlightedItem );
       
   219     RunLD();
       
   220     }
       
   221 
       
   222 
       
   223 // ---------------------------------------------------------
       
   224 // CSelectConnectionDialog::RefreshDialogL
       
   225 // ---------------------------------------------------------
       
   226 //    
       
   227 void CSelectConnectionDialog::RefreshDialogL( CConnectionInfoArray* aIAP, 
       
   228                                               CArrayPtr< CGulIcon >* aIcons,
       
   229                                               TBool aIsReallyRefreshing,
       
   230                                               const TInt aHighlightedItem )
       
   231     {  
       
   232     CLOG_ENTERFN( "CSelectConnectionDialog::RefreshDialogL " );  
       
   233      
       
   234     if ( aIAP->Count() == 0 )
       
   235         {
       
   236         ListBox()->Reset();	
       
   237         }
       
   238     else
       
   239         {
       
   240         SetItemTextArray( aIAP );	
       
   241         } 
       
   242     
       
   243     iIcons = aIcons;
       
   244 
       
   245     iIapIDs.Reset();
       
   246     iDestIDs.Reset();
       
   247 
       
   248     // Determine the preferred IAP
       
   249     TInt numAPs = aIAP->Count();
       
   250     for( TInt ii = 0; ii < numAPs; ii++ )
       
   251         {
       
   252         iIapIDs.AppendL( aIAP->At( ii )->Id() );
       
   253         iDestIDs.AppendL( aIAP->At( ii )->DestinationId() );
       
   254         }
       
   255 
       
   256     if ( aHighlightedItem >= 0 && aHighlightedItem < numAPs )
       
   257         {
       
   258         ListBox()->SetCurrentItemIndex( aHighlightedItem );
       
   259         if ( aHighlightedItem == 1 )
       
   260             {
       
   261             // To have the Search for Wlan also visible. But this is valid only
       
   262             // if the highlighted item can be the first or the second, 
       
   263             // otherwise we risk to hide the highlighted item!
       
   264             ListBox()->ScrollToMakeItemVisible( 0 );    
       
   265             }
       
   266         }
       
   267 
       
   268     ListBox()->HandleItemAdditionL();
       
   269 
       
   270     if ( aHighlightedItem >= 0 && aHighlightedItem < numAPs )
       
   271         {
       
   272         CEikButtonGroupContainer& cba = ButtonGroupContainer();
       
   273         HBufC* label;
       
   274 
       
   275         if ( iIapIDs[aHighlightedItem] != 0 )
       
   276             {       // Easy Wlan
       
   277             label = StringLoader::LoadL( R_QTN_MSK_SELECT );
       
   278             }
       
   279         else if ( iDestIDs[aHighlightedItem] != 0 )
       
   280             {       // Destination
       
   281             label = StringLoader::LoadL( R_QTN_MSK_CONNECT );
       
   282             }
       
   283         else        // if ( iIapIDs[aHighlightedItem] == 0 && iDestIDs[aHighlightedItem] == 0 )
       
   284             {      // Uncategorized
       
   285             label = StringLoader::LoadL( R_QTN_MSK_OPEN );
       
   286             }
       
   287 
       
   288         CleanupStack::PushL( label );
       
   289         cba.SetCommandL( EAknSoftkeyDone, label->Des() );
       
   290         CleanupStack::PopAndDestroy(); // label
       
   291         }
       
   292 
       
   293     if ( aIsReallyRefreshing )
       
   294         {   // If we are really making a refresh, we need to recalculate the 
       
   295             // layout, because the number of items could be different and the
       
   296             // dialog should be resized accordingly
       
   297         Layout();   
       
   298         SizeChanged();
       
   299         DrawDeferred();
       
   300         }
       
   301 
       
   302     CLOG_LEAVEFN( "CSelectConnectionDialog::RefreshDialogL " );  
       
   303     }
       
   304     
       
   305 
       
   306 // ----------------------------------------------------------------------------
       
   307 // CSelectConnectionDialog::DynInitMenuPaneL
       
   308 // ----------------------------------------------------------------------------
       
   309 //
       
   310 void CSelectConnectionDialog::DynInitMenuPaneL( TInt aResourceId, 
       
   311                                              CEikMenuPane* aMenuPane )
       
   312     {
       
   313     CAknListQueryDialog::DynInitMenuPaneL( aResourceId, aMenuPane );
       
   314 
       
   315     if ( aResourceId == R_SELECT_CONNECTION_MENU_PANE )
       
   316         {
       
   317         if ( aMenuPane )
       
   318             {
       
   319             TInt index = ListBox()->CurrentItemIndex();
       
   320 
       
   321             if ( iIapIDs[index] != 0 )   
       
   322                 {      // Easy Wlan
       
   323                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdChooseMethod );
       
   324                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdConnect );
       
   325                 }
       
   326             else if ( iDestIDs[index] != 0 )
       
   327                 {       // Destination
       
   328                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdSelect );
       
   329                 }
       
   330             else // if ( iIapIDs[index] == 0 && iDestIDs[index] == 0 ) 
       
   331                 {      // Uncategorized
       
   332                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdSelect );
       
   333                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdConnect );
       
   334                 }
       
   335             }
       
   336         }
       
   337     }
       
   338 
       
   339 
       
   340 // ----------------------------------------------------------------------------
       
   341 // CSelectConnectionDialog::ProcessCommandL
       
   342 // ----------------------------------------------------------------------------
       
   343 //
       
   344 void CSelectConnectionDialog::ProcessCommandL( TInt aCommand )
       
   345     {
       
   346     CLOG_ENTERFN( "CSelectConnectionDialog::ProcessCommandL" );  
       
   347     if ( MenuShowing() )
       
   348         {
       
   349         HideMenu();
       
   350         }
       
   351 
       
   352     switch( aCommand )
       
   353         {
       
   354         case ESelectConnectionCmdSelect:
       
   355         case ESelectConnectionCmdConnect:
       
   356             {
       
   357             TryExitL( EAknSoftkeySelect );
       
   358             break;
       
   359             }
       
   360 
       
   361         case ESelectConnectionCmdChooseMethod:
       
   362             {
       
   363             if ( !iActiveSelectExplicit )
       
   364                 {
       
   365                 iActiveSelectExplicit = CActiveSelectExplicit::NewL( this, 
       
   366                                         iDestIDs[ListBox()->CurrentItemIndex()],
       
   367                                         iRefreshInterval,
       
   368                                         iBearerSet, 
       
   369                                         iIsWLANFeatureSupported,
       
   370                                        iDefaultCMId );
       
   371                 iActiveSelectExplicit->ShowSelectExplicitL();
       
   372                 }
       
   373             break;
       
   374             }
       
   375 
       
   376         default:
       
   377             {
       
   378             break;
       
   379             }
       
   380         }
       
   381     CLOG_LEAVEFN( "CSelectConnectionDialog::ProcessCommandL" );  
       
   382     }
       
   383 
       
   384 
       
   385 // ---------------------------------------------------------
       
   386 // CNetworksViewContainer::OfferKeyEventL
       
   387 // ---------------------------------------------------------
       
   388 //
       
   389 TKeyResponse CSelectConnectionDialog::OfferKeyEventL( 
       
   390                                                    const TKeyEvent& aKeyEvent,
       
   391                                                    TEventCode aType )
       
   392     {
       
   393     CLOG_ENTERFN( "CSelectConnectionDialog::OfferKeyEventL" );
       
   394     
       
   395     if( aType == EEventKey && aKeyEvent.iCode == EKeyPhoneSend )
       
   396         {
       
   397         // Let's not obscure the Dialer in the background
       
   398         if ( iExpiryTimer && !iActiveSelectExplicit )
       
   399             {
       
   400             iExpiryTimer->Cancel();
       
   401             iExpiryTimer->StartShort();    
       
   402             }
       
   403         }
       
   404 
       
   405     TKeyResponse result( EKeyWasNotConsumed );
       
   406     TInt indexBefore = -1;
       
   407     TInt indexAfter = -1;
       
   408 
       
   409     if ( aKeyEvent.iScanCode == EStdKeyDownArrow || 
       
   410          aKeyEvent.iScanCode == EStdKeyUpArrow )
       
   411         {
       
   412         CLOG_WRITE( "Arrow pressed" );
       
   413         indexBefore = ListBox()->CurrentItemIndex();
       
   414         }
       
   415 
       
   416     result = CAknListQueryDialog::OfferKeyEventL( aKeyEvent, aType );
       
   417     
       
   418     if ( iFromOkToExit )
       
   419         {     
       
   420         return result;
       
   421         }
       
   422     
       
   423     CLOG_WRITEF( _L ( "Returned from CAknListQueryDialog::OfferKeyEventL: %d" ), result );
       
   424 
       
   425     if ( aKeyEvent.iScanCode == EStdKeyDownArrow || 
       
   426          aKeyEvent.iScanCode == EStdKeyUpArrow )
       
   427         {
       
   428         indexAfter = ListBox()->CurrentItemIndex();
       
   429         }
       
   430 
       
   431     if ( indexBefore != indexAfter )
       
   432         {
       
   433         CLOG_WRITEF( _L ( "IndexBefore = %d, IndexAfter = %d" ), indexBefore, indexAfter );
       
   434         CEikButtonGroupContainer& cba = ButtonGroupContainer();
       
   435         HBufC* label;
       
   436         if ( iIapIDs[indexAfter] != 0 )
       
   437             {       // Easy Wlan
       
   438             label = StringLoader::LoadL( R_QTN_MSK_SELECT );
       
   439             }
       
   440         else if ( iDestIDs[indexAfter] != 0 )
       
   441             {       // Destination
       
   442             label = StringLoader::LoadL( R_QTN_MSK_CONNECT );
       
   443             }
       
   444         else        // if ( iIapIDs[indexAfter] == 0 && iDestIDs[indexAfter] == 0 )
       
   445             {      // Uncategorized
       
   446             label = StringLoader::LoadL( R_QTN_MSK_OPEN );
       
   447             }
       
   448         CleanupStack::PushL( label );
       
   449         cba.SetCommandL( EAknSoftkeyDone, label->Des() );
       
   450         CleanupStack::PopAndDestroy(); // label
       
   451         cba.DrawDeferred();
       
   452         }
       
   453 
       
   454     // Show Options button if some listbox row gets highlighted
       
   455     //
       
   456     if ( static_cast< CAknAppUi* >( iCoeEnv->AppUi() )->IsSingleClickCompatible() )
       
   457         {
       
   458         CEikButtonGroupContainer* cba = CEikButtonGroupContainer::Current();
       
   459 
       
   460         if ( ( ListBox()->View()->ItemDrawer()->Flags()
       
   461                & CListItemDrawer::ESingleClickDisabledHighlight )
       
   462               )
       
   463             {
       
   464             cba->MakeCommandVisible( EAknSoftkeyOptions, EFalse );
       
   465             }
       
   466         else
       
   467             {
       
   468             cba->MakeCommandVisible( EAknSoftkeyOptions, ETrue );
       
   469             }
       
   470 
       
   471         cba->DrawDeferred();
       
   472         }
       
   473     
       
   474     CLOG_LEAVEFN( "CSelectConnectionDialog::OfferKeyEventL" );  
       
   475 
       
   476     return result;
       
   477     }
       
   478 
       
   479 
       
   480 // ----------------------------------------------------------------------------
       
   481 // CSelectConnectionDialog::RunLD
       
   482 // ----------------------------------------------------------------------------
       
   483 //
       
   484 TInt CSelectConnectionDialog::RunLD()
       
   485     {
       
   486     CLOG_ENTERFN( "CSelectConnectionDialog::RunLD" );  
       
   487     CAknDialog::ConstructL( R_SELECT_CONNECTION_MENUBAR );
       
   488     User::ResetInactivityTime();
       
   489 
       
   490     CAknKeySoundSystem* soundSystem = NULL;
       
   491     if ( iSoundSystem )
       
   492         {
       
   493         iSoundSystem->PushContextL( R_AVKON_DEFAULT_SKEY_LIST );
       
   494         // Need to store local copy of iSoundSystem, since it will have been
       
   495         // destroyed when RunLD returns
       
   496         soundSystem = iSoundSystem;
       
   497         }
       
   498 
       
   499     CAknsFrameBackgroundControlContext* cc = 
       
   500         ( CAknsFrameBackgroundControlContext* )AknsDrawUtils::ControlContext(
       
   501                                                                         this );
       
   502     cc->SetCenter( KAknsIIDQsnFrPopupCenterQuery );
       
   503 
       
   504     TInt ret = CAknDialog::RunLD();
       
   505     if ( soundSystem )
       
   506         {
       
   507         soundSystem->PopContext();
       
   508         }
       
   509     CLOG_LEAVEFN( "CSelectConnectionDialog::RunLD" );  
       
   510     return ret;
       
   511     }
       
   512 
       
   513 
       
   514 // ---------------------------------------------------------
       
   515 // CSelectConnectionDialog::SetElementIDL
       
   516 // ---------------------------------------------------------
       
   517 //    
       
   518 void CSelectConnectionDialog::SetElementIDL( TUint32 aIAPId )
       
   519     {
       
   520     iPlugin->SetElementIDL( aIAPId, 0 );
       
   521     }
       
   522 
       
   523 
       
   524 // ---------------------------------------------------------
       
   525 // void CSelectConnectionDialog::CompleteL
       
   526 // ---------------------------------------------------------
       
   527 //
       
   528 void CSelectConnectionDialog::CompleteL( TInt aStatus )
       
   529     {
       
   530     CLOG_ENTERFN( "CSelectConnectionDialog::CompleteL" );  
       
   531     delete iActiveSelectExplicit;
       
   532     iActiveSelectExplicit = NULL;
       
   533     iPlugin->CompleteL( aStatus );
       
   534     CLOG_LEAVEFN( "CSelectConnectionDialog::CompleteL" );  
       
   535     }
       
   536 
       
   537 void CSelectConnectionDialog::HandleTimedOut()
       
   538     {
       
   539     TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) );
       
   540     }
       
   541 
       
   542 // ---------------------------------------------------------
       
   543 // void CSelectConnectionDialog::HandleListBoxEventL
       
   544 // ---------------------------------------------------------
       
   545 //    
       
   546 void CSelectConnectionDialog::HandleListBoxEventL(CEikListBox* aListBox, 
       
   547 												TListBoxEvent aEventType)
       
   548 	{	
       
   549     if( aEventType == EEventItemClicked )
       
   550         {
       
   551         // Do not forward to the base class. 
       
   552         // The first click must only select the item.        
       
   553         return;
       
   554         }
       
   555     else if( aEventType == EEventItemDoubleClicked )
       
   556         {
       
   557         // Forward as EEventItemClicked to open the item on the second click.
       
   558         CAknListQueryDialog::HandleListBoxEventL( aListBox, EEventItemClicked );
       
   559         }
       
   560 	else
       
   561         {
       
   562         // normal forward
       
   563         CAknListQueryDialog::HandleListBoxEventL( aListBox, aEventType );
       
   564         }
       
   565     }
       
   566 
       
   567 // ---------------------------------------------------------
       
   568 // void CSelectConnectionDialog::HandlePointerEventL
       
   569 // ---------------------------------------------------------
       
   570 //    
       
   571 void CSelectConnectionDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
   572     {
       
   573     if( ListBox()->Rect().Contains( aPointerEvent.iPosition ) )
       
   574         {
       
   575         if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   576             {
       
   577             TInt index;
       
   578             TInt oldIndex = ListBox()->CurrentItemIndex();
       
   579             if ( ListBox()->View()->XYPosToItemIndex( aPointerEvent.iPosition, index ) &&
       
   580                    ( index == oldIndex ) )
       
   581                 {
       
   582                 // Pressed Down Effect
       
   583                 ListBox()->View()->ItemDrawer()->SetFlags( CListItemDrawer::EPressedDownState );
       
   584                 }
       
   585             }
       
   586         CAknControl::HandlePointerEventL(aPointerEvent);
       
   587         }
       
   588     else
       
   589         {
       
   590         CAknListQueryDialog::HandlePointerEventL( aPointerEvent );
       
   591         }
       
   592     }
       
   593 
       
   594 // End of File