textinput/peninputvkbcn/ctrlinc/AknFepVkbPinyinAnalyserDb.inl
author srilekhas <srilekhas@symbian.org>
Mon, 23 Aug 2010 13:36:00 +0100
branchRCL_3
changeset 41 6d1a7cb00f84
parent 0 eb1f2e154e89
permissions -rw-r--r--
Merge RCL_3 fixes with latest delivery.

/*
* Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0""
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:  vkb control pool inline function 
*
*/


inline TInt CPinyinAnalyserDbFeed::GetSpellCount() const
    {
    return iSpellLenBuf.Length();
    }
    
inline const TPtrC CPinyinAnalyserDbFeed::GetSpellByIndex( TInt aIndex ) const
    {
    int offset = 0;
    for ( TInt i = 0;  i < aIndex;  ++i  )
        {
        offset += iSpellLenBuf[i];
        }
    return iSpellBuf.Mid( offset, iSpellLenBuf[aIndex] );
    }

inline TInt CPinyinAnalyserDbFeed::GetSpellElementCount() const
    {
    return iSpellElemLen;
    }
    
inline TUint16 CPinyinAnalyserDbFeed::GetSpellElementByIndex( TInt aIndex ) const
    {
    return iSpellElemBase + aIndex;
    }

inline TBool CPinyinAnalyserDbFeed::IsNormalElement( TUint16 aCode ) const
    {
    return aCode >= iSpellElemBase && aCode < iSpellElemBase + iSpellElemLen;
    }
    
inline TSpellType CPinyinAnalyserDbFeed::GetSpellElementType( TUint16 aCode ) const
    {
    return ( TSpellType )iSpellTypeBuf[ aCode - iSpellElemBase ];
    }
 
 inline TBool CPinyinAnalyserDbFeed::IsFirstElement( TUint16 aCode ) const
    {
    for ( TInt i = 0; i < iNoFirstElements.Length(); i++ )
        {
        if ( iNoFirstElements[i] == aCode )
            {
            return EFalse;
            }
        }
    return ETrue;
    }