fep/aknfep/src/AknFepSharedDataInterface.cpp
branchRCL_3
changeset 12 4eb1ae11334f
parent 10 6defe5d1bd39
child 14 e6a39382bb9c
equal deleted inserted replaced
10:6defe5d1bd39 12:4eb1ae11334f
    82     if (iKeyboardLayoutStatusSubscriber)
    82     if (iKeyboardLayoutStatusSubscriber)
    83         {
    83         {
    84         iKeyboardLayoutStatusSubscriber->StopSubscribe();
    84         iKeyboardLayoutStatusSubscriber->StopSubscribe();
    85         }
    85         }
    86     iKeyboardLayoutStatusProperty.Close();
    86     iKeyboardLayoutStatusProperty.Close();
    87     delete iKeyboardLayoutStatusSubscriber;    
    87     delete iKeyboardLayoutStatusSubscriber;
       
    88     
       
    89 #ifdef RD_SCALABLE_UI_V2 
       
    90     if ( iVirtualKeyboardLayoutStatusSubscriber )
       
    91         {
       
    92         iVirtualKeyboardLayoutStatusSubscriber->StopSubscribe();
       
    93         }
       
    94     delete iVirtualKeyboardLayoutStatusSubscriber;
       
    95     iVirtualKeyboardLayoutStatusProperty.Close();
       
    96 #endif
    88 #endif
    97 #endif
    89     iQwertyModeStatusProperty.Close();
    98     iQwertyModeStatusProperty.Close();
    90     delete iQwertyModeStatusSubscriber;
    99     delete iQwertyModeStatusSubscriber;
    91     }
   100     }
    92 
   101 
   416     }
   425     }
   417 
   426 
   418 #ifdef RD_INTELLIGENT_TEXT_INPUT
   427 #ifdef RD_INTELLIGENT_TEXT_INPUT
   419 TInt CAknFepSharedDataInterface::KeyboardLayout() //const
   428 TInt CAknFepSharedDataInterface::KeyboardLayout() //const
   420     {
   429     {
   421     TInt value = 0;
   430 	return ActiveKeyboardType();
   422     iKeyboardLayoutStatusProperty.Get(value);
       
   423     return value;
       
   424     }
   431     }
   425 
   432 
   426 #ifdef FF_DUAL_LANGUAGE_SUPPORT
   433 #ifdef FF_DUAL_LANGUAGE_SUPPORT
   427 TInt CAknFepSharedDataInterface::InputTextLanguageSecondary()
   434 TInt CAknFepSharedDataInterface::InputTextLanguageSecondary()
   428     {
   435     {
   490     User::LeaveIfError(iKeyboardLayoutStatusProperty.Attach(KCRUidAvkon, KAknKeyBoardLayout));    
   497     User::LeaveIfError(iKeyboardLayoutStatusProperty.Attach(KCRUidAvkon, KAknKeyBoardLayout));    
   491     iKeyboardLayoutStatusSubscriber = new (ELeave) CSubscriber(
   498     iKeyboardLayoutStatusSubscriber = new (ELeave) CSubscriber(
   492                                          TCallBack(HandleKeyboardLayoutChangeNotification, this), 
   499                                          TCallBack(HandleKeyboardLayoutChangeNotification, this), 
   493                                          iKeyboardLayoutStatusProperty);    
   500                                          iKeyboardLayoutStatusProperty);    
   494     iKeyboardLayoutStatusSubscriber->SubscribeL();
   501     iKeyboardLayoutStatusSubscriber->SubscribeL();
       
   502 
       
   503 #ifdef RD_SCALABLE_UI_V2 
       
   504     User::LeaveIfError( iVirtualKeyboardLayoutStatusProperty.Attach
       
   505     		                                                ( KPSUidAknFep, KAknFepVirtualKeyboardType ) );    
       
   506     iVirtualKeyboardLayoutStatusSubscriber = new (ELeave) CSubscriber(
       
   507                                          TCallBack( HandleVirtualKeyboardLayoutChangeNotification, this ), 
       
   508                                          iVirtualKeyboardLayoutStatusProperty );    
       
   509     iVirtualKeyboardLayoutStatusSubscriber->SubscribeL();
       
   510 #endif // RD_SCALABLE_UI_V2    
   495 #endif
   511 #endif
   496     iQwertyModeStatusSubscriber = new (ELeave) CSubscriber(
   512     iQwertyModeStatusSubscriber = new (ELeave) CSubscriber(
   497     								TCallBack(QwertyModeChangeNotification, this), 
   513     								TCallBack(QwertyModeChangeNotification, this), 
   498     								iQwertyModeStatusProperty);
   514     								iQwertyModeStatusProperty);
   499     iQwertyModeStatusSubscriber->SubscribeL();
   515     iQwertyModeStatusSubscriber->SubscribeL();
   726         error = PredictiveTextPrimaryCandidateChangeNotification(aPtr);
   742         error = PredictiveTextPrimaryCandidateChangeNotification(aPtr);
   727         }
   743         }
   728 
   744 
   729     return error;
   745     return error;
   730     }
   746     }
       
   747 
       
   748 TPtiKeyboardType CAknFepSharedDataInterface::ActiveKeyboardType() const
       
   749     {    
       
   750 	TInt keyboardType = EPtiKeyboardNone;		   
       
   751 #ifdef RD_SCALABLE_UI_V2
       
   752 	// Get physical keyboard type
       
   753 	RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );
       
   754 
       
   755 	// When active keyboard is virtual keyboard, 
       
   756 	// need to get the active virtual keyboard type 
       
   757 	// and set keyboardType again.
       
   758 	
       
   759 	// When the default physical keyboard is 0, 
       
   760 	// it means that there is no physical keyboard,
       
   761 	// also need to get the active virtual keyboard type.
       
   762 	TInt isVirtualInputActive = 0;
       
   763 	RProperty::Get( KPSUidAknFep, KAknFepTouchInputActive, 
       
   764 					isVirtualInputActive );    
       
   765 	if ( isVirtualInputActive > 0 || keyboardType == 0 )
       
   766 		{
       
   767 		// Active keyboard is virtual keyboard          
       
   768 		RProperty::Get( KPSUidAknFep, KAknFepVirtualKeyboardType, 
       
   769 						keyboardType );      
       
   770 		}
       
   771 #else if
       
   772 	// Get physical keyboard type
       
   773 	RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );	    
   731 #endif
   774 #endif
       
   775 
       
   776 	if ( keyboardType <= 0 || keyboardType >= EPtiKeyboardMaxLayout )
       
   777 		{
       
   778 	    keyboardType = EPtiKeyboardNone;
       
   779 		}        
       
   780 	return (TPtiKeyboardType)keyboardType;
       
   781     }
       
   782 #endif // RD_INTELLIGENT_TEXT_INPUT
       
   783 
   732 TInt CAknFepSharedDataInterface::HandleRepositoryCallBack(TAny* aPtr)
   784 TInt CAknFepSharedDataInterface::HandleRepositoryCallBack(TAny* aPtr)
   733     {
   785     {
   734     CAknFepSharedDataInterface *self = STATIC_CAST(CAknFepSharedDataInterface*, aPtr);
   786     CAknFepSharedDataInterface *self = STATIC_CAST(CAknFepSharedDataInterface*, aPtr);
   735 #ifdef RD_INTELLIGENT_TEXT_INPUT
   787 #ifdef RD_INTELLIGENT_TEXT_INPUT
   736     
   788     
  1151     else
  1203     else
  1152         {
  1204         {
  1153         return KErrArgument;
  1205         return KErrArgument;
  1154         }
  1206         }
  1155     }
  1207     }
       
  1208 
       
  1209 #ifdef RD_SCALABLE_UI_V2
       
  1210 TInt CAknFepSharedDataInterface::HandleVirtualKeyboardLayoutChangeNotification(TAny* aObj)
       
  1211 	{
       
  1212     if (aObj)
       
  1213         {
       
  1214         static_cast<CAknFepSharedDataInterface*>(aObj)->HandleVirtualKeyboardLayoutChange();
       
  1215         return KErrNone;
       
  1216         }
       
  1217     else
       
  1218         {
       
  1219         return KErrArgument;
       
  1220         }	
       
  1221 	}
       
  1222 #endif // RD_SCALABLE_UI_V2
       
  1223 
  1156 #endif
  1224 #endif
  1157     
  1225     
  1158     
  1226     
  1159 void CAknFepSharedDataInterface::SetPredictiveTextAutoCompleteOn()
  1227 void CAknFepSharedDataInterface::SetPredictiveTextAutoCompleteOn()
  1160     {
  1228     {
  1276     iFepManager->SetFnKeyMappingState();
  1344     iFepManager->SetFnKeyMappingState();
  1277 #ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__
  1345 #ifdef __ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__
  1278     iFepManager->StopDisplayingMenuBar();
  1346     iFepManager->StopDisplayingMenuBar();
  1279 #endif //__ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__
  1347 #endif //__ITI_VIRTUAL_TOUCH_FIRST_GENERATION_SUPPORT__
  1280     }
  1348     }
       
  1349 
       
  1350 #ifdef RD_SCALABLE_UI_V2
       
  1351 // ---------------------------------------------------------------------------
       
  1352 // Handles the change to virtual keyboard layout.
       
  1353 // 
       
  1354 // ---------------------------------------------------------------------------
       
  1355 //
       
  1356 void CAknFepSharedDataInterface::HandleVirtualKeyboardLayoutChange()
       
  1357 	{
       
  1358 	TInt value = 0;
       
  1359     TPtiKeyboardType keyboardType;
       
  1360     iVirtualKeyboardLayoutStatusProperty.Get(value);
       
  1361     keyboardType = (TPtiKeyboardType)value;
       
  1362     iFepManager->SetKeyboardLayout(keyboardType);
       
  1363     iFepManager->SetFnKeyMappingState();
       
  1364 	}
       
  1365 #endif // RD_SCALABLE_UI_V2
       
  1366 
  1281 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteOn()
  1367 TInt CAknFepSharedDataInterface::PredictiveTextAutoCompleteOn()
  1282     {
  1368     {
  1283     TInt value = 0;
  1369     TInt value = 0;
  1284     if (iAknFepRepository)
  1370     if (iAknFepRepository)
  1285         {
  1371         {