fep/aknfep/src/AknFepUiInputStateCandidateMiniQwertyZhuyinPhrase.cpp
changeset 0 eb1f2e154e89
child 3 f5a1e66df979
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:            Implementation of Zhuyin phrase candidate state
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // System includes
       
    30 #include <PtiEngine.h>   
       
    31 
       
    32 // User includes
       
    33 #include "AknFepUiInputStateCandidateMiniQwertyZhuyinPhrase.h"
       
    34 #include "AknFepUiInputStateCandidateQwertyBaseChinesePhrase.h"
       
    35 #include "AknFepUiCtrlContainerChinese.h"
       
    36 #include "AknFepUICtrlCandidatePane.h"
       
    37 #include "AknFepUICtrlPinyinPopup.h"
       
    38 #include "AknFepUICtrlInputPane.h"
       
    39 #include "AknFepUIManagerStateInterface.h"  
       
    40 #include "AknFepManager.h" 
       
    41 #include <AknFep.rsg>   
       
    42 
       
    43 #include "aknfepuictrleditpane.h"           //for zhuyin phrase creation
       
    44 #include "aknfepinputstateminiqwertyzhuyinkeymap.h"
       
    45 #include "aknfepuiinputstateminiqwertyzhuyinphrase.h"
       
    46 // Constant definition
       
    47 const TInt KMinCandidateCount = 1;
       
    48 const TInt KInputPaneLength = 32;
       
    49 //_LIT( KDelimiter, "\x2022");
       
    50 _LIT( KDelimiter, "'");
       
    51 _LIT( KSaiStroke,"\x311D" );
       
    52 
       
    53 struct TToneZhuYinMap
       
    54     {
       
    55     TUint16 iValue;
       
    56     TInt iInputTone;
       
    57     };
       
    58 const TToneZhuYinMap ZhuyinToneMap[] =
       
    59     {
       
    60         {0x0020, 1},
       
    61         {0x02CA, 2},
       
    62         {0x02c7, 3},
       
    63         {0x02CB, 4},
       
    64         {0x02D9, 5}
       
    65     };
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // AknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::
       
    69 // TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase
       
    70 // (other items were commented in a header).
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase(
       
    74     MAknFepUIManagerStateInterface* aOwner,
       
    75     MAknFepUICtrlContainerChinese* aUIContainer ) :
       
    76     TAknFepInputStateCandidateQwertyBaseChinesePhrase( aOwner, aUIContainer)
       
    77     {
       
    78     iState = ECandidate;
       
    79     MAknFepUICtrlContainerChinese* uiContainer = UIContainer();
       
    80 
       
    81     TBool multiplePages = !(uiContainer->CandidatePane()->IsLastPage() && uiContainer->CandidatePane()->IsFirstPage());
       
    82     TInt bufLength = iOwner->PtiEngine()->CandidatePage().Length();
       
    83     TBool showHorizontalScrollArrows = multiplePages || bufLength
       
    84         > KMinCandidateCount;
       
    85 
       
    86     uiContainer->ShowHorizontalScrollArrows( showHorizontalScrollArrows );
       
    87     uiContainer->ShowVerticalScrollArrows( multiplePages );
       
    88     uiContainer->FocusCandidatePane( ETrue );
       
    89     uiContainer->CandidatePane()->ShowCandidateOrdinals( ETrue );
       
    90     uiContainer->CandidatePane()->SelectFirstPhrase();
       
    91     UpdateIndicator();
       
    92 
       
    93     }
       
    94 
       
    95 // ---------------------------------------------------------------------------
       
    96 // AknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::HandleKeyL
       
    97 // (other items were commented in a header).
       
    98 // ---------------------------------------------------------------------------
       
    99 //
       
   100 TBool TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::HandleKeyL(
       
   101     TInt aKey, TKeyPressLength aLength )
       
   102     {
       
   103     if (iOwner->FepMan()->KeyboardLayout() == EPtiKeyboardQwerty4x10 || iOwner->FepMan()->KeyboardLayout() == EPtiKeyboardQwerty3x11)
       
   104         {
       
   105         return HandleKeyForMiniQwertyL(aKey, aLength);
       
   106         }
       
   107     else
       
   108         {
       
   109         return HandleKeyForHalfAndCustomQwertyL(aKey, aLength);
       
   110         }
       
   111     }
       
   112 // ---------------------------------------------------------------------------
       
   113 // TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::ComitPhraseCreatedToEditor()
       
   114 // commit the phrase created to the editor
       
   115 // ---------------------------------------------------------------------------
       
   116 //
       
   117 TBool TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::ComitPhraseCreatedToEditorL()
       
   118     {
       
   119     TPtrC text = UIContainer()->CandidatePane()->CurrentPhraseCandidate();
       
   120     if ( text.Length() )
       
   121         {
       
   122         MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
   123         
       
   124     
       
   125         TBuf<KInputPaneLength> highText;
       
   126         UIContainer()->InputPane()->GetText( highText );
       
   127         TInt groupNum = GetInputPaneKeyStrokeCount( highText );
       
   128         TInt canidateCout = text.Length();
       
   129         if ( groupNum > canidateCout )
       
   130             {
       
   131             FillPhraseAndStrokArrayL( highText, text );
       
   132             }
       
   133         else
       
   134             {
       
   135             fepMan->NewTextL( text );
       
   136             fepMan->CommitInlineEditL();
       
   137             iOwner->PtiEngine()->SetPredictiveChineseChar( text );
       
   138             UIContainer()->EditPaneWindow()->ResetAllArray();
       
   139             UIContainer()->EditPaneWindow()->SetEffictiveLength( 0 );
       
   140             if ( fepMan->IsFlagSet( CAknFepManager::EFlagEditorFull ) )
       
   141                 {
       
   142                 fepMan->ClearFlag( CAknFepManager::EFlagEditorFull );
       
   143                 iOwner->FepMan()->TryCloseUiL();
       
   144                 }
       
   145             else
       
   146                 {
       
   147                 UIContainer()->EditPaneWindow()->SetChangeState(ETrue);
       
   148                 iOwner->ChangeState( EPredictiveCandidate );
       
   149                 }
       
   150             }
       
   151         }
       
   152     return ETrue;
       
   153     }
       
   154 // ---------------------------------------------------------------------------
       
   155 // TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::GetInputPaneKeyStrokeCount()
       
   156 // get the input pane key stroke count 
       
   157 // ---------------------------------------------------------------------------
       
   158 //
       
   159 TInt TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::GetInputPaneKeyStrokeCount(
       
   160     const TDesC& aBuf )
       
   161     {
       
   162     TInt groupNum = 1;
       
   163     for (TInt i = 0; i < aBuf.Length() - 1; i++ )
       
   164         {
       
   165         TInt num = sizeof(ZhuyinToneMap )/( sizeof(ZhuyinToneMap[0] ) );
       
   166         TBool isFindTone = EFalse;
       
   167         TInt isFindDel = 0;
       
   168         for (TInt m =0; m< num; m++ )
       
   169             {
       
   170             if ( aBuf[i] == ZhuyinToneMap[m].iValue )
       
   171                 {
       
   172                 isFindTone = ETrue;
       
   173                 break;
       
   174                 }
       
   175             }
       
   176         if ( !isFindTone )
       
   177             {
       
   178             isFindDel = aBuf.Mid(i,1).Compare( KDelimiter );
       
   179             }
       
   180         if ( 0 == isFindDel || isFindTone )
       
   181             {
       
   182             groupNum++;
       
   183             }
       
   184         }
       
   185     if ( 0 == aBuf.Right( 1 ).Compare( KDelimiter ) )
       
   186         {
       
   187         groupNum++;
       
   188         }
       
   189     return groupNum;
       
   190     }
       
   191 // ---------------------------------------------------------------------------
       
   192 // TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::GetIndexOfToneMark()
       
   193 // get the index of the tonemark 
       
   194 // ---------------------------------------------------------------------------
       
   195 //
       
   196 TInt TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::GetIndexOfToneMark( const TDesC& aText)
       
   197     {
       
   198     TInt num = sizeof(ZhuyinToneMap )/( sizeof(ZhuyinToneMap[0]));
       
   199     TInt len = aText.Length();
       
   200     for( TInt j = 0; j< len ;j++ )
       
   201         {
       
   202         for (TInt i = 0; i<num; i++ )
       
   203             {
       
   204             if ( aText[j] == ZhuyinToneMap[i].iValue )
       
   205                 {
       
   206                 return j;
       
   207                 }
       
   208             }
       
   209         }
       
   210     return -1;
       
   211     }
       
   212 // ---------------------------------------------------------------------------
       
   213 // TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::FillPhraseAndStrokArray()
       
   214 // fill the phrase and keystroke array
       
   215 // ---------------------------------------------------------------------------
       
   216 //
       
   217 void TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::FillPhraseAndStrokArrayL(
       
   218     const TDesC& aText, const TDesC& aPhrase )
       
   219     {
       
   220     CDesCArrayFlat* keyStrokeArray = UIContainer()->EditPaneWindow()->KeystrokeArray();
       
   221     CDesCArrayFlat* phraseKeyStrokeArray = UIContainer()->EditPaneWindow()->PhraseShowKeyStrokeArray() ;
       
   222     CDesCArrayFlat* phraseArray = UIContainer()->EditPaneWindow()->PhraseArray();
       
   223     
       
   224     RArray<TInt>* keyCodeArray = UIContainer()->EditPaneWindow()->KeycodeArray();
       
   225     RArray<TInt>* keyCodePhraseArray = UIContainer()->EditPaneWindow()->PhraseKeycodeArray();
       
   226     phraseArray->AppendL( aPhrase );
       
   227     TBuf<KInputPaneLength> keyStoke;
       
   228     TInt replaceCount = 0;
       
   229     TInt delimiterIndex = aText.Find( KDelimiter );
       
   230     if ( KErrNotFound == delimiterIndex )
       
   231         {
       
   232         delimiterIndex = -1;
       
   233         }
       
   234     TInt indexOfToneMark = GetIndexOfToneMark( aText );
       
   235     if ( -1 == delimiterIndex && indexOfToneMark == -1 )
       
   236         {
       
   237         replaceCount = aText.Length();
       
   238         }
       
   239     else if ( delimiterIndex >= 0 && indexOfToneMark == -1 )
       
   240         {
       
   241         replaceCount = delimiterIndex;
       
   242         }
       
   243     else if ( delimiterIndex >= 0 && indexOfToneMark >= 0 )
       
   244         {
       
   245         replaceCount = Min( delimiterIndex, indexOfToneMark );
       
   246         if ( delimiterIndex > indexOfToneMark )
       
   247             {
       
   248             replaceCount++;
       
   249             }
       
   250         }
       
   251     else
       
   252         {
       
   253         replaceCount = indexOfToneMark + 1;// have tonemark  but has not deli
       
   254         }
       
   255     for (TInt i = 0; i < replaceCount; i++ )
       
   256         {
       
   257         TPtrC ptr = keyStrokeArray->MdcaPoint( 0 );
       
   258         keyStoke.Append( ptr );
       
   259         keyStrokeArray->Delete( 0 );
       
   260         // added for the keycode
       
   261         TInt keyCodeValue = (*keyCodeArray)[0];
       
   262         keyCodePhraseArray->AppendL( keyCodeValue );
       
   263         keyCodeArray->Remove( 0 );
       
   264         }
       
   265     phraseKeyStrokeArray->AppendL( keyStoke );   
       
   266     if ( CheckToneMarkBorderUpon()|| 0 ==keyStrokeArray->MdcaPoint( 0 ).Compare( KSaiStroke ) )
       
   267         {
       
   268         iOwner->ChangeState( EMiniQwertyEdit );
       
   269         }
       
   270     else
       
   271         {
       
   272         //change to the spelling selecting state
       
   273         iOwner->ChangeState( EZhuyinSpelling );
       
   274         }
       
   275     }
       
   276 // ---------------------------------------------------------------------------
       
   277 // TAknFepInputMiniQwertyZhuyinPhraseBase::GetValidKeystroke
       
   278 // Get the valid keystroke.
       
   279 // ---------------------------------------------------------------------------
       
   280 //
       
   281 TBool TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::CheckToneMarkBorderUpon()
       
   282     {
       
   283     MAknFepUICtrlContainerChinese* uiContainer = UIContainer();
       
   284     MAknFepUICtrlEditPane* editPane = uiContainer->EditPaneWindow();
       
   285     CDesCArrayFlat* keystroke = editPane->KeystrokeArray();
       
   286     
       
   287     if ( keystroke->Count() > 1 )
       
   288         {
       
   289         for ( TInt i = 1; i < keystroke->Count(); ++i )
       
   290             {
       
   291             if ( ( 1 == keystroke->MdcaPoint( i - 1 ).Length() ) &&
       
   292                 ( 1 == keystroke->MdcaPoint( i ).Length() ) )
       
   293                 {
       
   294                 return ETrue;
       
   295                 }
       
   296             }
       
   297         }
       
   298     
       
   299     return EFalse;
       
   300     }
       
   301 
       
   302 // ---------------------------------------------------------------------------
       
   303 // AknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::HandleKeyForHalfAndCustomQwertyL
       
   304 // (other items were commented in a header).
       
   305 // ---------------------------------------------------------------------------
       
   306 //
       
   307 TBool TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::HandleKeyForHalfAndCustomQwertyL(TInt aKey,
       
   308                                                                     TKeyPressLength aLength)
       
   309     {
       
   310     TInt selected = UIContainer()->CandidatePane()->SelectedIndex();
       
   311     TInt numbertotal = UIContainer()->CandidatePane()->VisibleCandidateCount();
       
   312     
       
   313     if (iOwner->FepMan()->FnKeyState())
       
   314         {
       
   315         return ETrue;
       
   316         }
       
   317     else if(aKey == EStdKeySpace)
       
   318         {
       
   319         iOwner->FepMan()->PlaySound(EAvkonSIDErrorTone);
       
   320         return ETrue;
       
   321         }
       
   322     else if(aKey == EStdKeyBackspace )
       
   323         {
       
   324         iOwner->ChangeState(EEntry);
       
   325         iOwner->FepMan()->UpdateCbaL(R_AKNFEP_SOFTKEYS_OK_SELECT_CANCEL);
       
   326 
       
   327         return ETrue;
       
   328         }
       
   329     else if(aKey == EStdKeyUpArrow)   
       
   330         {
       
   331         if(UIContainer()->CandidatePane()->IsFirstPage())
       
   332             {
       
   333             iOwner->ChangeState(EEntry);
       
   334             iOwner->FepMan()->UpdateCbaL(R_AKNFEP_SOFTKEYS_OK_SELECT_CANCEL);
       
   335             return ETrue;
       
   336             }
       
   337         else
       
   338             {
       
   339             return TAknFepInputStateCandidateQwertyBaseChinesePhrase::HandleKeyL(aKey, aLength);
       
   340             }   
       
   341         }
       
   342     else if ( aKey == EStdKeyEnter)
       
   343         {
       
   344         TBuf<MAknFepUICtrlInputPane::EMaxInputCharsPinyinPopupNotIncludingToneMark> atext;
       
   345         UIContainer()->PinyinPopupWindow()->GetItemText(
       
   346                                     UIContainer()->PinyinPopupWindow()->CurrentSelection(),
       
   347                                     atext);
       
   348         if(atext.Length())
       
   349             {            
       
   350             MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
   351             fepMan->NewTextL(atext);
       
   352             fepMan->CommitInlineEditL();
       
   353             iOwner->FepMan()->TryCloseUiL();
       
   354             }
       
   355         return ETrue;
       
   356         }
       
   357     else if ( aKey == EStdKeyLeftArrow )
       
   358        {
       
   359        if ( selected == 0 )
       
   360           {
       
   361           UIContainer()->CandidatePane()->SelectIndex( numbertotal - 1 );
       
   362           }
       
   363        else
       
   364           {
       
   365           UIContainer()->CandidatePane()->SelectIndex( selected - 1 );
       
   366           }     
       
   367        UpdateIndicator();
       
   368        return ETrue;    
       
   369        }
       
   370     else if ( aKey == EStdKeyRightArrow )
       
   371        {
       
   372         if ( selected == numbertotal - 1 )
       
   373             {
       
   374             UIContainer()->CandidatePane()->SelectIndex( 0 );
       
   375             }
       
   376         else
       
   377             {
       
   378             UIContainer()->CandidatePane()->SelectIndex( selected + 1 );
       
   379             } 
       
   380         UpdateIndicator();
       
   381         return ETrue;       
       
   382        }
       
   383     else if ( aKey == EStdKeyDevice0 || aKey == EStdKeyDevice3 )
       
   384         {             
       
   385         TPtrC text = UIContainer()->CandidatePane()->CurrentPhraseCandidate();
       
   386         if(text.Length())
       
   387             {            
       
   388             MAknFepManagerUIInterface* fepMan = iOwner->FepMan();
       
   389             fepMan->NewTextL(text);
       
   390             fepMan->CommitInlineEditL();
       
   391             iOwner->PtiEngine()->SetPredictiveChineseChar(text);
       
   392             if (fepMan->IsFlagSet(CAknFepManager::EFlagEditorFull))
       
   393                 {
       
   394                 fepMan->ClearFlag(CAknFepManager::EFlagEditorFull);
       
   395                 iOwner->FepMan()->TryCloseUiL();
       
   396                 }
       
   397             else
       
   398                 {
       
   399                 UIContainer()->EditPaneWindow()->SetChangeState(ETrue);
       
   400                 iOwner->ChangeState(EPredictiveCandidate);
       
   401                 }
       
   402             }
       
   403         return ETrue;
       
   404         }   
       
   405     else
       
   406         {
       
   407         return TAknFepInputStateCandidateQwertyBaseChinesePhrase::HandleKeyL(aKey, aLength);
       
   408         } 
       
   409     }
       
   410 // ---------------------------------------------------------------------------
       
   411 // AknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::HandleKeyForMiniQwertyL
       
   412 // (other items were commented in a header).
       
   413 // ---------------------------------------------------------------------------
       
   414 //
       
   415 TBool TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::HandleKeyForMiniQwertyL(
       
   416     TInt aKey, TKeyPressLength aLength )
       
   417     {
       
   418     MAknFepUICtrlCandidatePane* candidatePane = UIContainer()->CandidatePane();
       
   419     MAknFepUICtrlEditPane* editPane = UIContainer()->EditPaneWindow();
       
   420     TInt selected = UIContainer()->CandidatePane()->SelectedIndex();
       
   421     TInt numbertotal = UIContainer()->CandidatePane()->VisibleCandidateCount();
       
   422     //  TInt isSelect = UIContainer()->CandidatePane()->SelectIndex( index, EFalse );
       
   423     if ( CAknFepFnKeyManager::EFnKeyNext == iOwner->FepMan()->FnKeyState() || 
       
   424          CAknFepFnKeyManager::EFnKeyLock == iOwner->FepMan()->FnKeyState() )
       
   425         {
       
   426         return ETrue;
       
   427         }
       
   428     else if ( aKey == EStdKeyDevice1 )
       
   429         {
       
   430         iOwner->FepMan()->TryCloseUiL();
       
   431         return ETrue;
       
   432         }
       
   433     else if ( aKey == EStdKeySpace )
       
   434         {
       
   435         iOwner->FepMan()->PlaySound( EAvkonSIDErrorTone );
       
   436         return ETrue;
       
   437         }
       
   438     else if ( aKey == EStdKeyBackspace )
       
   439         {
       
   440         UIContainer()->EditPaneWindow()->SetChangeState( ETrue );
       
   441         iOwner->ChangeState( EEntry );
       
   442         return ETrue;
       
   443         }
       
   444     else if ( aKey == EStdKeyUpArrow )
       
   445         {
       
   446         if ( UIContainer()->CandidatePane()->IsFirstPage() )
       
   447             {
       
   448             iOwner->ChangeState( EEntry );
       
   449             return ETrue;
       
   450             }
       
   451         else
       
   452             {
       
   453             return TAknFepInputStateCandidateQwertyBaseChinesePhrase::HandleKeyL(
       
   454                 aKey, aLength );
       
   455             }
       
   456         }
       
   457     else if ( aKey == EStdKeyDownArrow || aKey == EStdKeySpace )
       
   458         {
       
   459         TBool state = ETrue;
       
   460         if ( editPane->IsChangeState() && aLength == ELongKeyPress )
       
   461             {
       
   462             state = EFalse;
       
   463             }
       
   464         else
       
   465             {
       
   466             editPane->SetChangeState( EFalse );
       
   467             }
       
   468         if ( state )
       
   469             {
       
   470             return TAknFepInputStateCandidateQwertyBaseChinesePhrase::HandleKeyL(
       
   471                             aKey, aLength );
       
   472             }
       
   473         }
       
   474     else if ( aKey == EStdKeyEnter )
       
   475         {
       
   476         return ETrue;
       
   477         }
       
   478     else if ( aKey == EStdKeyLeftArrow )
       
   479         {
       
   480         if ( selected == 0 )
       
   481             {
       
   482             UIContainer()->CandidatePane()->SelectIndex( numbertotal-1 );
       
   483             }
       
   484         else
       
   485             {
       
   486             UIContainer()->CandidatePane()->SelectIndex( selected - 1 );
       
   487             }
       
   488         return ETrue;
       
   489         }
       
   490     else if ( aKey == EStdKeyRightArrow )
       
   491         {
       
   492         if ( selected == numbertotal-1 )
       
   493             {
       
   494             UIContainer()->CandidatePane()->SelectIndex( 0 );
       
   495             }
       
   496         else
       
   497             {
       
   498             UIContainer()->CandidatePane()->SelectIndex( selected + 1 );
       
   499             }
       
   500         return ETrue;
       
   501         }
       
   502     else
       
   503         {
       
   504         TInt index = 0;
       
   505         TBool isIndex = MapKeyToIndexSelectCandidate( aKey, index );
       
   506         if ( aLength == EShortKeyPress && 
       
   507             ( ( isIndex && UIContainer()->CandidatePane()->SelectIndex( index ) ) ||
       
   508                 aKey == EStdKeyDevice0 || 
       
   509                 aKey == EStdKeyDevice3 ) )
       
   510             {
       
   511             editPane->SetNeedClearDeliberateSelection( ETrue );
       
   512             ComitPhraseCreatedToEditorL();
       
   513             return ETrue;
       
   514             }
       
   515         else
       
   516             {
       
   517             return TAknFepInputStateCandidateQwertyBaseChinesePhrase::HandleKeyL(
       
   518                 aKey, aLength );
       
   519             }
       
   520         }
       
   521         return EFalse;
       
   522     }
       
   523 // ---------------------------------------------------------------------------
       
   524 // TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::HandleCommandL
       
   525 // Handling Command
       
   526 // ---------------------------------------------------------------------------
       
   527 //
       
   528 void TAknFepUiInputStateCandidateMiniQwertyZhuyinPhrase::HandleCommandL(
       
   529     TInt aCommandId )
       
   530     {
       
   531     TPtrC text = UIContainer()->CandidatePane()->CurrentPhraseCandidate( );
       
   532     switch ( aCommandId )
       
   533         {
       
   534         // Handle the event frome command.
       
   535         case EAknSoftkeySelect:
       
   536     //    case (TUint16)EAknSoftkeySelect: //the Selected in soft CBA            
       
   537             if ( text.Length( ) )
       
   538                 {
       
   539                 MAknFepManagerUIInterface* fepMan = iOwner->FepMan( );
       
   540                 fepMan->NewTextL( text );
       
   541                 fepMan->CommitInlineEditL( );
       
   542                 iOwner->PtiEngine()->SetPredictiveChineseChar( text );
       
   543                 if ( fepMan->IsFlagSet( CAknFepManager::EFlagEditorFull ) )
       
   544                     {
       
   545                     fepMan->ClearFlag( CAknFepManager::EFlagEditorFull );
       
   546                     iOwner->FepMan()->TryCloseUiL( );
       
   547                     }
       
   548                 else
       
   549                     {
       
   550                     iOwner->ChangeState( EPredictiveCandidate );
       
   551                     }
       
   552                 }
       
   553             break;
       
   554         default:
       
   555             TAknFepInputStateChineseBase::HandleCommandL( aCommandId );
       
   556             break;
       
   557         }
       
   558     }
       
   559 
       
   560 // End of file