425 |
425 |
426 void CPbk2ContactViewListBox::SetListCommands( |
426 void CPbk2ContactViewListBox::SetListCommands( |
427 const RPointerArray<MPbk2UiControlCmdItem>* aCommands ) |
427 const RPointerArray<MPbk2UiControlCmdItem>* aCommands ) |
428 { |
428 { |
429 iListboxModelDecorator->SetListCommands( aCommands ); |
429 iListboxModelDecorator->SetListCommands( aCommands ); |
430 iColumnData->SetListCommands( aCommands ); |
430 if( iColumnData ) |
|
431 { |
|
432 iColumnData->SetListCommands( aCommands ); |
|
433 } |
431 } |
434 } |
432 |
435 |
433 // -------------------------------------------------------------------------- |
436 // -------------------------------------------------------------------------- |
434 // CPbk2ContactViewListBox::ClipFromBeginning |
437 // CPbk2ContactViewListBox::ClipFromBeginning |
435 // -------------------------------------------------------------------------- |
438 // -------------------------------------------------------------------------- |
518 params.iMultiselection = IsMultiselection(); |
521 params.iMultiselection = IsMultiselection(); |
519 CPbk2ContactViewListBoxModel* model = DoCreateModelL( params ); |
522 CPbk2ContactViewListBoxModel* model = DoCreateModelL( params ); |
520 model->SetUnnamedText( iResourceData.iUnnamedText ); |
523 model->SetUnnamedText( iResourceData.iUnnamedText ); |
521 iModel = model; |
524 iModel = model; |
522 |
525 |
523 if(FeatureManager::FeatureSupported(KFeatureIdFfContactsPredictiveSearch)) |
526 if( iColumnData ) |
524 { |
527 { |
525 iColumnData->SetDataModel( iModel ); |
528 iColumnData->SetDataModel( iModel ); |
526 } |
529 } |
527 // Wrap the original model. |
530 // Wrap the original model. |
528 iListboxModelDecorator = DoCreateDecoratorL( |
531 iListboxModelDecorator = DoCreateDecoratorL( |
587 // CPbk2ContactViewListBox::CreateItemDrawerL |
590 // CPbk2ContactViewListBox::CreateItemDrawerL |
588 // -------------------------------------------------------------------------- |
591 // -------------------------------------------------------------------------- |
589 // |
592 // |
590 void CPbk2ContactViewListBox::CreateItemDrawerL() |
593 void CPbk2ContactViewListBox::CreateItemDrawerL() |
591 { |
594 { |
592 CPbk2ContactViewCustomListBoxData* columnData = |
595 // Use custom drawer only if predictive search is enabled |
593 CPbk2ContactViewCustomListBoxData::NewL( iSearchFilter ); |
596 if( FeatureManager::FeatureSupported(KFeatureIdFfContactsPredictiveSearch) ) |
594 |
597 { |
595 CleanupStack::PushL( columnData ); |
598 CPbk2ContactViewCustomListBoxData* columnData = |
596 |
599 CPbk2ContactViewCustomListBoxData::NewL( iSearchFilter ); |
597 iItemDrawer=new(ELeave) CPbk2ContactViewCustomListBoxItemDrawer( |
600 |
598 static_cast<MTextListBoxModel*>(Model()), iCoeEnv->NormalFont(), |
601 CleanupStack::PushL( columnData ); |
599 columnData); |
602 |
600 CleanupStack::Pop( columnData ); |
603 iItemDrawer=new(ELeave) CPbk2ContactViewCustomListBoxItemDrawer( |
601 |
604 static_cast<MTextListBoxModel*>(Model()), iCoeEnv->NormalFont(), |
602 //Ownership has been transferred to iItemDrawer |
605 columnData); |
603 iColumnData = columnData; |
606 CleanupStack::Pop( columnData ); |
|
607 |
|
608 //Ownership has been transferred to iItemDrawer |
|
609 iColumnData = columnData; |
|
610 } |
|
611 else |
|
612 { |
|
613 CAknSingleGraphicStyleListBox::CreateItemDrawerL(); |
|
614 } |
604 } |
615 } |
605 |
616 |
606 // -------------------------------------------------------------------------- |
617 // -------------------------------------------------------------------------- |
607 // CPbk2ContactViewListBox::HandleGainingForeground |
618 // CPbk2ContactViewListBox::HandleGainingForeground |
608 // -------------------------------------------------------------------------- |
619 // -------------------------------------------------------------------------- |