fep/aknfep/peninputplugins/peninputimeplugingeneric/src/peninputimeplugingeneric.cpp
branchRCL_3
changeset 19 ac7e4d1d9209
parent 5 a47de9135b21
--- a/fep/aknfep/peninputplugins/peninputimeplugingeneric/src/peninputimeplugingeneric.cpp	Thu Jul 15 19:01:13 2010 +0300
+++ b/fep/aknfep/peninputplugins/peninputimeplugingeneric/src/peninputimeplugingeneric.cpp	Thu Aug 19 10:15:25 2010 +0300
@@ -49,6 +49,7 @@
 _LIT(KHwrImeName, "Generic HWR");
 _LIT(KVkbImeName, "Generic VKB");
 _LIT(KFSQImeName, "Generic FSQ");
+_LIT(KPrtFSQImeName, "Portrait QWERTY");
 _LIT(KSSQImeName, "Split View Qwerty");
 _LIT(KFingerHwrImeName, "Generic Fingerhwr");
 _LIT(KHwrResourceFormatPattern, "peninputhwrwindowconfiginfo_*.rsc");
@@ -207,6 +208,16 @@
                 }
             }
             break;
+        case EPluginInputModePortraitFSQ:
+            {
+            // UI layout for portrait FSQ.
+            // Note: Don't need to check whether portrait QWERTY feature is 
+            // enabled.  Because otherwise, aMode can not have 
+            // EPluginInputModePortraitFSQ.
+            layoutId.iUid = KPrtFsqUiId;
+            }
+            break;
+
         case EPluginInputModeFingerHwr:
             {
             layoutId.iUid = KFingerHwrUiId;
@@ -271,6 +282,13 @@
         {
         mode = EPluginInputModeFSQ;
         }
+    // If full screen portrait QWERTY feature is enabled, portrait QWERTY UI 
+    // layout is used.
+    else if( aLayoutId == KPrtFsqUiId ) 
+        {
+        mode = EPluginInputModePortraitFSQ;
+        }
+
     else if( aLayoutId == KFingerHwrUiId )
         {
         mode = EPluginInputModeFingerHwr;
@@ -365,6 +383,11 @@
             id = KFsqUiId;
             }
             break;
+        case EPluginInputModePortraitFSQ:
+            {
+            id = KPrtFsqUiId;
+            }
+            break;
         case EPluginInputModeFingerHwr:
             {
             id = KFingerHwrUiId;
@@ -465,6 +488,7 @@
     TBool hwr = EFalse;
     TBool vkb = EFalse;
     TBool fsq = EFalse;
+    TBool prtfsq = EFalse;
     TBool ssq = EFalse;
     TBool fingerhwr = EFalse;  
     CleanupStack::PushL( TCleanupItem( Cleanup, &infoArray ) );
@@ -489,6 +513,14 @@
             fsq = ETrue;
             }
             
+        // If full screen portrait QWERTY feature is enabled, set the mode is enabled.
+        if ( infoArray[i]->ImplementationUid().iUid == KPrtFsqUiId
+            && FeatureManager::FeatureSupported( 
+                KFeatureIdFfVirtualFullscrPortraitQwertyInput ) )
+            {
+            prtfsq = ETrue;
+            }
+            
         if (infoArray[i]->ImplementationUid().iUid == KSsqUiId
                 && FeatureManager::FeatureSupported(KFeatureIdVirtualFullscrQwertyInput))
             {
@@ -533,7 +565,7 @@
   	    delete dir;
         }
 
-    if( vkb || fsq )
+    if( vkb || fsq || prtfsq )
         {
       	TFindFile fileFinder(CCoeEnv::Static()->FsSession());
       	TFileName resName;
@@ -571,6 +603,34 @@
                     j <=  KSupportLanguages[i].iLangEnd; ++j)
                     {
                     VkbResNameFromLangId( resName, j);
+                    
+                    if( IsFileInDir( dir, resName ) )
+                        {
+                        detail.iLanguage = j;
+                        detail.iMeritValue = KSupportLanguages[i].iMerit;
+                        aSupportList.Append(detail);
+                        }
+                    }
+                }
+            }
+
+        // Add portrait full qwerty as the supported mode.
+        // Note: Feature flag check is not needed here because prtfsq should be
+        // EFalse if the feature flag is not enabled.
+        // Note: We share the same layout for portrait FSQ with landscape FSQ.
+        if( prtfsq )
+            {
+            detail.iMode = EPluginInputModePortraitFSQ;
+            // Display name is "Portrait QWERTY".
+            detail.iDisplayName.Copy( KPrtFSQImeName() );
+            // Add all the support languages.  They are defined in 10282358.rss.
+            for ( TInt i = 0; i < sizeof( KSupportLanguages ) / sizeof( TLangMeritPair ); ++i )
+                {
+                for ( TInt j =  KSupportLanguages[i].iLangStart; 
+                    j <=  KSupportLanguages[i].iLangEnd; ++j )
+                    {
+                    VkbResNameFromLangId( resName, j );
+
                     if( IsFileInDir( dir, resName ) )
                         {
                         detail.iLanguage = j;
@@ -768,6 +828,7 @@
             }
         case EPluginInputModeVkb:
         case EPluginInputModeFSQ:
+        case EPluginInputModePortraitFSQ:
             {
             return iPluginUiManager = CPluginFepManagerVkb::NewL(*this, iPenInputServer);
             }