uiutils/Findutil/src/FindUtilWestern.cpp
branchRCL_3
changeset 72 a5e7a4f63858
parent 59 978afdc0236f
equal deleted inserted replaced
64:85902f042028 72:a5e7a4f63858
    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 
       
    35 const TInt KLitTab('\t');
    32 const TInt KLitTab('\t');
    36 const TInt KLitSpace(' ');
    33 const TInt KLitSpace(' ');
    37 const TInt KLitHyphen('-');
    34 const TInt KLitHyphen('-');
    38 const TInt KLitLineFeed(8233);
    35 const TInt KLitLineFeed(8233);
    39 const TInt KLitStar('*');
    36 const TInt KLitStar('*');
   284                                               CCenRepNotifyHandler::EIntKey,
   281                                               CCenRepNotifyHandler::EIntKey,
   285                                               KAknFepInputTxtLang );
   282                                               KAknFepInputTxtLang );
   286 		iNotifyHandler->StartListeningL();
   283 		iNotifyHandler->StartListeningL();
   287 	    }	
   284 	    }	
   288 //TSW: LYEE-7Q2GRV  
   285 //TSW: LYEE-7Q2GRV  
   289     FeatureManager::InitializeLibL();
   286 	if(!iFindUtilKorean)
   290     if( !iFindUtilKorean && FeatureManager::FeatureSupported( KFeatureIdKorean ) )
   287 	    {
   291         {
       
   292         iFindUtilKorean = CFindUtilKorean::NewL();
   288         iFindUtilKorean = CFindUtilKorean::NewL();
   293         }
   289 	    }
   294     FeatureManager::UnInitializeLib();
       
   295 	}
   290 	}
   296 	
   291 	
   297 void CFindUtilWestern::HandleNotifyInt( TUint32 aId, TInt aNewValue )
   292 void CFindUtilWestern::HandleNotifyInt( TUint32 aId, TInt aNewValue )
   298 	{
   293 	{
   299 	if(aId == KAknFepInputTxtLang)
   294 	if(aId == KAknFepInputTxtLang)
   306 // -----------------------------------------------------------------------------
   301 // -----------------------------------------------------------------------------
   307 //
   302 //
   308 
   303 
   309 TBool CFindUtilWestern::Match(const TDesC& aContactsField, const TDesC& aWord)
   304 TBool CFindUtilWestern::Match(const TDesC& aContactsField, const TDesC& aWord)
   310     {
   305     {
   311     if ( iFindUtilKorean && ( iFindUtilKorean->IsKoreanLanguage( aContactsField ) || iFindUtilKorean->IsKoreanLanguage( aWord ) ) )
   306     if ( iFindUtilKorean->IsKoreanLanguage( aContactsField ) || iFindUtilKorean->IsKoreanLanguage( aWord ) )
   312         {
   307         {
   313         return iFindUtilKorean->Match( aContactsField, aWord );	
   308         return iFindUtilKorean->Match( aContactsField, aWord );	
   314         }
   309         }
   315     else
   310     else
   316     	{
   311     	{
   317         TInt numChar = 1;
   312     TInt numChar = 1;
   318     	if (!aContactsField.Length())
   313     	if (!aContactsField.Length())
   319         	{
   314         	{
   320                 _LIT( KNone, "*" );
   315                 _LIT( KNone, "*" );
   321     	        if( aWord.CompareC(KNone()) == 0 )
   316     	        if( aWord.CompareC(KNone()) == 0 )
   322                     {
   317                     {
   345 // (other items were commented in a header).
   340 // (other items were commented in a header).
   346 // -----------------------------------------------------------------------------
   341 // -----------------------------------------------------------------------------
   347 //
   342 //
   348 TBool CFindUtilWestern::MatchRefineL( const TDesC& aItemString, const TDesC& aSearchText )
   343 TBool CFindUtilWestern::MatchRefineL( const TDesC& aItemString, const TDesC& aSearchText )
   349     {
   344     {
   350     if ( iFindUtilKorean && 
   345     if ( iFindUtilKorean->IsKoreanLanguage( aItemString ) || iFindUtilKorean->IsKoreanLanguage( aSearchText ) )
   351         ( iFindUtilKorean->IsKoreanLanguage( aItemString ) || 
       
   352           iFindUtilKorean->IsKoreanLanguage( aSearchText ) ) )
       
   353         {
   346         {
   354         return iFindUtilKorean->MatchRefineL( aItemString, aSearchText );	
   347         return iFindUtilKorean->MatchRefineL( aItemString, aSearchText );	
   355         }
   348         }
   356     else
   349     else
   357         {
   350     {
   358         if ( aItemString.Length() == 0 )
   351     if ( aItemString.Length() == 0 )
   359             {
   352         {
   360             return EFalse;
   353         return EFalse;
   361             }
   354         }
   362     
   355 
   363         if ( aSearchText.Length() == 0 )
   356     if ( aSearchText.Length() == 0 )
   364             {
   357         {
   365             return ETrue;
   358         return ETrue;
   366             }
   359         }
   367         return IsFindMatch( aItemString, aSearchText, iInputLanguage );
   360     return IsFindMatch( aItemString, aSearchText, iInputLanguage );
   368     	}
   361     	}
   369     }
   362     }
   370 
   363 
   371 // -----------------------------------------------------------------------------
   364 // -----------------------------------------------------------------------------
   372 // CFindUtilWestern::IsWordValidForMatching
   365 // CFindUtilWestern::IsWordValidForMatching
  1315 	{
  1308 	{
  1316     if ( aItemString.Length() == 0 )
  1309     if ( aItemString.Length() == 0 )
  1317         {
  1310         {
  1318         return EFalse;
  1311         return EFalse;
  1319         }
  1312         }
  1320 		
       
  1321     if ( iFindUtilKorean && ( iFindUtilKorean->IsKoreanLanguage( aItemString ) || iFindUtilKorean->IsKoreanLanguage( aSearchText ) ) )
       
  1322         {
       
  1323         return iFindUtilKorean->MatchAdaptiveRefineL(aItemString,aSearchText,aNextChars);   
       
  1324         }
       
  1325 		
       
  1326     if ( aSearchText.Length() == 0 )
  1313     if ( aSearchText.Length() == 0 )
  1327         {        
  1314         {        
  1328         UpdateNextCharsFromString( aNextChars, aItemString );
  1315         UpdateNextCharsFromString( aNextChars, aItemString );
  1329         return ETrue;
  1316         return ETrue;
  1330         }
  1317         }