textinput/peninputgenericvkb/src/peninputgenericlafdatamgr.cpp
branchRCL_3
changeset 56 8152b1f1763a
parent 46 bd83ceabce89
equal deleted inserted replaced
50:5a1685599b76 56:8152b1f1763a
  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 
  1041     
  1042     // Get the variant for Portrait QWERTY
  1042     // Get the variant for Portrait QWERTY
  1043     TInt cellVariantForPortraitQWERTY;
  1043     TInt cellVariantForPortraitQWERTY;
  1044     
  1044     
  1045     switch ( aLayoutType )
  1045     switch ( aLayoutType )
  1046         {
  1046         {
  1197             rowNumberOfKeyboard = 3;
  1197             rowNumberOfKeyboard = 3;
  1198             break;
  1198             break;
  1199             }
  1199             }
  1200         }
  1200         }
  1201     
  1201     
       
  1202     
  1202     if ( !isPortraitFSQEnabled ||
  1203     if ( !isPortraitFSQEnabled ||
  1203         ( isPortraitFSQEnabled && Layout_Meta_Data::IsLandscapeOrientation() ) )
  1204         ( isPortraitFSQEnabled && Layout_Meta_Data::IsLandscapeOrientation() ) )
  1204         {
  1205         {
  1205         // key pane rect
  1206         // key pane rect
  1206         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(v2).LayoutLine();
  1207         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(v2).LayoutLine();
  1228         
  1229         
  1229         TRect rectXPane = keypaneRect.Rect();
  1230         TRect rectXPane = keypaneRect.Rect();
  1230         
  1231         
  1231         // the key rect without gap
  1232         // the key rect without gap
  1232         rect = keypaneRect.Rect();
  1233         rect = keypaneRect.Rect();
  1233     
  1234         
  1234         rect.Move( - rectXPane.iTl.iX, - rectXPane.iTl.iY );
  1235         rect.Move( - rectXPane.iTl.iX, - rectXPane.iTl.iY );
  1235         TRect rectXBorder = rect;
  1236         TRect rectXBorder = rect;
  1236         rect = keylabelRect.Rect();
  1237         rect = keylabelRect.Rect();
  1237         rect.Move( - rectXPane.iTl.iX, - rectXPane.iTl.iY );
  1238         rect.Move( - rectXPane.iTl.iX, - rectXPane.iTl.iY );
  1238         TRect rectXInner = rect;
  1239         TRect rectXInner = rect;
  1241         TRect rect3PicPane = rect;
  1242         TRect rect3PicPane = rect;
  1242         rectXPane.Move( - rectXPane.iTl );
  1243         rectXPane.Move( - rectXPane.iTl );
  1243         
  1244         
  1244         rect = keypadRect.Rect();
  1245         rect = keypadRect.Rect();
  1245         rect.Move( - base.iX, - base.iY );
  1246         rect.Move( - base.iX, - base.iY );
  1246     
  1247         
  1247         TRect rectOfButtons = rect;
  1248         TRect rectOfButtons = rect;
  1248         // The gap between the top of the first row key and the top of the keyboard
  1249         // The gap between the top of the first row key and the top of the keyboard
  1249         gapValue = keypaneRect.Rect().iTl.iY - keypadRect.Rect().iTl.iY;
  1250         gapValue = keypaneRect.Rect().iTl.iY - keypadRect.Rect().iTl.iY;
  1250         // compute the top left Y coordinate of the function buttons
  1251         // compute the top left Y coordinate of the function buttons
  1251         rectOfButtons.iTl.iY = rectOfButtons.iTl.iY + 
  1252         rectOfButtons.iTl.iY = rectOfButtons.iTl.iY + 
  1252     		keypaneRect.Rect().Height() * rowNumberOfKeyboard + gapValue;
  1253     		keypaneRect.Rect().Height() * rowNumberOfKeyboard + gapValue;
  1253     
  1254         
  1254         TInt spaceBtnWidth = rectOfButtons.Width() - rectXPane.Width() * 8;
  1255         TInt spaceBtnWidth = rectOfButtons.Width() - rectXPane.Width() * 8;
  1255         TInt dx = rectOfButtons.iTl.iX;
  1256         TInt dx = rectOfButtons.iTl.iX;
  1256         TInt dy = rectOfButtons.iTl.iY;
  1257         TInt dy = rectOfButtons.iTl.iY;
  1257         
  1258         
  1258         aDataInfo.iCloseButton.iRect = OffsetRect( rectXBorder, dx, dy );
  1259         aDataInfo.iCloseButton.iRect = OffsetRect( rectXBorder, dx, dy );
  1714     TAknLayoutRect keypadRect, cellpaneRect;
  1715     TAknLayoutRect keypadRect, cellpaneRect;
  1715     TAknLayoutRect wndRect;
  1716     TAknLayoutRect wndRect;
  1716     TAknLayoutText keyTextLayout; 
  1717     TAknLayoutText keyTextLayout; 
  1717 	TAknTextLineLayout keyText;
  1718 	TAknTextLineLayout keyText;
  1718 	TRect keyRect;
  1719 	TRect keyRect;
  1719 	// The gap value of keyboard
  1720     // The gap value of keyboard
  1720 	TInt gapValue;
  1721 	TInt gapValue;
  1721 
  1722 
  1722     TBool isLandscape = Layout_Meta_Data::IsLandscapeOrientation();
  1723     TBool isLandscape = Layout_Meta_Data::IsLandscapeOrientation();
  1723 
  1724 
  1724 	// -----------------------Landscape Mode--------------------------
  1725 	// -----------------------Landscape Mode--------------------------
  1789         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(0).LayoutLine();
  1790         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(0).LayoutLine();
  1790         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  1791         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  1791         }
  1792         }
  1792   	    
  1793   	    
  1793   	rectVkbCtrl = keypadRect.Rect();
  1794   	rectVkbCtrl = keypadRect.Rect();
  1794   	// Compute the gap between first row key's top line and keyboard's top line
  1795     // 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   	gapValue = keypaneRect.Rect().iTl.iY - rectVkbCtrl.iTl.iY;
  1796   	// Compute keyboard position
  1797   	// Compute keyboard position
  1797   	rectVkbCtrl.iBr.iY = rectVkbCtrl.iTl.iY + keypaneRect.Rect().Height() * 3 + gapValue;
  1798   	rectVkbCtrl.iBr.iY = rectVkbCtrl.iTl.iY + keypaneRect.Rect().Height() * 3 + gapValue;
  1798   	rectVkbCtrl.iTl.iY += gapValue;
  1799   	rectVkbCtrl.iTl.iY += gapValue;
  1799   	
       
  1800   	dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;
  1800   	dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;
  1801 
  1801 
  1802   	linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(0).LayoutLine();
  1802   	linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(0).LayoutLine();
  1803   	keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1803   	keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1804   	
  1804   	
  1805   	linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(0).LayoutLine();
  1805   	linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(0).LayoutLine();
  1806   	keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1806   	keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1807 
  1807 
       
  1808   	
  1808     TRect rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  1809     TRect rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  1809     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  1810     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  1810   	
  1811   	
  1811     TRect rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  1812     TRect rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  1812     TRect rectXBorder = RelativeRect( keycellRect.Rect(), base );
  1813     TRect rectXBorder = RelativeRect( keycellRect.Rect(), base );
  1824             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1825             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1825             
  1826             
  1826             dataInfo->iKeypad.iRects.AppendL( bound );
  1827             dataInfo->iKeypad.iRects.AppendL( bound );
  1827             
  1828             
  1828             TRect inner = rectXPane;
  1829             TRect inner = rectXPane;
  1829             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1830             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );       
  1830             
  1831             
  1831             TAknLayoutText keyTextLayout; 
  1832             TAknLayoutText keyTextLayout; 
  1832             keyTextLayout.LayoutText( inner, keyText );
  1833             keyTextLayout.LayoutText( inner, keyText );
  1833             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  1834             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  1834             }
  1835             }
  1942         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(2).LayoutLine();
  1943         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(2).LayoutLine();
  1943         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  1944         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  1944         }
  1945         }
  1945   	    
  1946   	    
  1946   	rectVkbCtrl = keypadRect.Rect();
  1947   	rectVkbCtrl = keypadRect.Rect();
  1947     
  1948     // Compute the gap between first row key's top line and keyboard's top line
  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;
  1949     gapValue = keypaneRect.Rect().iTl.iY - rectVkbCtrl.iTl.iY;
  1950     // Compute keyboard position
  1950     // Compute keyboard position
  1951     rectVkbCtrl.iBr.iY = rectVkbCtrl.iTl.iY + keypaneRect.Rect().Height() * 3 + gapValue;
  1951     rectVkbCtrl.iBr.iY = rectVkbCtrl.iTl.iY + keypaneRect.Rect().Height() * 3 + gapValue;
  1952     rectVkbCtrl.iTl.iY += gapValue;
  1952     rectVkbCtrl.iTl.iY += gapValue;
  1953     
       
  1954     dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;
  1953     dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;
  1955 
  1954 
  1956     linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(2).LayoutLine();
  1955     linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(2).LayoutLine();
  1957     keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1956     keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1958     
  1957     
  1959     linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(2).LayoutLine();
  1958     linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(2).LayoutLine();
  1960     keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1959     keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  1961 
  1960 
       
  1961     
  1962     rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  1962     rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  1963     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  1963     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  1964     
  1964     
  1965     rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  1965     rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  1966     rectXBorder = RelativeRect( keycellRect.Rect(), base );
  1966     rectXBorder = RelativeRect( keycellRect.Rect(), base );
  1978             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1978             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1979             
  1979             
  1980             dataInfo->iKeypad.iRects.AppendL( bound );
  1980             dataInfo->iKeypad.iRects.AppendL( bound );
  1981             
  1981             
  1982             TRect inner = rectXPane;
  1982             TRect inner = rectXPane;
  1983             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  1983             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );      
  1984             
  1984             
  1985             TAknLayoutText keyTextLayout; 
  1985             TAknLayoutText keyTextLayout; 
  1986             keyTextLayout.LayoutText( inner, keyText );
  1986             keyTextLayout.LayoutText( inner, keyText );
  1987             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  1987             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  1988             }
  1988             }
  2084         // Reset keypane rect
  2084         // Reset keypane rect
  2085         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(3).LayoutLine();
  2085         linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_pane(3).LayoutLine();
  2086         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  2086         keypaneRect.LayoutRect( keypadRect.Rect(), linelayout );
  2087         }
  2087         }
  2088   	    
  2088   	    
  2089     rectVkbCtrl = keypadRect.Rect();
  2089   	rectVkbCtrl = keypadRect.Rect();
  2090     
       
  2091     // Compute the gap between first row key's top line and keyboard's top line
  2090     // Compute the gap between first row key's top line and keyboard's top line
  2092     gapValue = keypaneRect.Rect().iTl.iY - rectVkbCtrl.iTl.iY;
  2091     gapValue = keypaneRect.Rect().iTl.iY - rectVkbCtrl.iTl.iY;
  2093     // Compute keyboard position
  2092     // Compute keyboard position
  2094     rectVkbCtrl.iBr.iY = rectVkbCtrl.iTl.iY + keypaneRect.Rect().Height() * 4 + gapValue;
  2093     rectVkbCtrl.iBr.iY = rectVkbCtrl.iTl.iY + keypaneRect.Rect().Height() * 4 + gapValue;
  2095     rectVkbCtrl.iTl.iY += gapValue;
  2094     rectVkbCtrl.iTl.iY += gapValue;
  2096     
       
  2097     dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;    
  2095     dataInfo->iKeypad.iKaypadRect = rectVkbCtrl;    
  2098 
  2096 
  2099     linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(3).LayoutLine();
  2097     linelayout = AknLayoutScalable_Avkon::bg_cell_vkbss_key_g1(3).LayoutLine();
  2100     keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  2098     keycellRect.LayoutRect( keypaneRect.Rect(), linelayout );
  2101     
  2099     
  2102     linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(3).LayoutLine();
  2100     linelayout = AknLayoutScalable_Avkon::cell_vkbss_key_g1(3).LayoutLine();
  2103     keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  2101     keylabelRect.LayoutRect( keypaneRect.Rect(), linelayout );
  2104 
  2102 
       
  2103     
  2105     rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  2104     rectOfKeypad = RelativeRect( keypadRect.Rect(), base );
  2106     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  2105     rectOfKeypad.iBr.iY -= keypaneRect.Rect().Height(); 
  2107     
  2106     
  2108     rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  2107     rectXPane = RelativeRect( keypaneRect.Rect(), base ); 
  2109     rectXBorder = RelativeRect( keycellRect.Rect(), base );
  2108     rectXBorder = RelativeRect( keycellRect.Rect(), base );
  2121             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  2120             bound.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  2122             
  2121             
  2123             dataInfo->iKeypad.iRects.AppendL( bound );
  2122             dataInfo->iKeypad.iRects.AppendL( bound );
  2124             
  2123             
  2125             TRect inner = rectXPane;
  2124             TRect inner = rectXPane;
  2126             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );
  2125             inner.Move( j * rectXPane.Width(), i * rectXPane.Height() );    
  2127             
  2126             
  2128             TAknLayoutText keyTextLayout; 
  2127             TAknLayoutText keyTextLayout; 
  2129             keyTextLayout.LayoutText( inner, keyText );
  2128             keyTextLayout.LayoutText( inner, keyText );
  2130             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  2129             dataInfo->iKeypad.iCharRects.AppendL( keyTextLayout.TextRect() );
  2131             }
  2130             }