emailuis/emailui/src/FreestyleEmailUiLayoutHandler.cpp
branchRCL_3
changeset 12 4ce476e64c59
parent 11 0396474f30f5
child 16 b5fbb9b25d57
equal deleted inserted replaced
11:0396474f30f5 12:4ce476e64c59
    35 #include "FreestyleEmailUiLayoutHandler.h"
    35 #include "FreestyleEmailUiLayoutHandler.h"
    36 #include "FreestyleEmailUiLayoutData.h"
    36 #include "FreestyleEmailUiLayoutData.h"
    37 
    37 
    38 const TInt KPopupMargin = 8;
    38 const TInt KPopupMargin = 8;
    39 
    39 
       
    40 // -----------------------------------------------------------------------------
       
    41 // GeneralHash
       
    42 // -----------------------------------------------------------------------------
       
    43 //
    40 template< typename T >
    44 template< typename T >
    41 TUint32 GeneralHash( const T& aValue )
    45 TUint32 GeneralHash( const T& aValue )
    42     {
    46     {
    43     return DefaultHash::Des8( TPckgC< T >( aValue ) );
    47     return DefaultHash::Des8( TPckgC< T >( aValue ) );
    44     }
    48     }
    45 
    49 
       
    50 // -----------------------------------------------------------------------------
       
    51 // GeneralPtrIdentity
       
    52 // -----------------------------------------------------------------------------
       
    53 //
    46 template< typename T >
    54 template< typename T >
    47 TBool GeneralPtrIdentity( const T& aP1, const T& aP2 )
    55 TBool GeneralPtrIdentity( const T& aP1, const T& aP2 )
    48     {
    56     {
    49     return TPckgC< T >( aP1 ) == TPckgC< T >( aP2 );
    57     return TPckgC< T >( aP1 ) == TPckgC< T >( aP2 );
    50     }
    58     }
    54 // Base construction. May not leave.
    62 // Base construction. May not leave.
    55 // -----------------------------------------------------------------------------
    63 // -----------------------------------------------------------------------------
    56 //
    64 //
    57 CFSEmailUiLayoutHandler::CFSEmailUiLayoutHandler( CAlfEnv& aEnv )
    65 CFSEmailUiLayoutHandler::CFSEmailUiLayoutHandler( CAlfEnv& aEnv )
    58 	: iEnv(aEnv),
    66 	: iEnv(aEnv),
    59 	iScreenResolution( EQvgaPortrait ),
       
    60 	iTextStyleMap( THashFunction32< TAknTextComponentLayout >( GeneralHash ),
    67 	iTextStyleMap( THashFunction32< TAknTextComponentLayout >( GeneralHash ),
    61 	    TIdentityRelation< TAknTextComponentLayout >( GeneralPtrIdentity< TAknTextComponentLayout > ) ),
    68 	    TIdentityRelation< TAknTextComponentLayout >( GeneralPtrIdentity< TAknTextComponentLayout > ) )
    62     // <cmail>
       
    63     iNormalTextStyle( KErrNotFound ),
       
    64     iLargeTextStyle( KErrNotFound ),
       
    65     iSmallTextStyle( KErrNotFound )
       
    66     // </cmail>
       
    67  	{
    69  	{
    68     FUNC_LOG;
    70     FUNC_LOG;
    69 	}
    71 	}
    70 
    72 
    71 // -----------------------------------------------------------------------------
    73 // -----------------------------------------------------------------------------
   100 //
   102 //
   101 CFSEmailUiLayoutHandler::~CFSEmailUiLayoutHandler()
   103 CFSEmailUiLayoutHandler::~CFSEmailUiLayoutHandler()
   102     {
   104     {
   103     FUNC_LOG;
   105     FUNC_LOG;
   104     DeleteTextStyles();
   106     DeleteTextStyles();
   105     if ( iNormalTextStyle != KErrNotFound )
   107     }
   106         {
       
   107         CAlfStatic::Env().TextStyleManager().DeleteTextStyle( 
       
   108                 iNormalTextStyle );
       
   109         }
       
   110     if( iLargeTextStyle != KErrNotFound )
       
   111         {
       
   112         CAlfStatic::Env().TextStyleManager().DeleteTextStyle( 
       
   113                 iLargeTextStyle );
       
   114         }
       
   115     if( iSmallTextStyle != KErrNotFound )
       
   116         {
       
   117         CAlfStatic::Env().TextStyleManager().DeleteTextStyle( 
       
   118                 iSmallTextStyle );
       
   119         }
       
   120     }
       
   121 
       
   122 // -----------------------------------------------------------------------------
       
   123 // CFSEmailUiLayoutHandler::ScreenResolution
       
   124 // Function can be used to fetch currently active screen resolution
       
   125 // -----------------------------------------------------------------------------
       
   126 //	
       
   127 TScreenResolution CFSEmailUiLayoutHandler::ScreenResolution() const
       
   128 	{
       
   129     FUNC_LOG;
       
   130 	return iScreenResolution;
       
   131 	}
       
   132 
   108 
   133 // -----------------------------------------------------------------------------
   109 // -----------------------------------------------------------------------------
   134 // CFSEmailUiLayoutHandler::ScreenOrientation
   110 // CFSEmailUiLayoutHandler::ScreenOrientation
   135 // Function can be used to fetch orientation of the current screen resolution
   111 // Function can be used to fetch orientation of the current screen resolution
   136 // -----------------------------------------------------------------------------
   112 // -----------------------------------------------------------------------------
   140     FUNC_LOG;
   116     FUNC_LOG;
   141     return Layout_Meta_Data::IsLandscapeOrientation() ? ELandscape : EPortrait;
   117     return Layout_Meta_Data::IsLandscapeOrientation() ? ELandscape : EPortrait;
   142     }
   118     }
   143 
   119 
   144 // -----------------------------------------------------------------------------
   120 // -----------------------------------------------------------------------------
   145 // CTeamUiAppLayoutHandler::ScreenResolutionChanged
   121 // CFSEmailUiLayoutHandler::GridRowsInThisResolution
   146 // Function can be used to update internal resolution value. Typically called
   122 // -----------------------------------------------------------------------------
   147 // by UI in startup and when dynamic layout variant switch has occured 
   123 //
   148 // -----------------------------------------------------------------------------
       
   149 //	
       
   150 void CFSEmailUiLayoutHandler::ScreenResolutionChanged()
       
   151 	{
       
   152     FUNC_LOG;
       
   153    	TRect screenRect;
       
   154  	AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EScreen, screenRect );
       
   155 	switch ( screenRect.Width() )
       
   156   		{
       
   157 		case KLowResPortraitWidth:
       
   158 			iScreenResolution = ELowResPortrait;
       
   159 			break;
       
   160 		case KLowResLandscapeWidth:
       
   161 			iScreenResolution =  ELowResLandscape;
       
   162 			break;
       
   163 		case KQvgaPortraitWidth:
       
   164 			iScreenResolution =  EQvgaPortrait;
       
   165 			break;
       
   166 		case KQvgaLandscapeWidth: // Also KHvgaPortraitWidth
       
   167 			{
       
   168 			if ( screenRect.Height() == KQvgaLandscapeHeight )
       
   169 				{
       
   170 				iScreenResolution =  EQvgaLandscape;					
       
   171 				}
       
   172 			else
       
   173 				{
       
   174 				iScreenResolution =  EHvgaPortrait;
       
   175 				}			
       
   176 			}
       
   177 			break;
       
   178 		case KDrPortraitWidth:
       
   179 			iScreenResolution =  EDrPortrait;
       
   180 			break;
       
   181 		case KDrLandscapeWidth:
       
   182 			iScreenResolution =  EDrLandscape;
       
   183 			break;
       
   184 		case KVgaPortraitWidth: // Also KHvgaLandscapeWidth
       
   185 			{
       
   186 			if ( screenRect.Height() == KHvgaLandscapeHeight )
       
   187 				{
       
   188 				iScreenResolution =  EHvgaLandscape;					
       
   189 				}
       
   190 			else
       
   191 				{
       
   192 				iScreenResolution =  EVgaPortrait;
       
   193 				}							
       
   194 			}
       
   195 			break;
       
   196 		case KVgaLandscapeWidth:
       
   197 			iScreenResolution =  EVgaLandscape;
       
   198 			break;
       
   199 		case KWideLandscapeWidth:
       
   200 			iScreenResolution =  EWideLandscape;
       
   201 			break;
       
   202 		default:
       
   203 			break;
       
   204  		}
       
   205 	}
       
   206 
       
   207 
       
   208 TInt CFSEmailUiLayoutHandler::GridRowsInThisResolution() const
   124 TInt CFSEmailUiLayoutHandler::GridRowsInThisResolution() const
   209 	{
   125 	{
   210     FUNC_LOG;
   126     FUNC_LOG;
   211 	TInt rowCount(0);
   127     const TInt var( Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0 );
   212 	switch ( iScreenResolution )
   128     return AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastRow() + 1;
   213 		{
   129 	}
   214  		case ELowResPortrait:
   130 
   215 		case EQvgaPortrait:
   131 
   216  		case EVgaPortrait:
   132 // -----------------------------------------------------------------------------
   217   		case EHvgaPortrait:
   133 // CFSEmailUiLayoutHandler::GridColumnsInThisResolution
   218  		case EDrPortrait:
   134 // -----------------------------------------------------------------------------
   219 
   135 //
   220  		case ELowResLandscape:
       
   221  		case EQvgaLandscape:
       
   222 		case EVgaLandscape:	
       
   223 		case EHvgaLandscape:	
       
   224  		case EDrLandscape:
       
   225   		    rowCount = 3;
       
   226  		    break;
       
   227  		    
       
   228  		case EWideLandscape:
       
   229  		    rowCount = 2;
       
   230  		    break;
       
   231  		    
       
   232 		default:
       
   233 		    rowCount = 3;
       
   234 		    break;
       
   235 		}
       
   236 	return rowCount;
       
   237 	}
       
   238 
       
   239 
       
   240 TInt CFSEmailUiLayoutHandler::GridColumnsInThisResolution() const
   136 TInt CFSEmailUiLayoutHandler::GridColumnsInThisResolution() const
   241 	{
   137 	{
   242     FUNC_LOG;
   138     FUNC_LOG;
   243 	TInt columnCount(0);
   139     const TInt var( Layout_Meta_Data::IsLandscapeOrientation() ? 1 : 0 );
   244 	switch ( iScreenResolution )
   140     return AknLayoutScalable_Apps::cell_cmail_l_pane_ParamLimits( var ).LastColumn() + 1;
   245 		{
   141 	}
   246  		case ELowResPortrait:
   142 
   247 		case EQvgaPortrait:
   143 // -----------------------------------------------------------------------------
   248  		case EVgaPortrait:
   144 // CFSEmailUiLayoutHandler::GridIconSize
   249   		case EHvgaPortrait:
   145 // -----------------------------------------------------------------------------
   250  		case EDrPortrait:
   146 //
   251   		    columnCount = 3;
       
   252  		    break;
       
   253 
       
   254  		case ELowResLandscape:
       
   255  		case EQvgaLandscape:
       
   256 		case EVgaLandscape:	
       
   257 		case EHvgaLandscape:	
       
   258  		case EDrLandscape:
       
   259   		    columnCount = 4;
       
   260  		    break;
       
   261  		    
       
   262  		case EWideLandscape:
       
   263  		    columnCount = 5;
       
   264  		    break;
       
   265  		    
       
   266 		default:
       
   267 		    columnCount = 3;
       
   268 		    break;
       
   269 		}
       
   270 	return columnCount;
       
   271 	}
       
   272 
       
   273 
       
   274 // Grid normal state text color, same as focused
       
   275 TRgb CFSEmailUiLayoutHandler::GridNormalStateTextSkinColor() const
   147 TRgb CFSEmailUiLayoutHandler::GridNormalStateTextSkinColor() const
   276 	{
   148 	{
   277     FUNC_LOG;
   149     FUNC_LOG;
   278     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   150     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   279     TRgb textColor;
   151     TRgb textColor;
   286     return textColor;	
   158     return textColor;	
   287 	}
   159 	}
   288 
   160 
   289 // -----------------------------------------------------------------------------
   161 // -----------------------------------------------------------------------------
   290 // CFSEmailUiLayoutHandler::GridIconSize
   162 // CFSEmailUiLayoutHandler::GridIconSize
   291 // 
       
   292 // -----------------------------------------------------------------------------
   163 // -----------------------------------------------------------------------------
   293 //
   164 //
   294 TSize CFSEmailUiLayoutHandler::GridIconSize() const
   165 TSize CFSEmailUiLayoutHandler::GridIconSize() const
   295 	{
   166 	{
   296     FUNC_LOG;
   167     FUNC_LOG;
   510         }
   381         }
   511     return rect;
   382     return rect;
   512     }
   383     }
   513 
   384 
   514 // -----------------------------------------------------------------------------
   385 // -----------------------------------------------------------------------------
   515 // CFSEmailUiLayoutHandler::SelectorVisualSizeInThisResolution
       
   516 // Selector ring image visual size
       
   517 // -----------------------------------------------------------------------------
       
   518 //
       
   519 TSize CFSEmailUiLayoutHandler::SelectorVisualSizeInThisResolution() const
       
   520 	{
       
   521     FUNC_LOG;
       
   522 	TSize selectorVisualSize(0,0);
       
   523 	switch ( iScreenResolution )
       
   524 		{
       
   525 		case EQvgaPortrait:
       
   526 			selectorVisualSize = KSelectorVisualSizeInQvgaPort;
       
   527 	 		break;
       
   528  		case EQvgaLandscape:
       
   529 			selectorVisualSize = KSelectorVisualSizeInQvgaLand;
       
   530 		 	break;
       
   531  		case EVgaPortrait:
       
   532  			selectorVisualSize = KSelectorVisualSizeInVgaPort;
       
   533  			break;
       
   534 		case EVgaLandscape:	
       
   535 			selectorVisualSize = KSelectorVisualSizeInVgaLand;
       
   536 			break; 
       
   537   		case EHvgaPortrait:
       
   538  			selectorVisualSize = KSelectorVisualSizeInHvgaPort;
       
   539  			break;
       
   540 		case EHvgaLandscape:	
       
   541 			selectorVisualSize = KSelectorVisualSizeInHvgaLand;
       
   542 			break; 
       
   543  		case EWideLandscape:
       
   544 			selectorVisualSize = KSelectorVisualSizeInWideLand;
       
   545  			break;
       
   546  		case EDrPortrait:
       
   547 			selectorVisualSize = KSelectorVisualSizeInDoubleResPort;
       
   548  			break;
       
   549  		case EDrLandscape:
       
   550 		default:
       
   551 			selectorVisualSize = KSelectorVisualSizeInDoubleResLand;
       
   552 			break;
       
   553 		}
       
   554 	return selectorVisualSize;	
       
   555 	}
       
   556 
       
   557 
       
   558 // -----------------------------------------------------------------------------
       
   559 // CFSEmailUiLayoutHandler::OneLineListNodeHeight
   386 // CFSEmailUiLayoutHandler::OneLineListNodeHeight
   560 // List node item height 
   387 // List node item height 
   561 // -----------------------------------------------------------------------------
   388 // -----------------------------------------------------------------------------
   562 //	
   389 //	
   563 TInt CFSEmailUiLayoutHandler::OneLineListNodeHeight() const
   390 TInt CFSEmailUiLayoutHandler::OneLineListNodeHeight() const
   564 	{
   391 	{
   565     FUNC_LOG;
   392     FUNC_LOG;
   566 	//<cmail>
       
   567     TRect mainPaneRect;
   393     TRect mainPaneRect;
   568     TAknLayoutRect listItem;
   394     TAknLayoutRect listItem;
   569     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
   395     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
   570     listItem.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::list_single_fs_dyc_pane( 0 ) );
   396     listItem.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::list_single_fs_dyc_pane( 0 ) );
   571     return listItem.Rect().Height();
   397     return listItem.Rect().Height();
   572     //</cmail>
   398 	}
   573 	}
       
   574 	
       
   575 	
   399 	
   576 // -----------------------------------------------------------------------------
   400 // -----------------------------------------------------------------------------
   577 // CFSEmailUiLayoutHandler::OneLineListItemHeight
   401 // CFSEmailUiLayoutHandler::OneLineListItemHeight
   578 // List item height
   402 // List item height
   579 // -----------------------------------------------------------------------------
   403 // -----------------------------------------------------------------------------
   595     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
   419     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
   596     listItem.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::list_single_fs_dyc_pane( 1 ) );
   420     listItem.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::list_single_fs_dyc_pane( 1 ) );
   597     return listItem.Rect().Height();
   421     return listItem.Rect().Height();
   598     }
   422     }
   599 
   423 
   600 //<cmail>
       
   601 // -----------------------------------------------------------------------------
   424 // -----------------------------------------------------------------------------
   602 // CFSEmailUiLayoutHandler::FolderListOneLineItemHeight
   425 // CFSEmailUiLayoutHandler::FolderListOneLineItemHeight
   603 // List item height for folder list
   426 // List item height for folder list
   604 // -----------------------------------------------------------------------------
   427 // -----------------------------------------------------------------------------
   605 //
   428 //
   609     FUNC_LOG;
   432     FUNC_LOG;
   610     if ( aFullscreen )
   433     if ( aFullscreen )
   611         {        
   434         {        
   612         return OneLineListItemHeight();
   435         return OneLineListItemHeight();
   613         }
   436         }
   614 /*    else
       
   615         {
       
   616         const TRect ddMenuRect( DropDownMenuListRect( ELeft ) );
       
   617         TAknLayoutRect ddMenuPane;
       
   618         bg_sp_fs_ctrlbar_ddmenu_pane
       
   619         return 0;
       
   620         }*/
       
   621     return 0;
   437     return 0;
   622     }
   438     }
   623 //</cmail>
       
   624 
   439 
   625 // -----------------------------------------------------------------------------
   440 // -----------------------------------------------------------------------------
   626 // CFSEmailUiLayoutHandler::ControlBarHeight
   441 // CFSEmailUiLayoutHandler::ControlBarHeight
   627 // Control bar height
   442 // Control bar height
   628 // -----------------------------------------------------------------------------
   443 // -----------------------------------------------------------------------------
   635     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
   450     AknLayoutUtils::LayoutMetricsRect( AknLayoutUtils::EMainPane, mainPaneRect );
   636     ctrlBarRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane( 0 ) );
   451     ctrlBarRect.LayoutRect( mainPaneRect, AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane( 0 ) );
   637     return ctrlBarRect.Rect().Height();
   452     return ctrlBarRect.Rect().Height();
   638 	}
   453 	}
   639 
   454 
   640 // <cmail> changes to avoid unnecessary creating new text styles objects.
   455 // -----------------------------------------------------------------------------
   641 CAlfTextStyle* CFSEmailUiLayoutHandler::FSTextStyleFromIdL( TFSEmailFont aFontId )
   456 // CFSEmailUiLayoutHandler::ControlBarListPadding
   642     {
   457 // -----------------------------------------------------------------------------
   643     FUNC_LOG;
       
   644     CAlfTextStyle* style = NULL;
       
   645     
       
   646     switch ( aFontId )
       
   647         {
       
   648         case EFSFontTypeNormal:
       
   649         case EFSFontTypeNormalBold:
       
   650         case EFSFontTypeNormalItalic:
       
   651             if ( iNormalTextStyle == KErrNotFound ) 
       
   652                 {
       
   653                 iNormalTextStyle = CAlfStatic::Env().TextStyleManager().
       
   654                     CreatePlatformTextStyleL( 
       
   655                             EAknLogicalFontPrimaryFont, 
       
   656                             EAlfTextStyleNormal );
       
   657                 }
       
   658             style = CAlfStatic::Env().TextStyleManager().TextStyle( 
       
   659                         iNormalTextStyle );
       
   660             break;
       
   661         case EFSFontTypeLarge:
       
   662         case EFSFontTypeLargeBold:
       
   663         case EFSFontTypeLargeItalic:
       
   664             if ( iLargeTextStyle == KErrNotFound ) 
       
   665                 {
       
   666                 iLargeTextStyle = CAlfStatic::Env().TextStyleManager().
       
   667                     CreatePlatformTextStyleL( 
       
   668                             EAknLogicalFontTitleFont, 
       
   669                             EAlfTextStyleNormal );
       
   670                 }
       
   671             style = CAlfStatic::Env().TextStyleManager().TextStyle( 
       
   672                         iLargeTextStyle );
       
   673             break;
       
   674         case EFSFontTypeSmallItalic:
       
   675         case EFSFontTypeSmallBold:
       
   676         case EFSFontTypeSmall:
       
   677         default:
       
   678             if ( iSmallTextStyle == KErrNotFound ) 
       
   679                 {
       
   680                 iSmallTextStyle = CAlfStatic::Env().TextStyleManager().
       
   681                     CreatePlatformTextStyleL( 
       
   682                             EAknLogicalFontSecondaryFont, 
       
   683                             EAlfTextStyleNormal );
       
   684                 }
       
   685             style = CAlfStatic::Env().TextStyleManager().TextStyle( 
       
   686                     iSmallTextStyle );
       
   687             break;
       
   688         }
       
   689         
       
   690     switch ( aFontId )
       
   691         {
       
   692         case EFSFontTypeSmallBold:
       
   693             style->SetBold( EStrokeWeightBold );
       
   694             break;
       
   695         case EFSFontTypeSmallItalic:
       
   696             style->SetBold( EStrokeWeightNormal );
       
   697             style->SetItalic( EPostureItalic );    
       
   698             break;
       
   699         case EFSFontTypeNormal:
       
   700             style->SetBold( EStrokeWeightNormal );
       
   701             break;
       
   702         case EFSFontTypeNormalBold:
       
   703             style->SetBold( EStrokeWeightBold );
       
   704             break;
       
   705         case EFSFontTypeNormalItalic:
       
   706             style->SetBold( EStrokeWeightNormal );
       
   707             style->SetItalic( EPostureItalic );
       
   708             break;
       
   709         case EFSFontTypeLarge:
       
   710             style->SetBold( EStrokeWeightNormal );
       
   711             break;
       
   712         case EFSFontTypeLargeBold:
       
   713             style->SetBold( EStrokeWeightBold );
       
   714             break;
       
   715         case EFSFontTypeLargeItalic:
       
   716             style->SetBold( EStrokeWeightNormal );
       
   717             style->SetItalic( EPostureItalic ); 
       
   718             break;
       
   719         case EFSFontTypeSmall:
       
   720         default:
       
   721             {
       
   722             style->SetBold( EStrokeWeightNormal );
       
   723             }
       
   724             break;
       
   725         }
       
   726     
       
   727     return style;
       
   728     }
       
   729 // </cmail>
       
   730 
       
   731 TPoint CFSEmailUiLayoutHandler::ControlBarListPadding() const
   458 TPoint CFSEmailUiLayoutHandler::ControlBarListPadding() const
   732 	{
   459 	{
   733     FUNC_LOG;
   460     FUNC_LOG;
   734 	return KControlBarListPadding;
   461 	return KControlBarListPadding;
   735 	}
   462 	}
   736 
   463 
       
   464 // -----------------------------------------------------------------------------
       
   465 // CFSEmailUiLayoutHandler::ControlBarListBorderRoundingSize
       
   466 // -----------------------------------------------------------------------------
   737 TInt CFSEmailUiLayoutHandler::ControlBarListBorderRoundingSize() const
   467 TInt CFSEmailUiLayoutHandler::ControlBarListBorderRoundingSize() const
   738 	{
   468 	{
   739     FUNC_LOG;
   469     FUNC_LOG;
   740 	return KControlBarListBorderRoundingSize;
   470 	return KControlBarListBorderRoundingSize;
   741 	}
   471 	}
   742 
   472 
       
   473 // -----------------------------------------------------------------------------
       
   474 // CFSEmailUiLayoutHandler::ControlBarButtonBgRoundingSize
       
   475 // -----------------------------------------------------------------------------
   743 TInt CFSEmailUiLayoutHandler::ControlBarButtonBgRoundingSize() const
   476 TInt CFSEmailUiLayoutHandler::ControlBarButtonBgRoundingSize() const
   744 	{
   477 	{
   745     FUNC_LOG;
   478     FUNC_LOG;
   746 	return KControlBarbuttonBorderRoundingSize;	
   479 	return KControlBarbuttonBorderRoundingSize;	
   747 	}
   480 	}
   748 
   481 
       
   482 // -----------------------------------------------------------------------------
       
   483 // CFSEmailUiLayoutHandler::ListFadeInEffectTime
       
   484 // -----------------------------------------------------------------------------
   749 TInt CFSEmailUiLayoutHandler::ListFadeInEffectTime() const
   485 TInt CFSEmailUiLayoutHandler::ListFadeInEffectTime() const
   750 	{
   486 	{
   751     FUNC_LOG;
   487     FUNC_LOG;
   752 	return KListFadeInEffectTime;
   488 	return KListFadeInEffectTime;
   753 	}
   489 	}
   754 
   490 
       
   491 // -----------------------------------------------------------------------------
       
   492 // CFSEmailUiLayoutHandler::ListFadeOutEffectTime
       
   493 // -----------------------------------------------------------------------------
   755 TInt CFSEmailUiLayoutHandler::ListFadeOutEffectTime() const
   494 TInt CFSEmailUiLayoutHandler::ListFadeOutEffectTime() const
   756     {
   495     {
   757     FUNC_LOG;
   496     FUNC_LOG;
   758     return KListFadeOutEffectTime;
   497     return KListFadeOutEffectTime;
   759     }
   498     }
   760 
   499 
       
   500 // -----------------------------------------------------------------------------
       
   501 // CFSEmailUiLayoutHandler::StatusIndicatorFadeEffectTime
       
   502 // -----------------------------------------------------------------------------
   761 TInt CFSEmailUiLayoutHandler::StatusIndicatorFadeEffectTime() const
   503 TInt CFSEmailUiLayoutHandler::StatusIndicatorFadeEffectTime() const
   762 	{
   504 	{
   763     FUNC_LOG;
   505     FUNC_LOG;
   764 	return KStatusIndicatorFadeEffectTime;
   506 	return KStatusIndicatorFadeEffectTime;
   765 	}
   507 	}
   766 
   508 
       
   509 // -----------------------------------------------------------------------------
       
   510 // CFSEmailUiLayoutHandler::CtrlBarListFadeEffectTime
       
   511 // -----------------------------------------------------------------------------
   767 TInt CFSEmailUiLayoutHandler::CtrlBarListFadeEffectTime() const
   512 TInt CFSEmailUiLayoutHandler::CtrlBarListFadeEffectTime() const
   768 	{
   513 	{
   769     FUNC_LOG;
   514     FUNC_LOG;
   770 	return KCtrlBarListFadeEffectTime;
   515 	return KCtrlBarListFadeEffectTime;
   771 	}
   516 	}
   772 
   517 
       
   518 // -----------------------------------------------------------------------------
       
   519 // CFSEmailUiLayoutHandler::ViewSlideEffectActive
       
   520 // -----------------------------------------------------------------------------
   773 TBool CFSEmailUiLayoutHandler::ViewSlideEffectActive() const
   521 TBool CFSEmailUiLayoutHandler::ViewSlideEffectActive() const
   774 	{
   522 	{
   775     FUNC_LOG;
   523     FUNC_LOG;
   776 	return KListSlideEffectActive;
   524 	return KListSlideEffectActive;
   777 	}
   525 	}
   778 
   526 
       
   527 // -----------------------------------------------------------------------------
       
   528 // CFSEmailUiLayoutHandler::ViewFadeEffectActive
       
   529 // -----------------------------------------------------------------------------
   779 TBool CFSEmailUiLayoutHandler::ViewFadeEffectActive() const
   530 TBool CFSEmailUiLayoutHandler::ViewFadeEffectActive() const
   780 	{
   531 	{
   781     FUNC_LOG;
   532     FUNC_LOG;
   782 	return KListFadeEffectActive;
   533 	return KListFadeEffectActive;
   783 	}
   534 	}
   784 
   535 
       
   536 // -----------------------------------------------------------------------------
       
   537 // CFSEmailUiLayoutHandler::ViewSlideEffectTime
       
   538 // -----------------------------------------------------------------------------
   785 TInt CFSEmailUiLayoutHandler::ViewSlideEffectTime() const
   539 TInt CFSEmailUiLayoutHandler::ViewSlideEffectTime() const
   786 	{
   540 	{
   787     FUNC_LOG;
   541     FUNC_LOG;
   788 	return KListSlideEffectTime;
   542 	return KListSlideEffectTime;
   789 	}
   543 	}
   790 
   544 
       
   545 // -----------------------------------------------------------------------------
       
   546 // CFSEmailUiLayoutHandler::ViewFadeInEffectTime
       
   547 // -----------------------------------------------------------------------------
   791 TInt CFSEmailUiLayoutHandler::ViewFadeInEffectTime() const
   548 TInt CFSEmailUiLayoutHandler::ViewFadeInEffectTime() const
   792     {
   549     {
   793     FUNC_LOG;
   550     FUNC_LOG;
   794     return KListFadeInEffectTime;
   551     return KListFadeInEffectTime;
   795     }
   552     }
   796 
   553 
       
   554 // -----------------------------------------------------------------------------
       
   555 // CFSEmailUiLayoutHandler::ViewFadeOutEffectTime
       
   556 // -----------------------------------------------------------------------------
   797 TInt CFSEmailUiLayoutHandler::ViewFadeOutEffectTime() const
   557 TInt CFSEmailUiLayoutHandler::ViewFadeOutEffectTime() const
   798     {
   558     {
   799     FUNC_LOG;
   559     FUNC_LOG;
   800     return KListFadeOutEffectTime;
   560     return KListFadeOutEffectTime;
   801     }
   561     }
   802 
   562 
       
   563 // -----------------------------------------------------------------------------
       
   564 // CFSEmailUiLayoutHandler::ListScrollingTime
       
   565 // -----------------------------------------------------------------------------
   803 TInt CFSEmailUiLayoutHandler::ListScrollingTime() const
   566 TInt CFSEmailUiLayoutHandler::ListScrollingTime() const
   804 	{
   567 	{
   805     FUNC_LOG;
   568     FUNC_LOG;
   806 	return KListScrollingTime;
   569 	return KListScrollingTime;
   807 	}
   570 	}
   808 
   571 
       
   572 // -----------------------------------------------------------------------------
       
   573 // CFSEmailUiLayoutHandler::ListItemExpansionDelay
       
   574 // -----------------------------------------------------------------------------
   809 TInt CFSEmailUiLayoutHandler::ListItemExpansionDelay() const
   575 TInt CFSEmailUiLayoutHandler::ListItemExpansionDelay() const
   810 	{
   576 	{
   811     FUNC_LOG;
   577     FUNC_LOG;
   812 	return KListItemExpansionDelay;
   578 	return KListItemExpansionDelay;
   813 	}
   579 	}
   814 
   580 
   815 TInt CFSEmailUiLayoutHandler::ViewHidingDelay() const
   581 // -----------------------------------------------------------------------------
   816 	{
   582 // CFSEmailUiLayoutHandler::ListFocusedStateTextSkinColor
   817     FUNC_LOG;
   583 // -----------------------------------------------------------------------------
   818 	return KViewChangeDelay;
       
   819 	}
       
   820 	
       
   821 TRgb CFSEmailUiLayoutHandler::ListFocusedStateTextSkinColor() const
   584 TRgb CFSEmailUiLayoutHandler::ListFocusedStateTextSkinColor() const
   822     {
   585     {
   823     FUNC_LOG;
   586     FUNC_LOG;
   824     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   587     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   825     TRgb textColor;
   588     TRgb textColor;
   826     // <cmail> Skin support
       
   827     if( AknsUtils::GetCachedColor( skin, textColor,
   589     if( AknsUtils::GetCachedColor( skin, textColor,
   828     		KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ) != KErrNone )
   590     		KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG10 ) != KErrNone )
   829     	{
   591     	{
   830         textColor = KRgbBlack;
   592         textColor = KRgbBlack;
   831     	}
   593     	}
   832     // </cmail>
       
   833     return textColor;
   594     return textColor;
   834     }
   595     }
   835 
   596 
       
   597 // -----------------------------------------------------------------------------
       
   598 // CFSEmailUiLayoutHandler::ListNormalStateTextSkinColor
       
   599 // -----------------------------------------------------------------------------
   836 TRgb CFSEmailUiLayoutHandler::ListNormalStateTextSkinColor() const
   600 TRgb CFSEmailUiLayoutHandler::ListNormalStateTextSkinColor() const
   837     {
   601     {
   838     FUNC_LOG;
   602     FUNC_LOG;
   839     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   603     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   840     TRgb textColor;
   604     TRgb textColor;
   841 	// <cmail> S60 Skin support
       
   842     if ( AknsUtils::GetCachedColor( skin, textColor,
   605     if ( AknsUtils::GetCachedColor( skin, textColor,
   843     	KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
   606     	KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
   844     	{
   607     	{
   845         textColor = KRgbBlack;
   608         textColor = KRgbBlack;
   846     	}
   609     	}
   847 	// </cmail>        
       
   848     return textColor;
   610     return textColor;
   849     }
   611     }
   850 	
   612 	
       
   613 // -----------------------------------------------------------------------------
       
   614 // CFSEmailUiLayoutHandler::ListNodeBackgroundColor
       
   615 // -----------------------------------------------------------------------------
   851 TRgb CFSEmailUiLayoutHandler::ListNodeBackgroundColor() const
   616 TRgb CFSEmailUiLayoutHandler::ListNodeBackgroundColor() const
   852 	{
   617 	{
   853     FUNC_LOG;
   618     FUNC_LOG;
   854 //<cmail> skin support
       
   855     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   619     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   856     TRgb nodeBgColor;
   620     TRgb nodeBgColor;
   857     if ( AknsUtils::GetCachedColor( skin, nodeBgColor,
   621     if ( AknsUtils::GetCachedColor( skin, nodeBgColor,
   858             KAknsIIDFsOtherColors, EAknsCIFsOtherColorsCG19 ) != KErrNone )
   622             KAknsIIDFsOtherColors, EAknsCIFsOtherColorsCG19 ) != KErrNone )
   859         {
   623         {
   860         nodeBgColor = KRgbDarkGray;
   624         nodeBgColor = KRgbDarkGray;
   861         }
   625         }
   862 //</cmail>
       
   863     return nodeBgColor;
   626     return nodeBgColor;
   864 	}
   627 	}
   865 
   628 
       
   629 // -----------------------------------------------------------------------------
       
   630 // CFSEmailUiLayoutHandler::ListNodeTextColor
       
   631 // -----------------------------------------------------------------------------
   866 TRgb CFSEmailUiLayoutHandler::ListNodeTextColor() const
   632 TRgb CFSEmailUiLayoutHandler::ListNodeTextColor() const
   867 	{
   633 	{
   868     FUNC_LOG;
   634     FUNC_LOG;
   869    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   635    MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   870     // <cmail> S60 Skin support
       
   871    TRgb nodeTextColor;
   636    TRgb nodeTextColor;
   872     if ( AknsUtils::GetCachedColor( skin, nodeTextColor,
   637     if ( AknsUtils::GetCachedColor( skin, nodeTextColor,
   873             KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
   638             KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
   874     	{
   639     	{
   875         nodeTextColor = KRgbWhite;
   640         nodeTextColor = KRgbWhite;
   876         }
   641         }
   877     // </cmail>
       
   878     return nodeTextColor;	
   642     return nodeTextColor;	
   879 	}
   643 	}
   880 
   644 
       
   645 // -----------------------------------------------------------------------------
       
   646 // CFSEmailUiLayoutHandler::ListHeaderBackgroundColor
       
   647 // -----------------------------------------------------------------------------
   881 TRgb CFSEmailUiLayoutHandler::ListHeaderBackgroundColor() const
   648 TRgb CFSEmailUiLayoutHandler::ListHeaderBackgroundColor() const
   882     {
   649     {
   883     FUNC_LOG;
   650     FUNC_LOG;
   884     // The header item bg color is gained by mixing 50/50 node bg color
   651     // The header item bg color is gained by mixing 50/50 node bg color
   885     // and list item bg color.
   652     // and list item bg color.
   886     // <cmail>
       
   887     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   653     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   888     TRgb listItemBgColor;
   654     TRgb listItemBgColor;
   889     if ( AknsUtils::GetCachedColor( skin, listItemBgColor,
   655     if ( AknsUtils::GetCachedColor( skin, listItemBgColor,
   890         KAknsIIDQsnLineColors, EAknsCIFsTextColorsCG3 ) != KErrNone )
   656         KAknsIIDQsnLineColors, EAknsCIFsTextColorsCG3 ) != KErrNone )
   891         //KAknsIIDQsnLineColors, EAknsCIFsTextColorsCG5 ) != KErrNone )            
       
   892         {
   657         {
   893         listItemBgColor = KRgbWhite;
   658         listItemBgColor = KRgbWhite;
   894         }
   659         }
   895     // </cmail>
       
   896     TRgb nodeItemBgColor = ListNodeBackgroundColor(); 
   660     TRgb nodeItemBgColor = ListNodeBackgroundColor(); 
   897     TRgb headerBgColor;
   661     TRgb headerBgColor;
   898     headerBgColor.SetRed( (listItemBgColor.Red()+nodeItemBgColor.Red()) / 2 );
   662     headerBgColor.SetRed( (listItemBgColor.Red()+nodeItemBgColor.Red()) / 2 );
   899     headerBgColor.SetGreen( (listItemBgColor.Green()+nodeItemBgColor.Green()) / 2 );
   663     headerBgColor.SetGreen( (listItemBgColor.Green()+nodeItemBgColor.Green()) / 2 );
   900     headerBgColor.SetBlue( (listItemBgColor.Blue()+nodeItemBgColor.Blue()) / 2 );
   664     headerBgColor.SetBlue( (listItemBgColor.Blue()+nodeItemBgColor.Blue()) / 2 );
   901     return headerBgColor;
   665     return headerBgColor;
   902     }
   666     }
   903 
   667 
   904 TInt CFSEmailUiLayoutHandler::ListTextStyle() const
   668 // -----------------------------------------------------------------------------
   905 	{
   669 // CFSEmailUiLayoutHandler::DropdownMenuTextColor
   906     FUNC_LOG;
   670 // -----------------------------------------------------------------------------
   907 	TInt listTextStyle( EAlfTextStyleSmall );
       
   908 	TAknUiZoom zoomLevel(EAknUiZoomNormal);
       
   909     CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel );
       
   910  	switch ( zoomLevel ) 
       
   911 		{
       
   912 		case EAknUiZoomSmall:
       
   913 			{
       
   914 		    listTextStyle = EAlfTextStyleSmall;
       
   915 			}
       
   916 			break;
       
   917 		case EAknUiZoomLarge:
       
   918 			{
       
   919 		    listTextStyle = EAlfTextStyleLarge;
       
   920 			}
       
   921 			break;
       
   922 		case EAknUiZoomNormal:
       
   923 		default:
       
   924 			{
       
   925 		    listTextStyle = EAlfTextStyleNormal;
       
   926 			}
       
   927 			break;
       
   928 		}
       
   929 	return listTextStyle;
       
   930 	}
       
   931 
       
   932 TRgb CFSEmailUiLayoutHandler::DropdownMenuTextColor() const
   671 TRgb CFSEmailUiLayoutHandler::DropdownMenuTextColor() const
   933     {
   672     {
   934     FUNC_LOG;
   673     FUNC_LOG;
   935     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   674     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   936     TRgb textColor;
   675     TRgb textColor;
   937 
       
   938     // <cmail> S60 Skin support
       
   939     if ( AknsUtils::GetCachedColor( skin, textColor,
   676     if ( AknsUtils::GetCachedColor( skin, textColor,
   940             KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
   677             KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
   941         {
   678         {
   942          textColor = KRgbBlack;
   679          textColor = KRgbBlack;
   943         }
   680         }
   944 	// </cmail>        
       
   945 
       
   946     return textColor;
   681     return textColor;
   947     }
   682     }
   948 
   683 
   949 
   684 // -----------------------------------------------------------------------------
   950 TInt CFSEmailUiLayoutHandler::ViewerFontHeightInTwips() const
   685 // CFSEmailUiLayoutHandler::ListItemFontHeightInTwips
   951 	{
   686 // -----------------------------------------------------------------------------
   952     FUNC_LOG;
       
   953 	TAknUiZoom zoomLevel(EAknUiZoomNormal);
       
   954     CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel );
       
   955 	TInt heightInTwips(0);
       
   956   	switch ( zoomLevel ) 
       
   957 		{
       
   958 		case EAknUiZoomSmall:
       
   959 			{
       
   960 		    heightInTwips = 130;
       
   961 			}
       
   962 			break;
       
   963 		case EAknUiZoomLarge:
       
   964 			{
       
   965 		    heightInTwips = 190;
       
   966 			}
       
   967 			break;
       
   968 		case EAknUiZoomNormal:
       
   969 		default:
       
   970 			{
       
   971 		    heightInTwips = 160;
       
   972 			}
       
   973 			break;
       
   974 		}
       
   975 	return heightInTwips;
       
   976 	}
       
   977 
       
   978 TInt CFSEmailUiLayoutHandler::ListItemFontHeightInTwips( const TBool aPopup ) const
   687 TInt CFSEmailUiLayoutHandler::ListItemFontHeightInTwips( const TBool aPopup ) const
   979 	{
   688 	{
   980     FUNC_LOG;
   689     FUNC_LOG;
   981     if ( aPopup )
   690     if ( aPopup )
   982         {
   691         {
   994         itemText.LayoutText( mainPaneRect, AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 0 ) );
   703         itemText.LayoutText( mainPaneRect, AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 0 ) );
   995         return itemText.Font()->FontSpecInTwips().iHeight;
   704         return itemText.Font()->FontSpecInTwips().iHeight;
   996         }
   705         }
   997 	}
   706 	}
   998 
   707 
   999 
       
  1000 // -----------------------------------------------------------------------------
   708 // -----------------------------------------------------------------------------
  1001 // CFSEmailUiLayoutHandler::ViewerTitleFontAknLogicalFontId
   709 // CFSEmailUiLayoutHandler::ViewerTitleFontAknLogicalFontId
  1002 // -----------------------------------------------------------------------------
   710 // -----------------------------------------------------------------------------
  1003 TAknLogicalFontId CFSEmailUiLayoutHandler::ViewerTitleFontAknLogicalFontId() const
   711 TAknLogicalFontId CFSEmailUiLayoutHandler::ViewerTitleFontAknLogicalFontId() const
  1004 	{
   712 	{
  1005     FUNC_LOG;
   713     FUNC_LOG;
  1006 	return KViewerLogicalTitleFontId;
   714 	return KViewerLogicalTitleFontId;
  1007 	}
   715 	}
       
   716 
  1008 // -----------------------------------------------------------------------------
   717 // -----------------------------------------------------------------------------
  1009 // CFSEmailUiLayoutHandler::ViewerTextFontAknLogicalFontId
   718 // CFSEmailUiLayoutHandler::ViewerTextFontAknLogicalFontId
  1010 // -----------------------------------------------------------------------------
   719 // -----------------------------------------------------------------------------
  1011 TAknLogicalFontId CFSEmailUiLayoutHandler::ViewerTextFontAknLogicalFontId() const
   720 TAknLogicalFontId CFSEmailUiLayoutHandler::ViewerTextFontAknLogicalFontId() const
  1012 	{
   721 	{
  1013     FUNC_LOG;
   722     FUNC_LOG;
  1014 	return KViewerLogicalTextFontId;
   723 	return KViewerLogicalTextFontId;
  1015 	}
   724 	}
       
   725 
  1016 // -----------------------------------------------------------------------------
   726 // -----------------------------------------------------------------------------
  1017 // CFSEmailUiLayoutHandler::ViewerTitleFontHeight
   727 // CFSEmailUiLayoutHandler::ViewerTitleFontHeight
  1018 // -----------------------------------------------------------------------------
   728 // -----------------------------------------------------------------------------
  1019 TInt CFSEmailUiLayoutHandler::ViewerTitleFontHeight() const
   729 TInt CFSEmailUiLayoutHandler::ViewerTitleFontHeight() const
  1020 	{
   730 	{
  1021 	FUNC_LOG;
   731 	FUNC_LOG;
  1022     // <cmail> Platform layout changes
       
  1023     /*
       
  1024     TAknUiZoom zoomLevel;
       
  1025     CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel );
       
  1026     TInt heightInPixels = 0;
       
  1027     switch ( zoomLevel )
       
  1028         {
       
  1029         case EAknUiZoomSmall:
       
  1030             {
       
  1031             heightInPixels = KViewerTitleFontSizeSmall;
       
  1032             }
       
  1033             break;
       
  1034         case EAknUiZoomLarge:
       
  1035             {
       
  1036             heightInPixels = KViewerTitleFontSizeLarge;
       
  1037             }
       
  1038             break;
       
  1039         case EAknUiZoomNormal:
       
  1040         default:
       
  1041             {
       
  1042             heightInPixels = KViewerTitleFontSizeNormal;
       
  1043             }
       
  1044             break;
       
  1045         }
       
  1046     return heightInPixels;
       
  1047     */
       
  1048     TAknLayoutRect labelRect;
   732     TAknLayoutRect labelRect;
  1049     labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane() );
   733     labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane() );
  1050     TAknLayoutText layoutText;
   734     TAknLayoutText layoutText;
  1051     layoutText.LayoutText( labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1() );
   735     layoutText.LayoutText( labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1() );
  1052     return layoutText.Font()->FontMaxHeight();
   736     return layoutText.Font()->FontMaxHeight();
  1053     // </cmail> Platform layout changes
       
  1054 	}
   737 	}
  1055 
   738 
  1056 // -----------------------------------------------------------------------------
   739 // -----------------------------------------------------------------------------
  1057 // CFSEmailUiLayoutHandler::ViewerTextFontHeight
   740 // CFSEmailUiLayoutHandler::ViewerTextFontHeight
  1058 // -----------------------------------------------------------------------------
   741 // -----------------------------------------------------------------------------
  1059 TInt CFSEmailUiLayoutHandler::ViewerTextFontHeight() const
   742 TInt CFSEmailUiLayoutHandler::ViewerTextFontHeight() const
  1060 	{
   743 	{
  1061 	FUNC_LOG;
   744 	FUNC_LOG;
  1062     // <cmail> Platform layout changes
       
  1063     /*
       
  1064     TAknUiZoom zoomLevel;
       
  1065     CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel );
       
  1066     TInt heightInPixels = 0;
       
  1067     switch ( zoomLevel )
       
  1068         {
       
  1069         case EAknUiZoomSmall:
       
  1070             {
       
  1071             heightInPixels = KViewerTextFontSizeSmall;
       
  1072             }
       
  1073             break;
       
  1074         case EAknUiZoomLarge:
       
  1075             {
       
  1076             heightInPixels = KViewerTextFontSizeLarge;
       
  1077             }
       
  1078             break;
       
  1079         case EAknUiZoomNormal:
       
  1080         default:
       
  1081             {
       
  1082             heightInPixels = KViewerTextFontSizeNormal;
       
  1083             }
       
  1084             break;
       
  1085         }
       
  1086     return heightInPixels;
       
  1087     */
       
  1088     TAknLayoutRect labelRect;
   745     TAknLayoutRect labelRect;
  1089     labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
   746     labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
  1090     TAknLayoutText layoutText;
   747     TAknLayoutText layoutText;
  1091     layoutText.LayoutText( labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_t1( 0 ) );
   748     layoutText.LayoutText( labelRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_t1( 0 ) );
  1092     return layoutText.Font()->FontMaxHeight();
   749     return layoutText.Font()->FontMaxHeight();
  1093     // </cmail> Platform layout changes
       
  1094 	}
   750 	}
  1095 
   751 
  1096 // -----------------------------------------------------------------------------
   752 // -----------------------------------------------------------------------------
  1097 // CFSEmailUiLayoutHandler::ViewerTopMostSpaceHeight
   753 // CFSEmailUiLayoutHandler::ViewerTopMostSpaceHeight
  1098 // -----------------------------------------------------------------------------
   754 // -----------------------------------------------------------------------------
  1099 TInt CFSEmailUiLayoutHandler::ViewerTopMostSpaceHeight() const
   755 TInt CFSEmailUiLayoutHandler::ViewerTopMostSpaceHeight() const
  1100 	{
   756 	{
  1101 	FUNC_LOG;
   757 	FUNC_LOG;
  1102     // <cmail> Platform layout changes
       
  1103     /*
       
  1104 	TAknUiZoom zoomLevel;
       
  1105     CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel );
       
  1106 	TInt heightInPixels = 0;
       
  1107   	switch ( zoomLevel )
       
  1108 		{
       
  1109 		case EAknUiZoomSmall:
       
  1110 			{
       
  1111 			heightInPixels = KViewerTopMostSpaceSmall;
       
  1112 			}
       
  1113 			break;
       
  1114 		case EAknUiZoomLarge:
       
  1115 			{
       
  1116 			heightInPixels = KViewerTopMostSpaceLarge;
       
  1117 			}
       
  1118 			break;
       
  1119 		case EAknUiZoomNormal:
       
  1120 		default:
       
  1121 			{
       
  1122 			heightInPixels = KViewerTopMostSpaceNormal;
       
  1123 			}
       
  1124 			break;
       
  1125 		}
       
  1126 	return heightInPixels;
       
  1127 	*/
       
  1128     TAknLayoutRect labelRect;
   758     TAknLayoutRect labelRect;
  1129     labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane( 0 ) );
   759     labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane( 0 ) );
  1130     return labelRect.Rect().Height();
   760     return labelRect.Rect().Height();
  1131     // </cmail> Platform layout changes
       
  1132 	}
   761 	}
  1133 // -----------------------------------------------------------------------------
   762 // -----------------------------------------------------------------------------
  1134 // CFSEmailUiLayoutHandler::ViewerRecipientSpaceHeight
   763 // CFSEmailUiLayoutHandler::ViewerRecipientSpaceHeight
  1135 // -----------------------------------------------------------------------------
   764 // -----------------------------------------------------------------------------
  1136 TInt CFSEmailUiLayoutHandler::ViewerRecipientSpaceHeight() const
   765 TInt CFSEmailUiLayoutHandler::ViewerRecipientSpaceHeight() const
  1137 	{
   766 	{
  1138 	FUNC_LOG;
   767 	FUNC_LOG;
  1139     // <cmail> Platform layout changes
       
  1140     /*
       
  1141 	TAknUiZoom zoomLevel;
       
  1142     CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel );
       
  1143 	TInt heightInPixels = 0;
       
  1144   	switch ( zoomLevel )
       
  1145 		{
       
  1146 		case EAknUiZoomSmall:
       
  1147 			{
       
  1148 			heightInPixels = KViewerRecipientSpaceSmall;
       
  1149 			}
       
  1150 			break;
       
  1151 		case EAknUiZoomLarge:
       
  1152 			{
       
  1153 			heightInPixels = KViewerRecipientSpaceLarge;
       
  1154 			}
       
  1155 			break;
       
  1156 		case EAknUiZoomNormal:
       
  1157 		default:
       
  1158 			{
       
  1159 			heightInPixels = KViewerRecipientSpaceNormal;
       
  1160 			}
       
  1161 			break;
       
  1162 		}
       
  1163 	return heightInPixels;
       
  1164 	*/
       
  1165     TAknLayoutRect labelRect;
   768     TAknLayoutRect labelRect;
  1166     labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
   769     labelRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
  1167     return labelRect.Rect().Height();
   770     return labelRect.Rect().Height();
  1168     // </cmail> Platform layout changes
       
  1169 	}
   771 	}
  1170 
   772 
  1171 // -----------------------------------------------------------------------------
   773 // -----------------------------------------------------------------------------
  1172 // CFSEmailUiLayoutHandler::ViewerHeaderInfoSpaceHeight
   774 // CFSEmailUiLayoutHandler::ViewerHeaderInfoSpaceHeight
  1173 // -----------------------------------------------------------------------------
   775 // -----------------------------------------------------------------------------
  1174 TInt CFSEmailUiLayoutHandler::ViewerHeaderInfoSpaceHeight() const
   776 TInt CFSEmailUiLayoutHandler::ViewerHeaderInfoSpaceHeight() const
  1175 	{
   777 	{
  1176 	FUNC_LOG;
   778 	FUNC_LOG;
  1177     // <cmail> Platform layout changes
       
  1178     /*
       
  1179 	TAknUiZoom zoomLevel;
       
  1180     CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel );
       
  1181 	TInt heightInPixels = 0;
       
  1182   	switch ( zoomLevel )
       
  1183 		{
       
  1184 		case EAknUiZoomSmall:
       
  1185 			{
       
  1186 			heightInPixels = KViewerHeaderInfoSpaceSmall;
       
  1187 			}
       
  1188 			break;
       
  1189 		case EAknUiZoomLarge:
       
  1190 			{
       
  1191 			heightInPixels = KViewerHeaderInfoSpaceLarge;
       
  1192 			}
       
  1193 			break;
       
  1194 		case EAknUiZoomNormal:
       
  1195 		default:
       
  1196 			{
       
  1197 			heightInPixels = KViewerHeaderInfoSpaceNormal;
       
  1198 			}
       
  1199 			break;
       
  1200 		}
       
  1201 	return heightInPixels;
       
  1202 	*/
       
  1203 	return ViewerTopMostSpaceHeight();
   779 	return ViewerTopMostSpaceHeight();
  1204     // </cmail> Platform layout changes
       
  1205 	}
   780 	}
  1206 
   781 
  1207 // -----------------------------------------------------------------------------
   782 // -----------------------------------------------------------------------------
  1208 // CFSEmailUiLayoutHandler::ViewerBottomMostSpaceHeight
   783 // CFSEmailUiLayoutHandler::ViewerBottomMostSpaceHeight
  1209 // -----------------------------------------------------------------------------
   784 // -----------------------------------------------------------------------------
  1210 TInt CFSEmailUiLayoutHandler::ViewerBottomMostSpaceHeight() const
   785 TInt CFSEmailUiLayoutHandler::ViewerBottomMostSpaceHeight() const
  1211 	{
   786 	{
  1212 	FUNC_LOG;
   787 	FUNC_LOG;
  1213     // <cmail> Platform layout changes
       
  1214 	/*
       
  1215 	TAknUiZoom zoomLevel;
       
  1216     CAknEnv::Static()->GetCurrentGlobalUiZoom( zoomLevel );
       
  1217 	TInt heightInPixels = 0;
       
  1218   	switch ( zoomLevel )
       
  1219 		{
       
  1220 		case EAknUiZoomSmall:
       
  1221 			{
       
  1222 			heightInPixels = KViewerBottomMostSpaceSmall;
       
  1223 			}
       
  1224 			break;
       
  1225 		case EAknUiZoomLarge:
       
  1226 			{
       
  1227 			heightInPixels = KViewerBottomMostSpaceLarge;
       
  1228 			}
       
  1229 			break;
       
  1230 		case EAknUiZoomNormal:
       
  1231 		default:
       
  1232 			{
       
  1233 			heightInPixels = KViewerBottomMostSpaceNormal;
       
  1234 			}
       
  1235 			break;
       
  1236 		}
       
  1237 	return heightInPixels;
       
  1238 	*/
       
  1239 	return ViewerRecipientSpaceHeight();
   788 	return ViewerRecipientSpaceHeight();
  1240     // </cmail> Platform layout changes
   789 	}
  1241 	}
   790 
  1242 // -----------------------------------------------------------------------------
   791 // -----------------------------------------------------------------------------
  1243 // CFSEmailUiLayoutHandler::ViewerMaxRecipientLineCount
   792 // CFSEmailUiLayoutHandler::ViewerMaxRecipientLineCount
  1244 // -----------------------------------------------------------------------------
   793 // -----------------------------------------------------------------------------
  1245 TInt CFSEmailUiLayoutHandler::ViewerMaxRecipientLineCount() const
   794 TInt CFSEmailUiLayoutHandler::ViewerMaxRecipientLineCount() const
  1246     {
   795     {
  1247     FUNC_LOG;
   796     FUNC_LOG;
  1248     return KViewerMaxRecipientLineCount;
   797     return KViewerMaxRecipientLineCount;
  1249     }
   798     }
       
   799 
  1250 // -----------------------------------------------------------------------------
   800 // -----------------------------------------------------------------------------
  1251 // CFSEmailUiLayoutHandler::ViewerMaxSubjectLineCount
   801 // CFSEmailUiLayoutHandler::ViewerMaxSubjectLineCount
  1252 // -----------------------------------------------------------------------------
   802 // -----------------------------------------------------------------------------
  1253 TInt CFSEmailUiLayoutHandler::ViewerMaxSubjectLineCount() const
   803 TInt CFSEmailUiLayoutHandler::ViewerMaxSubjectLineCount() const
  1254     {
   804     {
  1255     FUNC_LOG;
   805     FUNC_LOG;
  1256     return KViewerMaxSubjectLineCount;
   806     return KViewerMaxSubjectLineCount;
  1257     }
   807     }
       
   808 
  1258 // -----------------------------------------------------------------------------
   809 // -----------------------------------------------------------------------------
  1259 // CFSEmailUiLayoutHandler::ViewerTitleTextColor
   810 // CFSEmailUiLayoutHandler::ViewerTitleTextColor
  1260 // -----------------------------------------------------------------------------
   811 // -----------------------------------------------------------------------------
  1261 TRgb CFSEmailUiLayoutHandler::ViewerTitleTextColor() const
   812 TRgb CFSEmailUiLayoutHandler::ViewerTitleTextColor() const
  1262 	{
   813 	{
  1263     FUNC_LOG;
   814     FUNC_LOG;
  1264     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   815     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  1265     TRgb textColor;
   816     TRgb textColor;
  1266     // <cmail> S60 Skin support
       
  1267     if (AknsUtils::GetCachedColor( skin, textColor,
   817     if (AknsUtils::GetCachedColor( skin, textColor,
  1268 		KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
   818 		KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
  1269         {
   819         {
  1270         textColor = KBlackFallbackTextColor;
   820         textColor = KBlackFallbackTextColor;
  1271         }
   821         }
  1272     // </cmail>
       
  1273 
       
  1274     return textColor;
   822     return textColor;
  1275 	}
   823 	}
       
   824 
  1276 // -----------------------------------------------------------------------------
   825 // -----------------------------------------------------------------------------
  1277 // CFSEmailUiLayoutHandler::ViewerTextTextColor
   826 // CFSEmailUiLayoutHandler::ViewerTextTextColor
  1278 // -----------------------------------------------------------------------------
   827 // -----------------------------------------------------------------------------
  1279 TRgb CFSEmailUiLayoutHandler::ViewerTextTextColor() const
   828 TRgb CFSEmailUiLayoutHandler::ViewerTextTextColor() const
  1280 	{
   829 	{
  1281     FUNC_LOG;
   830     FUNC_LOG;
  1282     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   831     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  1283     TRgb textColor;
   832     TRgb textColor;
  1284     // <cmail> S60 Skin support
       
  1285     if (AknsUtils::GetCachedColor( skin, textColor,
   833     if (AknsUtils::GetCachedColor( skin, textColor,
  1286 		KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
   834 		KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG6 ) != KErrNone )
  1287     	{
   835     	{
  1288         textColor = KBlackFallbackTextColor;
   836         textColor = KBlackFallbackTextColor;
  1289         }
   837         }
  1290 	// </cmail>
       
  1291 
       
  1292     return textColor;
   838     return textColor;
  1293 	}
   839 	}
       
   840 
  1294 // -----------------------------------------------------------------------------
   841 // -----------------------------------------------------------------------------
  1295 // CFSEmailUiLayoutHandler::ViewerBodyTextColor
   842 // CFSEmailUiLayoutHandler::ViewerBodyTextColor
  1296 // -----------------------------------------------------------------------------
   843 // -----------------------------------------------------------------------------
  1297 TRgb CFSEmailUiLayoutHandler::ViewerBodyTextColor() const
   844 TRgb CFSEmailUiLayoutHandler::ViewerBodyTextColor() const
  1298 	{
   845 	{
  1299     FUNC_LOG;
   846     FUNC_LOG;
  1300     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   847     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  1301     TRgb textColor;
   848     TRgb textColor;
  1302     if ( AknsUtils::GetCachedColor( skin, textColor,
   849     if ( AknsUtils::GetCachedColor( skin, textColor,
  1303             //KAknsIIDFsTextColors, EAknsCIFsTextColorsCG3 ) != KErrNone )
   850             KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG13 ) != KErrNone )
  1304             KAknsIIDQsnTextColors, EAknsCIQsnTextColorsCG13 ) != KErrNone ) // <cmail>
       
  1305         {
   851         {
  1306         textColor = KBlackFallbackTextColor;
   852         textColor = KBlackFallbackTextColor;
  1307         }
   853         }
  1308     return textColor;
   854     return textColor;
  1309 	}
   855 	}
       
   856 
  1310 // -----------------------------------------------------------------------------
   857 // -----------------------------------------------------------------------------
  1311 // CFSEmailUiLayoutHandler::ViewerNormalHotspotTextColor
   858 // CFSEmailUiLayoutHandler::ViewerNormalHotspotTextColor
  1312 // -----------------------------------------------------------------------------
   859 // -----------------------------------------------------------------------------
  1313 TRgb CFSEmailUiLayoutHandler::ViewerNormalHotspotTextColor() const
   860 TRgb CFSEmailUiLayoutHandler::ViewerNormalHotspotTextColor() const
  1314 	{
   861 	{
  1315     FUNC_LOG;
   862     FUNC_LOG;
  1316     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   863     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  1317     TRgb textColor;
   864     TRgb textColor;
  1318     // <cmail> S60 Skin support
       
  1319 	if ( AknsUtils::GetCachedColor( skin, textColor,
   865 	if ( AknsUtils::GetCachedColor( skin, textColor,
  1320             KAknsIIDQsnHighlightColors,
   866             KAknsIIDQsnHighlightColors,
  1321 		EAknsCIQsnHighlightColorsCG3 ) != KErrNone )
   867 		EAknsCIQsnHighlightColorsCG3 ) != KErrNone )
  1322 		{
   868 		{
  1323         textColor = KLightBlueFallbackTextColor;
   869         textColor = KLightBlueFallbackTextColor;
  1324         }
   870         }
  1325 	// </cmail>
       
  1326 
       
  1327     return textColor;
   871     return textColor;
  1328 	}
   872 	}
       
   873 
  1329 // -----------------------------------------------------------------------------
   874 // -----------------------------------------------------------------------------
  1330 // CFSEmailUiLayoutHandler::ViewerHighlightedHotspotTextColor
   875 // CFSEmailUiLayoutHandler::ViewerHighlightedHotspotTextColor
  1331 // -----------------------------------------------------------------------------
   876 // -----------------------------------------------------------------------------
  1332 TRgb CFSEmailUiLayoutHandler::ViewerHighlightedHotspotTextColor() const
   877 TRgb CFSEmailUiLayoutHandler::ViewerHighlightedHotspotTextColor() const
  1333 	{
   878 	{
  1334     FUNC_LOG;
   879     FUNC_LOG;
  1335     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
   880     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
  1336     TRgb textColor;
   881     TRgb textColor;
  1337     // <cmail> S60 Skin support
       
  1338 	if ( AknsUtils::GetCachedColor( skin, textColor,
   882 	if ( AknsUtils::GetCachedColor( skin, textColor,
  1339 			KAknsIIDQsnHighlightColors,
   883 			KAknsIIDQsnHighlightColors, EAknsCIQsnHighlightColorsCG3 ) 
  1340 			EAknsCIQsnHighlightColorsCG3 ) != KErrNone )
   884                 != KErrNone )
  1341 		{
   885 		{
  1342         textColor = KLightBlueFallbackTextColor;
   886         textColor = KLightBlueFallbackTextColor;
  1343         }
   887         }
  1344 	// </cmail>
       
  1345 
       
  1346     return textColor;
   888     return textColor;
  1347 	}
   889 	}
  1348 // -----------------------------------------------------------------------------
   890 // -----------------------------------------------------------------------------
  1349 // CFSEmailUiLayoutHandler::ViewerSentTextColor
   891 // CFSEmailUiLayoutHandler::ViewerSentTextColor
  1350 // -----------------------------------------------------------------------------
   892 // -----------------------------------------------------------------------------
  1358         {
   900         {
  1359         textColor = KBlackFallbackTextColor;
   901         textColor = KBlackFallbackTextColor;
  1360         }
   902         }
  1361     return textColor;
   903     return textColor;
  1362 	}
   904 	}
       
   905 
  1363 // -----------------------------------------------------------------------------
   906 // -----------------------------------------------------------------------------
  1364 // CFSEmailUiLayoutHandler::ViewerPixelsBetweenMsgStatusIconAndSubject
   907 // CFSEmailUiLayoutHandler::ViewerPixelsBetweenMsgStatusIconAndSubject
  1365 // -----------------------------------------------------------------------------
   908 // -----------------------------------------------------------------------------
  1366 TInt CFSEmailUiLayoutHandler::ViewerPixelsBetweenMsgStatusIconAndSubject() const
   909 TInt CFSEmailUiLayoutHandler::ViewerPixelsBetweenMsgStatusIconAndSubject() const
  1367 	{
   910 	{
  1368 	FUNC_LOG;
   911 	FUNC_LOG;
  1369     // <cmail> Platform layout changes
       
  1370     /*
       
  1371     return KViewerSpaceBetweenIconAndSubject;
       
  1372     */
       
  1373     const TRect cmailPaneRect( ListCmailPaneRect() );
   912     const TRect cmailPaneRect( ListCmailPaneRect() );
  1374     TAknLayoutRect layoutRect;
   913     TAknLayoutRect layoutRect;
  1375     layoutRect.LayoutRect( cmailPaneRect, AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
   914     layoutRect.LayoutRect( cmailPaneRect, AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
  1376     TAknLayoutRect iconRect;
   915     TAknLayoutRect iconRect;
  1377     iconRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g1( 0 ) );
   916     iconRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g1( 0 ) );
  1381         }
   920         }
  1382     else
   921     else
  1383         {
   922         {
  1384         return Abs( cmailPaneRect.iTl.iX - iconRect.Rect().iTl.iX );
   923         return Abs( cmailPaneRect.iTl.iX - iconRect.Rect().iTl.iX );
  1385         }
   924         }
  1386         
       
  1387     // </cmail> Platform layout changes
       
  1388 	}
   925 	}
  1389 
   926 
  1390 // -----------------------------------------------------------------------------
   927 // -----------------------------------------------------------------------------
  1391 // CFSEmailUiLayoutHandler::ViewerIconSize
   928 // CFSEmailUiLayoutHandler::ViewerIconSize
  1392 // -----------------------------------------------------------------------------
   929 // -----------------------------------------------------------------------------
  1393 TSize CFSEmailUiLayoutHandler::ViewerIconSize() const
   930 TSize CFSEmailUiLayoutHandler::ViewerIconSize() const
  1394 	{
   931 	{
  1395 	FUNC_LOG;
   932 	FUNC_LOG;
  1396 	// <cmail> Platform layout changes
       
  1397 	/*
       
  1398 	return KViewerIconSize;
       
  1399 	*/
       
  1400     TAknLayoutRect layoutRect;
   933     TAknLayoutRect layoutRect;
  1401     layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
   934     layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
  1402     layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g1( 2 ) );
   935     layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g1( 2 ) );
  1403     return layoutRect.Rect().Size();
   936     return layoutRect.Rect().Size();
  1404 	// </cmail> Platform layout changes
       
  1405 	}
   937 	}
  1406 // -----------------------------------------------------------------------------
   938 // -----------------------------------------------------------------------------
  1407 // CFSEmailUiLayoutHandler::ViewerIndentationIconSize
   939 // CFSEmailUiLayoutHandler::ViewerIndentationIconSize
  1408 // -----------------------------------------------------------------------------
   940 // -----------------------------------------------------------------------------
  1409 TSize CFSEmailUiLayoutHandler::ViewerIndentationIconSize() const
   941 TSize CFSEmailUiLayoutHandler::ViewerIndentationIconSize() const
  1410 	{
   942 	{
  1411 	FUNC_LOG;
   943 	FUNC_LOG;
  1412     // <cmail> Platform layout changes
       
  1413     /*
       
  1414     return KViewerTransparentIndentationIconSize;
       
  1415     */
       
  1416 	return ViewerIconSize();
   944 	return ViewerIconSize();
  1417     // </cmail> Platform layout changes
       
  1418 	}
   945 	}
  1419 // -----------------------------------------------------------------------------
   946 // -----------------------------------------------------------------------------
  1420 // CFSEmailUiLayoutHandler::ViewerActionMenuIconSize
   947 // CFSEmailUiLayoutHandler::ViewerActionMenuIconSize
  1421 // -----------------------------------------------------------------------------
   948 // -----------------------------------------------------------------------------
  1422 TSize CFSEmailUiLayoutHandler::ViewerActionMenuIconSize() const
   949 TSize CFSEmailUiLayoutHandler::ViewerActionMenuIconSize() const
  1423     {
   950     {
  1424 	FUNC_LOG;
   951 	FUNC_LOG;
  1425     // <cmail> Platform layout changes
       
  1426     /*
       
  1427     return KViewerActionMenuIconSize;
       
  1428     */
       
  1429     TAknLayoutRect layoutRect;
   952     TAknLayoutRect layoutRect;
  1430     layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
   953     layoutRect.LayoutRect( ListCmailPaneRect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane( 0 ) );
  1431     layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g2( 0 ) );
   954     layoutRect.LayoutRect( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_detail_pane_g2( 0 ) );
  1432     return layoutRect.Rect().Size();
   955     return layoutRect.Rect().Size();
  1433     // </cmail> Platform layout changes
       
  1434     }
   956     }
  1435 
   957 
  1436 // -----------------------------------------------------------------------------
   958 // -----------------------------------------------------------------------------
  1437 // CFSEmailUiLayoutHandler::ViewerActionMenuIconMargin
   959 // CFSEmailUiLayoutHandler::ViewerActionMenuIconMargin
  1438 // -----------------------------------------------------------------------------
   960 // -----------------------------------------------------------------------------
  1493     captionTextRect.LayoutText( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1() );
  1015     captionTextRect.LayoutText( layoutRect.Rect(), AknLayoutScalable_Apps::list_single_cmail_header_caption_pane_t1() );
  1494     return Abs( cmailPaneRect.iTl.iX - captionTextRect.TextRect().iTl.iX );
  1016     return Abs( cmailPaneRect.iTl.iX - captionTextRect.TextRect().iTl.iX );
  1495     }
  1017     }
  1496 
  1018 
  1497 // -----------------------------------------------------------------------------
  1019 // -----------------------------------------------------------------------------
  1498 // CFSEmailUiLayoutHandler::ViewerWaterMarkSizeInThisResolution
       
  1499 // -----------------------------------------------------------------------------
       
  1500 TSize CFSEmailUiLayoutHandler::ViewerWaterMarkSizeInThisResolution() const
       
  1501 	{
       
  1502     FUNC_LOG;
       
  1503 	TSize sizeWithCurrentResolution;
       
  1504 	// For now, set same size with all resolutions
       
  1505 	switch ( iScreenResolution )
       
  1506 		{
       
  1507  		case ELowResPortrait:
       
  1508 		case EQvgaPortrait:
       
  1509  		case EVgaPortrait:
       
  1510   		case EHvgaPortrait:
       
  1511  		case EDrPortrait:
       
  1512  		case ELowResLandscape:
       
  1513  		case EQvgaLandscape:
       
  1514 		case EVgaLandscape:	
       
  1515 		case EHvgaLandscape:	
       
  1516  		case EDrLandscape:
       
  1517  		case EWideLandscape:
       
  1518 		default:
       
  1519 		    sizeWithCurrentResolution = KViewerDefaultWaterMarkSizeInViewer;
       
  1520 		    break;
       
  1521 		}
       
  1522 	return sizeWithCurrentResolution;
       
  1523 	}
       
  1524 
       
  1525 // -----------------------------------------------------------------------------
       
  1526 // CFSEmailUiLayoutHandler::ViewerWaterMarkPositionFromBottomRightCornerInThisResolution
       
  1527 // -----------------------------------------------------------------------------
       
  1528 TPoint CFSEmailUiLayoutHandler::ViewerWaterMarkPlaceFromBottomRightCornerInThisResolution() const
       
  1529 	{
       
  1530     FUNC_LOG;
       
  1531 	TPoint placeFromBottomRightCorner;
       
  1532 	// For now, set place with all resolutions
       
  1533 	switch ( iScreenResolution )
       
  1534 		{
       
  1535  		case ELowResPortrait:
       
  1536 		case EQvgaPortrait:
       
  1537  		case EVgaPortrait:
       
  1538   		case EHvgaPortrait:
       
  1539  		case EDrPortrait:
       
  1540  		case ELowResLandscape:
       
  1541  		case EQvgaLandscape:
       
  1542 		case EVgaLandscape:	
       
  1543 		case EHvgaLandscape:	
       
  1544  		case EDrLandscape:
       
  1545  		case EWideLandscape:
       
  1546 		default:
       
  1547 		    placeFromBottomRightCorner = KViewerWaterMarkPositionFromBottomRightCorner;
       
  1548 		    break;
       
  1549 		}
       
  1550 	return placeFromBottomRightCorner;
       
  1551 	}
       
  1552 
       
  1553 // -----------------------------------------------------------------------------
       
  1554 // CFSEmailUiLayoutHandler::ComposerFieldBorderColor
  1020 // CFSEmailUiLayoutHandler::ComposerFieldBorderColor
  1555 // -----------------------------------------------------------------------------
  1021 // -----------------------------------------------------------------------------
  1556 TRgb CFSEmailUiLayoutHandler::ComposerFieldBorderColor() const
  1022 TRgb CFSEmailUiLayoutHandler::ComposerFieldBorderColor() const
  1557     {
  1023     {
  1558     FUNC_LOG;
  1024     FUNC_LOG;
  1952     TRect rect = listRect.Rect();
  1418     TRect rect = listRect.Rect();
  1953   
  1419   
  1954     // if control bar is required, reserve space on top of the listbox  
  1420     // if control bar is required, reserve space on top of the listbox  
  1955     if( aControlsOnTop && landscape )
  1421     if( aControlsOnTop && landscape )
  1956         {
  1422         {
  1957         TAknLayoutRect listRect2;
  1423         listRect.LayoutRect( mainPaneRect, 
  1958         listRect2.LayoutRect( mainPaneRect, 
       
  1959                         AknLayoutScalable_Apps::main_sp_fs_listscroll_pane_te_cp01( 0 ));
  1424                         AknLayoutScalable_Apps::main_sp_fs_listscroll_pane_te_cp01( 0 ));
  1960         rect.Intersection(listRect2.Rect());
  1425         rect = listRect.Rect();
  1961         }
  1426         }
  1962     
  1427     
  1963     return rect;
  1428     return rect;
  1964     }
  1429     }
  1965 
  1430