uiutils/Findutil/src/FindUtilWestern.cpp
branchRCL_3
changeset 51 fcdfafb36fe7
parent 4 8ca85d2f0db7
child 55 aecbbf00d063
equal deleted inserted replaced
50:a1caeb42b3a3 51:fcdfafb36fe7
    27 #include <collate.h>
    27 #include <collate.h>
    28 #include <PtiIndicDefs.h>
    28 #include <PtiIndicDefs.h>
    29 #include "FindUtilKorean.h"
    29 #include "FindUtilKorean.h"
    30 #include <avkon.rsg>
    30 #include <avkon.rsg>
    31 #include <StringLoader.h>
    31 #include <StringLoader.h>
       
    32 #include <featmgr.h>
       
    33 #include <bldvariant.hrh>
       
    34 
    32 const TInt KLitTab('\t');
    35 const TInt KLitTab('\t');
    33 const TInt KLitSpace(' ');
    36 const TInt KLitSpace(' ');
    34 const TInt KLitHyphen('-');
    37 const TInt KLitHyphen('-');
    35 const TInt KLitLineFeed(8233);
    38 const TInt KLitLineFeed(8233);
    36 const TInt KLitStar('*');
    39 const TInt KLitStar('*');
   307         {
   310         {
   308         return iFindUtilKorean->Match( aContactsField, aWord );	
   311         return iFindUtilKorean->Match( aContactsField, aWord );	
   309         }
   312         }
   310     else
   313     else
   311     	{
   314     	{
   312     TInt numChar = 1;
   315         TInt numChar = 1;
   313     	if (!aContactsField.Length())
   316     	if (!aContactsField.Length())
   314         	{
   317         	{
   315                 _LIT( KNone, "*" );
   318                 _LIT( KNone, "*" );
   316     	        if( aWord.CompareC(KNone()) == 0 )
   319     	        if( aWord.CompareC(KNone()) == 0 )
   317                     {
   320                     {
   340 // (other items were commented in a header).
   343 // (other items were commented in a header).
   341 // -----------------------------------------------------------------------------
   344 // -----------------------------------------------------------------------------
   342 //
   345 //
   343 TBool CFindUtilWestern::MatchRefineL( const TDesC& aItemString, const TDesC& aSearchText )
   346 TBool CFindUtilWestern::MatchRefineL( const TDesC& aItemString, const TDesC& aSearchText )
   344     {
   347     {
   345     if ( iFindUtilKorean->IsKoreanLanguage( aItemString ) || iFindUtilKorean->IsKoreanLanguage( aSearchText ) )
   348     if ( FeatureManager::FeatureSupported( KFeatureIdKorean ) || 
       
   349          iFindUtilKorean->IsKoreanLanguage( aItemString ) || 
       
   350          iFindUtilKorean->IsKoreanLanguage( aSearchText ) )
   346         {
   351         {
   347         return iFindUtilKorean->MatchRefineL( aItemString, aSearchText );	
   352         return iFindUtilKorean->MatchRefineL( aItemString, aSearchText );	
   348         }
   353         }
   349     else
   354     else
   350     {
   355         {
   351     if ( aItemString.Length() == 0 )
   356         if ( aItemString.Length() == 0 )
   352         {
   357             {
   353         return EFalse;
   358             return EFalse;
   354         }
   359             }
   355 
   360     
   356     if ( aSearchText.Length() == 0 )
   361         if ( aSearchText.Length() == 0 )
   357         {
   362             {
   358         return ETrue;
   363             return ETrue;
   359         }
   364             }
   360     return IsFindMatch( aItemString, aSearchText, iInputLanguage );
   365         return IsFindMatch( aItemString, aSearchText, iInputLanguage );
   361     	}
   366     	}
   362     }
   367     }
   363 
   368 
   364 // -----------------------------------------------------------------------------
   369 // -----------------------------------------------------------------------------
   365 // CFindUtilWestern::IsWordValidForMatching
   370 // CFindUtilWestern::IsWordValidForMatching
  1308 	{
  1313 	{
  1309     if ( aItemString.Length() == 0 )
  1314     if ( aItemString.Length() == 0 )
  1310         {
  1315         {
  1311         return EFalse;
  1316         return EFalse;
  1312         }
  1317         }
       
  1318 		
       
  1319     if ( iFindUtilKorean )
       
  1320         {
       
  1321         return iFindUtilKorean->MatchAdaptiveRefineL(aItemString,aSearchText,aNextChars);   
       
  1322         }
       
  1323 		
  1313     if ( aSearchText.Length() == 0 )
  1324     if ( aSearchText.Length() == 0 )
  1314         {        
  1325         {        
  1315         UpdateNextCharsFromString( aNextChars, aItemString );
  1326         UpdateNextCharsFromString( aNextChars, aItemString );
  1316         return ETrue;
  1327         return ETrue;
  1317         }
  1328         }