textinput/ptienginev2/src/PtiEngineImpl.cpp
branchRCL_3
changeset 16 857bebeecec0
parent 12 5e18d8c489d6
child 20 ebd48d2de13c
equal deleted inserted replaced
15:6c2c2d3ab788 16:857bebeecec0
   710 		else if (!iCurrentLanguage->HasInputMode(aMode))
   710 		else if (!iCurrentLanguage->HasInputMode(aMode))
   711 			{
   711 			{
   712 			return KErrNoSuitableCore;	
   712 			return KErrNoSuitableCore;	
   713 			}
   713 			}
   714 		}
   714 		}
   715 
   715 	
   716     iInputMode = aMode;	
   716 	if (iInputMode != aMode)
       
   717 		{
       
   718 		OnInputModeChanged(iInputMode, aMode);
       
   719 		iInputMode = aMode;		
       
   720 		}
   717 
   721 
   718 	TFileName temp;
   722 	TFileName temp;
   719 	temp.Copy(iTextBuffer);
   723 	temp.Copy(iTextBuffer);
   720 	return SetCurrentWord( temp );
   724 	return SetCurrentWord( temp );
   721 	}
   725 	}
   722 
   726 
       
   727 void CPtiEngineImpl::OnInputModeChanged(TPtiEngineInputMode /*aOldMode*/, TPtiEngineInputMode aNewMode)
       
   728 	{
       
   729 	if (aNewMode == EPtiEngineQwertyPredictive)
       
   730 		{
       
   731 		HBufC16* oldTextBuf = iTextBuffer.Alloc(); 
       
   732 		ClearCurrentWord();
       
   733 		if (oldTextBuf)
       
   734 			{
       
   735 			// why assigned here? eh, I don't want to do that either.
       
   736 			// SetCurrentWord will use core(), which will use iInputMode, and 
       
   737 			// obviously, the core should return the new core, that is why.
       
   738 			iInputMode = aNewMode;
       
   739 		
       
   740 			SetCurrentWord(oldTextBuf->Des());
       
   741 			delete oldTextBuf;
       
   742 			}
       
   743 		}
       
   744 	}
   723 
   745 
   724 // ---------------------------------------------------------------------------
   746 // ---------------------------------------------------------------------------
   725 // CPtiEngineImpl::CountToneMarks
   747 // CPtiEngineImpl::CountToneMarks
   726 // 
   748 // 
   727 // ---------------------------------------------------------------------------
   749 // ---------------------------------------------------------------------------
  3962 	// and set keyboardType again.
  3984 	// and set keyboardType again.
  3963 	
  3985 	
  3964 	// When the default physical keyboard is 0, 
  3986 	// When the default physical keyboard is 0, 
  3965 	// it means that there is no physical keyboard,
  3987 	// it means that there is no physical keyboard,
  3966 	// also need to get the active virtual keyboard type.
  3988 	// also need to get the active virtual keyboard type.
       
  3989 	TInt isQwertyOn = 0;
       
  3990 	RProperty::Get(KCRUidAvkon, KAknQwertyInputModeActive, isQwertyOn);	
  3967 	TInt isVirtualInputActive = 0;
  3991 	TInt isVirtualInputActive = 0;
  3968 	RProperty::Get( KPSUidAknFep, KAknFepTouchInputActive, 
  3992 	RProperty::Get( KPSUidAknFep, KAknFepTouchInputActive, 
  3969 					isVirtualInputActive );    
  3993 					isVirtualInputActive );    
  3970 	if ( isVirtualInputActive > 0 || keyboardType == 0 )
  3994 	if (( isVirtualInputActive > 0 || keyboardType == 0) && !isQwertyOn)
  3971 		{
  3995 		{
  3972 		// Active keyboard is virtual keyboard          
  3996 		// Active keyboard is virtual keyboard          
  3973 		RProperty::Get( KPSUidAknFep, KAknFepVirtualKeyboardType, 
  3997 		RProperty::Get( KPSUidAknFep, KAknFepVirtualKeyboardType, 
  3974 						keyboardType );      
  3998 						keyboardType );      
  3975 		}
  3999 		}