--- a/uifw/eikctl/src/EIKCLBD.CPP Thu Aug 19 10:11:06 2010 +0300
+++ b/uifw/eikctl/src/EIKCLBD.CPP Tue Aug 31 15:28:30 2010 +0300
@@ -1,5 +1,5 @@
/*
-* Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
+* Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
@@ -32,8 +32,6 @@
#include <layoutmetadata.cdl.h>
#include <aknlayoutscalable_avkon.cdl.h>
#include <aknphysics.h>
-#include <AknIconArray.h>
-#include <avkon.mbg>
#ifdef RD_UI_TRANSITION_EFFECTS_LIST
@@ -53,8 +51,6 @@
const TInt KColorIconFlag = -1;
const TInt KColorIconIdx = 0;
-// Number of icons in marking mode icon array
-const TInt KMarkingModeIconArraySize = 2;
/**
* About animation usage:
@@ -120,7 +116,7 @@
void DeleteAnim();
void FocusGained();
void FocusLost();
- void SkinChangedL();
+ void SkinChanged();
void SetControl( CCoeControl* aControl );
// Implementation of MCoeForegroundObserver
@@ -145,9 +141,6 @@
CWindowGc& aGc,
const TRect& aOutRect,
const TRect& aInnerRect ) const;
-
- void LoadMarkingIconsL();
-
public: //for handling column alignment
struct TColumnExt
{
@@ -246,7 +239,6 @@
CArrayFix<TColumnExt>* iColumnExtArray; //for column alignment
TRect iMarginRect;
- CAknIconArray* iMarkingIconArray;
};
/**
@@ -314,7 +306,6 @@
iKineticScrolling = CAknPhysics::FeatureEnabled();
- LoadMarkingIconsL();
_AKNTRACE_FUNC_EXIT;
}
@@ -339,13 +330,6 @@
delete iColorBmp;
delete iHiliBmp;
delete iColumnExtArray;
-
- if ( iMarkingIconArray )
- {
- iMarkingIconArray->ResetAndDestroy();
- }
-
- delete iMarkingIconArray;
}
MAknsControlContext* CColumnListBoxDataExtension::SkinBackgroundContext() const
@@ -536,20 +520,17 @@
}
}
-
// -----------------------------------------------------------------------------
-// CColumnListBoxDataExtension::SkinChangedL
+// CColumnListBoxDataExtension::SkinChanged
// -----------------------------------------------------------------------------
//
-void CColumnListBoxDataExtension::SkinChangedL()
+void CColumnListBoxDataExtension::SkinChanged()
{
DeleteAnim();
TryCreateAnimation();
CreateColorBitmapsL();
- LoadMarkingIconsL();
}
-
// -----------------------------------------------------------------------------
// CColumnListBoxDataExtension::SetControl
// -----------------------------------------------------------------------------
@@ -1141,64 +1122,19 @@
KAknsIIDQsnFrListCenterPressed );
}
-
-// -----------------------------------------------------------------------------
-// CColumnListBoxDataExtension::LoadMarkingIconsL
-// -----------------------------------------------------------------------------
-//
-void CColumnListBoxDataExtension::LoadMarkingIconsL()
- {
- if ( !iMarkingIconArray )
- {
- iMarkingIconArray = new ( ELeave ) CAknIconArray(
- KMarkingModeIconArraySize );
- }
- else
- {
- iMarkingIconArray->ResetAndDestroy();
- }
-
- MAknsSkinInstance* skin = AknsUtils::SkinInstance();
- const TDesC& avkonIconFile = AknIconUtils::AvkonIconFileName();
-
- CGulIcon* icon = AknsUtils::CreateGulIconL( skin,
- KAknsIIDQgnPropCheckboxOn,
- avkonIconFile,
- EMbmAvkonQgn_prop_checkbox_on,
- EMbmAvkonQgn_prop_checkbox_on_mask );
-
- CleanupStack::PushL( icon );
- iMarkingIconArray->AppendL( icon );
- CleanupStack::Pop( icon );
-
- icon = AknsUtils::CreateGulIconL( skin,
- KAknsIIDQgnPropCheckboxOff,
- avkonIconFile,
- EMbmAvkonQgn_prop_checkbox_off,
- EMbmAvkonQgn_prop_checkbox_off_mask );
-
- CleanupStack::PushL( icon );
- iMarkingIconArray->AppendL( icon );
- CleanupStack::Pop( icon );
- }
-
-
EXPORT_C CCoeControl *CColumnListBoxData::Control() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
return iExtension->iControl;
}
EXPORT_C void CColumnListBoxData::SetControl(CCoeControl *aControl)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
iExtension->SetControl( aControl );
}
EXPORT_C MAknsControlContext* CColumnListBoxData::SkinBackgroundContext() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
if (iExtension->iSkinEnabled)
{
return iExtension->iSkinControlContext;
@@ -1209,14 +1145,12 @@
void CColumnListBoxData::SetSkinBackgroundContext(CAknsListBoxBackgroundControlContext *aContext)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
delete iExtension->iSkinControlContext;
iExtension->iSkinControlContext = aContext;
}
void CColumnListBoxData::CreatePictographInterfaceL()
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
if ( !iExtension->iPictoInterface )
{
iExtension->iPictoInterface = CAknPictographInterface::NewL(
@@ -1226,7 +1160,6 @@
EXPORT_C void CColumnListBoxData::SetSkinHighlightFrame(const TAknsItemID *aFrameId, const TAknsItemID *aFrameCenterId)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
iExtension->iSkinHighlightFrameId = aFrameId;
iExtension->iSkinHighlightFrameCenterId = aFrameCenterId;
@@ -1234,14 +1167,12 @@
EXPORT_C void CColumnListBoxData::SetSkinEnabledL(TBool aEnabled)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
CListBoxData::SetSkinEnabledL(aEnabled);
iExtension->iSkinEnabled = aEnabled;
}
EXPORT_C void CColumnListBoxData::SetSkinStyle(const TAknsItemID *aId, const TRect &aTileRect)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
if (iExtension->iSkinControlContext)
{
iExtension->iSkinControlContext->SetTiledBitmap(*aId);
@@ -1251,7 +1182,6 @@
EXPORT_C void CColumnListBoxData::SetListEndSkinStyle(const TAknsItemID *aId, const TRect &aTileRect)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
if (iExtension->iSkinControlContext)
{
iExtension->iSkinControlContext->SetBottomBitmap(*aId);
@@ -1261,7 +1191,6 @@
void CColumnListBoxData::CreateMarqueeControlL()
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
if ( !iExtension->iMarquee )
{
@@ -1281,7 +1210,6 @@
void CColumnListBoxData::ResetMarquee()
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
if (iExtension->iMarquee)
{
@@ -1295,13 +1223,11 @@
TInt CColumnListBoxData::CurrentMarqueeItemIndex()
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
return iExtension->iCurrentItem;
}
void CColumnListBoxData::SetCurrentMarqueeItemIndex(TInt aIndex)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
iExtension->iCurrentItem = aIndex;
}
@@ -1310,7 +1236,6 @@
//
EXPORT_C void CColumnListBoxData::EnableMarqueeL(TBool aEnable)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
// CreateMarqueeControlL does nothing if marquee already exists,
// so let's just call it just in case.
@@ -1321,13 +1246,15 @@
EXPORT_C void CColumnListBoxData::SetSeparatorLinePosition(TAknSeparatorLinePosition aPosition)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- iExtension->iSeparatorLinePosition = aPosition;
+ if (iExtension)
+ iExtension->iSeparatorLinePosition = aPosition;
}
EXPORT_C TAknSeparatorLinePosition CColumnListBoxData::SeparatorLinePosition() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- return iExtension->iSeparatorLinePosition;
+ if (iExtension)
+ return iExtension->iSeparatorLinePosition;
+ else
+ return ENoLine;
}
EXPORT_C CAknLayoutData *CColumnListBoxData::LayoutData() const
{
@@ -1384,12 +1311,12 @@
// D'tor
//
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
delete iColumnArray;
if (IconArray())
{
IconArray()->ResetAndDestroy();
- delete iExtension->iIconArray;
+ if (iExtension)
+ delete iExtension->iIconArray;
}
delete iExtension;
}
@@ -1466,11 +1393,10 @@
// Set a columns width
//
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
TInt index;
FindColumnIndexOrAddL(index,aColumn);
At(index).iWidth=aWidth;
- if ( iExtension->iUseLayoutData )
+ if ( iExtension && iExtension->iUseLayoutData )
{
iExtension->iUseLayoutData = EFalse;
CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
@@ -1541,7 +1467,6 @@
// Set a columns baseline position
//
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
TInt index;
FindColumnIndexOrAddL(index,aColumn);
@@ -1549,7 +1474,7 @@
// can not be nicely supported by new drawing system
// --> revert to Symbian style drawing
- if ( iExtension->iUseLayoutData )
+ if ( iExtension && iExtension->iUseLayoutData )
{
iExtension->iUseLayoutData = EFalse;
#ifdef RD_UI_TRANSITION_EFFECTS_LIST
@@ -1584,7 +1509,6 @@
// Set a columns vertical cap
//
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
TInt index;
FindColumnIndexOrAddL(index,aColumn);
@@ -1592,7 +1516,7 @@
// can not be nicely supported by new drawing system
// --> revert to Symbian style drawing
- if ( iExtension->iUseLayoutData )
+ if ( iExtension && iExtension->iUseLayoutData )
{
iExtension->iUseLayoutData = EFalse;
#ifdef RD_UI_TRANSITION_EFFECTS_LIST
@@ -1704,7 +1628,6 @@
// Set a columns alignment
//
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
TInt index;
FindColumnIndexOrAddL(index,aColumn);
At(index).iAlign=aAlign;
@@ -1805,8 +1728,10 @@
// Return the list of icons
//
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- return iExtension->iIconArray;
+ if (iExtension)
+ return iExtension->iIconArray;
+ else
+ return 0;
}
EXPORT_C void CColumnListBoxData::SetIconArray(CArrayPtr<CGulIcon>* aArray)
@@ -1814,9 +1739,14 @@
// Passes ownership of the icon list aArray (assumes any previous list has been deleted by the caller)
//
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
- iExtension->iIconArray=aArray;
+ if (iExtension)
+ iExtension->iIconArray=aArray;
+ else
+ {
+ aArray->ResetAndDestroy();
+ delete aArray;
+ }
}
EXPORT_C CFont* CColumnListBoxData::Font(const TListItemProperties& /*aItemProperties*/, TInt aColumn) const
@@ -1848,7 +1778,6 @@
void CColumnListBoxData::DrawHighLight( CWindowGc& aGc, const TRect& aRect, TBool aHighlight, MAknsSkinInstance* aSkin ) const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
// SERIES60 Highlight drawing.
if( aHighlight )
{
@@ -2014,17 +1943,7 @@
TBool aHighlight,
const TColors& aColors ) const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
-
- __ASSERT_DEBUG( iExtension->iControl, Panic( EEikPanicNullPointer ));
-
- CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
- if ( listbox && !listbox->View()->ViewRect().Intersects( aRect ) )
- {
- // outside of the clipping rect -> don't process this item
- return;
- }
TInt lastColumn = Min( LastColumn(), KMaxColumn );
TInt column=0;
@@ -2032,10 +1951,10 @@
TPtrC tempText;
TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText;
-
+
MAknsSkinInstance *skin = AknsUtils::SkinInstance();
MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
- if ( !cc )
+ if (!cc)
{
cc = SkinBackgroundContext();
}
@@ -2044,6 +1963,13 @@
TBool rectClipped[KMaxColumn];
Mem::FillZ( &rectClipped[0], KMaxColumn * sizeof( TBool ) );
+
+ if ( iExtension->iSubCellsMightIntersect )
+ {
+ CheckIfSubCellsIntersect( &textLines[0], &rectClipped[0], *aText, aRect );
+ }
+
+ CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
#ifdef RD_UI_TRANSITION_EFFECTS_LIST
MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
#endif // RD_UI_TRANSITION_EFFECTS_LIST
@@ -2076,27 +2002,20 @@
}
#endif // RD_UI_TRANSITION_EFFECTS_LIST
}
- if ( iExtension->iCurrentRow < listbox->BottomItemIndex() )
- {
- AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin );
- }
+
+ DrawHighLight( aGc, aRect, aHighlight, skin );
- DrawHighLight( aGc, aRect, aHighlight, skin );
- TRect itemRect( aRect );
- DrawMarkingModeIcons( aItemProperties, aGc, itemRect );
- if ( iExtension->iSubCellsMightIntersect )
- {
- CheckIfSubCellsIntersect( &textLines[0], &rectClipped[0], *aText, itemRect );
- }
// The column draw loop
column = 0;
TInt subCellIndex = 0;
+
+ if ( !iExtension ) { return; }
#ifdef RD_UI_TRANSITION_EFFECTS_LIST
if ( transApi )
{
transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
- CListBoxView* view = listbox->View();
+ CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
aGc.SetClippingRect( view->ViewRect() );
}
#endif // RD_UI_TRANSITION_EFFECTS_LIST
@@ -2106,10 +2025,7 @@
TextUtils::ColumnText( text, column, aText );
if ( text == KNullDesC ) { continue; }
- if ( iExtension->FindSLSubCellIndex( subCellIndex, column )!=0 )
- {
- continue;
- }
+ if ( iExtension->FindSLSubCellIndex( subCellIndex, column )!=0 ) { continue; }
CGraphicsContext::TTextAlign align=ColumnAlignment(column);
TBool isLayoutAlignment = iExtension->ColumnLayoutAlignment(column);
@@ -2120,26 +2036,22 @@
TRgb textColor( aTextColor );
- if ( aHighlight )
+ if (aHighlight)
{
textColor = aColors.iHighlightedText;
aGc.SetBrushColor(aColors.iHighlightedBack);
}
- if ( AknsUtils::AvkonSkinEnabled() )
+ if (AknsUtils::AvkonSkinEnabled())
{
- CListBoxView* view = listbox->View();
- TBool useOverrideColor = view->ItemDrawer()->Flags() & CListItemDrawer::EUseOverrideSkinTextColor;
- if ( !useOverrideColor )
- {
- if ( iExtension->iTextColor != NULL )
- {
- textColor = iExtension->iTextColor;
- }
- if ( aHighlight && iExtension->iHighlightedTextColor != NULL )
- {
- textColor = iExtension->iHighlightedTextColor;
- }
- }
+ if (iExtension->iTextColor != NULL)
+ {
+ textColor = iExtension->iTextColor;
+ }
+
+ if (aHighlight && iExtension->iHighlightedTextColor != NULL)
+ {
+ textColor = iExtension->iHighlightedTextColor;
+ }
}
const CFont* rowAndColFont=RowAndColumnFont(iExtension->iCurrentRow,column);
@@ -2158,7 +2070,7 @@
// check if there are icons affecting this text layout
TInt gSC = iExtension->AtSL(subCellIndex).iConditionValue; // graphical subcell which might affect this text subcell
- if ( gSC > -1 )
+ if (gSC > -1)
{
TInt tempIndex;
while (gSC > -1) // when gSC == -1, we have found our graphical subcell
@@ -2174,7 +2086,7 @@
}
}
- if ( gSC == -1 ) // no affecting icons -> use default layout
+ if (gSC == -1) // no affecting icons -> use default layout
{
textLineLayout = iExtension->AtSL(subCellIndex).iTextLayout;
}
@@ -2183,7 +2095,7 @@
if( !isLayoutAlignment )
{
- switch( align )
+ switch(align)
{
case CGraphicsContext::ELeft :
{
@@ -2205,7 +2117,7 @@
}
TAknLayoutText textLayout;
- textLayout.LayoutText( itemRect, textLineLayout, usedFont );
+ textLayout.LayoutText( aRect, textLineLayout, usedFont );
// *2 == leave some room for marquee
const TInt maxlen( KMaxColumnDataLength * 2 );
TBuf<maxlen> convBuf = text.Left(maxlen);
@@ -2241,9 +2153,9 @@
}
TBool marqueeDisabled(EFalse);
- if ( listbox != NULL &&
- listbox->View() != NULL &&
- listbox->View()->ItemDrawer() != NULL)
+ if (listbox != NULL &&
+ listbox->View() != NULL &&
+ listbox->View()->ItemDrawer() != NULL)
{
marqueeDisabled = listbox->View()->ItemDrawer()->Flags() & CListItemDrawer::EDisableMarquee;
}
@@ -2252,7 +2164,7 @@
{
iExtension->iMarquee->UseLogicalToVisualConversion( bidiConv );
- if ( iExtension->iMarquee->DrawText( aGc, itemRect, textLineLayout, convBuf, usedFont, textColor ) )
+ if ( iExtension->iMarquee->DrawText( aGc, aRect, textLineLayout, convBuf, usedFont, textColor ) )
{
// all the loops have been executed
textLayout.DrawText( aGc, convBuf, bidiConv, textColor );
@@ -2331,7 +2243,7 @@
continue;
}
- if ( aHighlight && (index > 0xffff) )
+ if (aHighlight && (index > 0xffff))
{
index = index >> 16; // we have different icon for highlight
}
@@ -2342,10 +2254,10 @@
TAknWindowLineLayout graphicLayout = iExtension->AtSL(subCellIndex).iGraphicLayout;
TAknLayoutRect graphicRect;
- graphicRect.LayoutRect( itemRect,graphicLayout );
+ graphicRect.LayoutRect(aRect,graphicLayout);
TSize graphicSize( graphicRect.Rect().Size() );
- if ( index>=0 && IconArray() )
+ if (index>=0 && IconArray())
{
CGulIcon* icon=(*IconArray())[index];
CFbsBitmap* bitmap=icon->Bitmap();
@@ -2354,8 +2266,8 @@
{
TSize size( bitmap->SizeInPixels() );
- if ( size.iWidth != graphicSize.iWidth &&
- size.iHeight != graphicSize.iHeight )
+ if (size.iWidth != graphicSize.iWidth &&
+ size.iHeight != graphicSize.iHeight )
{
AknIconUtils::SetSize( bitmap,
graphicSize,
@@ -2385,7 +2297,6 @@
TBool aHighlight,
const TColors& aColors ) const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
if ( aHighlight )
@@ -2419,62 +2330,11 @@
return;
}
- CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
- TRect itemRect( aRect );
-
TInt extraVerticalSpace=(aRect.Height()-font->HeightInPixels());
TInt baseLineOffset=extraVerticalSpace/2+font->AscentInPixels();
- // SERIES60 Background drawing.
- MAknsSkinInstance *skin = AknsUtils::SkinInstance();
- MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
- if (!cc)
- {
- cc = SkinBackgroundContext();
- }
-
-#ifdef RD_UI_TRANSITION_EFFECTS_LIST
-
- MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
-
-#endif // RD_UI_TRANSITION_EFFECTS_LIST
-
- if ( !listbox || !listbox->BackgroundDrawingSuppressed() )
- {
-#ifdef RD_UI_TRANSITION_EFFECTS_LIST
- if ( transApi )
- {
- transApi->StartDrawing( MAknListBoxTfxInternal::EListView );
- }
-#endif // RD_UI_TRANSITION_EFFECTS_LIST
-
- aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
- aGc.SetPenStyle(CGraphicsContext::ESolidPen);
-
- if ( listbox )
- {
- AknsDrawUtils::Background( skin, cc, listbox, aGc, aRect );
- }
- else
- {
- aGc.Clear(aRect);
- }
-
-#ifdef RD_UI_TRANSITION_EFFECTS_LIST
- if ( transApi )
- {
- transApi->StopDrawing();
- }
-#endif // RD_UI_TRANSITION_EFFECTS_LIST
- }
- if ( iExtension->iCurrentRow < listbox->BottomItemIndex() )
- {
- AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin );
- }
- DrawHighLight( aGc, aRect, aHighlight, skin );
- DrawMarkingModeIcons( aItemProperties, aGc, itemRect );
- TRect textRect( itemRect );
- textRect.iBr.iX = itemRect.iTl.iX;
+ TRect textRect( aRect );
TRect textMRect; // textrect with margins.
+ textRect.iBr.iX=aRect.iTl.iX;
TInt column=0;
TPtrC text;
@@ -2484,11 +2344,11 @@
// be too difficult to do without - and this is cleaner solution.
// pass 1, figures out x-coordinates for columns.
- TInt x = itemRect.iTl.iX;
+ TInt x = aRect.iTl.iX;
TBool mirror = AknLayoutUtils::LayoutMirrored();
if (mirror)
{
- x = itemRect.iBr.iX;
+ x = aRect.iBr.iX;
}
TInt maxx = x;
while(column <= lastColumn)
@@ -2553,7 +2413,58 @@
// pass 3 drawing
-
+ // SERIES60 Background drawing.
+ MAknsSkinInstance *skin = AknsUtils::SkinInstance();
+ MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
+ if (!cc)
+ {
+ cc = SkinBackgroundContext();
+ }
+
+ // aRect is list item's rect, width of which is smaller than width of the list
+ // with a scroll bar. List needs to draw under scroll bar anyway, so we need to
+ // modify given rect here.
+ TRect r(aRect);
+
+ CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
+
+#ifdef RD_UI_TRANSITION_EFFECTS_LIST
+
+ MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
+
+#endif // RD_UI_TRANSITION_EFFECTS_LIST
+
+ if ( !listbox || !listbox->BackgroundDrawingSuppressed() )
+ {
+#ifdef RD_UI_TRANSITION_EFFECTS_LIST
+ if ( transApi )
+ {
+ transApi->StartDrawing( MAknListBoxTfxInternal::EListView );
+ }
+#endif // RD_UI_TRANSITION_EFFECTS_LIST
+
+ aGc.SetBrushStyle(CGraphicsContext::ESolidBrush);
+ aGc.SetPenStyle(CGraphicsContext::ESolidPen);
+
+ if ( listbox )
+ {
+ AknsDrawUtils::Background( skin, cc, listbox, aGc, aRect );
+ }
+ else
+ {
+ aGc.Clear(aRect);
+ }
+
+#ifdef RD_UI_TRANSITION_EFFECTS_LIST
+ if ( transApi )
+ {
+ transApi->StopDrawing();
+ }
+#endif // RD_UI_TRANSITION_EFFECTS_LIST
+ }
+
+ // LISTBOX LINES NEED TO BE DRAWN HERE.
+ DrawHighLight( aGc, aRect, aHighlight, skin );
#ifdef RD_UI_TRANSITION_EFFECTS_LIST
if ( transApi )
@@ -2563,6 +2474,7 @@
aGc.SetClippingRect( view->ViewRect() );
}
#endif // RD_UI_TRANSITION_EFFECTS_LIST
+
// The column draw loop
column = 0;
FOREVER
@@ -2615,15 +2527,15 @@
aGc.SetPenColor(aColors.iHighlightedText);
aGc.SetBrushColor(aColors.iHighlightedBack);
}
- CListBoxView* view = listbox->View();
- TBool useOverrideColor = view->ItemDrawer()->Flags() & CListItemDrawer::EUseOverrideSkinTextColor;
- if ( AknsUtils::AvkonSkinEnabled() && !useOverrideColor )
+
+ if (AknsUtils::AvkonSkinEnabled() && iExtension)
{
- if ( iExtension->iTextColor != NULL )
+ if (iExtension->iTextColor != NULL)
{
aGc.SetPenColor(iExtension->iTextColor);
}
- if ( aHighlight && iExtension->iHighlightedTextColor != NULL )
+
+ if (aHighlight && iExtension->iHighlightedTextColor != NULL)
{
aGc.SetPenColor(iExtension->iHighlightedTextColor);
}
@@ -2749,7 +2661,8 @@
{
CGulIcon* icon=(*IconArray())[index];
- if ( iExtension->iSubCellIconSize[column] != TSize(0,0) )
+ if ( iExtension
+ && iExtension->iSubCellIconSize[column] != TSize(0,0) )
{
TSize wanted( iExtension->iSubCellIconSize[column] );
TSize got( icon->Bitmap()->SizeInPixels() );
@@ -2822,76 +2735,6 @@
#endif //RD_UI_TRANSITION_EFFECTS_LIST
}
-// -----------------------------------------------------------------------------
-// CColumnListBoxData::DrawMarkingModeIcons
-// -----------------------------------------------------------------------------
-//
-void CColumnListBoxData::DrawMarkingModeIcons(
- const TListItemProperties& aProperties,
- CWindowGc& aGc,
- TRect& aItemRect ) const
- {
- CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
- TRect textRect( aItemRect );
-
- if ( listbox->View() && listbox->View()->ItemDrawer() )
- {
- if ( listbox->View()->ItemDrawer()->Flags()
- & CListItemDrawer::EMarkingModeEnabled &&
- !aProperties.IsSelectionHidden() &&
- iExtension->iMarkingIconArray &&
- iExtension->iMarkingIconArray->Count() ==
- KMarkingModeIconArraySize )
- {
- if ( AknLayoutUtils::LayoutMirrored() )
- {
- textRect.iBr.iX -=
- AknLayoutScalable_Avkon::list_single_graphic_pane_t1(
- 0 ).LayoutLine().ir;
- }
- else
- {
- textRect.iTl.iX +=
- AknLayoutScalable_Avkon::list_single_graphic_pane_t1(
- 0 ).LayoutLine().il;
- }
- TAknLayoutRect layoutRect;
- layoutRect.LayoutRect( aItemRect,
- AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ) );
-
- // unchecked icon
- CGulIcon* icon = (*iExtension->iMarkingIconArray)[1];
-
- if ( listbox->View()->ItemIsSelected( iExtension->iCurrentRow ) )
- {
- icon = (*iExtension->iMarkingIconArray)[0];
- }
- CFbsBitmap* bitmap = icon->Bitmap();
-
- if ( bitmap )
- {
- TSize size( bitmap->SizeInPixels() ); // set size if not already
- TSize targetSize( layoutRect.Rect().Size() );
-
- if ( size.iWidth != targetSize.iWidth &&
- size.iHeight != targetSize.iHeight )
- {
- AknIconUtils::SetSize(
- bitmap,
- targetSize,
- EAspectRatioPreservedAndUnusedSpaceRemoved );
- }
-
- aGc.BitBltMasked( layoutRect.Rect().iTl,
- bitmap,
- TRect( layoutRect.Rect().Size() ),
- icon->Mask(),
- EFalse );
- }
- aItemRect = textRect;
- }
- }
- }
void CColumnListBoxData::AddColumnL(TInt aColumn)
//
@@ -3018,8 +2861,8 @@
TInt aColumn,
const CFont* aFont)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
+ if (!iExtension) return;
TInt index = 0;
iExtension->FindRowAndColumnIndexOrAddL(index,aRow,aColumn);
iExtension->At(index).iFont=aFont;
@@ -3028,7 +2871,7 @@
EXPORT_C const CFont*
CColumnListBoxData::RowAndColumnFont(TInt aRow,TInt aColumn) const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
+ if (!iExtension) return 0;
TInt index = 0;
if (iExtension->FindRowAndColumnIndex(index,aRow,aColumn)!=0)
return 0;
@@ -3037,7 +2880,6 @@
void CColumnListBoxData::SetCurrentItemIndex(TInt aIndex)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
if( iExtension->iCurrentRow != aIndex )
{
@@ -3064,7 +2906,6 @@
const TBool aHighlight,
const TBool aIsTextClipped ) const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
TBool marqueeDisabled =
static_cast<CEikListBox*>(
@@ -3092,7 +2933,6 @@
EXPORT_C void CColumnListBoxData::SetMarqueeParams(const TInt aLoops, const TInt aScrollAmount, const TInt aScrollDelay)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
if ( iExtension->iMarquee )
{
@@ -3111,7 +2951,6 @@
EXPORT_C void CColumnListBoxData::SetMarqueeParams(const TInt aLoops, const TInt aScrollAmount,
const TInt aScrollDelay, const TInt aInterval)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
if ( iExtension->iMarquee )
{
@@ -3125,9 +2964,8 @@
EXPORT_C
void CColumnListBoxData::SetSubCellIconSize(TInt aIndex, TSize aSize)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
- if ( aIndex < 6 && aIndex >= 0 )
+ if (iExtension && aIndex < 6 && aIndex >= 0)
{
iExtension->iSubCellIconSize[aIndex] = aSize;
}
@@ -3135,8 +2973,7 @@
TSize CColumnListBoxData::GetSubCellIconSize(TInt aIndex)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- if ( aIndex < 6 && aIndex >= 0 )
+ if (iExtension && aIndex < 6 && aIndex >= 0)
{
return iExtension->iSubCellIconSize[aIndex];
}
@@ -3149,8 +2986,9 @@
//
EXPORT_C const CAknsEffectAnim* CColumnListBoxData::HighlightAnim() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- return iExtension->iAnimation;
+ if( iExtension )
+ return iExtension->iAnimation;
+ return NULL;
}
// -----------------------------------------------------------------------------
@@ -3159,7 +2997,10 @@
//
EXPORT_C void CColumnListBoxData::AboutToDrawHighlightAnim() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
+ if( !iExtension )
+ {
+ return;
+ }
if( !iExtension->iAnimation || !iExtension->iControl )
{
return;
@@ -3188,9 +3029,11 @@
EXPORT_C void CColumnListBoxData::SetHighlightAnimBackgroundDrawer(
MColumnListBoxAnimBackgroundDrawer* aDrawer )
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
- iExtension->iHighlightBgDrawer = aDrawer;
+ if( iExtension )
+ {
+ iExtension->iHighlightBgDrawer = aDrawer;
+ }
}
// -----------------------------------------------------------------------------
@@ -3199,14 +3042,15 @@
//
EXPORT_C void CColumnListBoxData::SetItemCellSize( const TSize& aSizeInPixels )
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
-
- if( iExtension->iAnimSize != aSizeInPixels )
+ if( iExtension )
{
- iExtension->Play();
+ if( iExtension->iAnimSize != aSizeInPixels )
+ {
+ iExtension->Play();
+ }
+ iExtension->iAnimSize = aSizeInPixels;
}
- iExtension->iAnimSize = aSizeInPixels;
}
// -----------------------------------------------------------------------------
@@ -3215,7 +3059,8 @@
//
EXPORT_C TBool CColumnListBoxData::HasHighlightAnim() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
+ if( !iExtension )
+ return EFalse;
if( !iExtension->iAnimation )
return EFalse;
return ETrue;
@@ -3228,7 +3073,9 @@
EXPORT_C TBool CColumnListBoxData::DrawHighlightAnim(
CBitmapContext& aGc, const TRect& aRect ) const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
+ if( !iExtension )
+ return EFalse;
+
if( !iExtension->iAnimation )
return EFalse;
@@ -3241,7 +3088,6 @@
//
void CColumnListBoxData::FocusGained()
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
iExtension->FocusGained();
}
@@ -3251,19 +3097,17 @@
//
void CColumnListBoxData::FocusLost()
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
iExtension->FocusLost();
}
void CColumnListBoxData::HandleResourceChange( TInt aType )
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s] aType = %d", "CColumnListBoxData", __FUNCTION__, aType );
// Animation is skin dependent, whenever skin changes animation changes
// too.
if( KAknsMessageSkinChange == aType )
{
- TRAP_IGNORE( iExtension->SkinChangedL() );
+ iExtension->SkinChanged();
}
else if(aType == KEikDynamicLayoutVariantSwitch)
{
@@ -3315,28 +3159,34 @@
void CColumnListBoxData::SetESSTextColor(TRgb aTextColor)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- iExtension->iTextColor = aTextColor;
+ if (iExtension)
+ iExtension->iTextColor = aTextColor;
}
void CColumnListBoxData::SetESSHighlightedTextColor(TRgb aHighlightedTextColor)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- iExtension->iHighlightedTextColor = aHighlightedTextColor;
+ if (iExtension)
+ iExtension->iHighlightedTextColor = aHighlightedTextColor;
}
EXPORT_C void CColumnListBoxData::SetColumnUnderlined( TBitFlags32 aUnderlinedColumns )
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- iExtension->iUnderlineFlagSet = ETrue;
- iExtension->iUnderlineFlags = aUnderlinedColumns;
+ if ( iExtension )
+ {
+ iExtension->iUnderlineFlagSet = ETrue;
+ iExtension->iUnderlineFlags = aUnderlinedColumns;
+ }
}
void CColumnListBoxData::SetUnderlineStyle( TListItemProperties aProperties,
CWindowGc& aGc,
TInt aColumn ) const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
+ if ( !iExtension )
+ {
+ return;
+ }
+
if ( !iExtension->iUnderlineFlagSet )
{
// underlining is already either on or off and
@@ -3363,9 +3213,13 @@
//
EXPORT_C void CColumnListBoxData::ResetSLSubCellArray()
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
+ if ( !iExtension )
+ {
+ return;
+ }
+
iExtension->iMarginRect = TRect::EUninitialized;
- if ( iExtension->iUseLayoutData )
+ if ( iExtension && iExtension->iUseLayoutData )
{
iExtension->iUseLayoutData = EFalse;
#ifdef RD_UI_TRANSITION_EFFECTS_LIST
@@ -3393,8 +3247,8 @@
EXPORT_C void CColumnListBoxData::SetGraphicSubCellL(TInt aSubCell,
const TAknWindowLineLayout &aGraphicLayout)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
+ if (!iExtension) return;
TInt index = 0;
iExtension->FindSLSubCellIndexOrAddL(index,aSubCell);
iExtension->AtSL(index).iTextLayout=NULL;
@@ -3442,8 +3296,8 @@
EXPORT_C void CColumnListBoxData::SetTextSubCellL(TInt aSubCell,
const TAknTextLineLayout &aTextLayout)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
+ if (!iExtension) return;
TInt index = 0;
iExtension->FindSLSubCellIndexOrAddL(index,aSubCell);
iExtension->AtSL(index).iTextLayout=aTextLayout;
@@ -3492,7 +3346,6 @@
const TAknTextLineLayout &aTextLayout,
TInt aAffectedSubCell)
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
// iConditionValue of affected subcell (=text subcell, which has different layouts)
// contains index of graphical subcell, which existence should be checked first.
@@ -3502,6 +3355,7 @@
// for compabitility - needed at least for text wrapping
SetOptionalColumnL( aSubCell, ETrue );
+ if (!iExtension) return;
TInt i = 0x01;
i = i << aSubCell;
@@ -3628,8 +3482,10 @@
//
TBool CColumnListBoxData::UsesScalableLayoutData() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- return iExtension->iUseLayoutData;
+ if (iExtension)
+ return iExtension->iUseLayoutData;
+
+ return EFalse;
}
// -----------------------------------------------------------------------------
@@ -3638,7 +3494,11 @@
//
void CColumnListBoxData::EnableStretching( const TBool aEnabled )
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
+ if ( !iExtension )
+ {
+ return;
+ }
+
iExtension->iStretchingEnabled = aEnabled;
}
@@ -3649,7 +3509,11 @@
//
EXPORT_C TBool CColumnListBoxData::StretchingEnabled() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
+ if ( !iExtension )
+ {
+ return EFalse;
+ }
+
return iExtension->iStretchingEnabled;
}
@@ -3675,7 +3539,6 @@
const TDesC& aText,
const TRect& aItemRect ) const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
_AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
TInt column = 0;
@@ -3790,7 +3653,6 @@
//
EXPORT_C void CColumnListBoxData::SubCellsMightIntersect( const TBool aMightIntersect )
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
iExtension->iSubCellsMightIntersect = aMightIntersect;
}
@@ -3891,14 +3753,16 @@
EXPORT_C TUint32 CColumnListBoxData::CurrentItemTextWasClipped() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- return iExtension->iClippedColumns;
+ return iExtension ? iExtension->iClippedColumns : 0;
}
TBool CColumnListBoxData::KineticScrollingEnabled() const
{
- __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
- return iExtension->iKineticScrolling;
+ if ( iExtension )
+ {
+ return iExtension->iKineticScrolling;
+ }
+ return EFalse;
}