fep/aknfep/peninputplugins/peninputimeplugincn/src/peninputimeplugincn.cpp
changeset 36 a7632c26d895
parent 35 0f326f2e628e
child 42 b3eaa440ab06
equal deleted inserted replaced
35:0f326f2e628e 36:a7632c26d895
     1 /*
       
     2 * Copyright (c) 2002-2005 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:            Input mode plugin implementation file
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 // System includes
       
    30 #include <ecom.h>
       
    31 #include <AknFepManagerInterface.h>
       
    32 #include <eikmenup.h>
       
    33 #include <avkon.hrh>
       
    34 #include <aknfepuiinterface.h>
       
    35 #include <aknfepuimenus.h>
       
    36 #include <bldvariant.hrh>
       
    37 #include <featmgr.h>
       
    38 
       
    39 // User includes
       
    40 #include "peninputimeplugincn.h"
       
    41 #include "peninputimeplugincndebug.h"
       
    42 #include "pluginfepmanagerhwr.h"
       
    43 #include "pluginfepmanagervkb.h"
       
    44 #include "aknfepuiinterface.h"
       
    45 
       
    46 
       
    47 
       
    48 const TInt KInvalidImplId = 0;
       
    49 
       
    50 _LIT(KFscImeName, "Chinese FSC");
       
    51 _LIT(KHwrImeName, "Chinese HWR");
       
    52 _LIT(KVkbImeName, "Chinese VKB");
       
    53 _LIT(KFsqImeName, "Chinese FSQ");
       
    54 _LIT(KFingerHwrImeName, "Chinese Fingerhwr");
       
    55 
       
    56 //lint -esym( 960, 58, * ) lint notes: break used outside of a switch
       
    57 
       
    58 // Implementation of Class CPenInputImePluginCn 
       
    59 
       
    60 // -----------------------------------------------------------------------------
       
    61 // RImplInfoPtrArray cleanup function
       
    62 // -----------------------------------------------------------------------------
       
    63 //
       
    64 void Cleanup( TAny* aAny )
       
    65     {
       
    66     RImplInfoPtrArray* implArray = 
       
    67         reinterpret_cast< RImplInfoPtrArray*> ( aAny );
       
    68     implArray->ResetAndDestroy();
       
    69     implArray->Close();
       
    70     }
       
    71 
       
    72 // ======== MEMBER FUNCTIONS ========
       
    73 
       
    74 // -----------------------------------------------------------------------------
       
    75 // CPenInputImePluginCn::NewL
       
    76 // factory function
       
    77 // (other items were commented in a header).
       
    78 // -----------------------------------------------------------------------------
       
    79 //
       
    80 CPenInputImePluginCn* CPenInputImePluginCn::NewL(TAny* aInitParams)
       
    81     {
       
    82     CPenInputImePluginCn* self = new(ELeave)CPenInputImePluginCn(
       
    83                                         static_cast<RPeninputServer*>(aInitParams));
       
    84     CleanupStack::PushL(self);
       
    85     self->ConstructL(); 
       
    86     CleanupStack::Pop(self);
       
    87     return self;
       
    88     }
       
    89 
       
    90 // -----------------------------------------------------------------------------
       
    91 // CPenInputImePluginCn::NewLC
       
    92 // factory function
       
    93 // (other items were commented in a header).
       
    94 // -----------------------------------------------------------------------------
       
    95 //
       
    96 CPenInputImePluginCn* CPenInputImePluginCn::NewLC(TAny* aInitParams)
       
    97     {
       
    98     CPenInputImePluginCn* self = new(ELeave) CPenInputImePluginCn(
       
    99                                         static_cast<RPeninputServer*>(aInitParams));
       
   100     CleanupStack::PushL(self);
       
   101     self->ConstructL(); 
       
   102     return self;
       
   103     }
       
   104 
       
   105 // -----------------------------------------------------------------------------
       
   106 // CPenInputImePluginCn::~CPenInputImePluginCn
       
   107 // destructor
       
   108 // (other items were commented in a header).
       
   109 // -----------------------------------------------------------------------------
       
   110 //
       
   111 CPenInputImePluginCn::~CPenInputImePluginCn()
       
   112     {
       
   113     DeActivate();
       
   114     iUiLayoutImpIdList.Close();
       
   115     delete iPluginUiManager;
       
   116     REComSession::FinalClose();//cleanup ecom
       
   117     }
       
   118 
       
   119 // -----------------------------------------------------------------------------
       
   120 // CPenInputImePluginCn::GetInputMethodUiL
       
   121 // Create layout UI interface
       
   122 // (other items were commented in a header).
       
   123 // -----------------------------------------------------------------------------
       
   124 //
       
   125 MAknFepManagerInterface* CPenInputImePluginCn::GetInputMethodUiL(
       
   126                                         MAknFepManagerUIInterface* aFepManager,
       
   127                                         TLanguage aLanguage, 
       
   128                                         TInt      aMode,
       
   129                                         const TDesC8& /*aData*/,
       
   130                                         const TBool aIsSplitView)
       
   131     {
       
   132     iFepManager = aFepManager;
       
   133     iLanguage = aLanguage;
       
   134     CPluginFepManagerBase* fepmanager = NULL;
       
   135     
       
   136     TUid layoutId;
       
   137     TInt i;
       
   138 
       
   139     switch(aMode)
       
   140         {
       
   141         case EPluginInputModeFSc:
       
   142             {
       
   143             layoutId.iUid = KFScUiId;
       
   144             }
       
   145             break;         
       
   146         case EPluginInputModeHwr:
       
   147             {
       
   148             layoutId.iUid = KHwrUiId;
       
   149             }
       
   150             break; 
       
   151         case EPluginInputModeVkb:
       
   152             {
       
   153             layoutId.iUid = KVkbUiId;
       
   154             }
       
   155             break;
       
   156         case EPluginInputModeFSQ:
       
   157             {
       
   158             layoutId.iUid = KFsqUiId;
       
   159             }
       
   160             break;
       
   161         case EPluginInputModeFingerHwr:
       
   162             {
       
   163             layoutId.iUid = KFingerHwrUiId;
       
   164             }
       
   165             break;            
       
   166         default:
       
   167             return NULL;
       
   168         }
       
   169     fepmanager = GetPluginUiL( aMode );
       
   170     
       
   171     for(i = 0; i < iUiLayoutImpIdList.Count(); ++i)
       
   172         {
       
   173         if(iUiLayoutImpIdList[i] == layoutId.iUid )
       
   174             {
       
   175             break;
       
   176             }
       
   177         }
       
   178 
       
   179     if( i < iUiLayoutImpIdList.Count() )
       
   180         {
       
   181         iPenInputMode = aMode;
       
   182         TInt errCode = iPenInputServer->SetUiLayoutId(layoutId);
       
   183         if( errCode == KErrNone )
       
   184             {
       
   185             fepmanager->OnInit();
       
   186             return fepmanager;
       
   187             }
       
   188         }
       
   189         
       
   190     return NULL;
       
   191     }
       
   192 
       
   193 // -----------------------------------------------------------------------------
       
   194 // CPenInputImePluginCn::GetInputMethodUiL
       
   195 // Create layout UI interface
       
   196 // (other items were commented in a header).
       
   197 // -----------------------------------------------------------------------------
       
   198 //
       
   199 MAknFepManagerInterface* CPenInputImePluginCn::GetInputMethodUiL(
       
   200                                     MAknFepManagerUIInterface* aFepManager,
       
   201                                     TInt aLayoutId,
       
   202                                     const TDesC8& /*aData*/)
       
   203     {
       
   204     iFepManager = aFepManager;
       
   205     CPluginFepManagerBase* fepmanager = NULL;   
       
   206     TInt i;
       
   207     TInt mode;    
       
   208     
       
   209     if ( aLayoutId == KHwrUiId )
       
   210         {
       
   211         mode = EPluginInputModeHwr;      
       
   212         }
       
   213     else if( aLayoutId == KVkbUiId )
       
   214         {
       
   215         mode = EPluginInputModeVkb;
       
   216         }
       
   217     else if (aLayoutId == KFScUiId)
       
   218         {
       
   219         mode = EPluginInputModeFSc;
       
   220         }
       
   221     else if( aLayoutId == KFsqUiId )
       
   222         {
       
   223         mode = EPluginInputModeFSQ;
       
   224         }
       
   225     else if( aLayoutId == KFingerHwrUiId )
       
   226         {
       
   227         mode = EPluginInputModeFingerHwr;
       
   228         }
       
   229     else
       
   230         {
       
   231         return NULL;
       
   232         }
       
   233     fepmanager = GetPluginUiL( mode );
       
   234 
       
   235     for ( i = 0; i < iUiLayoutImpIdList.Count(); ++i )
       
   236         {
       
   237         if ( iUiLayoutImpIdList[i] == aLayoutId )
       
   238             {
       
   239             break;
       
   240             }
       
   241         }
       
   242 
       
   243     if ( i < iUiLayoutImpIdList.Count() )
       
   244         {
       
   245         iPenInputMode = mode;
       
   246         iPenInputServer->SetUiLayoutId(TUid::Uid(aLayoutId));
       
   247         fepmanager->OnInit();    
       
   248         return fepmanager;
       
   249         }
       
   250         
       
   251     return NULL;
       
   252     }
       
   253 
       
   254 // -----------------------------------------------------------------------------
       
   255 // CPenInputImePluginCn::Activate
       
   256 // Activate current IME plugin.
       
   257 // (other items were commented in a header).
       
   258 // -----------------------------------------------------------------------------
       
   259 //
       
   260 void CPenInputImePluginCn::Activate()
       
   261     {
       
   262     if(iPenInputServer)
       
   263         {
       
   264         iPenInputServer->ActivateLayout(ETrue);        
       
   265         }
       
   266     }
       
   267 
       
   268 // -----------------------------------------------------------------------------
       
   269 // CPenInputImePluginCn::DeActivate
       
   270 // Deactivate current IME plugin.
       
   271 // (other items were commented in a header).
       
   272 // -----------------------------------------------------------------------------
       
   273 //
       
   274 void CPenInputImePluginCn::DeActivate()
       
   275     {
       
   276     if (iPenInputServer && iPenInputServer->IsVisible())        
       
   277         {
       
   278         iPenInputServer->ActivateLayout(EFalse);
       
   279         }
       
   280     }
       
   281 
       
   282 // -----------------------------------------------------------------------------
       
   283 // CPenInputImePluginCn::ImeImplId
       
   284 // Get current IME plugin implementation ID.
       
   285 // (other items were commented in a header).
       
   286 // -----------------------------------------------------------------------------
       
   287 //
       
   288 TInt CPenInputImePluginCn::ImeImplId()
       
   289     {
       
   290     return KInputMethodImplementationId;
       
   291     }
       
   292 
       
   293 // -----------------------------------------------------------------------------
       
   294 // CPenInputImePluginCn::LayoutUiImplId
       
   295 // Get current layout UI implementation id.
       
   296 // (other items were commented in a header).
       
   297 // -----------------------------------------------------------------------------
       
   298 //
       
   299 TInt CPenInputImePluginCn::LayoutUiImplId()
       
   300     {
       
   301     TInt id;
       
   302     switch ( iPenInputMode )
       
   303         {
       
   304         case EPluginInputModeHwr:
       
   305             {
       
   306             id = KHwrUiId;
       
   307             }
       
   308             break;
       
   309         case EPluginInputModeVkb:
       
   310             {
       
   311             id = KVkbUiId;
       
   312             }
       
   313             break;
       
   314         case EPluginInputModeFSc:
       
   315             {
       
   316             id = KFScUiId;
       
   317             }
       
   318             break; 
       
   319         case EPluginInputModeFSQ:
       
   320             {
       
   321             id = KFsqUiId;
       
   322             }
       
   323             break;
       
   324         case EPluginInputModeFingerHwr:
       
   325             {
       
   326             id = KFingerHwrUiId;
       
   327             }
       
   328             break; 
       
   329         default:
       
   330             {
       
   331             id = KInvalidImplId;
       
   332             }
       
   333             break;
       
   334         }
       
   335     return id;
       
   336     }
       
   337 
       
   338 
       
   339 // -----------------------------------------------------------------------------
       
   340 // CPenInputImePluginCn::SupportModes
       
   341 // Get suppored layout UI modes(VKB/HWR).
       
   342 // (other items were commented in a header).
       
   343 // -----------------------------------------------------------------------------
       
   344 //
       
   345 TInt CPenInputImePluginCn::SupportModes(CPtiEngine* aPtiEngine,
       
   346                                              RArray<TImePlguinImplDetail>& aSupportList) const
       
   347     {
       
   348     TInt ret = 0;
       
   349     TRAP_IGNORE( ret = SupportModesL( aPtiEngine, aSupportList ) );
       
   350     return ret;
       
   351     }
       
   352     
       
   353 // -----------------------------------------------------------------------------
       
   354 // CPenInputImePluginCn::SupportModesL
       
   355 // Get suppored layout UI modes(VKB/HWR).
       
   356 // (other items were commented in a header).
       
   357 // -----------------------------------------------------------------------------
       
   358 //
       
   359 TInt CPenInputImePluginCn::SupportModesL(CPtiEngine* /*aPtiEngine*/,
       
   360                                              RArray<TImePlguinImplDetail>& aSupportList) const 
       
   361     {
       
   362     RImplInfoPtrArray infoArray;
       
   363     TUid id;
       
   364     id.iUid = KHwrLayoutInterfaceId;
       
   365     TBool hwr = EFalse;
       
   366     TBool vkb = EFalse;
       
   367     TBool fsc = EFalse;
       
   368     TBool fsq = EFalse;
       
   369     TBool fingerhwr = EFalse;
       
   370     
       
   371     CleanupStack::PushL( TCleanupItem( Cleanup, &infoArray ) );
       
   372     REComSession::ListImplementationsL(id, infoArray);
       
   373         
       
   374     for (TInt i = 0; i < infoArray.Count(); ++i)
       
   375         {
       
   376         if(infoArray[i]->ImplementationUid().iUid == KHwrUiId )
       
   377             {
       
   378             hwr = ETrue;
       
   379             }
       
   380 
       
   381         if (infoArray[i]->ImplementationUid().iUid == KVkbUiId
       
   382                 && FeatureManager::FeatureSupported(KFeatureIdVirtualKeyboardInput))
       
   383             {
       
   384             vkb = ETrue;
       
   385             }
       
   386         if(infoArray[i]->ImplementationUid().iUid == KFScUiId )
       
   387             {
       
   388             fsc = ETrue;
       
   389             }          
       
   390         if (infoArray[i]->ImplementationUid().iUid == KFsqUiId
       
   391                 && FeatureManager::FeatureSupported(KFeatureIdVirtualFullscrQwertyInput))
       
   392             {
       
   393             fsq = ETrue;
       
   394             }
       
   395         if (infoArray[i]->ImplementationUid().iUid == KFingerHwrUiId )
       
   396             {
       
   397             fingerhwr = ETrue;
       
   398             }  
       
   399         }
       
   400     
       
   401     TImePlguinImplDetail detail;
       
   402     
       
   403     detail.iImplementationId = KInputMethodImplementationId;
       
   404     if( fsc )
       
   405         {
       
   406         detail.iMode = EPluginInputModeFSc;
       
   407         detail.iMeritValue = EImeMerit_Preferred;
       
   408         detail.iDisplayName.Copy(KFscImeName());
       
   409         detail.iLanguage = ELangTaiwanChinese;
       
   410         aSupportList.Append(detail);
       
   411         detail.iLanguage = ELangHongKongChinese;
       
   412         aSupportList.Append(detail);
       
   413         detail.iLanguage = ELangPrcChinese;
       
   414         aSupportList.Append(detail);
       
   415         //detail.iLanguage = ELangEnglish;
       
   416         //detail.iMeritValue = EImeMerit_NotUsed;
       
   417         //aSupportList.Append(detail);
       
   418         }
       
   419     if( hwr )
       
   420         {
       
   421         detail.iMode = EPluginInputModeHwr;
       
   422         detail.iMeritValue = EImeMerit_Preferred;
       
   423         detail.iDisplayName.Copy(KHwrImeName());
       
   424         detail.iLanguage = ELangTaiwanChinese;
       
   425         aSupportList.Append(detail);
       
   426         detail.iLanguage = ELangHongKongChinese;
       
   427         aSupportList.Append(detail);
       
   428         detail.iLanguage = ELangPrcChinese;
       
   429         aSupportList.Append(detail);
       
   430         //detail.iLanguage = ELangEnglish;
       
   431         //detail.iMeritValue = EImeMerit_NotUsed;
       
   432         //aSupportList.Append(detail);
       
   433         }
       
   434 
       
   435     if( vkb )
       
   436         {
       
   437         detail.iMode = EPluginInputModeVkb;
       
   438         detail.iMeritValue = EImeMerit_Preferred;
       
   439         detail.iDisplayName.Copy(KVkbImeName());
       
   440         detail.iLanguage = ELangTaiwanChinese;
       
   441         aSupportList.Append(detail);
       
   442         detail.iLanguage = ELangHongKongChinese;
       
   443         aSupportList.Append(detail);
       
   444         detail.iLanguage = ELangPrcChinese;
       
   445         aSupportList.Append(detail);
       
   446         //detail.iLanguage = ELangEnglish;
       
   447         //detail.iMeritValue = EImeMerit_NotUsed;
       
   448         //aSupportList.Append(detail);
       
   449         }
       
   450         
       
   451     if( fsq )
       
   452         {
       
   453         detail.iMode = EPluginInputModeFSQ;
       
   454         detail.iMeritValue = EImeMerit_Preferred;
       
   455         detail.iDisplayName.Copy(KFsqImeName());
       
   456         detail.iLanguage = ELangTaiwanChinese;
       
   457         aSupportList.Append(detail);
       
   458         detail.iLanguage = ELangHongKongChinese;
       
   459         aSupportList.Append(detail);
       
   460         detail.iLanguage = ELangPrcChinese;
       
   461         aSupportList.Append(detail);
       
   462         //detail.iLanguage = ELangEnglish;
       
   463         //detail.iMeritValue = EImeMerit_NotUsed;
       
   464         //aSupportList.Append(detail);
       
   465         }
       
   466     if( fingerhwr )
       
   467         {
       
   468         detail.iMode = EPluginInputModeFingerHwr;
       
   469         detail.iMeritValue = EImeMerit_Preferred;
       
   470         detail.iDisplayName.Copy(KFingerHwrImeName());
       
   471         detail.iLanguage = ELangTaiwanChinese;
       
   472         aSupportList.Append(detail);
       
   473         detail.iLanguage = ELangHongKongChinese;
       
   474         aSupportList.Append(detail);
       
   475         detail.iLanguage = ELangPrcChinese;
       
   476         aSupportList.Append(detail);
       
   477         }
       
   478         
       
   479     CleanupStack::PopAndDestroy(&infoArray); // infoArray    
       
   480     
       
   481     return 0;
       
   482     }
       
   483 
       
   484 // -----------------------------------------------------------------------------
       
   485 // CPenInputImePluginCn::CurrentMode
       
   486 // Get current layout UI mode.
       
   487 // (other items were commented in a header).
       
   488 // -----------------------------------------------------------------------------
       
   489 //
       
   490 TInt CPenInputImePluginCn::CurrentMode() const
       
   491     {
       
   492     return iPenInputMode;
       
   493     }
       
   494 
       
   495 // -----------------------------------------------------------------------------
       
   496 // CPenInputImePluginCn::HandleServerEventL
       
   497 // Handle pen input server event..
       
   498 // (other items were commented in a header).
       
   499 // -----------------------------------------------------------------------------
       
   500 //
       
   501 TBool CPenInputImePluginCn::HandleServerEventL(TInt aEventId, const TDesC& aData)
       
   502     {
       
   503     TBool bHandled = EFalse;
       
   504     switch( aEventId )
       
   505         {
       
   506         case ESignalLayoutICFLengthChanged:
       
   507             {
       
   508             GetCurrentUi()->RetrieveEditorMaxLength();
       
   509             }
       
   510             break;
       
   511         case ESignalCaseMode:
       
   512             {
       
   513             GetCurrentUi()->UpdateCaseMode(*(TInt*)(aData.Ptr())); //lint !e728
       
   514             }
       
   515             break;
       
   516         default:
       
   517             break;
       
   518         }
       
   519         
       
   520     return bHandled;
       
   521     }
       
   522 
       
   523 // -----------------------------------------------------------------------------
       
   524 // CPenInputImePluginCn::HandleMenuCommandL
       
   525 // Handle the menu command.
       
   526 // (other items were commented in a header).
       
   527 // -----------------------------------------------------------------------------
       
   528 //
       
   529 TBool CPenInputImePluginCn::HandleMenuCommandL(TInt /*aCommandId*/)
       
   530     {
       
   531     return EFalse;
       
   532     }
       
   533 
       
   534 // -----------------------------------------------------------------------------
       
   535 // CPenInputImePluginCn::DynInitMenuPaneL
       
   536 // Dynamiclly update menu items during it displays.
       
   537 // (other items were commented in a header).
       
   538 // -----------------------------------------------------------------------------
       
   539 //
       
   540 void CPenInputImePluginCn::DynInitMenuPaneL(CAknFepUiInterfaceMenuPane* aMenuPane)
       
   541     {
       
   542     TInt index;
       
   543     
       
   544     if ((iPenInputMode == EPluginInputModeVkb ||
       
   545         iPenInputMode == EPluginInputModeFSQ) &&
       
   546         aMenuPane->MenuItemExists(EPenInputCmdSetting, index))
       
   547         {
       
   548         aMenuPane->SetItemDimmed(EPenInputCmdSetting, EFalse);   
       
   549         }
       
   550     aMenuPane->SetItemDimmed(EPenInputCmdHwrTraining, ETrue);			
       
   551     }
       
   552 
       
   553 
       
   554 // -----------------------------------------------------------------------------
       
   555 // CPenInputImePluginCn::CPenInputImePluginCn
       
   556 // C++ default constructor.
       
   557 // (other items were commented in a header).
       
   558 // -----------------------------------------------------------------------------
       
   559 //
       
   560 CPenInputImePluginCn::CPenInputImePluginCn(RPeninputServer* aHwrServer)
       
   561 :iPenInputServer(aHwrServer) 
       
   562     {
       
   563     }
       
   564 
       
   565 // -----------------------------------------------------------------------------
       
   566 // CPenInputImePluginCn::ConstructL
       
   567 // 2nd phase constructor.
       
   568 // (other items were commented in a header).
       
   569 // -----------------------------------------------------------------------------
       
   570 //
       
   571 void CPenInputImePluginCn::ConstructL()
       
   572     {
       
   573     FindUiLayoutImplementationL();
       
   574     }
       
   575 
       
   576 // -----------------------------------------------------------------------------
       
   577 // CPenInputImePluginCn::FindUiLayoutImplementationL
       
   578 // Enumuate all layout UI ids.
       
   579 // (other items were commented in a header).
       
   580 // -----------------------------------------------------------------------------
       
   581 //
       
   582 void CPenInputImePluginCn::FindUiLayoutImplementationL()
       
   583     {
       
   584     RImplInfoPtrArray infoArray;
       
   585     TUid id;
       
   586     id.iUid = KHwrLayoutInterfaceId;
       
   587 
       
   588     iUiLayoutImpIdList.Reset();
       
   589     CleanupStack::PushL( TCleanupItem( Cleanup, &infoArray ) );
       
   590     REComSession::ListImplementationsL(id, infoArray);
       
   591         
       
   592     for (TInt i = 0; i < infoArray.Count(); ++i)
       
   593         {
       
   594         iUiLayoutImpIdList.AppendL(infoArray[i]->ImplementationUid().iUid);
       
   595         }
       
   596 
       
   597     CleanupStack::PopAndDestroy(&infoArray); // infoArray    
       
   598     }
       
   599 
       
   600 // -----------------------------------------------------------------------------
       
   601 // CPenInputImePluginCn::GetPluginUiL
       
   602 // Get HWR UI interface.
       
   603 // (other items were commented in a header).
       
   604 // -----------------------------------------------------------------------------
       
   605 //
       
   606 CPluginFepManagerBase* CPenInputImePluginCn::GetPluginUiL( TInt aMode )
       
   607     {
       
   608     delete iPluginUiManager;
       
   609     iPluginUiManager = NULL;
       
   610     
       
   611     switch ( aMode )
       
   612         {
       
   613         case EPluginInputModeFingerHwr:
       
   614         case EPluginInputModeFSc:
       
   615         case EPluginInputModeHwr:
       
   616             {
       
   617             return iPluginUiManager = CPluginFepManagerHwr::NewL(*this, iPenInputServer);
       
   618             }
       
   619         case EPluginInputModeVkb:
       
   620         case EPluginInputModeFSQ:
       
   621             {
       
   622             return iPluginUiManager = CPluginFepManagerVkb::NewL(*this, iPenInputServer);
       
   623             }
       
   624         default:
       
   625             {
       
   626             return NULL;
       
   627             }
       
   628         }
       
   629     }
       
   630 //End Of File