diff -r e6a39382bb9c -r c8fb4cf7b3ae fep/aknfep/src/AknFepVietnameseToneManager.cpp --- a/fep/aknfep/src/AknFepVietnameseToneManager.cpp Tue Apr 27 16:59:43 2010 +0300 +++ b/fep/aknfep/src/AknFepVietnameseToneManager.cpp Tue May 11 16:31:42 2010 +0300 @@ -85,3 +85,61 @@ // First vowel row lists those tone marks themselves return VietToneMatrix[iVowelIndex+1][iToneIndex]; } + +void CAknFepVietnameseToneManager::StartKeyLooping(TInt aKey) + { + iLoopingKey = aKey; + iIsKeyLooping = ETrue; + iIsLoopingCombined = EFalse; + } + +void CAknFepVietnameseToneManager::StopKeyLooping() + { + iLoopingKey = 0; + iIsKeyLooping = EFalse; + iIsLoopingCombined = EFalse; + } + +TInt CAknFepVietnameseToneManager::ToneMarkIndex() const + { + const TText prevChr = iFepMan->PreviousChar(); + + // All tone mark is after number in product key mapping. + // Notice: The order in product key mapping should be the same with in tone mark array. + for (TUint i = 0; i < KNumberOfToneMarks; ++i) + { + TBuf<1> num; + num.Num( i + 2 ); + if (prevChr == num [0]) + { + return i; + } + } + + return KErrNotFound; + } + +TBool CAknFepVietnameseToneManager::GetLoopingToneMarkVowel( TText& aText ) const + { + const TText prev2prevChr = iFepMan->PreviousToPreviousChar( ETrue ); + + // Judge if the previous to previous Character is a vowel or not + TInt vowelIndex = KErrNotFound; + for (TUint i = 0; i < sizeof(VietVowelList) / sizeof(TText); ++i) + { + if ( prev2prevChr == VietVowelList[i] ) + { + vowelIndex = i; + break; + } + } + + if (vowelIndex >= 0) + { + aText = VietToneMatrix[vowelIndex+1][ ToneMarkIndex() ]; + return ETrue; + } + + return EFalse; + } +