fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepPredictiveSettingData.cpp
branchRCL_3
changeset 12 4eb1ae11334f
parent 0 eb1f2e154e89
child 14 e6a39382bb9c
equal deleted inserted replaced
10:6defe5d1bd39 12:4eb1ae11334f
    28  * ============================================================================
    28  * ============================================================================
    29  *  Name     : CAknFepPredictiveSettingData from AknFepPredictiveSettingData 
    29  *  Name     : CAknFepPredictiveSettingData from AknFepPredictiveSettingData 
    30  * ============================================================================
    30  * ============================================================================
    31  */
    31  */
    32 
    32 
       
    33 #include <e32property.h>
       
    34 #include <AvkonInternalCRKeys.h>
       
    35 #include <AknFepInternalPSKeys.h>
    33 #include "AknFepPredictiveSettingData.h"
    36 #include "AknFepPredictiveSettingData.h"
    34 
    37 
    35 CAknFepPredictiveSettingData *CAknFepPredictiveSettingData::NewL()
    38 CAknFepPredictiveSettingData *CAknFepPredictiveSettingData::NewL()
    36 	{
    39 	{
    37 	CAknFepPredictiveSettingData *self = CAknFepPredictiveSettingData::NewLC();
    40 	CAknFepPredictiveSettingData *self = CAknFepPredictiveSettingData::NewLC();
    72     }
    75     }
    73     
    76     
    74 void CAknFepPredictiveSettingData::SaveL() const
    77 void CAknFepPredictiveSettingData::SaveL() const
    75     {
    78     {
    76     }
    79     }
       
    80 
       
    81 TPtiKeyboardType CAknFepPredictiveSettingData::ActiveKeyboardType() const
       
    82 	{    
       
    83 	TInt keyboardType = EPtiKeyboardNone;
       
    84 #ifdef RD_SCALABLE_UI_V2
       
    85 	// Get physical keyboard type
       
    86 	RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );
       
    87 
       
    88 	//1. When active keyboard is virtual keyboard, 
       
    89 	// need to get the active virtual keyboard type 
       
    90 	// and set keyboardType again.	
       
    91 	//2. When the default physical keyboard is 0, 
       
    92 	// it means that there is no physical keyboard,
       
    93 	// also need to get the active virtual keyboard type.
       
    94 	TInt isVirtualInputActive = 0;
       
    95 	RProperty::Get( KPSUidAknFep, KAknFepTouchInputActive, 
       
    96 					isVirtualInputActive );    
       
    97 	if ( isVirtualInputActive > 0 || keyboardType == 0 )
       
    98 		{
       
    99 		// Active keyboard is virtual keyboard          
       
   100 		RProperty::Get( KPSUidAknFep, KAknFepVirtualKeyboardType, 
       
   101 						keyboardType );      
       
   102 		}
       
   103 #else if
       
   104 	// Get physical keyboard type
       
   105 	RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );	    
       
   106 #endif
       
   107 
       
   108 	if ( keyboardType <= 0 || keyboardType >= EPtiKeyboardMaxLayout )
       
   109 		{
       
   110 	    keyboardType = EPtiKeyboardNone;
       
   111 		}        
       
   112 	return (TPtiKeyboardType)keyboardType;
       
   113     }
       
   114 
       
   115 TPtiKeyboardType CAknFepPredictiveSettingData::OwnerKeyboardType() const
       
   116 	{
       
   117 	TInt keyboardType = EPtiKeyboardNone;
       
   118 #ifdef RD_SCALABLE_UI_V2	
       
   119 	// When dialog state is 2, it means that the setting dialog is opened
       
   120 	// for virtual qwerty keyboard, therefore, 
       
   121 	// returning value of virtual qwerty keyboard type is necessary 
       
   122 	TInt dialogState = 0;
       
   123 	RProperty::Get( KPSUidAknFep, KAknFepSettingDialogState, dialogState );    	
       
   124 	if ( dialogState == 2 )
       
   125 		{
       
   126 		// The setting dialog is opened by virtual qwerty keyboard,
       
   127 	    // then need to get current virtual keyboard type 
       
   128 	    keyboardType = EPtiKeyboardQwerty4x12;
       
   129 		}
       
   130 	else
       
   131 		{
       
   132 	    // Get physical keyboard type
       
   133 	    RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );	    
       
   134 		}
       
   135 #else if
       
   136     // Get physical keyboard type
       
   137     RProperty::Get(KCRUidAvkon, KAknKeyBoardLayout, keyboardType );		
       
   138 #endif // RD_SCALABLE_UI_V2
       
   139 
       
   140 	if ( keyboardType <= 0 || keyboardType >= EPtiKeyboardMaxLayout )
       
   141 		{
       
   142 	    keyboardType = EPtiKeyboardNone;
       
   143 		}		
       
   144 	return (TPtiKeyboardType)keyboardType;	
       
   145 	}
       
   146 
    77 //EOF
   147 //EOF