uifw/AvKon/src/aknlistquerydialog.cpp
branchRCL_3
changeset 23 3d340a0166ff
parent 15 08e69e956a8c
child 25 941195f2d488
equal deleted inserted replaced
18:0aa5fbdfbc30 23:3d340a0166ff
    17 
    17 
    18 #include <eikcapc.h>
    18 #include <eikcapc.h>
    19 #include <AknMediatorFacade.h>
    19 #include <AknMediatorFacade.h>
    20 #include <MediatorEventProvider.h>
    20 #include <MediatorEventProvider.h>
    21 #include <MediatorDomainUIDs.h>
    21 #include <MediatorDomainUIDs.h>
    22 #include <SecondaryDisplay/AknSecondaryDisplayDefs.h>
    22 #include <secondarydisplay/AknSecondaryDisplayDefs.h>
    23 
    23 
    24 #include "aknPopupHeadingPane.h"
    24 #include "aknPopupHeadingPane.h"
    25 #include "aknlistquerycontrol.h"
    25 #include "aknlistquerycontrol.h"
    26 #include "aknlistquerysearchcontrol.h"
    26 #include "aknlistquerysearchcontrol.h"
    27 #include "aknlists.h"
    27 #include "aknlists.h"
   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 			listControl->SetLayout(&iLayout);
   266             {
   267 		}
   267             listControl->SetLayout( &iLayout );
       
   268             }            
       
   269         
       
   270         if ( iAvkonAppUi->IsSingleClickCompatible() && 
       
   271              !IsLeftSoftkeyShown() )
       
   272             {
       
   273             MakeLeftSoftkeyVisible( EFalse );
       
   274             }    
       
   275         }
   268 
   276 
   269     if (FindBox())
   277     if (FindBox())
   270         {
   278         {
   271         STATIC_CAST(CAknFilteredTextListBoxModel*,ListBox()->Model())->CreateFilterL(ListBox(),FindBox());
   279         STATIC_CAST(CAknFilteredTextListBoxModel*,ListBox()->Model())->CreateFilterL(ListBox(),FindBox());
   272 
   280 
   459                     if (iIdle)
   467                     if (iIdle)
   460                         {                    
   468                         {                    
   461                         iIdle->Start(TCallBack(ClosePopupAcceptingChanges, this));
   469                         iIdle->Start(TCallBack(ClosePopupAcceptingChanges, this));
   462                         }
   470                         }
   463                     }  
   471                     }  
       
   472                 
       
   473                 if( iAvkonAppUi->IsSingleClickCompatible() && 
       
   474                         aListBox->IsMultiselection() )
       
   475                     {
       
   476                     CEikListBox* listbox = ListBox();
       
   477                     if( listbox )
       
   478                         {
       
   479                         MakeLeftSoftkeyVisible( IsLeftSoftkeyShown() );
       
   480                         }    
       
   481                     }
   464                 }
   482                 }
   465                 break;
   483                 break;
   466             default:
   484             default:
   467                 {
   485                 {
   468                 break;
   486                 break;
   563 		    		}
   581 		    		}
   564 		    	}
   582 		    	}
   565 	        }
   583 	        }
   566 
   584 
   567         TInt currentSelection = listbox->CurrentItemIndex();
   585         TInt currentSelection = listbox->CurrentItemIndex();
   568         if( currentSelection == KErrNotFound )
   586         TBool isSingleClick = iAvkonAppUi->IsSingleClickCompatible(); 
   569             {
   587         if ( currentSelection == KErrNotFound )
   570             MakeLeftSoftkeyVisible(EFalse);
   588             {
   571             }
   589             MakeLeftSoftkeyVisible( EFalse );
   572         else
   590             }
   573             {
   591         else if ( isSingleClick )
   574             MakeLeftSoftkeyVisible(ETrue);
   592             {
       
   593             MakeLeftSoftkeyVisible( IsLeftSoftkeyShown() );
   575             }
   594             }
   576             
   595             
   577         TKeyResponse response = listbox->OfferKeyEventL( aKeyEvent, aType);
   596         TKeyResponse response = listbox->OfferKeyEventL( aKeyEvent, aType);
       
   597         
       
   598         if ( isSingleClick && IsLeftSoftkeyShown() )
       
   599             {
       
   600             MakeLeftSoftkeyVisible( ETrue );
       
   601             }
   578         if (currentSelection != listbox->CurrentItemIndex() && iMediatorObs)
   602         if (currentSelection != listbox->CurrentItemIndex() && iMediatorObs)
   579             {
   603             {
   580             iMediatorObs->UpdateL(listbox->CurrentItemIndex());
   604             iMediatorObs->UpdateL(listbox->CurrentItemIndex());
   581             }
   605             }
   582 
   606 
   767     {
   791     {
   768     CAknListQuerySearchControl *control = (CAknListQuerySearchControl*)ControlOrNull(EFindControl);
   792     CAknListQuerySearchControl *control = (CAknListQuerySearchControl*)ControlOrNull(EFindControl);
   769     if (control) { return control->iFind; }
   793     if (control) { return control->iFind; }
   770     return NULL;
   794     return NULL;
   771     }
   795     }
       
   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 	}
   772 
   808 
   773 EXPORT_C void CAknListQueryDialog::SetTone(TInt aTone)
   809 EXPORT_C void CAknListQueryDialog::SetTone(TInt aTone)
   774 	{
   810 	{
   775 	iTone = (TTone)aTone;
   811 	iTone = (TTone)aTone;
   776 	}
   812 	}