textinput/peninputvkbcn/src/peninputvkblayout.cpp
branchRCL_3
changeset 9 e6a39382bb9c
parent 0 eb1f2e154e89
child 11 c8fb4cf7b3ae
equal deleted inserted replaced
8:4eb1ae11334f 9:e6a39382bb9c
   277             break;
   277             break;
   278         case ECmdPenInputDimArrowKeys:
   278         case ECmdPenInputDimArrowKeys:
   279             {
   279             {
   280             TBool IsDimArrowKeys = *aData;
   280             TBool IsDimArrowKeys = *aData;
   281             iVkbWindow->DimArrowKeys( IsDimArrowKeys );
   281             iVkbWindow->DimArrowKeys( IsDimArrowKeys );
       
   282             }
       
   283             break;
       
   284         case ECmdPenInputDimEnterKey:
       
   285             {
       
   286             TBool isDimEnterKey = *((TUint16*)( aData ));
       
   287             iVkbWindow->DimEnterKey( isDimEnterKey );           
   282             }
   288             }
   283             break;
   289             break;
   284         case ECmdPenInputSetPromptText:
   290         case ECmdPenInputSetPromptText:
   285             {
   291             {
   286             if( iLayoutType == EPluginInputModeFSQ )
   292             if( iLayoutType == EPluginInputModeFSQ )
  1122 // Handle show tooltip command.
  1128 // Handle show tooltip command.
  1123 // ---------------------------------------------------------------------------
  1129 // ---------------------------------------------------------------------------
  1124 //
  1130 //
  1125 void CAknFepVkbLayout::HandleShowTooltipOnFSQCmdL( TUint8* aData )
  1131 void CAknFepVkbLayout::HandleShowTooltipOnFSQCmdL( TUint8* aData )
  1126     {
  1132     {
  1127     if ( !iITIEnabled || iLayoutType != EPluginInputModeFSQ )
  1133     if (!iITIEnabled || iLayoutType != EPluginInputModeFSQ)
  1128 		{
  1134 		{
  1129 		return;
  1135 		return;
  1130 		}
  1136 		}
  1131     
  1137     
  1132     TPtr8 buf8( aData, sizeof(TInt32), sizeof(TInt32) );
  1138     TPtr8 buf8(aData, sizeof(TInt32), sizeof(TInt32));
  1133     RDesReadStream readStream;
  1139     RDesReadStream readStream;
  1134     readStream.Open( buf8 );
  1140     readStream.Open(buf8);
  1135     CleanupClosePushL( readStream );
  1141     CleanupClosePushL(readStream);
  1136     TInt dataSize = readStream.ReadInt32L();
  1142     TInt dataSize = readStream.ReadInt32L();
  1137     CleanupStack::PopAndDestroy( &readStream );
  1143     CleanupStack::PopAndDestroy(&readStream);
  1138     if ( dataSize > 0 )
  1144     
  1139         {
  1145     if (dataSize > 0)
  1140         TUint16* dataAddress = (TUint16*)( aData + sizeof(TInt32) );
  1146         {
  1141         HBufC* tooltipText = ReadTextInfoHBufCL( dataAddress, 
  1147         TUint16* dataAddress = (TUint16*)(aData + sizeof(TInt32));
  1142                                                  ( dataSize + 1 )/ 2 );
  1148         HBufC* tooltipText = ReadTextInfoHBufCL(dataAddress, (dataSize + 1) / 2);
  1143         if ( tooltipText )
  1149         if (tooltipText)
  1144             {
  1150             {
  1145             CleanupStack::PushL( tooltipText );
  1151             CleanupStack::PushL(tooltipText);
  1146             iVkbWindow->ShowTooltipOnFSQL( *tooltipText );
  1152             iVkbWindow->ShowTooltipOnFSQL(*tooltipText);
  1147             CleanupStack::PopAndDestroy( tooltipText );
  1153             CleanupStack::PopAndDestroy(tooltipText);
  1148             }        
  1154             }
  1149         }     
  1155         }     
  1150     }
  1156     }
  1151 
  1157 
  1152 // ---------------------------------------------------------------------------
  1158 // ---------------------------------------------------------------------------
  1153 // Handle show candidate list command.
  1159 // Handle show candidate list command.
  1161         }
  1167         }
  1162     
  1168     
  1163     // Read candidate data from a block of memory staring from aData
  1169     // Read candidate data from a block of memory staring from aData
  1164     // The format is activeIndex | count of candiates | 
  1170     // The format is activeIndex | count of candiates | 
  1165     // length 1 | text 1 | length 2 | text 2 |...
  1171     // length 1 | text 1 | length 2 | text 2 |...
  1166     TPtr8 buf8( aData, sizeof( TInt32 )*2, sizeof( TInt32 )*2 );
  1172     TPtr8 buf8( aData, sizeof( TInt32 )* 3, sizeof( TInt32 )* 3 );
  1167     RDesReadStream readStream;
  1173     RDesReadStream readStream;
  1168     readStream.Open( buf8 );
  1174     readStream.Open( buf8 );
  1169     CleanupClosePushL( readStream );
  1175     CleanupClosePushL( readStream );
  1170     // Get activeIndex
  1176     // Get activeIndex
  1171     TInt activeIndex = readStream.ReadInt32L();
  1177     TInt activeIndex = readStream.ReadInt32L();
  1172     // Get count of candidates
  1178     // Get count of candidates
  1173     TInt count = readStream.ReadInt32L();    
  1179     TInt count = readStream.ReadInt32L();   
       
  1180 	TInt langCode = readStream.ReadInt32L();
       
  1181 	TInt align = TBidiText::ScriptDirectionality((TLanguage)langCode); 
       
  1182 	if(align != TBidiText::ELeftToRight)
       
  1183 		align = CGraphicsContext::ERight;
       
  1184 	else
       
  1185 		align = CGraphicsContext::ELeft;
  1174     CleanupStack::PopAndDestroy( &readStream );
  1186     CleanupStack::PopAndDestroy( &readStream );
  1175     
  1187     
  1176     CDesCArray* itemArray = NULL;
  1188     CDesCArray* itemArray = NULL;
  1177     if ( count > 0 )
  1189     if ( count > 0 )
  1178         {        
  1190         {        
  1179         TUint8* curPointer = aData + sizeof(TInt) * 2;
  1191         TUint8* curPointer = aData + sizeof(TInt) * 3;
  1180         itemArray = new (ELeave) CDesCArrayFlat( count );
  1192         itemArray = new (ELeave) CDesCArrayFlat( count );
  1181         CleanupStack::PushL( itemArray );
  1193         CleanupStack::PushL( itemArray );
  1182         for ( TInt i = 0; i < count; i++ )
  1194         for ( TInt i = 0; i < count; i++ )
  1183             {
  1195             {
  1184             // Get length
  1196             // Get length
  1203                     }     
  1215                     }     
  1204                 curPointer += textSize;
  1216                 curPointer += textSize;
  1205                 }
  1217                 }
  1206             }
  1218             }
  1207         
  1219         
  1208         iVkbWindow->ShowCandidateListOnFSQL( itemArray, activeIndex );
  1220         iVkbWindow->ShowCandidateListOnFSQL( align, itemArray, activeIndex );
  1209         CleanupStack::PopAndDestroy( itemArray );
  1221         CleanupStack::PopAndDestroy( itemArray );
  1210         }  
  1222         }  
  1211     }
  1223     }
  1212 
  1224 
  1213 // ---------------------------------------------------------------------------
  1225 // ---------------------------------------------------------------------------