fep/aknfep/src/aknfepinputstatecandidatepinyinphrasecreation.cpp
branchRCL_3
changeset 3 f5a1e66df979
parent 0 eb1f2e154e89
child 12 5e18d8c489d6
equal deleted inserted replaced
0:eb1f2e154e89 3:f5a1e66df979
   207 // ---------------------------------------------------------
   207 // ---------------------------------------------------------
   208 // Commit inline to the EEP ctrl.
   208 // Commit inline to the EEP ctrl.
   209 // ---------------------------------------------------------
   209 // ---------------------------------------------------------
   210 //
   210 //
   211 TBool TAknFepInputStateCandidatePinyinPhraseCreation::CommitInlineEEPL( const TDesC& aText )
   211 TBool TAknFepInputStateCandidatePinyinPhraseCreation::CommitInlineEEPL( const TDesC& aText )
   212     {
   212     {//select from phrase candidates
   213     MAknFepUICtrlPinyinPopup* popup = UIContainer()->PinyinPopupWindow();
   213     MAknFepUICtrlPinyinPopup* popup = UIContainer()->PinyinPopupWindow();
   214     CDesCArrayFlat* keystrokeArray = popup->ShowKeystrokeArray();
   214     CDesCArrayFlat* keystrokeArray = popup->ShowKeystrokeArray();
   215     CDesCArrayFlat* validKeystroke = popup->InEffectKeystrokeArray();
   215     CDesCArrayFlat* validKeystroke = popup->InEffectKeystrokeArray();
   216     CDesCArrayFlat* chooseChineseCharacterArray = 
   216     CDesCArrayFlat* chooseChineseCharacterArray = 
   217         popup->ChooseChineseCharacterArray();
   217         popup->ChooseChineseCharacterArray();
   221     
   221     
   222     TBuf<KMaxSpellingLength> keystroke;
   222     TBuf<KMaxSpellingLength> keystroke;
   223     
   223     
   224     popup->SetPhraseCreationState( ETrue );
   224     popup->SetPhraseCreationState( ETrue );
   225     
   225     
       
   226     //stroe spelling 
       
   227     CDesCArrayFlat* spellingArray = popup->PhoneticSpellingArray();//spelling array
       
   228 	TInt selection = popup->CurrentSelection();//selection index of spelling array
       
   229     CDesCArrayFlat* chooseChineseCharacterArraySpelling = popup->ChooseChineseCharacterArraySpelling();//phrase spelling array
       
   230 	TInt delCount = chooseChineseCharacterArraySpelling->Count() - chooseChineseCharacterArray->Count();
       
   231     if(delCount > 0)//we can sure delCount>=0,impossible <0
       
   232     	{//remove unwanted spelling
       
   233 		chooseChineseCharacterArraySpelling->Delete(chooseChineseCharacterArray->Count(),delCount);
       
   234     	}
       
   235 	chooseChineseCharacterArraySpelling->AppendL(spellingArray->MdcaPoint(selection));
       
   236     
   226     for ( TInt i = 0; i < keyCount; i++ )
   237     for ( TInt i = 0; i < keyCount; i++ )
   227         {
   238         {
   228         keystroke.Append( keystrokeArray->MdcaPoint( 0 ) );
   239         keystroke.Append( keystrokeArray->MdcaPoint( 0 ) );
   229         keystrokeArray->Delete( 0 );
   240         keystrokeArray->Delete( 0 );
   230         }
   241         }
   231     
       
   232     chooseChineseCharacterArray->AppendL( aText );
   242     chooseChineseCharacterArray->AppendL( aText );
   233     chooseChineseCharacterArrayKeystroke->AppendL( keystroke );
   243     chooseChineseCharacterArrayKeystroke->AppendL( keystroke );
   234     validKeystroke->Reset();
   244     validKeystroke->Reset();
   235     
   245     
   236     if ( chooseChineseCharacterArray->Count() >= KMaxPhraseCreationCount )
   246     if ( chooseChineseCharacterArray->Count() >= KMaxPhraseCreationCount )