uifw/EikStd/coctlsrc/EIKLBX.CPP
branchRCL_3
changeset 18 0aa5fbdfbc30
parent 16 71dd06cfe933
child 23 3d340a0166ff
equal deleted inserted replaced
16:71dd06cfe933 18:0aa5fbdfbc30
  2885         RestoreClientRectFromViewRect(clientRect);
  2885         RestoreClientRectFromViewRect(clientRect);
  2886         TRect inclusiveRect=Rect();
  2886         TRect inclusiveRect=Rect();
  2887         TEikScrollBarFrameLayout layout;
  2887         TEikScrollBarFrameLayout layout;
  2888         CreateScrollBarFrameLayout(layout);
  2888         CreateScrollBarFrameLayout(layout);
  2889         TBool sizeChanged=iSBFrame->TileL(&hSbarModel, &vSbarModel, clientRect, inclusiveRect, layout);
  2889         TBool sizeChanged=iSBFrame->TileL(&hSbarModel, &vSbarModel, clientRect, inclusiveRect, layout);
  2890         if (iListBoxExt->UpdateScrollBarsColors())
  2890         if ( iListBoxExt && iListBoxExt->UpdateScrollBarsColors() )
  2891             UpdateScrollBarsColors();
  2891             UpdateScrollBarsColors();
  2892         if (!sizeChanged)
  2892         if (!sizeChanged)
  2893             return;
  2893             return;
  2894         // else size of client/inclusive rect has changed
  2894         // else size of client/inclusive rect has changed
  2895         if (layout.iTilingMode==TEikScrollBarFrameLayout::EClientRectConstant)
  2895         if (layout.iTilingMode==TEikScrollBarFrameLayout::EClientRectConstant)
  3012          && iItemDrawer->Properties(index).IsSelectionHidden() )
  3012          && iItemDrawer->Properties(index).IsSelectionHidden() )
  3013         {
  3013         {
  3014         _AKNTRACE_FUNC_EXIT;
  3014         _AKNTRACE_FUNC_EXIT;
  3015         return;
  3015         return;
  3016         }
  3016         }
  3017     if( !iListBoxExt )
  3017     
  3018         {
       
  3019         _AKNTRACE_FUNC_EXIT;
       
  3020         return;
       
  3021         }
       
  3022     CEikButtonGroupContainer *bgc;
  3018     CEikButtonGroupContainer *bgc;
  3023     CCoeControl* MSK( NULL );
  3019     CCoeControl* MSK( NULL );
  3024     CEikCba* cba( NULL );
  3020     CEikCba* cba( NULL );
  3025     CONST_CAST( CEikListBox*,this )->MopGetObject( bgc );
  3021     CONST_CAST( CEikListBox*,this )->MopGetObject( bgc );
  3026     if ( !bgc )
  3022     if ( !bgc )
  3054         TRAPD( err, bgc->AddCommandToStackL( 3, newResourceId ) );
  3050         TRAPD( err, bgc->AddCommandToStackL( 3, newResourceId ) );
  3055         // in case of error, don't inform observers
  3051         // in case of error, don't inform observers
  3056         // marking still works even MSK isn't changed
  3052         // marking still works even MSK isn't changed
  3057         if ( err )
  3053         if ( err )
  3058             {
  3054             {
  3059             iListBoxExt->iSelectionModeEnabled = EFalse;
  3055             if ( iListBoxExt )
       
  3056                 {
       
  3057                 iListBoxExt->iSelectionModeEnabled = EFalse;
       
  3058                 }
  3060             _AKNTRACE_FUNC_EXIT;
  3059             _AKNTRACE_FUNC_EXIT;
  3061             return;
  3060             return;
  3062             }
  3061             }
  3063         cba->DrawNow();
  3062         cba->DrawNow();
  3064         iListBoxExt->iSelectionModeEnabled = ETrue;
  3063         if ( iListBoxExt )
       
  3064             {
       
  3065             iListBoxExt->iSelectionModeEnabled = ETrue;
       
  3066             }
  3065         }
  3067         }
  3066 
  3068 
  3067     // remove stacked MSK
  3069     // remove stacked MSK
  3068     if( !aEnable && iListBoxExt->iSelectionModeEnabled )
  3070     if( !aEnable && iListBoxExt && iListBoxExt->iSelectionModeEnabled )
  3069         {
  3071         {
  3070         if( ( MSK && cba->ControlId( MSK ) == EAknSoftkeyMark ) ||
  3072         if( ( MSK && cba->ControlId( MSK ) == EAknSoftkeyMark ) ||
  3071             ( MSK && cba->ControlId( MSK ) == EAknSoftkeyUnmark ) )
  3073             ( MSK && cba->ControlId( MSK ) == EAknSoftkeyUnmark ) )
  3072             {
  3074             {
  3073             bgc->RemoveCommandFromStack( 3, cba->ControlId( MSK ) );
  3075             bgc->RemoveCommandFromStack( 3, cba->ControlId( MSK ) );
  3074             }
  3076             }
  3075         iListBoxExt->iSelectionModeEnabled = EFalse; // just in case
  3077         iListBoxExt->iSelectionModeEnabled = EFalse; // just in case
  3076         }
  3078         }
  3077         
  3079     if ( iListBoxExt )
  3078     TInt count = iListBoxExt->iSelectionObservers.Count();
  3080         {
  3079     for ( int i=0; i < count; i++ )
  3081         TInt count = iListBoxExt->iSelectionObservers.Count();
  3080         {
  3082         for ( int i=0; i < count; i++ )
  3081         iListBoxExt->iSelectionObservers[i]->SelectionModeChanged( this, aEnable );
  3083             {
       
  3084             iListBoxExt->iSelectionObservers[i]->SelectionModeChanged( this, aEnable );
       
  3085             }
  3082         }
  3086         }
  3083     _AKNTRACE_FUNC_EXIT;
  3087     _AKNTRACE_FUNC_EXIT;
  3084     }
  3088     }
  3085 
  3089 
  3086 
  3090 
  3096     UpdateScrollBarsL();
  3100     UpdateScrollBarsL();
  3097     UpdateScrollBarThumbs();
  3101     UpdateScrollBarThumbs();
  3098     iView->ClearFlags(CListBoxView::EItemCountModified);
  3102     iView->ClearFlags(CListBoxView::EItemCountModified);
  3099 
  3103 
  3100 
  3104 
  3101     if ( iListBoxExt->iLongTappedItem != KErrNotFound )
  3105     if ( iListBoxExt && iListBoxExt->iLongTappedItem != KErrNotFound )
  3102         {
  3106         {
  3103         iListBoxExt->EnableHighlight( EFalse );
  3107         iListBoxExt->EnableHighlight( EFalse );
  3104         }
  3108         }
  3105 
  3109 
  3106     FireItemChange();
  3110     FireItemChange();
  3392             }
  3396             }
  3393         else
  3397         else
  3394             {
  3398             {
  3395             selectionMode = CListBoxView::ENoSelection;
  3399             selectionMode = CListBoxView::ENoSelection;
  3396             UpdateMarkUnmarkMSKL();
  3400             UpdateMarkUnmarkMSKL();
  3397             if (IsSelectionMarkKeys(code, aKeyEvent.iScanCode, iListBoxExt->iWesternVariant)) 
  3401             if ( iListBoxExt 
       
  3402                  && IsSelectionMarkKeys( code, aKeyEvent.iScanCode, iListBoxExt->iWesternVariant ) ) 
  3398                 {
  3403                 {
  3399                 __KeyDebug(ETrue, "SelectionMarkKey")
  3404                 __KeyDebug(ETrue, "SelectionMarkKey")
  3400                 View()->ClearSelectionAnchorAndActiveIndex();
  3405                 View()->ClearSelectionAnchorAndActiveIndex();
  3401                 }
  3406                 }
  3402             }
  3407             }
  3403         }
  3408         }
  3404 
  3409 
  3405 
  3410 
  3406     // CAknGrid marking is implemeted in avkon.dll. But we still need to disable short
  3411     // CAknGrid marking is implemeted in avkon.dll. But we still need to disable short
  3407     // hash mark in here.
  3412     // hash mark in here.
  3408     if ( iListBoxFlags & EMultipleSelection && 
  3413     if ( iListBoxExt && iListBoxFlags & EMultipleSelection && 
  3409          iListBoxFlags & EShiftEnterMarks && aType == EEventKeyUp )
  3414          iListBoxFlags & EShiftEnterMarks && aType == EEventKeyUp )
  3410         {
  3415         {
  3411         if ( aKeyEvent.iScanCode == EStdKeyLeftArrow ||
  3416         if ( aKeyEvent.iScanCode == EStdKeyLeftArrow ||
  3412              aKeyEvent.iScanCode == EStdKeyUpArrow ||
  3417              aKeyEvent.iScanCode == EStdKeyUpArrow ||
  3413              aKeyEvent.iScanCode == EStdKeyRightArrow ||
  3418              aKeyEvent.iScanCode == EStdKeyRightArrow ||
  3615                     _AKNTRACE_FUNC_EXIT;
  3620                     _AKNTRACE_FUNC_EXIT;
  3616                     return( EKeyWasConsumed );
  3621                     return( EKeyWasConsumed );
  3617                     }
  3622                     }
  3618                 }
  3623                 }
  3619 		
  3624 		
  3620             if ( ScrollingDisabled() || ( !iListBoxExt->MovePhysicsCursorL( moveto, selectionMode ) ) )
  3625             if ( ScrollingDisabled() 
       
  3626                 || ( iListBoxExt && !iListBoxExt->MovePhysicsCursorL( moveto, selectionMode ) ) )
  3621                 {
  3627                 {
  3622                 iView->MoveCursorL(moveto, selectionMode);
  3628                 iView->MoveCursorL(moveto, selectionMode);
  3623                 }
  3629                 }
  3624             ClearMatchBuffer();
  3630             ClearMatchBuffer();
  3625             if( iListBoxFlags & EMultipleSelection )
  3631             if( iListBoxFlags & EMultipleSelection )
  3664                     _AKNTRACE_FUNC_EXIT;
  3670                     _AKNTRACE_FUNC_EXIT;
  3665                     return(EKeyWasConsumed);    
  3671                     return(EKeyWasConsumed);    
  3666                     }
  3672                     }
  3667                 }
  3673                 }
  3668 
  3674 
  3669             if ( ScrollingDisabled() || ( !iListBoxExt->MovePhysicsCursorL( moveto, selectionMode ) ) )
  3675             if ( ScrollingDisabled() 
       
  3676                 || ( iListBoxExt && !iListBoxExt->MovePhysicsCursorL( moveto, selectionMode ) ) )
  3670                 {
  3677                 {
  3671                 iView->MoveCursorL(moveto, selectionMode);
  3678                 iView->MoveCursorL(moveto, selectionMode);
  3672                 }
  3679                 }
  3673             ClearMatchBuffer();
  3680             ClearMatchBuffer();
  3674             if (iListBoxFlags & EMultipleSelection)
  3681             if (iListBoxFlags & EMultipleSelection)
  3749     //
  3756     //
  3750     // Switch/case ends here
  3757     // Switch/case ends here
  3751     //
  3758     //
  3752     if(switchMSK)
  3759     if(switchMSK)
  3753         {
  3760         {
  3754         if( selectionMode == CListBoxView::EDisjointMarkSelection )
  3761         if( iListBoxExt && selectionMode == CListBoxView::EDisjointMarkSelection )
  3755             {
  3762             {
  3756              // if hash and either up or down pressed -> no short marking
  3763              // if hash and either up or down pressed -> no short marking
  3757             iListBoxExt->iShortHashMark = EFalse;
  3764             iListBoxExt->iShortHashMark = EFalse;
  3758             }
  3765             }
  3759         UpdateMarkUnmarkMSKL();
  3766         UpdateMarkUnmarkMSKL();
  3808     // This code block watches for hash key presses, and simulates shift + ok 
  3815     // This code block watches for hash key presses, and simulates shift + ok 
  3809     // if short hash key presses are used for selections. The events are simulated 
  3816     // if short hash key presses are used for selections. The events are simulated 
  3810     // only if a markable list is active, otherwise the simulated event might open 
  3817     // only if a markable list is active, otherwise the simulated event might open 
  3811     // the selected item, which we don't want.    
  3818     // the selected item, which we don't want.    
  3812     if((iListBoxFlags & EMultipleSelection) && (iListBoxFlags & EShiftEnterMarks) &&
  3819     if((iListBoxFlags & EMultipleSelection) && (iListBoxFlags & EShiftEnterMarks) &&
  3813         iListBoxExt->iWesternVariant &&
  3820         iListBoxExt && iListBoxExt->iWesternVariant &&
  3814         iListBoxExt->iAknFepHashKeySelection && 
  3821         iListBoxExt->iAknFepHashKeySelection && 
  3815         iListBoxExt->iQwertyMode == EFalse && 
  3822         iListBoxExt->iQwertyMode == EFalse && 
  3816         aType == EEventKeyUp && aKeyEvent.iScanCode == EStdKeyHash &&
  3823         aType == EEventKeyUp && aKeyEvent.iScanCode == EStdKeyHash &&
  3817         IsFocused() )
  3824         IsFocused() )
  3818         {
  3825         {
  3910         {
  3917         {
  3911         case MEikListBoxObserver::EEventFlickStarted:
  3918         case MEikListBoxObserver::EEventFlickStarted:
  3912         case MEikListBoxObserver::EEventPanningStarted:
  3919         case MEikListBoxObserver::EEventPanningStarted:
  3913             {
  3920             {
  3914             iItemDrawer->SetFlags( CListItemDrawer::EDisableMarquee );
  3921             iItemDrawer->SetFlags( CListItemDrawer::EDisableMarquee );
  3915             if ( aEvent == MEikListBoxObserver::EEventFlickStarted )
  3922             if ( iListBoxExt )
  3916                 iListBoxExt->SetFlickOngoing( ETrue );
  3923                 { 
  3917             else            
  3924                 if ( aEvent == MEikListBoxObserver::EEventFlickStarted )
  3918                 iListBoxExt->SetPanningOngoing( ETrue );
  3925                     {
       
  3926                     iListBoxExt->SetFlickOngoing( ETrue );
       
  3927                     }
       
  3928                 else 
       
  3929                     {
       
  3930                     iListBoxExt->SetPanningOngoing( ETrue );
       
  3931                     }
       
  3932                 }
  3919             break;
  3933             break;
  3920             }
  3934             }
  3921             
  3935             
  3922         case MEikListBoxObserver::EEventFlickStopped:
  3936         case MEikListBoxObserver::EEventFlickStopped:
  3923         case MEikListBoxObserver::EEventPanningStopped:
  3937         case MEikListBoxObserver::EEventPanningStopped:
  3924             {
  3938             {
  3925             iItemDrawer->ClearFlags( CListItemDrawer::EDisableMarquee );
  3939             iItemDrawer->ClearFlags( CListItemDrawer::EDisableMarquee );
  3926             if ( aEvent == MEikListBoxObserver::EEventFlickStopped )
  3940             if ( iListBoxExt )
  3927                 {
  3941                 { 
  3928                 iListBoxExt->SetFlickOngoing( EFalse );
  3942                 if ( aEvent == MEikListBoxObserver::EEventFlickStopped )
  3929                 }
  3943                     {   
  3930             else 
  3944                     iListBoxExt->SetFlickOngoing( EFalse );                    
  3931                 {
  3945                     }
  3932                 iListBoxExt->SetPanningOngoing( EFalse );
  3946                 else 
  3933                 }
  3947                     {
  3934             
  3948                     iListBoxExt->SetPanningOngoing( EFalse );
       
  3949                     }
       
  3950                 }            
  3935             break;
  3951             break;
  3936             }
  3952             }
  3937         }
  3953         }
  3938     
  3954     
  3939     if ( iListBoxObserver )
  3955     if ( iListBoxObserver )
  3978 // ---------------------------------------------------------------------------
  3994 // ---------------------------------------------------------------------------
  3979 //
  3995 //
  3980 EXPORT_C void CEikListBox::HandlePhysicsScrollEventL( TInt aDeltaPixels )
  3996 EXPORT_C void CEikListBox::HandlePhysicsScrollEventL( TInt aDeltaPixels )
  3981     {    
  3997     {    
  3982     _AKNTRACE_FUNC_ENTER;
  3998     _AKNTRACE_FUNC_ENTER;
  3983     if ( iListBoxExt->iPhysics )
  3999     if ( iListBoxExt && iListBoxExt->iPhysics )
  3984         {
  4000         {
  3985         iListBoxExt->InitPhysicsL();
  4001         iListBoxExt->InitPhysicsL();
  3986         
  4002         
  3987         TPoint newPosition( iListBoxExt->iViewPosition.iX,
  4003         TPoint newPosition( iListBoxExt->iViewPosition.iX,
  3988                             aDeltaPixels + iListBoxExt->iViewPosition.iY );
  4004                             aDeltaPixels + iListBoxExt->iViewPosition.iY );
  3993 
  4009 
  3994 
  4010 
  3995 EXPORT_C void CEikListBox::HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType)
  4011 EXPORT_C void CEikListBox::HandleScrollEventL(CEikScrollBar* aScrollBar,TEikScrollEvent aEventType)
  3996     {
  4012     {
  3997     _AKNTRACE_FUNC_ENTER;
  4013     _AKNTRACE_FUNC_ENTER;
  3998     if ( iListBoxExt->iSingleClickEnabled )
  4014     if ( iListBoxExt && iListBoxExt->iSingleClickEnabled )
  3999         {
  4015         {
  4000         iListBoxExt->EnableHighlight( EFalse );
  4016         iListBoxExt->EnableHighlight( EFalse );
  4001         iView->DrawItem( iView->CurrentItemIndex() );
  4017         iView->DrawItem( iView->CurrentItemIndex() );
  4002         }
  4018         }
  4003 
  4019 
  4136                                        MAknListBoxTfxInternal::EListScrollUp :
  4152                                        MAknListBoxTfxInternal::EListScrollUp :
  4137                                        MAknListBoxTfxInternal::EListScrollDown );
  4153                                        MAknListBoxTfxInternal::EListScrollDown );
  4138                 }
  4154                 }
  4139 #endif
  4155 #endif
  4140             
  4156             
  4141         if ( iListBoxExt->iPhysics )
  4157         if ( iListBoxExt && iListBoxExt->iPhysics )
  4142             {
  4158             {
  4143             iListBoxExt->InitPhysicsL();
  4159             iListBoxExt->InitPhysicsL();
  4144             TInt deltaPixels = newThumbPos;
  4160             TInt deltaPixels = newThumbPos;
  4145     
  4161     
  4146 #ifdef _DEBUG
  4162 #ifdef _DEBUG
  4147             RDebug::Print( _L( "CListBox::HandleScrollEventL, deltaPixels = %d" ), deltaPixels );
  4163                 RDebug::Print( _L( "CListBox::HandleScrollEventL, deltaPixels = %d" ), deltaPixels );
  4148 #endif // _DEBUG
  4164 #endif // _DEBUG
  4149             
  4165             
  4150             TPoint newPosition( iListBoxExt->iViewPosition.iX, deltaPixels + iView->ViewRect().Height() / 2 );
  4166             TPoint newPosition( iListBoxExt->iViewPosition.iX, deltaPixels + iView->ViewRect().Height() / 2 );
  4151             iListBoxExt->ViewPositionChanged( newPosition );
  4167             iListBoxExt->ViewPositionChanged( newPosition );            
  4152             }
  4168             }
  4153         else
  4169         else
  4154             {
  4170             {
  4155             iView->VScrollTo(newThumbPos/iView->ItemHeight());
  4171             iView->VScrollTo(newThumbPos/iView->ItemHeight());
  4156             }
  4172             }
  4168             }
  4184             }
  4169         
  4185         
  4170         // If the event has changed thumb position, then update scroll bar
  4186         // If the event has changed thumb position, then update scroll bar
  4171         // unless physics is used. In that case thumb is updated via 
  4187         // unless physics is used. In that case thumb is updated via 
  4172         // CEikListBox::ScrollView.
  4188         // CEikListBox::ScrollView.
  4173         if ( AknLayoutUtils::PenEnabled() && newThumbPos != newThumbPosBeforeCorrecting && !iListBoxExt->iPhysics )
  4189         if ( AknLayoutUtils::PenEnabled() 
       
  4190              && newThumbPos != newThumbPosBeforeCorrecting 
       
  4191              && iListBoxExt && !iListBoxExt->iPhysics )
  4174             {
  4192             {
  4175             UpdateScrollBarThumbs();
  4193             UpdateScrollBarThumbs();
  4176             }
  4194             }
  4177         }
  4195         }
  4178     iItemDrawer->ClearFlags(CListItemDrawer::EDisableMarquee);
  4196     iItemDrawer->ClearFlags(CListItemDrawer::EDisableMarquee);
  4187         {
  4205         {
  4188         _AKNTRACE_FUNC_EXIT;
  4206         _AKNTRACE_FUNC_EXIT;
  4189         return;
  4207         return;
  4190         }
  4208         }
  4191     
  4209     
  4192     CheckCreateExtensionL();
       
  4193     if (!(iListBoxFlags & ELeftDownInViewRect))
  4210     if (!(iListBoxFlags & ELeftDownInViewRect))
  4194         {
  4211         {
  4195         _AKNTRACE_FUNC_EXIT;
  4212         _AKNTRACE_FUNC_EXIT;
  4196         return;
  4213         return;
  4197         }
  4214         }
  5362     else
  5379     else
  5363         {
  5380         {
  5364         // switch off selection (marking) mode when we lose focus
  5381         // switch off selection (marking) mode when we lose focus
  5365         // this also corrects situation, where FEP-menu is launched
  5382         // this also corrects situation, where FEP-menu is launched
  5366         // and thus listbox doesn't receive shift up event
  5383         // and thus listbox doesn't receive shift up event
  5367         if (NULL != iListBoxExt)
  5384         if ( iListBoxExt )
  5368             {
  5385             {
  5369             if ((iListBoxFlags & EMultipleSelection) && (iListBoxFlags & EShiftEnterMarks))
  5386             if ((iListBoxFlags & EMultipleSelection) && (iListBoxFlags & EShiftEnterMarks))
  5370                 {
  5387                 {
  5371                 iListBoxExt->iShiftKeyPressed = EFalse;
  5388                 iListBoxExt->iShiftKeyPressed = EFalse;
  5372                 if (iListBoxExt->iLongPressTimer && iListBoxExt->iLongPressTimer->IsActive())
  5389                 if (iListBoxExt->iLongPressTimer && iListBoxExt->iLongPressTimer->IsActive())
  5382             }
  5399             }
  5383     
  5400     
  5384         iView->SetEmphasized(EFalse);
  5401         iView->SetEmphasized(EFalse);
  5385         iView->HideMatcherCursor();
  5402         iView->HideMatcherCursor();
  5386         
  5403         
  5387         if (iItemEditor && 
  5404         if ( iItemEditor && 
  5388             (iListBoxFlags & EPaintedSelection) && 
  5405             ( iListBoxFlags & EPaintedSelection ) && 
  5389             (NULL != iListBoxExt && iListBoxExt->ReasonForFocusLost() == EFocusLostToExternalControl))
  5406             ( iListBoxExt && iListBoxExt->ReasonForFocusLost() == EFocusLostToExternalControl ) )
  5390             {
  5407             {
  5391             iView->DeselectItem(CurrentItemIndex());
  5408             iView->DeselectItem(CurrentItemIndex());
  5392             }
  5409             }
  5393         }
  5410         }
  5394 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  5411 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  5736             iListBoxFlags &= ( ~ELeftDownInViewRect );
  5753             iListBoxFlags &= ( ~ELeftDownInViewRect );
  5737             }
  5754             }
  5738         
  5755         
  5739         if ( iView )
  5756         if ( iView )
  5740             {
  5757             {
  5741             iView->SetItemOffsetInPixels( 0 );
  5758             iView->SetItemOffsetInPixels( 0 );            
  5742             }
  5759             }
  5743         
  5760         
  5744         // make sure that highlight is removed and long tap is canceled 
  5761         // make sure that highlight is removed and long tap is canceled 
  5745         // on layout switch, if single click is enabled and there is 
  5762         // on layout switch, if single click is enabled and there is 
  5746         // pointer down on any item
  5763         // pointer down on any item
  5983         rect.iTl.iX += LafListBox::InnerGutter();
  6000         rect.iTl.iX += LafListBox::InnerGutter();
  5984         if (iItemDrawer->Flags()&CListItemDrawer::EDrawMarkSelection)
  6001         if (iItemDrawer->Flags()&CListItemDrawer::EDrawMarkSelection)
  5985             {
  6002             {
  5986             rect.iTl.iX += iItemDrawer->MarkColumn() + iItemDrawer->MarkGutter();
  6003             rect.iTl.iX += iItemDrawer->MarkColumn() + iItemDrawer->MarkGutter();
  5987             }
  6004             }
  5988         iListBoxExt->SetReasonForFocusLost(EFocusLostToInternalEditor);
  6005         if ( iListBoxExt )
       
  6006             {
       
  6007             iListBoxExt->SetReasonForFocusLost(EFocusLostToInternalEditor);
       
  6008             }
  5989         itemEditor->StartEditingL(*this,rect,index,aMaxLength);
  6009         itemEditor->StartEditingL(*this,rect,index,aMaxLength);
  5990         iListBoxExt->SetReasonForFocusLost(EFocusLostToExternalControl);
  6010         if ( iListBoxExt )
       
  6011             {
       
  6012             iListBoxExt->SetReasonForFocusLost(EFocusLostToExternalControl);
       
  6013             }
  5991         ReportListBoxEventL( MEikListBoxObserver::EEventEditingStarted );
  6014         ReportListBoxEventL( MEikListBoxObserver::EEventEditingStarted );
  5992         }
  6015         }
  5993     _AKNTRACE_FUNC_EXIT;
  6016     _AKNTRACE_FUNC_EXIT;
  5994     }
  6017     }
  5995 
  6018 
  6113 // ---------------------------------------------------------------------------
  6136 // ---------------------------------------------------------------------------
  6114 //
  6137 //
  6115 EXPORT_C void CEikListBox::DisableScrolling( TBool aDisabled )
  6138 EXPORT_C void CEikListBox::DisableScrolling( TBool aDisabled )
  6116     {
  6139     {
  6117     _AKNTRACE_FUNC_ENTER;
  6140     _AKNTRACE_FUNC_ENTER;
  6118     iListBoxExt->iScrollingDisabled = aDisabled;
  6141     if ( iListBoxExt )
  6119     iView->iExtension->iScrollingDisabled = aDisabled;
  6142         {
  6120     
  6143         iListBoxExt->iScrollingDisabled = aDisabled;
  6121     if ( aDisabled && iListBoxExt->iPhysics )
  6144         iView->iExtension->iScrollingDisabled = aDisabled;
  6122         {
  6145         
  6123         delete iListBoxExt->iPhysics;
  6146         if ( aDisabled && iListBoxExt->iPhysics )
  6124         iListBoxExt->iPhysics = NULL;
  6147             {
  6125         iView->SetItemOffsetInPixels( 0 );
  6148             delete iListBoxExt->iPhysics;
  6126         }
  6149             iListBoxExt->iPhysics = NULL;
  6127     else if ( !aDisabled && !iListBoxExt->iPhysics && CAknPhysics::FeatureEnabled() )
  6150             iView->SetItemOffsetInPixels( 0 );
  6128         {
  6151             }
  6129         iListBoxExt->iPhysics = CAknPhysics::NewL( *iListBoxExt, this);      
  6152         else if ( !aDisabled && !iListBoxExt->iPhysics && CAknPhysics::FeatureEnabled() )
       
  6153             {
       
  6154             iListBoxExt->iPhysics = CAknPhysics::NewL( *iListBoxExt, this);      
       
  6155             }
  6130         }
  6156         }
  6131     _AKNTRACE_FUNC_EXIT;
  6157     _AKNTRACE_FUNC_EXIT;
  6132     }
  6158     }
  6133 
  6159 
  6134 
  6160 
  6136 // Checks if the kinetic scrolling functionality is disabled in the list.
  6162 // Checks if the kinetic scrolling functionality is disabled in the list.
  6137 // ---------------------------------------------------------------------------
  6163 // ---------------------------------------------------------------------------
  6138 //
  6164 //
  6139 EXPORT_C TBool CEikListBox::ScrollingDisabled()
  6165 EXPORT_C TBool CEikListBox::ScrollingDisabled()
  6140     {
  6166     {
  6141     return !iListBoxExt->iPhysics || iListBoxExt->iScrollingDisabled;
  6167     if ( iListBoxExt )
       
  6168         {
       
  6169         return !iListBoxExt->iPhysics || iListBoxExt->iScrollingDisabled;
       
  6170         }
       
  6171     else
       
  6172         {
       
  6173         return ETrue;
       
  6174         }
  6142     }
  6175     }
  6143 
  6176 
  6144 
  6177 
  6145 EXPORT_C void CEikListBox::SetPointerEventFilterDisabledL( const CArrayFix<TInt>& aItemIndexes )
  6178 EXPORT_C void CEikListBox::SetPointerEventFilterDisabledL( const CArrayFix<TInt>& aItemIndexes )
  6146     {
  6179     {
  6147     _AKNTRACE_FUNC_ENTER;
  6180     _AKNTRACE_FUNC_ENTER;
  6148     iListBoxExt->iMutiTappingItems.Reset();
  6181     if ( iListBoxExt )
  6149 
  6182         {
  6150     for(TInt i=0; i<aItemIndexes.Count(); i++ )
  6183         iListBoxExt->iMutiTappingItems.Reset();
  6151         {
  6184     
  6152         iListBoxExt->iMutiTappingItems.InsertInOrderL( aItemIndexes.At(i) ); 
  6185         for(TInt i=0; i<aItemIndexes.Count(); i++ )
  6153         }   
  6186             {
       
  6187             iListBoxExt->iMutiTappingItems.InsertInOrderL( aItemIndexes.At(i) ); 
       
  6188             } 
       
  6189         }
  6154     _AKNTRACE_FUNC_EXIT;
  6190     _AKNTRACE_FUNC_EXIT;
  6155     }
  6191     }
  6156 
  6192 
  6157 
  6193 
  6158 // ---------------------------------------------------------------------------
  6194 // ---------------------------------------------------------------------------
  6204 // Disables the single click functionality in the list.
  6240 // Disables the single click functionality in the list.
  6205 // ---------------------------------------------------------------------------
  6241 // ---------------------------------------------------------------------------
  6206 //
  6242 //
  6207 EXPORT_C void CEikListBox::DisableSingleClick( TBool aDisabled )
  6243 EXPORT_C void CEikListBox::DisableSingleClick( TBool aDisabled )
  6208     {
  6244     {
  6209     _AKNTRACE_FUNC_ENTER;
  6245     _AKNTRACE_FUNC_ENTER;    
  6210     if ( aDisabled && iListBoxExt->iSingleClickEnabled )
  6246     if ( aDisabled && iListBoxExt && iListBoxExt->iSingleClickEnabled )
  6211         {
  6247         {
  6212         iListBoxExt->DisableSingleClick(); 
  6248         iListBoxExt->DisableSingleClick(); 
  6213         }
  6249         }
  6214     _AKNTRACE_FUNC_EXIT;
  6250     _AKNTRACE_FUNC_EXIT;
  6215     }
  6251     }
  6233 // CEikListBox::IsHighlightEnabled
  6269 // CEikListBox::IsHighlightEnabled
  6234 // ---------------------------------------------------------------------------
  6270 // ---------------------------------------------------------------------------
  6235 //
  6271 //
  6236 EXPORT_C TBool CEikListBox::IsHighlightEnabled()
  6272 EXPORT_C TBool CEikListBox::IsHighlightEnabled()
  6237     {
  6273     {
  6238     _AKNTRACE_FUNC_ENTER;
  6274     _AKNTRACE_FUNC_ENTER;	
  6239     TBool enabled( EFalse ); 
  6275     TBool enabled( EFalse ); 
  6240     if ( !( iItemDrawer->Flags() & CListItemDrawer::EDisableHighlight ) )
  6276     if ( !( iItemDrawer->Flags() & CListItemDrawer::EDisableHighlight ) )
  6241         {
  6277         {
  6242         if ( iListBoxExt->iSingleClickEnabled )
  6278         if ( iListBoxExt && iListBoxExt->iSingleClickEnabled )
  6243             {
  6279             {
  6244             enabled = !( iItemDrawer->Flags()
  6280             enabled = !( iItemDrawer->Flags()
  6245                 & CListItemDrawer::ESingleClickDisabledHighlight ); 
  6281                 & CListItemDrawer::ESingleClickDisabledHighlight ); 
  6246             }
  6282             }
  6247         else 
  6283         else 
  6256 void CEikListBox::ScrollView( const TInt aOffset, TBool aDrawNow )
  6292 void CEikListBox::ScrollView( const TInt aOffset, TBool aDrawNow )
  6257 	{
  6293 	{
  6258 	_AKNTRACE_FUNC_ENTER;
  6294 	_AKNTRACE_FUNC_ENTER;
  6259 #ifdef _DEBUG
  6295 #ifdef _DEBUG
  6260 	RDebug::Print( _L( "CEikListBox::ScrollView, aOffset = %d, aDrawNow = %d" ), aOffset, aDrawNow );
  6296 	RDebug::Print( _L( "CEikListBox::ScrollView, aOffset = %d, aDrawNow = %d" ), aOffset, aDrawNow );
  6261 #endif // _DEBUG
  6297 #endif // _DEBUG	
  6262 
  6298 	
  6263 	if ( aOffset != 0 )
  6299 	if ( iListBoxExt && aOffset != 0 )
  6264 	    {
  6300 	    {
  6265         TInt itemHeight = iView->ItemHeight();
  6301         TInt itemHeight = iView->ItemHeight();
  6266         TInt viewHeight = iView->ViewRect().Size().iHeight;
  6302         TInt viewHeight = iView->ViewRect().Size().iHeight;
  6267         TInt itemsInSingleLine = iListBoxExt->iItemsInSingleLine;
  6303         TInt itemsInSingleLine = iListBoxExt->iItemsInSingleLine;
  6268         TInt oldListTopPos = ( iView->TopItemIndex() / itemsInSingleLine ) * itemHeight 
  6304         TInt oldListTopPos = ( iView->TopItemIndex() / itemsInSingleLine ) * itemHeight 
  6332     if ( aDrawNow )
  6368     if ( aDrawNow )
  6333         {
  6369         {
  6334         TRect rect(Rect());
  6370         TRect rect(Rect());
  6335         
  6371         
  6336         // list position changed
  6372         // list position changed
  6337         iListBoxExt->iBackgroundDrawingSuppressed = ETrue;
  6373         if ( iListBoxExt )
       
  6374             {
       
  6375             iListBoxExt->iBackgroundDrawingSuppressed = ETrue;
       
  6376             }
  6338         UpdateScrollBarThumbs();
  6377         UpdateScrollBarThumbs();
  6339         DrawNow();
  6378         DrawNow();
  6340         if (iSBFrame && iSBFrame->VerticalScrollBar() && !iSBFrame->VerticalScrollBar()->OwnsWindow())
  6379         if (iSBFrame && iSBFrame->VerticalScrollBar() && !iSBFrame->VerticalScrollBar()->OwnsWindow())
  6341             {
  6380             {
  6342             TRect srect( iSBFrame->VerticalScrollBar()->Rect() );
  6381             TRect srect( iSBFrame->VerticalScrollBar()->Rect() );
  6343             if ( !srect.Intersects( rect ))
  6382             if ( !srect.Intersects( rect ))
  6344                 {
  6383                 {
  6345                 iSBFrame->DrawScrollBarsNow();                
  6384                 iSBFrame->DrawScrollBarsNow();                
  6346                 }
  6385                 }
  6347             }
  6386             }
  6348         iListBoxExt->iBackgroundDrawingSuppressed = EFalse;
  6387         if ( iListBoxExt )
       
  6388             {
       
  6389             iListBoxExt->iBackgroundDrawingSuppressed = EFalse;
       
  6390             }
  6349         }        
  6391         }        
  6350     _AKNTRACE_FUNC_EXIT;
  6392     _AKNTRACE_FUNC_EXIT;
  6351 	}
  6393 	}
  6352 
  6394 
  6353 
  6395 
  6615 void CEikListBox::UpdateHighlightL( TInt aItemIndex )
  6657 void CEikListBox::UpdateHighlightL( TInt aItemIndex )
  6616     {
  6658     {
  6617     _AKNTRACE_FUNC_ENTER;
  6659     _AKNTRACE_FUNC_ENTER;
  6618     TInt oldCurrentItemIndex = iView->CurrentItemIndex();
  6660     TInt oldCurrentItemIndex = iView->CurrentItemIndex();
  6619 
  6661 
  6620     if ( iListBoxExt->iReportDelayedPenDown && !iListBoxExt->iScrolling )
  6662     if ( iListBoxExt && iListBoxExt->iReportDelayedPenDown 
       
  6663         && !iListBoxExt->iScrolling )
  6621         {
  6664         {
  6622 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  6665 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  6623         if ( aItemIndex != oldCurrentItemIndex )
  6666         if ( aItemIndex != oldCurrentItemIndex )
  6624             {
  6667             {
  6625             MAknListBoxTfxInternal* transApi =
  6668             MAknListBoxTfxInternal* transApi =
  6638         // been made visible.
  6681         // been made visible.
  6639         iListBoxExt->LongTapPointerEventL(
  6682         iListBoxExt->LongTapPointerEventL(
  6640             iListBoxExt->iDelayedPointerDownEvent );
  6683             iListBoxExt->iDelayedPointerDownEvent );
  6641         }
  6684         }
  6642 
  6685 
  6643     if ( iListBoxExt->iDelayedMultiselection )
  6686     if ( iListBoxExt && iListBoxExt->iDelayedMultiselection )
  6644         {
  6687         {
  6645         iItemDrawer->SetFlags( CListItemDrawer::EPressedDownState );
  6688         iItemDrawer->SetFlags( CListItemDrawer::EPressedDownState );
  6646         }
  6689         }
  6647     
  6690     
  6648     iView->SetItemIndex( aItemIndex );
  6691     iView->SetItemIndex( aItemIndex );
  6649 
  6692 
  6650     if ( iListBoxExt->iMarkableListMarking )
  6693     if ( iListBoxExt && iListBoxExt->iMarkableListMarking )
  6651         {
  6694         {
  6652         if ( iListBoxExt->iMarkableListShiftKeyPressed )
  6695         if ( iListBoxExt->iMarkableListShiftKeyPressed )
  6653            {
  6696            {
  6654 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  6697 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  6655            iListBoxExt->iAnchor = oldCurrentItemIndex;
  6698            iListBoxExt->iAnchor = oldCurrentItemIndex;
  6675         }
  6718         }
  6676 
  6719 
  6677     iView->DrawItem( oldCurrentItemIndex );
  6720     iView->DrawItem( oldCurrentItemIndex );
  6678     iView->DrawItem( aItemIndex );
  6721     iView->DrawItem( aItemIndex );
  6679     
  6722     
  6680     if ( iListBoxExt->iDelayedMultiselection )
  6723     if ( iListBoxExt && iListBoxExt->iDelayedMultiselection )
  6681         {
  6724         {
  6682         iListBoxFlags |= EStateChanged;
  6725         iListBoxFlags |= EStateChanged;
  6683         Buffer()->iPressedIndex = aItemIndex;
  6726         Buffer()->iPressedIndex = aItemIndex;
  6684         }
  6727         }
  6685 
  6728