connectionutilities/ConnectionDialogs/cconndlg/src/SelectConnectionDialog.cpp
changeset 20 9c97ad6591ae
parent 18 fcbbe021d614
child 21 b8e8e15e80f2
child 23 7ec726f93df1
child 28 860702281757
equal deleted inserted replaced
18:fcbbe021d614 20:9c97ad6591ae
     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     iExpiryTimer = CExpiryTimer::NewL( *this );
       
   140     iExpiryTimer->Start();
       
   141     
       
   142     CLOG_LEAVEFN( "CSelectConnectionDialog::PreLayoutDynInitL " );      
       
   143     }
       
   144 
       
   145 
       
   146 // ---------------------------------------------------------
       
   147 // CSelectConnectionDialog::OkToExitL
       
   148 // ---------------------------------------------------------
       
   149 //
       
   150 TBool CSelectConnectionDialog::OkToExitL( TInt aButtonId )
       
   151     {
       
   152     CLOG_ENTERFN( "CSelectConnectionDialog::OkToExitL " );      
       
   153     
       
   154     TBool result( EFalse );
       
   155     TInt completeCode( KErrNone );
       
   156     
       
   157     if ( aButtonId == EAknSoftkeySelect || aButtonId == EAknSoftkeyOk ||
       
   158          aButtonId == EAknSoftkeyDone )
       
   159         {
       
   160         CLOG_WRITE( "OkToExitL Ok-ed" );  
       
   161         TInt index = ListBox()->CurrentItemIndex();
       
   162         if ( iIapIDs[index] == 0 && iDestIDs[index] == 0 ) 
       
   163             {      // Uncategorized
       
   164             ProcessCommandL( ESelectConnectionCmdChooseMethod );
       
   165             }
       
   166         else
       
   167             {
       
   168             iPlugin->SetElementIDL( iIapIDs[index], iDestIDs[index] );
       
   169             result = ETrue;
       
   170             }
       
   171         }
       
   172     else if ( aButtonId == EAknSoftkeyCancel )
       
   173         {
       
   174         CLOG_WRITE( "OkToExitL Cancel" );  
       
   175         completeCode = KErrCancel;
       
   176         result = ETrue;
       
   177         }
       
   178     else if ( aButtonId == EAknSoftkeyOptions )
       
   179         {
       
   180         if ( !( ListBox()->View()->ItemDrawer()->Flags() 
       
   181                & CListItemDrawer::EDisableHighlight ) )
       
   182             {
       
   183             DisplayMenuL();
       
   184             }
       
   185         else
       
   186             {
       
   187             ListBox()->View()->ItemDrawer()->ClearFlags(
       
   188                CListItemDrawer::EDisableHighlight );
       
   189             DrawNow();
       
   190             }
       
   191         }
       
   192         
       
   193     if ( result )
       
   194         {
       
   195         iFromOkToExit = ETrue;        
       
   196         
       
   197         __ASSERT_DEBUG( iPlugin, User::Panic( KErrNullPointer, KErrNone ) );
       
   198         CLOG_WRITE( "OkToExitL Going to CompleteL" );  
       
   199         iPlugin->CompleteL( completeCode );
       
   200         CLOG_WRITE( "OkToExitL Returned from CompleteL" );  
       
   201         }
       
   202 
       
   203     CLOG_LEAVEFN( "CSelectConnectionDialog::OkToExitL " );      
       
   204 
       
   205     return result;
       
   206     }
       
   207 
       
   208 
       
   209 // ---------------------------------------------------------
       
   210 // CSelectConnectionDialog::PrepareAndRunLD
       
   211 // ---------------------------------------------------------
       
   212 //    
       
   213 void CSelectConnectionDialog::PrepareAndRunLD( CConnectionInfoArray* aIAP,
       
   214                                                CArrayPtr< CGulIcon >* aIcons,
       
   215                                                TBool aIsReallyRefreshing,
       
   216                                                const TInt aHighlightedItem )
       
   217     {
       
   218     PrepareLC( R_SELECT_CONNECTION_QUERY );
       
   219     RefreshDialogL( aIAP, aIcons, aIsReallyRefreshing, aHighlightedItem );
       
   220     RunLD();
       
   221     }
       
   222 
       
   223 
       
   224 // ---------------------------------------------------------
       
   225 // CSelectConnectionDialog::RefreshDialogL
       
   226 // ---------------------------------------------------------
       
   227 //    
       
   228 void CSelectConnectionDialog::RefreshDialogL( CConnectionInfoArray* aIAP, 
       
   229                                               CArrayPtr< CGulIcon >* aIcons,
       
   230                                               TBool aIsReallyRefreshing,
       
   231                                               const TInt aHighlightedItem )
       
   232     {  
       
   233     CLOG_ENTERFN( "CSelectConnectionDialog::RefreshDialogL " );  
       
   234      
       
   235     if ( aIAP->Count() == 0 )
       
   236         {
       
   237         ListBox()->Reset();	
       
   238         }
       
   239     else
       
   240         {
       
   241         SetItemTextArray( aIAP );	
       
   242         } 
       
   243     
       
   244     iIcons = aIcons;
       
   245 
       
   246     iIapIDs.Reset();
       
   247     iDestIDs.Reset();
       
   248 
       
   249     // Determine the preferred IAP
       
   250     TInt numAPs = aIAP->Count();
       
   251     for( TInt ii = 0; ii < numAPs; ii++ )
       
   252         {
       
   253         iIapIDs.AppendL( aIAP->At( ii )->Id() );
       
   254         iDestIDs.AppendL( aIAP->At( ii )->DestinationId() );
       
   255         }
       
   256 
       
   257     if ( aHighlightedItem >= 0 && aHighlightedItem < numAPs )
       
   258         {
       
   259         ListBox()->SetCurrentItemIndex( aHighlightedItem );
       
   260         if ( aHighlightedItem == 1 )
       
   261             {
       
   262             // To have the Search for Wlan also visible. But this is valid only
       
   263             // if the highlighted item can be the first or the second, 
       
   264             // otherwise we risk to hide the highlighted item!
       
   265             ListBox()->ScrollToMakeItemVisible( 0 );    
       
   266             }
       
   267         }
       
   268 
       
   269     ListBox()->HandleItemAdditionL();
       
   270 
       
   271     if ( aHighlightedItem >= 0 && aHighlightedItem < numAPs )
       
   272         {
       
   273         CEikButtonGroupContainer& cba = ButtonGroupContainer();
       
   274         HBufC* label;
       
   275 
       
   276         if ( iIapIDs[aHighlightedItem] != 0 )
       
   277             {       // Easy Wlan
       
   278             label = StringLoader::LoadL( R_QTN_MSK_SELECT );
       
   279             }
       
   280         else if ( iDestIDs[aHighlightedItem] != 0 )
       
   281             {       // Destination
       
   282             label = StringLoader::LoadL( R_QTN_MSK_CONNECT );
       
   283             }
       
   284         else        // if ( iIapIDs[aHighlightedItem] == 0 && iDestIDs[aHighlightedItem] == 0 )
       
   285             {      // Uncategorized
       
   286             label = StringLoader::LoadL( R_QTN_MSK_OPEN );
       
   287             }
       
   288 
       
   289         CleanupStack::PushL( label );
       
   290         cba.SetCommandL( EAknSoftkeyDone, label->Des() );
       
   291         CleanupStack::PopAndDestroy(); // label
       
   292         }
       
   293 
       
   294     if ( aIsReallyRefreshing )
       
   295         {   // If we are really making a refresh, we need to recalculate the 
       
   296             // layout, because the number of items could be different and the
       
   297             // dialog should be resized accordingly
       
   298         Layout();   
       
   299         SizeChanged();
       
   300         DrawDeferred();
       
   301         }
       
   302 
       
   303     CLOG_LEAVEFN( "CSelectConnectionDialog::RefreshDialogL " );  
       
   304     }
       
   305     
       
   306 
       
   307 // ----------------------------------------------------------------------------
       
   308 // CSelectConnectionDialog::DynInitMenuPaneL
       
   309 // ----------------------------------------------------------------------------
       
   310 //
       
   311 void CSelectConnectionDialog::DynInitMenuPaneL( TInt aResourceId, 
       
   312                                              CEikMenuPane* aMenuPane )
       
   313     {
       
   314     CAknListQueryDialog::DynInitMenuPaneL( aResourceId, aMenuPane );
       
   315 
       
   316     if ( aResourceId == R_SELECT_CONNECTION_MENU_PANE )
       
   317         {
       
   318         if ( aMenuPane )
       
   319             {
       
   320             TInt index = ListBox()->CurrentItemIndex();
       
   321 
       
   322             if ( iIapIDs[index] != 0 )   
       
   323                 {      // Easy Wlan
       
   324                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdChooseMethod );
       
   325                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdConnect );
       
   326                 }
       
   327             else if ( iDestIDs[index] != 0 )
       
   328                 {       // Destination
       
   329                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdSelect );
       
   330                 }
       
   331             else // if ( iIapIDs[index] == 0 && iDestIDs[index] == 0 ) 
       
   332                 {      // Uncategorized
       
   333                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdSelect );
       
   334                 aMenuPane->DeleteMenuItem( ESelectConnectionCmdConnect );
       
   335                 }
       
   336             }
       
   337         }
       
   338     }
       
   339 
       
   340 
       
   341 // ----------------------------------------------------------------------------
       
   342 // CSelectConnectionDialog::ProcessCommandL
       
   343 // ----------------------------------------------------------------------------
       
   344 //
       
   345 void CSelectConnectionDialog::ProcessCommandL( TInt aCommand )
       
   346     {
       
   347     CLOG_ENTERFN( "CSelectConnectionDialog::ProcessCommandL" );  
       
   348     if ( MenuShowing() )
       
   349         {
       
   350         HideMenu();
       
   351         }
       
   352 
       
   353     switch( aCommand )
       
   354         {
       
   355         case ESelectConnectionCmdSelect:
       
   356         case ESelectConnectionCmdConnect:
       
   357             {
       
   358             TryExitL( EAknSoftkeySelect );
       
   359             break;
       
   360             }
       
   361 
       
   362         case ESelectConnectionCmdChooseMethod:
       
   363             {
       
   364             if ( !iActiveSelectExplicit )
       
   365                 {
       
   366                 iActiveSelectExplicit = CActiveSelectExplicit::NewL( this, 
       
   367                                         iDestIDs[ListBox()->CurrentItemIndex()],
       
   368                                         iRefreshInterval,
       
   369                                         iBearerSet, 
       
   370                                         iIsWLANFeatureSupported,
       
   371                                        iDefaultCMId );
       
   372                 iActiveSelectExplicit->ShowSelectExplicitL();
       
   373                 }
       
   374             break;
       
   375             }
       
   376 
       
   377         default:
       
   378             {
       
   379             break;
       
   380             }
       
   381         }
       
   382     CLOG_LEAVEFN( "CSelectConnectionDialog::ProcessCommandL" );  
       
   383     }
       
   384 
       
   385 
       
   386 // ---------------------------------------------------------
       
   387 // CNetworksViewContainer::OfferKeyEventL
       
   388 // ---------------------------------------------------------
       
   389 //
       
   390 TKeyResponse CSelectConnectionDialog::OfferKeyEventL( 
       
   391                                                    const TKeyEvent& aKeyEvent,
       
   392                                                    TEventCode aType )
       
   393     {
       
   394     CLOG_ENTERFN( "CSelectConnectionDialog::OfferKeyEventL" );
       
   395     
       
   396     if( aType == EEventKey && aKeyEvent.iCode == EKeyPhoneSend )
       
   397         {
       
   398         // Let's not obscure the Dialer in the background
       
   399         if ( iExpiryTimer && !iActiveSelectExplicit )
       
   400             {
       
   401             iExpiryTimer->Cancel();
       
   402             iExpiryTimer->StartShort();    
       
   403             }
       
   404         }
       
   405 
       
   406     TKeyResponse result( EKeyWasNotConsumed );
       
   407     TInt indexBefore = -1;
       
   408     TInt indexAfter = -1;
       
   409 
       
   410     if ( aKeyEvent.iScanCode == EStdKeyDownArrow || 
       
   411          aKeyEvent.iScanCode == EStdKeyUpArrow )
       
   412         {
       
   413         CLOG_WRITE( "Arrow pressed" );
       
   414         indexBefore = ListBox()->CurrentItemIndex();
       
   415         }
       
   416 
       
   417     result = CAknListQueryDialog::OfferKeyEventL( aKeyEvent, aType );
       
   418 
       
   419     CLOG_WRITEF( _L ( "Returned from CAknListQueryDialog::OfferKeyEventL: %d" ), result );
       
   420 
       
   421     if ( aKeyEvent.iScanCode == EStdKeyDownArrow || 
       
   422          aKeyEvent.iScanCode == EStdKeyUpArrow )
       
   423         {
       
   424         indexAfter = ListBox()->CurrentItemIndex();
       
   425         }
       
   426 
       
   427     if ( indexBefore != indexAfter )
       
   428         {
       
   429         CLOG_WRITEF( _L ( "IndexBefore = %d, IndexAfter = %d" ), indexBefore, indexAfter );
       
   430         CEikButtonGroupContainer& cba = ButtonGroupContainer();
       
   431         HBufC* label;
       
   432         if ( iIapIDs[indexAfter] != 0 )
       
   433             {       // Easy Wlan
       
   434             label = StringLoader::LoadL( R_QTN_MSK_SELECT );
       
   435             }
       
   436         else if ( iDestIDs[indexAfter] != 0 )
       
   437             {       // Destination
       
   438             label = StringLoader::LoadL( R_QTN_MSK_CONNECT );
       
   439             }
       
   440         else        // if ( iIapIDs[indexAfter] == 0 && iDestIDs[indexAfter] == 0 )
       
   441             {      // Uncategorized
       
   442             label = StringLoader::LoadL( R_QTN_MSK_OPEN );
       
   443             }
       
   444         CleanupStack::PushL( label );
       
   445         cba.SetCommandL( EAknSoftkeyDone, label->Des() );
       
   446         CleanupStack::PopAndDestroy(); // label
       
   447         cba.DrawDeferred();
       
   448         }
       
   449 
       
   450     CLOG_LEAVEFN( "CSelectConnectionDialog::OfferKeyEventL" );  
       
   451 
       
   452     return result;
       
   453     }
       
   454 
       
   455 
       
   456 // ----------------------------------------------------------------------------
       
   457 // CSelectConnectionDialog::RunLD
       
   458 // ----------------------------------------------------------------------------
       
   459 //
       
   460 TInt CSelectConnectionDialog::RunLD()
       
   461     {
       
   462     CLOG_ENTERFN( "CSelectConnectionDialog::RunLD" );  
       
   463     CAknDialog::ConstructL( R_SELECT_CONNECTION_MENUBAR );
       
   464     User::ResetInactivityTime();
       
   465 
       
   466     CAknKeySoundSystem* soundSystem = NULL;
       
   467     if ( iSoundSystem )
       
   468         {
       
   469         iSoundSystem->PushContextL( R_AVKON_DEFAULT_SKEY_LIST );
       
   470         // Need to store local copy of iSoundSystem, since it will have been
       
   471         // destroyed when RunLD returns
       
   472         soundSystem = iSoundSystem;
       
   473         }
       
   474 
       
   475     CAknsFrameBackgroundControlContext* cc = 
       
   476         ( CAknsFrameBackgroundControlContext* )AknsDrawUtils::ControlContext(
       
   477                                                                         this );
       
   478     cc->SetCenter( KAknsIIDQsnFrPopupCenterQuery );
       
   479 
       
   480     TInt ret = CAknDialog::RunLD();
       
   481     if ( soundSystem )
       
   482         {
       
   483         soundSystem->PopContext();
       
   484         }
       
   485     CLOG_LEAVEFN( "CSelectConnectionDialog::RunLD" );  
       
   486     return ret;
       
   487     }
       
   488 
       
   489 
       
   490 // ---------------------------------------------------------
       
   491 // CSelectConnectionDialog::SetElementIDL
       
   492 // ---------------------------------------------------------
       
   493 //    
       
   494 void CSelectConnectionDialog::SetElementIDL( TUint32 aIAPId )
       
   495     {
       
   496     iPlugin->SetElementIDL( aIAPId, 0 );
       
   497     }
       
   498 
       
   499 
       
   500 // ---------------------------------------------------------
       
   501 // void CSelectConnectionDialog::CompleteL
       
   502 // ---------------------------------------------------------
       
   503 //
       
   504 void CSelectConnectionDialog::CompleteL( TInt aStatus )
       
   505     {
       
   506     CLOG_ENTERFN( "CSelectConnectionDialog::CompleteL" );  
       
   507     delete iActiveSelectExplicit;
       
   508     iActiveSelectExplicit = NULL;
       
   509     iPlugin->CompleteL( aStatus );
       
   510     CLOG_LEAVEFN( "CSelectConnectionDialog::CompleteL" );  
       
   511     }
       
   512 
       
   513 void CSelectConnectionDialog::HandleTimedOut()
       
   514     {
       
   515     TRAP_IGNORE( TryExitL(EAknSoftkeyCancel) );
       
   516     }
       
   517 
       
   518 // ---------------------------------------------------------
       
   519 // void CSelectConnectionDialog::HandleListBoxEventL
       
   520 // ---------------------------------------------------------
       
   521 //    
       
   522 void CSelectConnectionDialog::HandleListBoxEventL(CEikListBox* aListBox, 
       
   523 												TListBoxEvent aEventType)
       
   524 	{	
       
   525     if( aEventType == EEventItemClicked )
       
   526         {
       
   527         // Do not forward to the base class. 
       
   528         // The first click must only select the item.        
       
   529         return;
       
   530         }
       
   531     else if( aEventType == EEventItemDoubleClicked )
       
   532         {
       
   533         // Forward as EEventItemClicked to open the item on the second click.
       
   534         CAknListQueryDialog::HandleListBoxEventL( aListBox, EEventItemClicked );
       
   535         }
       
   536 	else
       
   537         {
       
   538         // normal forward
       
   539         CAknListQueryDialog::HandleListBoxEventL( aListBox, aEventType );
       
   540         }
       
   541     }
       
   542 
       
   543 // ---------------------------------------------------------
       
   544 // void CSelectConnectionDialog::HandlePointerEventL
       
   545 // ---------------------------------------------------------
       
   546 //    
       
   547 void CSelectConnectionDialog::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
   548     {
       
   549     if( ListBox()->Rect().Contains( aPointerEvent.iPosition ) )
       
   550         {
       
   551         if ( aPointerEvent.iType == TPointerEvent::EButton1Down )
       
   552             {
       
   553             TInt index;
       
   554             TInt oldIndex = ListBox()->CurrentItemIndex();
       
   555             if ( ListBox()->View()->XYPosToItemIndex( aPointerEvent.iPosition, index ) &&
       
   556                    ( index == oldIndex ) )
       
   557                 {
       
   558                 // Pressed Down Effect
       
   559                 ListBox()->View()->ItemDrawer()->SetFlags( CListItemDrawer::EPressedDownState );
       
   560                 }
       
   561             }
       
   562         CAknControl::HandlePointerEventL(aPointerEvent);
       
   563         }
       
   564     else
       
   565         {
       
   566         CAknListQueryDialog::HandlePointerEventL( aPointerEvent );
       
   567         }
       
   568     }
       
   569 
       
   570 // End of File