textinput/ptienginev2/src/PtiEngineImpl.cpp
branchRCL_3
changeset 56 8152b1f1763a
parent 50 5a1685599b76
equal deleted inserted replaced
50:5a1685599b76 56:8152b1f1763a
   745 		
   745 		
   746 			SetCurrentWord(oldTextBuf->Des());
   746 			SetCurrentWord(oldTextBuf->Des());
   747 			delete oldTextBuf;
   747 			delete oldTextBuf;
   748 			}
   748 			}
   749 		}
   749 		}
   750      else
       
   751          {
       
   752          // call CPtiKoreanQwertyCore::LoadKeyboards() by OpenLanguageL() again,
       
   753          // make sure that in hardware Qwerty, product keymappings can be used correctly.
       
   754          if ( aNewMode == EPtiEngineQwertyKorean )
       
   755             {    
       
   756               CPtiCore* core = static_cast<CPtiCore*>(iCurrentLanguage->GetCore( aNewMode ));
       
   757               if ( core )
       
   758                   {
       
   759                   TRAP_IGNORE( core->OpenLanguageL( iCurrentLanguage ) );
       
   760                   }
       
   761             }
       
   762           }
       
   763 	}
   750 	}
   764 
   751 
   765 // ---------------------------------------------------------------------------
   752 // ---------------------------------------------------------------------------
   766 // CPtiEngineImpl::CountToneMarks
   753 // CPtiEngineImpl::CountToneMarks
   767 // 
   754 // 
   779 		return KErrNoActiveLanguage;
   766 		return KErrNoActiveLanguage;
   780 		}
   767 		}
   781 
   768 
   782 	return KErrNoSuitableCore;
   769 	return KErrNoSuitableCore;
   783 	}
   770 	}
   784 
       
   785 // ---------------------------------------------------------------------------
   771 // ---------------------------------------------------------------------------
   786 // Group Unicode is that kind of mapping which one visible character with more 
   772 // Group Unicode is that kind of mapping which one visible character with more 
   787 // than one unicode submitted.
   773 // than one unicode submitted.
   788 // 
   774 // 
   789 // ---------------------------------------------------------------------------
   775 // ---------------------------------------------------------------------------
   801         }
   787         }
   802     else
   788     else
   803         {
   789         {
   804         aResult.Append(aKey);
   790         aResult.Append(aKey);
   805         }    
   791         }    
   806     }
   792 	}
   807 
   793 
   808 		
   794 		
   809 // ---------------------------------------------------------------------------
   795 // ---------------------------------------------------------------------------
   810 // CPtiEngineImpl::AppendKeyPress
   796 // CPtiEngineImpl::AppendKeyPress
   811 // 
   797 // 
   893 			// Forward to core object
   879 			// Forward to core object
   894 			TBuf<KMaxMapping> mappings;
   880 			TBuf<KMaxMapping> mappings;
   895 			IsGroupUnicodeExist(aKey, mappings, 0);
   881 			IsGroupUnicodeExist(aKey, mappings, 0);
   896 			if(mappings.Length() == 1)
   882 			if(mappings.Length() == 1)
   897 			    {
   883 			    {
   898 				Core()->AppendKeyPress(aKey);
   884 			Core()->AppendKeyPress(aKey);
   899 			    }
   885 			    }
   900 			else
   886 			else
   901 			    {
   887 			    {
   902                 for(TInt i = 0; i < mappings.Length(); i++)
   888                 for(TInt i = 0; i < mappings.Length(); i++)
   903                     {
   889                     {
  1167 // ---------------------------------------------------------------------------
  1153 // ---------------------------------------------------------------------------
  1168 //
  1154 //
  1169 TPtrC CPtiEngineImpl::RedirectKeyForChineseQwerty(TPtiKey aKey, TBool& aRedirected)
  1155 TPtrC CPtiEngineImpl::RedirectKeyForChineseQwerty(TPtiKey aKey, TBool& aRedirected)
  1170 	{
  1156 	{
  1171 	aRedirected = EFalse;
  1157 	aRedirected = EFalse;
  1172     TPtiKeyboardType kbdType = KeyboardType();
  1158     TPtiKeyboardType kbdType = KeyboardType();	
  1173 	TBuf<KMaxName> data;
  1159 	TBuf<KMaxName> data;
  1174 	TInt key;
  1160 	TInt key;
  1175     
  1161     
  1176 	switch (iInputMode)
  1162 	switch (iInputMode)
  1177 		{
  1163 		{
  2471 // 
  2457 // 
  2472 // ---------------------------------------------------------------------------
  2458 // ---------------------------------------------------------------------------
  2473 //
  2459 //
  2474 void CPtiEngineImpl::LoadCoresInDefaultDirL(TBool aUseDefaultUserDictionary)
  2460 void CPtiEngineImpl::LoadCoresInDefaultDirL(TBool aUseDefaultUserDictionary)
  2475 	{
  2461 	{
  2476     TUid KPtiSogouCoreUid = { 0x20031DD7 };
  2462 	TInt i;
  2477     TInt i = 0;
  2463 	CArrayFix<TInt>* array = CPtiCore::ListCoresLC();
  2478     TInt postponed = -1;
  2464 	User::LeaveIfNull(array);
  2479     CArrayFix<TInt>* array = CPtiCore::ListCoresLC();
  2465 	for (i = 0; i < array->Count(); i++)
  2480     User::LeaveIfNull(array);
  2466 		{
  2481     for (i = 0; i < array->Count(); i++)
  2467 		AddCoreL(TUid::Uid(array->At(i)), aUseDefaultUserDictionary);
  2482         {
  2468 		}
  2483         if (TUid::Uid(array->At(i)) == KPtiSogouCoreUid )
       
  2484             {
       
  2485             postponed = i;
       
  2486             continue;
       
  2487             }
       
  2488         AddCoreL(TUid::Uid(array->At(i)), aUseDefaultUserDictionary);
       
  2489         }
       
  2490     
       
  2491     if (postponed >= 0)
       
  2492         {
       
  2493         AddCoreL(TUid::Uid(array->At(postponed)), aUseDefaultUserDictionary);
       
  2494         }
       
  2495 
  2469 
  2496 	CleanupStack::PopAndDestroy(); // array
  2470 	CleanupStack::PopAndDestroy(); // array
  2497 	}
  2471 	}
  2498 
  2472 
  2499 
  2473