emailuis/uicomponents/src/fslayoutmanager.cpp
branchRCL_3
changeset 64 3533d4323edc
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
       
     1 /*
       
     2 * Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). 
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description: This file implements class CFsLayoutManager.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #include "emailtrace.h"
       
    20 #include <AknUtils.h>
       
    21 #include <aknlayoutscalable_avkon.cdl.h>
       
    22 #include <layoutmetadata.cdl.h>
       
    23 #include <AknLayoutFont.h>
       
    24 #include <CdlRefs.h>
       
    25 #include <apgcli.h>
       
    26 #include <eikapp.h>
       
    27 // <cmail> SF
       
    28 #include <alf/alfstatic.h>
       
    29 #include <alf/alfenv.h>
       
    30 // </cmail>
       
    31 #include <centralrepository.h>
       
    32 #include <AvkonInternalCRKeys.h>
       
    33 
       
    34 //<CMAIL> As a device user, I want Message List items to follow platform layouts to be consistent with other apps
       
    35 #include <aknlayoutscalable_apps.cdl.h>
       
    36 //</CMAIL>
       
    37 
       
    38 //<cmail>
       
    39 //A lot of stuff removed, dependencies to FSLayout REMOVED!!
       
    40 //</cmail>
       
    41 
       
    42 #include "fslayoutmanager.h"
       
    43 
       
    44 // Layout file to use if a supported one wasn't found.
       
    45 // <cmail> S60 UID update
       
    46 //_LIT( KFsLayoutpackFile, "2001E284.dll" );
       
    47 // </cmail> S60 UID update
       
    48 
       
    49 
       
    50 // ======== LOCAL FUNCTIONS ========
       
    51 
       
    52 // ---------------------------------------------------------------------------
       
    53 // Release given pointer.
       
    54 // ---------------------------------------------------------------------------
       
    55 //
       
    56 void CleanupLayoutPack( TAny* /*aPtr*/ )
       
    57 	{
       
    58 	}
       
    59 
       
    60 
       
    61 // ======== MEMBER FUNCTIONS ========
       
    62 
       
    63 
       
    64 EXPORT_C CFsLayoutManager::CFsLayoutManager()
       
    65     {
       
    66     FUNC_LOG;
       
    67     }
       
    68 
       
    69 // ---------------------------------------------------------------------------
       
    70 // Determine if the mirroring is in use.
       
    71 // ---------------------------------------------------------------------------
       
    72 //
       
    73 EXPORT_C TBool CFsLayoutManager::IsMirrored()
       
    74     {
       
    75     FUNC_LOG;
       
    76     return Layout_Meta_Data::IsMirrored();
       
    77     }
       
    78 
       
    79 // ---------------------------------------------------------------------------
       
    80 // Fills given TRect with rectangle for given layout component. Returns EFalse
       
    81 // for status pane descendants if requested layout component is not available
       
    82 // in current layout. For other components returns always ETrue (returned
       
    83 // rectangle is from layout definition).
       
    84 // ---------------------------------------------------------------------------
       
    85 //
       
    86 EXPORT_C TBool CFsLayoutManager::LayoutMetricsRect(
       
    87     const TRect &aParent,
       
    88     TFsLayoutMetrics aParam,
       
    89     TRect& aRect,
       
    90     TInt aVariety,
       
    91     TInt aRow,
       
    92     TInt /*aCol*/ )
       
    93     {
       
    94     FUNC_LOG;
       
    95 
       
    96     TBool retVal( ETrue );
       
    97     TAknLayoutRect rect;
       
    98 
       
    99     switch ( aParam )
       
   100         {
       
   101         case EFsLmScreen:
       
   102             rect.LayoutRect( aParent,
       
   103                 AknLayoutScalable_Apps::Screen().LayoutLine() );
       
   104             break;
       
   105         case EFsLmApplicationWindow:
       
   106             rect.LayoutRect( aParent,
       
   107                 AknLayoutScalable_Apps::application_window().LayoutLine() );
       
   108             break;
       
   109         case EFsLmAreaTopPane:
       
   110             rect.LayoutRect( aParent,
       
   111                 AknLayoutScalable_Apps::area_top_pane( aVariety ).LayoutLine() );
       
   112             break;
       
   113         case EFsLmBgSpFsCtrlbarPane:
       
   114             rect.LayoutRect( aParent,
       
   115                 AknLayoutScalable_Apps::bg_sp_fs_ctrlbar_pane( aVariety ).LayoutLine() );
       
   116             break;            
       
   117         case EFsLmListMediumLineG1:
       
   118         case EFsLmListMediumLineX2G1:
       
   119         case EFsLmListMediumLineT2G2G1:
       
   120         case EFsLmListMediumLineT3G2G1:           
       
   121         case EFsLmListMediumLineT3G1:
       
   122         case EFsLmListMediumLineT2G3G1:
       
   123         case EFsLmListMediumLineT3G3G1:
       
   124         case EFsLmListMediumLineX2T3G4G1:
       
   125         case EFsLmListMediumLineX2T4G4G4:
       
   126         case EFsLmListMediumLineX2T3G3G1:
       
   127         case EFsLmListMediumLineG2G1:
       
   128         case EFsLmListMediumLineG3G1:          
       
   129         case EFsLmListMediumLineT2G1:
       
   130             rect.LayoutRect( aParent,
       
   131                 AknLayoutScalable_Apps::list_single_dyc_row_pane_g1( aVariety ).LayoutLine() );
       
   132             break;        
       
   133         case EFsLmListMediumLineG3G2:
       
   134         case EFsLmListMediumLineT2G3G2:
       
   135         case EFsLmListMediumLineT3G3G2:
       
   136         case EFsLmListMediumLineX2T3G4G2:
       
   137         case EFsLmListMediumLineRightIconx2G1:
       
   138         case EFsLmListMediumLineT2RightIconx2G1:
       
   139         case EFsLmListMediumLineT3RightIconx2G1:
       
   140             rect.LayoutRect( aParent,
       
   141                 AknLayoutScalable_Apps::list_single_dyc_row_pane_g3( aVariety ).LayoutLine() );
       
   142             break;
       
   143         case EFsLmListMediumLineG2G2:
       
   144         case EFsLmListMediumLineT2G2G2:
       
   145         case EFsLmListMediumLineT3G2G2:
       
   146         case EFsLmListMediumLineX2T3G3G2:
       
   147         case EFsLmListMediumLineRightIconG1:
       
   148         case EFsLmListMediumLineT2RightIconG1:
       
   149         case EFsLmListMediumLineRightIconx2G2:
       
   150         case EFsLmListMediumLineT2RightIconx2G2:
       
   151         case EFsLmListMediumLineT3RightIconx2G2:
       
   152         case EFsLmListMediumLineG3G3:
       
   153         case EFsLmListMediumLineT2G3G3:
       
   154         case EFsLmListMediumLineT3G3G3:
       
   155         case EFsLmListMediumLineX2T3G4G3:
       
   156             rect.LayoutRect( aParent,
       
   157                 AknLayoutScalable_Apps::list_single_dyc_row_pane_g4( aVariety ).LayoutLine() );
       
   158             break;         
       
   159         case EFsLmListMediumLineX2:
       
   160             rect.LayoutRect( aParent,
       
   161                 AknLayoutScalable_Apps::list_single_fs_dyc_pane(1).LayoutLine() );
       
   162             break;
       
   163         case EFsLmListMediumLineX3:
       
   164             rect.LayoutRect( aParent,
       
   165                 AknLayoutScalable_Apps::list_single_fs_dyc_pane(2).LayoutLine() );
       
   166             break;
       
   167         case EFsLmFolderListMediumLineG1: // Values for folderlist
       
   168 		    rect.LayoutRect( aParent, AknLayoutScalable_Avkon::list_single_large_graphic_pane_g1( aVariety ).LayoutLine() );		      
       
   169             break;
       
   170         case EFsLmListSingleDycRowPane:
       
   171             rect.LayoutRect( aParent,
       
   172                 AknLayoutScalable_Apps::list_single_dyc_row_pane( aVariety, 0, aRow ).LayoutLine() );
       
   173             break;
       
   174         case EFsLmListSingleDycRowPaneG1:
       
   175             rect.LayoutRect( aParent,
       
   176                 AknLayoutScalable_Apps::list_single_dyc_row_pane_g1( aVariety ).LayoutLine() );
       
   177             break;
       
   178         case EFsLmListSingleDycRowPaneG2:
       
   179             rect.LayoutRect( aParent,
       
   180                 AknLayoutScalable_Apps::list_single_dyc_row_pane_g2( aVariety ).LayoutLine() );
       
   181             break;
       
   182         case EFsLmListSingleDycRowPaneG3:
       
   183             rect.LayoutRect( aParent,
       
   184                 AknLayoutScalable_Apps::list_single_dyc_row_pane_g3( aVariety ).LayoutLine() );
       
   185             break;
       
   186         case EFsLmListSingleDycRowPaneG4:
       
   187             rect.LayoutRect( aParent,
       
   188                 AknLayoutScalable_Apps::list_single_dyc_row_pane_g4( aVariety ).LayoutLine() );
       
   189             break;
       
   190         case EFsLmListSingleDycRowTextPane:
       
   191             rect.LayoutRect( aParent,
       
   192                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane( aVariety ).LayoutLine() );
       
   193             break;
       
   194         case EFsLmListSingleFsDycPane:
       
   195             rect.LayoutRect( aParent,
       
   196                 AknLayoutScalable_Apps::list_single_fs_dyc_pane( aVariety ).LayoutLine() );
       
   197             break;
       
   198         case EFsLmMainPane:
       
   199             rect.LayoutRect( aParent,
       
   200                 AknLayoutScalable_Apps::main_pane( aVariety ).LayoutLine() );
       
   201             break;
       
   202         case EFsLmMainSpFsCtrlbarButtonPaneCp01:
       
   203             rect.LayoutRect( aParent,
       
   204                 AknLayoutScalable_Apps::main_sp_fs_ctrlbar_button_pane_cp01().LayoutLine() );
       
   205             break;
       
   206         case EFsLmMainSpFsCtrlbarDdmenuPane:
       
   207             rect.LayoutRect( aParent,
       
   208                 AknLayoutScalable_Apps::main_sp_fs_ctrlbar_ddmenu_pane().LayoutLine() );
       
   209             break;
       
   210         case EFsLmMainSpFsCtrlbarDdmenuPaneG1:
       
   211             rect.LayoutRect( aParent,
       
   212                 AknLayoutScalable_Apps::main_sp_fs_ctrlbar_ddmenu_pane_g1( aVariety ).LayoutLine() );
       
   213             break;
       
   214         case EFsLmMainSpFsCtrlbarDdmenuPaneG2:
       
   215             rect.LayoutRect( aParent,
       
   216                 AknLayoutScalable_Apps::main_sp_fs_ctrlbar_ddmenu_pane_g2( aVariety ).LayoutLine() );
       
   217             break;
       
   218         case EFsLmMainSpFsCtrlbarPane:
       
   219             {
       
   220             const TInt variety( Layout_Meta_Data::IsPenEnabled() ? 2 : 0 );
       
   221             rect.LayoutRect( aParent,
       
   222                 AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane( variety ).LayoutLine() );
       
   223             }
       
   224             break;
       
   225         case EFsLmMainSpFsCtrlbarPaneG1:
       
   226             rect.LayoutRect( aParent,
       
   227                 AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g1().LayoutLine() );
       
   228             break;
       
   229         case EFsLmMainSpFsCtrlbarPaneG2:
       
   230             rect.LayoutRect( aParent,
       
   231                 AknLayoutScalable_Apps::main_sp_fs_ctrlbar_pane_g2().LayoutLine() );
       
   232             break;
       
   233         case EFsLmMainSpFsListscrollPaneTe:
       
   234             rect.LayoutRect( aParent,
       
   235                 AknLayoutScalable_Apps::main_sp_fs_listscroll_pane_te().LayoutLine() );
       
   236             break;
       
   237         case EFsLmPopupSpFsActionMenuPane:
       
   238             rect.LayoutRect( aParent,
       
   239                 AknLayoutScalable_Apps::popup_sp_fs_action_menu_pane( aVariety ).LayoutLine() );
       
   240             break;
       
   241         case EFsLmMainSpFsListPane:
       
   242 		    rect.LayoutRect( aParent, AknLayoutScalable_Avkon::list_gen_pane( aVariety ).LayoutLine() );
       
   243             break;
       
   244         case EFsLmSpFsScrollPane:
       
   245 		    rect.LayoutRect( aParent, AknLayoutScalable_Avkon::scroll_pane( aVariety ).LayoutLine() );
       
   246             break;
       
   247         case EFsLmSpFsActionMenuListGenePaneG1:
       
   248             rect.LayoutRect( aParent,
       
   249                 AknLayoutScalable_Apps::sp_fs_action_menu_list_gene_pane_g1( aVariety ).LayoutLine() );
       
   250             break;
       
   251 
       
   252         case ECmailDdmenuBtn01Pane:
       
   253             rect.LayoutRect( aParent,
       
   254                 AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane( aVariety ).LayoutLine() );
       
   255             break;
       
   256             
       
   257         case ECmailDdmenuBtn01PaneG1:
       
   258             rect.LayoutRect( aParent,
       
   259                 AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane_g1( aVariety ).LayoutLine() );
       
   260             break;
       
   261                        
       
   262         case ECmailDdmenuBtn01PaneG2:
       
   263             rect.LayoutRect( aParent,
       
   264                 AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane_g2( aVariety ).LayoutLine() );
       
   265             break;
       
   266             
       
   267         case ECmailDdmenuBtn01PaneCP:
       
   268             rect.LayoutRect( aParent,
       
   269                 AknLayoutScalable_Apps::bg_button_pane_cp028( aVariety ).LayoutLine() );
       
   270             break;
       
   271                        
       
   272         case ECmailDdmenuBtn02Pane:
       
   273             rect.LayoutRect( aParent,
       
   274                 AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane( aVariety ).LayoutLine() );
       
   275             break;
       
   276             
       
   277         case ECmailDdmenuBtn02PaneG1:
       
   278             rect.LayoutRect( aParent,
       
   279                 AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_g1( aVariety ).LayoutLine() );
       
   280             break;            
       
   281 
       
   282         case ECmailDdmenuBtn02PaneG2:
       
   283             rect.LayoutRect( aParent,
       
   284                 AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_g2( aVariety ).LayoutLine() );
       
   285             break;            
       
   286             
       
   287         case ECmailDdmenuBtn02PaneCP:
       
   288             rect.LayoutRect( aParent,
       
   289                 AknLayoutScalable_Apps::bg_button_pane_cp029( aVariety ).LayoutLine() );
       
   290             break;
       
   291                         
       
   292         case ECmailDdmenuBtn03Pane:
       
   293             rect.LayoutRect( aParent,
       
   294                 AknLayoutScalable_Apps::cmail_ddmenu_btn03_pane( aVariety ).LayoutLine() );
       
   295             break;
       
   296             
       
   297         case ECmailDdmenuBtn03PaneG1:
       
   298             rect.LayoutRect( aParent,
       
   299                 AknLayoutScalable_Apps::cmail_ddmenu_btn03_pane_g1( aVariety ).LayoutLine() );
       
   300             break;
       
   301             
       
   302         case ECmailDdmenuBtn03PaneCP:
       
   303             rect.LayoutRect( aParent,
       
   304                 AknLayoutScalable_Apps::bg_button_pane_cp031( aVariety ).LayoutLine() );
       
   305             break;          
       
   306             
       
   307         default:
       
   308             // This is error case
       
   309             retVal = EFalse;
       
   310             break;
       
   311         }
       
   312 
       
   313     if ( retVal )
       
   314         {
       
   315         aRect = rect.Rect();
       
   316         }
       
   317 
       
   318     return retVal;
       
   319     }
       
   320 
       
   321 
       
   322 // ---------------------------------------------------------------------------
       
   323 // This method returns size of rectangle for given layout component. Returns
       
   324 // EFalse for status pane descendants if requested layout component is not
       
   325 // available in current layout. For other components returns always ETrue
       
   326 // (returned size is from layout definition).
       
   327 // ---------------------------------------------------------------------------
       
   328 //
       
   329 EXPORT_C TBool CFsLayoutManager::LayoutMetricsSize(
       
   330     const TRect &aParent,
       
   331     TFsLayoutMetrics aParam,
       
   332     TSize& aSize,
       
   333     TInt aVariety,
       
   334     TInt aRow,
       
   335     TInt aCol )
       
   336 	{
       
   337     FUNC_LOG;
       
   338     TRect rect;
       
   339 	TBool retVal(
       
   340 	    LayoutMetricsRect( aParent, aParam, rect, aVariety, aRow, aCol ) );
       
   341 	aSize = rect.Size();
       
   342 	return retVal;
       
   343 	}
       
   344 
       
   345 
       
   346 // ---------------------------------------------------------------------------
       
   347 // This method returns position of top left corner for given layout component.
       
   348 // Returns EFalse for status pane descendants if requested layout component is
       
   349 // not available in current layout. For other components returns always ETrue
       
   350 // (returned position is from layout definition).
       
   351 // ---------------------------------------------------------------------------
       
   352 //
       
   353 EXPORT_C TBool CFsLayoutManager::LayoutMetricsPosition(
       
   354     const TRect &aParent,
       
   355     TFsLayoutMetrics aParam,
       
   356     TPoint& aPos,
       
   357     TInt aVariety,
       
   358     TInt aRow,
       
   359     TInt aCol )
       
   360 	{
       
   361     FUNC_LOG;
       
   362 	TRect rect;
       
   363 	TBool retVal(
       
   364 	    LayoutMetricsRect( aParent, aParam, rect, aVariety, aRow, aCol ) );
       
   365 	aPos = rect.iTl;
       
   366 	return retVal;
       
   367 	}
       
   368 
       
   369 // ---------------------------------------------------------------------------
       
   370 // This method returns text position and font information of given layout
       
   371 // component. Returns EFalse for status pane descendants if requested layout
       
   372 // component is not available in current layout. For other components returns
       
   373 // always ETrue (returned position is from layout definition).
       
   374 // ---------------------------------------------------------------------------
       
   375 //
       
   376 /*
       
   377 TRect ListSingleDycRow( const TRect& aParent, TInt aRows, TInt aRow )
       
   378     {
       
   379     TAknLayoutRect layoutRect;
       
   380     layoutRect.LayoutRect(aParent, AknLayoutScalable_Apps::list_single_dyc_row_pane(aRows - 1, 0, aRow - 1).LayoutLine());
       
   381     return layoutRect.Rect();
       
   382     }*/
       
   383 
       
   384 // ---------------------------------------------------------------------------
       
   385 // This method returns text position and font information of given layout
       
   386 // component. Returns EFalse for status pane descendants if requested layout
       
   387 // component is not available in current layout. For other components returns
       
   388 // always ETrue (returned position is from layout definition).
       
   389 // ---------------------------------------------------------------------------
       
   390 //
       
   391 EXPORT_C TBool CFsLayoutManager::LayoutMetricsText(
       
   392     const TRect &aParent,
       
   393     TFsLayoutMetrics aParam,
       
   394     TFsText& aText,
       
   395     TInt aVariety,
       
   396     TInt /*aRow*/ )
       
   397     {
       
   398     FUNC_LOG;
       
   399 
       
   400     TBool retVal( ETrue );
       
   401     TAknLayoutText textLayout;
       
   402     
       
   403     switch ( aParam )
       
   404         {
       
   405 
       
   406         case EFsLmListMediumLineG2T1:
       
   407             textLayout.LayoutText( aParent,
       
   408                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 22 ).LayoutLine() );
       
   409             break;
       
   410         case EFsLmListMediumLineT2RightIconT1:
       
   411             textLayout.LayoutText( aParent,
       
   412                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 25 ).LayoutLine() );
       
   413             break;
       
   414         case EFsLmListMediumLineT2RightIconT2:
       
   415             textLayout.LayoutText( aParent,
       
   416                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t2( 16 ).LayoutLine() );
       
   417             break;
       
   418         case EFsLmListMediumLineX2T3G3T1:
       
   419             textLayout.LayoutText( aParent,
       
   420                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 13 ).LayoutLine() );
       
   421             break;
       
   422         case EFsLmListMediumLineX2T3G3T2:
       
   423             textLayout.LayoutText( aParent,
       
   424                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t2( 4 ).LayoutLine() );
       
   425             break;
       
   426         case EFsLmListMediumLineX2T3G2T1:
       
   427             textLayout.LayoutText( aParent,
       
   428                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 23 ).LayoutLine() );
       
   429             break;
       
   430         case EFsLmListMediumLineX2T3G2T2:
       
   431             textLayout.LayoutText( aParent,
       
   432                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t2( 14 ).LayoutLine() );
       
   433             break;            
       
   434         case EFsLmListMediumLineX2T2G4T1:
       
   435             textLayout.LayoutText( aParent,
       
   436                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 3 ).LayoutLine() );
       
   437            break;                       
       
   438         case EFsLmListMediumLineX2T2G3T1:
       
   439             textLayout.LayoutText( aParent,
       
   440                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 2 ).LayoutLine() );
       
   441             break;            
       
   442         case EFsLmListMediumLineX2T2G2T1:
       
   443         case EFsLmListMediumLineT4G4T3:
       
   444         case EFsLmListMediumLineX3T4G4T3:
       
   445             textLayout.LayoutText( aParent,
       
   446                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 5 ).LayoutLine() );
       
   447             break;           
       
   448         case EFsLmListMediumLineX2T3T3:
       
   449             textLayout.LayoutText( aParent,
       
   450                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 8 ).LayoutLine() );
       
   451             break;
       
   452         case EFsLmListMediumLineX3T4G4T2:
       
   453             textLayout.LayoutText( aParent,
       
   454                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t2( 13 ).LayoutLine() );
       
   455             break;
       
   456         case EFsLmListMediumLineX3T4G4T4:
       
   457             textLayout.LayoutText( aParent,
       
   458                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 7 ).LayoutLine() );
       
   459             break;
       
   460         case EFsLmListMediumLineRightIconx2T1:
       
   461             textLayout.LayoutText( aParent,
       
   462                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 6 ).LayoutLine() );
       
   463             break;
       
   464         case EFsLmListMediumLineG3T1:
       
   465             textLayout.LayoutText( aParent,
       
   466                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 3 ).LayoutLine() );
       
   467             break;
       
   468         case EFsLmListMediumLinePlainT1:
       
   469             textLayout.LayoutText( aParent,
       
   470                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 8 ).LayoutLine() );
       
   471             break;
       
   472         case EFsLmListMediumLineT3T1:
       
   473             textLayout.LayoutText( aParent,
       
   474                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 35 ).LayoutLine() );
       
   475             break;
       
   476         case EFsLmListMediumLineRightIconT1:
       
   477             textLayout.LayoutText( aParent,
       
   478                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 7 ).LayoutLine() );
       
   479             break;           
       
   480         case EFsLmListMediumLineT1:
       
   481             textLayout.LayoutText( aParent,
       
   482                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( 5 ).LayoutLine() );
       
   483             break;      
       
   484         case EFsLmFolderListMediumLineT1: // Values for folderlist
       
   485 		    textLayout.LayoutText( aParent, AknLayoutScalable_Avkon::list_single_large_graphic_pane_t1( aVariety ).LayoutLine() );		      		                
       
   486             break;
       
   487         case EFsLmMainSpFsCtrlbarDdmenuPaneT1:
       
   488             textLayout.LayoutText( aParent,
       
   489                 AknLayoutScalable_Apps::main_sp_fs_ctrlbar_ddmenu_pane_t1( aVariety ).LayoutLine() );
       
   490             break;
       
   491         case EFsLmListSingleDycRowTextPaneT1:
       
   492             textLayout.LayoutText( aParent,
       
   493                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t1( aVariety ).LayoutLine() );
       
   494             break;
       
   495         case EFsLmListSingleDycRowTextPaneT2:
       
   496             textLayout.LayoutText( aParent,
       
   497                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t2( aVariety ).LayoutLine() );
       
   498             break;
       
   499         case EFsLmListSingleDycRowTextPaneT3:
       
   500             textLayout.LayoutText( aParent,
       
   501                 AknLayoutScalable_Apps::list_single_dyc_row_text_pane_t3( aVariety ).LayoutLine() );
       
   502             break;
       
   503         case EFsLmSpFsActionMenuListGenePaneT1:
       
   504             textLayout.LayoutText( aParent,
       
   505                 AknLayoutScalable_Apps::sp_fs_action_menu_list_gene_pane_t1( aVariety ).LayoutLine() );
       
   506             break;
       
   507 
       
   508         case ECmailDdmenuBtn01PaneT1:
       
   509             textLayout.LayoutText( aParent,
       
   510                 AknLayoutScalable_Apps::cmail_ddmenu_btn01_pane_t1( aVariety ).LayoutLine() );
       
   511             break;
       
   512 
       
   513         case ECmailDdmenuBtn02PaneT1:
       
   514             textLayout.LayoutText( aParent,
       
   515                 AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_t1( aVariety ).LayoutLine() );
       
   516             break;
       
   517 
       
   518         case ECmailDdmenuBtn02PaneT2:
       
   519             textLayout.LayoutText( aParent,
       
   520                 AknLayoutScalable_Apps::cmail_ddmenu_btn02_pane_t2( aVariety ).LayoutLine() );
       
   521             break;
       
   522 
       
   523         case ECmailDdmenuBtn03PaneT1:
       
   524             textLayout.LayoutText( aParent,
       
   525                 AknLayoutScalable_Apps::cmail_ddmenu_btn03_pane_t1( aVariety ).LayoutLine() );
       
   526             break;
       
   527 
       
   528         default:
       
   529             retVal = EFalse;
       
   530             break;
       
   531         }
       
   532     
       
   533     if ( retVal )
       
   534         {
       
   535         aText.iTextRect = textLayout.TextRect();
       
   536         aText.iFont = textLayout.Font();
       
   537         //aText.iColor = textLayout.Color();
       
   538         const CAknLayoutFont* layoutFont(
       
   539             CAknLayoutFont::AsCAknLayoutFontOrNull( aText.iFont ) );
       
   540         //TInt textPaneHeight( 0 );
       
   541         TInt textPaneAscent( 0 );
       
   542         if ( layoutFont )
       
   543             {
       
   544             textPaneAscent = layoutFont->TextPaneTopToBaseline();
       
   545             }
       
   546         else
       
   547             {
       
   548             textPaneAscent = aText.iFont->AscentInPixels();
       
   549             }
       
   550         aText.iOffset = textPaneAscent;
       
   551         aText.iAlign = textLayout.Align();
       
   552         }
       
   553 
       
   554     return retVal;
       
   555     }
       
   556