fep/aknfep/src/aknfepinputstateminiqwertyzhuyinkeymap.cpp
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     1 /*
       
     2 * Copyright (c) 2008 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:            This file contains classes of phrase creation layout data management
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #include "aknfepinputstateminiqwertyzhuyinkeymap.h"
       
    31 #include <PtiDefs.h>
       
    32 
       
    33 const TInt16  KZhuyinSymbolUnicode = 0x2462;
       
    34 
       
    35 _LIT(KToneMark1, "\x02D9");
       
    36 _LIT(KToneMark2, "\x02CA");
       
    37 _LIT(KToneMark3, "\x02C7");
       
    38 _LIT(KToneMark4, "\x02CB");
       
    39 _LIT(KToneMark5, "\x0020");
       
    40 _LIT(KRightBracket, "(");
       
    41 _LIT(KLeftBracket, ")");
       
    42 
       
    43 // ---------------------------------------------------------------------------
       
    44 // TAknFepInputStateMiniQwertyZhuyinKeyMap::GetKeyStroke
       
    45 // Get the key stroke.
       
    46 // ---------------------------------------------------------------------------
       
    47 //
       
    48 void TAknFepInputStateMiniQwertyZhuyinKeyMap::GetKeyStroke(
       
    49     CPtiEngine* aPtiEngine, TInt& aKey, TDes& aKeystroke )
       
    50     {
       
    51     TBuf<KMaxName> lowerdata;
       
    52     aPtiEngine->MappingDataForKey( (TPtiKey)aKey, lowerdata, EPtiCaseLower );
       
    53 
       
    54     TBuf<2> zhuyinStoke;
       
    55     if ( lowerdata.Length( ) > 0 )
       
    56         {
       
    57         for (TInt i=0; i<lowerdata.Length()-1; i++ )
       
    58             {
       
    59             if ( lowerdata[i]==KZhuyinSymbolUnicode )
       
    60                 {
       
    61                 zhuyinStoke.Append( lowerdata.Mid( i+1, 1 ) );
       
    62                 }
       
    63             }
       
    64         }
       
    65 
       
    66     if ( zhuyinStoke.Compare( KToneMark1 ) == 0
       
    67         || zhuyinStoke.Compare( KToneMark2 ) == 0
       
    68         || zhuyinStoke.Compare( KToneMark3 ) == 0
       
    69         || zhuyinStoke.Compare( KToneMark4 ) == 0
       
    70         || zhuyinStoke.Compare( KToneMark5 ) == 0 )
       
    71         {
       
    72         aKeystroke.Copy( zhuyinStoke );
       
    73         }
       
    74     else
       
    75         {
       
    76         aKeystroke.Append( KRightBracket );
       
    77         aKeystroke.Append( zhuyinStoke );
       
    78         aKeystroke.Append( KLeftBracket );
       
    79         }
       
    80     }
       
    81 
       
    82 // End of File