textinput/peninputfingerhwr/src/peninputfingerhwrlafmanager.cpp
changeset 0 eb1f2e154e89
child 3 f5a1e66df979
equal deleted inserted replaced
-1:000000000000 0:eb1f2e154e89
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0""
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Implementation of LAF manager.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDES
       
    19 #include <aknlayoutscalable_avkon.cdl.h>
       
    20 #include <aknutils.h>
       
    21 
       
    22 #include "peninputfingerhwrlafmanager.h"
       
    23 #include "peninputfingerhwrcontrolid.h"
       
    24 
       
    25 #define LAF_MODIFY 1
       
    26  
       
    27 
       
    28 // ---------------------------------------------------------------------------
       
    29 // Symbian Constructor
       
    30 // ---------------------------------------------------------------------------
       
    31 //
       
    32 CPeninputFingerHwrLAFManager* CPeninputFingerHwrLAFManager::NewL()
       
    33     {
       
    34     CPeninputFingerHwrLAFManager* self = CPeninputFingerHwrLAFManager::NewLC();
       
    35     CleanupStack::Pop(); // self;
       
    36     return self;   
       
    37     }
       
    38 
       
    39 // ---------------------------------------------------------------------------
       
    40 // Symbian Constructor
       
    41 // ---------------------------------------------------------------------------
       
    42 //
       
    43 CPeninputFingerHwrLAFManager* CPeninputFingerHwrLAFManager::NewLC()
       
    44     {
       
    45     CPeninputFingerHwrLAFManager* self = new( ELeave ) CPeninputFingerHwrLAFManager();
       
    46     CleanupStack::PushL( self );
       
    47     self->ConstructL();
       
    48     return self;
       
    49     }
       
    50 
       
    51 // ---------------------------------------------------------------------------
       
    52 // c++ destructor
       
    53 // ---------------------------------------------------------------------------
       
    54 //
       
    55 CPeninputFingerHwrLAFManager::~CPeninputFingerHwrLAFManager()
       
    56     {
       
    57     //nothing
       
    58     iSCTrectArray.Reset();
       
    59     iSCTrectArray.Close();
       
    60     }
       
    61 
       
    62 
       
    63 // ---------------------------------------------------------------------------
       
    64 // read laf data.
       
    65 // ---------------------------------------------------------------------------
       
    66 //
       
    67 void CPeninputFingerHwrLAFManager::ReadLafInfo()
       
    68     {
       
    69     // Screen
       
    70     TRect rect;
       
    71     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);
       
    72     iScreenSize = rect.Size();
       
    73 
       
    74     iIsLandscape = iScreenSize.iWidth < iScreenSize.iHeight ? EFalse : ETrue;
       
    75     
       
    76     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, rect);
       
    77 
       
    78     // finger Layout
       
    79     TAknWindowLineLayout fshwrlayout;
       
    80     TAknLayoutRect fshwrRect;
       
    81         
       
    82     fshwrlayout = AknLayoutScalable_Avkon::main_fep_fshwr2_pane(0).LayoutLine();
       
    83     fshwrRect.LayoutRect(rect, fshwrlayout);
       
    84 
       
    85     iLayoutRect = fshwrRect.Rect();
       
    86     iLayoutOffset = iLayoutRect.iTl;
       
    87 
       
    88     // ICF & Keypad
       
    89     TAknWindowLineLayout icflayoutcn,icflayoutbgcn;
       
    90     TAknTextLineLayout icflefttext;    
       
    91     TAknTextLineLayout icflefttext1, icflefttext2, icflefttext3; 
       
    92     TAknLayoutRect icfrectlatin, icfrectcn;
       
    93 
       
    94     if (iIsLandscape)
       
    95         {
       
    96         icflayoutcn = AknLayoutScalable_Avkon::fshwr2_icf_pane(1).LayoutLine();
       
    97         }
       
    98     else
       
    99         {
       
   100         icflayoutcn = AknLayoutScalable_Avkon::fshwr2_icf_pane(0).LayoutLine();
       
   101         }
       
   102     
       
   103     icfrectcn.LayoutRect(fshwrRect.Rect(), icflayoutcn);
       
   104 	
       
   105     TAknLayoutScalableParameterLimits entryPaneVariety = 
       
   106                 AknLayoutScalable_Avkon::fshwr2_icf_pane_t1_ParamLimits(0);
       
   107     TInt maxRow = entryPaneVariety.LastRow();
       
   108     
       
   109     icflefttext = AknLayoutScalable_Avkon::fshwr2_icf_pane_t1(0, 0, 0).LayoutLine();
       
   110     
       
   111     icflefttext1 = AknLayoutScalable_Avkon::fshwr2_icf_pane_t1(0, 0, 1).LayoutLine();
       
   112     icflefttext2 = AknLayoutScalable_Avkon::fshwr2_icf_pane_t1(0, 0, 2).LayoutLine();
       
   113     icflefttext3 = AknLayoutScalable_Avkon::fshwr2_icf_pane_t1(0, 0, maxRow).LayoutLine();
       
   114     iIcfTextLeftMarginCn = icflefttext.il;
       
   115     iIcfTextRightMarginCn = iIcfTextLeftMarginCn;
       
   116     
       
   117     TAknLayoutText ctxt, ctxt1, ctxt2, ctxt3;
       
   118     ctxt.LayoutText( icfrectcn.Rect(), icflefttext );
       
   119     ctxt1.LayoutText( icfrectcn.Rect(), icflefttext1 );
       
   120     ctxt2.LayoutText( icfrectcn.Rect(), icflefttext2 );
       
   121     ctxt3.LayoutText( icfrectcn.Rect(), icflefttext3 );
       
   122 	
       
   123     iIcfTextTopMarginCn = ctxt.TextRect().iTl.iY - icfrectcn.Rect().iTl.iY;
       
   124     iIcfTextLineSpaceMarginCn = ctxt1.TextRect().iTl.iY - ctxt.TextRect().iBr.iY;
       
   125     iIcfTextBottomMarginCn = icfrectcn.Rect().iBr.iY - ctxt3.TextRect().iBr.iY 
       
   126                                                      - iIcfTextLineSpaceMarginCn;
       
   127     iIcfTextHeightCn = ctxt.TextRect().Height();    
       
   128  	
       
   129     iIcfFont = const_cast<CFont*>(AknLayoutUtils::FontFromId(icflefttext.iFont, NULL));
       
   130 
       
   131     iRectIcf = icfrectcn.Rect();
       
   132     
       
   133 	// candidate list
       
   134     TAknWindowLineLayout candrowpane, candrowpane2, candlistpane, cellpane, candbgpane;
       
   135     TAknLayoutRect candpaneRect, candrowpaneRect, candrowpaneRect2, cellpaneRect1, cellpaneRect2;
       
   136     TAknLayoutRect cellpaneRect3, cellpaneRect;
       
   137 	
       
   138     if (iIsLandscape)
       
   139         {
       
   140 		candlistpane = AknLayoutScalable_Avkon::fshwr2_func_candi_pane(1).
       
   141 										LayoutLine();        
       
   142         }
       
   143     else
       
   144         {
       
   145        	candlistpane = AknLayoutScalable_Avkon::fshwr2_func_candi_pane(0).
       
   146 										LayoutLine();
       
   147         }
       
   148     candpaneRect.LayoutRect( fshwrRect.Rect(), candlistpane );
       
   149     rect = candpaneRect.Rect();
       
   150     candrowpane = AknLayoutScalable_Avkon::fshwr2_func_candi_row_pane(0, 0, 1).
       
   151 										LayoutLine();
       
   152     candrowpaneRect.LayoutRect( rect, candrowpane );
       
   153     
       
   154     candrowpane2 = AknLayoutScalable_Avkon::fshwr2_func_candi_row_pane(0, 0, 2).
       
   155 										LayoutLine();
       
   156     candrowpaneRect2.LayoutRect( rect, candrowpane2 );
       
   157      
       
   158 	
       
   159     cellpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 3 , 0 , 0 ).
       
   160 										LayoutLine();
       
   161     cellpaneRect.LayoutRect( candrowpaneRect.Rect(), cellpane );
       
   162     
       
   163     candbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(3).LayoutLine();
       
   164     cellpaneRect1.LayoutRect( cellpaneRect.Rect(), candbgpane );   
       
   165     
       
   166     cellpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 3 , 1 , 0 ).
       
   167 										LayoutLine();
       
   168     cellpaneRect.LayoutRect( candrowpaneRect.Rect(), cellpane );
       
   169     
       
   170     candbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(3).LayoutLine();
       
   171     cellpaneRect2.LayoutRect( cellpaneRect.Rect(), candbgpane );   
       
   172     
       
   173     
       
   174     
       
   175     cellpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 3 , 0 , 1 ).
       
   176 										LayoutLine();
       
   177     cellpaneRect.LayoutRect( candrowpaneRect2.Rect(), cellpane );
       
   178     
       
   179     candbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(3).LayoutLine();
       
   180     cellpaneRect3.LayoutRect( cellpaneRect.Rect(), candbgpane );   
       
   181     
       
   182 									
       
   183     iCandsHorizontalMargin = cellpaneRect2.Rect().iTl.iX - cellpaneRect1.Rect().iBr.iX;
       
   184     iCandsVerticalMargin = cellpaneRect3.Rect().iTl.iY - cellpaneRect1.Rect().iBr.iY;
       
   185 	
       
   186     iCandsUnitWidth = cellpaneRect1.Rect().Width();
       
   187     iCandsUnitHeight = cellpaneRect1.Rect().Height() ;
       
   188     
       
   189     iCandsNaviHeight = cellpaneRect1.Rect().Height();
       
   190     iCandidateLTPos = candrowpaneRect.Rect().iTl;
       
   191     iPredictiveLTPos = candrowpaneRect2.Rect().iTl;
       
   192     
       
   193     TAknTextLineLayout candstxtlayout = 
       
   194                      AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane_t1(3).LayoutLine();
       
   195     TAknLayoutText candstxt;
       
   196     candstxt.LayoutText( cellpaneRect1.Rect(), candstxtlayout );
       
   197     iCandsFont = const_cast<CFont*>( AknLayoutUtils::FontFromId( candstxtlayout.iFont, NULL ) );
       
   198     iCandsTextMargin = candstxt.TextRect().iTl.iX - cellpaneRect1.Rect().iTl.iX;
       
   199     
       
   200     
       
   201     TAknWindowLineLayout btnrowpane, btnpane, btnbgpane;
       
   202     TAknLayoutRect btnrowRect, btnRect, btnbgRect;
       
   203     
       
   204     // Get the first row rect *************************************************
       
   205     btnrowpane = AknLayoutScalable_Avkon::fshwr2_func_candi_row_pane(0, 0, 0).
       
   206                                             LayoutLine();
       
   207     btnrowRect.LayoutRect(candpaneRect.Rect(), btnrowpane);
       
   208     // Close Button
       
   209     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 2 , 0 , 0 ).
       
   210 										LayoutLine();    
       
   211     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   212     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(2).
       
   213 										LayoutLine();
       
   214     btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane); 
       
   215     iRectBtnClose = btnbgRect.Rect();
       
   216     
       
   217     // Range Button with mark
       
   218     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 2 , 1 , 0 ).
       
   219 										LayoutLine();
       
   220     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   221     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(2).
       
   222 										LayoutLine();
       
   223     btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane); 
       
   224     iRectBtnRangeChn = btnbgRect.Rect();
       
   225     iRectBtnRangeEng = iRectBtnRangeChn;
       
   226     iRectBtnRangeNum = iRectBtnRangeEng;
       
   227     
       
   228     // SCT button
       
   229     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 2 , 2 , 0 ).
       
   230 										LayoutLine();
       
   231     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   232     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(2).
       
   233 										LayoutLine();
       
   234     btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane); 
       
   235     iRectBtnRangeSmb = btnbgRect.Rect();
       
   236     
       
   237     // Backspace button
       
   238     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 2 , 3 , 0 ).
       
   239 										LayoutLine();
       
   240     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   241     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(2).
       
   242 										LayoutLine();
       
   243     btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane);
       
   244     iRectBtnBackspace = btnbgRect.Rect();    
       
   245     
       
   246     // Get the second row rect **************************************************
       
   247     btnrowpane = AknLayoutScalable_Avkon::fshwr2_func_candi_row_pane(0, 0, 1).
       
   248                                             LayoutLine();
       
   249     btnrowRect.LayoutRect(candpaneRect.Rect(), btnrowpane);
       
   250     
       
   251     // Option button
       
   252     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 1 , 0 , 0 ).
       
   253 										LayoutLine();
       
   254     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   255     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(1).
       
   256 										LayoutLine();
       
   257     btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane);
       
   258     iRectBtnOption = btnbgRect.Rect();     
       
   259     
       
   260     // Switch mode button
       
   261     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 1 , 1 , 0 ).
       
   262 										LayoutLine();
       
   263     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   264     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(1).
       
   265 										LayoutLine();
       
   266     btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane); 
       
   267     iRectBtnImeSwitch = btnbgRect.Rect();
       
   268     
       
   269     // Arrow up button
       
   270     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 1 , 2 , 0 ).
       
   271 										LayoutLine();
       
   272     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   273     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(1).
       
   274 										LayoutLine();
       
   275     btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane);  
       
   276     iRectBtnArrowUp = btnbgRect.Rect();
       
   277     iRectBtnSctPage = iRectBtnArrowUp;  
       
   278 
       
   279 
       
   280     // Get the third row rect **************************************************
       
   281     btnrowpane = AknLayoutScalable_Avkon::fshwr2_func_candi_row_pane(0, 0, 2).
       
   282                                             LayoutLine();
       
   283     btnrowRect.LayoutRect(candpaneRect.Rect(), btnrowpane);
       
   284 
       
   285     // Arrow left button
       
   286     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 1 , 0 , 0 ).
       
   287 										LayoutLine();									
       
   288     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   289     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(1).
       
   290 										LayoutLine();
       
   291     btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane); 
       
   292     iRectBtnArrowLeft = btnbgRect.Rect();    
       
   293     
       
   294     // Arrow right button
       
   295     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 1 , 1 , 0 ).
       
   296 										LayoutLine();
       
   297     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   298     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(1).
       
   299 										LayoutLine();
       
   300 	btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane);									    
       
   301     iRectBtnArrowRight = btnbgRect.Rect();
       
   302     
       
   303     // Arrow down button
       
   304     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 1 , 2 , 0 ).
       
   305 										LayoutLine();
       
   306     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   307     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(1).
       
   308 										LayoutLine();
       
   309 	btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane);									    
       
   310     iRectBtnArrowDown = btnbgRect.Rect();
       
   311     
       
   312     // Space button
       
   313     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 0 , 0 , 0 ).
       
   314 										LayoutLine();
       
   315     btnRect.LayoutRect(btnrowRect.Rect(), btnpane);
       
   316     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(0).
       
   317 										LayoutLine();
       
   318 	btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane);									    
       
   319     
       
   320     iRectFixSctpad = btnrowRect.Rect();
       
   321   
       
   322     iRectSpase = btnbgRect.Rect();
       
   323     iRectSpase.Move(-iRectFixSctpad.iTl );
       
   324     
       
   325     // Enter button
       
   326     btnpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_pane( 0 , 1 , 0 ).
       
   327 										LayoutLine();
       
   328 	btnRect.LayoutRect(btnrowRect.Rect(), btnpane);																		
       
   329     btnbgpane = AknLayoutScalable_Avkon::fshwr2_func_candi_cell_bg_pane(0).
       
   330 										LayoutLine();									
       
   331 	btnbgRect.LayoutRect(btnRect.Rect(), btnbgpane);
       
   332 										    
       
   333     iRectEnter = btnbgRect.Rect();
       
   334     iRectEnter.Move(-iRectFixSctpad.iTl);
       
   335 
       
   336     iSizeFixSctpadCell = iRectSpase.Size();
       
   337     
       
   338     // Writing box
       
   339     TAknWindowLineLayout writingboxpane;
       
   340     TAknLayoutRect boxRect;
       
   341     writingboxpane = AknLayoutScalable_Avkon::fshwr2_hwr_syb_pane(0).LayoutLine();
       
   342     boxRect.LayoutRect(fshwrRect.Rect(), writingboxpane);
       
   343     iRectWritingBox = boxRect.Rect();
       
   344     iRectNumpad = iRectWritingBox;
       
   345     iRectSctpad = iRectWritingBox;
       
   346     
       
   347     // virtual key size
       
   348     TAknWindowLineLayout keypane, keybgpane;
       
   349     TAknLayoutRect keyRect, keybgRect;
       
   350   
       
   351     TAknLayoutScalableParameterLimits sctPaneVariety =
       
   352         AknLayoutScalable_Avkon::cell_fshwr2_syb_pane_ParamLimits(0);
       
   353     
       
   354     iSctpadRowCount = sctPaneVariety.LastRow() + 1;
       
   355     iSctpadColCount = sctPaneVariety.LastColumn() + 1;    
       
   356   
       
   357     iSizeBtnPadding = TSize(6, 6);
       
   358   
       
   359     iSCTrectArray.Reset();
       
   360     for(TInt i = 0; i < iSctpadRowCount; i++)
       
   361         {
       
   362         for ( TInt j = 0; j < iSctpadColCount; j++ )
       
   363             {
       
   364             keypane = AknLayoutScalable_Avkon::cell_fshwr2_syb_pane(0, j, i).LayoutLine();
       
   365             keyRect.LayoutRect(boxRect.Rect(), keypane);
       
   366             keybgpane = AknLayoutScalable_Avkon::cell_fshwr2_syb_bg_pane(0).LayoutLine();
       
   367             keybgRect.LayoutRect(keyRect.Rect(), keybgpane);
       
   368             iSCTrectArray.Append( keybgRect.Rect());
       
   369             }
       
   370         }
       
   371     iSizeNumpadCell = keybgRect.Rect().Size();
       
   372     iSizeSctpadCell = iSizeNumpadCell;
       
   373     
       
   374     // preview popup window 
       
   375   	TAknWindowLineLayout previewWnd, previewBackground, previewWndInner;
       
   376   	TAknLayoutRect previewWndRect, previewBackgroundRect, previewWndInnerRect;
       
   377   	TAknLayoutText previewWndText;
       
   378   	previewWnd = AknLayoutScalable_Avkon::popup_fshwr2_char_preview_window(0).LayoutLine();	
       
   379   	            
       
   380   	previewWndRect.LayoutRect( iLayoutRect, previewWnd );
       
   381   	previewBackground = AknLayoutScalable_Avkon::bg_popup_fep_char_preview_window_cp01().LayoutLine();
       
   382   	previewBackgroundRect.LayoutRect( previewWndRect.Rect(), previewBackground );
       
   383   	iPreviewWndRect = previewBackgroundRect.Rect();
       
   384   	
       
   385   	previewWndInner = AknLayoutScalable_Avkon::bg_popup_fep_char_preview_window_g9().LayoutLine();
       
   386   	previewWndInnerRect.LayoutRect( previewBackgroundRect.Rect(), previewWndInner );
       
   387   	
       
   388   	iPreviewWndInnerRect = previewWndInnerRect.Rect();
       
   389   	iPreviewWndText = 
       
   390         AknLayoutScalable_Avkon::popup_fshwr2_char_preview_window_t1(0).LayoutLine();
       
   391     previewWndText.LayoutText(previewWndRect.Rect(), iPreviewWndText);
       
   392     iBubbleFont = previewWndText.Font();
       
   393     }
       
   394         
       
   395 
       
   396 // ---------------------------------------------------------------------------
       
   397 // get screen orientation.
       
   398 // ---------------------------------------------------------------------------
       
   399 //
       
   400 TBool CPeninputFingerHwrLAFManager::IsLandscape()
       
   401     {
       
   402     return iIsLandscape;
       
   403     }
       
   404     
       
   405     
       
   406 // ---------------------------------------------------------------------------
       
   407 // get rect of layout.
       
   408 // ---------------------------------------------------------------------------
       
   409 //    
       
   410 TRect CPeninputFingerHwrLAFManager::LayoutRect()
       
   411     {        
       
   412     return iLayoutRect;
       
   413     }
       
   414 
       
   415 
       
   416 // ---------------------------------------------------------------------------
       
   417 // get rect of specified control.
       
   418 // ---------------------------------------------------------------------------
       
   419 //  
       
   420 TRect CPeninputFingerHwrLAFManager::CtrlRect( TInt aCtrlId )
       
   421     {
       
   422     switch ( aCtrlId )
       
   423         {
       
   424         case EHwrCtrlIdInputContextField:
       
   425             {
       
   426             return iRectIcf;
       
   427             }
       
   428         case EHwrCtrlIdWritingBox:
       
   429             {
       
   430             return iRectWritingBox;
       
   431             }
       
   432         case EHwrCtrlIdNumpad:
       
   433             {
       
   434             return iRectNumpad;
       
   435             }
       
   436         case EHwrCtrlIdSctpad:
       
   437             {
       
   438             return iRectSctpad;
       
   439             }
       
   440         case EHwrCtrlIdSctpadFix:
       
   441             {
       
   442             return iRectFixSctpad;
       
   443             }            
       
   444         case EHwrCtrlIdClose:
       
   445             {
       
   446             return iRectBtnClose;
       
   447             }      
       
   448         case EHwrCtrlIdRangeSelector:
       
   449             {
       
   450             return iRectBtnRangeChn;
       
   451             }      
       
   452         case EHwrCtrlIdSymbolButton:
       
   453             {
       
   454             return iRectBtnRangeSmb;
       
   455             }
       
   456         case EHwrCtrlIdBackspace:
       
   457             {
       
   458             return iRectBtnBackspace;
       
   459             }
       
   460         case EHwrCtrlIdArrowUp:
       
   461             {
       
   462             return iRectBtnArrowUp;
       
   463             }
       
   464         case EHwrCtrlIdArrowDown:
       
   465             {
       
   466             return iRectBtnArrowDown;
       
   467             }  
       
   468         case EHwrCtrlIdArrowLeft:
       
   469             {
       
   470             return iRectBtnArrowLeft;
       
   471             }
       
   472         case EHwrCtrlIdArrowRight:
       
   473             {
       
   474             return iRectBtnArrowRight;
       
   475             }
       
   476         case EHwrCtrlIdLanguageOption:
       
   477             {
       
   478             return iRectBtnOption;
       
   479             }
       
   480         case EHwrCtrlIdVkbSwitcher:
       
   481             {
       
   482             return iRectBtnImeSwitch;
       
   483             }
       
   484         case EHwrCtrlIdSctPage0Btn:
       
   485         case EHwrCtrlIdSctPage1Btn:
       
   486         case EHwrCtrlIdSctPage2Btn:
       
   487             {
       
   488             return iRectBtnSctPage;
       
   489             }
       
   490         }
       
   491     return TRect();
       
   492     }
       
   493 
       
   494 // ---------------------------------------------------------------------------
       
   495 // get rect of ICF control.
       
   496 // ---------------------------------------------------------------------------
       
   497 // 
       
   498 TRect CPeninputFingerHwrLAFManager::IcfRect()
       
   499     {    
       
   500     return iRectIcf;    
       
   501     }
       
   502 
       
   503 // ---------------------------------------------------------------------------
       
   504 // get left margin of icf.
       
   505 // ---------------------------------------------------------------------------
       
   506 // 
       
   507 TInt CPeninputFingerHwrLAFManager::IcfLeftMargin()
       
   508     {
       
   509     return iIcfTextLeftMarginCn;
       
   510     }
       
   511     
       
   512 // ---------------------------------------------------------------------------
       
   513 // get right margin of icf.
       
   514 // ---------------------------------------------------------------------------
       
   515 // 
       
   516 TInt CPeninputFingerHwrLAFManager::IcfRightMargin()
       
   517     { 
       
   518     return iIcfTextRightMarginCn;
       
   519     }    
       
   520 
       
   521 // ---------------------------------------------------------------------------
       
   522 // get top margin of icf.
       
   523 // ---------------------------------------------------------------------------
       
   524 // 
       
   525 TInt CPeninputFingerHwrLAFManager::IcfTopMargin()
       
   526     {
       
   527     return iIcfTextTopMarginCn;
       
   528     }
       
   529     
       
   530 // ---------------------------------------------------------------------------
       
   531 // get bottom margin of icf.
       
   532 // ---------------------------------------------------------------------------
       
   533 // 
       
   534 TInt CPeninputFingerHwrLAFManager::IcfBottomMargin()
       
   535     {      
       
   536     return iIcfTextBottomMarginCn;
       
   537     }
       
   538     
       
   539 // ---------------------------------------------------------------------------
       
   540 // get line spacing of icf.
       
   541 // ---------------------------------------------------------------------------
       
   542 // 
       
   543 TInt CPeninputFingerHwrLAFManager::IcfLineSpaceMargin()
       
   544     {  
       
   545     return iIcfTextLineSpaceMarginCn;
       
   546     }    
       
   547     
       
   548 // ---------------------------------------------------------------------------
       
   549 // get font of icf.
       
   550 // ---------------------------------------------------------------------------
       
   551 // 
       
   552 CFont* CPeninputFingerHwrLAFManager::IcfFont()
       
   553     {
       
   554     return iIcfFont;
       
   555     }
       
   556    
       
   557 // ---------------------------------------------------------------------------
       
   558 // get text height of icf.
       
   559 // ---------------------------------------------------------------------------
       
   560 // 
       
   561 TInt CPeninputFingerHwrLAFManager::IcfTextHeight()
       
   562     { 
       
   563     return iIcfTextHeightCn;
       
   564     }
       
   565        
       
   566 
       
   567 // ---------------------------------------------------------------------------
       
   568 // get inner padding of buttons.
       
   569 // ---------------------------------------------------------------------------
       
   570 //
       
   571 TSize CPeninputFingerHwrLAFManager::ButtonInnerPadding()
       
   572     {
       
   573     return iSizeBtnPadding;
       
   574     }
       
   575 
       
   576 
       
   577 // ---------------------------------------------------------------------------
       
   578 // get cell size of virtual numpad.
       
   579 // ---------------------------------------------------------------------------
       
   580 //
       
   581 TRect CPeninputFingerHwrLAFManager::VirtualNumpadCellSize()
       
   582     {
       
   583     return iSizeNumpadCell;
       
   584     }
       
   585     
       
   586 
       
   587 // ---------------------------------------------------------------------------
       
   588 // get text layout of virtual numpad.
       
   589 // ---------------------------------------------------------------------------
       
   590 //
       
   591 TAknTextLineLayout CPeninputFingerHwrLAFManager::NumpadKeyTxtLayout()
       
   592     {
       
   593     TAknTextLineLayout layout = AknLayoutScalable_Avkon::
       
   594         cell_fshwr2_syb_bg_pane_t1(0).LayoutLine();
       
   595     return layout;    
       
   596     }
       
   597 
       
   598 // ---------------------------------------------------------------------------
       
   599 // get row count of virtual sctpad.
       
   600 // ---------------------------------------------------------------------------
       
   601 //
       
   602 TInt CPeninputFingerHwrLAFManager::VirtualSctpadRowCount()
       
   603     {
       
   604     return iSctpadRowCount;
       
   605     }
       
   606 
       
   607 // ---------------------------------------------------------------------------
       
   608 // get column count of virtual sctpad.
       
   609 // ---------------------------------------------------------------------------
       
   610 //
       
   611 TInt CPeninputFingerHwrLAFManager::VirtualSctpadColCount()
       
   612     {
       
   613     return iSctpadColCount;
       
   614     }
       
   615 
       
   616 // ---------------------------------------------------------------------------
       
   617 // get cell size of virtual sctpad.
       
   618 // ---------------------------------------------------------------------------
       
   619 //
       
   620 TRect CPeninputFingerHwrLAFManager::VirtualSctpadCellSize()
       
   621     {
       
   622     return iSizeSctpadCell;
       
   623     }
       
   624 
       
   625 // ---------------------------------------------------------------------------
       
   626 // get cell size of virtual sctpad.
       
   627 // ---------------------------------------------------------------------------
       
   628 //
       
   629 TRect CPeninputFingerHwrLAFManager::FixVirtualSctpadCellSize()
       
   630     {
       
   631     return iSizeFixSctpadCell;
       
   632     }
       
   633     
       
   634     
       
   635 // ---------------------------------------------------------------------------
       
   636 // get preview bubble rect.
       
   637 // ---------------------------------------------------------------------------
       
   638 //
       
   639 TRect CPeninputFingerHwrLAFManager::PreviewBubbleRect()
       
   640     {
       
   641     return iPreviewWndRect;
       
   642     }
       
   643 
       
   644 // ---------------------------------------------------------------------------
       
   645 // get preview bubble inner rect
       
   646 // ---------------------------------------------------------------------------
       
   647 //
       
   648 TRect CPeninputFingerHwrLAFManager::PreviewBubbleInnerRect()
       
   649     {
       
   650     return iPreviewWndInnerRect;
       
   651     }
       
   652  
       
   653 // ---------------------------------------------------------------------------
       
   654 // get preview bubble font
       
   655 // ---------------------------------------------------------------------------
       
   656 //
       
   657 const CFont* CPeninputFingerHwrLAFManager::PreviewBubbleFont()
       
   658     {
       
   659     return iBubbleFont;
       
   660     }
       
   661 
       
   662 // ---------------------------------------------------------------------------
       
   663 // get preview bubble text layout
       
   664 // ---------------------------------------------------------------------------
       
   665 //
       
   666 TAknTextLineLayout CPeninputFingerHwrLAFManager::PreviewBubbleTextLayout()
       
   667     {
       
   668     return iPreviewWndText;
       
   669     }
       
   670 
       
   671 // ---------------------------------------------------------------------------
       
   672 // get cell rect of virtual sctpad.
       
   673 // ---------------------------------------------------------------------------
       
   674 //
       
   675 void CPeninputFingerHwrLAFManager::GetVirtualKeyRects( RArray<TRect>& aArrayRects )
       
   676     {   
       
   677     aArrayRects.Reset();
       
   678     
       
   679     for(TInt i = 0; i < iSCTrectArray.Count(); i++)
       
   680         {
       
   681         TRect absoluteRect = iSCTrectArray[i];
       
   682         absoluteRect.Move(-iRectSctpad.iTl.iX, -iRectSctpad.iTl.iY);
       
   683         aArrayRects.Append(absoluteRect);
       
   684         } 
       
   685     }
       
   686 
       
   687 // ---------------------------------------------------------------------------
       
   688 // get space and enter key rect.
       
   689 // ---------------------------------------------------------------------------
       
   690 //
       
   691 void CPeninputFingerHwrLAFManager::GetFixVirtualKeyRects( RArray<TRect>& aArrayRects )
       
   692     {   
       
   693     aArrayRects.Reset();
       
   694     aArrayRects.Append( iRectSpase );
       
   695     aArrayRects.Append( iRectEnter );
       
   696         
       
   697     }
       
   698 
       
   699 // ---------------------------------------------------------------------------
       
   700 // get text layout of virtual sctpad.
       
   701 // ---------------------------------------------------------------------------
       
   702 //
       
   703 TAknTextLineLayout CPeninputFingerHwrLAFManager::SctpadKeyTxtLayout()
       
   704     {
       
   705     TAknTextLineLayout layout = AknLayoutScalable_Avkon::
       
   706         cell_fshwr2_syb_bg_pane_t1(0).LayoutLine();
       
   707     return layout;
       
   708     }
       
   709 
       
   710 // ---------------------------------------------------------------------------
       
   711 // get text layout of space and enter.
       
   712 // ---------------------------------------------------------------------------
       
   713 //
       
   714 TAknTextLineLayout CPeninputFingerHwrLAFManager::FixSctpadKeyTxtLayout()
       
   715     {
       
   716     TAknTextLineLayout layout = AknLayoutScalable_Avkon::
       
   717         cell_fshwr2_syb_bg_pane_t1(0).LayoutLine();
       
   718     return layout;
       
   719     }
       
   720 
       
   721 // ---------------------------------------------------------------------------
       
   722 // get width unit of candidate list.
       
   723 // ---------------------------------------------------------------------------
       
   724 //
       
   725 TInt CPeninputFingerHwrLAFManager::CandidateUnitWidth()
       
   726     {
       
   727     return iCandsUnitWidth;
       
   728     }
       
   729 
       
   730 // ---------------------------------------------------------------------------
       
   731 // get height unit of candidate list.
       
   732 // ---------------------------------------------------------------------------
       
   733 //
       
   734 TInt CPeninputFingerHwrLAFManager::CandidateUnitHeight()
       
   735     {
       
   736     return iCandsUnitHeight;
       
   737     }
       
   738 
       
   739 // ---------------------------------------------------------------------------
       
   740 // get horizontal margin of candidate list.
       
   741 // ---------------------------------------------------------------------------
       
   742 //
       
   743 TInt CPeninputFingerHwrLAFManager::CandidateHorizontalMargin()
       
   744     {
       
   745     return iCandsHorizontalMargin;
       
   746     }    
       
   747 
       
   748 // ---------------------------------------------------------------------------
       
   749 // get vertical margin of candidate list.
       
   750 // ---------------------------------------------------------------------------
       
   751 //
       
   752 TInt CPeninputFingerHwrLAFManager::CandidateVerticalMargin()
       
   753     {
       
   754     return iCandsVerticalMargin;
       
   755     }    
       
   756    
       
   757 // ---------------------------------------------------------------------------
       
   758 // get top-left position of candidate list.
       
   759 // ---------------------------------------------------------------------------
       
   760 //
       
   761 TPoint CPeninputFingerHwrLAFManager::CandidateLTPos()
       
   762     {
       
   763     return iCandidateLTPos;
       
   764     }
       
   765 
       
   766 // ---------------------------------------------------------------------------
       
   767 // get top-left position of predictive list.
       
   768 // ---------------------------------------------------------------------------
       
   769 //
       
   770 TPoint CPeninputFingerHwrLAFManager::PredictiveLTPos()
       
   771     {
       
   772     return iPredictiveLTPos;
       
   773     }
       
   774    
       
   775 // ---------------------------------------------------------------------------
       
   776 // get font of candidate list.
       
   777 // ---------------------------------------------------------------------------
       
   778 //
       
   779 const CFont* CPeninputFingerHwrLAFManager::CandidateFont()
       
   780     {   
       
   781     return iCandsFont;
       
   782     }
       
   783 
       
   784 // ---------------------------------------------------------------------------
       
   785 // c++ constructor
       
   786 // ---------------------------------------------------------------------------
       
   787 //
       
   788 CPeninputFingerHwrLAFManager::CPeninputFingerHwrLAFManager()
       
   789     {
       
   790     
       
   791     }
       
   792     
       
   793 // ---------------------------------------------------------------------------
       
   794 // Symbian second-phase constructor
       
   795 // ---------------------------------------------------------------------------
       
   796 //
       
   797 void CPeninputFingerHwrLAFManager::ConstructL()
       
   798     {
       
   799     }
       
   800 
       
   801 // End Of File