emailuis/emailui/src/ncspopuplistbox.cpp
branchRCL_3
changeset 16 b5fbb9b25d57
parent 14 b13141f05c3d
child 18 6b8f3b30d0ec
equal deleted inserted replaced
14:b13141f05c3d 16:b5fbb9b25d57
    21 #include <eikclbd.h>
    21 #include <eikclbd.h>
    22 #include <AknsFrameBackgroundControlContext.h>
    22 #include <AknsFrameBackgroundControlContext.h>
    23 #include <FreestyleEmailUi.rsg>						// R_FSE_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH
    23 #include <FreestyleEmailUi.rsg>						// R_FSE_EDITOR_ADDRESS_LIST_REMOTE_LOOKUP_SEARCH
    24 #include <StringLoader.h>						// StringLoader
    24 #include <StringLoader.h>						// StringLoader
    25 #include <CPbkContactEngine.h>
    25 #include <CPbkContactEngine.h>
    26 #include <aknnotewrappers.h>					//For LanguageNotSupported errorNote
       
    27 #include <aknsdrawutils.h>
    26 #include <aknsdrawutils.h>
    28 #include <aknsutils.h>
    27 #include <aknsutils.h>
    29 #include <aknlayoutscalable_apps.cdl.h>
    28 #include <aknlayoutscalable_apps.cdl.h>
    30 #include <aknlayoutscalable_avkon.cdl.h>
    29 #include <aknlayoutscalable_avkon.cdl.h>
    31 
    30 
   109     }
   108     }
   110 
   109 
   111 // -----------------------------------------------------------------------------
   110 // -----------------------------------------------------------------------------
   112 // CNcsPopupListBox::InitAndSearchL
   111 // CNcsPopupListBox::InitAndSearchL
   113 // -----------------------------------------------------------------------------
   112 // -----------------------------------------------------------------------------
   114 void CNcsPopupListBox::InitAndSearchL( const TDesC& aText )
   113 void CNcsPopupListBox::InitAndSearchL( const TDesC& aText, TInt aMode )
   115     {
   114     {
   116     FUNC_LOG;
   115     FUNC_LOG;
   117     SetSearchTextL( aText );
   116     SetSearchTextL( aText, aMode );
   118     RPointerArray<CFSEmailUiClsItem> emptyArray;
   117     RPointerArray<CFSEmailUiClsItem> emptyArray;
   119     CleanupClosePushL( emptyArray );
   118     CleanupClosePushL( emptyArray );
   120     OperationCompleteL( ESearchContacts, emptyArray );
   119     OperationCompleteL( ESearchContacts, emptyArray );
   121     CleanupStack::PopAndDestroy( &emptyArray );
   120     CleanupStack::PopAndDestroy( &emptyArray );
   122     }
   121     }
   244 //      
   243 //      
   245 void CNcsPopupListBox::HandleListBoxEventL( CEikListBox* /*aListBox*/,
   244 void CNcsPopupListBox::HandleListBoxEventL( CEikListBox* /*aListBox*/,
   246     TListBoxEvent aEventType )
   245     TListBoxEvent aEventType )
   247     {
   246     {
   248     if ( aEventType == EEventItemClicked || 
   247     if ( aEventType == EEventItemClicked || 
   249     	 aEventType == EEventItemSingleClicked )
   248          aEventType == EEventItemSingleClicked )
   250         {
   249         {
   251         iHeaderContainer.DoPopupSelectL();
   250         iHeaderContainer.DoPopupSelectL();
   252         }
   251         }
   253     }
   252     }
   254 
   253 
   300 
   299 
   301 // -----------------------------------------------------------------------------
   300 // -----------------------------------------------------------------------------
   302 // CNcsPopupListBox::SetSearchTextL
   301 // CNcsPopupListBox::SetSearchTextL
   303 // -----------------------------------------------------------------------------
   302 // -----------------------------------------------------------------------------
   304 //
   303 //
   305 void CNcsPopupListBox::SetSearchTextL( const TDesC& aText )
   304 void CNcsPopupListBox::SetSearchTextL( const TDesC& aText, TInt aMode )
   306     {
   305     {
   307     FUNC_LOG;
   306     FUNC_LOG;
   308     delete iCurrentSearchText;
   307     delete iCurrentSearchText;
   309     iCurrentSearchText = NULL;
   308     iCurrentSearchText = NULL;
   310     iCurrentSearchText = aText.AllocL();
   309     iCurrentSearchText = aText.AllocL();
   311     if ( !iCachingInProgress  )
   310     if ( !iCachingInProgress  )
   312         {
   311         {
   313         if ( iContactHandler  )
   312         if ( iContactHandler  )
   314             {
   313             {
   315             iContactHandler->SearchMatchesL( aText, this, &iMailBox );
   314             iContactHandler->SearchMatchesL( aText, this, &iMailBox, aMode );
   316             }
   315             }
   317         }
   316         }
   318     }
   317     }
   319 
   318 
   320 // -----------------------------------------------------------------------------
   319 // -----------------------------------------------------------------------------
   690     { 
   689     { 
   691     // temporary const_cast to get the scrollbar width
   690     // temporary const_cast to get the scrollbar width
   692     CNcsPopupListBox& tmpListBox = const_cast<CNcsPopupListBox&>( iListBox );
   691     CNcsPopupListBox& tmpListBox = const_cast<CNcsPopupListBox&>( iListBox );
   693     const TInt scrollbarBreadth = tmpListBox.ScrollBarFrame()->
   692     const TInt scrollbarBreadth = tmpListBox.ScrollBarFrame()->
   694         ScrollBarBreadth( CEikScrollBar::EVertical );
   693         ScrollBarBreadth( CEikScrollBar::EVertical );
   695     if ( AknLayoutUtils::LayoutMirrored() )
   694     if ( scrollbarBreadth > 0 )
   696         {
   695         {
   697         itemRect.iTl.iX = iListBox.Rect().iTl.iX + scrollbarBreadth;
   696         if ( AknLayoutUtils::LayoutMirrored() )
   698         }
   697             {
   699     else
   698             itemRect.iTl.iX = iListBox.Rect().iTl.iX + scrollbarBreadth;
   700         {
   699             }
   701         itemRect.iBr.iX = iListBox.Rect().iBr.iX - scrollbarBreadth;
   700         else
       
   701             {
       
   702             itemRect.iBr.iX = iListBox.Rect().iBr.iX - scrollbarBreadth;
       
   703             }
   702         }
   704         }
   703     }
   705     }
   704 
   706 
   705     TRect textRect = itemRect;
   707     TRect textRect = itemRect;
   706     textRect.Shrink( KHighlightFrameWidth, KHighlightFrameWidth );
   708     textRect.Shrink( KHighlightFrameWidth, KHighlightFrameWidth );
   767 		if ( rmluPosition >= 0 && aItemIndex > rmluPosition )
   769 		if ( rmluPosition >= 0 && aItemIndex > rmluPosition )
   768 			{
   770 			{
   769 			aItemIndex--;
   771 			aItemIndex--;
   770 			}
   772 			}
   771 
   773 
   772 		// change color to gray if match doesn't have email address.
   774     // Change text transparency if match doesn't have email address.
   773 		if( clsItemArray[aItemIndex]->EmailAddress().Compare( KNullDesC ) == 0 )
   775     if ( clsItemArray[aItemIndex]->EmailAddress().Compare( KNullDesC ) == 0 )
   774 			{
   776         {
   775 			TRgb dimmedColor = iListBox.LayoutHandler().PcsPopupDimmedFontColor();
   777         const TInt KTransparency = 
   776 			iGc->SetPenColor( dimmedColor );
   778             iListBox.LayoutHandler().PcsPopupDimmedFontTransparency();
   777 			}
   779         textColor.SetAlpha( KTransparency );
       
   780         iGc->SetPenColor( textColor );
       
   781         }
   778 
   782 
   779 		// For now, we support underlining the matching part only if the
   783 		// For now, we support underlining the matching part only if the
   780 		//       text is written completely with left-to-right script
   784 		//       text is written completely with left-to-right script
   781 		
   785 		
   782 		// We know the text contains RTL script if the display string is not just
   786 		// We know the text contains RTL script if the display string is not just