fep/aknfep/src/AknFepUiInputStateInitialVietnameseMultitap.cpp
branchRCL_3
changeset 11 c8fb4cf7b3ae
parent 0 eb1f2e154e89
child 12 5e18d8c489d6
equal deleted inserted replaced
9:e6a39382bb9c 11:c8fb4cf7b3ae
   175                 
   175                 
   176             bHandled = EFalse;
   176             bHandled = EFalse;
   177             }
   177             }
   178         }
   178         }
   179     
   179     
       
   180     if( toneMgr->IsKeyLooping( aKey ) )
       
   181         {
       
   182         if( toneMgr->ToneMarkIndex() !=  KErrNotFound )
       
   183             {
       
   184             // Get current tone mark
       
   185             TText toneVowel;
       
   186             if( toneMgr->GetLoopingToneMarkVowel( toneVowel ) )
       
   187                 {
       
   188                 // remove two previous chars
       
   189                 ((CAknFepManager*)fepMan)->RemovePreviousCharacterL();
       
   190                 ((CAknFepManager*)fepMan)->RemovePreviousCharacterL();
       
   191     
       
   192                 TBuf<CAknFepManager::ESingleCharacter> aChr;
       
   193                 aChr.Append(toneVowel);
       
   194                 
       
   195                 // Update inline character(s)
       
   196                 fepMan->CancelInlineEdit();
       
   197                 fepMan->NewCharacterL(aChr);
       
   198                 
       
   199                 toneMgr->SetLoopingCombined( ETrue );
       
   200                 bHandled = ETrue;
       
   201                 }
       
   202             
       
   203             // Reset the engine timer so that we can get timer expired message
       
   204             // We send the * key, and clear it in the next loop
       
   205             ptiEng->ClearCurrentWord();
       
   206             ptiEng->AppendKeyPress((TPtiKey)EPtiKeyStar);
       
   207             }
       
   208         else
       
   209             {
       
   210             if( toneMgr->IsLoopingCombined() )
       
   211                 {
       
   212                 // remove tone mark
       
   213                 TBuf<2> newText;
       
   214                 // Get the last character from the current editor
       
   215                 TText prevChar = fepMan->PreviousChar();
       
   216                 
       
   217                 // Judge if the last character needs to be converted
       
   218                 if ( NeedsVietnameseBkDelSupport(prevChar, newText) )
       
   219                     {
       
   220                     // Delete the prev character and send the new character to editor
       
   221                     ((CAknFepManager*)fepMan)->RemovePreviousCharacterL();
       
   222                     fepMan->NewCharacterL(newText);
       
   223                     fepMan->CommitInlineEditL();
       
   224                     }
       
   225             
       
   226                 toneMgr->SetLoopingCombined( EFalse );
       
   227                 }
       
   228             }
       
   229         }
       
   230     else
       
   231         {
       
   232         toneMgr->StartKeyLooping( aKey );
       
   233         }
       
   234     
   180     if(!bHandled && toneMgr->IsLooping())
   235     if(!bHandled && toneMgr->IsLooping())
   181     	{
   236     	{
   182     	toneMgr->StopToneMarkLooping();
   237     	toneMgr->StopToneMarkLooping();
   183     	}
   238     	}
   184     
   239     
   194 
   249 
   195     // Try commit inline editting and clean up for future input attemps
   250     // Try commit inline editting and clean up for future input attemps
   196     TRAP_IGNORE(fepMan->CommitInlineEditL());
   251     TRAP_IGNORE(fepMan->CommitInlineEditL());
   197 
   252 
   198     toneMgr->StopToneMarkLooping();
   253     toneMgr->StopToneMarkLooping();
       
   254     toneMgr->StopKeyLooping();
   199     ptiEng->ClearCurrentWord();
   255     ptiEng->ClearCurrentWord();
   200     }
   256     }
   201     
   257     
   202 TBool TAknFepInputStateInitialVietnameseMultitap::NeedsVietnameseBkDelSupport(
   258 TBool TAknFepInputStateInitialVietnameseMultitap::NeedsVietnameseBkDelSupport(
   203                                          TText aGlyphToDelete, TDes& aNewText)
   259                                          TText aGlyphToDelete, TDes& aNewText)