fep/aknfep/peninputplugins/peninputimeplugingeneric/src/peninputimeplugingeneric.cpp
branchRCL_3
changeset 19 ac7e4d1d9209
parent 5 a47de9135b21
equal deleted inserted replaced
18:b1ea1642412e 19:ac7e4d1d9209
    47 const TInt KInvalidImplId = 0;
    47 const TInt KInvalidImplId = 0;
    48 
    48 
    49 _LIT(KHwrImeName, "Generic HWR");
    49 _LIT(KHwrImeName, "Generic HWR");
    50 _LIT(KVkbImeName, "Generic VKB");
    50 _LIT(KVkbImeName, "Generic VKB");
    51 _LIT(KFSQImeName, "Generic FSQ");
    51 _LIT(KFSQImeName, "Generic FSQ");
       
    52 _LIT(KPrtFSQImeName, "Portrait QWERTY");
    52 _LIT(KSSQImeName, "Split View Qwerty");
    53 _LIT(KSSQImeName, "Split View Qwerty");
    53 _LIT(KFingerHwrImeName, "Generic Fingerhwr");
    54 _LIT(KFingerHwrImeName, "Generic Fingerhwr");
    54 _LIT(KHwrResourceFormatPattern, "peninputhwrwindowconfiginfo_*.rsc");
    55 _LIT(KHwrResourceFormatPattern, "peninputhwrwindowconfiginfo_*.rsc");
    55 _LIT(KVkbResourceFormatPattern, "peninputvkbwindowconfiginfo_*.rsc");
    56 _LIT(KVkbResourceFormatPattern, "peninputvkbwindowconfiginfo_*.rsc");
    56 _LIT(KSsqResourceFormatPattern, "peninputssqwinconfiginfo_*.rsc");
    57 _LIT(KSsqResourceFormatPattern, "peninputssqwinconfiginfo_*.rsc");
   205                 {
   206                 {
   206                 layoutId.iUid = KFsqUiId;
   207                 layoutId.iUid = KFsqUiId;
   207                 }
   208                 }
   208             }
   209             }
   209             break;
   210             break;
       
   211         case EPluginInputModePortraitFSQ:
       
   212             {
       
   213             // UI layout for portrait FSQ.
       
   214             // Note: Don't need to check whether portrait QWERTY feature is 
       
   215             // enabled.  Because otherwise, aMode can not have 
       
   216             // EPluginInputModePortraitFSQ.
       
   217             layoutId.iUid = KPrtFsqUiId;
       
   218             }
       
   219             break;
       
   220 
   210         case EPluginInputModeFingerHwr:
   221         case EPluginInputModeFingerHwr:
   211             {
   222             {
   212             layoutId.iUid = KFingerHwrUiId;
   223             layoutId.iUid = KFingerHwrUiId;
   213             }
   224             }
   214             break;            
   225             break;            
   269         }
   280         }
   270     else if( aLayoutId == KFsqUiId )
   281     else if( aLayoutId == KFsqUiId )
   271         {
   282         {
   272         mode = EPluginInputModeFSQ;
   283         mode = EPluginInputModeFSQ;
   273         }
   284         }
       
   285     // If full screen portrait QWERTY feature is enabled, portrait QWERTY UI 
       
   286     // layout is used.
       
   287     else if( aLayoutId == KPrtFsqUiId ) 
       
   288         {
       
   289         mode = EPluginInputModePortraitFSQ;
       
   290         }
       
   291 
   274     else if( aLayoutId == KFingerHwrUiId )
   292     else if( aLayoutId == KFingerHwrUiId )
   275         {
   293         {
   276         mode = EPluginInputModeFingerHwr;
   294         mode = EPluginInputModeFingerHwr;
   277         }
   295         }
   278     else
   296     else
   361             }
   379             }
   362             break;
   380             break;
   363         case EPluginInputModeFSQ:
   381         case EPluginInputModeFSQ:
   364             {
   382             {
   365             id = KFsqUiId;
   383             id = KFsqUiId;
       
   384             }
       
   385             break;
       
   386         case EPluginInputModePortraitFSQ:
       
   387             {
       
   388             id = KPrtFsqUiId;
   366             }
   389             }
   367             break;
   390             break;
   368         case EPluginInputModeFingerHwr:
   391         case EPluginInputModeFingerHwr:
   369             {
   392             {
   370             id = KFingerHwrUiId;
   393             id = KFingerHwrUiId;
   463     TUid id;
   486     TUid id;
   464     id.iUid = KHwrLayoutInterfaceId;
   487     id.iUid = KHwrLayoutInterfaceId;
   465     TBool hwr = EFalse;
   488     TBool hwr = EFalse;
   466     TBool vkb = EFalse;
   489     TBool vkb = EFalse;
   467     TBool fsq = EFalse;
   490     TBool fsq = EFalse;
       
   491     TBool prtfsq = EFalse;
   468     TBool ssq = EFalse;
   492     TBool ssq = EFalse;
   469     TBool fingerhwr = EFalse;  
   493     TBool fingerhwr = EFalse;  
   470     CleanupStack::PushL( TCleanupItem( Cleanup, &infoArray ) );
   494     CleanupStack::PushL( TCleanupItem( Cleanup, &infoArray ) );
   471     REComSession::ListImplementationsL(id, infoArray);
   495     REComSession::ListImplementationsL(id, infoArray);
   472         
   496         
   485             
   509             
   486         if (infoArray[i]->ImplementationUid().iUid == KFsqUiId
   510         if (infoArray[i]->ImplementationUid().iUid == KFsqUiId
   487                 && FeatureManager::FeatureSupported(KFeatureIdVirtualFullscrQwertyInput))
   511                 && FeatureManager::FeatureSupported(KFeatureIdVirtualFullscrQwertyInput))
   488             {
   512             {
   489             fsq = ETrue;
   513             fsq = ETrue;
       
   514             }
       
   515             
       
   516         // If full screen portrait QWERTY feature is enabled, set the mode is enabled.
       
   517         if ( infoArray[i]->ImplementationUid().iUid == KPrtFsqUiId
       
   518             && FeatureManager::FeatureSupported( 
       
   519                 KFeatureIdFfVirtualFullscrPortraitQwertyInput ) )
       
   520             {
       
   521             prtfsq = ETrue;
   490             }
   522             }
   491             
   523             
   492         if (infoArray[i]->ImplementationUid().iUid == KSsqUiId
   524         if (infoArray[i]->ImplementationUid().iUid == KSsqUiId
   493                 && FeatureManager::FeatureSupported(KFeatureIdVirtualFullscrQwertyInput))
   525                 && FeatureManager::FeatureSupported(KFeatureIdVirtualFullscrQwertyInput))
   494             {
   526             {
   531                 
   563                 
   532       	    }
   564       	    }
   533   	    delete dir;
   565   	    delete dir;
   534         }
   566         }
   535 
   567 
   536     if( vkb || fsq )
   568     if( vkb || fsq || prtfsq )
   537         {
   569         {
   538       	TFindFile fileFinder(CCoeEnv::Static()->FsSession());
   570       	TFindFile fileFinder(CCoeEnv::Static()->FsSession());
   539       	TFileName resName;
   571       	TFileName resName;
   540       	CDir* dir = NULL;
   572       	CDir* dir = NULL;
   541       	TInt result = fileFinder.FindWildByDir( KVkbResourceFormatPattern, 
   573       	TInt result = fileFinder.FindWildByDir( KVkbResourceFormatPattern, 
   569                 {
   601                 {
   570                 for(TInt j =  KSupportLanguages[i].iLangStart; 
   602                 for(TInt j =  KSupportLanguages[i].iLangStart; 
   571                     j <=  KSupportLanguages[i].iLangEnd; ++j)
   603                     j <=  KSupportLanguages[i].iLangEnd; ++j)
   572                     {
   604                     {
   573                     VkbResNameFromLangId( resName, j);
   605                     VkbResNameFromLangId( resName, j);
       
   606                     
       
   607                     if( IsFileInDir( dir, resName ) )
       
   608                         {
       
   609                         detail.iLanguage = j;
       
   610                         detail.iMeritValue = KSupportLanguages[i].iMerit;
       
   611                         aSupportList.Append(detail);
       
   612                         }
       
   613                     }
       
   614                 }
       
   615             }
       
   616 
       
   617         // Add portrait full qwerty as the supported mode.
       
   618         // Note: Feature flag check is not needed here because prtfsq should be
       
   619         // EFalse if the feature flag is not enabled.
       
   620         // Note: We share the same layout for portrait FSQ with landscape FSQ.
       
   621         if( prtfsq )
       
   622             {
       
   623             detail.iMode = EPluginInputModePortraitFSQ;
       
   624             // Display name is "Portrait QWERTY".
       
   625             detail.iDisplayName.Copy( KPrtFSQImeName() );
       
   626             // Add all the support languages.  They are defined in 10282358.rss.
       
   627             for ( TInt i = 0; i < sizeof( KSupportLanguages ) / sizeof( TLangMeritPair ); ++i )
       
   628                 {
       
   629                 for ( TInt j =  KSupportLanguages[i].iLangStart; 
       
   630                     j <=  KSupportLanguages[i].iLangEnd; ++j )
       
   631                     {
       
   632                     VkbResNameFromLangId( resName, j );
       
   633 
   574                     if( IsFileInDir( dir, resName ) )
   634                     if( IsFileInDir( dir, resName ) )
   575                         {
   635                         {
   576                         detail.iLanguage = j;
   636                         detail.iLanguage = j;
   577                         detail.iMeritValue = KSupportLanguages[i].iMerit;
   637                         detail.iMeritValue = KSupportLanguages[i].iMerit;
   578                         aSupportList.Append(detail);
   638                         aSupportList.Append(detail);
   766             {
   826             {
   767             return iPluginUiManager = CPluginFepManagerHwr::NewL(*this, iPenInputServer);
   827             return iPluginUiManager = CPluginFepManagerHwr::NewL(*this, iPenInputServer);
   768             }
   828             }
   769         case EPluginInputModeVkb:
   829         case EPluginInputModeVkb:
   770         case EPluginInputModeFSQ:
   830         case EPluginInputModeFSQ:
       
   831         case EPluginInputModePortraitFSQ:
   771             {
   832             {
   772             return iPluginUiManager = CPluginFepManagerVkb::NewL(*this, iPenInputServer);
   833             return iPluginUiManager = CPluginFepManagerVkb::NewL(*this, iPenInputServer);
   773             }
   834             }
   774         default:
   835         default:
   775             {
   836             {