Ejemplo n.º 1
0
// -----------------------------------------------------------------------------
// For Devanagari AS
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//  
inline void UpdateNextCharsL( HBufC*& aNextChars, const TDesC& aItemString )
	{
	TChar searchChar = aItemString[0];
    //Check if this is an Indic special ligature
    if ( IsIndicConsonant(searchChar) && aItemString.Length() > 2
            && IsSpecialIndicLigature(aItemString) 
            && KErrNotFound == (*aNextChars).Find(aItemString.Mid(0,3)) )
        {
        //Check if we have enough space for 3 more characters
        if( aNextChars->Des().Length() >= aNextChars->Des().MaxLength()-3 )
            {
            aNextChars = aNextChars->ReAllocL( aNextChars->Des().MaxLength()+10 );
            }       
        aNextChars->Des().Append( aItemString.Mid(0,3) );        
        }
    else
        {
        //check if this is an Indic combined Char
        if ( IsIndicCombinedChar(searchChar) )
            {
            searchChar = RemoveIndicNukta( searchChar );
            }
        //Now update the nextChars string
        TInt strLength = aNextChars->Length();
        for ( TInt i(0); i < strLength ; ++i )
            {
            if ( IsSpecialIndicLigature( (*aNextChars).Mid( i ) ) )
                {
                //As aItemString is not a special ligature (checked above)
                //we can move directly to the 3rd character from here
                i+=2;
                }
            else if ( searchChar.GetUpperCase() == (*aNextChars)[i] ||
                        searchChar.GetLowerCase() == (*aNextChars)[i] )
                {
                //already exists - do nothing
                return;
                }
            //else continue the loop
            }
        //So this character is not yet in the list of nextChars.
        if ( aNextChars->Des().Length() == aNextChars->Des().MaxLength() )
            {
            aNextChars = aNextChars->ReAllocL( aNextChars->Des().MaxLength()+10 );
            }       
        aNextChars->Des().Append( searchChar );   
        }
   	}
Ejemplo n.º 2
0
/**
 * Update next characters if find pane state was changed.
 *
 * @since 5.0
 * @param aNextChars reference to the next characters for the adaptive search grid
 * @param aCh Criteria from the search field.    
 */
inline void UpdateNextCharsL( HBufC*& aNextChars, TChar aCh )
    {
        TChar ch_temp = aCh;          
    
    TLanguage lang = User::Language();  
    if ( lang == ELangVietnamese )
	   {
	   aCh = ReplaceVietnameseChar ( ch_temp );
	   }
    
    if( ( aNextChars->Locate(aCh.GetLowerCase() ) == KErrNotFound ) &&
        ( aNextChars->Locate(aCh.GetUpperCase() ) == KErrNotFound ) )
        {               
        if( aNextChars->Des().Length() == aNextChars->Des().MaxLength() )
            {
            aNextChars = aNextChars->ReAllocL( aNextChars->Des().MaxLength()+10 );
            TInt length1 = aNextChars->Des().Length();
            TInt maxlength1 = aNextChars->Des().MaxLength();
            }       
        aNextChars->Des().Append( aCh );            
        }
    }
/**
Character information methods

@param charac a Character to be investigated
@return ETrue if the parameter for host part of the e-mail address is valid, else returns EFalse
*/
TBool CTulAddressStringTokenizer::IsValidEmailHostChar(const TChar& aCharac)
    { 
    // Returns ETrue if the parameter is a valid character for a host part of e-mail address
    const TDesC& array = KEmailHostChars;
    return (array.Locate( aCharac.GetLowerCase() ) != KErrNotFound);
    }