textinput/peninputfingerhwrar/src/peninputfingerhwrardatastore.cpp
branchRCL_3
changeset 5 a47de9135b21
parent 3 f5a1e66df979
child 7 6defe5d1bd39
equal deleted inserted replaced
3:f5a1e66df979 5:a47de9135b21
    19 #include <centralrepository.h>
    19 #include <centralrepository.h>
    20 #include <settingsinternalcrkeys.h>
    20 #include <settingsinternalcrkeys.h>
    21 
    21 
    22 //FEP INCLUDE
    22 //FEP INCLUDE
    23 #include <aknfeppeninputenums.h>
    23 #include <aknfeppeninputenums.h>
    24 #include <AknFepGlobalEnums.h>
    24 #include <aknfepglobalenums.h>
    25 #include <AknFepInternalCRKeys.h>
    25 #include <aknfepinternalcrkeys.h>
    26 
    26 
    27 //USER INCLUDE
    27 //USER INCLUDE
    28 #include "peninputfingerhwrarlayout.h"
    28 #include "peninputfingerhwrarlayout.h"
    29 #include "peninputfingerhwrardatastore.h"
    29 #include "peninputfingerhwrardatastore.h"
    30 #include "peninputfingerhwrarengine.h"
    30 #include "peninputfingerhwrarengine.h"
   135 // ----------------------------------------------------------------------------
   135 // ----------------------------------------------------------------------------
   136 //
   136 //
   137  void CPeninputFingerHwrArDataStore::SetArabicSymbolL()
   137  void CPeninputFingerHwrArDataStore::SetArabicSymbolL()
   138     {
   138     {
   139     iCandidates.ResetAndDestroy();
   139     iCandidates.ResetAndDestroy();
   140 //    TInt symCount = sizeof( ChineseSymbolCode )/sizeof( TUint16 ); 	
   140     }
   141 //    
       
   142 //    for( TInt i = 0; i < symCount; i++ )
       
   143 //        {
       
   144 //        TBuf<1> charBuf;
       
   145 //        charBuf.Append( ChineseSymbolCode[i] );
       
   146 //
       
   147 //        iCandidates.AppendL( charBuf.AllocL() );
       
   148 //        }    
       
   149     
       
   150     }
       
   151 
       
   152 
       
   153 // ----------------------------------------------------------------------------
       
   154 // Set fixed English symbols
       
   155 // ----------------------------------------------------------------------------
       
   156 //
       
   157   void CPeninputFingerHwrArDataStore::SetFixEnglishSymbolL(TRowCount aRowCount)
       
   158     {
       
   159     TInt symCount = 0;
       
   160     
       
   161     switch(aRowCount)
       
   162         {
       
   163         case ERowOne: // only set one row dropdownlist
       
   164             {
       
   165             iCandidates.ResetAndDestroy();
       
   166             symCount = sizeof( EnglishSymbolCodeOneRow )/sizeof( TUint16 );
       
   167             for( TInt i = 0; i < symCount; i++ )
       
   168                 {
       
   169                 TBuf<1> charBuf;            
       
   170                 charBuf.Append( EnglishSymbolCodeOneRow[i] );
       
   171                 iCandidates.AppendL( charBuf.AllocL() );
       
   172                 }
       
   173             }
       
   174             break;
       
   175         case ERowTwo: // Set two rows dropdownlist
       
   176             {
       
   177             iCandidates.ResetAndDestroy();
       
   178             symCount = sizeof( EnglishSymbolCodeTwoRow )/sizeof( TUint16 );
       
   179             
       
   180             for( TInt i = 0; i < symCount; i++ )
       
   181                 {
       
   182                 TBuf<1> charBuf1; // the first row
       
   183                 TBuf<2> charBuf2; // the second row           
       
   184                 
       
   185                 charBuf1.Append( EnglishSymbolCodeOneRow[i] );
       
   186                 iCandidates.AppendL( charBuf1.AllocL() );
       
   187                 
       
   188                 if(i > 2) // for smile symbol
       
   189                     {
       
   190                     charBuf2.Append(ColonSymbol);
       
   191                     } 
       
   192                 charBuf2.Append( EnglishSymbolCodeTwoRow[i] );
       
   193                
       
   194                } 
       
   195             }
       
   196             break;
       
   197         default:
       
   198             break;
       
   199         }
       
   200     }   
       
   201 
       
   202 
       
   203 
   141 
   204 // ----------------------------------------------------------------------------
   142 // ----------------------------------------------------------------------------
   205 // Set permitted ranges
   143 // Set permitted ranges
   206 // ----------------------------------------------------------------------------
   144 // ----------------------------------------------------------------------------
   207 //
   145 //
   358             }   
   296             }   
   359         
   297         
   360         }
   298         }
   361     else
   299     else
   362         {
   300         {
   363         // aLanguage is Chinese
   301         // aLanguage is arabic
   364         if ( iLanguage != aLanguage )
   302         if ( iLanguage != aLanguage )
   365             {
   303             {
   366             iLanguage = aLanguage;
   304             iLanguage = aLanguage;
   367             
   305             
   368             SetEngineLanguageL( iLanguage );
   306             SetEngineLanguageL( iLanguage );
   857                     }
   795                     }
   858                 insertPos++;
   796                 insertPos++;
   859                 }
   797                 }
   860             }
   798             }
   861         }
   799         }
   862     else if(iFirstCandidateType == ECandArabicCharFirst)
       
   863         {
       
   864         for(TInt i = 0; i < candCount; i++)
       
   865             {
       
   866             TUint16 unicode = (*iCandidates[i])[0];
       
   867             if(IsArabicChar(unicode))
       
   868                 {
       
   869                 if(insertPos < i)
       
   870                     {
       
   871                     iCandidates.Insert(iCandidates[i],insertPos);
       
   872                     iCandidates.Remove(i+1);
       
   873                     }
       
   874                 insertPos++;
       
   875                 }
       
   876             }    
       
   877         }
       
   878     }
   800     }
   879 
   801 
   880 // ----------------------------------------------------------------------------
   802 // ----------------------------------------------------------------------------
   881 // CPeninputFingerHwrArDataStore::IsLatinNumber
   803 // CPeninputFingerHwrArDataStore::IsLatinNumber
   882 // ----------------------------------------------------------------------------
   804 // ----------------------------------------------------------------------------
   918 		}
   840 		}
   919 	
   841 	
   920     return EFalse;	
   842     return EFalse;	
   921 	}
   843 	}
   922 	
   844 	
   923 // ----------------------------------------------------------------------------
       
   924 // CPeninputFingerHwrArDataStore::IsArabicChar
       
   925 // ----------------------------------------------------------------------------
       
   926 //  
       
   927 TBool CPeninputFingerHwrArDataStore::IsArabicChar(TUint16 aChar)
       
   928     {
       
   929     if((aChar >= 0x0600 && aChar <= 0x06FF && !IsArabicNumber(aChar) && 
       
   930             !IsArabicSymbol(aChar)) ||
       
   931             (aChar >= 0x0750 && aChar <= 0x077F) ||
       
   932             (aChar >= 0xFB50 && aChar <= 0xFDFF) ||
       
   933             (aChar >= 0xFE70 && aChar <= 0xFEFF))
       
   934         {
       
   935         return ETrue;
       
   936         }
       
   937     
       
   938     return EFalse;  
       
   939     }
       
   940 
       
   941 // ----------------------------------------------------------------------------
       
   942 // CPeninputFingerHwrArDataStore::IsArabicSymbol
       
   943 // ----------------------------------------------------------------------------
       
   944 //  
       
   945 TBool CPeninputFingerHwrArDataStore::IsArabicSymbol(TUint16 aChar)
       
   946     {
       
   947     if(aChar == 0x061B || aChar == 0x061F || 
       
   948             aChar == 0x060C || aChar == 0x066A)
       
   949         {
       
   950         return ETrue;
       
   951         }
       
   952     
       
   953     return EFalse;  
       
   954     }
       
   955 
       
   956 // End Of File
   845 // End Of File