textinput/peninputgenericvkb/src/peninputgenericlafdatamgr.cpp
branchRCL_3
changeset 22 bd83ceabce89
parent 21 ecbabf52600f
equal deleted inserted replaced
21:ecbabf52600f 22:bd83ceabce89
  1036     rect.Move( - base.iX, - base.iY );
  1036     rect.Move( - base.iX, - base.iY );
  1037     aDataInfo.iClientRect = rect;
  1037     aDataInfo.iClientRect = rect;
  1038     aDataInfo.iQwtRect = aParentWndRect;
  1038     aDataInfo.iQwtRect = aParentWndRect;
  1039     
  1039     
  1040     TInt v1, v2, gridLayoutVariant;
  1040     TInt v1, v2, gridLayoutVariant;
       
  1041 
       
  1042     // Get the variant for Portrait QWERTY
       
  1043     TInt cellVariantForPortraitQWERTY;
       
  1044     
  1041     switch ( aLayoutType )
  1045     switch ( aLayoutType )
  1042         {
  1046         {
  1043         case ELayout10x3:
  1047         case ELayout10x3:
  1044             {
  1048             {
  1045             v1 = 0;
  1049             v1 = 0;
  1046             v2 = 0;
  1050             v2 = 0;
       
  1051             cellVariantForPortraitQWERTY = 0;
  1047             gridLayoutVariant = 1;
  1052             gridLayoutVariant = 1;
  1048             break;
  1053             break;
  1049             }
  1054             }
  1050         case ELayout11x3:
  1055         case ELayout11x3:
  1051             {
  1056             {
  1052             v1 = 1;
  1057             v1 = 1;
  1053             v2 = 2;
  1058             v2 = 2;
       
  1059             cellVariantForPortraitQWERTY = 2;
  1054             gridLayoutVariant = 1;
  1060             gridLayoutVariant = 1;
  1055             break;
  1061             break;
  1056             }
  1062             }
  1057         case ELayout11x4:
  1063         case ELayout11x4:
  1058             {
  1064             {
  1059             v1 = 1;
  1065             v1 = 1;
  1060             v2 = 3;
  1066             v2 = 3;
       
  1067             cellVariantForPortraitQWERTY = 3;
  1061             gridLayoutVariant = 2;
  1068             gridLayoutVariant = 2;
  1062             break;
  1069             break;
  1063             }
  1070             }
  1064         default:
  1071         default:
  1065             {
  1072             {
  1066             v1 = 0;
  1073             v1 = 0;
  1067             v2 = 0;
  1074             v2 = 0;
       
  1075             cellVariantForPortraitQWERTY = 0;
  1068             gridLayoutVariant = 1;
  1076             gridLayoutVariant = 1;
       
  1077             break;
  1069             }
  1078             }
  1070         }
  1079         }
  1071     
  1080     
  1072     // Landscape info is set if i) portrait FSQ feature is not enabled (landscape FSQ)
  1081     // Landscape info is set if i) portrait FSQ feature is not enabled (landscape FSQ)
  1073     // or ii) portrait FSQ feature is enabled and the current orientation is landscape. 
  1082     // or ii) portrait FSQ feature is enabled and the current orientation is landscape. 
  1162     
  1171     
  1163     // keypad pane rect
  1172     // keypad pane rect
  1164     linelayout = AknLayoutScalable_Avkon::grid_vkbss_keypad_pane(v1).LayoutLine();
  1173     linelayout = AknLayoutScalable_Avkon::grid_vkbss_keypad_pane(v1).LayoutLine();
  1165     keypadRect.LayoutRect( rectBottomWin, linelayout );
  1174     keypadRect.LayoutRect( rectBottomWin, linelayout );
  1166     
  1175     
       
  1176     TInt rowNumberOfKeyboard;
       
  1177     TInt gapValue;
       
  1178     switch ( aLayoutType )
       
  1179         {
       
  1180         case ELayout10x3:
       
  1181             {
       
  1182             rowNumberOfKeyboard = 3;
       
  1183             break;
       
  1184             }
       
  1185         case ELayout11x3:
       
  1186             {
       
  1187             rowNumberOfKeyboard = 3;
       
  1188             break;
       
  1189             }
       
  1190         case ELayout11x4:
       
  1191             {
       
  1192             rowNumberOfKeyboard = 4;
       
  1193             break;
       
  1194             }
       
  1195         default:
       
  1196             {
       
  1197             rowNumberOfKeyboard = 3;
       
  1198             break;
       
  1199             }
       
  1200         }
       
  1201     
  1167     if ( !isPortraitFSQEnabled ||
  1202     if ( !isPortraitFSQEnabled ||
  1168         ( isPortraitFSQEnabled && Layout_Meta_Data::IsLandscapeOrientation() ) )
  1203         ( isPortraitFSQEnabled && Layout_Meta_Data::IsLandscapeOrientation() ) )
  1169         {
  1204         {
  1170         // key pane rect
  1205         // key pane rect
  1171         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(v2).LayoutLine();
  1206         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(v2).LayoutLine();
  1190         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_3p_pane_g3(0).LayoutLine();
  1225         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_3p_pane_g3(0).LayoutLine();
  1191         layoutrect.LayoutRect( pic3paneRect.Rect(), linelayout );
  1226         layoutrect.LayoutRect( pic3paneRect.Rect(), linelayout );
  1192         pic3pRightWidth = layoutrect.Rect().Width();
  1227         pic3pRightWidth = layoutrect.Rect().Width();
  1193         
  1228         
  1194         TRect rectXPane = keypaneRect.Rect();
  1229         TRect rectXPane = keypaneRect.Rect();
  1195         rect = keycellRect.Rect();
  1230         
       
  1231         // the key rect without gap
       
  1232         rect = keypaneRect.Rect();
       
  1233     
  1196         rect.Move( - rectXPane.iTl.iX, - rectXPane.iTl.iY );
  1234         rect.Move( - rectXPane.iTl.iX, - rectXPane.iTl.iY );
  1197         TRect rectXBorder = rect;
  1235         TRect rectXBorder = rect;
  1198         rect = keylabelRect.Rect();
  1236         rect = keylabelRect.Rect();
  1199         rect.Move( - rectXPane.iTl.iX, - rectXPane.iTl.iY );
  1237         rect.Move( - rectXPane.iTl.iX, - rectXPane.iTl.iY );
  1200         TRect rectXInner = rect;
  1238         TRect rectXInner = rect;
  1203         TRect rect3PicPane = rect;
  1241         TRect rect3PicPane = rect;
  1204         rectXPane.Move( - rectXPane.iTl );
  1242         rectXPane.Move( - rectXPane.iTl );
  1205         
  1243         
  1206         rect = keypadRect.Rect();
  1244         rect = keypadRect.Rect();
  1207         rect.Move( - base.iX, - base.iY );
  1245         rect.Move( - base.iX, - base.iY );
  1208         TRect rectOfKeypad = rect;
  1246     
  1209         TRect rectOfButtons = rectOfKeypad;
  1247         TRect rectOfButtons = rect;
  1210         rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  1248         // The gap between the top of the first row key and the top of the keyboard
  1211         rectOfButtons.iTl.iY += rectOfKeypad.Height();
  1249         gapValue = keypaneRect.Rect().iTl.iY - keypadRect.Rect().iTl.iY;
  1212         
  1250         // compute the top left Y coordinate of the function buttons
       
  1251         rectOfButtons.iTl.iY = rectOfButtons.iTl.iY + 
       
  1252     		keypaneRect.Rect().Height() * rowNumberOfKeyboard + gapValue;
       
  1253     
  1213         TInt spaceBtnWidth = rectOfButtons.Width() - rectXPane.Width() * 8;
  1254         TInt spaceBtnWidth = rectOfButtons.Width() - rectXPane.Width() * 8;
  1214         TInt dx = rectOfButtons.iTl.iX;
  1255         TInt dx = rectOfButtons.iTl.iX;
  1215         TInt dy = rectOfButtons.iTl.iY;
  1256         TInt dy = rectOfButtons.iTl.iY;
  1216         
  1257         
  1217         aDataInfo.iCloseButton.iRect = OffsetRect( rectXBorder, dx, dy );
  1258         aDataInfo.iCloseButton.iRect = OffsetRect( rectXBorder, dx, dy );
  1268 
  1309 
  1269         // key pane rect
  1310         // key pane rect
  1270         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(15).LayoutLine();
  1311         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(15).LayoutLine();
  1271         bottomRowRect.LayoutRect( keypadRect.Rect(), linelayout );
  1312         bottomRowRect.LayoutRect( keypadRect.Rect(), linelayout );
  1272         
  1313         
  1273         // key cell rect
  1314         // key cell rect with out gap
  1274         linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(8).LayoutLine();
  1315         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(15).LayoutLine();
  1275         keycellRect.LayoutRect( bottomRowRect.Rect(), linelayout );
  1316         keycellRect.LayoutRect( bottomRowRect.Rect(), linelayout );
  1276         
  1317         
  1277         // key label rect
  1318         // key label rect
  1278         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(8).LayoutLine();
  1319         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(8).LayoutLine();
  1279         keylabelRect.LayoutRect( bottomRowRect.Rect(), linelayout );
  1320         keylabelRect.LayoutRect( bottomRowRect.Rect(), linelayout );
  1287         TRect rectXInner = rect;
  1328         TRect rectXInner = rect;
  1288         rectXPane.Move( - rectXPane.iTl );
  1329         rectXPane.Move( - rectXPane.iTl );
  1289         
  1330         
  1290         rect = keypadRect.Rect();
  1331         rect = keypadRect.Rect();
  1291         rect.Move( - base.iX, - base.iY );
  1332         rect.Move( - base.iX, - base.iY );
  1292         TRect rectOfKeypad = rect;
  1333         
  1293         TRect rectOfButtons = rectOfKeypad;
  1334         // Get the height of one key
  1294         rectOfKeypad.iBr.iY -= ( bottomRowRect.Rect().Height() );
  1335         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane( 
  1295         rectOfButtons.iTl.iY += rectOfKeypad.Height();
  1336         		cellVariantForPortraitQWERTY ).LayoutLine();
       
  1337         keycellRect.LayoutRect( keypadRect.Rect(), linelayout );
       
  1338         TInt theHeightOfTheKey = keycellRect.Rect().Height();
       
  1339         // Compute the gap between the top of the first row key and 
       
  1340         // the top of the keyboard
       
  1341         gapValue = keycellRect.Rect().iTl.iY - keypadRect.Rect().iTl.iY;
       
  1342         // Get the second row function button's height
       
  1343         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(4).LayoutLine();
       
  1344         keycellRect.LayoutRect( keypadRect.Rect(), linelayout );
       
  1345         
       
  1346         TRect rectOfButtons = rect;
       
  1347         // compute the top left Y coordinate of the first row function buttons
       
  1348         rectOfButtons.iTl.iY += keycellRect.Rect().Height() + 
       
  1349         		theHeightOfTheKey * rowNumberOfKeyboard + gapValue + 1;
  1296         
  1350         
  1297         TInt dx = rectOfButtons.iTl.iX;
  1351         TInt dx = rectOfButtons.iTl.iX;
  1298         TInt dy = rectOfButtons.iTl.iY;
  1352         TInt dy = rectOfButtons.iTl.iY;
  1299 
  1353 
  1300         // CLOSE (15)
  1354         // CLOSE (15)
  1330         
  1384         
  1331         // SHIFT (keypane v=4, keycell v=4, keylabel v=4)
  1385         // SHIFT (keypane v=4, keycell v=4, keylabel v=4)
  1332         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(4).LayoutLine();
  1386         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(4).LayoutLine();
  1333         shiftRect.LayoutRect( keypadRect.Rect(), linelayout );
  1387         shiftRect.LayoutRect( keypadRect.Rect(), linelayout );
  1334         
  1388         
  1335         // key cell rect
  1389         // key cell rect without gap
  1336         linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(4).LayoutLine();
  1390         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(4).LayoutLine();
  1337         keycellRect.LayoutRect( shiftRect.Rect(), linelayout );
  1391         keycellRect.LayoutRect( shiftRect.Rect(), linelayout );
  1338         
  1392         
  1339         // key label rect
  1393         // key label rect
  1340         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(4).LayoutLine();
  1394         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(4).LayoutLine();
  1341         keylabelRect.LayoutRect( shiftRect.Rect(), linelayout );
  1395         keylabelRect.LayoutRect( shiftRect.Rect(), linelayout );
  1349         rectXInner = rect;
  1403         rectXInner = rect;
  1350         rectXPane.Move( - rectXPane.iTl );
  1404         rectXPane.Move( - rectXPane.iTl );
  1351         
  1405         
  1352         // Update the height to account for the second row
  1406         // Update the height to account for the second row
  1353         rectOfButtons.iTl.iY -= shiftRect.Rect().Height();
  1407         rectOfButtons.iTl.iY -= shiftRect.Rect().Height();
       
  1408         // adjust the Y coordinate
       
  1409         rectOfButtons.iTl.iY -= 1;
  1354         
  1410         
  1355         dx = rectOfButtons.iTl.iX;
  1411         dx = rectOfButtons.iTl.iX;
  1356         dy = rectOfButtons.iTl.iY;
  1412         dy = rectOfButtons.iTl.iY;
  1357 
  1413 
  1358         aDataInfo.iShiftButton.iRect = OffsetRect( rectXBorder, dx, dy );
  1414         aDataInfo.iShiftButton.iRect = OffsetRect( rectXBorder, dx, dy );
  1361         
  1417         
  1362         // SPACE (keypane v=8, keycell v=5, keylabel v=5, pic3pane v=5)
  1418         // SPACE (keypane v=8, keycell v=5, keylabel v=5, pic3pane v=5)
  1363         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(8).LayoutLine();
  1419         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(8).LayoutLine();
  1364         spaceRect.LayoutRect( keypadRect.Rect(), linelayout );
  1420         spaceRect.LayoutRect( keypadRect.Rect(), linelayout );
  1365         
  1421         
  1366         // key cell rect
  1422         // key cell rect without gap
  1367         linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(5).LayoutLine();
  1423         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(8).LayoutLine();
  1368         keycellRect.LayoutRect( spaceRect.Rect(), linelayout );
  1424         keycellRect.LayoutRect( spaceRect.Rect(), linelayout );
  1369         
  1425         
  1370         // key label rect
  1426         // key label rect
  1371         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(5).LayoutLine();
  1427         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(5).LayoutLine();
  1372         keylabelRect.LayoutRect( spaceRect.Rect(), linelayout );
  1428         keylabelRect.LayoutRect( spaceRect.Rect(), linelayout );
  1658     TAknLayoutRect keypadRect, cellpaneRect;
  1714     TAknLayoutRect keypadRect, cellpaneRect;
  1659     TAknLayoutRect wndRect;
  1715     TAknLayoutRect wndRect;
  1660     TAknLayoutText keyTextLayout; 
  1716     TAknLayoutText keyTextLayout; 
  1661 	TAknTextLineLayout keyText;
  1717 	TAknTextLineLayout keyText;
  1662 	TRect keyRect;
  1718 	TRect keyRect;
       
  1719 	// The gap value of keyboard
       
  1720 	TInt gapValue;
  1663 
  1721 
  1664     TBool isLandscape = Layout_Meta_Data::IsLandscapeOrientation();
  1722     TBool isLandscape = Layout_Meta_Data::IsLandscapeOrientation();
  1665 
  1723 
  1666 	// -----------------------Landscape Mode--------------------------
  1724 	// -----------------------Landscape Mode--------------------------
  1667 	appWnd = AknLayoutScalable_Avkon::application_window(0).LayoutLine();
  1725 	appWnd = AknLayoutScalable_Avkon::application_window(0).LayoutLine();
  1731         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(0).LayoutLine();
  1789         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(0).LayoutLine();
  1732         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  1790         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  1733         }
  1791         }
  1734   	    
  1792   	    
  1735   	rectVkbCtrl = keypadRect.Rect();
  1793   	rectVkbCtrl = keypadRect.Rect();
  1736     rectVkbCtrl.iBr.iY -= functionKeyRowsHeight;
  1794   	// Compute the gap between first row key's top line and keyboard's top line
       
  1795   	gapValue = keypaneRect.Rect().iTl.iY - rectVkbCtrl.iTl.iY;
       
  1796   	// Compute keyboard position
       
  1797   	rectVkbCtrl.iBr.iY = rectVkbCtrl.iTl.iY + keypaneRect.Rect().Height() * 3 + gapValue;
       
  1798   	rectVkbCtrl.iTl.iY += gapValue;
       
  1799   	
  1737   	dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;
  1800   	dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;
  1738 
  1801 
  1739   	linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(0).LayoutLine();
  1802   	linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(0).LayoutLine();
  1740   	keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1803   	keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1741   	
  1804   	
  1742   	linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(0).LayoutLine();
  1805   	linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(0).LayoutLine();
  1743   	keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1806   	keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1744 
  1807 
  1745   	linelayout = AknLayoutScalable_Avkon::aid_vkbss_key_offset(0).LayoutLine();    
       
  1746   	layoutrect.LayoutRect( keypadRect.Rect(), linelayout );
       
  1747   	TInt rowIndentWidth = layoutrect.Rect().Width();
       
  1748   	
       
  1749     TRect rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  1808     TRect rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  1750     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  1809     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  1751   	
  1810   	
  1752     TRect rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  1811     TRect rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  1753     TRect rectXBorder = RelativeRect( keycellRect.Rect(), base );
  1812     TRect rectXBorder = RelativeRect( keycellRect.Rect(), base );
  1757     rectXBorder.Move( - rectOfKeypad.iTl );
  1816     rectXBorder.Move( - rectOfKeypad.iTl );
  1758     rectXInner.Move( - rectOfKeypad.iTl );
  1817     rectXInner.Move( - rectOfKeypad.iTl );
  1759   	
  1818   	
  1760   	for( TInt i = 0; i < KKeypadLayout[0][1]; i++)
  1819   	for( TInt i = 0; i < KKeypadLayout[0][1]; i++)
  1761   		{
  1820   		{
  1762   		TInt indent = ( i % 2 == 1 ) ? rowIndentWidth : 0;
       
  1763   		for( TInt j = 0; j < KKeypadLayout[0][0]; j++)
  1821   		for( TInt j = 0; j < KKeypadLayout[0][0]; j++)
  1764             {
  1822             {
  1765 			TRect bound = rectXPane;
  1823 			TRect bound = rectXPane;
  1766             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1824             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1767             bound.Move( indent, 0 );
       
  1768             
  1825             
  1769             dataInfo->iKeypad.iRects.AppendL( bound );
  1826             dataInfo->iKeypad.iRects.AppendL( bound );
  1770             
  1827             
  1771             TRect inner = rectXPane;
  1828             TRect inner = rectXPane;
  1772             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1829             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1773             inner.Move( indent, 0 );        
       
  1774             
  1830             
  1775             TAknLayoutText keyTextLayout; 
  1831             TAknLayoutText keyTextLayout; 
  1776             keyTextLayout.LayoutText( inner, keyText );
  1832             keyTextLayout.LayoutText( inner, keyText );
  1777             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  1833             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  1778             }
  1834             }
  1886         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(2).LayoutLine();
  1942         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(2).LayoutLine();
  1887         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  1943         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  1888         }
  1944         }
  1889   	    
  1945   	    
  1890   	rectVkbCtrl = keypadRect.Rect();
  1946   	rectVkbCtrl = keypadRect.Rect();
  1891     rectVkbCtrl.iBr.iY -= functionKeyRowsHeight;
  1947     
       
  1948   	// Compute the gap between first row key's top line and keyboard's top line
       
  1949     gapValue = keypaneRect.Rect().iTl.iY - rectVkbCtrl.iTl.iY;
       
  1950     // Compute keyboard position
       
  1951     rectVkbCtrl.iBr.iY = rectVkbCtrl.iTl.iY + keypaneRect.Rect().Height() * 3 + gapValue;
       
  1952     rectVkbCtrl.iTl.iY += gapValue;
       
  1953     
  1892     dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;
  1954     dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;
  1893 
  1955 
  1894     linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(2).LayoutLine();
  1956     linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(2).LayoutLine();
  1895     keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1957     keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1896     
  1958     
  1897     linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(2).LayoutLine();
  1959     linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(2).LayoutLine();
  1898     keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1960     keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1899 
  1961 
  1900     linelayout = AknLayoutScalable_Avkon::aid_vkbss_key_offset(1).LayoutLine();    
       
  1901     layoutrect.LayoutRect( keypadRect.Rect(), linelayout );
       
  1902     rowIndentWidth = layoutrect.Rect().Width();
       
  1903     
       
  1904     rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  1962     rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  1905     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  1963     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  1906     
  1964     
  1907     rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  1965     rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  1908     rectXBorder = RelativeRect( keycellRect.Rect(), base );
  1966     rectXBorder = RelativeRect( keycellRect.Rect(), base );
  1912     rectXBorder.Move( - rectOfKeypad.iTl );
  1970     rectXBorder.Move( - rectOfKeypad.iTl );
  1913     rectXInner.Move( - rectOfKeypad.iTl );
  1971     rectXInner.Move( - rectOfKeypad.iTl );
  1914     
  1972     
  1915     for( TInt i = 0; i < KKeypadLayout[1][1]; i++)
  1973     for( TInt i = 0; i < KKeypadLayout[1][1]; i++)
  1916         {
  1974         {
  1917         TInt indent = ( i % 2 == 1 ) ? rowIndentWidth : 0;
       
  1918         for( TInt j = 0; j < KKeypadLayout[1][0]; j++)
  1975         for( TInt j = 0; j < KKeypadLayout[1][0]; j++)
  1919             {
  1976             {
  1920 		    TRect bound = rectXPane;
  1977 		    TRect bound = rectXPane;
  1921             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1978             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1922             bound.Move( indent, 0 );
       
  1923             
  1979             
  1924             dataInfo->iKeypad.iRects.AppendL( bound );
  1980             dataInfo->iKeypad.iRects.AppendL( bound );
  1925             
  1981             
  1926             TRect inner = rectXPane;
  1982             TRect inner = rectXPane;
  1927             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1983             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1928             inner.Move( indent, 0 );        
       
  1929             
  1984             
  1930             TAknLayoutText keyTextLayout; 
  1985             TAknLayoutText keyTextLayout; 
  1931             keyTextLayout.LayoutText( inner, keyText );
  1986             keyTextLayout.LayoutText( inner, keyText );
  1932             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  1987             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  1933             }
  1988             }
  2029         // Reset keypane rect
  2084         // Reset keypane rect
  2030         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(3).LayoutLine();
  2085         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(3).LayoutLine();
  2031         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  2086         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  2032         }
  2087         }
  2033   	    
  2088   	    
  2034   	rectVkbCtrl = keypadRect.Rect();
  2089     rectVkbCtrl = keypadRect.Rect();
  2035     rectVkbCtrl.iBr.iY -= functionKeyRowsHeight;
  2090     
       
  2091     // Compute the gap between first row key's top line and keyboard's top line
       
  2092     gapValue = keypaneRect.Rect().iTl.iY - rectVkbCtrl.iTl.iY;
       
  2093     // Compute keyboard position
       
  2094     rectVkbCtrl.iBr.iY = rectVkbCtrl.iTl.iY + keypaneRect.Rect().Height() * 4 + gapValue;
       
  2095     rectVkbCtrl.iTl.iY += gapValue;
       
  2096     
  2036     dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;    
  2097     dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;    
  2037 
  2098 
  2038     linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(3).LayoutLine();
  2099     linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(3).LayoutLine();
  2039     keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  2100     keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  2040     
  2101     
  2041     linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(3).LayoutLine();
  2102     linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(3).LayoutLine();
  2042     keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  2103     keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  2043 
  2104 
  2044     linelayout = AknLayoutScalable_Avkon::aid_vkbss_key_offset(1).LayoutLine();    
       
  2045     layoutrect.LayoutRect( keypadRect.Rect(), linelayout );
       
  2046     rowIndentWidth = layoutrect.Rect().Width();
       
  2047     
       
  2048     rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  2105     rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  2049     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  2106     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  2050     
  2107     
  2051     rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  2108     rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  2052     rectXBorder = RelativeRect( keycellRect.Rect(), base );
  2109     rectXBorder = RelativeRect( keycellRect.Rect(), base );
  2056     rectXBorder.Move( - rectOfKeypad.iTl );
  2113     rectXBorder.Move( - rectOfKeypad.iTl );
  2057     rectXInner.Move( - rectOfKeypad.iTl );
  2114     rectXInner.Move( - rectOfKeypad.iTl );
  2058     
  2115     
  2059     for( TInt i = 0; i < KKeypadLayout[2][1]; i++)
  2116     for( TInt i = 0; i < KKeypadLayout[2][1]; i++)
  2060         {
  2117         {
  2061         TInt indent = ( i % 2 == 1 ) ? rowIndentWidth : 0;
       
  2062         for( TInt j = 0; j < KKeypadLayout[2][0]; j++)
  2118         for( TInt j = 0; j < KKeypadLayout[2][0]; j++)
  2063             {
  2119             {
  2064 		    TRect bound = rectXPane;
  2120 		    TRect bound = rectXPane;
  2065             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  2121             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  2066             bound.Move( indent, 0 );
       
  2067             
  2122             
  2068             dataInfo->iKeypad.iRects.AppendL( bound );
  2123             dataInfo->iKeypad.iRects.AppendL( bound );
  2069             
  2124             
  2070             TRect inner = rectXPane;
  2125             TRect inner = rectXPane;
  2071             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  2126             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  2072             inner.Move( indent, 0 );        
       
  2073             
  2127             
  2074             TAknLayoutText keyTextLayout; 
  2128             TAknLayoutText keyTextLayout; 
  2075             keyTextLayout.LayoutText( inner, keyText );
  2129             keyTextLayout.LayoutText( inner, keyText );
  2076             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  2130             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  2077             }
  2131             }