fep/aknfep/src/AknFepUiInputStateCandidateBaseChinesePhrase.cpp
branchRCL_3
changeset 3 f5a1e66df979
parent 0 eb1f2e154e89
equal deleted inserted replaced
0:eb1f2e154e89 3:f5a1e66df979
   844                         UIContainer()->PinyinPopupWindow()->ChooseChineseCharacterArrayKeystroke();
   844                         UIContainer()->PinyinPopupWindow()->ChooseChineseCharacterArrayKeystroke();
   845                 chineseCharacterArrayKeystroke->Reset();
   845                 chineseCharacterArrayKeystroke->Reset();
   846                 for (i = 0; i < ptr1.Length() && count < text.Length()
   846                 for (i = 0; i < ptr1.Length() && count < text.Length()
   847                     && ptr2.Length() != 0; i++ )
   847                     && ptr2.Length() != 0; i++ )
   848                     {
   848                     {
   849                     if ( ptr1.Mid( i, 1 ) == KPinyinSysSeparator || ptr1.Mid(
   849                     if ( ptr1.Mid( i, 1 ) == KPinyinSysSeparator || 
   850                         i, 1 ) == KPinyinListSeparator )
   850                          ptr1.Mid( i, 1 ) == KPinyinListSeparator )
   851                         {
   851                         {
   852                         pos = i - len - count;
   852                         pos = i - len - count;
   853                         if ( pos < 0 )
   853                         if ( pos < 0 )
   854                             {
   854                             {
   855                             pos = 0;
   855                             pos = 0;
   957                     || (*ptr1.Right( 1 ).Ptr() == KPinyinTone4Valid)) )
   957                     || (*ptr1.Right( 1 ).Ptr() == KPinyinTone4Valid)) )
   958                     {
   958                     {
   959                     totalCount++;
   959                     totalCount++;
   960                     }
   960                     }
   961 
   961 
   962                 if ( totalCount > text.Length() )
   962                 if ( totalCount > text.Length() )//pinyin group more than phrase,will create phrase
   963                     {
   963                     {
   964                     CDesCArray
   964                     CDesCArray* chineseCharacterArray =//phrase
   965                         * chineseCharacterArray =
       
   966                             UIContainer()->PinyinPopupWindow()->ChooseChineseCharacterArray();
   965                             UIContainer()->PinyinPopupWindow()->ChooseChineseCharacterArray();
   967                     chineseCharacterArray->Reset();
   966                     chineseCharacterArray->Reset();
   968                     for (i = 0; i < text.Length(); i++ )
   967                     
   969                         {
   968                     CDesCArray* chineseCharacterArraySpelling =//phrase spelling
       
   969                             UIContainer()->PinyinPopupWindow()->ChooseChineseCharacterArraySpelling();
       
   970                     chineseCharacterArraySpelling->Reset();
       
   971                     
       
   972                     TBuf<KMaxKeystrokeCount> buf = ptr1;
       
   973                     for (i = 0; i < text.Length(); i++ )//usually,if totalCount > text.Length()then text length is 1
       
   974                         {
       
   975 						
       
   976 						//here,store spelling,ptr1 is full spelling
       
   977 						TInt separatorIdx = KErrNotFound;
       
   978 						if(KErrNotFound == separatorIdx)
       
   979 							separatorIdx = buf.Find(KPinyinSysSeparator);
       
   980 						if(KErrNotFound == separatorIdx)
       
   981 							separatorIdx = buf.Find(KPinyinListSeparator);
       
   982 						if(KErrNotFound == separatorIdx)
       
   983 							separatorIdx = buf.Find(KPinyinTone0ValidStr);
       
   984 						if(KErrNotFound == separatorIdx)
       
   985 							separatorIdx = buf.Find(KPinyinTone1ValidStr);
       
   986 						if(KErrNotFound == separatorIdx)
       
   987 							separatorIdx = buf.Find(KPinyinTone2ValidStr);
       
   988 						if(KErrNotFound == separatorIdx)
       
   989 							separatorIdx = buf.Find(KPinyinTone3ValidStr);
       
   990 						if(KErrNotFound == separatorIdx)
       
   991 							separatorIdx = buf.Find(KPinyinTone4ValidStr);
       
   992 					
       
   993 						if(separatorIdx == KErrNotFound )
       
   994 							{
       
   995 							if(buf.Length()>0)//only one 
       
   996 								{
       
   997 								chineseCharacterArraySpelling->AppendL(buf);
       
   998 								buf.Zero();
       
   999 								}
       
  1000 							}
       
  1001 						else
       
  1002 							{
       
  1003 							chineseCharacterArraySpelling->AppendL(buf.Left(separatorIdx+1));//include separator and tone mark
       
  1004 							buf.Delete(0,separatorIdx+1);
       
  1005 							}
       
  1006 						
   970                         chineseCharacterArray->AppendL( text.Mid( i, 1 ) );
  1007                         chineseCharacterArray->AppendL( text.Mid( i, 1 ) );
   971                         }
  1008                         }
       
  1009                     
       
  1010                     
   972                     //set key stroke
  1011                     //set key stroke
   973                     CDesCArray* keyStroke =
  1012                     CDesCArray* keyStroke =
   974                         UIContainer()->PinyinPopupWindow()->KeystrokeArray();
  1013                         UIContainer()->PinyinPopupWindow()->KeystrokeArray();
   975                     keyStroke->Reset();
  1014                     keyStroke->Reset();
   976                     for (i = 0; i < ptr2.Length(); i++ )
  1015                     for (i = 0; i < ptr2.Length(); i++ )
   977                         {
  1016                         {
   978                         keyStroke->AppendL( ptr2.Mid( i, 1 ) );
  1017                         keyStroke->AppendL( ptr2.Mid( i, 1 ) );
   979                         }
  1018                         }
   980                     //set show stroke                               
  1019                     //set show stroke                               
   981                     CDesCArray
  1020                     CDesCArray* showStroke =
   982                         * showStroke =
       
   983                             UIContainer()->PinyinPopupWindow()->ShowKeystrokeArray();
  1021                             UIContainer()->PinyinPopupWindow()->ShowKeystrokeArray();
   984                     showStroke->Reset();
  1022                     showStroke->Reset();
   985                     TInt pinyinStarCount = 0;
  1023                     TInt pinyinStarCount = 0;
   986                     for (i = 0; i < ptr2.Length(); )
  1024                     for (i = 0; i < ptr2.Length(); )
   987                         {
  1025                         {