fep/aknfep/src/AknFepSharedDataInterface.cpp
branchRCL_3
changeset 21 ecbabf52600f
equal deleted inserted replaced
20:ebd48d2de13c 21:ecbabf52600f
       
     1 /*
       
     2 * Copyright (c) 2002-2004 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 *       CAknFepSharedDataInterface class
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 
       
    22 
       
    23 
       
    24 
       
    25 
       
    26 
       
    27 
       
    28 
       
    29 
       
    30 #include <w32std.h>
       
    31 #include <eikdef.h>
       
    32 #include <eikenv.h>
       
    33 #include <AknUtils.h>
       
    34 
       
    35 #include "AknFepSharedDataInterface.h"
       
    36 #include "AknFepManager.h"
       
    37 
       
    38 #include <centralrepository.h>
       
    39 #include <AknFepInternalCRKeys.h>
       
    40 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
    41 #include <AknFepInternalPSKeys.h>
       
    42 #include <AknFepGlobalEnums.h>
       
    43 #include <PtiDefs.h>
       
    44 #endif
       
    45 #include <AvkonInternalCRKeys.h>    // KAknQwertyInputModeActive
       
    46 #include <settingsinternalcrkeys.h> //Pen related settings
       
    47 #include <sensorplugindomaincrkeys.h> // KCRUidSensorSettings
       
    48 #include <featmgr.h>                  // Feature Manager
       
    49 
       
    50 // TODO: include CommonengineInternalCRKeys.h
       
    51 const TUid KCRUidCommonEngineKeys = {0x1020503B};
       
    52 const TUint32 KGSDisplayTxtLang = 0x00000001;
       
    53 
       
    54 const TInt KJapHwrConversion = 0x0010;
       
    55 
       
    56 #include <AknDef.h>
       
    57 
       
    58 CAknFepSharedDataInterface* CAknFepSharedDataInterface::NewL(CAknFepManager* aFepManager)
       
    59     {
       
    60     CAknFepSharedDataInterface* self = new (ELeave) CAknFepSharedDataInterface(aFepManager);
       
    61     CleanupStack::PushL(self);
       
    62     self->ConstructL();
       
    63     CleanupStack::Pop(); //self
       
    64     return self;
       
    65     }
       
    66 
       
    67 
       
    68 CAknFepSharedDataInterface::~CAknFepSharedDataInterface()
       
    69     {
       
    70     delete iCommonEngineRepository;
       
    71     delete iAknFepRepositoryWatcher;
       
    72     delete iAknFepLocaleRepositoryWatcher;
       
    73     delete iAknFepRepository;
       
    74     delete iGsPenSettings;
       
    75     delete iLocaleRepository;
       
    76     delete iSensorRepository;
       
    77     delete iThemeEffectsRepository;
       
    78 
       
    79     if (iQwertyModeStatusSubscriber)
       
    80         {
       
    81         iQwertyModeStatusSubscriber->StopSubscribe();
       
    82         }
       
    83 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
    84     if (iKeyboardLayoutStatusSubscriber)
       
    85         {
       
    86         iKeyboardLayoutStatusSubscriber->StopSubscribe();
       
    87         }
       
    88     iKeyboardLayoutStatusProperty.Close();
       
    89     delete iKeyboardLayoutStatusSubscriber;
       
    90     
       
    91 #ifdef RD_SCALABLE_UI_V2 
       
    92     if ( iVirtualKeyboardLayoutStatusSubscriber )
       
    93         {
       
    94         iVirtualKeyboardLayoutStatusSubscriber->StopSubscribe();
       
    95         }
       
    96     delete iVirtualKeyboardLayoutStatusSubscriber;
       
    97     iVirtualKeyboardLayoutStatusProperty.Close();
       
    98 #endif
       
    99 #endif
       
   100     iQwertyModeStatusProperty.Close();
       
   101     delete iQwertyModeStatusSubscriber;
       
   102     }
       
   103 
       
   104 
       
   105 TInt CAknFepSharedDataInterface::PredictiveTextOn()
       
   106     {
       
   107     TInt value = 0;
       
   108     if (iAknFepRepository)
       
   109         {
       
   110 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   111         TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout();
       
   112         TInt temp = 0;
       
   113         iAknFepRepository->Get(KAknFepPredTxtFlagExtension, temp);
       
   114         switch(layout)
       
   115             {
       
   116             case EPtiKeyboardNone:
       
   117                 break;
       
   118           	case EPtiKeyboard12Key:
       
   119                 temp &= EKeyboardStyle12Key;
       
   120                 break;
       
   121             case EPtiKeyboardHalfQwerty:
       
   122                 temp &= EKeyboardStyleHalfQwerty;
       
   123                 break;                
       
   124           	case EPtiKeyboardQwerty4x12:
       
   125           	case EPtiKeyboardQwerty4x10:
       
   126           	case EPtiKeyboardQwerty3x11:          	
       
   127           	case EPtiKeyboardCustomQwerty:
       
   128                 temp &= EKeyboardStyleQwerty;
       
   129                 break;
       
   130           	default:
       
   131           	    break;
       
   132             }
       
   133         value = ( temp ? 1 : 0);
       
   134 #else
       
   135         iAknFepRepository->Get(KAknFepPredTxtFlag, value);
       
   136 #endif
       
   137         }
       
   138     return value;
       
   139     }
       
   140 
       
   141 TInt CAknFepSharedDataInterface::PredictiveTextJapaneseOn()
       
   142     {
       
   143     TInt value = 0;
       
   144     if (iAknFepRepository)
       
   145         {
       
   146         iAknFepRepository->Get(KAknFepJapanesePredTxtFlag, value);
       
   147         }
       
   148     return value;
       
   149     }
       
   150 
       
   151 TInt CAknFepSharedDataInterface::InputMode()
       
   152     {
       
   153     TUint value = 0;
       
   154     if (iAknFepRepository)
       
   155         {
       
   156    		/* Teleca change begin, 03.07.2008 ssal 
       
   157    			original code:
       
   158 		TPtrC filteredPtr(0,0);
       
   159 		iAknFepRepository->Get(KAknFepChineseInputMode, value);*/
       
   160 		_LIT(Kx, "x");
       
   161 		// This conversion is needed because KAknFepChineseInputMode cenrep key original type was 16bit int.
       
   162 		// now type is changed to string, so that it can accommodate bigger values like EHangul 0x16000. 
       
   163 		TBuf<CAknFepManager::EMaximumFepWordLength> conversion;
       
   164         iAknFepRepository->Get(KAknFepChineseInputMode, conversion);
       
   165        
       
   166        	TInt len = conversion.Find(Kx);
       
   167        	TLex lex;
       
   168        	
       
   169        	if(len)
       
   170        		{
       
   171        		TPtrC ptr = conversion.Mid(len +1);
       
   172        		lex.Assign(ptr);
       
   173        		}
       
   174 		else
       
   175 			{
       
   176 			lex.Assign(conversion);
       
   177 			}
       
   178 		
       
   179 		lex.Val(value, EHex);
       
   180 		/* Teleca change end, 04.06.2008 ssal */
       
   181         }
       
   182     return value;
       
   183     }
       
   184 
       
   185 void CAknFepSharedDataInterface::SetInputMode(TInt aInputMode)
       
   186     {
       
   187     if (iAknFepRepository)
       
   188         {
       
   189         /* Teleca change begin, 03.07.2008 ssal 
       
   190 			original code:
       
   191         iAknFepRepository->Set(KAknFepChineseInputMode, aInputMode);*/
       
   192         
       
   193         // Please see the explanation on CAknFepSharedDataInterface::InputMode() method
       
   194 		TBuf<CAknFepManager::EMaximumFepWordLength> conversion;
       
   195 		conversion.Num(aInputMode, EHex);
       
   196 		
       
   197         iAknFepRepository->Set(KAknFepChineseInputMode, conversion);
       
   198       	/* Teleca change end, 04.06.2008 ssal */
       
   199         }
       
   200     }
       
   201 
       
   202 TInt CAknFepSharedDataInterface::CangJieMode()
       
   203     {
       
   204     TInt value = 0;
       
   205     if (iAknFepRepository)
       
   206         {
       
   207         iAknFepRepository->Get(KAknFepCangJieMode, value);
       
   208         }
       
   209     return value;
       
   210     }
       
   211     
       
   212 void CAknFepSharedDataInterface::SetCangJieMode(TInt aNewCangJieMode)
       
   213     {
       
   214     if (iAknFepRepository)
       
   215         {
       
   216         iAknFepRepository->Set(KAknFepCangJieMode, aNewCangJieMode);
       
   217         }
       
   218     }
       
   219 
       
   220 TInt CAknFepSharedDataInterface::InputTextLanguage()
       
   221     {
       
   222     TInt value = 0;
       
   223     if (iAknFepRepository)
       
   224         {
       
   225         iAknFepRepository->Get(KAknFepInputTxtLang, value);
       
   226         }
       
   227     return TLanguage(value);
       
   228     }
       
   229 
       
   230 void CAknFepSharedDataInterface::SetInputTextLanguage(TInt aValue)
       
   231     {
       
   232     if (iAknFepRepository)
       
   233         {
       
   234         iAknFepRepository->Set(KAknFepInputTxtLang, aValue);
       
   235         }
       
   236 
       
   237     // now inform all open apps of the switch
       
   238     TWsEvent event;
       
   239     event.SetType(KEikInputLanguageChange);
       
   240     CEikonEnv::Static()->WsSession().SendEventToAllWindowGroups(event);
       
   241     }
       
   242 
       
   243 TInt CAknFepSharedDataInterface::DisplayLanguage()
       
   244     {
       
   245     TInt value = 0;
       
   246     if (iCommonEngineRepository)
       
   247         {
       
   248         iCommonEngineRepository->Get(KGSDisplayTxtLang, value);
       
   249         }
       
   250     return TLanguage(value);
       
   251     }
       
   252 
       
   253 void CAknFepSharedDataInterface::SetPredictiveTextOn()
       
   254     {
       
   255     if (iAknFepRepository)
       
   256         {
       
   257 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   258         TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout();
       
   259         TInt value = 0;
       
   260         iAknFepRepository->Get(KAknFepPredTxtFlagExtension, value);
       
   261         switch(layout)
       
   262             {
       
   263             case EPtiKeyboardNone:
       
   264                 // No keyboard active, so don't change anything
       
   265                 break;
       
   266           	case EPtiKeyboard12Key:
       
   267                 value |= EKeyboardStyle12Key;
       
   268                 break;
       
   269             case EPtiKeyboardHalfQwerty:    
       
   270                 value |= EKeyboardStyleHalfQwerty;
       
   271                 break;             
       
   272           	case EPtiKeyboardQwerty4x12:
       
   273           	case EPtiKeyboardQwerty4x10:
       
   274           	case EPtiKeyboardQwerty3x11:
       
   275           	case EPtiKeyboardCustomQwerty:
       
   276                 value |= EKeyboardStyleQwerty;
       
   277                 break;
       
   278           	default:
       
   279           	    break;
       
   280             }
       
   281         iAknFepRepository->Set(KAknFepPredTxtFlagExtension, value);
       
   282         // For backwards compatibility
       
   283         if (value & EKeyboardStyle12Key)
       
   284             {
       
   285             iAknFepRepository->Set(KAknFepPredTxtFlag, 1);
       
   286             }
       
   287 #else
       
   288         iAknFepRepository->Set(KAknFepPredTxtFlag, 1);
       
   289 #endif
       
   290         }
       
   291     }
       
   292 
       
   293 
       
   294 void CAknFepSharedDataInterface::ResetPredictiveTextOn()
       
   295     {
       
   296     if (iAknFepRepository)
       
   297         {
       
   298 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   299         TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout();
       
   300         TInt value = 0;
       
   301         iAknFepRepository->Get(KAknFepPredTxtFlagExtension, value);
       
   302         switch(layout)
       
   303             {
       
   304             case EPtiKeyboardNone:
       
   305                 // No keyboard active, so don't change anything
       
   306                 break;
       
   307           	case EPtiKeyboard12Key:
       
   308                 value &= ~EKeyboardStyle12Key;
       
   309                 break;
       
   310           	case EPtiKeyboardHalfQwerty:
       
   311                 value &= ~EKeyboardStyleHalfQwerty;
       
   312                 break;
       
   313           	case EPtiKeyboardQwerty4x12:
       
   314           	case EPtiKeyboardQwerty4x10:
       
   315           	case EPtiKeyboardQwerty3x11:
       
   316           	case EPtiKeyboardCustomQwerty:
       
   317                 value &= ~EKeyboardStyleQwerty;
       
   318                 break;
       
   319           	default:
       
   320           	    break;
       
   321             }
       
   322         iAknFepRepository->Set(KAknFepPredTxtFlagExtension, value);
       
   323         // For backwards compatibility
       
   324         if (!(value & EKeyboardStyle12Key))
       
   325             {
       
   326             iAknFepRepository->Set(KAknFepPredTxtFlag, 0);
       
   327             }
       
   328 #else
       
   329         iAknFepRepository->Set(KAknFepPredTxtFlag, 0);
       
   330 #endif
       
   331         }
       
   332     }
       
   333 
       
   334 void CAknFepSharedDataInterface::SetJapanesePredictiveTextOn()
       
   335     {
       
   336     if (iAknFepRepository)
       
   337         {
       
   338         iAknFepRepository->Set(KAknFepJapanesePredTxtFlag, 1);
       
   339         }
       
   340     }
       
   341 
       
   342 
       
   343 void CAknFepSharedDataInterface::ResetJapanesePredictiveTextOn()
       
   344     {
       
   345     if (iAknFepRepository)
       
   346         {
       
   347         iAknFepRepository->Set(KAknFepJapanesePredTxtFlag, 0);
       
   348         }
       
   349     }
       
   350 
       
   351 TInt CAknFepSharedDataInterface::PluginInputMode() const
       
   352     {
       
   353     TInt value = 0;
       
   354     if (iAknFepRepository)
       
   355         {
       
   356         iAknFepRepository->Get(KAknFepLastUsedInput, value);
       
   357         }
       
   358     return value;
       
   359     }
       
   360 
       
   361 void CAknFepSharedDataInterface::SetPluginInputMode(TInt aDevice)
       
   362     {
       
   363     // Check validity of the input mode to be set.
       
   364     if ( aDevice == EPluginInputModeItut )
       
   365         {
       
   366         __ASSERT_DEBUG( FeatureManager::FeatureSupported( 
       
   367             KFeatureIdVirtualItutInput ), 
       
   368             User::Panic( _L( "Wrong input mode - ITU-T" ), __LINE__ ) );
       
   369         }
       
   370     else if ( aDevice == EPluginInputModeFSQ )
       
   371         {
       
   372         __ASSERT_DEBUG(  FeatureManager::FeatureSupported( 
       
   373             KFeatureIdVirtualFullscrQwertyInput ), 
       
   374             User::Panic( _L( "Wrong input mode - Landscape FSQ" ), 
       
   375                 __LINE__ ) );
       
   376         }
       
   377     else if ( aDevice == EPluginInputModePortraitFSQ )
       
   378         {
       
   379         __ASSERT_DEBUG( FeatureManager::FeatureSupported( 
       
   380             KFeatureIdFfVirtualFullscrPortraitQwertyInput ), 
       
   381             User::Panic( _L( "Wrong input mode - Portrait FSQ" ), 
       
   382                 __LINE__ ) );
       
   383         }
       
   384     else
       
   385         {
       
   386         // Do nothing.
       
   387         }
       
   388 
       
   389     if (iAknFepRepository)
       
   390         {
       
   391         iAknFepRepository->Set(KAknFepLastUsedInput, aDevice);
       
   392         }
       
   393     }
       
   394 
       
   395 TInt CAknFepSharedDataInterface::PluginUILanguage() const
       
   396     {
       
   397     TInt value = 0;
       
   398     if (iAknFepRepository)
       
   399         {
       
   400         //iAknFepRepository->Create(KAknFepLastUsedUILanguage, 0); //??
       
   401         iAknFepRepository->Get(KAknFepLastUsedUILanguage, value);
       
   402         }
       
   403     return value;
       
   404     }
       
   405 
       
   406 void CAknFepSharedDataInterface::SetPluginUILanguage(TInt aLanguage)
       
   407     {
       
   408     if (iAknFepRepository)
       
   409         {
       
   410         iAknFepRepository->Set(KAknFepLastUsedUILanguage, aLanguage);
       
   411         }
       
   412     }
       
   413 
       
   414 void CAknFepSharedDataInterface::SetDefaultNumberMode( TInt aMode, TInt aValue )
       
   415     {
       
   416     if (iLocaleRepository)
       
   417         {
       
   418         iLocaleRepository->Set(aMode, aValue);
       
   419         }
       
   420     }
       
   421 
       
   422 
       
   423 TInt CAknFepSharedDataInterface::PenInputLanguage() const
       
   424     {
       
   425     TInt value = 0;
       
   426     if (iAknFepRepository)
       
   427         {
       
   428         iAknFepRepository->Get(KAknFepInputTxtLang, value);
       
   429         }
       
   430     return value;
       
   431     }
       
   432 
       
   433 TInt CAknFepSharedDataInterface::ScrollLatinPredictiveCandidates() const
       
   434     {
       
   435     return iSharedDataScrollLatinPredictive;
       
   436     }
       
   437 
       
   438 TInt CAknFepSharedDataInterface::SpaceWithScrollRight() const
       
   439     {
       
   440     return iSharedDataSpaceWithScrollRight;
       
   441     }
       
   442 
       
   443 TInt CAknFepSharedDataInterface::EntersWithScrollDown() const
       
   444     {
       
   445     return iSharedDataEnterWithScrollDown;
       
   446     }
       
   447 
       
   448 TInt CAknFepSharedDataInterface::QwertyInputMode() //const
       
   449     {
       
   450     TInt value = 0;
       
   451     iQwertyModeStatusProperty.Get(value);
       
   452     return value;
       
   453     }
       
   454 
       
   455 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   456 TInt CAknFepSharedDataInterface::KeyboardLayout() //const
       
   457     {
       
   458 	return ActiveKeyboardType();
       
   459     }
       
   460 
       
   461 #ifdef FF_DUAL_LANGUAGE_SUPPORT
       
   462 TInt CAknFepSharedDataInterface::InputTextLanguageSecondary()
       
   463     {
       
   464     TInt value = 0;
       
   465     if (iAknFepRepository)
       
   466         {
       
   467         iAknFepRepository->Get(KAknFepInputTxtLangSecondary, value);
       
   468         }
       
   469     return TLanguage(value);
       
   470     }
       
   471 
       
   472 void CAknFepSharedDataInterface::SetInputTextLanguageSecondary(TInt aValue)
       
   473     {
       
   474     if (iAknFepRepository)
       
   475         {
       
   476         iAknFepRepository->Set(KAknFepInputTxtLangSecondary, aValue);
       
   477         }
       
   478 
       
   479     // now inform all open apps of the switch
       
   480     // same event as primary input language change
       
   481     TWsEvent event;
       
   482     event.SetType(KEikInputLanguageChange);
       
   483     CEikonEnv::Static()->WsSession().SendEventToAllWindowGroups(event);
       
   484     }
       
   485 
       
   486 #endif //FF_DUAL_LANGUAGE_SUPPORT
       
   487 #endif
       
   488 
       
   489 CAknFepSharedDataInterface::CAknFepSharedDataInterface(CAknFepManager* aFepManager)
       
   490     {
       
   491     iFepManager = aFepManager;
       
   492     }
       
   493 
       
   494 
       
   495 void CAknFepSharedDataInterface::ConstructL()
       
   496     {
       
   497     TInt ret = KErrNone;
       
   498 
       
   499     TRAP(ret, iCommonEngineRepository = CRepository::NewL(KCRUidCommonEngineKeys));
       
   500 
       
   501     TRAP(ret, iAknFepRepository = CRepository::NewL(KCRUidAknFep));
       
   502     if (ret == KErrNone)
       
   503         {
       
   504         iAknFepRepositoryWatcher = CAknFepRepositoryWatcher::NewL(
       
   505             KCRUidAknFep,
       
   506             TCallBack(HandleRepositoryCallBack, this),
       
   507             iAknFepRepository);
       
   508         HandleHashKeySelectionChange();//we need read proactively before value changed,and we must sure the iAknFepRepository has been constructed
       
   509         }
       
   510 	
       
   511 	TRAP(ret, iLocaleRepository = CRepository::NewL( KCRUidLocaleSettings ));
       
   512 
       
   513     if (ret == KErrNone)
       
   514         {
       
   515         iAknFepLocaleRepositoryWatcher = CAknFepRepositoryWatcher::NewL(
       
   516             KCRUidLocaleSettings,
       
   517             TCallBack(HandleLocaleRepositoryCallBack, this),
       
   518             iLocaleRepository);
       
   519         }
       
   520 
       
   521     User::LeaveIfError(iQwertyModeStatusProperty.Attach(KCRUidAvkon, KAknQwertyInputModeActive));
       
   522 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   523     //Attach the P&S property to the keyboardlayout and subscribe to the P&S framework
       
   524     // for any keyboard layout change.
       
   525     User::LeaveIfError(iKeyboardLayoutStatusProperty.Attach(KCRUidAvkon, KAknKeyBoardLayout));    
       
   526     iKeyboardLayoutStatusSubscriber = new (ELeave) CSubscriber(
       
   527                                          TCallBack(HandleKeyboardLayoutChangeNotification, this), 
       
   528                                          iKeyboardLayoutStatusProperty);    
       
   529     iKeyboardLayoutStatusSubscriber->SubscribeL();
       
   530 
       
   531 #ifdef RD_SCALABLE_UI_V2 
       
   532     User::LeaveIfError( iVirtualKeyboardLayoutStatusProperty.Attach
       
   533     		                                                ( KPSUidAknFep, KAknFepVirtualKeyboardType ) );    
       
   534     iVirtualKeyboardLayoutStatusSubscriber = new (ELeave) CSubscriber(
       
   535                                          TCallBack( HandleVirtualKeyboardLayoutChangeNotification, this ), 
       
   536                                          iVirtualKeyboardLayoutStatusProperty );    
       
   537     iVirtualKeyboardLayoutStatusSubscriber->SubscribeL();
       
   538 #endif // RD_SCALABLE_UI_V2    
       
   539 #endif
       
   540     iQwertyModeStatusSubscriber = new (ELeave) CSubscriber(
       
   541     								TCallBack(QwertyModeChangeNotification, this), 
       
   542     								iQwertyModeStatusProperty);
       
   543     iQwertyModeStatusSubscriber->SubscribeL();
       
   544 
       
   545     // Read read-only shared data settings.
       
   546     if (iAknFepRepository)
       
   547         {
       
   548         iAknFepRepository->Get(KAknFepScrollLatinPredictive, iSharedDataScrollLatinPredictive);
       
   549         iAknFepRepository->Get(KAknFepSpaceWithScrollRight,  iSharedDataSpaceWithScrollRight);
       
   550         iAknFepRepository->Get(KAknFepEnterWithScrollDown,   iSharedDataEnterWithScrollDown);
       
   551         }
       
   552         
       
   553     TRAP(ret, iGsPenSettings = CRepository::NewL(KCRUidPersonalizationSettings));
       
   554     
       
   555     TRAP(ret, iSensorRepository = CRepository::NewL( KCRUidSensorSettings ) );
       
   556     
       
   557     TRAP(ret, iThemeEffectsRepository = CRepository::NewL( KCRUidThemes ));
       
   558     }
       
   559 
       
   560 TInt CAknFepSharedDataInterface::HashKeySelectionNotification(TAny* aObj)
       
   561     {
       
   562     if (aObj)
       
   563         {
       
   564         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleHashKeySelectionChange();
       
   565         return KErrNone;
       
   566         }
       
   567     else
       
   568         {
       
   569         return KErrArgument;
       
   570         }
       
   571     }
       
   572     
       
   573 void CAknFepSharedDataInterface::HandleHashKeySelectionChange()
       
   574     {
       
   575     TInt value(0);
       
   576     
       
   577     if (iAknFepRepository)
       
   578         {
       
   579         iAknFepRepository->Get(KAknFepHashKeySelection, value);
       
   580         }
       
   581     
       
   582     iHashKeySelectionInUse = value;
       
   583     }
       
   584 
       
   585 
       
   586 TInt CAknFepSharedDataInterface::InputModeChangeGSNotification(TAny* aObj)
       
   587     {
       
   588     if (aObj)
       
   589         {
       
   590         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleInputModeGSChange();
       
   591         return KErrNone;
       
   592         }
       
   593     else
       
   594         {
       
   595         return KErrArgument;
       
   596         }
       
   597     }
       
   598 
       
   599 void CAknFepSharedDataInterface::HandleInputModeGSChange()
       
   600     {
       
   601     iFepManager->SetFlag(CAknFepManager::EFlagNewSharedDataInputMode);
       
   602     }
       
   603 
       
   604 TInt CAknFepSharedDataInterface::InputTextLangGSNotification(TAny* aObj)
       
   605     {
       
   606     if (aObj)
       
   607         {
       
   608         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleInputTextLanguageGSChange();
       
   609         return KErrNone;
       
   610         }
       
   611     else
       
   612         {
       
   613         return KErrArgument;
       
   614         }
       
   615     }
       
   616 
       
   617 void CAknFepSharedDataInterface::HandleInputTextLanguageGSChange()
       
   618     {
       
   619     if( iFepManager->ActiveInputLanguage() != PenInputLanguage() )
       
   620         {
       
   621         iFepManager->SetFlag(CAknFepManager::EFlagNewSharedDataInputLanguage);
       
   622         ESubVariantFlag subVariant = AknLayoutUtils::SubVariant();
       
   623         if((AknLayoutUtils::Variant() == EApacVariant)
       
   624             && ((subVariant == EPrcSubVariant)
       
   625             || (subVariant == EHongKongSubVariant)
       
   626             || (subVariant == ETaiwanSubVariant)))
       
   627             {
       
   628             iFepManager->SetFlag(CAknFepManager::EFlagNewSharedDataInputMode);
       
   629             }
       
   630         iFepManager->SetActiveInputLanguage( PenInputLanguage() );
       
   631         }
       
   632     }
       
   633 
       
   634 
       
   635 TInt CAknFepSharedDataInterface::PredictiveTextSettingChangeGSNotification(TAny* aObj)
       
   636     {
       
   637     if (aObj)
       
   638         {
       
   639         static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextSettingGSChange();
       
   640         return KErrNone;
       
   641         }
       
   642     else
       
   643         {
       
   644         return KErrArgument;
       
   645         }
       
   646     }
       
   647 
       
   648 TInt CAknFepSharedDataInterface::JapanesePredictiveTextSettingChangeGSNotification(TAny* aObj)
       
   649     {
       
   650     if (aObj)
       
   651         {
       
   652         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleJapanesePredictiveTextSettingGSChange();
       
   653         return KErrNone;
       
   654         }
       
   655     else
       
   656         {
       
   657         return KErrArgument;
       
   658         }
       
   659     }
       
   660 
       
   661 TInt CAknFepSharedDataInterface::QwertyModeChangeNotification(TAny* aObj)
       
   662     {
       
   663     if (aObj)
       
   664         {
       
   665         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleQwertyModeChangeNotification();
       
   666         return KErrNone;
       
   667         }
       
   668     else
       
   669         {
       
   670         return KErrArgument;
       
   671         }
       
   672     }
       
   673 
       
   674 void CAknFepSharedDataInterface::HandlePredictiveTextSettingGSChange()
       
   675     {
       
   676     TInt value = 0;
       
   677 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   678     if (iAknFepRepository)
       
   679         {
       
   680         iAknFepRepository->Get(KAknFepPredTxtFlagExtension, value);
       
   681         }
       
   682     TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout();
       
   683     switch(layout)
       
   684         {
       
   685         case EPtiKeyboardNone:
       
   686             break;
       
   687       	case EPtiKeyboard12Key:
       
   688             value &= EKeyboardStyle12Key;
       
   689             break;
       
   690         case EPtiKeyboardHalfQwerty:
       
   691             value &= EKeyboardStyleHalfQwerty;
       
   692             break;            
       
   693       	case EPtiKeyboardQwerty4x12:
       
   694       	case EPtiKeyboardQwerty4x10:
       
   695       	case EPtiKeyboardQwerty3x11:      	
       
   696       	case EPtiKeyboardCustomQwerty:
       
   697             value &= EKeyboardStyleQwerty;
       
   698             break;
       
   699       	default:
       
   700       	    break;
       
   701         }
       
   702     if (value > 0)
       
   703     	{
       
   704     	value = 1;
       
   705     	}
       
   706 #else
       
   707     if (iAknFepRepository)
       
   708         {
       
   709         iAknFepRepository->Get(KAknFepPredTxtFlag, value);
       
   710         }
       
   711 #endif
       
   712     iFepManager->SetWesternPredictive(value);
       
   713     }
       
   714 
       
   715 void CAknFepSharedDataInterface::HandleJapanesePredictiveTextSettingGSChange()
       
   716     {
       
   717     TInt value = 0;
       
   718     if (iAknFepRepository)
       
   719         {
       
   720         iAknFepRepository->Get(KAknFepJapanesePredTxtFlag, value);
       
   721         }
       
   722     iFepManager->SetJapanesePredictive(value);
       
   723     }
       
   724 
       
   725 void CAknFepSharedDataInterface::HandleQwertyModeChangeNotification()
       
   726     {
       
   727     TInt value = 0;
       
   728     iQwertyModeStatusProperty.Get(value);
       
   729     iFepManager->SetQwertyMode(value);
       
   730     }
       
   731 
       
   732 TInt CAknFepSharedDataInterface::NumberModeChangesGSNotification()
       
   733     {
       
   734     iFepManager->NumberModeChangeGSNotification();
       
   735     return KErrNone;
       
   736     }
       
   737 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   738 
       
   739 //
       
   740 //Intensionally not called methods
       
   741 // JapanesePredictiveTextSettingChangeGSNotification()
       
   742 // MultiTapTimerChangeGSNotification()
       
   743 // JapaneseQwertyFlagsChangeGSNotification()
       
   744 // PredictiveTextAutoCompleteSettingChangeGSNotification() - Autocompletion feature
       
   745 // 
       
   746 TInt CAknFepSharedDataInterface::HandleGenericRepositoryChange(TAny* aPtr)
       
   747     {
       
   748     CAknFepSharedDataInterface *self = STATIC_CAST(CAknFepSharedDataInterface*, aPtr);
       
   749     TInt error = KErrNone;
       
   750     if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepChineseInputMode)
       
   751         {
       
   752         error = InputModeChangeGSNotification(aPtr);
       
   753         }
       
   754     if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepInputTxtLang)
       
   755         {
       
   756         error = InputTextLangGSNotification(aPtr);
       
   757         }
       
   758     if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPredTxtFlag)
       
   759         {
       
   760         error = PredictiveTextSettingChangeGSNotification(aPtr);
       
   761         }
       
   762     if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepAutoCompleteFlag)
       
   763         {
       
   764         error = PredictiveTextAutoCompleteSettingChangeGSNotification(aPtr);
       
   765         }
       
   766     if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepTypingCorrectionLevel)
       
   767         {
       
   768         error = PredictiveTextTypingCorrectionLevelChangeNotification(aPtr);
       
   769         }
       
   770     if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepNumberCandidateFlag)
       
   771         {
       
   772         error = PredictiveTextNumberCandidateSettingChangeNotification(aPtr);
       
   773         }
       
   774     if(self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPrimaryCandidateFlag)
       
   775         {
       
   776         error = PredictiveTextPrimaryCandidateChangeNotification(aPtr);
       
   777         }
       
   778 
       
   779     return error;
       
   780     }
       
   781 
       
   782 TPtiKeyboardType CAknFepSharedDataInterface::ActiveKeyboardType() const
       
   783     {    
       
   784 	TInt keyboardType = EPtiKeyboardNone;		   
       
   785 #ifdef RD_SCALABLE_UI_V2
       
   786 	// Get physical keyboard type
       
   787 	RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );
       
   788 
       
   789 	// When active keyboard is virtual keyboard, 
       
   790 	// need to get the active virtual keyboard type 
       
   791 	// and set keyboardType again.
       
   792 	
       
   793 	// When the default physical keyboard is 0, 
       
   794 	// it means that there is no physical keyboard,
       
   795 	// also need to get the active virtual keyboard type.
       
   796 	TInt isVirtualInputActive = 0;
       
   797 	RProperty::Get( KPSUidAknFep, KAknFepTouchInputActive, 
       
   798 					isVirtualInputActive );    
       
   799 	if ( isVirtualInputActive > 0 || keyboardType == 0 )
       
   800 		{
       
   801 		// Active keyboard is virtual keyboard          
       
   802 		RProperty::Get( KPSUidAknFep, KAknFepVirtualKeyboardType, 
       
   803 						keyboardType );      
       
   804 		}
       
   805 #else
       
   806 	// Get physical keyboard type
       
   807 	RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );	    
       
   808 #endif
       
   809 
       
   810 	if ( keyboardType <= 0 || keyboardType >= EPtiKeyboardMaxLayout )
       
   811 		{
       
   812 	    keyboardType = EPtiKeyboardNone;
       
   813 		}        
       
   814 	return (TPtiKeyboardType)keyboardType;
       
   815     }
       
   816 #endif // RD_INTELLIGENT_TEXT_INPUT
       
   817 
       
   818 TInt CAknFepSharedDataInterface::HandleRepositoryCallBack(TAny* aPtr)
       
   819     {
       
   820     CAknFepSharedDataInterface *self = STATIC_CAST(CAknFepSharedDataInterface*, aPtr);
       
   821 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   822     
       
   823     if( self->iAknFepRepositoryWatcher && 
       
   824         self->iAknFepRepositoryWatcher->IsGenericCenrepChange())
       
   825         {
       
   826         return HandleGenericRepositoryChange(aPtr);
       
   827         }
       
   828     else
       
   829 #endif        
       
   830     if (self->iAknFepRepositoryWatcher)
       
   831         {
       
   832 		 if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepHashKeySelection)
       
   833         	{
       
   834         	return HashKeySelectionNotification(aPtr);
       
   835         	}
       
   836         if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepChineseInputMode)
       
   837             {
       
   838             return InputModeChangeGSNotification(aPtr);
       
   839             }
       
   840         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepInputTxtLang)
       
   841             {
       
   842             return InputTextLangGSNotification(aPtr);
       
   843             }
       
   844 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   845 #ifdef FF_DUAL_LANGUAGE_SUPPORT
       
   846         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepInputTxtLangSecondary)
       
   847             {
       
   848             return InputTextLangGSNotification(aPtr);
       
   849             }
       
   850 #endif //FF_DUAL_LANGUAGE_SUPPORT
       
   851 #endif
       
   852         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPredTxtFlag)
       
   853             {
       
   854             return PredictiveTextSettingChangeGSNotification(aPtr);
       
   855             }
       
   856         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepJapanesePredTxtFlag)
       
   857             {
       
   858             return JapanesePredictiveTextSettingChangeGSNotification(aPtr);
       
   859             }
       
   860         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepMultiTapTimer)
       
   861             {
       
   862             return MultiTapTimerChangeGSNotification(aPtr);
       
   863             }
       
   864         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepJapaneseSpecialCharFlag)
       
   865             {
       
   866             return JapaneseQwertyFlagsChangeGSNotification(aPtr);
       
   867             }
       
   868 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
   869         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepAutoCompleteFlag)
       
   870             {
       
   871             return PredictiveTextAutoCompleteSettingChangeGSNotification(aPtr);
       
   872             }          
       
   873 #endif	//RD_INTELLIGENT_TEXT_INPUT
       
   874 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
   875         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepAutoCompleteFlag)
       
   876             {
       
   877             return PredictiveTextAutoCompleteSettingChangeGSNotification(aPtr);
       
   878             }          
       
   879         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepTypingCorrectionLevel)
       
   880             {
       
   881             return PredictiveTextTypingCorrectionLevelChangeNotification(aPtr);
       
   882             }          
       
   883         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepNumberCandidateFlag)
       
   884             {
       
   885             return PredictiveTextNumberCandidateSettingChangeNotification(aPtr);
       
   886             }
       
   887         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPrimaryCandidateFlag)
       
   888             {
       
   889             return PredictiveTextPrimaryCandidateChangeNotification(aPtr);
       
   890             }
       
   891         else if (self->iAknFepRepositoryWatcher->ChangedKey() == KAknFepPredTxtFlagExtension)
       
   892             {
       
   893             return PredictiveTextSettingChangeGSNotification(aPtr);
       
   894             }          
       
   895 #endif
       
   896         }
       
   897 
       
   898     return KErrNone;
       
   899     }
       
   900     
       
   901 TInt CAknFepSharedDataInterface::HandleLocaleRepositoryCallBack(TAny* aPtr)    
       
   902 	{
       
   903 	CAknFepSharedDataInterface *self = STATIC_CAST(CAknFepSharedDataInterface*, aPtr);
       
   904 
       
   905 	if(self->iAknFepLocaleRepositoryWatcher)
       
   906 	    {
       
   907         if (self->iAknFepLocaleRepositoryWatcher->ChangedKey() == KSettingsDefaultNumberMode
       
   908         ||  self->iAknFepLocaleRepositoryWatcher->ChangedKey() == KSettingsIndicDefaultNumberMode)
       
   909 		    {
       
   910 		    return self->NumberModeChangesGSNotification();
       
   911 		    }
       
   912 	    }    
       
   913 	return KErrNone;	
       
   914 	}
       
   915 
       
   916 CAknFepSharedDataInterface::CSubscriber::CSubscriber(TCallBack aCallBack, RProperty& aProperty)
       
   917     :
       
   918     CActive(EPriorityNormal), iCallBack(aCallBack), iProperty(aProperty)
       
   919     {
       
   920     CActiveScheduler::Add(this);
       
   921     }
       
   922 
       
   923 CAknFepSharedDataInterface::CSubscriber::~CSubscriber()
       
   924     {
       
   925     Cancel();
       
   926     }
       
   927 
       
   928 void CAknFepSharedDataInterface::CSubscriber::SubscribeL()
       
   929     {
       
   930     if (!IsActive())
       
   931         {
       
   932         iProperty.Subscribe(iStatus);
       
   933         SetActive();
       
   934         }
       
   935     }
       
   936 
       
   937 void CAknFepSharedDataInterface::CSubscriber::StopSubscribe()
       
   938     {
       
   939     Cancel();
       
   940     }
       
   941 
       
   942 void CAknFepSharedDataInterface::CSubscriber::RunL()
       
   943     {
       
   944     if (iStatus.Int() == KErrNone)
       
   945         {
       
   946         iCallBack.CallBack();
       
   947         SubscribeL();
       
   948         }
       
   949     }
       
   950 
       
   951 void CAknFepSharedDataInterface::CSubscriber::DoCancel()
       
   952     {
       
   953     iProperty.Cancel();
       
   954     }
       
   955     
       
   956     
       
   957 TInt CAknFepSharedDataInterface::EditSubmenuInUse() const
       
   958     {
       
   959     TInt value = 0;				
       
   960     if (iAknFepRepository)
       
   961         {
       
   962         iAknFepRepository->Get(KAknFepHashKeySelection, value);
       
   963         }       
       
   964     
       
   965     return value;    
       
   966     }
       
   967     
       
   968     
       
   969     
       
   970 TInt CAknFepSharedDataInterface::HashKeySelectionInUse()
       
   971     {
       
   972     // This is never used in qwerty modes.
       
   973     if (QwertyInputMode())
       
   974     	{
       
   975     	return 0;
       
   976     	}
       
   977     	    	
       
   978     TInt value = 0;     	    		    	
       
   979     if (iAknFepRepository)
       
   980         {
       
   981         iAknFepRepository->Get(KAknFepHashKeySelection, value);
       
   982         }        
       
   983  
       
   984     return iHashKeySelectionInUse;
       
   985     }   
       
   986     
       
   987 
       
   988 CAknFepRepositoryWatcher* CAknFepRepositoryWatcher::NewL(
       
   989     const TUid aUid,
       
   990     const TUint32 aKey,
       
   991     CCenRepNotifyHandler::TCenRepKeyType aKeyType,
       
   992     TCallBack aCallBack,
       
   993     CRepository* aRepository)
       
   994     {
       
   995     CAknFepRepositoryWatcher* self = new(ELeave) CAknFepRepositoryWatcher(aUid, aKey, aCallBack, 
       
   996                                                                           aRepository);
       
   997 
       
   998     CleanupStack::PushL(self);
       
   999     self->ConstructL(aKeyType);
       
  1000     CleanupStack::Pop(self);
       
  1001 
       
  1002     return self;
       
  1003     }
       
  1004 
       
  1005 CAknFepRepositoryWatcher* CAknFepRepositoryWatcher::NewL(
       
  1006     const TUid aUid,
       
  1007     TCallBack aCallBack,
       
  1008     CRepository* aRepository)
       
  1009     {
       
  1010     CAknFepRepositoryWatcher* self = new(ELeave) CAknFepRepositoryWatcher(aUid, 
       
  1011                            NCentralRepositoryConstants::KInvalidNotificationId, 
       
  1012                            aCallBack, aRepository);
       
  1013 
       
  1014     CleanupStack::PushL(self);
       
  1015     self->ConstructL();
       
  1016     CleanupStack::Pop(self);
       
  1017 
       
  1018     return self;
       
  1019     }
       
  1020 
       
  1021 CAknFepRepositoryWatcher::~CAknFepRepositoryWatcher()
       
  1022     {
       
  1023     if( iNotifyHandler )
       
  1024         {
       
  1025         iNotifyHandler->StopListening();
       
  1026         delete iNotifyHandler;
       
  1027         iNotifyHandler = NULL;
       
  1028         }
       
  1029     }
       
  1030 
       
  1031 CAknFepRepositoryWatcher::CAknFepRepositoryWatcher(
       
  1032     const TUid aUid,
       
  1033     const TUint32 aKey,
       
  1034     TCallBack aCallBack,
       
  1035     CRepository* aRepository)
       
  1036     :
       
  1037     iUid(aUid), iKey(aKey), iCallBack(aCallBack), iRepository(aRepository)
       
  1038 #ifdef RD_INTELLIGENT_TEXT_INPUT    
       
  1039     , iIsGeneric (EFalse)
       
  1040 #endif    
       
  1041     {
       
  1042     }
       
  1043 
       
  1044 void CAknFepRepositoryWatcher::ConstructL(CCenRepNotifyHandler::TCenRepKeyType aKeyType)
       
  1045     {
       
  1046     iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository, aKeyType, iKey);
       
  1047     iNotifyHandler->StartListeningL();
       
  1048     }
       
  1049 
       
  1050 void CAknFepRepositoryWatcher::ConstructL()
       
  1051     {
       
  1052     iNotifyHandler = CCenRepNotifyHandler::NewL(*this, *iRepository);
       
  1053     iNotifyHandler->StartListeningL();
       
  1054     }
       
  1055 
       
  1056 TUint32 CAknFepRepositoryWatcher::ChangedKey()
       
  1057     {
       
  1058     return iChangedKey;
       
  1059     }
       
  1060 
       
  1061 void CAknFepRepositoryWatcher::HandleNotifyInt(TUint32 aKey, TInt aNewValue)
       
  1062     {
       
  1063 #ifdef _DEBUG
       
  1064     RDebug::Print(_L("AknFep: HandleNotifyInt aKey=%d, aNewValue=%d"), aKey, aNewValue);
       
  1065 #endif
       
  1066     iChangedKey = aKey;
       
  1067 #ifdef RD_INTELLIGENT_TEXT_INPUT    
       
  1068     iIsGeneric = EFalse;
       
  1069 #endif    
       
  1070     iCallBack.CallBack();
       
  1071     iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId;
       
  1072     }
       
  1073 
       
  1074 void CAknFepRepositoryWatcher::HandleNotifyError(TUint32 /*aKey*/, TInt /*aError*/, CCenRepNotifyHandler* /*aHandler*/)
       
  1075     {
       
  1076     }
       
  1077 
       
  1078 /*
       
  1079 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1080 void CAknFepRepositoryWatcher::HandleNotifyGeneric(TUint32 aId)
       
  1081     {
       
  1082 #ifdef _DEBUG
       
  1083     RDebug::Print(_L("AknFep: HandleNotifyGeneric aId=%d"), aId);
       
  1084 #endif  
       
  1085     iChangedKey = aId;
       
  1086     iIsGeneric = ETrue;
       
  1087     iCallBack.CallBack();      
       
  1088     iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId;
       
  1089     }
       
  1090 #else*/
       
  1091 
       
  1092 void CAknFepRepositoryWatcher::HandleNotifyGeneric(TUint32 aId)
       
  1093     {
       
  1094 #ifdef _DEBUG
       
  1095     RDebug::Print(_L("AknFep: HandleNotifyGeneric aId=%d"), aId);
       
  1096 #endif  
       
  1097     iChangedKey = aId;
       
  1098     iCallBack.CallBack();
       
  1099     iChangedKey = NCentralRepositoryConstants::KInvalidNotificationId;  
       
  1100     }
       
  1101 //#endif
       
  1102 
       
  1103 /**
       
  1104  * Multitap timer value. 
       
  1105  * Replaces the constant KMultiTapTimeoutMS in Japanese variant.
       
  1106  *
       
  1107  * @since 3.0
       
  1108  * @return Value of KAknFepMultiTapTimer setting.
       
  1109  */
       
  1110 TInt CAknFepSharedDataInterface::MultiTapTimer() const
       
  1111     {
       
  1112     TInt value = 1000000;
       
  1113     if (iAknFepRepository)
       
  1114         {
       
  1115         iAknFepRepository->Get(KAknFepMultiTapTimer, value);
       
  1116         }
       
  1117     return value;
       
  1118     }
       
  1119     
       
  1120 /**
       
  1121  * Change notification for Multitap timer. 
       
  1122  *
       
  1123  * @since 3.0
       
  1124  * @return return KErrNone if aObj isn't NULL
       
  1125  *         return KErrArgument if aObj is NULL
       
  1126  */
       
  1127 TInt CAknFepSharedDataInterface::MultiTapTimerChangeGSNotification(TAny* aObj)
       
  1128     {
       
  1129     if (aObj)
       
  1130         {
       
  1131         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleMultiTapTimerChangeGSNotification();
       
  1132         return KErrNone;
       
  1133         }
       
  1134     else
       
  1135         {
       
  1136         return KErrArgument;
       
  1137         }
       
  1138     }
       
  1139 
       
  1140 /**
       
  1141  * Handle change notification for Multitap timer. 
       
  1142  *
       
  1143  * @since 3.0
       
  1144  */
       
  1145 void CAknFepSharedDataInterface::HandleMultiTapTimerChangeGSNotification()
       
  1146     {
       
  1147     TInt value = MultiTapTimer();
       
  1148     iFepManager->SetMultiTapTimer(value);
       
  1149     }
       
  1150 
       
  1151 /**
       
  1152  * Japanese Qwerty Flags value. 
       
  1153  * Replaces the constant KAknFepJapaneseSpecialCharFlag in Japanese variant.
       
  1154  *
       
  1155  * @since 3.0
       
  1156  * @return Value of KAknFepJapaneseSpecialCharFlag setting.
       
  1157  */
       
  1158 TInt CAknFepSharedDataInterface::JapaneseQwertyFlags() const
       
  1159     {
       
  1160     TInt value = 0x000F;
       
  1161     if (iAknFepRepository)
       
  1162         {
       
  1163         iAknFepRepository->Get(KAknFepJapaneseSpecialCharFlag, value);
       
  1164         }
       
  1165     return value;
       
  1166     }
       
  1167     
       
  1168 /**
       
  1169  * Change notification for Japanese Qwerty Flags. 
       
  1170  *
       
  1171  * @since 3.0
       
  1172  * @return return KErrNone if aObj isn't NULL
       
  1173  *         return KErrArgument if aObj is NULL
       
  1174  */
       
  1175 TInt CAknFepSharedDataInterface::JapaneseQwertyFlagsChangeGSNotification(TAny* aObj)
       
  1176     {
       
  1177     if (aObj)
       
  1178         {
       
  1179         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleJapaneseQwertyFlagsChangeGSNotification();
       
  1180         return KErrNone;
       
  1181         }
       
  1182     else
       
  1183         {
       
  1184         return KErrArgument;
       
  1185         }
       
  1186     }
       
  1187 
       
  1188 /**
       
  1189  * Handle change notification for Japanese Qwerty Flags. 
       
  1190  *
       
  1191  * @since 3.0
       
  1192  */
       
  1193 void CAknFepSharedDataInterface::HandleJapaneseQwertyFlagsChangeGSNotification()
       
  1194     {
       
  1195     TInt value = JapaneseQwertyFlags();
       
  1196     iFepManager->SetJapaneseQwertyFlags(value);
       
  1197     }
       
  1198 
       
  1199 /**
       
  1200  * Returns a value of current clear direction.
       
  1201  *
       
  1202  * @since 3.2
       
  1203  * @return Value of KAknFepClearDirection setting.
       
  1204  */
       
  1205 TInt CAknFepSharedDataInterface::ClearDirection() const
       
  1206     {
       
  1207     TInt value = EClearDirectionLeft;
       
  1208     if (iAknFepRepository)
       
  1209         {
       
  1210         iAknFepRepository->Get(KAknFepClearDirection, value);
       
  1211         }
       
  1212     return value;
       
  1213     }
       
  1214 
       
  1215 /**
       
  1216  * Set a value of current clear direction.
       
  1217  *
       
  1218  * @since 3.2
       
  1219  * @param aValue new value set to Clear Direction shared data item which
       
  1220  *               represents the direction currently being used
       
  1221  */
       
  1222 void CAknFepSharedDataInterface::SetClearDirection(TInt aValue)
       
  1223     {
       
  1224     if (iAknFepRepository)
       
  1225         {
       
  1226         iAknFepRepository->Set(KAknFepClearDirection, aValue);
       
  1227         }
       
  1228     }
       
  1229 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1230 TInt CAknFepSharedDataInterface::HandleKeyboardLayoutChangeNotification(TAny* aObj)
       
  1231     {
       
  1232     if (aObj)
       
  1233         {
       
  1234         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleKeyboardLayoutChange();
       
  1235         return KErrNone;
       
  1236         }
       
  1237     else
       
  1238         {
       
  1239         return KErrArgument;
       
  1240         }
       
  1241     }
       
  1242 
       
  1243 #ifdef RD_SCALABLE_UI_V2
       
  1244 TInt CAknFepSharedDataInterface::HandleVirtualKeyboardLayoutChangeNotification(TAny* aObj)
       
  1245 	{
       
  1246     if (aObj)
       
  1247         {
       
  1248         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleVirtualKeyboardLayoutChange();
       
  1249         return KErrNone;
       
  1250         }
       
  1251     else
       
  1252         {
       
  1253         return KErrArgument;
       
  1254         }	
       
  1255 	}
       
  1256 #endif // RD_SCALABLE_UI_V2
       
  1257 
       
  1258 #endif
       
  1259     
       
  1260     
       
  1261 void CAknFepSharedDataInterface::SetPredictiveTextAutoCompleteOn()
       
  1262     {
       
  1263     if (iAknFepRepository)
       
  1264         {
       
  1265 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1266         //Set autocomplete flag only for the current keyboard layout type. Otherwise,
       
  1267         //by simply setting to "1", we los information on autocompletion settings
       
  1268         //of other keyboard types.
       
  1269         TPtiKeyboardType currentKeyboardLayoutlayout = (TPtiKeyboardType)KeyboardLayout();
       
  1270         TInt autocompletionSetting = 0;
       
  1271         iAknFepRepository->Get(KAknFepAutoCompleteFlag, autocompletionSetting);
       
  1272         switch(currentKeyboardLayoutlayout)
       
  1273             {
       
  1274             case EPtiKeyboardNone:
       
  1275                 break;
       
  1276             case EPtiKeyboard12Key:
       
  1277                 autocompletionSetting |= EKeyboardStyle12Key;
       
  1278                 break;
       
  1279             case EPtiKeyboardQwerty4x12:
       
  1280             case EPtiKeyboardQwerty4x10:
       
  1281             case EPtiKeyboardQwerty3x11:
       
  1282             case EPtiKeyboardHalfQwerty:
       
  1283             case EPtiKeyboardCustomQwerty:
       
  1284                 autocompletionSetting |= EKeyboardStyleQwerty;
       
  1285                 break;
       
  1286             default:
       
  1287                 break;
       
  1288             }
       
  1289         iAknFepRepository->Set(KAknFepAutoCompleteFlag, autocompletionSetting);
       
  1290 #else
       
  1291         iAknFepRepository->Set(KAknFepAutoCompleteFlag, 1);
       
  1292 #endif
       
  1293         }
       
  1294     }    
       
  1295 
       
  1296 
       
  1297 void CAknFepSharedDataInterface::ResetPredictiveTextAutoCompleteOn()
       
  1298     {
       
  1299     if (iAknFepRepository)
       
  1300         {
       
  1301 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1302         //Reset autocomplete flag only for the current keyboard layout type. Otherwise,
       
  1303         //by simply setting to "0", we lose information on autocompletion settings
       
  1304         //of other keyboard types.
       
  1305         TPtiKeyboardType currentKeyboardLayoutlayout = (TPtiKeyboardType)KeyboardLayout();
       
  1306         TInt autocompletionSetting = 0;
       
  1307         iAknFepRepository->Get(KAknFepAutoCompleteFlag, autocompletionSetting);
       
  1308         switch(currentKeyboardLayoutlayout)
       
  1309             {
       
  1310             case EPtiKeyboardNone:
       
  1311                 break;
       
  1312             case EPtiKeyboard12Key:
       
  1313                 autocompletionSetting &= ~EKeyboardStyle12Key;
       
  1314                 break;
       
  1315             case EPtiKeyboardQwerty4x12:
       
  1316             case EPtiKeyboardQwerty4x10:
       
  1317             case EPtiKeyboardQwerty3x11:
       
  1318             case EPtiKeyboardHalfQwerty:
       
  1319             case EPtiKeyboardCustomQwerty:
       
  1320                 autocompletionSetting &= ~EKeyboardStyleQwerty;
       
  1321                 break;
       
  1322             default:
       
  1323                 break;
       
  1324             }
       
  1325         iAknFepRepository->Set(KAknFepAutoCompleteFlag, autocompletionSetting);
       
  1326 #else
       
  1327         iAknFepRepository->Set(KAknFepAutoCompleteFlag, 0);
       
  1328 #endif
       
  1329         }
       
  1330     }
       
  1331     
       
  1332 #ifndef RD_INTELLIGENT_TEXT_INPUT
       
  1333 void CAknFepSharedDataInterface::HandlePredictiveTextAutoCompleteSettingGSChange()
       
  1334     {
       
  1335     TInt value = 0;
       
  1336     if (iAknFepRepository)
       
  1337         {
       
  1338         iAknFepRepository->Get(KAknFepAutoCompleteFlag, value);
       
  1339         }
       
  1340     iFepManager->SetAutoCompletionState(value);
       
  1341     }
       
  1342     
       
  1343     
       
  1344 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteSettingChangeGSNotification(TAny* aObj)
       
  1345     {
       
  1346     if (aObj)
       
  1347         {
       
  1348         static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextAutoCompleteSettingGSChange();
       
  1349         return KErrNone;
       
  1350         }
       
  1351     else
       
  1352         {
       
  1353         return KErrArgument;
       
  1354         }
       
  1355     }    
       
  1356 
       
  1357 #endif	//RD_INTELLIGENT_TEXT_INPUT
       
  1358 
       
  1359 #ifdef RD_INTELLIGENT_TEXT_INPUT
       
  1360 void CAknFepSharedDataInterface::SetFnKeyState(TInt aState)
       
  1361     {
       
  1362     RProperty::Set(KPSUidAknFep,KAknFepFnKeyState, aState);
       
  1363     }
       
  1364     
       
  1365 TInt CAknFepSharedDataInterface::GetFnKeyState()
       
  1366     {
       
  1367     TInt state = 0;
       
  1368     RProperty::Get(KPSUidAknFep,KAknFepFnKeyState, state);
       
  1369     return state;
       
  1370     }
       
  1371 void CAknFepSharedDataInterface::HandleKeyboardLayoutChange()
       
  1372     {
       
  1373     TInt value = 0;
       
  1374     TPtiKeyboardType keyboardType;
       
  1375     iKeyboardLayoutStatusProperty.Get(value);
       
  1376     keyboardType = (TPtiKeyboardType)value;
       
  1377     iFepManager->SetKeyboardLayout(keyboardType);
       
  1378     iFepManager->SetFnKeyMappingState();
       
  1379 #ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__
       
  1380     iFepManager->StopDisplayingMenuBar();
       
  1381 #endif //__ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__
       
  1382     }
       
  1383 
       
  1384 #ifdef RD_SCALABLE_UI_V2
       
  1385 // ---------------------------------------------------------------------------
       
  1386 // Handles the change to virtual keyboard layout.
       
  1387 // 
       
  1388 // ---------------------------------------------------------------------------
       
  1389 //
       
  1390 void CAknFepSharedDataInterface::HandleVirtualKeyboardLayoutChange()
       
  1391 	{
       
  1392 	TInt value = 0;
       
  1393     TPtiKeyboardType keyboardType;
       
  1394     iVirtualKeyboardLayoutStatusProperty.Get(value);
       
  1395     keyboardType = (TPtiKeyboardType)value;
       
  1396     iFepManager->SetKeyboardLayout(keyboardType);
       
  1397     iFepManager->SetFnKeyMappingState();
       
  1398 	}
       
  1399 #endif // RD_SCALABLE_UI_V2
       
  1400 
       
  1401 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteOn()
       
  1402     {
       
  1403     TInt value = 0;
       
  1404     if (iAknFepRepository)
       
  1405         {
       
  1406         TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout();
       
  1407         TInt temp = 0;
       
  1408         iAknFepRepository->Get(KAknFepAutoCompleteFlag, temp);
       
  1409         switch(layout)
       
  1410             {
       
  1411             case EPtiKeyboardNone:
       
  1412                 break;
       
  1413           	case EPtiKeyboard12Key:
       
  1414                 temp &= EKeyboardStyle12Key;
       
  1415                 break;
       
  1416             case EPtiKeyboardHalfQwerty:
       
  1417                 temp &= EKeyboardStyleHalfQwerty;
       
  1418                 break;
       
  1419           	case EPtiKeyboardQwerty4x12:
       
  1420           	case EPtiKeyboardQwerty4x10:
       
  1421           	case EPtiKeyboardQwerty3x11:          	
       
  1422           	case EPtiKeyboardCustomQwerty:
       
  1423                 temp &= EKeyboardStyleQwerty;
       
  1424                 break;
       
  1425           	default:
       
  1426           	    break;
       
  1427             }
       
  1428         value = ( temp ? 1 : 0);
       
  1429         }
       
  1430     return value;
       
  1431     }
       
  1432 
       
  1433 void CAknFepSharedDataInterface::HandlePredictiveTextAutoCompleteSettingGSChange()
       
  1434     {
       
  1435     TInt value = 0;
       
  1436     if (iAknFepRepository)
       
  1437         {
       
  1438         iAknFepRepository->Get(KAknFepAutoCompleteFlag, value);
       
  1439         }
       
  1440     TPtiKeyboardType layout = (TPtiKeyboardType)KeyboardLayout();
       
  1441     switch(layout)
       
  1442         {
       
  1443         case EPtiKeyboardNone:
       
  1444             break;
       
  1445       	case EPtiKeyboard12Key:
       
  1446             value &= EKeyboardStyle12Key;
       
  1447             break;
       
  1448         case EPtiKeyboardHalfQwerty:    
       
  1449             value &= EKeyboardStyleHalfQwerty;
       
  1450             break;
       
  1451       	case EPtiKeyboardQwerty4x12:
       
  1452       	case EPtiKeyboardQwerty4x10:
       
  1453       	case EPtiKeyboardQwerty3x11:      	
       
  1454       	case EPtiKeyboardCustomQwerty:
       
  1455             value &= EKeyboardStyleQwerty;
       
  1456             break;
       
  1457       	default:
       
  1458       	    break;
       
  1459         }
       
  1460     if (value > 0)
       
  1461     	{
       
  1462     	value = 1;
       
  1463     	}
       
  1464     iFepManager->SetAutoCompletionState(value);
       
  1465     }
       
  1466     
       
  1467     
       
  1468 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteSettingChangeGSNotification(TAny* aObj)
       
  1469     {
       
  1470     if (aObj) 
       
  1471         {
       
  1472         static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextAutoCompleteSettingGSChange();
       
  1473         return KErrNone;
       
  1474         }
       
  1475     else
       
  1476         {
       
  1477         return KErrArgument;
       
  1478         }
       
  1479     }    
       
  1480 /**
       
  1481  * Queries the value of PredictiveText Typing Correction Level from shared data
       
  1482  *
       
  1483  * @return Typing Correction Level
       
  1484 */
       
  1485 TInt CAknFepSharedDataInterface::PredictiveTextTypingCorrectionLevel()
       
  1486 	{
       
  1487 	TInt value = 0;
       
  1488     if (iAknFepRepository)
       
  1489         {
       
  1490         iAknFepRepository->Get(KAknFepTypingCorrectionLevel, value);
       
  1491         }
       
  1492     return value;
       
  1493 	}
       
  1494 
       
  1495 
       
  1496 /**
       
  1497  * Sets the value of PredictiveText Typing Correction Level state to aCorrectionLevel in shared data 
       
  1498 */    
       
  1499 void CAknFepSharedDataInterface::SetPredictiveTextTypingCorrectionLevel(TInt aCorrectionLevel)
       
  1500 	{
       
  1501 	if (iAknFepRepository)
       
  1502         {
       
  1503         iAknFepRepository->Set(KAknFepTypingCorrectionLevel, aCorrectionLevel);
       
  1504         }
       
  1505 	}
       
  1506 
       
  1507 void CAknFepSharedDataInterface::HandlePredictiveTextTypingCorrectionLevelChange()
       
  1508     {
       
  1509     TInt value = 0;
       
  1510     if (iAknFepRepository)
       
  1511         {
       
  1512         iAknFepRepository->Get(KAknFepTypingCorrectionLevel, value);
       
  1513         }
       
  1514     iFepManager->SetTypingCorrectionLevel(value);
       
  1515     }
       
  1516 
       
  1517  /**
       
  1518  * Handles a change in predictive text Typing Correction Level setting.
       
  1519 */    
       
  1520 TInt CAknFepSharedDataInterface::PredictiveTextTypingCorrectionLevelChangeNotification(TAny* aObj)
       
  1521 	{
       
  1522 	if (aObj) 
       
  1523         {
       
  1524         static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextTypingCorrectionLevelChange();
       
  1525         return KErrNone;
       
  1526         }
       
  1527     else
       
  1528         {
       
  1529         return KErrArgument;
       
  1530         }
       
  1531 	}
       
  1532 
       
  1533 /**
       
  1534  * Queries the value of PredictiveText Number Candidate Shown state to be On from shared data
       
  1535  *
       
  1536  * @return 1 for shown or 0 for not shown
       
  1537 */
       
  1538 TInt CAknFepSharedDataInterface::PredictiveTextNumberCandidateShown()
       
  1539 	{
       
  1540 	TInt value = 0;
       
  1541     if (iAknFepRepository)
       
  1542         {
       
  1543         iAknFepRepository->Get(KAknFepNumberCandidateFlag, value);
       
  1544         }
       
  1545     return value;
       
  1546 	}
       
  1547 
       
  1548 
       
  1549 /**
       
  1550  * Sets the value of PredictiveText Number Candidate Shown state to 1 in shared data - this
       
  1551  * is used to represent predictive text Number Candidate Shown being shown.
       
  1552 */    
       
  1553 void CAknFepSharedDataInterface::SetPredictiveTextNumberCandidateShown()
       
  1554 	{
       
  1555 	if (iAknFepRepository)
       
  1556         {
       
  1557         iAknFepRepository->Set(KAknFepNumberCandidateFlag, 1);
       
  1558         }
       
  1559 	}
       
  1560 
       
  1561 
       
  1562 /**
       
  1563  * Sets the value of PredictiveText Number Candidate Shown state to 0 in shared data - this
       
  1564  * is used to represent predictive text Number Candidate Shown being not shown.
       
  1565 */    
       
  1566 void CAknFepSharedDataInterface::ResetPredictiveTextNumberCandidateShown()
       
  1567 	{
       
  1568 	if (iAknFepRepository)
       
  1569         {
       
  1570         iAknFepRepository->Set(KAknFepNumberCandidateFlag, 0);
       
  1571         }
       
  1572 	}
       
  1573 
       
  1574 void CAknFepSharedDataInterface::HandlePredictiveTextNumberCandidateSettingChange()
       
  1575     {
       
  1576     TInt value = 0;
       
  1577     if (iAknFepRepository)
       
  1578         {
       
  1579         iAknFepRepository->Get(KAknFepNumberCandidateFlag, value);
       
  1580         }
       
  1581     iFepManager->SetNumberCandidateState(value);
       
  1582     }
       
  1583 
       
  1584 /**
       
  1585  * Handles a change in predictive text Number Candidate Shown setting.
       
  1586 */    
       
  1587 TInt CAknFepSharedDataInterface::PredictiveTextNumberCandidateSettingChangeNotification(TAny* aObj)
       
  1588 	{
       
  1589 	if (aObj) 
       
  1590         {
       
  1591         static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextNumberCandidateSettingChange();
       
  1592         return KErrNone;
       
  1593         }
       
  1594     else
       
  1595         {
       
  1596         return KErrArgument;
       
  1597         }
       
  1598 	}
       
  1599 	
       
  1600 /**
       
  1601 * Queries the value of PredictiveText Primary candidate setting from shared data
       
  1602 *
       
  1603 * @return Primary candidate setting(0 for Suggested or 1 for Exact)
       
  1604 */
       
  1605 TInt CAknFepSharedDataInterface::PredictiveTextPrimaryCandidate()
       
  1606 	{
       
  1607 	TInt value = 0;
       
  1608     if (iAknFepRepository)
       
  1609         {
       
  1610         iAknFepRepository->Get(KAknFepPrimaryCandidateFlag, value);
       
  1611         }
       
  1612     return value;
       
  1613 	}
       
  1614 
       
  1615 
       
  1616 /**
       
  1617 * Sets the value of PredictiveText Primary candidate setting state to aPrimaryCandidate in shared data 
       
  1618 */    
       
  1619 void CAknFepSharedDataInterface::SetPredictiveTextPrimaryCandidate(TInt aPrimaryCandidate)
       
  1620 	{
       
  1621 	if (iAknFepRepository)
       
  1622         {
       
  1623         iAknFepRepository->Set(KAknFepPrimaryCandidateFlag, aPrimaryCandidate);
       
  1624         }
       
  1625 	}
       
  1626 /**
       
  1627 * Handles a change in predictive text Primary candidate setting.
       
  1628 */   
       
  1629 void CAknFepSharedDataInterface::HandlePredictiveTextPrimaryCandidateChange()
       
  1630     {
       
  1631     TInt value = 0;
       
  1632     if (iAknFepRepository)
       
  1633         {
       
  1634         iAknFepRepository->Get(KAknFepPrimaryCandidateFlag, value);
       
  1635         }
       
  1636     iFepManager->SetPrimaryCandidate(value);
       
  1637     }
       
  1638 
       
  1639 /**
       
  1640 * Handles a change in predictive text Typing Correction Level setting.
       
  1641 */    
       
  1642 TInt CAknFepSharedDataInterface::PredictiveTextPrimaryCandidateChangeNotification(TAny* aObj)
       
  1643 	{
       
  1644 	if (aObj) 
       
  1645         {
       
  1646         static_cast<CAknFepSharedDataInterface*>(aObj)->HandlePredictiveTextPrimaryCandidateChange();
       
  1647         return KErrNone;
       
  1648         }
       
  1649     else
       
  1650         {
       
  1651         return KErrArgument;
       
  1652         }
       
  1653 	}
       
  1654 #else	// RD_INTELLIGENT_TEXT_INPUT
       
  1655 
       
  1656 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteOn()
       
  1657     {
       
  1658     TInt value = 0;
       
  1659     if (iAknFepRepository)
       
  1660         {
       
  1661         iAknFepRepository->Get(KAknFepAutoCompleteFlag, value);
       
  1662         }
       
  1663     return value;
       
  1664     }
       
  1665 #endif    
       
  1666 /**
       
  1667  * Returns a value of HWR conversion on/off.
       
  1668  *
       
  1669  * @since 3.2
       
  1670  * @return Value of KAknFepJapaneseHwrConversion setting.
       
  1671  */
       
  1672 TInt CAknFepSharedDataInterface::JapaneseHwrConversion() const
       
  1673     {
       
  1674     TInt value = 0;
       
  1675     if (iAknFepRepository)
       
  1676         {
       
  1677         iAknFepRepository->Get(KAknFepJapaneseSpecialCharFlag, value);
       
  1678         }
       
  1679     return (value & KJapHwrConversion)?
       
  1680                 EJapaneseConversionOn : EJapaneseConversionOff;
       
  1681     }
       
  1682 
       
  1683 /**
       
  1684  * Set a value of HWR conversion on/off.
       
  1685  *
       
  1686  * @since 3.2
       
  1687  * @param aValue new value set to HWR conversion on/off shared data item
       
  1688  */
       
  1689 void CAknFepSharedDataInterface::SetJapaneseHwrConversion(TInt aValue)
       
  1690     {
       
  1691     if (iAknFepRepository)
       
  1692         {
       
  1693         TInt value;
       
  1694         iAknFepRepository->Get(KAknFepJapaneseSpecialCharFlag, value);
       
  1695         if (aValue == EJapaneseConversionOn)
       
  1696             {
       
  1697             value |= KJapHwrConversion;
       
  1698             }
       
  1699         else
       
  1700             {
       
  1701             value &= ~(KJapHwrConversion);
       
  1702             }
       
  1703         iAknFepRepository->Set(KAknFepJapaneseSpecialCharFlag, value);
       
  1704         }
       
  1705     }
       
  1706     
       
  1707 TInt CAknFepSharedDataInterface::FepShowFsqPreviewStatus()
       
  1708     {
       
  1709     TInt value = 0;
       
  1710     if (iAknFepRepository)
       
  1711         {
       
  1712         iAknFepRepository->Get(KAknFepShowFsqPreview, value);
       
  1713         }
       
  1714     return value;
       
  1715     }
       
  1716     
       
  1717     
       
  1718 void CAknFepSharedDataInterface::SetFepShowFsqPreviewStatus(TInt aValue)
       
  1719     {
       
  1720     if (iAknFepRepository)
       
  1721         {
       
  1722         iAknFepRepository->Set(KAknFepShowFsqPreview, aValue);
       
  1723         }
       
  1724     } 
       
  1725     
       
  1726 TInt CAknFepSharedDataInterface::FepShowVkbPreviewStatus()
       
  1727     {
       
  1728     TInt value = 0;
       
  1729     if (iAknFepRepository)
       
  1730         {
       
  1731         iAknFepRepository->Get(KAknFepShowVkbPreview, value);
       
  1732         }
       
  1733     return value;
       
  1734     }
       
  1735     
       
  1736     
       
  1737 void CAknFepSharedDataInterface::SetFepShowVkbPreviewStatus(TInt aValue)
       
  1738     {
       
  1739     if (iAknFepRepository)
       
  1740         {
       
  1741         iAknFepRepository->Set(KAknFepShowVkbPreview, aValue);
       
  1742         }
       
  1743     } 
       
  1744     
       
  1745 TInt CAknFepSharedDataInterface::FepLastUseVkbModeForLandscape()
       
  1746     {
       
  1747     TInt value = 4;
       
  1748     if (iAknFepRepository)
       
  1749         {
       
  1750         iAknFepRepository->Get(KAknFepLastUseVkbMode, value);
       
  1751         }
       
  1752     return value;
       
  1753     }
       
  1754     
       
  1755     
       
  1756 void CAknFepSharedDataInterface::SetFepLastUseVkbModeForLandscape(TInt aValue)
       
  1757     {
       
  1758     if (iAknFepRepository)
       
  1759         {
       
  1760         iAknFepRepository->Set(KAknFepLastUseVkbMode, aValue);
       
  1761         }
       
  1762     }           
       
  1763 
       
  1764 TBool CAknFepSharedDataInterface::AutoRotateEnabled()
       
  1765 	{
       
  1766 	TInt sensorState( 0 );    
       
  1767 
       
  1768     if (iSensorRepository)
       
  1769         {
       
  1770         iSensorRepository->Get( KSenSettingsSensorsOn, sensorState );
       
  1771         }
       
  1772     if ( sensorState )
       
  1773         {
       
  1774         TInt turnCtrl = 0;
       
  1775         iSensorRepository->Get( KSenSettingsTurnCtrl, turnCtrl );
       
  1776         turnCtrl = turnCtrl >> 2;
       
  1777             
       
  1778         if ( turnCtrl ) 
       
  1779             {
       
  1780             return ETrue;
       
  1781             }
       
  1782         }
       
  1783     
       
  1784     return EFalse;
       
  1785 	}
       
  1786 
       
  1787 TBool CAknFepSharedDataInterface::ThemeEffectsEnabled()
       
  1788     {
       
  1789         TInt effectsValue = KErrNone;
       
  1790         TInt error = iThemeEffectsRepository->Get( KThemesTransitionEffects, effectsValue );
       
  1791         if ( error != KErrNone || effectsValue != 0 )//zero means on
       
  1792             {
       
  1793             effectsValue = KErrNotFound;
       
  1794             }
       
  1795         return effectsValue == KErrNone ? ETrue:EFalse;
       
  1796     }
       
  1797 
       
  1798 #ifdef	RD_INTELLIGENT_TEXT_INPUT
       
  1799 #ifdef __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__
       
  1800 /**
       
  1801 * Queries if numbers (and other characters found behind Fn) can be entered with long key press on QWERTY.
       
  1802 */
       
  1803 TBool CAknFepSharedDataInterface::LongPressNumberEntryOnQwerty() const
       
  1804     {
       
  1805 	TInt value = 0;
       
  1806       if (iAknFepRepository)
       
  1807         {
       
  1808         iAknFepRepository->Get(KAknFepLongPressNumberEntryOnQwerty, value);
       
  1809         }
       
  1810     return value;
       
  1811     }
       
  1812 
       
  1813 /**
       
  1814 * Queries if copy-pasting with shift+softkeys is available also on QWERTY.
       
  1815 */
       
  1816 TBool CAknFepSharedDataInterface::ShiftCopyPastingOnQwerty() const
       
  1817     {
       
  1818 	TInt value = 0;
       
  1819       if (iAknFepRepository)
       
  1820         {
       
  1821         iAknFepRepository->Get(KAknFepShiftCopyPasteOnQwerty, value);
       
  1822         }
       
  1823     return value;
       
  1824     }
       
  1825 #endif // __ITI_LONGPRESS_NUM_SHIFT_COPYPASTE__	
       
  1826 #endif	// RD_INTELLIGENT_TEXT_INPUT
       
  1827 
       
  1828 #ifdef  RD_SCALABLE_UI_V2
       
  1829 // ---------------------------------------------------------------------------
       
  1830 // Get a value of current default on screen vkb.
       
  1831 // It depends on input lanage is PRC/HW/TW Chinese.
       
  1832 // ---------------------------------------------------------------------------
       
  1833 //  
       
  1834 TInt CAknFepSharedDataInterface::DefaultOnScreenVKB()
       
  1835     {
       
  1836     TInt value = 0;
       
  1837     switch( PenInputLanguage() )
       
  1838         {
       
  1839         case ELangPrcChinese:
       
  1840             {
       
  1841             iGsPenSettings->Get( KSettingsDefaultVkbPrc, value );
       
  1842             }
       
  1843             break;
       
  1844         case ELangHongKongChinese:
       
  1845             {
       
  1846             iGsPenSettings->Get( KSettingsDefaultVkbHk, value );
       
  1847             }
       
  1848             break;
       
  1849          case ELangTaiwanChinese:
       
  1850             {
       
  1851             iGsPenSettings->Get( KSettingsDefaultVkbTw, value );
       
  1852             }
       
  1853             break;
       
  1854          default:
       
  1855             break;
       
  1856         }
       
  1857     return value;
       
  1858     };
       
  1859 	
       
  1860 /**
       
  1861  * Returns a value of default arabic finger hwr orientation.
       
  1862  *
       
  1863  * @since 5.2
       
  1864  * @return Value of default arabic finger hwr orientation.
       
  1865  */
       
  1866 TInt CAknFepSharedDataInterface::DefaultArabicFingerHwrOrientation() const
       
  1867      {
       
  1868      TInt value = 0;
       
  1869      if (iAknFepRepository)
       
  1870        {
       
  1871        iAknFepRepository->Get(KAknFepDefaultArabicFingerHwrOrientation, value);
       
  1872        }
       
  1873      return value;     
       
  1874      }
       
  1875 
       
  1876 /**
       
  1877  * Set a value of default arabic finger hwr orientation.
       
  1878  *
       
  1879  * @since 5.2
       
  1880  * @param aValue new value set to default arabic finger hwr orientation shared data item
       
  1881  */
       
  1882 void CAknFepSharedDataInterface::SetDefaultArabicFingerHwrOrientation(TInt aValue)
       
  1883     {
       
  1884     if (iAknFepRepository)
       
  1885         {
       
  1886         iAknFepRepository->Set(KAknFepDefaultArabicFingerHwrOrientation, aValue);
       
  1887         }
       
  1888     }
       
  1889 	
       
  1890 /**
       
  1891  * Returns a value of default arabic finger hwr number mode.
       
  1892  *
       
  1893  * @since 5.2
       
  1894  * @return Value of default arabic finger hwr number mode.
       
  1895  */
       
  1896 TInt CAknFepSharedDataInterface::DefaultArabicNumberMode() const
       
  1897      {
       
  1898      TInt value = 0;
       
  1899      if (iAknFepRepository)
       
  1900        {
       
  1901        iAknFepRepository->Get(KAknFepDefaultArabicNumberMode, value);
       
  1902        }
       
  1903      return value;     
       
  1904      }
       
  1905 
       
  1906 /**
       
  1907  * Set a value of default arabic finger hwr number mode.
       
  1908  *
       
  1909  * @since 5.2
       
  1910  * @param aValue new value set to default arabic finger hwr number mode shared data item
       
  1911  */
       
  1912 void CAknFepSharedDataInterface::SetDefaultArabicNumberMode(TInt aValue)
       
  1913     {
       
  1914     if (iAknFepRepository)
       
  1915         {
       
  1916         iAknFepRepository->Set(KAknFepDefaultArabicNumberMode, aValue);
       
  1917         }
       
  1918     }
       
  1919 #endif
       
  1920 
       
  1921 /**
       
  1922  * Get the last used plugin input mode for portrait orientation
       
  1923  *
       
  1924  * @since 5.2
       
  1925  * @return Value of KAknFepLastUsedPortraitInput setting.
       
  1926  */    
       
  1927 TPluginInputMode CAknFepSharedDataInterface::PluginPortraitInputMode() const
       
  1928     {
       
  1929     TInt cenRepValue( 0 );
       
  1930     if ( iAknFepRepository )
       
  1931         {
       
  1932         iAknFepRepository->Get( KAknFepLastUsedPortraitInput, cenRepValue );
       
  1933         }
       
  1934 
       
  1935     TPluginInputMode lastUsedPortraitInputMode = 
       
  1936          static_cast<TPluginInputMode>( cenRepValue );
       
  1937     
       
  1938     // Check portrait FSQ and ITU-T feature are enabled.
       
  1939     TBool isPortraitFSQEnabled = FeatureManager::FeatureSupported( 
       
  1940         KFeatureIdFfVirtualFullscrPortraitQwertyInput );
       
  1941     TBool isITUTEnabled = FeatureManager::FeatureSupported( 
       
  1942         KFeatureIdVirtualItutInput );
       
  1943     
       
  1944     // If both ITU-T and portrait FSQ features are enabled, use the saved
       
  1945     // portrait input mode.
       
  1946     if ( isITUTEnabled && isPortraitFSQEnabled )
       
  1947         {
       
  1948         // If the saved portrait input mode is not valid, use the default
       
  1949         // value, EPluginInputModeItut.
       
  1950         if ( ! ( lastUsedPortraitInputMode == EPluginInputModeItut ||
       
  1951                  lastUsedPortraitInputMode == EPluginInputModePortraitFSQ ) )
       
  1952             {
       
  1953             lastUsedPortraitInputMode = EPluginInputModeItut;
       
  1954             }
       
  1955         }
       
  1956     // If only ITU-T feature is enabled, use the mode.
       
  1957     else if ( isITUTEnabled )
       
  1958         {
       
  1959         lastUsedPortraitInputMode = EPluginInputModeItut;
       
  1960         }
       
  1961     // If only portrait FSQ feature is enabled, use the mode.
       
  1962     else if ( isPortraitFSQEnabled )
       
  1963         {
       
  1964         lastUsedPortraitInputMode = EPluginInputModePortraitFSQ;
       
  1965         }
       
  1966     // If none of the features are enabled, EPluginInputModeNone is assigned
       
  1967     // for exception handling.
       
  1968     else
       
  1969         {
       
  1970         lastUsedPortraitInputMode = EPluginInputModeNone;
       
  1971         }
       
  1972 
       
  1973     return lastUsedPortraitInputMode;
       
  1974     }
       
  1975 
       
  1976 /**
       
  1977  * Replaces the last used plugin input mode for portrait orientation
       
  1978  *
       
  1979  * @since 5.2
       
  1980  * @return Replace value of KAknFepLastUsedPortraitInput setting.
       
  1981  */
       
  1982 void CAknFepSharedDataInterface::SetPluginPortraitInputMode( 
       
  1983     TPluginInputMode aLastUsedPortraitInputMode )
       
  1984     {
       
  1985     // Check validity of the input mode to be set.  The input mode is not 
       
  1986     // valid if,
       
  1987          // i) The input mode is not neither ITU-T nor portrait FSQ.
       
  1988     if ( !( aLastUsedPortraitInputMode == EPluginInputModeItut ||
       
  1989             aLastUsedPortraitInputMode == EPluginInputModePortraitFSQ ) ||
       
  1990          // ii) The input mode is ITU-T but the feature is disabled.
       
  1991           ( aLastUsedPortraitInputMode == EPluginInputModeItut &&  
       
  1992             !FeatureManager::FeatureSupported( KFeatureIdVirtualItutInput ) ) ||
       
  1993          // iii) The input mode is portrait FSQ but the feature is disabled.
       
  1994           ( aLastUsedPortraitInputMode == EPluginInputModePortraitFSQ && 
       
  1995             !FeatureManager::FeatureSupported(
       
  1996                 KFeatureIdFfVirtualFullscrPortraitQwertyInput ) ) )
       
  1997         {
       
  1998         __ASSERT_DEBUG( 0, 
       
  1999             User::Panic( _L( "Wrong portrait input mode" ), __LINE__ ) );
       
  2000         // Return without saving the value if the portrait input is invalid.
       
  2001         return;  
       
  2002         }
       
  2003         
       
  2004    if ( iAknFepRepository )
       
  2005         {
       
  2006         TInt err = iAknFepRepository->Set( KAknFepLastUsedPortraitInput,
       
  2007             static_cast<TInt>( aLastUsedPortraitInputMode ) );
       
  2008         }
       
  2009     }
       
  2010     
       
  2011 // End of File