textinput/peninputarc/gsplugin/gspeninputplugin/src/gspeninputmodel.cpp
branchRCL_3
changeset 12 4eb1ae11334f
parent 10 6defe5d1bd39
child 43 ebd48d2de13c
equal deleted inserted replaced
10:6defe5d1bd39 12:4eb1ae11334f
    46 const TInt KGSLanguageMask = 0x03FF;
    46 const TInt KGSLanguageMask = 0x03FF;
    47 const TInt KISOCodeLength = 2;
    47 const TInt KISOCodeLength = 2;
    48 const TUid KUidtruiApp = { 0x2000B104 };
    48 const TUid KUidtruiApp = { 0x2000B104 };
    49 const TUid KUidPenInputSettingApp = { 0x2001959B };
    49 const TUid KUidPenInputSettingApp = { 0x2001959B };
    50 
    50 
       
    51 const TInt KFepChineseInputModeLength = 10;
       
    52 
    51 _LIT(KLeftBracket, "(" );
    53 _LIT(KLeftBracket, "(" );
    52 _LIT(KRightBracket, ")" );
    54 _LIT(KRightBracket, ")" );
    53 
    55 
    54 // ======== MEMBER FUNCTIONS ========
    56 // ======== MEMBER FUNCTIONS ========
    55 
    57 
  1183         {
  1185         {
  1184         case ELangPrcChinese:
  1186         case ELangPrcChinese:
  1185         case ELangHongKongChinese:
  1187         case ELangHongKongChinese:
  1186         case ELangTaiwanChinese:
  1188         case ELangTaiwanChinese:
  1187             {
  1189             {
  1188             iAknfepRepository->Set(KAknFepChineseInputMode, aInputMode);
  1190             TBuf<KFepChineseInputModeLength> conversion;
       
  1191             conversion.Num(aInputMode, EHex);
       
  1192             iAknfepRepository->Set( KAknFepChineseInputMode, conversion );
  1189             }
  1193             }
  1190             break;
  1194             break;
  1191          default:
  1195          default:
  1192             break;
  1196             break;
  1193         }
  1197         }
  1198 // Get FEP default input mode when language changed
  1202 // Get FEP default input mode when language changed
  1199 // ---------------------------------------------------------
  1203 // ---------------------------------------------------------
  1200 //
  1204 //
  1201 TInt CGSPenInputModel::GetFepInputMode()
  1205 TInt CGSPenInputModel::GetFepInputMode()
  1202     {
  1206     {
  1203     TInt inputMode = 0;
  1207     TUint inputMode = 0;
  1204     switch(iInputLanguage)
  1208     switch(iInputLanguage)
  1205         {
  1209         {
  1206         case ELangPrcChinese:
  1210         case ELangPrcChinese:
  1207         case ELangHongKongChinese:
  1211         case ELangHongKongChinese:
  1208         case ELangTaiwanChinese:
  1212         case ELangTaiwanChinese:
  1209             {
  1213             {
  1210             iAknfepRepository->Get(KAknFepChineseInputMode, inputMode);
  1214             _LIT(Kx, "x");
       
  1215             // This conversion is needed because KAknFepChineseInputMode cenrep key original type was 16bit int.
       
  1216             // now type is changed to string, so that it can accommodate bigger values like EHangul 0x16000. 
       
  1217             TBuf<KFepChineseInputModeLength> conversion;
       
  1218             iAknfepRepository->Get( KAknFepChineseInputMode, conversion );
       
  1219            
       
  1220             TInt len = conversion.Find(Kx);
       
  1221             TLex lex;
       
  1222             
       
  1223             if(len)
       
  1224                 {
       
  1225                 TPtrC ptr = conversion.Mid(len +1);
       
  1226                 lex.Assign(ptr);
       
  1227                 }
       
  1228             else
       
  1229                 {
       
  1230                 lex.Assign(conversion);
       
  1231                 }
       
  1232             
       
  1233             lex.Val(inputMode, EHex);
  1211             }
  1234             }
  1212             break;
  1235             break;
  1213          default:
  1236          default:
  1214             break;
  1237             break;
  1215         }
  1238         }
  1402     if(KErrNone == iConnectErr)
  1425     if(KErrNone == iConnectErr)
  1403         {
  1426         {
  1404         supportMode = iPenInputServer.SupportInputMode( iInputLanguage );
  1427         supportMode = iPenInputServer.SupportInputMode( iInputLanguage );
  1405         }
  1428         }
  1406 
  1429 
  1407     TBool supportHWR = EFalse;
       
  1408     if( supportMode & EPluginInputModeHwr ||
  1430     if( supportMode & EPluginInputModeHwr ||
  1409         supportMode & EPluginInputModeFSc ||
  1431         supportMode & EPluginInputModeFSc ||
  1410         supportMode & EPluginInputModeFingerHwr)
  1432         supportMode & EPluginInputModeFingerHwr)
  1411         {
  1433         {
  1412         return ETrue;
  1434         return ETrue;