uifw/AvKon/src/aknlistquerydialog.cpp
branchRCL_3
changeset 25 941195f2d488
parent 23 3d340a0166ff
child 55 aecbbf00d063
equal deleted inserted replaced
23:3d340a0166ff 25:941195f2d488
   260                                                         CEikScrollBarFrame::EAuto);
   260                                                         CEikScrollBarFrame::EAuto);
   261         listbox->ScrollBarFrame()->DrawBackground( EFalse, EFalse );
   261         listbox->ScrollBarFrame()->DrawBackground( EFalse, EFalse );
   262 		listbox->SetListBoxObserver(this);
   262 		listbox->SetListBoxObserver(this);
   263     
   263     
   264 		CAknListQueryControl* listControl = ListControl();
   264 		CAknListQueryControl* listControl = ListControl();
   265         if ( listControl )
   265 		if (listControl)
   266             {
   266 			listControl->SetLayout(&iLayout);
   267             listControl->SetLayout( &iLayout );
   267 		}
   268             }            
       
   269         
       
   270         if ( iAvkonAppUi->IsSingleClickCompatible() && 
       
   271              !IsLeftSoftkeyShown() )
       
   272             {
       
   273             MakeLeftSoftkeyVisible( EFalse );
       
   274             }    
       
   275         }
       
   276 
   268 
   277     if (FindBox())
   269     if (FindBox())
   278         {
   270         {
   279         STATIC_CAST(CAknFilteredTextListBoxModel*,ListBox()->Model())->CreateFilterL(ListBox(),FindBox());
   271         STATIC_CAST(CAknFilteredTextListBoxModel*,ListBox()->Model())->CreateFilterL(ListBox(),FindBox());
   280 
   272 
   467                     if (iIdle)
   459                     if (iIdle)
   468                         {                    
   460                         {                    
   469                         iIdle->Start(TCallBack(ClosePopupAcceptingChanges, this));
   461                         iIdle->Start(TCallBack(ClosePopupAcceptingChanges, this));
   470                         }
   462                         }
   471                     }  
   463                     }  
   472                 
       
   473                 if( iAvkonAppUi->IsSingleClickCompatible() && 
       
   474                         aListBox->IsMultiselection() )
       
   475                     {
       
   476                     CEikListBox* listbox = ListBox();
       
   477                     if( listbox )
       
   478                         {
       
   479                         MakeLeftSoftkeyVisible( IsLeftSoftkeyShown() );
       
   480                         }    
       
   481                     }
       
   482                 }
   464                 }
   483                 break;
   465                 break;
   484             default:
   466             default:
   485                 {
   467                 {
   486                 break;
   468                 break;
   581 		    		}
   563 		    		}
   582 		    	}
   564 		    	}
   583 	        }
   565 	        }
   584 
   566 
   585         TInt currentSelection = listbox->CurrentItemIndex();
   567         TInt currentSelection = listbox->CurrentItemIndex();
   586         TBool isSingleClick = iAvkonAppUi->IsSingleClickCompatible(); 
   568         if( currentSelection == KErrNotFound )
   587         if ( currentSelection == KErrNotFound )
   569             {
   588             {
   570             MakeLeftSoftkeyVisible(EFalse);
   589             MakeLeftSoftkeyVisible( EFalse );
   571             }
   590             }
   572         else
   591         else if ( isSingleClick )
   573             {
   592             {
   574             MakeLeftSoftkeyVisible(ETrue);
   593             MakeLeftSoftkeyVisible( IsLeftSoftkeyShown() );
       
   594             }
   575             }
   595             
   576             
   596         TKeyResponse response = listbox->OfferKeyEventL( aKeyEvent, aType);
   577         TKeyResponse response = listbox->OfferKeyEventL( aKeyEvent, aType);
   597         
       
   598         if ( isSingleClick && IsLeftSoftkeyShown() )
       
   599             {
       
   600             MakeLeftSoftkeyVisible( ETrue );
       
   601             }
       
   602         if (currentSelection != listbox->CurrentItemIndex() && iMediatorObs)
   578         if (currentSelection != listbox->CurrentItemIndex() && iMediatorObs)
   603             {
   579             {
   604             iMediatorObs->UpdateL(listbox->CurrentItemIndex());
   580             iMediatorObs->UpdateL(listbox->CurrentItemIndex());
   605             }
   581             }
   606 
   582 
   764         return EFalse;
   740         return EFalse;
   765         }
   741         }
   766     }
   742     }
   767 
   743 
   768 
   744 
   769 EXPORT_C void* CAknListQueryDialog::ExtensionInterface( TUid /*aInterface*/ ) 
   745 EXPORT_C void* CAknListQueryDialog::ExtensionInterface( TUid aInterface ) 
   770     { 
   746     {
       
   747     if(aInterface == KExIfTactileFeedbackUid)
       
   748         {
       
   749         return MTouchFeedback::Instance();
       
   750         }
   771     return NULL;
   751     return NULL;
   772     }
   752     }
   773 
   753 
   774 EXPORT_C void CAknListQueryDialog::CEikDialog_Reserved_1()
   754 EXPORT_C void CAknListQueryDialog::CEikDialog_Reserved_1()
   775 	{
   755 	{
   791     {
   771     {
   792     CAknListQuerySearchControl *control = (CAknListQuerySearchControl*)ControlOrNull(EFindControl);
   772     CAknListQuerySearchControl *control = (CAknListQuerySearchControl*)ControlOrNull(EFindControl);
   793     if (control) { return control->iFind; }
   773     if (control) { return control->iFind; }
   794     return NULL;
   774     return NULL;
   795     }
   775     }
   796 
       
   797 TBool CAknListQueryDialog::IsLeftSoftkeyShown()
       
   798 	{
       
   799     CEikListBox* listbox = ListBox();
       
   800     __ASSERT_DEBUG( listbox, Panic(EAknPanicNullPointer));
       
   801     // This flag indicators that listbox is a viewer listbox.    
       
   802     TBool isViewMode = listbox->View()->ItemDrawer()->Flags() & 
       
   803                            CListItemDrawer::EDisableHighlight; 
       
   804 
       
   805     return listbox->IsHighlightEnabled() || 
       
   806                listbox->SelectionIndexes()->Count() > 0 || isViewMode;
       
   807 	}
       
   808 
   776 
   809 EXPORT_C void CAknListQueryDialog::SetTone(TInt aTone)
   777 EXPORT_C void CAknListQueryDialog::SetTone(TInt aTone)
   810 	{
   778 	{
   811 	iTone = (TTone)aTone;
   779 	iTone = (TTone)aTone;
   812 	}
   780 	}