mulwidgets/mulcoverflowwidget/src/mulcovertemplate1.cpp
changeset 17 3eca7e70b1b8
parent 3 4526337fb576
equal deleted inserted replaced
3:4526337fb576 17:3eca7e70b1b8
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Description of various grid templates
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // Class Header
       
    20 #include "mulcoverflowtemplate.h"
       
    21 
       
    22 // system includes
       
    23 #include <AknUtils.h>
       
    24 #include <alf/alfviewportlayout.h>
       
    25 #include <alf/alftextvisual.h> 
       
    26 #include <alf/alfutil.h>
       
    27 
       
    28 // Local includes
       
    29 #include "mulassert.h"
       
    30 #include "mulcoverflowcontrol.h"
       
    31 
       
    32 namespace Alf
       
    33     {
       
    34     
       
    35 // ---------------------------------------------------------------------------
       
    36 // MulCoverLogicalTemplate1
       
    37 // ---------------------------------------------------------------------------
       
    38 //  
       
    39 MulCoverFlowTemplate1::MulCoverFlowTemplate1(MulCoverFlowControl &aControl, 
       
    40         MulBaseElement &aBaseElement):MulCoverFlowTemplate(aControl, aBaseElement)
       
    41     {
       
    42     
       
    43     }
       
    44 
       
    45 // ---------------------------------------------------------------------------
       
    46 // ~MulCoverLogicalTemplate1
       
    47 // ---------------------------------------------------------------------------
       
    48 //  
       
    49 MulCoverFlowTemplate1::~MulCoverFlowTemplate1()
       
    50     {
       
    51     
       
    52     }
       
    53     
       
    54 // ---------------------------------------------------------------------------
       
    55 // GetIconSize
       
    56 // ---------------------------------------------------------------------------
       
    57 //      
       
    58 void MulCoverFlowTemplate1::GetIconSize(mulvisualitem::TVisualAttribute aAttribute,bool aIslandscape, int& aHeight, int& aWidth)
       
    59 	{
       
    60 	int appMainPaneVerityId;
       
    61 	int coverFlowPaneVarietyId;
       
    62 	int imagePaneVerityId ;
       
    63 	if (aIslandscape)
       
    64 		{
       
    65 		appMainPaneVerityId = 3; 
       
    66 		coverFlowPaneVarietyId = 2;
       
    67 		imagePaneVerityId = 4;
       
    68 		}
       
    69 	else
       
    70 		{
       
    71 		appMainPaneVerityId = 5; 
       
    72 		coverFlowPaneVarietyId = 0;
       
    73 		imagePaneVerityId = 0;
       
    74 		}
       
    75 
       
    76 	// Get  the size of the appwindow
       
    77 	TAknWindowLineLayout appMainLayout = 
       
    78 		AknLayoutScalable_UiAccel::main_pane(appMainPaneVerityId).LayoutLine();
       
    79 	TAknLayoutRect appMainRect;
       
    80 	appMainRect.LayoutRect(  AlfUtil::ScreenSize(), appMainLayout );
       
    81 	TSize appMainSize(appMainRect.Rect().Size());
       
    82 	
       
    83 	// Get the size of the coverflow main window
       
    84 	TAknWindowLineLayout mainLayout = 
       
    85 		AknLayoutScalable_UiAccel::main_aa_coverflow_pane(coverFlowPaneVarietyId).LayoutLine();
       
    86 	TAknLayoutRect mainRect;
       
    87 	mainRect.LayoutRect( appMainSize, mainLayout );
       
    88 	TSize mainSize(mainRect.Rect().Size());
       
    89 	
       
    90 	switch(aAttribute)
       
    91 		{
       
    92 		case mulvisualitem::KMulIcon1:
       
    93 			{
       
    94             TAknWindowLineLayout centerLayout = 
       
    95                 AknLayoutScalable_UiAccel::aacf_image_pane(imagePaneVerityId).LayoutLine();
       
    96             TAknLayoutRect centerRect;
       
    97             centerRect.LayoutRect( TSize(mainSize), centerLayout );
       
    98             aHeight = centerRect.Rect().Size().iHeight;
       
    99             aWidth  = centerRect.Rect().Size().iWidth;
       
   100 			break;
       
   101 			}
       
   102 		default:
       
   103 			{
       
   104 			// invalid attribute
       
   105 			// raise exception.
       
   106 			__MUL_ASSERT(false,KInvalidAttribute);
       
   107 			
       
   108 			break;
       
   109 			}
       
   110 		}	
       
   111 	}
       
   112     
       
   113 
       
   114 // ---------------------------------------------------------------------------
       
   115 // CreateVisualisation
       
   116 // ---------------------------------------------------------------------------
       
   117 //      
       
   118 void MulCoverFlowTemplate1::CreateVisualisation(bool aIsLandscape,bool aIsOrientationChange)
       
   119 	{
       
   120 	mData->mOrientationChange = aIsOrientationChange;	
       
   121 	
       
   122 	// set the default attribue of the template
       
   123 	// irrespective of the orientation
       
   124     mData->mUiOnOffFlag = false;
       
   125 	mData->mMaxVisibleCount = 3;
       
   126 	mData->mEnhancedSupportFlag = false;
       
   127 	
       
   128     // store the default attribute in base element
       
   129     mData->mBaseElement->SetFitMode(false);
       
   130 	
       
   131 	if (aIsLandscape)
       
   132 		{
       
   133 		// create visualisation for landscape
       
   134 		CreateLscStructure();
       
   135 		}
       
   136 	else
       
   137 		{
       
   138 		// create visualisation for potrait
       
   139 		CreatePrtStructure();
       
   140 		}
       
   141 	mData->mOrientationChange = false;		
       
   142 	}
       
   143 	
       
   144 // ---------------------------------------------------------------------------
       
   145 // CreatePrtStructure
       
   146 // ---------------------------------------------------------------------------
       
   147 //      	
       
   148 void MulCoverFlowTemplate1::CreatePrtStructure()
       
   149 	{
       
   150 	// list of all component lct verity id.
       
   151 	int mainPaneVerityId = 0;
       
   152 	int imagePaneCenterVerityId = 0;
       
   153 	int counterPaneVerityId = 0;
       
   154 	
       
   155 	CAlfVisual* main = mData->mBaseElement->findVisual(KMainLayoutIndex);        
       
   156 	CAlfLayout* parentLayout = main->Layout();
       
   157 	TSize mainSize = parentLayout->Size().Target().AsSize();
       
   158 	
       
   159 	// get for main layout
       
   160 	TAknWindowLineLayout componentLayout = 
       
   161 		AknLayoutScalable_UiAccel::main_aa_coverflow_pane(mainPaneVerityId).LayoutLine();
       
   162 	TRect mainRect = IconWindowRect(componentLayout, mainSize);
       
   163 	main->SetPos(TAlfRealPoint(0,0));
       
   164 	main->SetSize(mainRect.Size());
       
   165 	
       
   166 	
       
   167 	// for deck layout
       
   168 	CAlfDeckLayout& deckLayout = static_cast<CAlfDeckLayout&>(
       
   169 	        static_cast<CAlfLayout*>(main)->Visual(KMainLayoutIndex) );
       
   170 	deckLayout.SetSize(mainRect.Size(),0);
       
   171 	
       
   172 	// if set background with some skin id is called before calling set model
       
   173 	// then the visual and texture would be created with 0,0 sizes
       
   174 	// hence we need to resize them                
       
   175 	CAlfVisual* backgroundVisual = deckLayout.FindTag(backgroundvisual);
       
   176 	if(backgroundVisual)
       
   177 	   {
       
   178 	   backgroundVisual->SetSize(mainRect.Size(),0);              
       
   179 	   }
       
   180 
       
   181 	// for center item	  
       
   182     componentLayout = 
       
   183         AknLayoutScalable_UiAccel::aacf_image_pane(imagePaneCenterVerityId).LayoutLine();
       
   184 	TRect centerRect = IconWindowRect(componentLayout,mainRect);          
       
   185 	
       
   186 	TMulCoverFlowItem highlightItem(centerRect.iTl.iX,
       
   187 		centerRect.iTl.iY,centerRect.Size().iWidth,centerRect.Size().iHeight);
       
   188 
       
   189 	// apply attribute
       
   190     mData->mBaseElement->StoreVisualDimensions(highlightItem,highlightItem,1);
       
   191 	 
       
   192     ApplyCounterAttribute(counterPaneVerityId,mainRect);
       
   193 	ApplyTextAttribute(mainRect);
       
   194     
       
   195     // set the status of the slider
       
   196     mData->mSliderEnabled = true;
       
   197 	ApplySliderAttribute(mainRect);	
       
   198 	}
       
   199 
       
   200 // ---------------------------------------------------------------------------
       
   201 // CreateLscStructure
       
   202 // ---------------------------------------------------------------------------
       
   203 //      	
       
   204 void MulCoverFlowTemplate1::CreateLscStructure()
       
   205 	{
       
   206 	// list of all component lct verity id.
       
   207 	int mainPaneVerityId = 2;
       
   208 	int imagePaneCenterVerityId = 4;
       
   209 	int imagePaneRightVerityId = 3;	
       
   210 	int counterPaneVerityId = 4;
       
   211 	
       
   212 	CAlfVisual* main = mData->mBaseElement->findVisual(KMainLayoutIndex);        
       
   213 	CAlfLayout* parentLayout = main->Layout();
       
   214 	TSize mainSize = parentLayout->Size().Target().AsSize();
       
   215 	
       
   216 	// get for main layout
       
   217 	TAknWindowLineLayout componentLayout = 
       
   218 		AknLayoutScalable_UiAccel::main_aa_coverflow_pane(mainPaneVerityId).LayoutLine();
       
   219 	TRect mainRect = IconWindowRect(componentLayout, mainSize);
       
   220 	main->SetPos(TAlfRealPoint(0,0));
       
   221 	main->SetSize(mainRect.Size());
       
   222 	
       
   223 	
       
   224 	// for deck layout
       
   225 	CAlfDeckLayout& deckLayout = static_cast<CAlfDeckLayout&>(
       
   226 	        static_cast<CAlfLayout*>(main)->Visual(KMainLayoutIndex) );
       
   227 	deckLayout.SetSize(mainRect.Size(),0);
       
   228 	
       
   229 	// if set background with some skin id is called before calling set model
       
   230 	// then the visual and texture would be created with 0,0 sizes
       
   231 	// hence we need to resize them                
       
   232 	CAlfVisual* backgroundVisual = deckLayout.FindTag(backgroundvisual);
       
   233 	if(backgroundVisual)
       
   234 	   {
       
   235 	   backgroundVisual->SetSize(mainRect.Size(),0);              
       
   236 	   }
       
   237 
       
   238 	// for center item	  
       
   239     componentLayout = 
       
   240         AknLayoutScalable_UiAccel::aacf_image_pane(imagePaneCenterVerityId).LayoutLine();
       
   241 	TRect centerRect = IconWindowRect(componentLayout,mainRect);          
       
   242 	
       
   243 	TMulCoverFlowItem highlightItem(centerRect.iTl.iX,
       
   244 		centerRect.iTl.iY,centerRect.Size().iWidth,centerRect.Size().iHeight);
       
   245 	
       
   246 	// for right item
       
   247     if (AknLayoutUtils::LayoutMirrored())
       
   248     	{
       
   249     	componentLayout =
       
   250         	AknLayoutScalable_UiAccel::aacf_image_pane_cp001(imagePaneRightVerityId).LayoutLine();
       
   251     	}
       
   252     else
       
   253     	{
       
   254     	componentLayout =
       
   255         	AknLayoutScalable_UiAccel::aacf_image_pane_cp002(imagePaneRightVerityId).LayoutLine();
       
   256     	}
       
   257 	TRect rightItemRect = IconWindowRect(componentLayout,mainRect);
       
   258 
       
   259 	TMulCoverFlowItem nonHighlightItem(rightItemRect.iTl.iX,
       
   260 		rightItemRect.iTl.iY,rightItemRect.Size().iHeight,rightItemRect.Size().iHeight);
       
   261 	
       
   262 	// apply attribute
       
   263     mData->mBaseElement->StoreVisualDimensions(highlightItem,nonHighlightItem,3);
       
   264 	 
       
   265     ApplyCounterAttribute(counterPaneVerityId,mainRect);
       
   266 	ApplyTextAttribute(mainRect);
       
   267     
       
   268     // set the status of the slider
       
   269     mData->mSliderEnabled = false;
       
   270 	}
       
   271 	
       
   272 // ---------------------------------------------------------------------------
       
   273 // ApplyCounterAttribute
       
   274 // ---------------------------------------------------------------------------
       
   275 //      		
       
   276 void MulCoverFlowTemplate1::ApplyCounterAttribute(int acounterPaneVerityId,const TRect& aMainRect)
       
   277 	{
       
   278 	TAknTextLineLayout counterComponentLayout = 
       
   279 		AknLayoutScalable_UiAccel::main_aa_coverflow_pane_t1(acounterPaneVerityId).LayoutLine();   
       
   280     	
       
   281     TRect counterRect = TextWindowRect(counterComponentLayout,aMainRect);
       
   282     TSize counterSize(counterRect.Size());
       
   283     mData->mCounterDimensions.posx = counterRect.iTl.iX;
       
   284     mData->mCounterDimensions.posy = counterRect.iTl.iY;
       
   285     mData->mCounterDimensions.width = counterSize.iWidth;
       
   286     mData->mCounterDimensions.height = counterSize.iHeight;
       
   287         
       
   288     // Set Properties to Counter Visual if we are creating.
       
   289     // no need to apply attribute for orientation change
       
   290     // as all are same.
       
   291     if(!mData->mOrientationChange)
       
   292 	    {
       
   293 	    // Create a Counter visual if it is not Created.
       
   294 	    CAlfTextVisual& counterVisual = mData->mBaseElement->CounterVisual();
       
   295 	    
       
   296 	    //get font Id for counter
       
   297 	    int fontId = counterComponentLayout.FontId();
       
   298 	    int counterFontId = 0x000000FF &  fontId;	    
       
   299 		// apply default attribute
       
   300 		counterVisual.SetAlign(EAlfAlignHCenter,EAlfAlignVCenter);
       
   301 	    SetTextStyle(counterFontId, counterVisual); 
       
   302 	    
       
   303 		// check if user has set some different attribute.
       
   304 		TMulVisualColorProperty counterColor = mData->mBaseElement->TextColor(ECounterVisual);
       
   305 		if (counterColor.mIsColorSet)
       
   306 			{
       
   307 			// apply the color set by the application
       
   308 			counterVisual.SetColor(counterColor.mColor);
       
   309 			}
       
   310 		else
       
   311 			{
       
   312 			// apply the default color
       
   313 			counterVisual.SetColor(KRgbWhite);
       
   314 			}
       
   315 		mData->mCounterFontMaxCharLength = UpdateMaxFontWidth(&counterVisual);			
       
   316 	    }
       
   317 	}
       
   318 
       
   319 // ---------------------------------------------------------------------------
       
   320 // ApplyTextAttribute
       
   321 // ---------------------------------------------------------------------------
       
   322 //      		
       
   323 void MulCoverFlowTemplate1::ApplyTextAttribute(const TRect& aMainRect)
       
   324 	{
       
   325 	// list of all component lct verity id.	
       
   326 	int textPaneVerityId ;
       
   327 	int textPaneBgVerityId ;
       
   328 	int textPaneTitleVerityId ;	
       
   329 	int textPaneDetailVerityId ;
       
   330 	float bgTextOpacity;
       
   331 	
       
   332 	if (mData->mControl->IsLandscape())
       
   333 		{
       
   334 		textPaneVerityId = 3;
       
   335 		textPaneBgVerityId = 0;
       
   336 		textPaneTitleVerityId = 0;
       
   337 		textPaneDetailVerityId = 0;
       
   338 		bgTextOpacity = 0.5;
       
   339 		}
       
   340 	else
       
   341 		{
       
   342 		textPaneVerityId = 0;
       
   343 		textPaneBgVerityId = 0;
       
   344 		textPaneTitleVerityId = 0;
       
   345 		textPaneDetailVerityId = 0;
       
   346 		bgTextOpacity = 0;
       
   347 		}
       
   348 	
       
   349 	// set text visibility 
       
   350 	mData->mBaseElement->StoreTextVisibility( true );	
       
   351 	
       
   352 	// Create and apply attribute for text visual.
       
   353 	 
       
   354     CAlfLayout& textLayout = mData->mBaseElement->TextLayout();
       
   355     
       
   356     // for parent text layout
       
   357 	TAknWindowLineLayout windowLineLayout = 
       
   358         AknLayoutScalable_UiAccel::aacf_image_title_pane(textPaneVerityId).LayoutLine();
       
   359     TRect textRect = IconWindowRect(windowLineLayout, aMainRect);
       
   360     TRect textLayoutRect = TRect(0,0,textRect.Width(),textRect.Height());
       
   361     
       
   362     // set the position of parent text layout.     
       
   363     textLayout.SetPos(textRect.iTl);
       
   364     textLayout.SetSize(textRect.Size()); 
       
   365     
       
   366     // for the background visual
       
   367     CAlfTextVisual* bkgTextVisual = static_cast<CAlfTextVisual*>(
       
   368             textLayout.FindTag(KLitMulBackGround));
       
   369     if(!bkgTextVisual)
       
   370         {
       
   371         bkgTextVisual = CAlfTextVisual::AddNewL(*mData->mControl,  &textLayout); 
       
   372         bkgTextVisual->SetTagL(KLitMulBackGround);
       
   373         bkgTextVisual->SetFlag(EAlfVisualFlagIgnorePointer);                
       
   374         }
       
   375     windowLineLayout = 
       
   376       AknLayoutScalable_UiAccel::aacf_image_title_pane_g1(textPaneBgVerityId).LayoutLine();
       
   377     TRect bkgRect = IconWindowRect(windowLineLayout , textLayoutRect);
       
   378     bkgTextVisual->SetSize(bkgRect.Size());
       
   379     bkgTextVisual->SetPos(bkgRect.iTl);
       
   380     
       
   381     ApplyBrush(*bkgTextVisual,KRgbBlack,bgTextOpacity);
       
   382     
       
   383     ApplyTitleTextAttribute(textPaneTitleVerityId,textLayoutRect);
       
   384     ApplyDetailTextAttribute(textPaneDetailVerityId,textLayoutRect);
       
   385     
       
   386 	}
       
   387 
       
   388 // ---------------------------------------------------------------------------
       
   389 // ApplyTitleTextAttribute
       
   390 // ---------------------------------------------------------------------------
       
   391 //      		
       
   392 void MulCoverFlowTemplate1::ApplyTitleTextAttribute(int atextPaneTitleVerityId,const TRect& aTextLayoutRect)
       
   393 	{
       
   394 		
       
   395     // get the main text layout
       
   396     CAlfLayout& textLayout = mData->mBaseElement->TextLayout();	
       
   397     
       
   398 	// for title visual
       
   399     CAlfViewportLayout *viewPortLayout =static_cast<CAlfViewportLayout*>(
       
   400             textLayout.FindTag(KTitleViewPortLayout));
       
   401    if(viewPortLayout == NULL)
       
   402        {
       
   403        viewPortLayout = CAlfViewportLayout::AddNewL(*mData->mControl,
       
   404                &textLayout);
       
   405        viewPortLayout->SetTagL(KTitleViewPortLayout);    
       
   406        viewPortLayout->SetFlag(EAlfVisualFlagAutomaticLocaleMirroringEnabled);   
       
   407        viewPortLayout->SetFlag(EAlfVisualFlagIgnorePointer);                
       
   408        } 
       
   409    else
       
   410        {
       
   411        viewPortLayout = static_cast <CAlfViewportLayout*>(
       
   412               textLayout.FindTag(KTitleViewPortLayout));
       
   413        }
       
   414     TAknTextLineLayout textWindowLayout =
       
   415      AknLayoutScalable_UiAccel::aacf_image_title_pane_t1(atextPaneTitleVerityId).LayoutLine(); 
       
   416     TRect titleRect = TextWindowRect(textWindowLayout, aTextLayoutRect);
       
   417     mData->mTitleParentSize = titleRect.Size();
       
   418     viewPortLayout->SetSize(titleRect.Size());
       
   419     viewPortLayout->SetPos(titleRect.iTl); 
       
   420     viewPortLayout->SetViewportSize(TAlfRealSize(titleRect.Size()),0);           
       
   421     viewPortLayout->SetClipping(true);
       
   422     CAlfTextVisual* textVisual = static_cast<CAlfTextVisual*>(
       
   423     	&mData->mBaseElement->CreateTextVisual(KCoverflowTitle,*viewPortLayout)); 
       
   424               
       
   425    if(!mData->mOrientationChange) 
       
   426        {
       
   427 		//Get font ID
       
   428 		int fontId = textWindowLayout.FontId();
       
   429 		int textFontId = 0x000000FF &  fontId;
       
   430 		SetTextStyle(textFontId, *textVisual);
       
   431 		mData->mTitleFontMaxCharLength = UpdateMaxFontWidth(textVisual);
       
   432 		// Apply default attribute.
       
   433 		textVisual->SetAlign(EAlfAlignHLocale,EAlfAlignVCenter);
       
   434 		textVisual->SetOpacity(1);
       
   435        
       
   436 		// check if user has set some different attribute.
       
   437 		TMulVisualColorProperty textColor = mData->mBaseElement->TextColor(ETilteDetailTextVisual);
       
   438 		if (textColor.mIsColorSet)
       
   439 			{
       
   440 			// apply the color set by the application
       
   441 			textVisual->SetColor(textColor.mColor);
       
   442 			}
       
   443 		else
       
   444 			{
       
   445 			// apply the default color
       
   446 			textVisual->SetColor(KRgbWhite);
       
   447 			}
       
   448        }	
       
   449 	}
       
   450 
       
   451 // ---------------------------------------------------------------------------
       
   452 // ApplyDetailTextAttribute
       
   453 // ---------------------------------------------------------------------------
       
   454 //      		
       
   455 void MulCoverFlowTemplate1::ApplyDetailTextAttribute(int aTextPaneDetailVerityId,const TRect& aTextLayoutRect)
       
   456 	{	
       
   457     // get the main text layout
       
   458     CAlfLayout& textLayout = mData->mBaseElement->TextLayout();		
       
   459 	
       
   460     CAlfViewportLayout *viewPortLayout = NULL;
       
   461     CAlfTextVisual* textVisual = NULL;
       
   462     viewPortLayout =static_cast<CAlfViewportLayout*>(
       
   463             textLayout.FindTag(KDetailViewPortLayout));
       
   464    if(viewPortLayout == NULL)
       
   465        {
       
   466        viewPortLayout = CAlfViewportLayout::AddNewL(*mData->mControl,
       
   467                &textLayout);
       
   468        viewPortLayout->SetTagL(KDetailViewPortLayout);   
       
   469        viewPortLayout->SetFlag(EAlfVisualFlagAutomaticLocaleMirroringEnabled); 
       
   470        viewPortLayout->SetFlag(EAlfVisualFlagIgnorePointer);                               
       
   471        } 
       
   472    else
       
   473        {
       
   474        viewPortLayout = static_cast <CAlfViewportLayout*>(
       
   475               textLayout.FindTag(KDetailViewPortLayout));
       
   476        }
       
   477     TAknTextLineLayout textWindowLayout =
       
   478        AknLayoutScalable_UiAccel::aacf_image_title_pane_t2(aTextPaneDetailVerityId).LayoutLine(); 
       
   479     TRect detailRect = TextWindowRect(textWindowLayout, aTextLayoutRect);
       
   480     mData->mDetailParentSize = detailRect.Size();
       
   481     viewPortLayout->SetSize(detailRect.Size());
       
   482     viewPortLayout->SetPos(detailRect.iTl); 
       
   483     viewPortLayout->SetViewportSize(TAlfRealSize(detailRect.Size()),0);           
       
   484 
       
   485     viewPortLayout->SetClipping(true);
       
   486     textVisual = static_cast<CAlfTextVisual*>(
       
   487       &mData->mBaseElement->CreateTextVisual(KCoverflowDetail , *viewPortLayout )); 
       
   488    if(!mData->mOrientationChange) 
       
   489        {
       
   490        //Get font ID
       
   491        int fontId = textWindowLayout.FontId();
       
   492        int textFontId = 0x000000FF &  fontId;
       
   493        SetTextStyle(textFontId, *textVisual);
       
   494        mData->mDetailFontMaxCharLength = UpdateMaxFontWidth(textVisual);
       
   495        // Apply default attribute.
       
   496        textVisual->SetAlign(EAlfAlignHLocale,EAlfAlignVCenter);
       
   497        textVisual->SetOpacity(0.7);
       
   498        
       
   499 		// check if user has set some different attribute.
       
   500 		TMulVisualColorProperty textColor = mData->mBaseElement->TextColor(ETilteDetailTextVisual);
       
   501 		if (textColor.mIsColorSet)
       
   502 			{
       
   503 			// apply the color set by the application
       
   504 			textVisual->SetColor(textColor.mColor);
       
   505 			}
       
   506 		else
       
   507 			{
       
   508 			// apply the default color
       
   509 			textVisual->SetColor(KRgbWhite);
       
   510 			}
       
   511        }
       
   512 	
       
   513 	}
       
   514 
       
   515 // ---------------------------------------------------------------------------
       
   516 // ApplySliderAttribute
       
   517 // ---------------------------------------------------------------------------
       
   518 //      		
       
   519 void MulCoverFlowTemplate1::ApplySliderAttribute(const TRect& aMainRect)
       
   520 	{
       
   521     int sliderPaneVerityId = 1;
       
   522     
       
   523     TAknWindowLineLayout componentLayout =
       
   524         AknLayoutScalable_UiAccel::aacf_slider_pane(sliderPaneVerityId).LayoutLine();
       
   525     TRect sliderRect = IconWindowRect(componentLayout, aMainRect);
       
   526     TSize sliderSize(sliderRect.Size()); 
       
   527     mData->mSliderDimensions.height = sliderSize.iHeight;
       
   528     mData->mSliderDimensions.width = sliderSize.iWidth;
       
   529     mData->mSliderDimensions.posx = sliderRect.iTl.iX;
       
   530     mData->mSliderDimensions.posy = sliderRect.iTl.iY;
       
   531 	}
       
   532 	
       
   533     }//namespace ends