phonebookui/Phonebook2/ccapplication/ccacommlauncherplugin/src/ccappcommlaunchercustomlistboxdata.cpp
branchRCL_3
changeset 3 04ab22b956c2
parent 0 e686773b3f54
child 21 b3431bff8c19
equal deleted inserted replaced
0:e686773b3f54 3:04ab22b956c2
     9 * Initial Contributors:
     9 * Initial Contributors:
    10 * Nokia Corporation - initial contribution.
    10 * Nokia Corporation - initial contribution.
    11 *
    11 *
    12 * Contributors:
    12 * Contributors:
    13 *
    13 *
    14 * Description: 
    14 * Description: CCA customized control. Code has been modified to suit 
       
    15                CCA requirements. See CFormattedCellListBoxData
       
    16 *       	   in EIKCLBD.CPP. 
       
    17 *              Ensure that this piece of code is in sync with Avkon EIKFRLBD.CPP(CFormattedCellListBoxData)
    15 *
    18 *
    16 */
    19 */
    17 /*
    20 
    18  * ccappcommlaunchercustomlistboxdata.cpp
       
    19  *
       
    20  *  Created on: 2009-11-2
       
    21  *      Author: dev
       
    22  */
       
    23 /*
       
    24  * ============================================================================
       
    25  *  Name     : Eikfrlbd.cpp
       
    26  *  Part of  : Avkon
       
    27  *
       
    28  *  Description:
       
    29  *  Version:
       
    30  *
       
    31  *  Copyright � 2002-2009 Nokia Corporation.
       
    32  *  This material, including documentation and any related 
       
    33  *  computer programs, is protected by copyright controlled by 
       
    34  *  Nokia Corporation. All rights are reserved. Copying, 
       
    35  *  including reproducing, storing,  adapting or translating, any 
       
    36  *  or all of this material requires the prior written consent of 
       
    37  *  Nokia Corporation. This material also contains confidential 
       
    38  *  information which may not be disclosed to others without the 
       
    39  *  prior written consent of Nokia Corporation.
       
    40  * ============================================================================
       
    41  */
       
    42 
    21 
    43 #include <eikfrlbd.h>
    22 #include <eikfrlbd.h>
    44 #include <aknlists.h>
    23 #include <aknlists.h>
    45 #include <AknMarqueeControl.h>
    24 #include <AknMarqueeControl.h>
    46 #include <aknpictographinterface.h>
    25 #include <AknPictographInterface.h>
    47 #include <aknpictographdrawerinterface.h>
    26 #include <AknPictographDrawerInterface.h>
    48 #include <aknseffectanim.h>
    27 #include <AknsEffectAnim.h>
    49 #include <aknslistboxbackgroundcontrolcontext.h>
    28 #include <AknsListBoxBackgroundControlContext.h>
    50 #include <aknsframebackgroundcontrolcontext.h>
    29 #include <AknsFrameBackgroundControlContext.h>
    51 #include <aknpanic.h>
    30 #include <AknPanic.h>
    52 #include <aknbiditextutils.h>
    31 #include <AknBidiTextUtils.h>
    53 #include <centralrepository.h>
    32 #include <centralrepository.h>
    54 #include <avkoninternalcrkeys.h>
    33 #include <AvkonInternalCRKeys.h>
    55 #include <gulicon.h>
    34 #include <gulicon.h>
    56 #include <eikslbd.h>
    35 #include <eikslbd.h>
    57 //#include <akndebug.h>
    36 
    58 #include <aknlayoutscalable_avkon.cdl.h>
    37 #include <aknlayoutscalable_avkon.cdl.h>
    59 #include <layoutmetadata.cdl.h>
    38 #include <layoutmetadata.cdl.h>
    60 #include <aknphysics.h>
    39 #include <aknphysics.h>
    61 #include <AknUtils.h> 
    40 #include <AknUtils.h> 
    62 #include <AknFontId.h>
    41 #include <AknFontId.h>
    67 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
    46 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
    68 #include <aknlistloadertfx.h>
    47 #include <aknlistloadertfx.h>
    69 #include <aknlistboxtfxinternal.h>
    48 #include <aknlistboxtfxinternal.h>
    70 #endif //RD_UI_TRANSITION_EFFECTS_LIST
    49 #endif //RD_UI_TRANSITION_EFFECTS_LIST
    71 
    50 
    72 #ifdef RD_TACTILE_FEEDBACK
    51 
    73 #include <touchfeedback.h>
    52 #include <touchfeedback.h>
    74 #endif //RD_TACTILE_FEEDBACK
       
    75 // there are 17(!) subcells in qdial grid (0 ... 16)
    53 // there are 17(!) subcells in qdial grid (0 ... 16)
    76 const TInt KMaxSubCellIndex = 16 + 1;
    54 const TInt KMaxSubCellIndex = 16 + 1;
    77 
    55 
    78 // colored tick marks support
    56 // colored tick marks support
    79 const TInt KColorIconFlag = -1;
    57 const TInt KColorIconFlag = -1;
   990 	if (!cc)
   968 	if (!cc)
   991 		{
   969 		{
   992 		cc = SkinBackgroundContext();
   970 		cc = SkinBackgroundContext();
   993 		}
   971 		}
   994 
   972 
   995 	return AknsDrawUtils::DrawBackground(AknsUtils::SkinInstance(), cc,
   973     TBool ret = AknsDrawUtils::DrawBackground( AknsUtils::SkinInstance(), cc, iControl, aGc, TPoint(0,0),
   996 			iControl, aGc, TPoint(0, 0), itemRect,
   974                                           itemRect, KAknsDrawParamBottomLevelRGBOnly );
   997 			KAknsDrawParamBottomLevelRGBOnly);
   975     return ret;
   998 	}
   976 	}
   999 
   977 
  1000 // -----------------------------------------------------------------------------
   978 // -----------------------------------------------------------------------------
  1001 // CCCAppCommLauncherCustomListBoxDataExtension::PostDeleteAnimation
   979 // CCCAppCommLauncherCustomListBoxDataExtension::PostDeleteAnimation
  1002 // Schedules the animation for deletion by activating the extension itself.
   980 // Schedules the animation for deletion by activating the extension itself.
  1296 	}
  1274 	}
  1297 
  1275 
  1298  void CCCAppCommLauncherCustomListBoxData::SetSkinPopupFrame(
  1276  void CCCAppCommLauncherCustomListBoxData::SetSkinPopupFrame(
  1299 		const TAknsItemID *aFrameId, const TAknsItemID *aFrameCenterId)
  1277 		const TAknsItemID *aFrameId, const TAknsItemID *aFrameCenterId)
  1300 	{
  1278 	{
  1301 	if (iExtension && iExtension->iPopupFrame)
  1279     if ( iExtension )
  1302 		{
  1280         {
  1303 		iExtension->iPopupFrame->SetFrame(*aFrameId);
  1281         if ( iExtension->iPopupFrame )
  1304 		iExtension->iPopupFrame->SetCenter(*aFrameCenterId);
  1282 		    {
  1305 		}
  1283 		    iExtension->iPopupFrame->SetFrame(*aFrameId);
  1306 	else
  1284             iExtension->iPopupFrame->SetCenter(*aFrameCenterId);
  1307 		{
  1285 	    	}
  1308 		TRAPD(err, iExtension->iPopupFrame = CAknsFrameBackgroundControlContext::NewL(
  1286 	    else
       
  1287 	    	{
       
  1288 	        TRAPD(err, iExtension->iPopupFrame = CAknsFrameBackgroundControlContext::NewL(
  1309 						KAknsIIDNone,
  1289 						KAknsIIDNone,
  1310 						TRect(0,0,1,1), // these must be set by using SetSkinPopupFramePosition
  1290 						TRect(0,0,1,1), // these must be set by using SetSkinPopupFramePosition
  1311 						TRect(0,0,1,1),
  1291 						TRect(0,0,1,1),
  1312 						EFalse ) );
  1292 						EFalse ) );
  1313 		if (!err)
  1293             if (!err)
  1314 			{
  1294 			    {
  1315 			iExtension->iPopupFrame->SetFrame(*aFrameId);
  1295 			    iExtension->iPopupFrame->SetFrame(*aFrameId);
  1316 			iExtension->iPopupFrame->SetCenter(*aFrameCenterId);
  1296 			    iExtension->iPopupFrame->SetCenter(*aFrameCenterId);
       
  1297                 }
  1317 			}
  1298 			}
  1318 		}
  1299 		}
  1319 	}
  1300 	}
  1320 
  1301 
  1321  void CCCAppCommLauncherCustomListBoxData::SetSkinPopupFramePosition(
  1302  void CCCAppCommLauncherCustomListBoxData::SetSkinPopupFramePosition(
  1746 
  1727 
  1747  void CCCAppCommLauncherCustomListBoxData::DrawFormatted(
  1728  void CCCAppCommLauncherCustomListBoxData::DrawFormatted(
  1748 		TListItemProperties aProperties, CWindowGc& aGc, const TDesC* aText,
  1729 		TListItemProperties aProperties, CWindowGc& aGc, const TDesC* aText,
  1749 		const TRect& aItemRect, TBool aHighlight, const TColors& aColors) const
  1730 		const TRect& aItemRect, TBool aHighlight, const TColors& aColors) const
  1750 	{
  1731 	{
       
  1732     CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
       
  1733     if (!view->ViewRect().Intersects(aItemRect))
       
  1734         {
       
  1735         // outside of the clipping rect -> don't process this item
       
  1736         return;
       
  1737         }
  1751 	if (aHighlight)
  1738 	if (aHighlight)
  1752 		{
  1739 		{
  1753 		iExtension->iClippedSubcells = 0;
  1740 		iExtension->iClippedSubcells = 0;
  1754 		}
  1741 		}
  1755 
  1742 
  1756 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1743 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1757 	MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal(&aGc);
  1744     MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
  1758 	TBool effectsDisabled = ETrue;
  1745     if ( transApi )
  1759 
  1746         {
  1760 	if (transApi)
  1747         transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
  1761 		{
  1748         if(transApi->EffectsDisabled())
  1762 		transApi->StartDrawing(MAknListBoxTfxInternal::EListItem);
  1749             {
  1763 		effectsDisabled = transApi->EffectsDisabled();
  1750             aGc.SetClippingRect( view->ViewRect() );
  1764 
  1751             }
  1765 		if (effectsDisabled)
  1752         }
  1766 			{
       
  1767 			CListBoxView* view =
       
  1768 					static_cast<CEikListBox*> (iExtension->iControl)->View();
       
  1769 			aGc.SetClippingRect(view->ViewRect());
       
  1770 			}
       
  1771 		}
       
  1772 #else
  1753 #else
  1773 	CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1754 	CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1774 	aGc.SetClippingRect( view->ViewRect() );
  1755 	aGc.SetClippingRect( view->ViewRect() );
  1775 #endif //RD_UI_TRANSITION_EFFECTS_LIST
  1756 #endif //RD_UI_TRANSITION_EFFECTS_LIST
  1776 	if (UsesScalableLayoutData())
  1757 	if (UsesScalableLayoutData())
  1792 		}
  1773 		}
  1793 
  1774 
  1794 #ifdef RD_UI_TRANSITION_EFFECTS_LIST  
  1775 #ifdef RD_UI_TRANSITION_EFFECTS_LIST  
  1795 	if (transApi)
  1776 	if (transApi)
  1796 		{
  1777 		{
  1797 		if (effectsDisabled)
  1778         if(transApi->EffectsDisabled())
  1798 			{
  1779 			{
  1799 			aGc.CancelClippingRect();
  1780 			aGc.CancelClippingRect();
  1800 			}
  1781 			}
  1801 
  1782 
  1802 		transApi->StopDrawing();
  1783 		transApi->StopDrawing();
  1871 	TInt subcell = 0;
  1852 	TInt subcell = 0;
  1872 	TPtrC text;
  1853 	TPtrC text;
  1873 	TPtrC tempText;
  1854 	TPtrC tempText;
  1874 	TRect textShadowRect; // For transparent list
  1855 	TRect textShadowRect; // For transparent list
  1875 	TRgb textShadowColour = AKN_LAF_COLOR_STATIC(215); // Black shadow for item text.
  1856 	TRgb textShadowColour = AKN_LAF_COLOR_STATIC(215); // Black shadow for item text.
  1876 	MAknsControlContext *cc = AknsDrawUtils::ControlContext(Control());
  1857     MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
  1877 	TBool skinEnabled = AknsUtils::AvkonSkinEnabled();
  1858     if (!cc)
  1878 
  1859         {
  1879 	if (!cc)
  1860         cc = SkinBackgroundContext();
  1880 		{
  1861         }
  1881 		cc = SkinBackgroundContext();
  1862 
  1882 		}
  1863     TAknTextLineLayout textLines[KMaxSubCellIndex];
  1883 
  1864     TBool rectClipped[KMaxSubCellIndex];
  1884 	TAknTextLineLayout textLines[KMaxSubCellIndex];
  1865     
  1885 	TBool rectClipped[KMaxSubCellIndex];
  1866     Mem::FillZ( &rectClipped[0], KMaxSubCellIndex * sizeof( TBool ) );
  1886 
  1867     
  1887 	Mem::FillZ(&rectClipped[0], KMaxSubCellIndex * sizeof(TBool));
  1868     if ( iExtension->iSubCellsMightIntersect )
  1888 
  1869         {
  1889 	if (iExtension->iSubCellsMightIntersect)
  1870         CheckIfSubCellsIntersect( &textLines[0], &rectClipped[0], *aText, aItemRect );
  1890 		{
  1871         }
  1891 		CheckIfSubCellsIntersect(&textLines[0], &rectClipped[0], *aText,
       
  1892 				aItemRect);
       
  1893 		}
       
  1894 
  1872 
  1895 	TInt SCindex = 0;
  1873 	TInt SCindex = 0;
  1896 
  1874 
  1897 	// This loop does the drawing.    
  1875     // This loop does the drawing.    
  1898 	aGc.SetPenStyle(CGraphicsContext::ENullPen);
  1876     aGc.SetPenStyle(CGraphicsContext::ENullPen);
  1899 	subcell = 0;
  1877     subcell=0;
  1900 	FOREVER{
  1878     FOREVER
  1901 	if (subcell>lastSubCell)
  1879         {        
  1902 		{
  1880         if (subcell>lastSubCell)
  1903 		break;
  1881             {
  1904 		}
  1882             break;
  1905 
  1883             }
  1906 	TextUtils::ColumnText(text,subcell, aText);
  1884         
  1907 	if (text == KNullDesC)
  1885         TextUtils::ColumnText(text,subcell, aText);
  1908 		{
  1886         if (text == KNullDesC)
  1909 		// empty subcell, continue to draw next subcell
  1887             {
  1910 		++ subcell;
  1888             // empty subcell, continue to draw next subcell
  1911 		continue;
  1889             ++ subcell;
  1912 		}
  1890             continue;
  1913 	if (!iExtension) break;
  1891             }
  1914 	if (iExtension->FindSLSubCellIndex(SCindex,subcell)!=0) break;
  1892         if (!iExtension) break;
  1915 
  1893         if (iExtension->FindSLSubCellIndex(SCindex,subcell)!=0) break;
  1916 	if (UseSubCellColors(subcell))
  1894 
  1917 		{
  1895         if (UseSubCellColors(subcell))
  1918 		subcellColors = &SubCellColors(subcell);
  1896             {
  1919 		}
  1897             subcellColors = &SubCellColors(subcell);
  1920 	else
  1898             }
  1921 		{
  1899         else
  1922 		subcellColors = &aColors;
  1900             {
  1923 		}
  1901             subcellColors = &aColors;
  1924 
  1902             }
  1925 	TRgb color;
  1903             
  1926 
  1904         TRgb color;
  1927 	if (aHighlight)
  1905 
  1928 		{
  1906         if (aHighlight)
  1929 		color = subcellColors->iHighlightedText;
  1907             {
  1930 		aGc.SetBrushColor(subcellColors->iHighlightedBack);
  1908             color = subcellColors->iHighlightedText;
  1931 		if ( skinEnabled )
  1909             aGc.SetBrushColor(subcellColors->iHighlightedBack); 
  1932 			{
  1910             if ( AknsUtils::AvkonSkinEnabled() )
  1933 			if ( iExtension->iHighlightedTextColor != NULL )
  1911                 {
  1934 				{
  1912                 if ( iExtension->iHighlightedTextColor != NULL )
  1935 				color = iExtension->iHighlightedTextColor;
  1913                     {
  1936 				}
  1914                     color = iExtension->iHighlightedTextColor;
  1937 			}
  1915                     }
  1938 		}
  1916                 }
  1939 	else
  1917             }
  1940 		{
  1918         else
  1941 		color = subcellColors->iText;
  1919             {
  1942 		aGc.SetBrushColor(subcellColors->iBack);
  1920             color = subcellColors->iText;
  1943 		if ( skinEnabled )
  1921             aGc.SetBrushColor(subcellColors->iBack);
  1944 			{
  1922             if ( AknsUtils::AvkonSkinEnabled() )
  1945 			if ( iExtension->iTextColor != NULL )
  1923                 {
  1946 				{
  1924                 if ( iExtension->iTextColor != NULL )
  1947 				color = iExtension->iTextColor;
  1925                     {
  1948 				}
  1926                     color = iExtension->iTextColor;
  1949 			}
  1927                     }
  1950 		}
  1928                 }
  1951 
  1929             }
  1952 	// graphics or text column
  1930         
  1953 	if (iExtension->AtSL(SCindex).iSubCellType == CCCAppCommLauncherCustomListBoxDataExtension::EAknSLText)
  1931         // graphics or text column
  1954 		{
  1932         if (iExtension->AtSL(SCindex).iSubCellType == CCCAppCommLauncherCustomListBoxDataExtension::EAknSLText)
  1955 		const CFont* rowAndCellFont=RowAndSubCellFont(iExtension->iCurrentlyDrawnItemIndex,subcell);
  1933             {
  1956 		const CFont* cellFont=Font(aProperties, subcell);
  1934             const CFont* rowAndCellFont=RowAndSubCellFont(iExtension->iCurrentlyDrawnItemIndex,subcell);
  1957 		const CFont* tempFont=(cellFont) ? cellFont : NULL;
  1935             const CFont* cellFont=Font(aProperties, subcell);
  1958 		const CFont* usedFont=(rowAndCellFont) ? rowAndCellFont : tempFont;
  1936             const CFont* tempFont=(cellFont) ? cellFont : NULL;
  1959 
  1937             const CFont* usedFont=(rowAndCellFont) ? rowAndCellFont : tempFont;
  1960 		TAknTextLineLayout textLineLayout = NULL;
  1938             
  1961 
  1939             TAknTextLineLayout textLineLayout = NULL;
  1962 		if ( rectClipped[subcell] )
  1940 
  1963 			{
  1941             if ( rectClipped[subcell] )
  1964 			textLineLayout = textLines[subcell];
  1942                 {
  1965 			}
  1943                 textLineLayout = textLines[subcell];
  1966 		else
  1944                 }
  1967 			{
  1945             else
  1968 			// check if there are icons affecting this text layout
  1946                 {
  1969 			TInt gSC = iExtension->AtSL(SCindex).iConditionValue; // graphical subcell which might affect this text subcell
  1947                 // check if there are icons affecting this text layout
  1970 
  1948                 TInt gSC = iExtension->AtSL(SCindex).iConditionValue; // graphical subcell which might affect this text subcell
  1971 			if (gSC> -1)
  1949                 
  1972 				{
  1950                 if (gSC > -1)
  1973 				TInt tempIndex;
  1951                     {
  1974 				while (gSC> -1) // when gSC == -1, we have found our graphical subcell
  1952                     TInt tempIndex;
  1975 
  1953                     while (gSC > -1) // when gSC == -1, we have found our graphical subcell
  1976 					{
  1954                         {
  1977 					if (iExtension->FindSLSubCellIndex(tempIndex,gSC)!=0) break;
  1955                         if (iExtension->FindSLSubCellIndex(tempIndex,gSC)!=0) break;
  1978 					TextUtils::ColumnText(tempText,gSC, aText);
  1956                         TextUtils::ColumnText(tempText,gSC, aText);
  1979 					if (tempText != KNullDesC)
  1957                         if (tempText != KNullDesC)
  1980 						{
  1958                             {
  1981 						textLineLayout = iExtension->AtSL(tempIndex).iTextLayout;
  1959                             textLineLayout = iExtension->AtSL(tempIndex).iTextLayout;
  1982 						break;
  1960                             break;                      
  1983 						}
  1961                             }
  1984 					gSC = iExtension->AtSL(tempIndex).iConditionValue;
  1962                         gSC = iExtension->AtSL(tempIndex).iConditionValue;
  1985 					}
  1963                         }
  1986 				}
  1964                     }
  1987 
  1965                     
  1988 			if (gSC == -1) // no affecting icons -> use default layout
  1966                 if (gSC == -1) // no affecting icons -> use default layout
  1989 
  1967                     {
  1990 				{
  1968                     textLineLayout = iExtension->AtSL(SCindex).iTextLayout;
  1991 				textLineLayout = iExtension->AtSL(SCindex).iTextLayout;
  1969                     }
  1992 				}
  1970                 }
  1993 			}
  1971 
  1994 
  1972                       
  1995 		CGraphicsContext::TTextAlign align=SubCellAlignment(subcell); //gumq
  1973             CGraphicsContext::TTextAlign align=SubCellAlignment(subcell); //gumq
  1996 		TBool isLayoutAlignment = iExtension->SubCellLayoutAlignment(subcell); //gumq  
  1974             TBool isLayoutAlignment = iExtension->SubCellLayoutAlignment(subcell); //gumq  
  1997 		if( !isLayoutAlignment )
  1975             if( !isLayoutAlignment )
  1998 			{
  1976                 { 
  1999 			switch(align)
  1977                 switch(align) 
  2000 				{
  1978                     {
  2001 				case CGraphicsContext::ELeft :
  1979                     case CGraphicsContext::ELeft : 
  2002 					{
  1980                         {
  2003 					textLineLayout.iJ = ELayoutAlignLeft;
  1981                         textLineLayout.iJ = ELayoutAlignLeft;    
  2004 					}
  1982                         }
  2005 				break;
  1983                         break; 
  2006 				case CGraphicsContext::ECenter:
  1984                     case CGraphicsContext::ECenter: 
  2007 					{
  1985                         {
  2008 					textLineLayout.iJ = ELayoutAlignCenter;
  1986                         textLineLayout.iJ = ELayoutAlignCenter;
  2009 					}
  1987                         }
  2010 				break;
  1988                         break; 
  2011 				case CGraphicsContext::ERight:
  1989                     case CGraphicsContext::ERight:  
  2012 					{
  1990                         {
  2013 					textLineLayout.iJ = ELayoutAlignRight;
  1991                         textLineLayout.iJ = ELayoutAlignRight;
  2014 					}
  1992                         } 
  2015 				break;
  1993                         break; 
  2016 				default: break;
  1994                     default:  break;
  2017 				};
  1995                     }; 
  2018 			}
  1996                 }    
  2019 
  1997                 
  2020 		TAknLayoutText textLayout;
  1998             TAknLayoutText textLayout;
  2021 		textLayout.LayoutText(textRect, textLineLayout, usedFont);
  1999             textLayout.LayoutText(textRect, textLineLayout, usedFont);
  2022 
  2000 
  2023 		SetUnderlineStyle( aProperties, aGc, subcell );
  2001             SetUnderlineStyle( aProperties, aGc, subcell );
  2024 
  2002 
  2025 		// * 2 == leave some room for marquee
  2003             // * 2 == leave some room for marquee
  2026 		const TInt maxlen( KMaxColumnDataLength * 2 );
  2004             const TInt maxlen( KMaxColumnDataLength * 2 ); 
  2027 		TBuf<maxlen> convBuf = text.Left(maxlen);
  2005             TBuf<maxlen> convBuf = text.Left(maxlen);
  2028 
  2006 
  2029 		// Note that this potentially modifies the text so its lenght in pixels
  2007             // Note that this potentially modifies the text so its lenght in pixels
  2030 		// might increase. Therefore, this should always be done before
  2008             // might increase. Therefore, this should always be done before
  2031 		// wrapping/clipping text. In some cases, WordWrapListItem is called
  2009             // wrapping/clipping text. In some cases, WordWrapListItem is called
  2032 		// before coming here. Is it certain that it is not done for number subcells?
  2010             // before coming here. Is it certain that it is not done for number subcells?
  2033 
  2011 
  2034 		// Do number conversion if required.
  2012             // Do number conversion if required.
  2035 		if (SubCellIsNumberCell(subcell))
  2013             if (SubCellIsNumberCell(subcell))
  2036 			{
  2014                 {
  2037 			AknTextUtils::LanguageSpecificNumberConversion(convBuf);
  2015                 AknTextUtils::LanguageSpecificNumberConversion(convBuf);
  2038 			}
  2016                 }
  2039 
  2017 
  2040 		// Check whether logical to visual conversion should be done here or not.
  2018             // Check whether logical to visual conversion should be done here or not.
  2041 		TBool bidiConv =
  2019             TBool bidiConv =
  2042 		iExtension->iUseLogicalToVisualConversion &&
  2020                 iExtension->iUseLogicalToVisualConversion &&
  2043 		subcell != iExtension->iFirstWordWrappedSubcellIndex &&
  2021                 subcell != iExtension->iFirstWordWrappedSubcellIndex &&
  2044 		subcell != iExtension->iSecondWordWrappedSubcellIndex;
  2022                 subcell != iExtension->iSecondWordWrappedSubcellIndex;
  2045 
  2023 
  2046 		TBool doesNotFit( EFalse );
  2024             TBool doesNotFit( EFalse );
  2047 		if ( aHighlight )
  2025             if ( aHighlight )
  2048 			{
  2026                 {
  2049 			doesNotFit = usedFont->TextWidthInPixels( convBuf )> textLayout.TextRect().Width();
  2027                 doesNotFit = usedFont->TextWidthInPixels( convBuf ) > textLayout.TextRect().Width();
  2050 
  2028             
  2051 			if ( doesNotFit )
  2029                 if ( doesNotFit )
  2052 				{
  2030                     {
  2053 				iExtension->iClippedSubcells |= ( 1 << subcell );
  2031                     iExtension->iClippedSubcells |= ( 1 << subcell );
  2054 				}
  2032                     }
  2055 			else
  2033                 else 
  2056 				{
  2034                     {
  2057 				iExtension->iClippedSubcells &= ~( 1 << subcell );
  2035                     iExtension->iClippedSubcells &= ~( 1 << subcell );
  2058 				}
  2036                     }
  2059 
  2037 
  2060 			if ( iExtension->iUseClippedByWrap ) // override if already clipped
  2038 			if ( iExtension->iUseClippedByWrap ) // override if already clipped
  2061 
  2039 
  2062 				{
  2040 				{
  2063 				iExtension->iClippedSubcells = iExtension->iClippedByWrap;
  2041 				iExtension->iClippedSubcells = iExtension->iClippedByWrap;
  2552 		// What is under highlight may have changed -> we need to update
  2530 		// What is under highlight may have changed -> we need to update
  2553 		// highlight background to animation.
  2531 		// highlight background to animation.
  2554 		iExtension->iAnimFlags.Set(
  2532 		iExtension->iAnimFlags.Set(
  2555 				CCCAppCommLauncherCustomListBoxDataExtension::EFlagUpdateBg);
  2533 				CCCAppCommLauncherCustomListBoxDataExtension::EFlagUpdateBg);
  2556 		}
  2534 		}
  2557 	}
  2535     else if( ( aType == KEikMessageUnfadeWindows ) ||
  2558 
  2536              ( aType == KEikMessageFadeAllWindows ) )
       
  2537         {
       
  2538         if( iExtension->iMarquee )
       
  2539             {
       
  2540             iExtension->iMarquee->HandleResourceChange( aType );
       
  2541             }
       
  2542         if( iExtension->i2ndLineMarquee )
       
  2543             {
       
  2544             iExtension->i2ndLineMarquee->HandleResourceChange( aType );
       
  2545             }
       
  2546         }
       
  2547 	}
  2559 // -----------------------------------------------------------------------------
  2548 // -----------------------------------------------------------------------------
  2560 // CCCAppCommLauncherCustomListBoxData::HighlightAnim
  2549 // CCCAppCommLauncherCustomListBoxData::HighlightAnim
  2561 // -----------------------------------------------------------------------------
  2550 // -----------------------------------------------------------------------------
  2562 //
  2551 //
  2563  const CAknsEffectAnim* CCCAppCommLauncherCustomListBoxData::HighlightAnim() const
  2552  const CAknsEffectAnim* CCCAppCommLauncherCustomListBoxData::HighlightAnim() const
  2783 	}
  2772 	}
  2784 
  2773 
  2785  void CCCAppCommLauncherCustomListBoxData::SetSubCellIconSize(
  2774  void CCCAppCommLauncherCustomListBoxData::SetSubCellIconSize(
  2786 		TInt aIndex, TSize aSize)
  2775 		TInt aIndex, TSize aSize)
  2787 	{
  2776 	{
  2788 	if (iExtension && aIndex <= KMaxSubCellIndex && aIndex >= 0)
  2777     if ( iExtension && aIndex < KMaxSubCellIndex && aIndex >= 0 )
  2789 		{
  2778 		{
  2790 		iExtension->iSubCellIconSize[aIndex] = aSize;
  2779 		iExtension->iSubCellIconSize[aIndex] = aSize;
  2791 		}
  2780 		}
  2792 	}
  2781 	}
  2793 
  2782 
  2794 TSize CCCAppCommLauncherCustomListBoxData::GetSubCellIconSize(TInt aIndex)
  2783 TSize CCCAppCommLauncherCustomListBoxData::GetSubCellIconSize(TInt aIndex)
  2795 	{
  2784 	{
  2796 	if (iExtension && aIndex <= KMaxSubCellIndex && aIndex >= 0)
  2785     if ( iExtension && aIndex < KMaxSubCellIndex && aIndex >= 0 )
  2797 		{
  2786 		{
  2798 		return iExtension->iSubCellIconSize[aIndex];
  2787 		return iExtension->iSubCellIconSize[aIndex];
  2799 		}
  2788 		}
  2800 	return TSize(0, 0);
  2789 	return TSize(0, 0);
  2801 	}
  2790 	}
  2973 
  2962 
  2974 TInt CCCAppCommLauncherCustomListBoxData::CorrectBaseline(TInt aParentHeight, TInt aBaseline, TInt aFontId)
  2963 TInt CCCAppCommLauncherCustomListBoxData::CorrectBaseline(TInt aParentHeight, TInt aBaseline, TInt aFontId)
  2975     {
  2964     {
  2976     TInt B = aBaseline;
  2965     TInt B = aBaseline;
  2977 
  2966 
  2978     if( /*TAknFontId::IsEncodedFont(aFontId) &&*/ aFontId != ELayoutEmpty ) // This tells us that the font id has come from scalable layout API
  2967     if( TAknFontId::IsEncodedFont(aFontId) && aFontId != ELayoutEmpty ) // This tells us that the font id has come from scalable layout API
  2979         {
  2968         {
  2980         TInt b = aBaseline;
  2969         TInt b = aBaseline;
  2981         if (IsParentRelative(b)) { b = aParentHeight - ELayoutP + b; }
  2970         if (IsParentRelative(b)) { b = aParentHeight - ELayoutP + b; }
  2982 
  2971 
  2983         const CAknLayoutFont *font = AknLayoutUtils::LayoutFontFromId(aFontId);
  2972         const CAknLayoutFont *font = AknLayoutUtils::LayoutFontFromId(aFontId);
  3087 	{
  3076 	{
  3088 	if (iExtension)
  3077 	if (iExtension)
  3089 		{
  3078 		{
  3090 		if (!aUse && iExtension->iSimpleList)
  3079 		if (!aUse && iExtension->iSimpleList)
  3091 			{
  3080 			{
  3092 			CEikFormattedCellListBox
  3081 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  3093 					* list =
  3082             CEikFormattedCellListBox* list = static_cast<CEikFormattedCellListBox*>( iExtension->iControl );
  3094 							static_cast<CEikFormattedCellListBox*> (iExtension->iControl);
  3083             MAknListBoxTfxInternal* transApi =
  3095 			MAknListBoxTfxInternal* transApi = CAknListLoader::TfxApiInternal(
  3084                 CAknListLoader::TfxApiInternal( list->View()->ItemDrawer()->Gc() );
  3096 					list->View()->ItemDrawer()->Gc());
  3085             if ( transApi )
  3097 			if (transApi)
  3086                 {
  3098 				{
  3087                 transApi->SetPosition( MAknListBoxTfxInternal::EListTLMargin, TPoint( 0, 0 ) );
  3099 				transApi->SetPosition(MAknListBoxTfxInternal::EListTLMargin,
  3088                 transApi->SetPosition( MAknListBoxTfxInternal::EListBRMargin, TPoint( 0, 0 ) );
  3100 						TPoint(0, 0));
  3089                 }
  3101 				transApi->SetPosition(MAknListBoxTfxInternal::EListBRMargin,
  3090 #endif
  3102 						TPoint(0, 0));
       
  3103 				}
       
  3104 			}
  3091 			}
  3105 		iExtension->iSimpleList = aUse;
  3092 		iExtension->iSimpleList = aUse;
  3106 		}
  3093 		}
  3107 	}
  3094 	}
  3108 
  3095 
  3331 	TInt subCellIndex;
  3318 	TInt subCellIndex;
  3332 	TInt subCellIndex2;
  3319 	TInt subCellIndex2;
  3333 	TInt lastSubCell = Min(KMaxSubCellIndex, LastSubCell());
  3320 	TInt lastSubCell = Min(KMaxSubCellIndex, LastSubCell());
  3334 	TPtrC text;
  3321 	TPtrC text;
  3335 	TBool isEmpty[KMaxSubCellIndex];
  3322 	TBool isEmpty[KMaxSubCellIndex];
  3336 	TBool layoutMirrored = AknLayoutUtils::LayoutMirrored();
       
  3337 
  3323 
  3338 	// cache the empty text states
  3324 	// cache the empty text states
  3339 	while (ETrue)
  3325 	while (ETrue)
  3340 		{
  3326 		{
  3341 		if (subCell > lastSubCell)
  3327 		if (subCell > lastSubCell)
  3391 				break;
  3377 				break;
  3392 				}
  3378 				}
  3393 
  3379 
  3394 			TRect bRect2(SubCellPosition(subCell2), SubCellSize(subCell2));
  3380 			TRect bRect2(SubCellPosition(subCell2), SubCellSize(subCell2));
  3395 
  3381 
  3396 			if (bRect.Intersects(bRect2) && !SubCellIsTransparent(subCell)
  3382             if ( bRect.Intersects( bRect2 ) && !SubCellIsTransparent( subCell ) && !SubCellIsTransparent( subCell2 ) ) 
  3397 					&& !SubCellIsTransparent(subCell2))
  3383                 {
  3398 				{
  3384                 aResults[subCell] = ETrue;
  3399 				aResults[subCell] = ETrue;
  3385 
  3400 
  3386                 if ( !AknLayoutUtils::LayoutMirrored() )
  3401 				if (!layoutMirrored)
  3387                     {
  3402 					{
  3388                     bRect.iBr.iX = bRect2.iTl.iX;
  3403 					bRect.iBr.iX = bRect2.iTl.iX;
  3389                     }
  3404 					}
  3390                 else
  3405 				else
  3391                     {
  3406 					{
  3392                     bRect.iTl.iX = bRect2.iBr.iX;
  3407 					bRect.iTl.iX = bRect2.iBr.iX;
  3393                     }
  3408 					}
  3394                 }
  3409 				}
  3395             }
  3410 			}
  3396             
  3411 
  3397         if ( aResults[subCell] )
  3412 		if (aResults[subCell])
  3398             {
  3413 			{
  3399             if ( iExtension->AtSL( subCellIndex ).iSubCellType == CCCAppCommLauncherCustomListBoxDataExtension::EAknSLText )
  3414 			if (iExtension->AtSL(subCellIndex).iSubCellType
  3400                 {
  3415 					== CCCAppCommLauncherCustomListBoxDataExtension::EAknSLText)
  3401                 TAknTextLineLayout textLine = iExtension->AtSL( subCellIndex ).iTextLayout;
  3416 				{
  3402                 
  3417 				TAknTextLineLayout textLine =
  3403                 textLine.iW = bRect.Width();
  3418 						iExtension->AtSL(subCellIndex).iTextLayout;
  3404 
  3419 
  3405                 if ( !AknLayoutUtils::LayoutMirrored() )
  3420 				textLine.iW = bRect.Width();
  3406                     {
  3421 
  3407                     textLine.ir = aItemRect.iBr.iX - bRect.iBr.iX;
  3422 				if (!layoutMirrored)
  3408                     }
  3423 					{
  3409                 else
  3424 					textLine.ir = aItemRect.iBr.iX - bRect.iBr.iX;
  3410                     {
  3425 					}
  3411                     textLine.il = bRect.iTl.iX - aItemRect.iTl.iX;
  3426 				else
  3412                     }
  3427 					{
  3413                 
  3428 					textLine.il = bRect.iTl.iX - aItemRect.iTl.iX;
  3414                 aLayouts[subCell] = textLine;
  3429 					}
  3415                 }
  3430 
  3416             }
  3431 				aLayouts[subCell] = textLine;
       
  3432 				}
       
  3433 			}
       
  3434 
  3417 
  3435 		++subCell;
  3418 		++subCell;
  3436 		}
  3419 		}
  3437 	}
  3420 	}
  3438 
  3421 
  3566 
  3549 
  3567 	if (!cc)
  3550 	if (!cc)
  3568 		{
  3551 		{
  3569 		cc = SkinBackgroundContext();
  3552 		cc = SkinBackgroundContext();
  3570 		}
  3553 		}
  3571 	TBool linesShown = AknListBoxUtils::ListBoxLinesShown(
  3554 
  3572 			AknsUtils::SkinInstance(), cc);
       
  3573 
  3555 
  3574 	Mem::FillZ(textNull, sizeof(textNull));
  3556 	Mem::FillZ(textNull, sizeof(textNull));
  3575 
  3557 
  3576 	// cache the text states.
  3558 	// cache the text states.
  3577 	subcell = 0;
  3559 	subcell = 0;
  3607 			continue;
  3589 			continue;
  3608 			}
  3590 			}
  3609 
  3591 
  3610 		TRect bRect(SubCellPosition(subcell), SubCellSize(subcell));
  3592 		TRect bRect(SubCellPosition(subcell), SubCellSize(subcell));
  3611 		TMargins m(SubCellMargins(subcell));
  3593 		TMargins m(SubCellMargins(subcell));
  3612 		TRect cRect(bRect.iTl + TSize(m.iLeft, m.iTop), bRect.Size() - TSize(
  3594         TRect cRect(bRect.iTl+TSize(m.iLeft,m.iTop),bRect.Size()-TSize(m.iRight+m.iLeft,m.iBottom+m.iTop));
  3613 				m.iRight + m.iLeft, m.iBottom + m.iTop));
       
  3614 
  3595 
  3615 		for (subcell2 = subcell + 1; subcell2 <= lastSubCell; subcell2++)
  3596 		for (subcell2 = subcell + 1; subcell2 <= lastSubCell; subcell2++)
  3616 			{
  3597 			{
  3617 			if (textNull[subcell2])
  3598 			if (textNull[subcell2])
  3618 				{
  3599 				{
  3619 				continue;
  3600 				continue;
  3620 				}
  3601 				}
  3621 
  3602 
  3622 			// This is called O(N^2) times - Do not put anything extra to it, it'll slow down drawing!
  3603 			// This is called O(N^2) times - Do not put anything extra to it, it'll slow down drawing!
  3623 			TRect bRect2(SubCellPosition(subcell2), SubCellSize(subcell2));
  3604             TRect bRect2 = TRect(SubCellPosition(subcell2),SubCellSize(subcell2));
  3624 			if (cRect.Intersects(bRect2) && bRect.Intersects(bRect2)
  3605             if (cRect.Intersects(bRect2) && bRect.Intersects(bRect2) && !SubCellIsTransparent(subcell) && !SubCellIsTransparent(subcell2)) 
  3625 					&& !SubCellIsTransparent(subcell) && !SubCellIsTransparent(
       
  3626 					subcell2))
       
  3627 				{
  3606 				{
  3628 				if (!layoutMirrored)
  3607 				if (!layoutMirrored)
  3629 					{
  3608 					{
  3630 					cRect.iBr.iX = bRect2.iTl.iX;
  3609 					cRect.iBr.iX = bRect2.iTl.iX;
  3631 					bRect.iBr.iX = bRect2.iTl.iX;
  3610 					bRect.iBr.iX = bRect2.iTl.iX;
  3659 			}
  3638 			}
  3660 
  3639 
  3661 		// SetPosition, SetSize and margins support
  3640 		// SetPosition, SetSize and margins support
  3662 		TRect bRect(SubCellPosition(subcell), SubCellRealSize(subcell));
  3641 		TRect bRect(SubCellPosition(subcell), SubCellRealSize(subcell));
  3663 		TMargins m(SubCellMargins(subcell));
  3642 		TMargins m(SubCellMargins(subcell));
  3664 		TRect cRect(bRect.iTl + TSize(m.iLeft, m.iTop), SubCellRealTextSize(
  3643         TRect cRect(bRect.iTl+TSize(m.iLeft,m.iTop),SubCellRealTextSize(subcell));
  3665 				subcell));
  3644         
  3666 
  3645 
  3667 		if (bRect.iBr.iX == 0)
  3646 		if (bRect.iBr.iX == 0)
  3668 			{
  3647 			{
  3669 			++subcell;
  3648 			++subcell;
  3670 			continue;
  3649 			continue;
  3671 			}
  3650 			}
  3672 
  3651 
  3673 		if (layoutMirrored)
  3652 		if (layoutMirrored)
  3674 			{
  3653 			{
  3675 			TRect bRect(SubCellPosition(subcell), SubCellSize(subcell));
  3654             TRect bRect = TRect(SubCellPosition(subcell),SubCellSize(subcell));
  3676 			TRect cRect2(bRect.iTl + TSize(m.iLeft, m.iTop), bRect.Size()
  3655             TRect cRect2 = TRect(bRect.iTl+TSize(m.iLeft,m.iTop),bRect.Size()-TSize(m.iRight+m.iLeft,m.iBottom+m.iTop));
  3677 					- TSize(m.iRight + m.iLeft, m.iBottom + m.iTop));
  3656             
  3678 
  3657 
  3679 			TInt shift = (cRect2.Size() - SubCellRealTextSize(subcell)).iWidth;
  3658 			TInt shift = (cRect2.Size() - SubCellRealTextSize(subcell)).iWidth;
  3680 			cRect.iTl.iX += shift;
  3659 			cRect.iTl.iX += shift;
  3681 			cRect.iBr.iX += shift;
  3660 			cRect.iBr.iX += shift;
  3682 			}
  3661 			}
  3733 
  3712 
  3734 			// graphics or text column
  3713 			// graphics or text column
  3735 			CGraphicsContext::TTextAlign align = SubCellAlignment(subcell);
  3714 			CGraphicsContext::TTextAlign align = SubCellAlignment(subcell);
  3736 			if (!SubCellIsGraphics(subcell))
  3715 			if (!SubCellIsGraphics(subcell))
  3737 				{
  3716 				{
  3738 				const CFont* rowAndCellFont = RowAndSubCellFont(
  3717                 const CFont* rowAndCellFont=RowAndSubCellFont(iExtension->iCurrentlyDrawnItemIndex,subcell);
  3739 						iExtension->iCurrentlyDrawnItemIndex, subcell);
  3718                 const CFont* cellFont=Font(aProperties, subcell);
  3740 				const CFont* cellFont = Font(aProperties, subcell);
  3719                 const CFont* tempFont=(cellFont) ? cellFont : font;
  3741 				const CFont* tempFont = (cellFont) ? cellFont : font;
  3720                 const CFont* usedFont=(rowAndCellFont) ? rowAndCellFont : tempFont;
  3742 				const CFont* usedFont = (rowAndCellFont) ? rowAndCellFont
       
  3743 						: tempFont;
       
  3744 				aGc.UseFont(usedFont);
  3721 				aGc.UseFont(usedFont);
  3745 				SetUnderlineStyle(aProperties, aGc, subcell);
  3722 				SetUnderlineStyle(aProperties, aGc, subcell);
  3746 
  3723 
  3747 				// baseline calc needed for each cell.
  3724 				// baseline calc needed for each cell.
  3748 				baseLineOffset = SubCellBaselinePos(subcell);
  3725 				baseLineOffset = SubCellBaselinePos(subcell);
  3749 				baseLineOffset -= cRect.iTl.iY;
  3726 				baseLineOffset -= cRect.iTl.iY;
  3750 				if (!baseLineOffset)
  3727 				if (!baseLineOffset)
  3751 					{
  3728 					{
  3752 					baseLineOffset = (cRect.Size().iHeight
  3729                     baseLineOffset = (cRect.Size().iHeight-usedFont->HeightInPixels())/2 + usedFont->AscentInPixels();
  3753 							- usedFont->HeightInPixels()) / 2
       
  3754 							+ usedFont->AscentInPixels();
       
  3755 					}
  3730 					}
  3756 
  3731 
  3757 				TBuf<KMaxColumnDataLength + KAknBidiExtraSpacePerLine> clipbuf =
  3732 				TBuf<KMaxColumnDataLength + KAknBidiExtraSpacePerLine> clipbuf =
  3758 						text.Left(KMaxColumnDataLength);
  3733 						text.Left(KMaxColumnDataLength);
  3759 
  3734 
  3767 					}
  3742 					}
  3768 
  3743 
  3769 				TBool clipped(EFalse);
  3744 				TBool clipped(EFalse);
  3770 				TInt clipgap = SubCellTextClipGap(subcell);
  3745 				TInt clipgap = SubCellTextClipGap(subcell);
  3771 
  3746 
  3772 				if (iExtension->iUseLogicalToVisualConversion && subcell
  3747                 if ( iExtension->iUseLogicalToVisualConversion &&
  3773 						!= iExtension->iFirstWordWrappedSubcellIndex && subcell
  3748                      subcell != iExtension->iFirstWordWrappedSubcellIndex &&
  3774 						!= iExtension->iSecondWordWrappedSubcellIndex)
  3749                      subcell != iExtension->iSecondWordWrappedSubcellIndex )
  3775 					{
  3750                     {
  3776 					TInt maxClipWidth = textRect.Size().iWidth + clipgap;
  3751                     TInt maxClipWidth = textRect.Size().iWidth + clipgap;
  3777 
  3752                     
  3778 					clipped = AknBidiTextUtils::ConvertToVisualAndClip(
  3753                     clipped = AknBidiTextUtils::ConvertToVisualAndClip(
  3779 							text.Left(KMaxColumnDataLength), clipbuf,
  3754                         text.Left(KMaxColumnDataLength), 
  3780 							*usedFont, textRect.Size().iWidth, maxClipWidth);
  3755                         clipbuf,
       
  3756                         *usedFont,
       
  3757                         textRect.Size().iWidth, 
       
  3758                         maxClipWidth );
  3781 					}
  3759 					}
  3782 
  3760 
  3783 				if (clipped)
  3761 				if (clipped)
  3784 					{
  3762 					{
  3785 					if (!layoutMirrored)
  3763 					if (!layoutMirrored)
  3803 						iExtension->iClippedSubcells &= ~(1 << subcell);
  3781 						iExtension->iClippedSubcells &= ~(1 << subcell);
  3804 						}
  3782 						}
  3805 
  3783 
  3806 					if (iExtension->iUseClippedByWrap) // override if already clipped
  3784 					if (iExtension->iUseClippedByWrap) // override if already clipped
  3807 						{
  3785 						{
  3808 						iExtension->iClippedSubcells
  3786                         iExtension->iClippedSubcells = iExtension->iClippedByWrap;
  3809 								= iExtension->iClippedByWrap;
       
  3810 						}
  3787 						}
  3811 					}
  3788 					}
  3812 
  3789 
  3813 				CAknMarqueeControl* marquee =
  3790                 CAknMarqueeControl* marquee =
  3814 						subcell == 1 ? iExtension->iMarquee
  3791                     subcell == 1 ? iExtension->iMarquee :
  3815 								: iExtension->i2ndLineMarquee;
  3792                                    iExtension->i2ndLineMarquee;
  3816 
  3793                 
  3817 				TBool
  3794                 TBool marqueeDisabled =
  3818 						marqueeDisabled =
  3795                         static_cast<CEikListBox*>(
  3819 								static_cast<CEikListBox*> (Control())->View()->ItemDrawer()->Flags()
  3796                             Control() )->View()->ItemDrawer()->Flags() & CListItemDrawer::EDisableMarquee;
  3820 										& CListItemDrawer::EDisableMarquee;
  3797                 
  3821 
  3798                 if ( aHighlight && iExtension->IsMarqueeOn() && clipped && !marqueeDisabled )
  3822 				if (aHighlight && iExtension->IsMarqueeOn() && clipped
  3799                     {                    
  3823 						&& !marqueeDisabled)
  3800                     // Let marquee know if it needs to do bidi conversion.
  3824 					{
  3801                     marquee->UseLogicalToVisualConversion( clipped );
  3825 					// Let marquee know if it needs to do bidi conversion.
  3802                     
  3826 					marquee->UseLogicalToVisualConversion(clipped);
  3803                     if ( marquee->DrawText( aGc, textRect, text, baseLineOffset, align, *usedFont ) )
  3827 
  3804                         {
  3828 					if (marquee->DrawText(aGc, textRect, text, baseLineOffset,
  3805                         // All the loops have been executed -> the text needs to be truncated.
  3829 							align, *usedFont))
  3806                         aGc.DrawText( clipbuf, textRect, baseLineOffset, align, 0 );
  3830 						{
       
  3831 						// All the loops have been executed -> the text needs to be truncated.
       
  3832 						aGc.DrawText(clipbuf, textRect, baseLineOffset, align,
       
  3833 								0);
       
  3834 						}
  3807 						}
  3835 					}
  3808 					}
  3836 				else
  3809 				else
  3837 					{
  3810 					{
  3838 					if (marquee && marqueeDisabled)
  3811 					if (marquee && marqueeDisabled)
  3840 						marquee->Stop();
  3813 						marquee->Stop();
  3841 						}
  3814 						}
  3842 
  3815 
  3843 					if (IsBackgroundDrawingEnabled())
  3816 					if (IsBackgroundDrawingEnabled())
  3844 						{
  3817 						{
  3845 						aGc.DrawText(clipbuf, textRect, baseLineOffset, align,
  3818                         aGc.DrawText( clipbuf, textRect, baseLineOffset, align, 0 );
  3846 								0);
  3819                         }
  3847 						}
  3820                     else  // "Transparent" list, draw text shadow first, then the actual text.
  3848 					else // "Transparent" list, draw text shadow first, then the actual text.
  3821                         {
  3849 						{
  3822                         textShadowRect = textRect;
  3850 						textShadowRect = textRect;
  3823                         textShadowRect.Move( 1, 1 );
  3851 						textShadowRect.Move(1, 1);
  3824                         aGc.SetPenColor( textShadowColour );
  3852 						aGc.SetPenColor(textShadowColour);
  3825                         aGc.DrawText( clipbuf, textShadowRect, baseLineOffset, align, 0 );
  3853 						aGc.DrawText(clipbuf, textShadowRect, baseLineOffset,
  3826                         if ( aHighlight )
  3854 								align, 0);
  3827                             {
  3855 						if (aHighlight)
  3828                             aGc.SetPenColor( subcellColors->iHighlightedText );
  3856 							{
  3829                             }
  3857 							aGc.SetPenColor(subcellColors->iHighlightedText);
  3830                         else
  3858 							}
  3831                             {
  3859 						else
  3832                             aGc.SetPenColor( subcellColors->iText );
  3860 							{
  3833                             }
  3861 							aGc.SetPenColor(subcellColors->iText);
  3834                         aGc.DrawText( clipbuf, textRect, baseLineOffset, align, 0 );
  3862 							}
       
  3863 						aGc.DrawText(clipbuf, textRect, baseLineOffset, align,
       
  3864 								0);
       
  3865 						}
  3835 						}
  3866 					}
  3836 					}
  3867 
  3837 
  3868 				if (iExtension->iPictoInterface)
  3838 				if (iExtension->iPictoInterface)
  3869 					{
  3839 					{
  3870 					iExtension->iPictoInterface->Interface()->DrawPictographsInText(
  3840 					iExtension->iPictoInterface->Interface()->DrawPictographsInText(
  3871 							aGc, *usedFont, clipbuf, textRect, baseLineOffset,
  3841                         aGc, *usedFont, clipbuf, textRect, baseLineOffset, align, 0 );
  3872 							align, 0);
       
  3873 					}
  3842 					}
  3874 				// disable underline after first text.
  3843 				// disable underline after first text.
  3875 				// at least phonebook uses this. See SetSubcellUnderlined to override
  3844 				// at least phonebook uses this. See SetSubcellUnderlined to override
  3876 				aGc.SetUnderlineStyle(EUnderlineOff);
  3845 				aGc.SetUnderlineStyle(EUnderlineOff);
  3877 				aGc.DiscardFont(); // Release the font cache
  3846 				aGc.DiscardFont(); // Release the font cache
  3940 						case ERight:
  3909 						case ERight:
  3941 							bmpPos.iX = textRect.iBr.iX - size.iWidth;
  3910 							bmpPos.iX = textRect.iBr.iX - size.iWidth;
  3942 							break;
  3911 							break;
  3943 						}
  3912 						}
  3944 					bmpRect = TRect(bmpPos, size);
  3913 					bmpRect = TRect(bmpPos, size);
  3945 					TPoint posInBitmap = TPoint(0, 0) + bitmap->SizeInPixels()
  3914                     TPoint posInBitmap = TPoint(0,0) + bitmap->SizeInPixels() - textRect.Size();
  3946 							- textRect.Size();
  3915                     posInBitmap.iX /= 2;
  3947 					posInBitmap.iX >> 1;
  3916                     posInBitmap.iY /= 2;
  3948 					posInBitmap.iY >> 1;
       
  3949 					if (posInBitmap.iX < 0)
  3917 					if (posInBitmap.iX < 0)
  3950 						{
  3918 						{
  3951 						posInBitmap.iX = 0;
  3919 						posInBitmap.iX = 0;
  3952 						}
  3920 						}
  3953 					if (posInBitmap.iY < 0)
  3921 					if (posInBitmap.iY < 0)