fep/aknfep/src/AknFepUiManagerChinese.cpp
branchRCL_3
changeset 46 bd83ceabce89
parent 44 ecbabf52600f
child 50 5a1685599b76
equal deleted inserted replaced
44:ecbabf52600f 46:bd83ceabce89
   130 const TInt16 KStrokeDownToRightValue = 0x4e36;
   130 const TInt16 KStrokeDownToRightValue = 0x4e36;
   131 const TInt16 KStrokeBendingValue = 0x4e5b;
   131 const TInt16 KStrokeBendingValue = 0x4e5b;
   132 const TInt16 KStrokeQuestionValue = 0x003f;
   132 const TInt16 KStrokeQuestionValue = 0x003f;
   133 const TInt16 KStrokeUnicode = 0x2461;
   133 const TInt16 KStrokeUnicode = 0x2461;
   134 const TInt16 KZhuyinIndicator = 0x2462;
   134 const TInt16 KZhuyinIndicator = 0x2462;
       
   135 const TInt16 KPinyinIndicator = 0x2460;
       
   136 //const TInt16 KStrokeIndicator = 0x2461;
       
   137 const TInt16 KCanjieIndicator = 0x2463;
       
   138 const TInt16 KChineseTone1 = 0x02c9;
       
   139 const TInt16 KChineseTone2 = 0x02ca; 
       
   140 const TInt16 KChineseTone3 = 0x02c7; 
       
   141 const TInt16 KChineseTone4 = 0x02cb;
       
   142 const TInt16 KChineseTone0 = 0x02d9;
   135 /**
   143 /**
   136 *  CAknFepUIManagerChinese class.
   144 *  CAknFepUIManagerChinese class.
   137 * 
   145 * 
   138 */
   146 */
   139 
   147 
   473         }
   481         }
   474     
   482     
   475     return EFalse;
   483     return EFalse;
   476     }
   484     }
   477 #endif
   485 #endif
       
   486 TBool CAknFepUIManagerChinese::IsValidChineseInputSymbol(TInt aKey, TPtiEngineInputMode aMode) const
       
   487     {
       
   488     if( aMode == EPtiEnginePinyinPhraseQwerty)
       
   489         {
       
   490         return MapAgainst(aKey, aMode, KPinyinIndicator, EPtiCaseLower);
       
   491         }
       
   492     else if( aMode == EPtiEngineZhuyinPhraseQwerty)
       
   493         {
       
   494         return MapAgainst(aKey, aMode, KZhuyinIndicator, EPtiCaseLower);
       
   495         }
       
   496     else if( aMode == EPtiEngineNormalCangjieQwerty || 
       
   497              aMode == EPtiEngineEasyCangjieQwerty ||
       
   498              aMode == EPtiEngineAdvCangjieQwerty)
       
   499         {
       
   500         return MapAgainst(aKey, aMode, KCanjieIndicator, EPtiCaseLower);
       
   501         }
       
   502     return EFalse;
       
   503     }
       
   504 TBool CAknFepUIManagerChinese::IsValidChineseToneMarkKey(TInt aKey, TPtiEngineInputMode aMode) const
       
   505     {
       
   506     if( MapAgainst(aKey, aMode, KChineseTone1, EPtiCaseLower))
       
   507         {
       
   508         return ETrue;
       
   509         }
       
   510     else if( MapAgainst(aKey, aMode, KChineseTone2, EPtiCaseLower))
       
   511         {
       
   512         return ETrue;
       
   513         }
       
   514     else if( MapAgainst(aKey, aMode, KChineseTone3, EPtiCaseLower))
       
   515         {
       
   516         return ETrue;
       
   517         }
       
   518     else if( MapAgainst(aKey, aMode, KChineseTone4, EPtiCaseLower))
       
   519         {
       
   520         return ETrue;
       
   521         }
       
   522     else if( MapAgainst(aKey, aMode, KChineseTone0, EPtiCaseLower))
       
   523         {
       
   524         return ETrue;
       
   525         }
       
   526     return EFalse;
       
   527     }
   478 // ---------------------------------------------------------------------------
   528 // ---------------------------------------------------------------------------
   479 // CAknFepUIManagerChinese::IsValidChineseInputKeyQwerty
   529 // CAknFepUIManagerChinese::IsValidChineseInputKeyQwerty
   480 // 
   530 // 
   481 // 
   531 // 
   482 // ---------------------------------------------------------------------------
   532 // ---------------------------------------------------------------------------
   493         }
   543         }
   494 #endif
   544 #endif
   495 
   545 
   496     if(iMode == EPinyin)
   546     if(iMode == EPinyin)
   497         {
   547         {
   498         if( (aKey >= EPtiKeyQwertyA && aKey <= EPtiKeyQwertyZ) ||
   548         if( IsValidChineseInputSymbol(aKey, EPtiEnginePinyinPhraseQwerty) ||
   499         	(aKey >= EPtiKeyQwerty1 && aKey <= EPtiKeyQwerty9) ||
       
   500             (IsFlagSet(ESupportPinyinPhrase) && aKey == EPtiKeyQwertyApostrophe 
   549             (IsFlagSet(ESupportPinyinPhrase) && aKey == EPtiKeyQwertyApostrophe 
   501              && State() != EInitial))
   550              && State() != EInitial))
   502             {
   551             {
   503             response = ETrue;
   552             response = ETrue;
   504             }
   553             }
   600         }
   649         }
   601 #endif
   650 #endif
   602     
   651     
   603     if(iMode == ECangJie)
   652     if(iMode == ECangJie)
   604         {
   653         {
   605         if (aKey >= EPtiKeyQwertyA && aKey <= EPtiKeyQwertyZ)
   654         response = IsValidChineseInputSymbol(aKey, (TPtiEngineInputMode)iFepMan->CangJieMode());
   606             {
       
   607             response = ETrue;
       
   608             }
       
   609         }
   655         }
   610     
   656     
   611     if(iMode == EZhuyin || iMode == EZhuyinFind)
   657     if(iMode == EZhuyin || iMode == EZhuyinFind)
   612         {
   658         {
   613 #ifdef RD_INTELLIGENT_TEXT_INPUT        
   659 #ifdef RD_INTELLIGENT_TEXT_INPUT        
   614         if(EPtiKeyboardQwerty4x10 == keyboardType ||
       
   615            EPtiKeyboardQwerty3x11 == keyboardType )
       
   616             {
       
   617             TBuf<KMaxName> lowerdata;
       
   618             iPtiEngine->MappingDataForKey((TPtiKey)aKey, lowerdata, EPtiCaseLower);
       
   619        //     TInt ZhuyinUnicodeCur =0;
   660        //     TInt ZhuyinUnicodeCur =0;
   620             for(TInt i=0;i<lowerdata.Length();i++)
   661         if (  EPtiKeyboardHalfQwerty == keyboardType )
   621                 {
       
   622                 if(lowerdata[i]==KZhuyinIndicator)
       
   623                     {
       
   624                 response = ETrue;
       
   625                 }   
       
   626                 }
       
   627             }
       
   628         else if( EPtiKeyboardCustomQwerty == keyboardType)        
       
   629             {
       
   630 			if((aKey >= EPtiKeyQwertyA && aKey <= EPtiKeyQwertyZ))
       
   631     			{
       
   632 				response = ETrue;        
       
   633     			}       	
       
   634             }
       
   635         else if (  EPtiKeyboardHalfQwerty == keyboardType )
       
   636             {
   662             {
   637             if((aKey >= EPtiKeyQwertyA && aKey <= EPtiKeyQwertyZ) || 
   663             if((aKey >= EPtiKeyQwertyA && aKey <= EPtiKeyQwertyZ) || 
   638                     (aKey >= EPtiKey0 && aKey <= EPtiKey9) ||
   664                     (aKey >= EPtiKey0 && aKey <= EPtiKey9) ||
   639                     aKey == EPtiKeyQwertySpace )
   665                     aKey == EPtiKeyQwertySpace )
   640                 {
   666                 {
   642                 }  
   668                 }  
   643             }
   669             }
   644         else
   670         else
   645             {
   671             {
   646 #endif
   672 #endif
   647         if((aKey >= EPtiKeyQwertyA && aKey <= EPtiKeyQwertyZ) ||
   673           if(IsValidChineseInputSymbol(aKey, (TPtiEngineInputMode)EPtiEngineZhuyinPhraseQwerty))
   648             (aKey >= EPtiKeyQwerty0 && aKey <= EPtiKeyQwerty9)||
       
   649             (aKey == EPtiKeyQwertySemicolon) ||
       
   650             (aKey == EPtiKeyQwertyApostrophe) ||
       
   651             (aKey == EPtiKeyQwertyComma) ||
       
   652             (aKey == EPtiKeyQwertyFullstop) ||
       
   653             (aKey == EPtiKeyQwertySlash))
       
   654             {
   674             {
   655             response = ETrue;        
   675             response = ETrue;        
   656             }
   676             }
   657         }
   677         }
   658 #ifdef RD_INTELLIGENT_TEXT_INPUT        
   678 #ifdef RD_INTELLIGENT_TEXT_INPUT        
   695         }
   715         }
   696 
   716 
   697     if(iQwertyMode && (iMode == EZhuyin) && supportSCTToneMarks)
   717     if(iQwertyMode && (iMode == EZhuyin) && supportSCTToneMarks)
   698         {
   718         {
   699 #ifdef RD_INTELLIGENT_TEXT_INPUT 
   719 #ifdef RD_INTELLIGENT_TEXT_INPUT 
   700         if( keyboardType == EPtiKeyboardQwerty4x12)
   720         return IsValidChineseToneMarkKey(aKey, EPtiEngineZhuyinPhraseQwerty);            
   701             {
       
   702 #endif            
       
   703             if(aKey == EPtiKeyQwerty3 || aKey == EPtiKeyQwerty4 || aKey == EPtiKeyQwerty6 || aKey == EPtiKeyQwerty7)
       
   704                 {
       
   705                 return ETrue;
       
   706                 }
       
   707             else
       
   708                 {
       
   709                 return EFalse;
       
   710                 }
       
   711 #ifdef RD_INTELLIGENT_TEXT_INPUT 
       
   712             }
       
   713         else if( keyboardType == EPtiKeyboardQwerty4x10 || keyboardType == EPtiKeyboardQwerty3x11)
       
   714             {
       
   715             if(aKey == EPtiKeyQwertyE || aKey == EPtiKeyQwertyR || aKey == EPtiKeyQwertyY || aKey == EPtiKeyQwertyU)
       
   716                 {
       
   717                 return ETrue;
       
   718                 }
       
   719             else
       
   720                 {
       
   721                 return EFalse;
       
   722                 }
       
   723             }
       
   724 #endif        
   721 #endif        
   725         }
   722         }
   726     else 
   723     else 
   727         {
   724         {
   728         return EFalse;
   725         return EFalse;
   729         }
   726         }
   730     return EFalse;
       
   731     }
   727     }
   732 
   728 
   733 // ---------------------------------------------------------------------------
   729 // ---------------------------------------------------------------------------
   734 // CAknFepUIManagerChinese::GetLatestDeliberateSelection
   730 // CAknFepUIManagerChinese::GetLatestDeliberateSelection
   735 // 
   731 //