fep/aknfep/UiPlugins/AknFepUiInterface/AvkonImpl/src/AknFepUiAvkonCtrlContainerChinese.cpp
branchRCL_3
changeset 50 5a1685599b76
parent 0 eb1f2e154e89
child 56 8152b1f1763a
equal deleted inserted replaced
46:bd83ceabce89 50:5a1685599b76
    40 #include <AknUtils.h>
    40 #include <AknUtils.h>
    41 #include <AknsDrawUtils.h>
    41 #include <AknsDrawUtils.h>
    42 #include <AknsFrameBackgroundControlContext.h>
    42 #include <AknsFrameBackgroundControlContext.h>
    43 #include <skinlayout.cdl.h>
    43 #include <skinlayout.cdl.h>
    44 #include <AknDef.h>
    44 #include <AknDef.h>
       
    45 #include <coemain.h>
       
    46 #include "AknFepUiInputStateBase.h"
    45 
    47 
    46 #include "AknFepUiInterfacePanic.h"
    48 #include "AknFepUiInterfacePanic.h"
    47 #include "AknFepUIAvkonCtrlContainerChinese.h"
    49 #include "AknFepUIAvkonCtrlContainerChinese.h"
    48 #include "AknFepUIAvkonCtrlCandidatePane.h"
    50 #include "AknFepUIAvkonCtrlCandidatePane.h"
    49 #include "AknFepUIAvkonCtrlInputPane.h"
    51 #include "AknFepUIAvkonCtrlInputPane.h"
   108         if(aEnable)
   110         if(aEnable)
   109             {
   111             {
   110             Window().SetOrdinalPosition(0, ECoeWinPriorityFep); // right at the front
   112             Window().SetOrdinalPosition(0, ECoeWinPriorityFep); // right at the front
   111             // make sure we are not faded even if a query has appeared
   113             // make sure we are not faded even if a query has appeared
   112             Window().SetFaded(EFalse, RWindowTreeNode::EFadeIncludeChildren); 
   114             Window().SetFaded(EFalse, RWindowTreeNode::EFadeIncludeChildren); 
       
   115             ClaimPointerGrab(ETrue);
       
   116             // Set enable to capture outside pointer down event to close UI.
       
   117             SetPointerCapture( ETrue );
   113             }
   118             }
   114         else
   119         else
   115             {
   120             {
   116             // make sure that the popup window is disabled as well
   121             // make sure that the popup window is disabled as well
   117             iInputPane->MakeVisible(aEnable); 
   122             iInputPane->MakeVisible(aEnable); 
   118             iPinyinPopupWindow->Enable(aEnable);
   123             iPinyinPopupWindow->Enable(aEnable);
   119             iEditPane->Enable(aEnable);
   124             iEditPane->Enable(aEnable);
   120             iCandidatePane->Enable(aEnable);
   125             iCandidatePane->Enable(aEnable);
       
   126             ClaimPointerGrab(EFalse);
       
   127         	// Set disable to capture outside pointer event
       
   128             SetPointerCapture( EFalse );
   121             }
   129             }
   122         MakeVisible(aEnable);
   130         MakeVisible(aEnable);
   123         }
   131         }
   124     if ( aEnable == EFalse )
   132     if ( aEnable == EFalse )
   125         {
   133         {
   137 	    iEditPane->ResetAllArray();
   145 	    iEditPane->ResetAllArray();
   138 	    iEditPane->SetEffictiveLength( 0 );
   146 	    iEditPane->SetEffictiveLength( 0 );
   139 	    iEditPane->SetChangeState( EFalse );
   147 	    iEditPane->SetChangeState( EFalse );
   140 #endif
   148 #endif
   141         }
   149         }
       
   150     else
       
   151     	{
       
   152 		Window().Invalidate();
       
   153     	}
   142     }  
   154     }  
   143   
   155   
   144 void CAknFepUICtrlContainerChinese::ConstructL()
   156 void CAknFepUICtrlContainerChinese::ConstructL()
   145     {
   157     {
   146     CreateWindowL();
   158     CreateWindowL();
   147     SetNonFocusing();
   159     SetNonFocusing();
   148     RWindow& window=Window();
   160     RWindow& window=Window();
       
   161         
       
   162     // Need receive drag events.
       
   163     window.PointerFilter( EPointerFilterDrag, 0 );
   149     window.SetOrdinalPosition(0, ECoeWinPriorityFep); // right at the front
   164     window.SetOrdinalPosition(0, ECoeWinPriorityFep); // right at the front
   150     MakeVisible(EFalse);
   165     MakeVisible(EFalse);
   151 
   166 
   152     iEikonEnv->EikAppUi()->AddToStackL(this, ECoeStackPriorityDefault, ECoeStackFlagRefusesFocus);
   167     iEikonEnv->EikAppUi()->AddToStackL(this, ECoeStackPriorityDefault, ECoeStackFlagRefusesFocus);
   153 
   168 
   154     iLafDataMgr = CAknFepUiLayoutDataMgr::NewL();
   169     iLafDataMgr = CAknFepUiLayoutDataMgr::NewL();
   155     iInputPane = CAknFepUICtrlInputPane::NewL(window, CAknFepUICtrlInputPane::ELayoutPhraseInputPane, iLafDataMgr);
   170     iInputPane = CAknFepUICtrlInputPane::NewL(window, CAknFepUICtrlInputPane::ELayoutPhraseInputPane, iLafDataMgr);
   156     iCandidatePane = CAknFepUICtrlCandidatePane::NewL(window, iLafDataMgr);
   171     iCandidatePane = CAknFepUICtrlCandidatePane::NewL(window, iLafDataMgr, this );
   157     iPinyinPopupWindow = CAknFepUICtrlPinyinPopup::NewL(window , iLafDataMgr);
   172     iPinyinPopupWindow = CAknFepUICtrlPinyinPopup::NewL(window , iLafDataMgr);
   158     iEditPane = CAknFepUICtrlPinyinEEP::NewL( window, iLafDataMgr );
   173     iEditPane = CAknFepUICtrlPinyinEEP::NewL( window, iLafDataMgr );
   159     iInputPane->SetMopParent(this);
   174     iInputPane->SetMopParent(this);
   160     iCandidatePane->SetMopParent(this);
   175     iCandidatePane->SetMopParent(this);
   161     iEditPane->SetMopParent(this);
   176     iEditPane->SetMopParent(this);
   162 
   177 
   163     iInputPane->SetSizeChangedObserver(this);
   178     iInputPane->SetSizeChangedObserver(this);
   164     iPinyinPopupWindow->SetSizeChangedObserver(this);
   179     iPinyinPopupWindow->SetSizeChangedObserver(this);
   165     iPinyinPopupWindow->MakeVisible(EFalse);
   180     iPinyinPopupWindow->MakeVisible(EFalse);
       
   181     iPinyinPopupWindow->SetMopParent( this );
   166     iEditPane->Enable(EFalse);
   182     iEditPane->Enable(EFalse);
   167 
   183 
   168     iCandidatePane->SetPaneLayout(iPaneLayout); // set pane layout
   184     iCandidatePane->SetPaneLayout(iPaneLayout); // set pane layout
   169     iCandidatePane->SetVisibleCandidateCount(iPaneLayout);
   185     iCandidatePane->SetVisibleCandidateCount(iPaneLayout);
   170  	iHorizLine = 
   186  	iHorizLine = 
   188     ActivateL();
   204     ActivateL();
   189     }
   205     }
   190 
   206 
   191 CAknFepUICtrlContainerChinese::~CAknFepUICtrlContainerChinese()
   207 CAknFepUICtrlContainerChinese::~CAknFepUICtrlContainerChinese()
   192     {
   208     {
   193     iEikonEnv->EikAppUi()->RemoveFromStack(this);
   209     iEikonEnv->EikAppUi()->RemoveFromStack( this );
   194     delete iLafDataMgr;
   210     delete iLafDataMgr;
   195     delete iInputPane;
   211     delete iInputPane;
   196     delete iCandidatePane;
   212     delete iCandidatePane;
   197     delete iPinyinPopupWindow;
   213     delete iPinyinPopupWindow;
   198     delete iEditPane;
   214     delete iEditPane;
   370         }
   386         }
   371     }
   387     }
   372 
   388 
   373 void CAknFepUICtrlContainerChinese::FocusCandidatePane(TBool aValue)
   389 void CAknFepUICtrlContainerChinese::FocusCandidatePane(TBool aValue)
   374     {
   390     {
   375     iInputPane->SetHighlighted(!aValue);
   391     //iInputPane->SetHighlighted(!aValue);
   376     iCandidatePane->SetHighlighted(aValue);
   392     iCandidatePane->SetHighlighted(aValue);
   377     }
   393     }
   378 
   394 
   379 void CAknFepUICtrlContainerChinese::SelectionPopupEnabled(TBool /*aEnabled*/)
   395 void CAknFepUICtrlContainerChinese::SelectionPopupEnabled(TBool /*aEnabled*/)
   380     {
   396     {
   395     DrawDeferred();
   411     DrawDeferred();
   396     }
   412     }
   397 
   413 
   398 void CAknFepUICtrlContainerChinese::LayoutPinyinPopupWindow()
   414 void CAknFepUICtrlContainerChinese::LayoutPinyinPopupWindow()
   399     {
   415     {
   400     TRect popupRect(Position(), Size()); 
   416 	// Use the same rect in Zhuyin input & Phrase creation mode.
   401     TRect pinyinRect = popupRect;
   417 	TRect rect = Rect();
   402     TAknWindowLineLayout entryHorizLine = 
   418 	TAknWindowLineLayout popupRect;
   403         CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EEntryHorizLineWindow ));
   419 	TInt index = ConvertLayoutToIndex();
   404     TAknWindowLineLayout entryPaneLine = 
   420     switch ( index )
   405         CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EEntryPaneWindowLine ));
   421         {
   406     TAknWindowLineLayout eepFirstHorizLine = 
   422         case 0:
   407         CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EEEPFirstHorizLineWindow ));
   423         	popupRect = CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EECWindowLayout ));
   408     TAknWindowLineLayout eepSecondHorizLine = 
   424             break;
   409         CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EEEPSecondHorizLineWindow ));
   425         case 2:
   410     TAknLayoutRect layoutLineEntry, layoutLineEntryPane, layoutLineFirstHorizEEP, layoutLineSecondHorizEEP;
   426         	popupRect = CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EECPLayout ));
   411     TRect layoutLineRectEntry, layoutLineRectEntryPane, layoutLineRectFirstHorizEEP, layoutLineRectSecondHorizEEP;
   427             break;
   412     TInt index = ConvertLayoutToIndex();
   428         default:        	
   413     if ( 2 == index )
   429             break;
   414         {
   430         }
   415         layoutLineFirstHorizEEP.LayoutRect( popupRect, eepFirstHorizLine );
   431 	
   416         layoutLineRectFirstHorizEEP = layoutLineFirstHorizEEP.Rect();
   432     AknLayoutUtils::LayoutControl( iPinyinPopupWindow, rect, popupRect );
   417         layoutLineSecondHorizEEP.LayoutRect( popupRect, eepSecondHorizLine );
       
   418         layoutLineRectSecondHorizEEP = layoutLineSecondHorizEEP.Rect();
       
   419         
       
   420         pinyinRect.iTl.iY = layoutLineRectFirstHorizEEP.iBr.iY;
       
   421         pinyinRect.iBr.iY = layoutLineRectSecondHorizEEP.iTl.iY;
       
   422         }
       
   423     else
       
   424         {
       
   425         layoutLineEntry.LayoutRect( popupRect, entryHorizLine );
       
   426         layoutLineRectEntry = layoutLineEntry.Rect();
       
   427         layoutLineEntryPane.LayoutRect( popupRect, entryPaneLine );
       
   428         layoutLineRectEntryPane = layoutLineEntryPane.Rect();
       
   429         pinyinRect.iTl.iY = layoutLineRectEntryPane.iTl.iY;
       
   430         pinyinRect.SetHeight(layoutLineRectEntry.iTl.iY - pinyinRect.iTl.iY);
       
   431         }
       
   432     iPinyinPopupWindow->SetRect(pinyinRect);
       
   433     }
   433     }
   434 
   434 
   435 void CAknFepUICtrlContainerChinese::LayoutPinyinEEPWindow()
   435 void CAknFepUICtrlContainerChinese::LayoutPinyinEEPWindow()
   436     {
   436     {
   437     TRect rect = Rect();  
   437     TRect rect = Rect();  
   438     TAknWindowLineLayout EEPWindowLayout;
   438     TAknWindowLineLayout layoutEEPWindow;
   439     if ( iPaneLayout == ELayoutPhraseCreation )
   439     if ( iPaneLayout == ELayoutPhraseCreation )
   440     	{
   440     	{
   441     	EEPWindowLayout =
   441 		layoutEEPWindow =
   442     	    CAknFepChineseUIDataConv::AnyToWindowLine(iLafDataMgr->RequestData(EEEPWindowLayout));
   442     	    CAknFepChineseUIDataConv::AnyToWindowLine(iLafDataMgr->RequestData(EEntryCPLayout));
   443     	}
   443     	}
   444     else
   444     else
   445     	{
   445     	{
   446     	EEPWindowLayout =
   446 		layoutEEPWindow =
   447     	    	    CAknFepChineseUIDataConv::AnyToWindowLine(iLafDataMgr->RequestData(EEntryPaneWindowLine));
   447     	    	    CAknFepChineseUIDataConv::AnyToWindowLine(iLafDataMgr->RequestData(EEntryCLayout));
   448     	}       
   448     	}       
   449     AknLayoutUtils::LayoutControl(iEditPane, rect, EEPWindowLayout);
   449     AknLayoutUtils::LayoutControl(iEditPane, rect, layoutEEPWindow);
   450     }
   450     }
   451 
   451 
   452 void CAknFepUICtrlContainerChinese::SetControlVisibility()
   452 void CAknFepUICtrlContainerChinese::SetControlVisibility()
   453     {
   453     {
   454     TBool popupEnabled = iPinyinPopupWindow->IsEnabled();
   454     TBool popupEnabled = iPinyinPopupWindow->IsEnabled();
   494         }
   494         }
   495     }
   495     }
   496 
   496 
   497 void CAknFepUICtrlContainerChinese::SetContainerPosition(TPoint aCurPos, TInt aHeight)
   497 void CAknFepUICtrlContainerChinese::SetContainerPosition(TPoint aCurPos, TInt aHeight)
   498     {
   498     {
   499     TRect parentRect;
   499     TRect rect;
   500     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, parentRect);
   500     AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EScreen, rect);
   501     TInt windowHeight = 0;
   501     TInt windowHeight = 0;
   502     TInt index = ConvertLayoutToIndex();
   502     TInt index = ConvertLayoutToIndex();
   503     
   503     switch ( index )
   504     if ( index != 2 )
   504         {
   505         {
   505     	// Zhuyin input & phrase creation use the same rect
   506         windowHeight = 
   506         case 2:
   507             CAknFepChineseUIDataConv::AnyToInt( iLafDataMgr->RequestData( EPopupHeightEntry ));
   507         	windowHeight = CAknFepChineseUIDataConv::AnyToInt( iLafDataMgr->RequestData( EPopupHeightEEP ));
   508         isPCLPosed = EFalse;
   508         	isPCLPosed = ETrue;
   509         }
   509             break;
       
   510         case 1:
       
   511         	windowHeight = CAknFepChineseUIDataConv::AnyToInt( iLafDataMgr->RequestData( EPopupHeightEntry ));
       
   512         	isPCLPosed = EFalse;
       
   513             break;
       
   514         default:
       
   515         	windowHeight = CAknFepChineseUIDataConv::AnyToInt( iLafDataMgr->RequestData( EPopupHeightEP ));
       
   516         	isPCLPosed = EFalse;
       
   517             break;
       
   518         }
       
   519     // If cursor is covered by the container, move it to the top
       
   520     if( aCurPos.iY > rect.iBr.iY - windowHeight )
       
   521     	{
       
   522         iContainerPosition.iY = aCurPos.iY - windowHeight - aHeight;
       
   523     	}
   510     else
   524     else
   511         {
   525     	{
   512         windowHeight = CAknFepChineseUIDataConv::AnyToInt( iLafDataMgr->RequestData( EPopupHeightEEP ));
   526         iContainerPosition.iY = rect.iBr.iY - windowHeight ;
   513         isPCLPosed = ETrue;
   527     	}
   514         }
       
   515     // Laf comments: In case there is enough space on the main pane to show the window under the entry,
       
   516     // the window is placed 3 pixels below the text baseline of the entry. In case there is no space on 
       
   517     // the main pane to show the window fully under the entry, the window is placed 17(16 pixel font) or
       
   518     // 13(12 pixel font) pixels above the baseline of the entry.
       
   519     if(aCurPos.iY + 3 + windowHeight < parentRect.iBr.iY) 
       
   520         {
       
   521         iContainerPosition.iY = aCurPos.iY + 3; 
       
   522         }
       
   523     else
       
   524         {
       
   525         iContainerPosition.iY = aCurPos.iY - windowHeight - (aHeight + 1); 
       
   526         }
       
   527     if ((( iContainerPosition.iY + windowHeight ) > parentRect.iBr.iY ) ||
       
   528         ( iContainerPosition.iY < parentRect.iTl.iY ))
       
   529     {
       
   530     iContainerPosition.iY = parentRect.iBr.iY - ( parentRect.iBr.iY - 
       
   531                             parentRect.iTl.iY ) / 2 - windowHeight / 2;
       
   532     }
       
   533     LayoutContainer();
   528     LayoutContainer();
   534     }
   529     }
   535 
   530 
   536 void CAknFepUICtrlContainerChinese::ShowHorizontalScrollArrows(TBool aValue)
   531 void CAknFepUICtrlContainerChinese::ShowHorizontalScrollArrows(TBool aValue)
   537     {
   532     {
   544     }
   539     }
   545 
   540 
   546 void CAknFepUICtrlContainerChinese::LayoutInputPane()
   541 void CAknFepUICtrlContainerChinese::LayoutInputPane()
   547     {
   542     {
   548     TRect rect = Rect();
   543     TRect rect = Rect();
   549     TAknWindowLineLayout entryPaneWindowLine = 
   544     TAknWindowLineLayout entryPaneWindowLine;
   550         CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EEntryPaneWindowLine ));
       
   551     TInt index = ConvertLayoutToIndex();
   545     TInt index = ConvertLayoutToIndex();
   552     if ( index == 2)
   546     switch ( index )
   553         {
   547         {
   554         TInt eepPopupHeight = CAknFepChineseUIDataConv::AnyToInt( iLafDataMgr->RequestData( EPopupHeightEEP ));
   548         case 2:
   555         TInt entryPopupHeight = CAknFepChineseUIDataConv::AnyToInt( iLafDataMgr->RequestData( EPopupHeightEntry ));
   549         	entryPaneWindowLine = CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EECPLayout ));
   556         rect.iTl.iY = rect.iTl.iY + eepPopupHeight - entryPopupHeight;
   550             break;
   557         }
   551         case 1:
   558     AknLayoutUtils::LayoutControl(iInputPane, rect, entryPaneWindowLine);
   552         	entryPaneWindowLine = CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EECWindowLayout ));
       
   553             break;
       
   554         default:
       
   555         	entryPaneWindowLine = CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EECWindowLayout ));
       
   556             break;
       
   557         }
       
   558     AknLayoutUtils::LayoutControl(iInputPane, rect, entryPaneWindowLine );
   559     }
   559     }
   560 
   560 
   561 void CAknFepUICtrlContainerChinese::LayoutContainedControls()
   561 void CAknFepUICtrlContainerChinese::LayoutContainedControls()
   562     {
   562     {
   563     LayoutInputPane();
   563     LayoutInputPane();
   564     // layout candidate pane
   564     // layout candidate pane
   565     TAknWindowLineLayout candidatePaneWindowLine = 
   565     TAknWindowLineLayout candidatePaneWindowLine ;    
   566                 CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( ECandidatePaneWindowLine ));
   566     TInt index = ConvertLayoutToIndex();    
   567     TInt index = ConvertLayoutToIndex();
   567     switch ( index )
       
   568         {
       
   569         case 2:
       
   570         	candidatePaneWindowLine = CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EEPCandidateLayout ));
       
   571             break;
       
   572         case 1:
       
   573         	candidatePaneWindowLine = CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( ECandidateLayout ));
       
   574             break;
       
   575         default:
       
   576         	candidatePaneWindowLine = CAknFepChineseUIDataConv::AnyToWindowLine( iLafDataMgr->RequestData( EECandidateLayout ));
       
   577             break;
       
   578         }
       
   579     // Layout candidate pane.
       
   580     AknLayoutUtils::LayoutControl( iCandidatePane, Rect(), candidatePaneWindowLine );
       
   581     
   568     if (index == 2)
   582     if (index == 2)
   569         {
   583         {
   570         if ( isPCLPosed )
   584         if ( isPCLPosed )
   571             {
   585             {
   572             iEditPane->Enable( ETrue );      
   586             iEditPane->Enable( ETrue ); 
   573             AknLayoutUtils::LayoutControl( iCandidatePane, Rect(), candidatePaneWindowLine );
       
   574             LayoutPinyinPopupWindow();
   587             LayoutPinyinPopupWindow();
   575             LayoutPinyinEEPWindow();
   588             LayoutPinyinEEPWindow();
   576             }
   589             }
   577         }
   590         }
   578     else if ( index == 0 || index == 1 ) 
   591     else if ( index == 0 || index == 1 ) 
   579         {
   592         {
   580         TRect rect = Rect();
       
   581         iEditPane->Enable(EFalse);
   593         iEditPane->Enable(EFalse);
   582         AknLayoutUtils::LayoutControl(iCandidatePane, rect, candidatePaneWindowLine);
       
   583         LayoutPinyinPopupWindow();
   594         LayoutPinyinPopupWindow();
   584         }
   595         }
   585     else
   596     else
   586         {
   597         {
   587         iEditPane->Enable(ETrue);
   598         iEditPane->Enable(ETrue);
   588         iPinyinPopupWindow->Enable(EFalse);
   599         iPinyinPopupWindow->Enable(EFalse);
   589         AknLayoutUtils::LayoutControl(iCandidatePane, Rect(), candidatePaneWindowLine);
       
   590         LayoutPinyinEEPWindow();
   600         LayoutPinyinEEPWindow();
   591         }
   601         }
   592     }
   602     }
   593 
   603 
   594 void CAknFepUICtrlContainerChinese::LayoutContainer()
   604 void CAknFepUICtrlContainerChinese::LayoutContainer()
   599         {
   609         {
   600         case 2:
   610         case 2:
   601             rect = CAknFepChineseUIDataConv::AnyToRect( iLafDataMgr->RequestData( EPopupRectEEP ));
   611             rect = CAknFepChineseUIDataConv::AnyToRect( iLafDataMgr->RequestData( EPopupRectEEP ));
   602             break;
   612             break;
   603         case 1:
   613         case 1:
       
   614             rect = CAknFepChineseUIDataConv::AnyToRect( iLafDataMgr->RequestData( EPopupRectEntry ));
       
   615             break;
       
   616         default:
   604             rect = CAknFepChineseUIDataConv::AnyToRect( iLafDataMgr->RequestData( EPopupRectCandatate ));
   617             rect = CAknFepChineseUIDataConv::AnyToRect( iLafDataMgr->RequestData( EPopupRectCandatate ));
   605             break;
   618             break;
   606         default:
   619         }
   607             rect = CAknFepChineseUIDataConv::AnyToRect( iLafDataMgr->RequestData( EPopupRectEntry ));
   620 
   608             break;
   621     // Set container rect.
   609         }
   622     rect.iBr.iY = iContainerPosition.iY + rect.Height();
   610     TInt rectHeight = rect.iBr.iY - rect.iTl.iY;
   623     rect.iTl.iY = iContainerPosition.iY;    
   611     rect.iTl.iY = iContainerPosition.iY;
       
   612     rect.iBr.iY = iContainerPosition.iY + rectHeight;
       
   613     SetRect(rect); 
   624     SetRect(rect); 
   614     }
   625     }
   615 
   626 
   616 void CAknFepUICtrlContainerChinese::LayoutRects()
   627 void CAknFepUICtrlContainerChinese::LayoutRects()
   617     {
   628     {
   688 
   699 
   689 void CAknFepUICtrlContainerChinese::SetFepMan( MAknFepManagerUIInterface* aFepMan )
   700 void CAknFepUICtrlContainerChinese::SetFepMan( MAknFepManagerUIInterface* aFepMan )
   690     {
   701     {
   691     iFepMan = aFepMan;
   702     iFepMan = aFepMan;
   692     }
   703     }
       
   704 
       
   705 void CAknFepUICtrlContainerChinese::HandlePointerEventL(const TPointerEvent& aPointerEvent)
       
   706 	{	
       
   707 	CCoeControl::HandlePointerEventL(aPointerEvent);
       
   708 	TRect rect = Rect();
       
   709 	// If click out of the container, close container.
       
   710 	if (( aPointerEvent.iType == TPointerEvent::EButton1Down )  
       
   711 	 && ( !rect.Contains( aPointerEvent.iPosition )))
       
   712 		{
       
   713 		CloseUI();
       
   714 		// simulation pointer event to application.
       
   715 		Window().SetOrdinalPosition(-1);
       
   716 		User::After(50000);
       
   717 		TRawEvent eventDown;   
       
   718 		eventDown.Set( TRawEvent::EButton1Down, 
       
   719 				       aPointerEvent.iParentPosition.iX, 
       
   720 				       aPointerEvent.iParentPosition.iY );
       
   721 		CCoeEnv::Static()->WsSession().SimulateRawEvent( eventDown );
       
   722 		User::After(1000);
       
   723 		TRawEvent eventUp; 
       
   724 		eventUp.Set( TRawEvent::EButton1Up, 
       
   725 				     aPointerEvent.iParentPosition.iX, 
       
   726 				     aPointerEvent.iParentPosition.iY );
       
   727 		CCoeEnv::Static()->WsSession().SimulateRawEvent( eventUp );		
       
   728 		}	
       
   729 	return;
       
   730 	}
       
   731 
       
   732 void CAknFepUICtrlContainerChinese::CloseUI()
       
   733 	{
       
   734 	// Hide container
       
   735 	if( iFepUiState )
       
   736 		{
       
   737 		iFepUiState->CloseUI();
       
   738 		}
       
   739 	}
       
   740 
       
   741 void CAknFepUICtrlContainerChinese::SetFepUiStateCtrl( MAknFepUiStateCtrl* aFepUiState )
       
   742     {
       
   743     iFepUiState = aFepUiState;
       
   744     }
       
   745 
       
   746 void CAknFepUICtrlContainerChinese::SubmitSelectedTextL(const TDesC& aText)
       
   747     {
       
   748 	// Commit text
       
   749     if ( iFepUiState )
       
   750         {
       
   751 		iFepUiState->SubmitTextL( aText );
       
   752         }
       
   753     }
       
   754 
       
   755 void CAknFepUICtrlContainerChinese::CloseContainer()
       
   756 	{
       
   757 	CloseUI();
       
   758 	}