textinput/peninputgenericitut/src/peninputgenericitutdatamgr.cpp
branchRCL_3
changeset 7 a47de9135b21
parent 0 eb1f2e154e89
child 10 6defe5d1bd39
equal deleted inserted replaced
3:f5a1e66df979 7:a47de9135b21
    30 #include <bautils.h>
    30 #include <bautils.h>
    31 #include <aknlayoutscalable_apps.cdl.h>
    31 #include <aknlayoutscalable_apps.cdl.h>
    32 #include <aknlayoutscalable_avkon.cdl.h>
    32 #include <aknlayoutscalable_avkon.cdl.h>
    33 #include <peninputlayoutmultilineicf.h>
    33 #include <peninputlayoutmultilineicf.h>
    34 #include <AknSettingCache.h>
    34 #include <AknSettingCache.h>
       
    35 #include <AknFepInternalCRKeys.h>
       
    36 #include <centralrepository.h>
    35 
    37 
    36 #include "peninputgenericitutdatamgr.h"
    38 #include "peninputgenericitutdatamgr.h"
    37 #include "peninputgenericitutlayoutcontext.h"
    39 #include "peninputgenericitutlayoutcontext.h"
    38 #include "peninputgenericitutconverter.h"
    40 #include "peninputgenericitutconverter.h"
    39 #include "peninputgenericitutcustomization.h"
    41 #include "peninputgenericitutcustomization.h"
   108     ClearChnCandidates(EItutPuncCandidates);
   110     ClearChnCandidates(EItutPuncCandidates);
   109 
   111 
   110     iKeypadCellRects.Close();
   112     iKeypadCellRects.Close();
   111     iKeypadCellRectsCn.Close();
   113     iKeypadCellRectsCn.Close();
   112     iKeypadCellRectsQuery.Close(); 
   114     iKeypadCellRectsQuery.Close(); 
       
   115     iKeypadCellRectsForPrtWest.Close();
   113     delete iNumericKeymapData;
   116     delete iNumericKeymapData;
   114     }
   117     }
   115 
   118 
   116 void CGenericItutDataMgr::ConstructL()
   119 void CGenericItutDataMgr::ConstructL()
   117     {
   120     {
   172             iSubscriberList.Append(aSubscriber);
   175             iSubscriberList.Append(aSubscriber);
   173             }
   176             }
   174         }
   177         }
   175     }
   178     }
   176 
   179 
       
   180 void CGenericItutDataMgr::ReadLafInfoForPrtWest()
       
   181 	{
       
   182 	// Screen
       
   183 	TRect rect;
       
   184 
       
   185 	AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, rect);
       
   186 
       
   187 	TAknWindowLineLayout mainWnd, bottomWnd, bottomPane;
       
   188 	TAknLayoutRect mainWndRect, bottomwndtrect, bottompanerect;
       
   189 
       
   190 	mainWnd = AknLayoutScalable_Avkon::main_fep_vtchi_ss_pane(0).LayoutLine();
       
   191 	mainWndRect.LayoutRect(rect, mainWnd);
       
   192 	
       
   193 	bottomWnd = AknLayoutScalable_Avkon::popup_fep_ituss_window(0).LayoutLine();    
       
   194 	bottomwndtrect.LayoutRect(mainWndRect.Rect(), bottomWnd);
       
   195 
       
   196 	bottomPane = AknLayoutScalable_Avkon::ituss_keypad_pane(0).LayoutLine();
       
   197 	bottompanerect.LayoutRect(bottomwndtrect.Rect(), bottomPane);   
       
   198 	
       
   199 	iLayoutRectForPrtWest = mainWndRect.Rect();
       
   200 	iLayoutOffsetForPrtWest = mainWndRect.Rect().iTl;
       
   201 
       
   202 	// ICF
       
   203 	TAknWindowLineLayout icflayout, icflayoutbg, icflayoutpane;
       
   204 	TAknLayoutRect icfRect, icfRectBg, icfRectPane;
       
   205 	
       
   206 	icflayoutpane = AknLayoutScalable_Avkon::popup_fep_vtchi_icf_pane(0).LayoutLine();
       
   207 	icfRectPane.LayoutRect( mainWndRect.Rect(), icflayoutpane );
       
   208 	
       
   209 	icflayoutbg = AknLayoutScalable_Avkon::bg_icf_pane_cp01(0).LayoutLine();
       
   210 	icfRectBg.LayoutRect( icfRectPane.Rect(), icflayoutbg );
       
   211 	
       
   212 	icflayout = AknLayoutScalable_Avkon::vtchi_icf_list_pane(0).LayoutLine();
       
   213 	icfRect.LayoutRect( icfRectBg.Rect(), icflayout );
       
   214 	
       
   215 	iIcfRectForPrtWest = icfRect.Rect();
       
   216 	
       
   217 	// icf indicator
       
   218 	TAknWindowLineLayout icfIndiPaneWithText, icfIndiPaneWithoutText, 
       
   219         indiIcon, indiText;
       
   220 	TAknLayoutRect icfIndiPaneRectWithText, icfIndiPaneRectWithoutText, indiIconRect, indiTextRect;
       
   221 	TAknTextLineLayout indiTextLayout;
       
   222 	
       
   223 	icfIndiPaneWithText = AknLayoutScalable_Avkon::icf_edit_indi_pane(1).LayoutLine();
       
   224 	icfIndiPaneRectWithText.LayoutRect(icfRect.Rect(), icfIndiPaneWithText);
       
   225 	iIndiPaneRectWithTextForPrtWest = icfIndiPaneRectWithText.Rect();
       
   226 	
       
   227 	icfIndiPaneWithoutText = AknLayoutScalable_Avkon::icf_edit_indi_pane(0).LayoutLine();
       
   228 	icfIndiPaneRectWithoutText.LayoutRect(icfRect.Rect(), icfIndiPaneWithoutText);
       
   229 	iIndiPaneRectWithoutTextForPrtWest = icfIndiPaneRectWithoutText.Rect();
       
   230 	
       
   231 	iIndiIconRectWithTextForPrtWest = TRect( 0, 0, 60, 20 );
       
   232 	iIndiIconRectWithoutTextForPrtWest = TRect( 0, 0, 60, 20 );
       
   233 	
       
   234 	indiTextLayout = AknLayoutScalable_Avkon::icf_edit_indi_pane_t1(0).LayoutLine();
       
   235 	iIndiTextForPrtWest = indiTextLayout;
       
   236 	
       
   237 	// icf text
       
   238 	TAknTextLineLayout icflefttext, icflefttext1; 
       
   239 	icflefttext = AknLayoutScalable_Avkon::vtchi_icf_list_pane_t1(0, 0, 0).LayoutLine();
       
   240 	icflefttext1 = AknLayoutScalable_Avkon::vtchi_icf_list_pane_t1(0, 0, 1).LayoutLine();
       
   241 
       
   242 	iIcfTextAlignmentForPrtWest = icflefttext.iJ;
       
   243 	iIcfTextLeftMarginForPrtWest = icflefttext.il;
       
   244 	//iIcfTextRightMarginForPrtWest = icflefttext.ir;
       
   245 	iIcfTextRightMarginForPrtWest = iIcfTextLeftMarginForPrtWest;
       
   246 	    
       
   247 	TAknLayoutText ctxt, ctxt1;
       
   248 	ctxt.LayoutText( icfRect.Rect(), icflefttext );
       
   249 	ctxt1.LayoutText( icfRect.Rect(), icflefttext1 );
       
   250 	    
       
   251 	iIcfTextTopMarginForPrtWest = ctxt.TextRect().iTl.iY - icfRect.Rect().iTl.iY;
       
   252 	iIcfTextLineSpaceMarginForPrtWest = ctxt1.TextRect().iTl.iY - ctxt.TextRect().iBr.iY;
       
   253 	iIcfTextHeightForPrtWest = ctxt.TextRect().Height();
       
   254 	
       
   255 	TInt maxRow = ( iIcfRectForPrtWest.Height() - iIcfTextTopMarginForPrtWest ) 
       
   256         / ( iIcfTextHeightForPrtWest + iIcfTextLineSpaceMarginForPrtWest );
       
   257 	
       
   258 	iIcfTextBottomMarginForPrtWest = 
       
   259         iIcfRectForPrtWest.Height() - ( iIcfTextHeightForPrtWest + iIcfTextLineSpaceMarginForPrtWest ) 
       
   260         * maxRow - iIcfTextTopMarginForPrtWest;
       
   261 	    
       
   262 	iIcfFontForPrtWest = const_cast<CFont*>(AknLayoutUtils::FontFromId(icflefttext.iFont, NULL));	
       
   263 	
       
   264 	// Keypad
       
   265 	TAknWindowLineLayout itucell, ituinnercell;
       
   266 	TAknLayoutRect itucellrect, ituinnercellrect;
       
   267    
       
   268 	iKeypadCellRectsForPrtWest.Reset();
       
   269 
       
   270 	itucell = AknLayoutScalable_Avkon::cell_ituss_key_pane(0).LayoutLine();           
       
   271 	itucellrect.LayoutRect(bottompanerect.Rect(), itucell);
       
   272 	ituinnercell = AknLayoutScalable_Avkon::bg_cell_ituss_key_g1(1).LayoutLine();
       
   273 	
       
   274 	iKeypadRectForPrtWest = bottompanerect.Rect();
       
   275 	iKeypadRectForPrtWest.SetHeight(itucellrect.Rect().Height() * 4);
       
   276 	iKeypadRectForPrtWest.Move(-iLayoutOffsetForPrtWest); 
       
   277 	
       
   278 	TRect cellrect = itucellrect.Rect();
       
   279 	cellrect.Move(-iLayoutOffsetForPrtWest);
       
   280 	cellrect.Move(-iKeypadRectForPrtWest.iTl);
       
   281 	   
       
   282 	// keypad is 4 rows, 3 cols
       
   283 	for (TInt i = 0; i < 4; i++)
       
   284 		{
       
   285 		for (TInt j = 0; j < 3; j++)
       
   286 			{
       
   287 			TRect keyrect = cellrect;
       
   288 			keyrect.Move(itucellrect.Rect().Width() * j, itucellrect.Rect().Height() * i);
       
   289 
       
   290 			ituinnercellrect.LayoutRect(keyrect, ituinnercell);
       
   291 			iKeypadCellRectsForPrtWest.Append(ituinnercellrect.Rect());
       
   292 			
       
   293 			// read shift icon rect
       
   294 			if( i == 3 &&  j == 2 )
       
   295 				{
       
   296 				TAknWindowLineLayout shiftIcon =  AknLayoutScalable_Avkon::
       
   297 								cell_ituss_key_pane_g2( 0 ).LayoutLine();
       
   298 				TAknLayoutRect shiftIconRect;
       
   299 				shiftIconRect.LayoutRect( keyrect, shiftIcon );                
       
   300 				iShiftIconRectForPrtWest = shiftIconRect.Rect();          
       
   301 				}    
       
   302 			}
       
   303 		} 
       
   304 	 
       
   305 
       
   306 	iVkNumTextForPrtWest = AknLayoutScalable_Avkon::cell_ituss_key_t1(0).LayoutLine(); 
       
   307 	// Key text row 1                               
       
   308 	iVkAlphaText1ForPrtWest = AknLayoutScalable_Avkon::cell_ituss_key_t2(0).LayoutLine();
       
   309 	iVkAlphaText3ForPrtWest = AknLayoutScalable_Avkon::cell_ituss_key_t4(0).LayoutLine();                                                              
       
   310 	// Key text row 2                               
       
   311 	iVkAlphaText2ForPrtWest = AknLayoutScalable_Avkon::cell_ituss_key_t3(0).LayoutLine();
       
   312 	
       
   313 	// close button
       
   314 	TAknWindowLineLayout funcbtn, funcbtnbg, funcbtninner;
       
   315 	TAknLayoutRect funcrect, funcbgrect, funcinnerrect, arrowleftinnerrect, arrowrightinnerrect;
       
   316 	TAknLayoutRect optioninnerrect, backspaceinnerrect;
       
   317 	
       
   318 	funcbtn = AknLayoutScalable_Avkon::cell_ituss_key_pane(1).LayoutLine();
       
   319 	funcrect.LayoutRect(bottompanerect.Rect(), funcbtn);
       
   320 	
       
   321 	funcbtnbg = AknLayoutScalable_Avkon::bg_cell_ituss_key_g1(1).LayoutLine();
       
   322 	funcbgrect.LayoutRect(funcrect.Rect(), funcbtnbg);
       
   323 	
       
   324 	funcbtninner = AknLayoutScalable_Avkon::cell_ituss_key_pane_g1(0).LayoutLine();
       
   325 	funcinnerrect.LayoutRect(funcrect.Rect(), funcbtninner);
       
   326 	
       
   327 	TInt btnWidth = funcrect.Rect().Width();
       
   328 	// close button
       
   329 	iCloseRectForPrtWest = funcbgrect.Rect();
       
   330 	iCloseRectForPrtWest.Move(0, funcrect.Rect().Height() * 4);
       
   331 	iCloseRectForPrtWest.Move(-iLayoutOffsetForPrtWest);
       
   332 
       
   333 	iCloseInnerRectForPrtWest = funcinnerrect.Rect();
       
   334 	iCloseInnerRectForPrtWest.Move(0, funcrect.Rect().Height() * 4);
       
   335 	iCloseInnerRectForPrtWest.Move(-iLayoutOffsetForPrtWest);
       
   336 	
       
   337 	// arrow left button
       
   338 	iArrowLeftRectForPrtWest = iCloseRectForPrtWest;     
       
   339 	iArrowLeftRectForPrtWest.Move(btnWidth, 0);
       
   340 	arrowleftinnerrect.LayoutRect(iArrowLeftRectForPrtWest, funcbtninner);
       
   341 	iArrowLeftInnerRectForPrtWest = arrowleftinnerrect.Rect();
       
   342 	
       
   343 	// option button
       
   344 	iOptionsRectForPrtWest = iArrowLeftRectForPrtWest;
       
   345 	iOptionsRectForPrtWest.Move(btnWidth, 0);    
       
   346 	optioninnerrect.LayoutRect(iOptionsRectForPrtWest, funcbtninner);
       
   347 	iOptionInnerRectForPrtWest = optioninnerrect.Rect();
       
   348 	
       
   349 	// arrow right button
       
   350 	iArrowRightRectForPrtWest = iOptionsRectForPrtWest;
       
   351 	iArrowRightRectForPrtWest.Move(btnWidth, 0);    
       
   352 	arrowrightinnerrect.LayoutRect(iArrowRightRectForPrtWest, funcbtninner);
       
   353 	iArrowRightInnerRectForPrtWest = arrowrightinnerrect.Rect();
       
   354 	
       
   355 	// backspace button
       
   356 	iBackspaceRectForPrtWest = iArrowRightRectForPrtWest;
       
   357 	iBackspaceRectForPrtWest.Move(btnWidth, 0);  
       
   358 	backspaceinnerrect.LayoutRect(iBackspaceRectForPrtWest, funcbtninner);
       
   359 	iBackspaceInnerRectForPrtWest = backspaceinnerrect.Rect();
       
   360 
       
   361 	// preview popup window 
       
   362 	TAknWindowLineLayout previewWnd, previewBackground, previewWndInner;
       
   363 	TAknLayoutRect previewWndRect, previewBackgroundRect, previewWndInnerRect;
       
   364 	TAknLayoutText previewWndText;
       
   365 	previewWnd = AknLayoutScalable_Avkon::popup_fshwr2_char_preview_window(0).LayoutLine(); 
       
   366 				
       
   367 	previewWndRect.LayoutRect( iLayoutRectForPrtWest, previewWnd );
       
   368 	previewBackground = AknLayoutScalable_Avkon::bg_popup_fep_char_preview_window_cp01().LayoutLine();
       
   369 	previewBackgroundRect.LayoutRect( previewWndRect.Rect(), previewBackground );
       
   370 	iPreviewWndRectForPrtWest = previewBackgroundRect.Rect();
       
   371 	
       
   372 	previewWndInner = AknLayoutScalable_Avkon::bg_popup_fep_char_preview_window_g9().LayoutLine();
       
   373 	previewWndInnerRect.LayoutRect( previewBackgroundRect.Rect(), previewWndInner );
       
   374 	
       
   375 	iPreviewWndInnerRectForPrtWest = previewWndInnerRect.Rect();
       
   376 	iPreviewWndTextForPrtWest = 
       
   377 		AknLayoutScalable_Avkon::popup_fshwr2_char_preview_window_t1(0).LayoutLine();
       
   378 	previewWndText.LayoutText(previewWndRect.Rect(), iPreviewWndTextForPrtWest);
       
   379 	iBubbleFontForPrtWest = const_cast<CFont*>(previewWndText.Font());	
       
   380 	
       
   381 	// LAF for spell mode
       
   382 	TAknWindowLineLayout btnPaneWnd, okBtnWnd, cancelBtnWnd, spellwnd;
       
   383 	TAknLayoutRect btnPaneRect, okBtnRect, cancelBtnRect, spellwndtrect;
       
   384 	
       
   385 	iSpellQueryPaneRectForPrtWest = mainWndRect.Rect();
       
   386 	
       
   387     spellwnd = AknLayoutScalable_Avkon::popup_fep_ituss_window(1).LayoutLine();
       
   388     spellwndtrect.LayoutRect( mainWndRect.Rect(), spellwnd ); 
       
   389     
       
   390 	btnPaneWnd = AknLayoutScalable_Avkon::ituss_sks_pane(0).LayoutLine();
       
   391 	btnPaneRect.LayoutRect( spellwndtrect.Rect(), btnPaneWnd );
       
   392 	
       
   393 	okBtnWnd = AknLayoutScalable_Avkon::ituss_sks_pane_g1(0).LayoutLine();
       
   394 	okBtnRect.LayoutRect( btnPaneRect.Rect(), okBtnWnd );
       
   395 	iOKRectForPrtWest = okBtnRect.Rect();
       
   396 	
       
   397 	cancelBtnWnd = AknLayoutScalable_Avkon::ituss_sks_pane_g2(0).LayoutLine();
       
   398 	cancelBtnRect.LayoutRect( btnPaneRect.Rect(), cancelBtnWnd );
       
   399 	iCancelRectForPrtWest = cancelBtnRect.Rect();
       
   400 	
       
   401 	iBtnOKTextForPrtWest = AknLayoutScalable_Avkon::ituss_sks_pane_t1(0).LayoutLine();
       
   402 	iBtnCancelTextForPrtWest = AknLayoutScalable_Avkon::ituss_sks_pane_t2(0).LayoutLine();
       
   403 	
       
   404 	iBtnOKTextForPrtWest.ir = 7;
       
   405 	iBtnCancelTextForPrtWest.ir = 7;
       
   406 	
       
   407 	iBtnCancelTextForPrtWest = iBtnOKTextForPrtWest;
       
   408 	
       
   409 	TAknWindowLineLayout queryTopPane, queryICFPane, icfSpellIndiPane, middleInnerBtn;
       
   410 	TAknLayoutRect queryTopPaneRect, queryICFPaneRect, icfSpellIndiPaneRect, 
       
   411 		middleButton, middleInnerRect;
       
   412 	
       
   413 	queryTopPane = AknLayoutScalable_Avkon::popup_fep_vtchi_icf_pane(1).LayoutLine();
       
   414 	queryTopPaneRect.LayoutRect( mainWndRect.Rect(), queryTopPane );
       
   415 	
       
   416 	queryICFPane = AknLayoutScalable_Avkon::vtchi_query_pane(0).LayoutLine();
       
   417 	queryICFPaneRect.LayoutRect( queryTopPaneRect.Rect(), queryICFPane );
       
   418 	iSpellICFRectForPrtWest = queryICFPaneRect.Rect();
       
   419 	
       
   420 	TRect middleButtonPaneRect = spellwndtrect.Rect();
       
   421 	middleButtonPaneRect.Move( 5, 3 );
       
   422 	
       
   423 	TRect cellSpellRect;
       
   424 	cellSpellRect.iTl = middleButtonPaneRect.iTl;
       
   425 	cellSpellRect.SetHeight( itucellrect.Rect().Height());
       
   426 	cellSpellRect.SetWidth( itucellrect.Rect().Width());
       
   427 
       
   428 	// Left
       
   429 	middleButton.LayoutRect( cellSpellRect, ituinnercell );
       
   430 	iSpellArrowLeftRectForPrtWest = middleButton.Rect();
       
   431 	
       
   432 	middleInnerBtn = AknLayoutScalable_Avkon::cell_ituss_key_pane_g1(2).LayoutLine();
       
   433 	middleInnerRect.LayoutRect( middleButton.Rect(), middleInnerBtn );
       
   434 	iSpellArrowLeftInnerRectForPrtWest = middleInnerRect.Rect();
       
   435 	
       
   436 	// Right
       
   437 	cellSpellRect.Move( itucellrect.Rect().Width(), 0 );
       
   438 	middleButton.LayoutRect( cellSpellRect, ituinnercell );
       
   439 	iSpellArrowRightRectForPrtWest = middleButton.Rect();
       
   440 	
       
   441 	middleInnerRect.LayoutRect( middleButton.Rect(), middleInnerBtn );
       
   442 	iSpellArrowRightInnerRectForPrtWest = middleInnerRect.Rect();
       
   443 	
       
   444 	// BackSpace
       
   445 	cellSpellRect.Move( itucellrect.Rect().Width(), 0 );
       
   446 	middleButton.LayoutRect( cellSpellRect, ituinnercell );
       
   447 	iSpellICFBtnRectForPrtWest = middleButton.Rect();
       
   448 	
       
   449 	middleInnerRect.LayoutRect( middleButton.Rect(), middleInnerBtn );
       
   450 	iSpellICFBtnInnerRectForPrtWest = middleInnerRect.Rect();
       
   451 	
       
   452 	iSpellText1ForPrtWest = AknLayoutScalable_Avkon::vtchi_query_pane_t1(0).LayoutLine();
       
   453 	iSpellText2ForPrtWest = AknLayoutScalable_Avkon::vtchi_query_pane_t2(0).LayoutLine();
       
   454 	iSpellText3ForPrtWest = AknLayoutScalable_Avkon::vtchi_query_pane_t3(0).LayoutLine();
       
   455 	
       
   456 	iSpellIcfFontForPrtWest = const_cast<CFont*>(
       
   457 	        AknLayoutUtils::FontFromId(iSpellText1ForPrtWest.iFont, NULL));
       
   458 	
       
   459 	TAknLayoutText cSpelltxt1;
       
   460 	cSpelltxt1.LayoutText( queryICFPaneRect.Rect(), iSpellText1ForPrtWest );
       
   461 	iSpellIcfTextHeightForPrtWest = cSpelltxt1.TextRect().Height();
       
   462 	
       
   463 	
       
   464 	icfSpellIndiPane = AknLayoutScalable_Avkon::icf_edit_indi_pane(0).LayoutLine();
       
   465 	icfSpellIndiPaneRect.LayoutRect(queryICFPaneRect.Rect(), icfSpellIndiPane);
       
   466 	iSpellIndiPaneWithoutTextForPrtWest = icfSpellIndiPaneRect.Rect();
       
   467 	iSpellIndiIconWithoutTextForPrtWest = TRect( 0, 0, 50, 17 );
       
   468 	}
   177 void CGenericItutDataMgr::ReadLafInfo()
   469 void CGenericItutDataMgr::ReadLafInfo()
   178     {
   470     {
   179     // Screen
   471     // Screen
   180     TRect rect, rectcn;
   472     TRect rect, rectcn;
   181     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);
   473     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);
   182     iScreenSize = rect.Size();
   474     iScreenSize = rect.Size();
   183 
   475 
   184     iLandScape = iScreenSize.iWidth < iScreenSize.iHeight ? EFalse : ETrue;
   476     iLandScape = iScreenSize.iWidth < iScreenSize.iHeight ? EFalse : ETrue;
   185 
   477 
       
   478     ReadLafInfoForPrtWest();
   186     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, rect);
   479     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EApplicationWindow, rect);
   187 
   480 
   188     // finger Layout
   481     // finger Layout
   189     TAknWindowLineLayout vitulayout;
   482     TAknWindowLineLayout vitulayout;
   190     TAknLayoutRect viturect;
   483     TAknLayoutRect viturect;
   765     {
  1058     {
   766     CFepLayoutMultiLineIcf* icffield = static_cast<CFepLayoutMultiLineIcf*>(iLayoutContext->Control(ECtrlIdICF));
  1059     CFepLayoutMultiLineIcf* icffield = static_cast<CFepLayoutMultiLineIcf*>(iLayoutContext->Control(ECtrlIdICF));
   767     
  1060     
   768     if (icffield && InputLanguage() != ELangNone)
  1061     if (icffield && InputLanguage() != ELangNone)
   769         {
  1062         {
   770         TRAP_IGNORE(icffield->SetTextAlignmentL(iIcfTextAlignment, InputLanguage()));
  1063         if ( IsPortraitWest())
       
  1064             {
       
  1065             TRAP_IGNORE(icffield->SetTextAlignmentL(
       
  1066                     iIcfTextAlignmentForPrtWest, InputLanguage()));
       
  1067             }
       
  1068         else
       
  1069             {
       
  1070             TRAP_IGNORE(icffield->SetTextAlignmentL(
       
  1071                     iIcfTextAlignment, InputLanguage()));
       
  1072             }
   771         }
  1073         }
   772     }
  1074     }
   773     
  1075     
   774 void CGenericItutDataMgr::SetIcfTextAlignment(TInt aAlignment)
  1076 void CGenericItutDataMgr::SetIcfTextAlignment(TInt aAlignment)
   775     {
  1077     {
   776     iIcfTextAlignment = aAlignment;
  1078     if ( IsPortraitWest())
       
  1079         {
       
  1080         iIcfTextAlignmentForPrtWest = aAlignment;
       
  1081         }
       
  1082     else
       
  1083         {
       
  1084         iIcfTextAlignment = aAlignment;
       
  1085         }
   777     }
  1086     }
   778 
  1087 
   779 void CGenericItutDataMgr::SetLanguageL(TInt aLanguage)
  1088 void CGenericItutDataMgr::SetLanguageL(TInt aLanguage)
   780     {    
  1089     {    
   781     ASSERT( IsValidLanguage( aLanguage ) );
  1090     ASSERT( IsValidLanguage( aLanguage ) );
   888             iInputMode = aMode;
  1197             iInputMode = aMode;
   889             }
  1198             }
   890         }
  1199         }
   891     }
  1200     }
   892 
  1201 
       
  1202 TBool CGenericItutDataMgr::IsChineseGlobalLanguage()
       
  1203     {
       
  1204     CRepository* repository = NULL;
       
  1205     TRAPD(ret, repository = CRepository::NewL(KCRUidAknFep));
       
  1206     if (ret != KErrNone)
       
  1207         {
       
  1208         return EPluginInputModeAll;
       
  1209         }
       
  1210     TInt curLanguage ;
       
  1211     repository->Get(KAknFepInputTxtLang, curLanguage);
       
  1212     delete repository;
       
  1213     
       
  1214     return (curLanguage == ELangPrcChinese || curLanguage == ELangHongKongChinese 
       
  1215          || curLanguage == ELangTaiwanChinese);
       
  1216     }
       
  1217 
       
  1218 TAny* CGenericItutDataMgr::RequestDataForPortraitWest(TInt aDataType)
       
  1219     {
       
  1220     switch ( aDataType )
       
  1221         {
       
  1222         case EScreenSize:
       
  1223             {
       
  1224             return &iScreenSize;
       
  1225             }
       
  1226         case ELayoutOffset:
       
  1227             {
       
  1228             return &iLayoutOffsetForPrtWest;
       
  1229             }
       
  1230         case ELayoutRect:
       
  1231             {
       
  1232             if ( IsChineseGlobalLanguage())
       
  1233                 {
       
  1234                 return &iLayoutRect;
       
  1235                 }
       
  1236             else
       
  1237                 {
       
  1238                 return &iLayoutRectForPrtWest;
       
  1239                 }
       
  1240             }
       
  1241         case EIcfRect:
       
  1242             {
       
  1243             return &iIcfRectForPrtWest;
       
  1244             }
       
  1245         case EIcfFont:
       
  1246             {
       
  1247             if ( IsChineseGlobalLanguage())
       
  1248                 {
       
  1249                 return IsChinese() ? reinterpret_cast<TAny*>(iIcfFontCn) : 
       
  1250                     reinterpret_cast<TAny*>(iIcfFont);
       
  1251                 }
       
  1252             else
       
  1253                 {
       
  1254                 return reinterpret_cast<TAny*>(iIcfFontForPrtWest);
       
  1255                 }
       
  1256             }
       
  1257         case EBackspaceRect:
       
  1258         case EItutPosClear:
       
  1259             {
       
  1260             return &iBackspaceRectForPrtWest;
       
  1261             }
       
  1262         case EKeypadRect:
       
  1263             {
       
  1264             if ( IsChineseGlobalLanguage())
       
  1265                 {
       
  1266                 return IsChinese() ? &iKeypadRectCn : &iKeypadRect;
       
  1267                 }
       
  1268             else
       
  1269                 {
       
  1270                 return &iKeypadRectForPrtWest;
       
  1271                 }
       
  1272             }               
       
  1273         case EKeypadCellRects:
       
  1274             {
       
  1275             if ( IsChineseGlobalLanguage())
       
  1276                 {
       
  1277                 return IsChinese() ? &iKeypadCellRectsCn : &iKeypadCellRects;
       
  1278                 }
       
  1279             else
       
  1280                 {
       
  1281                 return &iKeypadCellRectsForPrtWest;
       
  1282                 }
       
  1283             }
       
  1284         case EKeypadLeftTextLine:
       
  1285             {
       
  1286             if ( IsChineseGlobalLanguage())
       
  1287                 {
       
  1288                 return &iVkNumText;
       
  1289                 }
       
  1290             else
       
  1291                 {
       
  1292                 return &iVkNumTextForPrtWest;
       
  1293                 }
       
  1294             }
       
  1295         case EKeypadRightTextLine1:
       
  1296             {
       
  1297             if ( IsChineseGlobalLanguage())
       
  1298                 {
       
  1299                 return IsThai() ? &iVkAlphaText1ForThai : &iVkAlphaText1;
       
  1300                 }
       
  1301             else
       
  1302                 {
       
  1303                 return &iVkAlphaText1ForPrtWest;
       
  1304                 }
       
  1305             }
       
  1306         case EKeypadRightTextLine2:
       
  1307             {
       
  1308             if ( IsChineseGlobalLanguage())
       
  1309                 {
       
  1310                 return IsThai() ? &iVkAlphaText2ForThai : &iVkAlphaText2;
       
  1311                 }
       
  1312             else
       
  1313                 {
       
  1314                 return &iVkAlphaText2ForPrtWest;
       
  1315                 }
       
  1316             }
       
  1317         case EKeypadRightTextLine3:
       
  1318             {
       
  1319             if ( IsChineseGlobalLanguage())
       
  1320                 {
       
  1321                 return IsThai() ? &iVkAlphaText3ForThai : &iVkAlphaText3;
       
  1322                 }
       
  1323             else
       
  1324                 {
       
  1325                 return &iVkAlphaText3ForPrtWest;
       
  1326                 }
       
  1327             }
       
  1328         case EDropdownlistUnitWidth:
       
  1329             {
       
  1330             return &iCandsUnitWidth;
       
  1331             }
       
  1332         case EDropdownlistUnitHeight:
       
  1333             {
       
  1334             return &iCandsUnitHeight;
       
  1335             }
       
  1336         case EDropdownlistHorizontalMargin:
       
  1337             {
       
  1338             return &iCandsHorizontalMargin;
       
  1339             }
       
  1340         case EDropdownlistVerticalMargin:
       
  1341             {
       
  1342             return &iCandsVerticalMargin;
       
  1343             }
       
  1344         case EDropdownListNaviWidth:
       
  1345             {
       
  1346             return &iCandsNaviWidth;
       
  1347             }
       
  1348         case EDropdownListSpinBtnHeight:
       
  1349             {
       
  1350             return &iCandsSpinBtnHeight;
       
  1351             }
       
  1352         case EDropdownListSpellLTPos:
       
  1353             {
       
  1354             return &iCandsSpellLTPos;
       
  1355             }
       
  1356         case EDropdownListCandsLTPos:
       
  1357             {
       
  1358             return &iCandsLTPos;
       
  1359             }
       
  1360         case EDropdownListPuncLTPos:
       
  1361             {
       
  1362             return &iCandsPuncLTPos;
       
  1363             }
       
  1364         case EDropdownListFont:
       
  1365             {
       
  1366             return reinterpret_cast<TAny*>(iCandsFont);
       
  1367             }
       
  1368         case EDropdownListTextMargin:
       
  1369             {
       
  1370             return &iCandsTextMargin;
       
  1371             }
       
  1372         case EDropdownListTextColor:
       
  1373             {
       
  1374             return &iCandsTextColor;
       
  1375             }
       
  1376         case ESpellRect:
       
  1377             {
       
  1378             return &iSpellRect;
       
  1379             }
       
  1380         case ESpellFont:
       
  1381             {
       
  1382             return reinterpret_cast<TAny*>(iSpellIcfFontForPrtWest);
       
  1383             }
       
  1384         case ESpellTextColor:
       
  1385             {
       
  1386             return &iSpellTextColor;
       
  1387             }
       
  1388         case ELanguage:
       
  1389             {
       
  1390             return &iLanguage;
       
  1391             }
       
  1392         case EInputMode:
       
  1393             {
       
  1394             return &iInputMode;
       
  1395             }
       
  1396         case ECase:
       
  1397             {
       
  1398             return &iCase;
       
  1399             }
       
  1400         case EChnCandidates:
       
  1401             {
       
  1402             return &iCandidates;
       
  1403             }
       
  1404         case EChnPuncCandidates:
       
  1405             {
       
  1406             return &iPuncCandidates;
       
  1407             }
       
  1408         case EArrowLeftRect:
       
  1409         case EItutPosArrowLeft:
       
  1410             {
       
  1411             return &iArrowLeftRectForPrtWest;
       
  1412             }
       
  1413         case EArrowRightRect:
       
  1414         case EItutPosArrowRight:
       
  1415             {
       
  1416             return &iArrowRightRectForPrtWest;
       
  1417             }
       
  1418         case EArrowUpRect:
       
  1419         case EItutPosArrowUp:
       
  1420             {
       
  1421             return &iArrowUpRect;
       
  1422             }
       
  1423         case EArrowDownRect:
       
  1424         case EItutPosArrowDown:
       
  1425             {
       
  1426             return &iArrowDownRect;
       
  1427             }
       
  1428         case EItutPosSend:
       
  1429             {
       
  1430             return &iSendRect;
       
  1431             }
       
  1432         case EItutPosDisconn:
       
  1433             {
       
  1434             return &iDisconnRect;
       
  1435             }
       
  1436         case EMatchSelectionTlPos:
       
  1437             {
       
  1438             return &iSelectionTl;
       
  1439             }
       
  1440         case EMatchSelectionItemSize:
       
  1441             {
       
  1442             return &iSelectionItemSize;
       
  1443             }
       
  1444         case EMatchSelectionItemMargin:
       
  1445             {
       
  1446             return &iSelectionItemMargin;
       
  1447             }
       
  1448         case EMatchSelectionTextLine:
       
  1449             {
       
  1450             return &iSelectionTextLine;
       
  1451             }
       
  1452         case EOptionsRect:   
       
  1453             {
       
  1454             return &iOptionsRectForPrtWest;
       
  1455             }           
       
  1456         case ECloseRect:
       
  1457             {
       
  1458             return &iCloseRectForPrtWest;
       
  1459             }          
       
  1460         case ELeftInnerRect:
       
  1461             {
       
  1462             return &iArrowLeftInnerRectForPrtWest;
       
  1463             }
       
  1464         case ERightInnerRect:
       
  1465             {
       
  1466             return &iArrowRightInnerRectForPrtWest;
       
  1467             }
       
  1468         case EUpInnerRect:
       
  1469             {
       
  1470             return &iArrowUpInnerRect;
       
  1471             }
       
  1472         case EDownInnerRect:
       
  1473             {
       
  1474             return &iArrowDownInnerRect;
       
  1475             }
       
  1476         case EBackspaceInnerRect:
       
  1477             {
       
  1478             return &iBackspaceInnerRectForPrtWest;
       
  1479             }
       
  1480         case ECloseInnerRect:
       
  1481             {
       
  1482             return &iCloseInnerRectForPrtWest;
       
  1483             }       
       
  1484         case EOptionInnerRect:
       
  1485             {
       
  1486             return &iOptionInnerRectForPrtWest;
       
  1487             }         
       
  1488         case EItutPosOk:
       
  1489             {
       
  1490             if ( IsChineseGlobalLanguage())
       
  1491                 {
       
  1492                 return &iOkRect;
       
  1493                 }
       
  1494             else
       
  1495                 {
       
  1496                 return &iOKRectForPrtWest;
       
  1497                 }
       
  1498             }
       
  1499         case EItutPosCancel:
       
  1500             {
       
  1501             if ( IsChineseGlobalLanguage())
       
  1502                 {
       
  1503                 return &iCancelRect;
       
  1504                 }
       
  1505             else
       
  1506                 {
       
  1507                 return &iCancelRectForPrtWest;
       
  1508                 }
       
  1509             }
       
  1510         case EBtnTextLine:
       
  1511             {
       
  1512             if ( IsChineseGlobalLanguage())
       
  1513                 {
       
  1514                 return &iBtnTextFormat;
       
  1515                 }
       
  1516             else
       
  1517                 {
       
  1518                 return &iBtnOKTextForPrtWest;
       
  1519                 }
       
  1520             }
       
  1521         case ESpellTextCancle:
       
  1522             {
       
  1523             if ( IsChineseGlobalLanguage())
       
  1524                 {
       
  1525                 return &iBtnTextFormat1;
       
  1526                 }
       
  1527             else
       
  1528                 {
       
  1529                 return &iBtnCancelTextForPrtWest;
       
  1530                 }
       
  1531             }
       
  1532         case ESpellICFRect:
       
  1533             {
       
  1534             if ( IsChineseGlobalLanguage())
       
  1535                 {
       
  1536                 return &iSpellICFRect;
       
  1537                 }
       
  1538             else
       
  1539                 {
       
  1540                 return &iSpellICFRectForPrtWest;
       
  1541                 }
       
  1542             }
       
  1543         case ESpellClrRect:
       
  1544             {
       
  1545             if ( IsChineseGlobalLanguage())
       
  1546                 {
       
  1547                 return &iSpellClrRect;
       
  1548                 }
       
  1549             else
       
  1550                 {
       
  1551                 return &iSpellICFBtnRectForPrtWest;
       
  1552                 }
       
  1553             }
       
  1554         case ESpellClrInnerRect:
       
  1555             {
       
  1556             if ( IsChineseGlobalLanguage())
       
  1557                 {
       
  1558                 return &iSpellClrInnerRect;
       
  1559                 }
       
  1560             else
       
  1561                 {
       
  1562                 return &iSpellICFBtnInnerRectForPrtWest;
       
  1563                 }
       
  1564             }
       
  1565         case ESpellEditIndicatorRect:
       
  1566             {
       
  1567             return &iSpellEditIndicator;
       
  1568             }
       
  1569         case ESpellQueryPaneRect:
       
  1570             {
       
  1571             if ( IsChineseGlobalLanguage())
       
  1572                 {
       
  1573                 return &iSpellQueryPaneRect;
       
  1574                 }
       
  1575             else
       
  1576                 {
       
  1577                 return &iSpellQueryPaneRectForPrtWest;
       
  1578                 }
       
  1579             }
       
  1580         case ELatinOnly:
       
  1581             {
       
  1582             return &iLatinOnly;
       
  1583             }
       
  1584         case EPreviewBubbleRect:
       
  1585             {
       
  1586             return &iPreviewWndRectForPrtWest;
       
  1587             }
       
  1588         case EPreviewBubbleInnerRect:
       
  1589             {
       
  1590             return &iPreviewWndInnerRectForPrtWest;
       
  1591             }   
       
  1592         case EPreviewBubbleTextlayout:
       
  1593             {
       
  1594             return &iPreviewWndTextForPrtWest;
       
  1595             }
       
  1596         case EPreviewBubbleFont:
       
  1597             {
       
  1598             return reinterpret_cast<TAny*>(iBubbleFontForPrtWest);
       
  1599             }
       
  1600         case EImIndicatorRect:
       
  1601             {
       
  1602             if (iSpellMode)
       
  1603                 {
       
  1604                 return &iSpellEditIndicator;
       
  1605                 }
       
  1606                  
       
  1607             CalWesternIndicator();
       
  1608             return &iCalindwesternRect;
       
  1609             }
       
  1610         case EImIndicatorOuterRect:
       
  1611             {
       
  1612             return &iImIndiOuterRect;
       
  1613             }
       
  1614         case EIndiPaneWithTextRect:
       
  1615             {
       
  1616             return &iIndiPaneRectWithTextForPrtWest;
       
  1617             }
       
  1618         case EIndiPaneWithoutTextRect:
       
  1619             {
       
  1620             return &iIndiPaneRectWithoutTextForPrtWest;
       
  1621             }
       
  1622         case EIndiIconWithTextRect:
       
  1623             {
       
  1624             return &iIndiIconRectWithTextForPrtWest;
       
  1625             }
       
  1626         case EIndiIconWithoutTextRect:
       
  1627             {
       
  1628             return &iIndiIconRectWithoutTextForPrtWest;
       
  1629             }
       
  1630         case EIndiTextLine:
       
  1631             {
       
  1632             return &iIndiTextForPrtWest;
       
  1633             }
       
  1634         case ESpellIndiPaneWithoutTextRect:
       
  1635             {
       
  1636             return &iSpellIndiPaneWithoutTextForPrtWest;
       
  1637             }
       
  1638         case ESpellIndiIconWithoutTextRect:
       
  1639             {
       
  1640             return &iSpellIndiIconWithoutTextForPrtWest;
       
  1641             }
       
  1642         case ESpellArrowLeft:
       
  1643         	{
       
  1644         	return &iSpellArrowLeftRectForPrtWest;
       
  1645         	}
       
  1646         case ESpellArrowLeftInner:
       
  1647         	{
       
  1648         	return &iSpellArrowLeftInnerRectForPrtWest;
       
  1649         	}
       
  1650         case ESpellArrowRight:
       
  1651         	{
       
  1652         	return &iSpellArrowRightRectForPrtWest;
       
  1653         	}
       
  1654         case ESpellArrowRightInner:
       
  1655         	{
       
  1656         	return &iSpellArrowRightInnerRectForPrtWest;
       
  1657         	}
       
  1658         default:
       
  1659             break;
       
  1660         }
       
  1661 
       
  1662     return NULL;
       
  1663     }
   893 TAny* CGenericItutDataMgr::RequestData(TInt aDataType)
  1664 TAny* CGenericItutDataMgr::RequestData(TInt aDataType)
   894     {
  1665     {
       
  1666     if ( IsPortraitWest())
       
  1667         {
       
  1668         return RequestDataForPortraitWest( aDataType );
       
  1669         }
   895     switch ( aDataType )
  1670     switch ( aDataType )
   896         {
  1671         {
   897         case EScreenSize:
  1672         case EScreenSize:
   898             return &iScreenSize;
  1673             return &iScreenSize;
   899         case ELayoutOffset:
  1674         case ELayoutOffset: