uifw/AvKon/src/AknAdaptiveSearchGrid.cpp
changeset 14 3320e4e6e8bb
parent 0 2f259fa3e83a
equal deleted inserted replaced
0:2f259fa3e83a 14:3320e4e6e8bb
    59 
    59 
    60 _LIT( KSlashOfPageIndicator, "/" );
    60 _LIT( KSlashOfPageIndicator, "/" );
    61 _LIT( KSpaceCharacter, " " );
    61 _LIT( KSpaceCharacter, " " );
    62 const TInt KCloseAndClearButtonCount = 2;  
    62 const TInt KCloseAndClearButtonCount = 2;  
    63 
    63 
       
    64    
    64 // ============================ MEMBER FUNCTIONS ===============================
    65 // ============================ MEMBER FUNCTIONS ===============================
    65 
    66 
    66 // -----------------------------------------------------------------------------
    67 // -----------------------------------------------------------------------------
    67 // CAknAdaptiveSearchGrid::NewL()
    68 // CAknAdaptiveSearchGrid::NewL()
    68 // Two-phased constructor.
    69 // Two-phased constructor.
   406 // Update layout variant. This should be done when 
   407 // Update layout variant. This should be done when 
   407 // KEikDynamicLayoutVariantSwitch message recieved. 
   408 // KEikDynamicLayoutVariantSwitch message recieved. 
   408 // -----------------------------------------------------------------------------
   409 // -----------------------------------------------------------------------------
   409 // 
   410 // 
   410 void CAknAdaptiveSearchGrid::UpdateLayoutVariant()
   411 void CAknAdaptiveSearchGrid::UpdateLayoutVariant()
   411 	{
   412     {
   412     _AKNTRACE_FUNC_ENTER;
   413     _AKNTRACE_FUNC_ENTER;
   413 	InitGrid(); 
   414     InitGrid(); 
   414 	UpdatePageAndRowCount();       	         
   415     UpdatePageAndRowCount();                 
   415 	if( IsShown() )
   416     if( IsShown() )
   416 		{
   417         {
   417 		ControlsPositions();
   418         ControlsPositions();
   418 		TRAP_IGNORE( UpdateVisibleButtonsL() );  
   419         TRAP_IGNORE( UpdateVisibleButtonsL() );  
   419 		ShowControls();           
   420         ShowControls();           
   420 		}
   421         }
   421     _AKNTRACE_FUNC_EXIT;
   422     _AKNTRACE_FUNC_EXIT;
   422 	}
   423     }
   423 
   424 
   424 // -----------------------------------------------------------------------------
   425 // -----------------------------------------------------------------------------
   425 // CAknAdaptiveSearchGrid::UpdateSkinL()
   426 // CAknAdaptiveSearchGrid::UpdateSkinL()
   426 // Update adaptive search grid skin. This should be done when 
   427 // Update adaptive search grid skin. This should be done when 
   427 // KAknsMessageSkinChange message recieved. 
   428 // KAknsMessageSkinChange message recieved. 
   428 // -----------------------------------------------------------------------------
   429 // -----------------------------------------------------------------------------
   429 //  
   430 //  
   430 void CAknAdaptiveSearchGrid::UpdateSkinL()
   431 void CAknAdaptiveSearchGrid::UpdateSkinL()
   431 	{
   432     {
   432     CGulIcon* gulIcon = NULL;
   433     CGulIcon* gulIcon = NULL;
   433     gulIcon = GetColorIconL( 0 );        
   434     gulIcon = GetColorIconL( 0 );        
   434     iCloseButton->State()->SetIcon( gulIcon );
   435     iCloseButton->State()->SetIcon( gulIcon );
   435     CGulIcon* gulIcon1 = NULL;
   436     CGulIcon* gulIcon1 = NULL;
   436     gulIcon1 = GetColorIconL( 1 );        
   437     gulIcon1 = GetColorIconL( 1 );        
   437     iDeleteButton->State()->SetIcon( gulIcon1 );
   438     iDeleteButton->State()->SetIcon( gulIcon1 );
   438     CGulIcon* gulIcon2 = NULL;
   439     CGulIcon* gulIcon2 = NULL;
   439     gulIcon2 = GetColorIconL( 2 );        
   440     gulIcon2 = GetColorIconL( 2 );        
   440 	iPrevButton->State()->SetIcon( gulIcon2 );		
   441     iPrevButton->State()->SetIcon( gulIcon2 );      
   441     CGulIcon* gulIcon3 = NULL;
   442     CGulIcon* gulIcon3 = NULL;
   442     gulIcon3 = GetColorIconL( 3 );        
   443     gulIcon3 = GetColorIconL( 3 );        
   443     iNextButton->State()->SetIcon( gulIcon3 );
   444     iNextButton->State()->SetIcon( gulIcon3 );
   444     
   445     
   445    	UpdateVisibleButtonsL();	 	    		    
   446     UpdateVisibleButtonsL();                        
   446 	    
   447         
   447     if( iNumOfPages > 1 )
   448     if( iNumOfPages > 1 )
   448 		{	
   449         {   
   449 		// Page pane & page indicator	
   450         // Page pane & page indicator   
   450     	TRect page_pane = RectFromLayout( Rect(), AknLayoutScalable_Apps::afind_page_pane( iLayoutOption) );	
   451         TRect page_pane = RectFromLayout( Rect(), AknLayoutScalable_Apps::afind_page_pane( iLayoutOption) );    
   451     	if( AknsUtils::AvkonSkinEnabled() )
   452         if( AknsUtils::AvkonSkinEnabled() )
   452 	        {	        
   453             {           
   453 	        TRgb textColor = KRgbBlack; 
   454             TRgb textColor = KRgbBlack; 
   454     	    TInt error = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), 
   455             TInt error = AknsUtils::GetCachedColor( AknsUtils::SkinInstance(), 
   455     	                                            textColor, 
   456                                                     textColor, 
   456     	                                            KAknsIIDQsnTextColors, 
   457                                                     KAknsIIDQsnTextColors, 
   457     	                                            EAknsCIQsnTextColorsCG19);
   458                                                     EAknsCIQsnTextColorsCG19);
   458     	    if( !error )        	        
   459             if( !error )                    
   459     	        AknLayoutUtils::OverrideControlColorL(*iPageIndicator, EColorLabelText, textColor);         	                           
   460                 AknLayoutUtils::OverrideControlColorL(*iPageIndicator, EColorLabelText, textColor);                                        
   460 		    }			    
   461             }               
   461 		iBgContextOfControlPane->SetRect( page_pane );     
   462         iBgContextOfControlPane->SetRect( page_pane );     
   462 		}
   463         }
   463 	}
   464     }
   464 // CAknAdaptiveSearchGrid::InitGridButtons()
   465 // CAknAdaptiveSearchGrid::InitGridButtons()
   465 // Initiates buttons array of the adaptive search grid.
   466 // Initiates buttons array of the adaptive search grid.
   466 // iTotalGridButtons should be calculated in advance by caling InitGrid() 
   467 // iTotalGridButtons should be calculated in advance by caling InitGrid() 
   467 // -----------------------------------------------------------------------------
   468 // -----------------------------------------------------------------------------
   468 //
   469 //
   527     {  
   528     {  
   528     TInt layout_option;
   529     TInt layout_option;
   529            
   530            
   530     if( Layout_Meta_Data::IsLandscapeOrientation() )
   531     if( Layout_Meta_Data::IsLandscapeOrientation() )
   531         {
   532         {
       
   533         CAknToolbar* toolbar = iAppUi->CurrentFixedToolbar();
   532         iLayoutOption = KLandscapeSinglePage; 
   534         iLayoutOption = KLandscapeSinglePage; 
   533         layout_option = KLandscapeMaxSize;
   535         layout_option = KLandscapeMaxSize;
   534         iToolbarShown = EFalse;
   536         if ( toolbar && toolbar->IsShown() )
       
   537              iToolbarShown = ETrue;
       
   538         else
       
   539             iToolbarShown = EFalse;
   535         }
   540         }
   536     else
   541     else
   537         {        
   542         {        
   538         CAknToolbar* toolbar = iAppUi->CurrentFixedToolbar();
   543         CAknToolbar* toolbar = iAppUi->CurrentFixedToolbar();
   539         iLayoutOption = KPortraitSinglePage;
   544         iLayoutOption = KPortraitSinglePage;
   564         currentWindowRect.iBr.iY = controlPaneRect.iTl.iY;
   569         currentWindowRect.iBr.iY = controlPaneRect.iTl.iY;
   565         
   570         
   566         TRect mainPaneRect;
   571         TRect mainPaneRect;
   567         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
   572         AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane,
   568                                            mainPaneRect );
   573                                            mainPaneRect );
   569         
   574         CAknToolbar* toolbar = iAppUi->CurrentFixedToolbar();   
   570         if ( 0 != iFindpaneRect.Size().iWidth 
   575         if ( !toolbar 
   571                 && iFindpaneRect.Size().iWidth <= mainPaneRect.Size().iWidth )
   576              || !toolbar->IsVisible()
   572             {
   577              || mainPaneRect.iBr.iX <= toolbar->Position().iX 
   573             currentWindowRect.iBr.iX = currentWindowRect.iTl.iX 
   578            )
   574                                         + iFindpaneRect.Size().iWidth;
   579             {          
   575             }
   580             currentWindowRect.iBr.iX = mainPaneRect.iBr.iX;
   576         else
       
   577             {
       
   578             currentWindowRect.iBr.iX = currentWindowRect.iTl.iX 
       
   579                                         + mainPaneRect.Size().iWidth;
       
   580             }
   581             }
   581         }
   582         }
   582         
   583         
   583     TRect grid_pane = RectFromLayout( currentWindowRect, AknLayoutScalable_Apps::grid_afind_pane( iLayoutOption ) );
   584     TRect grid_pane = RectFromLayout( currentWindowRect, AknLayoutScalable_Apps::grid_afind_pane( iLayoutOption ) );
   584     TRect button_rect = RectFromLayout( grid_pane, AknLayoutScalable_Apps::cell_afind_pane( iLayoutOption, 0, 0 ) );  
   585     TRect button_rect = RectFromLayout( grid_pane, AknLayoutScalable_Apps::cell_afind_pane( iLayoutOption, 0, 0 ) );  
   856         find_pane = RectFromLayout( Rect(), AknLayoutScalable_Avkon::popup_find_window() );
   857         find_pane = RectFromLayout( Rect(), AknLayoutScalable_Avkon::popup_find_window() );
   857         }
   858         }
   858     else
   859     else
   859         {
   860         {
   860         find_pane = RectFromLayout( Rect(), AknLayoutScalable_Apps::find_pane_cp01( iLayoutOption ) );
   861         find_pane = RectFromLayout( Rect(), AknLayoutScalable_Apps::find_pane_cp01( iLayoutOption ) );
   861       	} 
   862         } 
   862     _AKNTRACE( "[%s][%s] rect of find pane is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   863     _AKNTRACE( "[%s][%s] rect of find pane is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   863     		find_pane.iTl.iX, find_pane.iTl.iY, find_pane.iBr.iX, find_pane.iBr.iY );   
   864             find_pane.iTl.iX, find_pane.iTl.iY, find_pane.iBr.iX, find_pane.iBr.iY );   
   864     iInputFrame->SetRect( find_pane ); 
   865     iInputFrame->SetRect( find_pane ); 
   865     iSkinContextOfFindPane->SetRect( find_pane );        
   866     iSkinContextOfFindPane->SetRect( find_pane );        
   866    
   867    
   867     // Backspace and close buttons
   868     // Backspace and close buttons
   868     cell_pane = RectFromLayout( grid_pane, AknLayoutScalable_Apps::cell_afind_pane(iLayoutOption, iNumOfCols-2, iNumOfRows-1) );        
   869     cell_pane = RectFromLayout( grid_pane, AknLayoutScalable_Apps::cell_afind_pane(iLayoutOption, iNumOfCols-2, iNumOfRows-1) );        
   872         {
   873         {
   873         cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*iNumOfRows;          
   874         cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*iNumOfRows;          
   874         cell_pane.iTl.iY = cell_pane.iTl.iY - iOverlapLength*(iNumOfRows-1); 
   875         cell_pane.iTl.iY = cell_pane.iTl.iY - iOverlapLength*(iNumOfRows-1); 
   875         }
   876         }
   876      _AKNTRACE( "[%s][%s] rect of delete button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   877      _AKNTRACE( "[%s][%s] rect of delete button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   877     		cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   878             cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   878     iDeleteButton->SetRect( cell_pane );    
   879     iDeleteButton->SetRect( cell_pane );    
   879     cell_pane = RectFromLayout( grid_pane, AknLayoutScalable_Apps::cell_afind_pane(iLayoutOption, iNumOfCols-1, iNumOfRows-1) );        
   880     cell_pane = RectFromLayout( grid_pane, AknLayoutScalable_Apps::cell_afind_pane(iLayoutOption, iNumOfCols-1, iNumOfRows-1) );        
   880    
   881    
   881     // For ELJG-7VC8Q2, move close button up
   882     // For ELJG-7VC8Q2, move close button up
   882     if(iPopupFindpane && ( iLayoutOption == KPortraitSinglePage ||iLayoutOption == KLandscapeSinglePage))
   883     if(iPopupFindpane && ( iLayoutOption == KPortraitSinglePage ||iLayoutOption == KLandscapeSinglePage))
   884         cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*iNumOfRows;          
   885         cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*iNumOfRows;          
   885         cell_pane.iTl.iY = cell_pane.iTl.iY - iOverlapLength*(iNumOfRows-1); 
   886         cell_pane.iTl.iY = cell_pane.iTl.iY - iOverlapLength*(iNumOfRows-1); 
   886         }
   887         }
   887 
   888 
   888      _AKNTRACE( "[%s][%s] rect of close button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   889      _AKNTRACE( "[%s][%s] rect of close button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   889         		cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   890                 cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   890     iCloseButton->SetRect( cell_pane ); 
   891     iCloseButton->SetRect( cell_pane ); 
   891 
   892 
   892     // For ELJG-7VC8Q2, Move all the buttons up when there is only one page
   893     // For ELJG-7VC8Q2, Move all the buttons up when there is only one page
   893     if(iPopupFindpane)
   894     if(iPopupFindpane)
   894         {
   895         {
   897             {
   898             {
   898             for ( TInt i = 0; i < iNumOfCols; i++ ) 
   899             for ( TInt i = 0; i < iNumOfCols; i++ ) 
   899                 {
   900                 {
   900                 cell_pane = RectFromLayout( grid_pane, AknLayoutScalable_Apps::cell_afind_pane( iLayoutOption, i, j ) );             
   901                 cell_pane = RectFromLayout( grid_pane, AknLayoutScalable_Apps::cell_afind_pane( iLayoutOption, i, j ) );             
   901                 if(iLayoutOption == KPortraitSinglePage ||iLayoutOption == KLandscapeSinglePage )   
   902                 if(iLayoutOption == KPortraitSinglePage ||iLayoutOption == KLandscapeSinglePage )   
   902             	    {
   903                     {
   903                     cell_pane.iTl.iY -=iOverlapLength*j;
   904                     cell_pane.iTl.iY -=iOverlapLength*j;
   904                     cell_pane.iBr.iY -=iOverlapLength*(j+1); 
   905                     cell_pane.iBr.iY -=iOverlapLength*(j+1); 
   905             	    }
   906                     }
   906                 iButtonArray[temp]->SetRect( cell_pane );
   907                 iButtonArray[temp]->SetRect( cell_pane );
   907                 temp++;
   908                 temp++;
   908                 }               
   909                 }               
   909             } 
   910             } 
   910     	}
   911         }
   911 
   912 
   912    
   913    
   913     if ( Layout_Meta_Data::IsLandscapeOrientation() && AknLayoutUtils::LayoutMirrored() )
   914     if ( Layout_Meta_Data::IsLandscapeOrientation() && AknLayoutUtils::LayoutMirrored() )
   914         {
   915         {
   915         SetCornerAndSize( EHLeftVTop, Rect().Size()); 
   916         SetCornerAndSize( EHLeftVTop, Rect().Size()); 
   927                 {
   928                 {
   928                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   929                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   929                 }
   930                 }
   930 
   931 
   931             _AKNTRACE( "[%s][%s] rect of delete button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   932             _AKNTRACE( "[%s][%s] rect of delete button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   932                 		cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY ); 
   933                         cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY ); 
   933             iDeleteButton->SetRect( cell_pane );        
   934             iDeleteButton->SetRect( cell_pane );        
   934             cell_pane = RectFromLayout( cont_pane, AknLayoutScalable_Apps::cell_afind_grid_control_pane(0,1) ); 
   935             cell_pane = RectFromLayout( cont_pane, AknLayoutScalable_Apps::cell_afind_grid_control_pane(0,1) ); 
   935 
   936 
   936             // For ELJG-7VC8Q2, Move close button up
   937             // For ELJG-7VC8Q2, Move close button up
   937             if(iPopupFindpane)
   938             if(iPopupFindpane)
   938                 {
   939                 {
   939                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);      	
   940                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);        
   940                 }
   941                 }
   941 
   942 
   942             _AKNTRACE( "[%s][%s] rect of close button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   943             _AKNTRACE( "[%s][%s] rect of close button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   943                 		cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   944                         cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   944             iCloseButton->SetRect( cell_pane );         
   945             iCloseButton->SetRect( cell_pane );         
   945             }
   946             }
   946         // Page pane    
   947         // Page pane    
   947         TRect page_pane;       
   948         TRect page_pane;       
   948         page_pane = RectFromLayout( Rect(), AknLayoutScalable_Apps::afind_page_pane( iLayoutOption) );  
   949         page_pane = RectFromLayout( Rect(), AknLayoutScalable_Apps::afind_page_pane( iLayoutOption) );  
   949         _AKNTRACE( "[%s][%s] rect of page pane is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   950         _AKNTRACE( "[%s][%s] rect of page pane is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   950         		page_pane.iTl.iX, page_pane.iTl.iY, page_pane.iBr.iX, page_pane.iBr.iY );
   951                 page_pane.iTl.iX, page_pane.iTl.iY, page_pane.iBr.iX, page_pane.iBr.iY );
   951         AknLayoutUtils::LayoutLabel( iPageIndicator, Rect(), 
   952         AknLayoutUtils::LayoutLabel( iPageIndicator, Rect(), 
   952         TAknWindowComponentLayout::ComposeText( AknLayoutScalable_Apps::afind_page_pane( iLayoutOption ), 
   953         TAknWindowComponentLayout::ComposeText( AknLayoutScalable_Apps::afind_page_pane( iLayoutOption ), 
   953         AknLayoutScalable_Apps::afind_page_pane_t1() ).LayoutLine() );
   954         AknLayoutScalable_Apps::afind_page_pane_t1() ).LayoutLine() );
   954         
   955         
   955         // Next and previous buttons
   956         // Next and previous buttons
   961             if(iPopupFindpane)
   962             if(iPopupFindpane)
   962                 {
   963                 {
   963                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   964                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   964                 }
   965                 }
   965             _AKNTRACE( "[%s][%s] rect of pre page button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   966             _AKNTRACE( "[%s][%s] rect of pre page button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   966                            		cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   967                                 cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   967             iPrevButton->SetRect( cell_pane );
   968             iPrevButton->SetRect( cell_pane );
   968             cell_pane = RectFromLayout( page_pane, AknLayoutScalable_Apps::afind_page_pane_g3( iLayoutOption) );  
   969             cell_pane = RectFromLayout( page_pane, AknLayoutScalable_Apps::afind_page_pane_g3( iLayoutOption) );  
   969             
   970             
   970             // For ELJG-7VC8Q2, Move next button up
   971             // For ELJG-7VC8Q2, Move next button up
   971             if(iPopupFindpane)
   972             if(iPopupFindpane)
   972                 {
   973                 {
   973                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   974                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   974                 }
   975                 }
   975             _AKNTRACE( "[%s][%s] rect of next page button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   976             _AKNTRACE( "[%s][%s] rect of next page button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   976                            		cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   977                                 cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   977             iNextButton->SetRect( cell_pane );  
   978             iNextButton->SetRect( cell_pane );  
   978             }
   979             }
   979         else
   980         else
   980             {
   981             {
   981             cell_pane = RectFromLayout( page_pane, AknLayoutScalable_Apps::afind_page_pane_g2( iLayoutOption) ); 
   982             cell_pane = RectFromLayout( page_pane, AknLayoutScalable_Apps::afind_page_pane_g2( iLayoutOption) ); 
   984             if(iPopupFindpane)
   985             if(iPopupFindpane)
   985                 {
   986                 {
   986                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   987                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   987                 } 
   988                 } 
   988             _AKNTRACE( "[%s][%s] rect of next page button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   989             _AKNTRACE( "[%s][%s] rect of next page button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
   989                            		cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   990                                 cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
   990             iNextButton->SetRect( cell_pane );       
   991             iNextButton->SetRect( cell_pane );       
   991             cell_pane = RectFromLayout( page_pane, AknLayoutScalable_Apps::afind_page_pane_g3( iLayoutOption) ); 
   992             cell_pane = RectFromLayout( page_pane, AknLayoutScalable_Apps::afind_page_pane_g3( iLayoutOption) ); 
   992             
   993             
   993              // For ELJG-7VC8Q2, Move pre button up
   994              // For ELJG-7VC8Q2, Move pre button up
   994             if(iPopupFindpane)
   995             if(iPopupFindpane)
   995                 {
   996                 {
   996                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   997                 cell_pane.iBr.iY = cell_pane.iBr.iY - iOverlapLength*(iNumOfRows+1);
   997                 }
   998                 }
   998  
   999  
   999             _AKNTRACE( "[%s][%s] rect of pre page button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1000             _AKNTRACE( "[%s][%s] rect of pre page button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1000                            		cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
  1001                                 cell_pane.iTl.iX, cell_pane.iTl.iY, cell_pane.iBr.iX, cell_pane.iBr.iY );
  1001             iPrevButton->SetRect( cell_pane );   
  1002             iPrevButton->SetRect( cell_pane );   
  1002             }    
  1003             }    
  1003         
  1004         
  1004         if( AknsUtils::AvkonSkinEnabled() )
  1005         if( AknsUtils::AvkonSkinEnabled() )
  1005             {           
  1006             {           
  1156         
  1157         
  1157     CAknToolbar* toolbar = iAppUi->CurrentFixedToolbar();
  1158     CAknToolbar* toolbar = iAppUi->CurrentFixedToolbar();
  1158     TBool needRelayout = EFalse;
  1159     TBool needRelayout = EFalse;
  1159     if( Layout_Meta_Data::IsLandscapeOrientation())
  1160     if( Layout_Meta_Data::IsLandscapeOrientation())
  1160         {
  1161         {
  1161         if ( iLayoutOption == KPortraitMultiPage 
  1162         if ( iLayoutOption == KPortraitMultiPage || iLayoutOption == KPortraitSinglePage )
  1162                 || iLayoutOption == KPortraitSinglePage 
       
  1163                 || iFindPaneSizeChanged )
       
  1164             {       
  1163             {       
  1165             needRelayout = ETrue;
  1164             needRelayout = ETrue;
  1166             iFindPaneSizeChanged = EFalse;
  1165             }
  1167             }
  1166         else if ( toolbar && toolbar->IsVisible() && iToolbarShown == EFalse )
       
  1167             {
       
  1168             needRelayout = ETrue;
       
  1169             }
       
  1170             
  1168         }
  1171         }
  1169     else if ( iLayoutOption == KLandscapeMultiPage || iLayoutOption == KLandscapeSinglePage )
  1172     else if ( iLayoutOption == KLandscapeMultiPage || iLayoutOption == KLandscapeSinglePage )
  1170         {       
  1173         {       
  1171         needRelayout = ETrue;
  1174         needRelayout = ETrue;
  1172         }
  1175         }
  1463                             bState->SetTextL( ptr.Mid(charPosition, 1) );
  1466                             bState->SetTextL( ptr.Mid(charPosition, 1) );
  1464                             }
  1467                             }
  1465                         }                  
  1468                         }                  
  1466                     button_rect = button->Rect();
  1469                     button_rect = button->Rect();
  1467                     _AKNTRACE( "[%s][%s] rect of button %s is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__, bState->Text().Ptr(), 
  1470                     _AKNTRACE( "[%s][%s] rect of button %s is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__, bState->Text().Ptr(), 
  1468                     		button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1471                             button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1469                     iCurrentRegion.AddRect( button_rect );
  1472                     iCurrentRegion.AddRect( button_rect );
  1470                     button->MakeVisible( ETrue );
  1473                     button->MakeVisible( ETrue );
  1471                     }
  1474                     }
  1472                 else
  1475                 else
  1473                     {
  1476                     {
  1543                                 bState->SetTextL( ptr.Mid(CharPosition, 1));                      
  1546                                 bState->SetTextL( ptr.Mid(CharPosition, 1));                      
  1544                                 }                 
  1547                                 }                 
  1545                             }                  
  1548                             }                  
  1546                         button_rect = button->Rect();
  1549                         button_rect = button->Rect();
  1547                         _AKNTRACE( "[%s][%s] rect of button %s is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__, bState->Text().Ptr(), 
  1550                         _AKNTRACE( "[%s][%s] rect of button %s is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__, bState->Text().Ptr(), 
  1548                                            		button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1551                                                 button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1549                         iCurrentRegion.AddRect( button_rect );
  1552                         iCurrentRegion.AddRect( button_rect );
  1550                         button->MakeVisible( ETrue );
  1553                         button->MakeVisible( ETrue );
  1551                         }
  1554                         }
  1552                     }
  1555                     }
  1553                 }
  1556                 }
  1601                                 bState->SetTextL( ptr.Mid(i, 1) );
  1604                                 bState->SetTextL( ptr.Mid(i, 1) );
  1602                                 }
  1605                                 }
  1603                             }                  
  1606                             }                  
  1604                         button_rect = button->Rect();
  1607                         button_rect = button->Rect();
  1605                         _AKNTRACE( "[%s][%s] rect of button %s is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__, bState->Text().Ptr(), 
  1608                         _AKNTRACE( "[%s][%s] rect of button %s is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__, bState->Text().Ptr(), 
  1606                                            		button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1609                                                 button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1607                         iCurrentRegion.AddRect( button_rect );
  1610                         iCurrentRegion.AddRect( button_rect );
  1608                         button->MakeVisible( ETrue );
  1611                         button->MakeVisible( ETrue );
  1609                         
  1612                         
  1610                         }                   
  1613                         }                   
  1611                     }
  1614                     }
  1620                         }           
  1623                         }           
  1621                 }               
  1624                 }               
  1622             }        
  1625             }        
  1623         button_rect = iDeleteButton->Rect();
  1626         button_rect = iDeleteButton->Rect();
  1624         _AKNTRACE( "[%s][%s] rect of delete button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1627         _AKNTRACE( "[%s][%s] rect of delete button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1625                            		button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1628                                 button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1626         iCurrentRegion.AddRect( button_rect );
  1629         iCurrentRegion.AddRect( button_rect );
  1627         button_rect = iCloseButton->Rect();
  1630         button_rect = iCloseButton->Rect();
  1628         _AKNTRACE( "[%s][%s] rect of close button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1631         _AKNTRACE( "[%s][%s] rect of close button is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1629                            		button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1632                                 button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1630         iCurrentRegion.AddRect( button_rect );
  1633         iCurrentRegion.AddRect( button_rect );
  1631         button_rect = iInputFrame->Rect();
  1634         button_rect = iInputFrame->Rect();
  1632         _AKNTRACE( "[%s][%s] rect of Input Frame is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1635         _AKNTRACE( "[%s][%s] rect of Input Frame is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1633                                    		button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1636                                         button_rect.iTl.iX, button_rect.iTl.iY, button_rect.iBr.iX, button_rect.iBr.iY );
  1634         iCurrentRegion.AddRect( button_rect );
  1637         iCurrentRegion.AddRect( button_rect );
  1635         if( iNumOfPages > 1 )
  1638         if( iNumOfPages > 1 )
  1636             {
  1639             {
  1637             TRect page_pane;       
  1640             TRect page_pane;       
  1638             page_pane = RectFromLayout( Rect(), AknLayoutScalable_Apps::afind_page_pane(iLayoutOption) );   
  1641             page_pane = RectFromLayout( Rect(), AknLayoutScalable_Apps::afind_page_pane(iLayoutOption) );   
  1639             _AKNTRACE( "[%s][%s] rect of page pane is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1642             _AKNTRACE( "[%s][%s] rect of page pane is %d %d %d %d ", "CAknAdaptiveSearchGrid", __FUNCTION__,
  1640             		page_pane.iTl.iX, page_pane.iTl.iY, page_pane.iBr.iX, page_pane.iBr.iY );
  1643                     page_pane.iTl.iX, page_pane.iTl.iY, page_pane.iBr.iX, page_pane.iBr.iY );
  1641             iCurrentRegion.AddRect( page_pane );
  1644             iCurrentRegion.AddRect( page_pane );
  1642             }    
  1645             }    
  1643         }
  1646         }
  1644     Window().SetShape( iCurrentRegion );
  1647     Window().SetShape( iCurrentRegion );
  1645     _AKNTRACE_FUNC_EXIT;
  1648     _AKNTRACE_FUNC_EXIT;
  1731     {    
  1734     {    
  1732     _AKNTRACE_FUNC_ENTER;
  1735     _AKNTRACE_FUNC_ENTER;
  1733     _AKNTRACE( "[%s][%s] Event Type : %d ", "CAknAdaptiveSearchGrid", __FUNCTION__, aType );
  1736     _AKNTRACE( "[%s][%s] Event Type : %d ", "CAknAdaptiveSearchGrid", __FUNCTION__, aType );
  1734     switch( aType )
  1737     switch( aType )
  1735         {
  1738         {
  1736     	case KEikDynamicLayoutVariantSwitch:
  1739         case KEikDynamicLayoutVariantSwitch:
  1737         	{
  1740             {
  1738         	UpdateLayoutVariant();
  1741             UpdateLayoutVariant();
  1739         	break;
  1742             break;
  1740         	}
  1743             }
  1741         case KAknsMessageSkinChange:
  1744         case KAknsMessageSkinChange:
  1742         	{
  1745             {
  1743         	TRAP_IGNORE( UpdateSkinL() );
  1746             TRAP_IGNORE( UpdateSkinL() );
  1744         	break;
  1747             break;
  1745         	}
  1748             }
  1746         default:
  1749         default:
  1747         	{
  1750             {
  1748         	break;
  1751             break;
  1749         	}
  1752             }
  1750         }
  1753         }
  1751         
  1754         
  1752     CAknControl::HandleResourceChange( aType );
  1755     CAknControl::HandleResourceChange( aType );
  1753     _AKNTRACE_FUNC_EXIT;
  1756     _AKNTRACE_FUNC_EXIT;
  1754     }
  1757     }
  1782 MAknAdaptiveSearchGridObserver* CAknAdaptiveSearchGrid::AdaptiveSearchGridObserver() 
  1785 MAknAdaptiveSearchGridObserver* CAknAdaptiveSearchGrid::AdaptiveSearchGridObserver() 
  1783     {
  1786     {
  1784     return iAdaptiveSearchGridObserver;
  1787     return iAdaptiveSearchGridObserver;
  1785     }
  1788     }
  1786         
  1789         
  1787 
       
  1788 // -----------------------------------------------------------------------------
       
  1789 // CCAknAdaptiveSearch::SaveFindPaneRect()
       
  1790 // When the rect of find pane is set, this functions will be notified
       
  1791 // to record the size of it.
       
  1792 // -----------------------------------------------------------------------------
       
  1793 //
       
  1794 void CAknAdaptiveSearchGrid::SaveFindPaneRect( const TRect &aRect )
       
  1795     {
       
  1796     //Now we just deal with the landscape conditions
       
  1797     if ( !Layout_Meta_Data::IsLandscapeOrientation() )
       
  1798         return;
       
  1799     
       
  1800     //When width is zero, no need to deal with.
       
  1801     if ( 0 == aRect.Size().iWidth )
       
  1802         return;
       
  1803     
       
  1804     //The same size already is set. No need to do further process.
       
  1805     if ( aRect.Size().iWidth == iFindpaneRect.Size().iWidth )
       
  1806         return;    
       
  1807 
       
  1808     iFindpaneRect = aRect;
       
  1809     iFindPaneSizeChanged = ETrue;
       
  1810     }
       
  1811 
       
  1812 // End of File
  1790 // End of File
  1813 
  1791