textinput/peninputgenericitut/src/peninputitutwesternuistatespelling.cpp
branchRCL_3
changeset 7 6defe5d1bd39
parent 6 6ceef9a83b1a
child 8 4eb1ae11334f
equal deleted inserted replaced
6:6ceef9a83b1a 7:6defe5d1bd39
    23 #include <peninputcommonbutton.h>
    23 #include <peninputcommonbutton.h>
    24 #include <peninputlayout.h>
    24 #include <peninputlayout.h>
    25 #include <peninputcmd.h>
    25 #include <peninputcmd.h>
    26 #include <peninputlabel.h>
    26 #include <peninputlabel.h>
    27 
    27 
    28 // Fix bug for EZLG-7YUAP7
       
    29 #include <peninputrawkeybutton.h>
    28 #include <peninputrawkeybutton.h>
    30 
    29 
    31 #include "peninputitutwesternuistatespelling.h"
    30 #include "peninputitutwesternuistatespelling.h"
    32 #include "peninputgenericitutuimgrbase.h"
    31 #include "peninputgenericitutuimgrbase.h"
    33 #include "peninputgenericitutdatamgr.h"
    32 #include "peninputgenericitutdatamgr.h"
   122     CFepUiBaseCtrl* baseCtrl = iOwner->LayoutContext()->Control(ECtrlIdSwitch);
   121     CFepUiBaseCtrl* baseCtrl = iOwner->LayoutContext()->Control(ECtrlIdSwitch);
   123     if ( baseCtrl )
   122     if ( baseCtrl )
   124         {
   123         {
   125         baseCtrl->Hide(ETrue);
   124         baseCtrl->Hide(ETrue);
   126         }
   125         }
   127     iOwner->LayoutContext()->Control(ECtrlIdArrowLeft)->Hide(ETrue);
       
   128     iOwner->LayoutContext()->Control(ECtrlIdArrowRight)->Hide(ETrue);
       
   129     iOwner->LayoutContext()->Control(ECtrlIdOptions)->Hide(ETrue);
   126     iOwner->LayoutContext()->Control(ECtrlIdOptions)->Hide(ETrue);
   130     iOwner->LayoutContext()->Control(ECtrlIdClose)->Hide(ETrue);
   127     iOwner->LayoutContext()->Control(ECtrlIdClose)->Hide(ETrue);
   131     baseCtrl = iOwner->LayoutContext()->Control(ECtrlIdIndicator);
   128     baseCtrl = iOwner->LayoutContext()->Control(ECtrlIdIndicator);
   132     if ( baseCtrl )
   129     if ( baseCtrl )
   133         {
   130         {
   134         baseCtrl->Hide(ETrue);
   131         baseCtrl->Hide(ETrue);
   135         }
   132         }
   136     // Fix bug for EZLG-7YUAP7 
       
   137     // Hide Chinese Arrow Up button and Arrow Down button 
   133     // Hide Chinese Arrow Up button and Arrow Down button 
   138     CAknFepCtrlRawKeyButton* upbtn = 
   134     CAknFepCtrlRawKeyButton* upbtn = 
   139         static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowUp));
   135         static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowUp));
   140     CAknFepCtrlRawKeyButton* downbtn =  
   136     CAknFepCtrlRawKeyButton* downbtn =  
   141         static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowDown));
   137         static_cast<CAknFepCtrlRawKeyButton *>(iOwner->LayoutContext()->Control(ECtrlIdArrowDown));
   168 
   164 
   169     iOwner->DataMgr()->SetSpellMode(ETrue);
   165     iOwner->DataMgr()->SetSpellMode(ETrue);
   170     iICF->SetLineSeparatorAfterPrompt(ETrue);
   166     iICF->SetLineSeparatorAfterPrompt(ETrue);
   171     
   167     
   172     ReCalcLayoutL();
   168     ReCalcLayoutL();
       
   169     // Show ICF, Backspace after position changed to avoid flicker
       
   170     iOwner->LayoutContext()->Control(ECtrlIdBackspace)->Hide( EFalse );
       
   171     iOwner->LayoutContext()->Control(ECtrlIdICF)->Hide( EFalse );
   173     CAknFepCtrlLabel* indilabel = static_cast<CAknFepCtrlLabel*>
   172     CAknFepCtrlLabel* indilabel = static_cast<CAknFepCtrlLabel*>
   174                                   (iOwner->LayoutContext()->Control(ECtrlIdSpellIndicator));
   173                                   (iOwner->LayoutContext()->Control(ECtrlIdSpellIndicator));
   175     // Modify begin
   174     // Modify begin
   176     if ( indilabel && iOwner->DataMgr()->IsChinese())
   175     if ( indilabel && iOwner->DataMgr()->IsChineseSpellMode())
   177     // Modify end
   176     // Modify end
   178         {
   177         {
   179         indilabel->Hide( EFalse );
   178         indilabel->Hide( EFalse );
   180         }
   179         }
   181     iOwner->DataMgr()->SetUpdate(ETrue);
   180     iOwner->DataMgr()->SetUpdate(ETrue);
   187                                   (iOwner->LayoutContext()->Control(ECtrlIdSpellIndicator));
   186                                   (iOwner->LayoutContext()->Control(ECtrlIdSpellIndicator));
   188     if ( indilabel )
   187     if ( indilabel )
   189         {
   188         {
   190         indilabel->Hide( ETrue );
   189         indilabel->Hide( ETrue );
   191         }
   190         }
       
   191     // Hide ICF, Backspace, Arrow contrls when exit to avoid flicker
       
   192     iOwner->LayoutContext()->ShowArrowBtn(0);
       
   193     iOwner->LayoutContext()->Control(ECtrlIdBackspace)->Hide( ETrue );
       
   194     iOwner->LayoutContext()->Control(ECtrlIdICF)->Hide( ETrue );
       
   195     iICF->SetPromptTextL( KNullDesC );
   192     iOk->Hide(ETrue);
   196     iOk->Hide(ETrue);
   193     iCancel->Hide(ETrue);
   197     iCancel->Hide(ETrue);
   194     iOwner->DataMgr()->SetSpellMode(EFalse);
   198     iOwner->DataMgr()->SetSpellMode(EFalse);
   195     iICF->SetLineSeparatorAfterPrompt(EFalse);
   199     iICF->SetLineSeparatorAfterPrompt(EFalse);
   196     // Hide background of the spell popup window
   200     // Hide background of the spell popup window
   198                                       (iOwner->LayoutContext()->Control(ECtrlIdBackground) );
   202                                       (iOwner->LayoutContext()->Control(ECtrlIdBackground) );
   199     if(bgCtrl)
   203     if(bgCtrl)
   200 		{
   204 		{
   201 		bgCtrl->ShowSubBgItem( 0, EFalse );	
   205 		bgCtrl->ShowSubBgItem( 0, EFalse );	
   202 		}    
   206 		}    
       
   207     iOwner->DataMgr()->SetChineseSpellFlag( EFalse );
   203     }
   208     }
   204 
   209 
   205 CGenericItutUiMgrBase::TUiState CWesternItutUiStateSpelling::StateType()
   210 CGenericItutUiMgrBase::TUiState CWesternItutUiStateSpelling::StateType()
   206     {
   211     {
   207     return CGenericItutUiMgrBase::EStateSpelling;
   212     return CGenericItutUiMgrBase::EStateSpelling;
   271     iCancel->SetTextFormat(btntextCancel);
   276     iCancel->SetTextFormat(btntextCancel);
   272     iCancel->SizeChanged(btnrect, btnrect, ETrue);
   277     iCancel->SizeChanged(btnrect, btnrect, ETrue);
   273     //iICF->SetRect( TItutDataConverter::AnyToRect(iOwner->DataMgr()->RequestData(ESpellICFRect)) );
   278     //iICF->SetRect( TItutDataConverter::AnyToRect(iOwner->DataMgr()->RequestData(ESpellICFRect)) );
   274     CFont* icffont;
   279     CFont* icffont;
   275     if ( iOwner->DataMgr()->IsPortraitWest() && 
   280     if ( iOwner->DataMgr()->IsPortraitWest() && 
   276             (!iOwner->DataMgr()->IsChineseGlobalLanguage()))
   281             (!iOwner->DataMgr()->IsChineseSpellMode()))
   277         {
   282         {
   278         icffont = TItutDataConverter::AnyToFont(iOwner->DataMgr()->RequestData(ESpellFont));
   283         icffont = TItutDataConverter::AnyToFont(iOwner->DataMgr()->RequestData(ESpellFont));
   279         }
   284         }
   280     else
   285     else
   281         {
   286         {
   289     					  2,
   294     					  2,
   290     					  2);
   295     					  2);
   291  
   296  
   292     iICF->SetLineSpace( 1 );
   297     iICF->SetLineSpace( 1 );
   293     if ( iOwner->DataMgr()->IsPortraitWest() && 
   298     if ( iOwner->DataMgr()->IsPortraitWest() && 
   294             (!iOwner->DataMgr()->IsChineseGlobalLanguage()))
   299             (!iOwner->DataMgr()->IsChineseSpellMode()))
   295         {
   300         {
   296         iICF->SizeChangedL(rect, 
   301         iICF->SizeChangedL(rect, 
   297                       iOwner->DataMgr()->iSpellIcfTextHeightForPrtWest,
   302                       iOwner->DataMgr()->iSpellIcfTextHeightForPrtWest,
   298                       icffont->FontMaxHeight(),
   303                       icffont->FontMaxHeight(),
   299                       icffont);
   304                       icffont);
   320 	if( bSizedChanged && iOwner->DataMgr()->IsRtoLLanguage() )
   325 	if( bSizedChanged && iOwner->DataMgr()->IsRtoLLanguage() )
   321 		{
   326 		{
   322 		iOwner->UiManager()->Window()->HandleButtonResOnLangDirChange( ECtrlIdBackspace );			
   327 		iOwner->UiManager()->Window()->HandleButtonResOnLangDirChange( ECtrlIdBackspace );			
   323 		}
   328 		}
   324 	if ( iOwner->DataMgr()->IsPortraitWest() && 
   329 	if ( iOwner->DataMgr()->IsPortraitWest() && 
   325 	        (!iOwner->DataMgr()->IsChineseGlobalLanguage()))
   330 	        (!iOwner->DataMgr()->IsChineseSpellMode()))
   326 	    {
   331 	    {
   327 		iOwner->LayoutContext()->Control(ECtrlIdArrowLeft)->Hide( EFalse );
   332 		iOwner->LayoutContext()->Control(ECtrlIdArrowLeft)->Hide( EFalse );
   328 		iOwner->LayoutContext()->Control(ECtrlIdArrowRight)->Hide( EFalse );
   333 		iOwner->LayoutContext()->Control(ECtrlIdArrowRight)->Hide( EFalse );
   329 		
   334 		
   330 	    // left button
   335 	    // left button