fep/aknfep/peninputplugins/PeninputPluginKr/src/PeninputPluginKr.cpp
changeset 0 eb1f2e154e89
child 3 f5a1e66df979
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:
       
    15 *
       
    16 */
       
    17 
       
    18 #include <FeatMgr.h>
       
    19 #include <ImplementationInformation.h>
       
    20 #include <AknFepPeninputEnums.h>
       
    21 #include <AknFepUiInterface.h>
       
    22 #include <AknFepUiMenus.h>
       
    23 #include <AknListQueryDialog.h>
       
    24 
       
    25 #include <COEMAIN.H>
       
    26 #include <BAUTILS.H>
       
    27 #include <StringLoader.h>
       
    28 
       
    29 #include <PeninputCmd.h>
       
    30 #include <PeninputPluginKrRes.rsg>
       
    31 #include <PeninputClient.h>
       
    32 
       
    33 #include <PtiKoreanQwertyCoreCRDefs.h>
       
    34 
       
    35 #include "PeninputPluginKrDbg.h"
       
    36 #include "PeninputPluginKr.hrh"   // CPeninputPluginKr
       
    37 #include "PeninputPluginKr.h"	// CPeninputPluginKr
       
    38 #include "PeninputPluginKr.pan"	  	// panic codes
       
    39 #include "PluginKrFepManagerBase.h"     // panic codes
       
    40 #include "PluginKrFepManagerHwr.h"
       
    41 #include "PluginKrFepManagerVkb.h"
       
    42 #include "PluginKrFepManagerItut.h"
       
    43 
       
    44 //_LIT(KFscImeName, "Korean FSC");
       
    45 //_LIT(KHwrImeName, "Korean HWR");
       
    46 _LIT(KVkbImeName, "Korean VKB");
       
    47 _LIT(KFsqImeName, "Korean FSQ");
       
    48 //_LIT(KFsqImeNameEng, "English FSQ");
       
    49 _LIT(KItutImeName, "Korean ITUT");
       
    50 
       
    51 _LIT(KPeninputPluginKrResourceFileName, "z:\\resource\\fep\\PeninputPluginKrRes.rsc");
       
    52 
       
    53 const TInt KItutUiIndex = 0;
       
    54 const TInt KVkbUiIndex = 1;
       
    55 const TInt KFSQUiIndex = 2;
       
    56 //const TInt KFSQUiEngIndex = 3;
       
    57 const TInt KInvalidImplId = 0;
       
    58 
       
    59 LOCAL_C void Cleanup( TAny* aAny )
       
    60     {
       
    61     RImplInfoPtrArray* implArray = 
       
    62         reinterpret_cast< RImplInfoPtrArray*> ( aAny );
       
    63     implArray->ResetAndDestroy();
       
    64     implArray->Close();
       
    65     }
       
    66 
       
    67 // ---------------------------------------------------------------------------
       
    68 // Constructors & Destructors
       
    69 // ---------------------------------------------------------------------------
       
    70 //
       
    71 
       
    72 CPeninputPluginKr* CPeninputPluginKr::NewLC(TAny* aInitParams)
       
    73     {
       
    74     CPeninputPluginKr* self = new (ELeave) CPeninputPluginKr(
       
    75         static_cast<RPeninputServer*>(aInitParams));
       
    76     CleanupStack::PushL(self);
       
    77     self->ConstructL();
       
    78     return self;
       
    79     }
       
    80 
       
    81 CPeninputPluginKr* CPeninputPluginKr::NewL(TAny* aInitParams)
       
    82     {
       
    83     CPeninputPluginKr* self = CPeninputPluginKr::NewLC(aInitParams);
       
    84     CleanupStack::Pop(self);
       
    85     return self;
       
    86     }
       
    87 
       
    88 CPeninputPluginKr::CPeninputPluginKr(RPeninputServer* aServer)
       
    89     : iPeninputServer(*aServer)
       
    90     {
       
    91     }
       
    92 
       
    93 void CPeninputPluginKr::ConstructL()
       
    94     {
       
    95     /*
       
    96     LOG("FEP.IMEPLG.KR.ConstructL");
       
    97     FindUiLayoutImplementationL();
       
    98     */
       
    99     FindUiLayoutImplementationL();
       
   100     //Append NULL to save HWR manager position
       
   101     iAllUiManagers.Append(NULL);
       
   102     //Append NULL to save VKB manager position
       
   103     iAllUiManagers.Append(NULL);
       
   104     //Append NULL to save ITUT manager position
       
   105     iAllUiManagers.Append(NULL);
       
   106     //Append NULL to save Mini ITUT manager position
       
   107     iAllUiManagers.Append(NULL);
       
   108     //Append NULL to save FSQ manager position
       
   109     iAllUiManagers.Append(NULL);
       
   110     
       
   111     TFileName resourceName(KPeninputPluginKrResourceFileName);
       
   112     CCoeEnv* coeEnv = CCoeEnv::Static();
       
   113     BaflUtils::NearestLanguageFile(coeEnv->FsSession(), resourceName);
       
   114     iResId = coeEnv->AddResourceFileL(resourceName);
       
   115     
       
   116     iRepository=CRepository::NewL(KCRUidPtiKoreanQwertyCore);
       
   117     
       
   118     }
       
   119 
       
   120 CPeninputPluginKr::~CPeninputPluginKr()
       
   121     {
       
   122     delete iRepository;
       
   123     CCoeEnv::Static()->DeleteResourceFile(iResId);
       
   124     DeActivate();
       
   125     iUiLayoutImpIdList.Close();
       
   126     delete iPluginKrFepManager;
       
   127     iAllUiManagers.ResetAndDestroy();
       
   128     REComSession::FinalClose();//cleanup ecom
       
   129     }
       
   130 
       
   131 // ---------------------------------------------------------------------------
       
   132 // from CAknFepPenInputImePlugin
       
   133 // ---------------------------------------------------------------------------
       
   134 //
       
   135 
       
   136 MAknFepManagerInterface* CPeninputPluginKr::GetInputMethodUiL(
       
   137         MAknFepManagerUIInterface* aFepManager,
       
   138         TLanguage aLanguage, 
       
   139         TInt aMode,
       
   140         const TDesC8& /*aData*/,
       
   141         const TBool /*aIsSplitView*/ )
       
   142     {
       
   143     iFepManager = aFepManager;
       
   144     iLanguage = aLanguage;
       
   145     CPluginKrFepManagerBase* fepmanager = NULL;
       
   146 
       
   147     TUid layoutId;
       
   148     TInt i;
       
   149 
       
   150     switch(aMode)
       
   151         {
       
   152         case EPluginInputModeVkb:
       
   153             layoutId.iUid = KVkbUiId;
       
   154             fepmanager = GetVkbUiL();
       
   155             break;
       
   156         /*   
       
   157         case EPluginInputModeItut:
       
   158             layoutId.iUid = KItutUiId;
       
   159             fepmanager = GetItutUiL();
       
   160             break;*/
       
   161             
       
   162         case EPluginInputModeFSQ:
       
   163         	{
       
   164         	/*if(iLanguage == ELangEnglish)
       
   165         		{
       
   166         		layoutId.iUid = KFsqUiEngId;
       
   167         		}
       
   168         	else*/
       
   169         		{
       
   170         		layoutId.iUid = KFsqUiId;
       
   171         		}
       
   172         	fepmanager = GetFSQUiL(aLanguage);
       
   173         	}
       
   174             break;
       
   175         default:
       
   176             return NULL;
       
   177         }
       
   178     
       
   179     for(i = 0; i < iUiLayoutImpIdList.Count(); ++i)
       
   180         {
       
   181         if(iUiLayoutImpIdList[i] == layoutId.iUid )
       
   182             {
       
   183             break;
       
   184             }
       
   185         }
       
   186 
       
   187     if( i < iUiLayoutImpIdList.Count() )
       
   188         {
       
   189         iPenInputMode = aMode;
       
   190         TInt errCode = iPeninputServer.SetUiLayoutId(layoutId);
       
   191         if( errCode == KErrNone )
       
   192             {
       
   193             fepmanager->OnInit();
       
   194             return fepmanager;
       
   195             }
       
   196         }
       
   197         
       
   198     return NULL;
       
   199     }
       
   200 
       
   201 MAknFepManagerInterface* CPeninputPluginKr::GetInputMethodUiL(
       
   202         MAknFepManagerUIInterface* /*aFepManager*/,
       
   203         TInt /*aLayoutId*/,
       
   204         const TDesC8& /*aData*/)
       
   205     {
       
   206     LOG("FEP.IMEPLG.KR.GetInputMethodUiL");
       
   207     MAknFepManagerInterface* ret(NULL);
       
   208     return ret;    
       
   209     }
       
   210 
       
   211 void CPeninputPluginKr::Activate()
       
   212     {
       
   213     LOG("FEP.IMEPLG.KR.Activate");
       
   214     iPeninputServer.ActivateLayout(ETrue);        
       
   215     }
       
   216 
       
   217 void CPeninputPluginKr::DeActivate()
       
   218     {
       
   219     LOG("FEP.IMEPLG.KR.DeActivate");
       
   220     if (&iPeninputServer && iPeninputServer.IsVisible())        
       
   221         {
       
   222         iPeninputServer.ActivateLayout(EFalse);
       
   223         }
       
   224     }
       
   225 
       
   226 TInt CPeninputPluginKr::ImeImplId()
       
   227     {
       
   228     LOG("FEP.IMEPLG.KR.ImeImplId");
       
   229     return KAknFepImePluginImplementationId;
       
   230     }
       
   231 
       
   232 TInt CPeninputPluginKr::LayoutUiImplId()
       
   233     {
       
   234     LOG("FEP.IMEPLG.KR.LayoutUiImplId");
       
   235     TInt id;
       
   236     switch ( iPenInputMode )
       
   237         {
       
   238         case EPluginInputModeVkb:
       
   239             {
       
   240             id = KVkbUiId;
       
   241             }
       
   242             break;
       
   243         case EPluginInputModeFSQ:
       
   244             {
       
   245             id = KFsqUiId;
       
   246             }
       
   247             break;
       
   248         case EPluginInputModeItut:
       
   249         	{
       
   250         	id = KItutUiId;
       
   251         	}
       
   252         default:
       
   253             {
       
   254             id = KInvalidImplId;
       
   255             }
       
   256             break;
       
   257         }
       
   258     return id;
       
   259     }
       
   260 
       
   261 TBool CPeninputPluginKr::HandleServerEventL(
       
   262         TInt aEventId, 
       
   263         const TDesC& aData)
       
   264     {
       
   265     LOG1("FEP.IMEPLG.KR.HandleServerEventL %d",aEventId);
       
   266     TBool bHandled = EFalse;
       
   267     switch ( aEventId )
       
   268         {
       
   269         case ESignalLayoutICFLengthChanged:
       
   270             {
       
   271             GetCurrentUi()->RetrieveEditorMaxLength();
       
   272             }
       
   273             break;
       
   274         case ESignalCaseMode:
       
   275             {
       
   276             TInt data = *(TInt*)( aData.Ptr() );
       
   277             if (data>=ECaseInvalide)
       
   278                 {
       
   279                 GetCurrentUi()->UpdateCaseMode( data );                 
       
   280                 }
       
   281             }
       
   282             break;
       
   283         default:
       
   284             break;
       
   285         }
       
   286         
       
   287     return bHandled;
       
   288     }
       
   289 
       
   290 TInt CPeninputPluginKr::SupportModes(
       
   291         CPtiEngine* aPtiEngine, 
       
   292         RArray<TImePlguinImplDetail>& aSupportList) const
       
   293     {
       
   294     LOG("FEP.IMEPLG.KR.SupportModes");
       
   295     TRAPD( ret, SupportModesL( aPtiEngine, aSupportList ) );
       
   296     return ret;
       
   297     }
       
   298 
       
   299 TInt CPeninputPluginKr::CurrentMode() const
       
   300     {
       
   301     LOG("FEP.IMEPLG.KR.CurrentMode");
       
   302     return iPenInputMode;
       
   303     }
       
   304 
       
   305 TBool CPeninputPluginKr::HandleMenuCommandL(TInt aCommandId)
       
   306     {
       
   307     LOG("FEP.IMEPLG.KR.HandleMenuCommandL");
       
   308     TInt ret(EFalse);
       
   309     if (aCommandId==EPeninputPluginKrDoubleConsonentCmd)
       
   310         {
       
   311         iRepository->Set(EDblConsonentOnSetting,1);
       
   312         TRAP_IGNORE(ShowListQueryL(R_AKNEXQUERY_MULTI_SELECTION_LIST_QUERY));
       
   313         iRepository->Set(EDblConsonentOnSetting,0);
       
   314         ret=ETrue;
       
   315         }
       
   316     return ret;
       
   317     }
       
   318 
       
   319 void CPeninputPluginKr::DynInitMenuPaneL(
       
   320         CAknFepUiInterfaceMenuPane* aMenuPane)
       
   321     {
       
   322     LOG("FEP.IMEPLG.KR.DynInitMenuPaneL");
       
   323     TInt index;
       
   324     /*
       
   325     if ((iPenInputMode == EPluginInputModeVkb ||
       
   326         iPenInputMode == EPluginInputModeFSQ) &&
       
   327         aMenuPane->MenuItemExists(EPenInputCmdSetting, index))
       
   328         {
       
   329         aMenuPane->SetItemDimmed(EPenInputCmdSetting, EFalse);   
       
   330         }
       
   331     aMenuPane->SetItemDimmed(EPenInputCmdHwrTraining, ETrue);
       
   332     */           
       
   333     if (
       
   334         ( iLanguage == ELangKorean ) &&
       
   335         (iPenInputMode == EPluginInputModeVkb ||
       
   336         iPenInputMode == EPluginInputModeFSQ))
       
   337         {
       
   338         aMenuPane->MenuItemExists(EFepInputCmdHelp, index);
       
   339         if (index!=KErrNotFound)
       
   340             {
       
   341             TBuf<255> menuStr;
       
   342             StringLoader::Load(menuStr, R_PENINPUT_PLUGIN_KR_DOUBLECONSONENT_SETTING);
       
   343             CAknFepUiInterfaceMenuPane::SItemData data;
       
   344             data.iCommandId=EPeninputPluginKrDoubleConsonentCmd;
       
   345             data.iCascadeId=0;
       
   346             data.iFlags=0;
       
   347             data.iText=menuStr.Mid(1, menuStr.Length() - 1);
       
   348             aMenuPane->InsertMenuItemL(data,index);
       
   349             }
       
   350         }
       
   351     }
       
   352 
       
   353 // ---------------------------------------------------------------------------
       
   354 // Internal Utilities
       
   355 // ---------------------------------------------------------------------------
       
   356 //
       
   357 
       
   358 void CPeninputPluginKr::FindUiLayoutImplementationL()
       
   359     {
       
   360     RImplInfoPtrArray infoArray;
       
   361     TUid id;
       
   362     id.iUid = KHwrLayoutInterfaceId;
       
   363     
       
   364     iUiLayoutImpIdList.Reset();
       
   365     CleanupStack::PushL( TCleanupItem( Cleanup, &infoArray ) );
       
   366     REComSession::ListImplementationsL(id, infoArray);
       
   367 
       
   368     LOG1("FEP.IMEPLG.KR.FindUiLayoutImplementationL %d",infoArray.Count());
       
   369     for (TInt i = 0; i < infoArray.Count(); ++i)
       
   370         {
       
   371         LOG1("FEP.IMEPLG.KR.  0x%08X",infoArray[i]->ImplementationUid().iUid);
       
   372 #ifdef _DEBUG
       
   373         TPtrC ptr(infoArray[i]->DisplayName());
       
   374         LOG1("FEP.IMEPLG.KR.  %S",&ptr);
       
   375 #endif
       
   376         iUiLayoutImpIdList.AppendL(infoArray[i]->ImplementationUid().iUid);
       
   377         
       
   378         }
       
   379 
       
   380     CleanupStack::PopAndDestroy(&infoArray); // infoArray    
       
   381     }
       
   382 
       
   383 CPluginKrFepManagerBase* CPeninputPluginKr::GetPluginUiL( TInt /*aMode*/ )
       
   384     {
       
   385     return NULL;
       
   386     }
       
   387 
       
   388 TInt CPeninputPluginKr::SupportModesL(
       
   389         CPtiEngine* /*aPtiEngine*/,
       
   390         RArray<TImePlguinImplDetail>& aSupportList) const
       
   391     {
       
   392     RImplInfoPtrArray infoArray;
       
   393     TUid id;
       
   394     id.iUid = KHwrLayoutInterfaceId;
       
   395     //TBool hwr = EFalse;
       
   396     TBool vkb = EFalse;
       
   397     TBool itut = EFalse;
       
   398     //TBool miniitut = EFalse;
       
   399     TBool fsq = EFalse;
       
   400     //TBool fsqEng = EFalse;
       
   401 
       
   402     CleanupStack::PushL( TCleanupItem( Cleanup, &infoArray ) );
       
   403     REComSession::ListImplementationsL(id, infoArray);
       
   404 
       
   405     for (TInt i = 0; i < infoArray.Count(); ++i)
       
   406         {
       
   407         if(infoArray[i]->ImplementationUid().iUid == KVkbUiId )
       
   408             {
       
   409             vkb = ETrue;
       
   410             }
       
   411         /*    
       
   412         if(infoArray[i]->ImplementationUid().iUid == KItutUiId )
       
   413             {
       
   414             itut = ETrue;
       
   415             }*/
       
   416         if(infoArray[i]->ImplementationUid().iUid == KFsqUiId )
       
   417             {
       
   418             fsq = ETrue;
       
   419             }
       
   420         /*if(infoArray[i]->ImplementationUid().iUid == KFsqUiEngId )
       
   421             {
       
   422             fsqEng = ETrue;
       
   423             }*/
       
   424         }
       
   425 
       
   426     TImePlguinImplDetail detail;
       
   427 
       
   428     detail.iImplementationId = KAknFepImePluginImplementationId;
       
   429 
       
   430     if( vkb )
       
   431         {
       
   432         detail.iMode = EPluginInputModeVkb;
       
   433         detail.iMeritValue = EImeMerit_Preferred;
       
   434         detail.iDisplayName.Copy(KVkbImeName());
       
   435         detail.iLanguage = ELangKorean;
       
   436         aSupportList.Append(detail);
       
   437         }
       
   438 
       
   439     if( itut )
       
   440         {
       
   441         detail.iMode = EPluginInputModeItut;
       
   442         detail.iMeritValue = EImeMerit_Preferred;
       
   443         detail.iDisplayName.Copy(KItutImeName());
       
   444         detail.iLanguage = ELangKorean;
       
   445         aSupportList.Append(detail);
       
   446         }
       
   447 
       
   448     if( fsq )
       
   449         {
       
   450         detail.iMode = EPluginInputModeFSQ;
       
   451         detail.iMeritValue = EImeMerit_Preferred;
       
   452         detail.iDisplayName.Copy(KFsqImeName());
       
   453         detail.iLanguage = ELangKorean;
       
   454         aSupportList.Append(detail);
       
   455         }
       
   456      /*if( fsqEng )
       
   457         {
       
   458         detail.iMode = EPluginInputModeFSQ;
       
   459         detail.iMeritValue = EImeMerit_Preferred;
       
   460         detail.iDisplayName.Copy(KFsqImeNameEng());
       
   461         detail.iLanguage = ELangEnglish;
       
   462         aSupportList.Append(detail);
       
   463         }*/
       
   464 
       
   465     CleanupStack::PopAndDestroy(&infoArray); // infoArray
       
   466 
       
   467     return 0;
       
   468     }
       
   469 
       
   470 inline CPluginKrFepManagerBase* CPeninputPluginKr::GetCurrentUi()
       
   471     {
       
   472     switch ( iPenInputMode )
       
   473         {
       
   474         case EPluginInputModeVkb:
       
   475             return iAllUiManagers[KVkbUiIndex];
       
   476         case EPluginInputModeItut:
       
   477             return iAllUiManagers[KItutUiIndex];
       
   478         case EPluginInputModeFSQ:
       
   479         	{
       
   480         	/*if(iLanguage == ELangEnglish)
       
   481         		{
       
   482 				return iAllUiManagers[KFSQUiEngIndex];
       
   483         		}
       
   484         	else*/
       
   485         		{
       
   486         		return iAllUiManagers[KFSQUiIndex];	
       
   487         		}
       
   488         	}
       
   489         default:
       
   490             return NULL;
       
   491         }
       
   492     }
       
   493 
       
   494 
       
   495 // -----------------------------------------------------------------------------
       
   496 // CPeninputPluginKr::GetVkbUi
       
   497 // Get VKB UI interface.
       
   498 // (other items were commented in a header).
       
   499 // -----------------------------------------------------------------------------
       
   500 //
       
   501 CPluginKrFepManagerBase* CPeninputPluginKr::GetVkbUiL()
       
   502     {
       
   503     if( !iAllUiManagers[KVkbUiIndex] )
       
   504         {
       
   505         iAllUiManagers[KVkbUiIndex] = CPluginKrFepManagerVkb::NewL(*this, iPeninputServer);
       
   506         }
       
   507 
       
   508     return iAllUiManagers[KVkbUiIndex];
       
   509     }
       
   510 
       
   511 // -----------------------------------------------------------------------------
       
   512 // CPeninputPluginKr::GetItutUi
       
   513 // Get Itut UI interface.
       
   514 // (other items were commented in a header).
       
   515 // -----------------------------------------------------------------------------
       
   516 //
       
   517 CPluginKrFepManagerBase* CPeninputPluginKr::GetItutUiL()
       
   518     {
       
   519     if( iAllUiManagers[KItutUiIndex] == NULL )
       
   520         {
       
   521         iAllUiManagers[KItutUiIndex] = CPluginKrFepManagerItut::NewL(*this, iPeninputServer);
       
   522         }
       
   523 
       
   524     return iAllUiManagers[KItutUiIndex];
       
   525     }
       
   526 
       
   527 // -----------------------------------------------------------------------------
       
   528 // CPeninputPluginKr::GetFSQUi
       
   529 // Get FSQ UI interface.
       
   530 // (other items were commented in a header).
       
   531 // -----------------------------------------------------------------------------
       
   532 //
       
   533 CPluginKrFepManagerBase* CPeninputPluginKr::GetFSQUiL(TInt aLang)
       
   534     {
       
   535     if( iAllUiManagers[KFSQUiIndex] == NULL )
       
   536         {
       
   537         iAllUiManagers[KFSQUiIndex] = CPluginKrFepManagerVkb::NewL(*this, iPeninputServer);
       
   538         }
       
   539         
       
   540    /* if( iAllUiManagers[KFSQUiEngIndex] == NULL )
       
   541         {
       
   542         iAllUiManagers[KFSQUiEngIndex] = CPluginKrFepManagerVkb::NewL(*this, iPeninputServer);
       
   543         }*/
       
   544 	
       
   545 	/*if (aLang == ELangEnglish)
       
   546 		{
       
   547 		return iAllUiManagers[KFSQUiEngIndex];
       
   548 		}
       
   549 	else*/
       
   550 		{
       
   551 		return iAllUiManagers[KFSQUiIndex];
       
   552 		}
       
   553     }
       
   554 
       
   555 void CPeninputPluginKr::ShowListQueryL(const TInt aResourceId)
       
   556     {
       
   557     CArrayFixFlat<TInt>* arraySelected=
       
   558         new (ELeave) CArrayFixFlat<TInt>(7);
       
   559     CleanupStack::PushL(arraySelected);
       
   560     CAknListQueryDialog* dlg=
       
   561         new (ELeave) CAknListQueryDialog(arraySelected);
       
   562     dlg->PrepareLC(aResourceId);
       
   563     
       
   564     TInt set;
       
   565     if (iRepository->Get(EDblConsonentSsangKiyeok,set)==KErrNone)
       
   566         {
       
   567         if (set) arraySelected->AppendL(0);
       
   568         }
       
   569     if (iRepository->Get(EDblConsonentSsangTikeut,set)==KErrNone)
       
   570         {
       
   571         if (set) arraySelected->AppendL(1);
       
   572         }
       
   573     if (iRepository->Get(EDblConsonentSsangPieup,set)==KErrNone)
       
   574         {
       
   575         if (set) arraySelected->AppendL(2);
       
   576         }
       
   577     if (iRepository->Get(EDblConsonentSsangSios,set)==KErrNone)
       
   578         {
       
   579         if (set) arraySelected->AppendL(3);
       
   580         }
       
   581     if (iRepository->Get(EDblConsonentSsangCieuc,set)==KErrNone)
       
   582         {
       
   583         if (set) arraySelected->AppendL(4);
       
   584         }
       
   585     if (iRepository->Get(EDblConsonentYaPlusI,set)==KErrNone)
       
   586         {
       
   587         if (set) arraySelected->AppendL(5);
       
   588         }
       
   589     if (iRepository->Get(EDblConsonentYuPlusI,set)==KErrNone)
       
   590         {
       
   591         if (set) arraySelected->AppendL(6);
       
   592         }
       
   593     dlg->ListBox()->SetSelectionIndexesL(arraySelected);
       
   594     
       
   595     if (dlg->RunLD())
       
   596         {
       
   597         iRepository->Set(EDblConsonentSsangKiyeok,0);
       
   598         iRepository->Set(EDblConsonentSsangTikeut,0);
       
   599         iRepository->Set(EDblConsonentSsangPieup,0);
       
   600         iRepository->Set(EDblConsonentSsangSios,0);
       
   601         iRepository->Set(EDblConsonentSsangCieuc,0);
       
   602         iRepository->Set(EDblConsonentYaPlusI,0);
       
   603         iRepository->Set(EDblConsonentYuPlusI,0);
       
   604 
       
   605         for (TInt i=0;i<arraySelected->Count();i++)
       
   606             {
       
   607             switch (arraySelected->At(i))
       
   608                 {
       
   609                 case 0:
       
   610                     iRepository->Set(EDblConsonentSsangKiyeok,1);
       
   611                     break;
       
   612                 case 1:
       
   613                     iRepository->Set(EDblConsonentSsangTikeut,1);
       
   614                     break;
       
   615                 case 2:
       
   616                     iRepository->Set(EDblConsonentSsangPieup,1);
       
   617                     break;
       
   618                 case 3:
       
   619                     iRepository->Set(EDblConsonentSsangSios,1);
       
   620                     break;
       
   621                 case 4:
       
   622                     iRepository->Set(EDblConsonentSsangCieuc,1);
       
   623                     break;
       
   624                 case 5:
       
   625                     iRepository->Set(EDblConsonentYaPlusI,1);
       
   626                     break;
       
   627                 case 6:
       
   628                     iRepository->Set(EDblConsonentYuPlusI,1);
       
   629                     break;
       
   630                 default:
       
   631                     break;
       
   632                 }
       
   633             }
       
   634         }
       
   635     CleanupStack::PopAndDestroy(arraySelected);
       
   636     }
       
   637 
       
   638 //End Of File