textinput/peninputvkbcn/ctrlinc/AknFepVkbPinyinAnalyserDb.inl
changeset 0 eb1f2e154e89
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  vkb control pool inline function 
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 inline TInt CPinyinAnalyserDbFeed::GetSpellCount() const
       
    20     {
       
    21     return iSpellLenBuf.Length();
       
    22     }
       
    23     
       
    24 inline const TPtrC CPinyinAnalyserDbFeed::GetSpellByIndex( TInt aIndex ) const
       
    25     {
       
    26     int offset = 0;
       
    27     for ( TInt i = 0;  i < aIndex;  ++i  )
       
    28         {
       
    29         offset += iSpellLenBuf[i];
       
    30         }
       
    31     return iSpellBuf.Mid( offset, iSpellLenBuf[aIndex] );
       
    32     }
       
    33 
       
    34 inline TInt CPinyinAnalyserDbFeed::GetSpellElementCount() const
       
    35     {
       
    36     return iSpellElemLen;
       
    37     }
       
    38     
       
    39 inline TUint16 CPinyinAnalyserDbFeed::GetSpellElementByIndex( TInt aIndex ) const
       
    40     {
       
    41     return iSpellElemBase + aIndex;
       
    42     }
       
    43 
       
    44 inline TBool CPinyinAnalyserDbFeed::IsNormalElement( TUint16 aCode ) const
       
    45     {
       
    46     return aCode >= iSpellElemBase && aCode < iSpellElemBase + iSpellElemLen;
       
    47     }
       
    48     
       
    49 inline TSpellType CPinyinAnalyserDbFeed::GetSpellElementType( TUint16 aCode ) const
       
    50     {
       
    51     return ( TSpellType )iSpellTypeBuf[ aCode - iSpellElemBase ];
       
    52     }
       
    53  
       
    54  inline TBool CPinyinAnalyserDbFeed::IsFirstElement( TUint16 aCode ) const
       
    55     {
       
    56     for ( TInt i = 0; i < iNoFirstElements.Length(); i++ )
       
    57         {
       
    58         if ( iNoFirstElements[i] == aCode )
       
    59             {
       
    60             return EFalse;
       
    61             }
       
    62         }
       
    63     return ETrue;
       
    64     }
       
    65