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> |
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()) |
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; |
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 |
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 |