fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepPredictiveSettingData.cpp
branchRCL_3
changeset 12 4eb1ae11334f
parent 0 eb1f2e154e89
child 14 e6a39382bb9c
--- a/fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepPredictiveSettingData.cpp	Wed Mar 31 22:08:20 2010 +0300
+++ b/fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepPredictiveSettingData.cpp	Wed Apr 14 16:18:34 2010 +0300
@@ -30,6 +30,9 @@
  * ============================================================================
  */
 
+#include <e32property.h>
+#include <AvkonInternalCRKeys.h>
+#include <AknFepInternalPSKeys.h>
 #include "AknFepPredictiveSettingData.h"
 
 CAknFepPredictiveSettingData *CAknFepPredictiveSettingData::NewL()
@@ -74,4 +77,71 @@
 void CAknFepPredictiveSettingData::SaveL() const
     {
     }
+
+TPtiKeyboardType CAknFepPredictiveSettingData::ActiveKeyboardType() const
+	{    
+	TInt keyboardType = EPtiKeyboardNone;
+#ifdef RD_SCALABLE_UI_V2
+	// Get physical keyboard type
+	RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );
+
+	//1. When active keyboard is virtual keyboard, 
+	// need to get the active virtual keyboard type 
+	// and set keyboardType again.	
+	//2. When the default physical keyboard is 0, 
+	// it means that there is no physical keyboard,
+	// also need to get the active virtual keyboard type.
+	TInt isVirtualInputActive = 0;
+	RProperty::Get( KPSUidAknFep, KAknFepTouchInputActive, 
+					isVirtualInputActive );    
+	if ( isVirtualInputActive > 0 || keyboardType == 0 )
+		{
+		// Active keyboard is virtual keyboard          
+		RProperty::Get( KPSUidAknFep, KAknFepVirtualKeyboardType, 
+						keyboardType );      
+		}
+#else if
+	// Get physical keyboard type
+	RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );	    
+#endif
+
+	if ( keyboardType <= 0 || keyboardType >= EPtiKeyboardMaxLayout )
+		{
+	    keyboardType = EPtiKeyboardNone;
+		}        
+	return (TPtiKeyboardType)keyboardType;
+    }
+
+TPtiKeyboardType CAknFepPredictiveSettingData::OwnerKeyboardType() const
+	{
+	TInt keyboardType = EPtiKeyboardNone;
+#ifdef RD_SCALABLE_UI_V2	
+	// When dialog state is 2, it means that the setting dialog is opened
+	// for virtual qwerty keyboard, therefore, 
+	// returning value of virtual qwerty keyboard type is necessary 
+	TInt dialogState = 0;
+	RProperty::Get( KPSUidAknFep, KAknFepSettingDialogState, dialogState );    	
+	if ( dialogState == 2 )
+		{
+		// The setting dialog is opened by virtual qwerty keyboard,
+	    // then need to get current virtual keyboard type 
+	    keyboardType = EPtiKeyboardQwerty4x12;
+		}
+	else
+		{
+	    // Get physical keyboard type
+	    RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );	    
+		}
+#else if
+    // Get physical keyboard type
+    RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );		
+#endif // RD_SCALABLE_UI_V2
+
+	if ( keyboardType <= 0 || keyboardType >= EPtiKeyboardMaxLayout )
+		{
+	    keyboardType = EPtiKeyboardNone;
+		}		
+	return (TPtiKeyboardType)keyboardType;	
+	}
+
 //EOF