uifw/eikctl/src/EIKCLBD.CPP
branchRCL_3
changeset 23 3d340a0166ff
parent 16 71dd06cfe933
child 25 941195f2d488
equal deleted inserted replaced
18:0aa5fbdfbc30 23:3d340a0166ff
    30 #include <AknBidiTextUtils.h>
    30 #include <AknBidiTextUtils.h>
    31 #include <skinlayout.cdl.h>
    31 #include <skinlayout.cdl.h>
    32 #include <layoutmetadata.cdl.h>
    32 #include <layoutmetadata.cdl.h>
    33 #include <aknlayoutscalable_avkon.cdl.h>
    33 #include <aknlayoutscalable_avkon.cdl.h>
    34 #include <aknphysics.h>
    34 #include <aknphysics.h>
       
    35 #include <AknIconArray.h>
       
    36 #include <avkon.mbg>
    35 
    37 
    36 
    38 
    37 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
    39 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
    38 #include <aknlistloadertfx.h>
    40 #include <aknlistloadertfx.h>
    39 #include <aknlistboxtfxinternal.h>
    41 #include <aknlistboxtfxinternal.h>
   114     TBool SyncAndDrawAnim( CBitmapContext& aGc, const TRect& aRect );
   116     TBool SyncAndDrawAnim( CBitmapContext& aGc, const TRect& aRect );
   115     MAknsControlContext* SkinBackgroundContext() const;
   117     MAknsControlContext* SkinBackgroundContext() const;
   116     void DeleteAnim();
   118     void DeleteAnim();
   117     void FocusGained();
   119     void FocusGained();
   118     void FocusLost();
   120     void FocusLost();
   119     void SkinChanged();
   121     void SkinChangedL();
   120     void SetControl( CCoeControl* aControl );
   122     void SetControl( CCoeControl* aControl );
   121 
   123 
   122     // Implementation of MCoeForegroundObserver
   124     // Implementation of MCoeForegroundObserver
   123     void HandleGainingForeground();
   125     void HandleGainingForeground();
   124     void HandleLosingForeground();
   126     void HandleLosingForeground();
   139     
   141     
   140     TBool DrawPressedDownEffectL( MAknsSkinInstance* aInstance, 
   142     TBool DrawPressedDownEffectL( MAknsSkinInstance* aInstance, 
   141                                  CWindowGc& aGc, 
   143                                  CWindowGc& aGc, 
   142                                  const TRect& aOutRect, 
   144                                  const TRect& aOutRect, 
   143                                  const TRect& aInnerRect ) const;
   145                                  const TRect& aInnerRect ) const;
       
   146 
       
   147     void LoadMarkingIconsL();
       
   148 
   144 public: //for handling column alignment
   149 public: //for handling column alignment
   145     struct TColumnExt
   150     struct TColumnExt
   146         {
   151         {
   147         TInt    iColumn; // Must be first entry 
   152         TInt    iColumn; // Must be first entry 
   148         TBool   iLayoutAlign;//is layout alignment or Set by client 
   153         TBool   iLayoutAlign;//is layout alignment or Set by client 
   237 
   242 
   238    
   243    
   239     
   244     
   240     CArrayFix<TColumnExt>* iColumnExtArray; //for column alignment
   245     CArrayFix<TColumnExt>* iColumnExtArray; //for column alignment
   241     TRect iMarginRect;
   246     TRect iMarginRect;
       
   247     CAknIconArray* iMarkingIconArray;
   242     };
   248     };
   243 
   249 
   244 /**
   250 /**
   245 * High priority is well argumented because running the active object will
   251 * High priority is well argumented because running the active object will
   246 * result in animation deletion -> results in freeing resources.
   252 * result in animation deletion -> results in freeing resources.
   304     delete cenRep;
   310     delete cenRep;
   305 #endif // RD_LIST_STRETCH
   311 #endif // RD_LIST_STRETCH
   306 
   312 
   307     
   313     
   308     iKineticScrolling = CAknPhysics::FeatureEnabled();
   314     iKineticScrolling = CAknPhysics::FeatureEnabled();
       
   315     LoadMarkingIconsL();
   309     _AKNTRACE_FUNC_EXIT;
   316     _AKNTRACE_FUNC_EXIT;
   310     }
   317     }
   311 
   318 
   312 CColumnListBoxDataExtension::~CColumnListBoxDataExtension()
   319 CColumnListBoxDataExtension::~CColumnListBoxDataExtension()
   313     {
   320     {
   328     delete iRowAndSubCellArray;
   335     delete iRowAndSubCellArray;
   329     delete iSLSubCellArray;
   336     delete iSLSubCellArray;
   330     delete iColorBmp;
   337     delete iColorBmp;
   331     delete iHiliBmp;
   338     delete iHiliBmp;
   332     delete  iColumnExtArray;
   339     delete  iColumnExtArray;
       
   340 
       
   341     if ( iMarkingIconArray )
       
   342         {
       
   343         iMarkingIconArray->ResetAndDestroy();
       
   344         }
       
   345 
       
   346     delete iMarkingIconArray;
   333     }
   347     }
   334 
   348 
   335 MAknsControlContext* CColumnListBoxDataExtension::SkinBackgroundContext() const
   349 MAknsControlContext* CColumnListBoxDataExtension::SkinBackgroundContext() const
   336     {
   350     {
   337     if ( iSkinEnabled )
   351     if ( iSkinEnabled )
   518         {
   532         {
   519         NoAnimIfError( iAnimation->Pause() );
   533         NoAnimIfError( iAnimation->Pause() );
   520         }
   534         }
   521     }
   535     }
   522 
   536 
   523 // -----------------------------------------------------------------------------
   537 
   524 // CColumnListBoxDataExtension::SkinChanged
   538 // -----------------------------------------------------------------------------
   525 // -----------------------------------------------------------------------------
   539 // CColumnListBoxDataExtension::SkinChangedL
   526 //
   540 // -----------------------------------------------------------------------------
   527 void CColumnListBoxDataExtension::SkinChanged()
   541 //
       
   542 void CColumnListBoxDataExtension::SkinChangedL()
   528     {
   543     {
   529     DeleteAnim();
   544     DeleteAnim();
   530     TryCreateAnimation();
   545     TryCreateAnimation();
   531     CreateColorBitmapsL();
   546     CreateColorBitmapsL();
   532     }
   547     LoadMarkingIconsL();
       
   548     }
       
   549 
   533 
   550 
   534 // -----------------------------------------------------------------------------
   551 // -----------------------------------------------------------------------------
   535 // CColumnListBoxDataExtension::SetControl
   552 // CColumnListBoxDataExtension::SetControl
   536 // -----------------------------------------------------------------------------
   553 // -----------------------------------------------------------------------------
   537 //
   554 //
  1120                                      aInnerRect,
  1137                                      aInnerRect,
  1121                                      KAknsIIDQsnFrListPressed,
  1138                                      KAknsIIDQsnFrListPressed,
  1122                                      KAknsIIDQsnFrListCenterPressed );
  1139                                      KAknsIIDQsnFrListCenterPressed );
  1123     }
  1140     }
  1124 
  1141 
       
  1142 
       
  1143 // -----------------------------------------------------------------------------
       
  1144 // CColumnListBoxDataExtension::LoadMarkingIconsL
       
  1145 // -----------------------------------------------------------------------------
       
  1146 //
       
  1147 void CColumnListBoxDataExtension::LoadMarkingIconsL()
       
  1148     {
       
  1149     if ( !iMarkingIconArray )
       
  1150         {
       
  1151         iMarkingIconArray = new ( ELeave ) CAknIconArray( 2 );
       
  1152         }
       
  1153     else
       
  1154         {
       
  1155         iMarkingIconArray->ResetAndDestroy();
       
  1156         }
       
  1157 
       
  1158     MAknsSkinInstance* skin = AknsUtils::SkinInstance();
       
  1159     const TDesC& avkonIconFile = AknIconUtils::AvkonIconFileName();
       
  1160 
       
  1161     CGulIcon* icon = AknsUtils::CreateGulIconL( skin, 
       
  1162             KAknsIIDQgnPropCheckboxOn, 
       
  1163             avkonIconFile, 
       
  1164             EMbmAvkonQgn_prop_checkbox_on, 
       
  1165             EMbmAvkonQgn_prop_checkbox_on_mask );
       
  1166     
       
  1167     CleanupStack::PushL( icon );
       
  1168     iMarkingIconArray->AppendL( icon );
       
  1169     CleanupStack::Pop( icon );
       
  1170 
       
  1171     icon = AknsUtils::CreateGulIconL( skin, 
       
  1172             KAknsIIDQgnPropCheckboxOff, 
       
  1173             avkonIconFile, 
       
  1174             EMbmAvkonQgn_prop_checkbox_off, 
       
  1175             EMbmAvkonQgn_prop_checkbox_off_mask );
       
  1176 
       
  1177     CleanupStack::PushL( icon );
       
  1178     iMarkingIconArray->AppendL( icon );
       
  1179     CleanupStack::Pop( icon );
       
  1180     }
       
  1181 
       
  1182 
  1125 EXPORT_C CCoeControl *CColumnListBoxData::Control() const 
  1183 EXPORT_C CCoeControl *CColumnListBoxData::Control() const 
  1126     {
  1184     {
       
  1185 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1127     return iExtension->iControl;
  1186     return iExtension->iControl;
  1128     }
  1187     }
  1129 
  1188 
  1130 EXPORT_C void CColumnListBoxData::SetControl(CCoeControl *aControl)
  1189 EXPORT_C void CColumnListBoxData::SetControl(CCoeControl *aControl)
  1131     {
  1190     {
       
  1191 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1132     iExtension->SetControl( aControl );
  1192     iExtension->SetControl( aControl );
  1133     }
  1193     }
  1134 
  1194 
  1135 
  1195 
  1136 EXPORT_C MAknsControlContext* CColumnListBoxData::SkinBackgroundContext() const
  1196 EXPORT_C MAknsControlContext* CColumnListBoxData::SkinBackgroundContext() const
  1137     {
  1197     {
       
  1198 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1138     if (iExtension->iSkinEnabled)
  1199     if (iExtension->iSkinEnabled)
  1139         {
  1200         {
  1140         return iExtension->iSkinControlContext;
  1201         return iExtension->iSkinControlContext;
  1141         }
  1202         }
  1142         
  1203         
  1143     return NULL;
  1204     return NULL;
  1144     }
  1205     }
  1145 
  1206 
  1146 void CColumnListBoxData::SetSkinBackgroundContext(CAknsListBoxBackgroundControlContext *aContext)
  1207 void CColumnListBoxData::SetSkinBackgroundContext(CAknsListBoxBackgroundControlContext *aContext)
  1147     {
  1208     {
       
  1209 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1148     delete iExtension->iSkinControlContext;
  1210     delete iExtension->iSkinControlContext;
  1149     iExtension->iSkinControlContext = aContext;
  1211     iExtension->iSkinControlContext = aContext;
  1150     }
  1212     }
  1151 
  1213 
  1152 void CColumnListBoxData::CreatePictographInterfaceL()
  1214 void CColumnListBoxData::CreatePictographInterfaceL()
  1153     {
  1215     {
       
  1216 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1154     if ( !iExtension->iPictoInterface )
  1217     if ( !iExtension->iPictoInterface )
  1155         {
  1218         {
  1156         iExtension->iPictoInterface = CAknPictographInterface::NewL(
  1219         iExtension->iPictoInterface = CAknPictographInterface::NewL(
  1157             *iExtension->iControl, *iExtension );
  1220             *iExtension->iControl, *iExtension );
  1158         }
  1221         }
  1159     }
  1222     }
  1160 
  1223 
  1161 EXPORT_C void CColumnListBoxData::SetSkinHighlightFrame(const TAknsItemID *aFrameId, const TAknsItemID *aFrameCenterId)
  1224 EXPORT_C void CColumnListBoxData::SetSkinHighlightFrame(const TAknsItemID *aFrameId, const TAknsItemID *aFrameCenterId)
  1162     {
  1225     {
       
  1226 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1163     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1227     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1164     iExtension->iSkinHighlightFrameId = aFrameId;
  1228     iExtension->iSkinHighlightFrameId = aFrameId;
  1165     iExtension->iSkinHighlightFrameCenterId = aFrameCenterId;
  1229     iExtension->iSkinHighlightFrameCenterId = aFrameCenterId;
  1166     }
  1230     }
  1167 
  1231 
  1168 EXPORT_C void CColumnListBoxData::SetSkinEnabledL(TBool aEnabled)
  1232 EXPORT_C void CColumnListBoxData::SetSkinEnabledL(TBool aEnabled)
  1169     {
  1233     {
       
  1234 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1170     CListBoxData::SetSkinEnabledL(aEnabled);
  1235     CListBoxData::SetSkinEnabledL(aEnabled);
  1171     iExtension->iSkinEnabled = aEnabled;
  1236     iExtension->iSkinEnabled = aEnabled;
  1172     }
  1237     }
  1173 
  1238 
  1174 EXPORT_C void CColumnListBoxData::SetSkinStyle(const TAknsItemID *aId, const TRect &aTileRect)
  1239 EXPORT_C void CColumnListBoxData::SetSkinStyle(const TAknsItemID *aId, const TRect &aTileRect)
  1175     {
  1240     {
       
  1241 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1176     if (iExtension->iSkinControlContext)
  1242     if (iExtension->iSkinControlContext)
  1177         {
  1243         {
  1178         iExtension->iSkinControlContext->SetTiledBitmap(*aId);
  1244         iExtension->iSkinControlContext->SetTiledBitmap(*aId);
  1179         iExtension->iSkinControlContext->SetTiledRect(aTileRect);
  1245         iExtension->iSkinControlContext->SetTiledRect(aTileRect);
  1180         }
  1246         }
  1181     }
  1247     }
  1182 
  1248 
  1183 EXPORT_C void CColumnListBoxData::SetListEndSkinStyle(const TAknsItemID *aId, const TRect &aTileRect)
  1249 EXPORT_C void CColumnListBoxData::SetListEndSkinStyle(const TAknsItemID *aId, const TRect &aTileRect)
  1184     {
  1250     {
       
  1251 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1185     if (iExtension->iSkinControlContext)
  1252     if (iExtension->iSkinControlContext)
  1186         {
  1253         {
  1187         iExtension->iSkinControlContext->SetBottomBitmap(*aId);
  1254         iExtension->iSkinControlContext->SetBottomBitmap(*aId);
  1188         iExtension->iSkinControlContext->SetBottomRect(aTileRect);
  1255         iExtension->iSkinControlContext->SetBottomRect(aTileRect);
  1189         }
  1256         }
  1190     }
  1257     }
  1191 
  1258 
  1192 void CColumnListBoxData::CreateMarqueeControlL()
  1259 void CColumnListBoxData::CreateMarqueeControlL()
  1193     {
  1260     {
       
  1261 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1194     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1262     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1195     if ( !iExtension->iMarquee )
  1263     if ( !iExtension->iMarquee )
  1196         {
  1264         {
  1197         iExtension->iMarquee = CAknMarqueeControl::NewL();
  1265         iExtension->iMarquee = CAknMarqueeControl::NewL();
  1198         }
  1266         }
  1208     iExtension->i2ndLineMarquee->SetRedrawCallBack(callBack);
  1276     iExtension->i2ndLineMarquee->SetRedrawCallBack(callBack);
  1209     }
  1277     }
  1210 
  1278 
  1211 void CColumnListBoxData::ResetMarquee()
  1279 void CColumnListBoxData::ResetMarquee()
  1212     {
  1280     {
       
  1281 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1213     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1282     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1214     if (iExtension->iMarquee)
  1283     if (iExtension->iMarquee)
  1215         {
  1284         {
  1216         iExtension->iMarquee->Reset();
  1285         iExtension->iMarquee->Reset();
  1217         }
  1286         }
  1221         }
  1290         }
  1222     }
  1291     }
  1223 
  1292 
  1224 TInt CColumnListBoxData::CurrentMarqueeItemIndex()
  1293 TInt CColumnListBoxData::CurrentMarqueeItemIndex()
  1225     {
  1294     {
       
  1295 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1226     return iExtension->iCurrentItem;
  1296     return iExtension->iCurrentItem;
  1227     }
  1297     }
  1228 
  1298 
  1229 void CColumnListBoxData::SetCurrentMarqueeItemIndex(TInt aIndex)
  1299 void CColumnListBoxData::SetCurrentMarqueeItemIndex(TInt aIndex)
  1230     {
  1300     {
       
  1301 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1231     iExtension->iCurrentItem = aIndex;
  1302     iExtension->iCurrentItem = aIndex;
  1232     }
  1303     }
  1233 
  1304 
  1234 //
  1305 //
  1235 // Enables or disables marquee.
  1306 // Enables or disables marquee.
  1236 //
  1307 //
  1237 EXPORT_C void CColumnListBoxData::EnableMarqueeL(TBool aEnable)
  1308 EXPORT_C void CColumnListBoxData::EnableMarqueeL(TBool aEnable)
  1238     {
  1309     {
       
  1310 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1239     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1311     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1240     // CreateMarqueeControlL does nothing if marquee already exists,
  1312     // CreateMarqueeControlL does nothing if marquee already exists,
  1241     // so let's just call it just in case.
  1313     // so let's just call it just in case.
  1242     CreateMarqueeControlL();
  1314     CreateMarqueeControlL();
  1243     iExtension->iMarquee->EnableMarquee(aEnable);
  1315     iExtension->iMarquee->EnableMarquee(aEnable);
  1244     iExtension->i2ndLineMarquee->EnableMarquee(aEnable);
  1316     iExtension->i2ndLineMarquee->EnableMarquee(aEnable);
  1245     }
  1317     }
  1246 
  1318 
  1247 EXPORT_C void CColumnListBoxData::SetSeparatorLinePosition(TAknSeparatorLinePosition aPosition)
  1319 EXPORT_C void CColumnListBoxData::SetSeparatorLinePosition(TAknSeparatorLinePosition aPosition)
  1248     {
  1320     {
  1249     if (iExtension)
  1321 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1250         iExtension->iSeparatorLinePosition = aPosition;
  1322     iExtension->iSeparatorLinePosition = aPosition;
  1251     }
  1323     }
  1252 EXPORT_C TAknSeparatorLinePosition CColumnListBoxData::SeparatorLinePosition() const
  1324 EXPORT_C TAknSeparatorLinePosition CColumnListBoxData::SeparatorLinePosition() const
  1253     {
  1325     {
  1254     if (iExtension)
  1326 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1255         return iExtension->iSeparatorLinePosition;
  1327     return iExtension->iSeparatorLinePosition;
  1256     else
       
  1257         return ENoLine;
       
  1258     }
  1328     }
  1259 EXPORT_C CAknLayoutData *CColumnListBoxData::LayoutData() const
  1329 EXPORT_C CAknLayoutData *CColumnListBoxData::LayoutData() const
  1260     {
  1330     {
  1261     return NULL;
  1331     return NULL;
  1262     }
  1332     }
  1309 EXPORT_C CColumnListBoxData::~CColumnListBoxData()
  1379 EXPORT_C CColumnListBoxData::~CColumnListBoxData()
  1310 //
  1380 //
  1311 //    D'tor
  1381 //    D'tor
  1312 //
  1382 //
  1313     {
  1383     {
       
  1384 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1314     delete iColumnArray;
  1385     delete iColumnArray;
  1315     if (IconArray())
  1386     if (IconArray())
  1316         {
  1387         {
  1317         IconArray()->ResetAndDestroy();
  1388         IconArray()->ResetAndDestroy();
  1318         if (iExtension)
  1389         delete iExtension->iIconArray;
  1319             delete iExtension->iIconArray;
       
  1320         }
  1390         }
  1321     delete iExtension;
  1391     delete iExtension;
  1322     }
  1392     }
  1323 
  1393 
  1324 EXPORT_C void CColumnListBoxData::ConstructLD()
  1394 EXPORT_C void CColumnListBoxData::ConstructLD()
  1391 EXPORT_C void CColumnListBoxData::SetColumnWidthPixelL(TInt aColumn,TInt aWidth)
  1461 EXPORT_C void CColumnListBoxData::SetColumnWidthPixelL(TInt aColumn,TInt aWidth)
  1392 //
  1462 //
  1393 //    Set a columns width
  1463 //    Set a columns width
  1394 //
  1464 //
  1395     {
  1465     {
       
  1466 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1396     TInt index;
  1467     TInt index;
  1397     FindColumnIndexOrAddL(index,aColumn);
  1468     FindColumnIndexOrAddL(index,aColumn);
  1398     At(index).iWidth=aWidth;
  1469     At(index).iWidth=aWidth;
  1399     if ( iExtension && iExtension->iUseLayoutData )
  1470     if ( iExtension->iUseLayoutData )
  1400         {
  1471         {
  1401         iExtension->iUseLayoutData = EFalse;
  1472         iExtension->iUseLayoutData = EFalse;
  1402         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1473         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1403 #ifdef RD_UI_TRANSITION_EFFECTS_LIST 
  1474 #ifdef RD_UI_TRANSITION_EFFECTS_LIST 
  1404         MAknListBoxTfxInternal* transApi =
  1475         MAknListBoxTfxInternal* transApi =
  1465 EXPORT_C void CColumnListBoxData::SetColumnBaselinePosL(TInt aColumn,TInt aPos)
  1536 EXPORT_C void CColumnListBoxData::SetColumnBaselinePosL(TInt aColumn,TInt aPos)
  1466 //
  1537 //
  1467 //  Set a columns baseline position
  1538 //  Set a columns baseline position
  1468 //
  1539 //
  1469     {
  1540     {
       
  1541 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1470     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1542     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1471     TInt index;
  1543     TInt index;
  1472     FindColumnIndexOrAddL(index,aColumn);
  1544     FindColumnIndexOrAddL(index,aColumn);
  1473     At(index).iBaseline=aPos;
  1545     At(index).iBaseline=aPos;
  1474     
  1546     
  1475     // can not be nicely supported by new drawing system
  1547     // can not be nicely supported by new drawing system
  1476     // --> revert to Symbian style drawing
  1548     // --> revert to Symbian style drawing
  1477     if ( iExtension && iExtension->iUseLayoutData )
  1549     if ( iExtension->iUseLayoutData )
  1478         {
  1550         {
  1479         iExtension->iUseLayoutData = EFalse;
  1551         iExtension->iUseLayoutData = EFalse;
  1480 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1552 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1481         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1553         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1482         MAknListBoxTfxInternal* transApi =
  1554         MAknListBoxTfxInternal* transApi =
  1507 EXPORT_C void CColumnListBoxData::SetColumnMarginsL(TInt aColumn,TMargins aMargins)
  1579 EXPORT_C void CColumnListBoxData::SetColumnMarginsL(TInt aColumn,TMargins aMargins)
  1508 //
  1580 //
  1509 //  Set a columns vertical cap
  1581 //  Set a columns vertical cap
  1510 //
  1582 //
  1511     {
  1583     {
       
  1584 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1512     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1585     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1513     TInt index;
  1586     TInt index;
  1514     FindColumnIndexOrAddL(index,aColumn);
  1587     FindColumnIndexOrAddL(index,aColumn);
  1515     At(index).iMargins=aMargins;
  1588     At(index).iMargins=aMargins;
  1516 
  1589 
  1517     // can not be nicely supported by new drawing system
  1590     // can not be nicely supported by new drawing system
  1518     // --> revert to Symbian style drawing
  1591     // --> revert to Symbian style drawing
  1519     if ( iExtension && iExtension->iUseLayoutData )
  1592     if ( iExtension->iUseLayoutData )
  1520         {
  1593         {
  1521         iExtension->iUseLayoutData = EFalse;
  1594         iExtension->iUseLayoutData = EFalse;
  1522 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1595 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1523         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1596         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1524         MAknListBoxTfxInternal* transApi =
  1597         MAknListBoxTfxInternal* transApi =
  1626 EXPORT_C void CColumnListBoxData::SetColumnAlignmentL(TInt aColumn,CGraphicsContext::TTextAlign aAlign)
  1699 EXPORT_C void CColumnListBoxData::SetColumnAlignmentL(TInt aColumn,CGraphicsContext::TTextAlign aAlign)
  1627 //
  1700 //
  1628 //    Set a columns alignment
  1701 //    Set a columns alignment
  1629 //
  1702 //
  1630     {
  1703     {
       
  1704 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1631     TInt index;
  1705     TInt index;
  1632     FindColumnIndexOrAddL(index,aColumn);
  1706     FindColumnIndexOrAddL(index,aColumn);
  1633     At(index).iAlign=aAlign;
  1707     At(index).iAlign=aAlign;
  1634     iExtension->SetColumnLayoutAlignmentL( aColumn);  
  1708     iExtension->SetColumnLayoutAlignmentL( aColumn);  
  1635     }
  1709     }
  1726 EXPORT_C CArrayPtr<CGulIcon>* CColumnListBoxData::IconArray() const
  1800 EXPORT_C CArrayPtr<CGulIcon>* CColumnListBoxData::IconArray() const
  1727 //
  1801 //
  1728 //    Return the list of icons
  1802 //    Return the list of icons
  1729 //
  1803 //
  1730     {
  1804     {
  1731     if (iExtension)
  1805 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1732         return iExtension->iIconArray;
  1806     return iExtension->iIconArray;
  1733     else
       
  1734         return 0;
       
  1735     }
  1807     }
  1736 
  1808 
  1737 EXPORT_C void CColumnListBoxData::SetIconArray(CArrayPtr<CGulIcon>* aArray)
  1809 EXPORT_C void CColumnListBoxData::SetIconArray(CArrayPtr<CGulIcon>* aArray)
  1738 //
  1810 //
  1739 //    Passes ownership of the icon list aArray (assumes any previous list has been deleted by the caller)
  1811 //    Passes ownership of the icon list aArray (assumes any previous list has been deleted by the caller)
  1740 //
  1812 //
  1741     {
  1813     {
       
  1814 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1742     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1815     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1743     if (iExtension)
  1816     iExtension->iIconArray=aArray; 
  1744         iExtension->iIconArray=aArray;
       
  1745     else
       
  1746         {
       
  1747         aArray->ResetAndDestroy();
       
  1748         delete aArray;
       
  1749         }    
       
  1750     }
  1817     }
  1751 
  1818 
  1752 EXPORT_C CFont* CColumnListBoxData::Font(const TListItemProperties& /*aItemProperties*/, TInt aColumn) const
  1819 EXPORT_C CFont* CColumnListBoxData::Font(const TListItemProperties& /*aItemProperties*/, TInt aColumn) const
  1753     {
  1820     {
  1754     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1821     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  1776 #endif
  1843 #endif
  1777     }
  1844     }
  1778 
  1845 
  1779 void CColumnListBoxData::DrawHighLight( CWindowGc& aGc, const TRect& aRect, TBool aHighlight, MAknsSkinInstance* aSkin ) const
  1846 void CColumnListBoxData::DrawHighLight( CWindowGc& aGc, const TRect& aRect, TBool aHighlight, MAknsSkinInstance* aSkin ) const
  1780     {
  1847     {
       
  1848 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1781     // SERIES60 Highlight drawing.
  1849     // SERIES60 Highlight drawing.
  1782     if( aHighlight )
  1850     if( aHighlight )
  1783         {
  1851         {
  1784         // same as CFormattedCellListBoxData::DrawDefaultHighlight
  1852         // same as CFormattedCellListBoxData::DrawDefaultHighlight
  1785         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1853         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  1941                                      const TDesC* aText,
  2009                                      const TDesC* aText,
  1942                                      const TRect& aRect,
  2010                                      const TRect& aRect,
  1943                                      TBool aHighlight,
  2011                                      TBool aHighlight,
  1944                                      const TColors& aColors ) const
  2012                                      const TColors& aColors ) const
  1945     {
  2013     {
       
  2014 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  1946     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );    
  2015     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );    
  1947     
  2016     
  1948     __ASSERT_DEBUG( iExtension->iControl, Panic( EEikPanicNullPointer ));
  2017     __ASSERT_DEBUG( iExtension->iControl, Panic( EEikPanicNullPointer ));
  1949     
  2018     
  1950     CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
  2019     CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
  1958     TInt column=0;
  2027     TInt column=0;
  1959     TPtrC text;
  2028     TPtrC text;
  1960     TPtrC tempText;
  2029     TPtrC tempText;
  1961 
  2030 
  1962     TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText;
  2031     TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText;
       
  2032     
       
  2033     TBool markingMode = EFalse;
       
  2034     TRect itemRect( aRect );
       
  2035     
       
  2036     if ( listbox->View() && listbox->View()->ItemDrawer() )
       
  2037         {
       
  2038         if ( listbox->View()->ItemDrawer()->Flags() 
       
  2039                 & CListItemDrawer::EMarkingModeEnabled
       
  2040                 && iExtension->iMarkingIconArray
       
  2041                 &&  iExtension->iMarkingIconArray->Count() == 2 )
       
  2042             {
       
  2043             markingMode = ETrue;
       
  2044             itemRect.iTl.iX += 
       
  2045                     AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 0 ).LayoutLine().il;
       
  2046             }
       
  2047         }
  1963 
  2048 
  1964     MAknsSkinInstance *skin = AknsUtils::SkinInstance();
  2049     MAknsSkinInstance *skin = AknsUtils::SkinInstance();
  1965     MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
  2050     MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() );
  1966     if ( !cc )
  2051     if ( !cc )
  1967         {
  2052         {
  1973     
  2058     
  1974     Mem::FillZ( &rectClipped[0], KMaxColumn * sizeof( TBool ) );
  2059     Mem::FillZ( &rectClipped[0], KMaxColumn * sizeof( TBool ) );
  1975     
  2060     
  1976     if ( iExtension->iSubCellsMightIntersect )
  2061     if ( iExtension->iSubCellsMightIntersect )
  1977         {
  2062         {
  1978         CheckIfSubCellsIntersect( &textLines[0], &rectClipped[0], *aText, aRect );
  2063         CheckIfSubCellsIntersect( &textLines[0], &rectClipped[0], *aText, itemRect );
  1979         }
  2064         }
  1980 
       
  1981 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  2065 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  1982     MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
  2066     MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
  1983 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2067 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  1984 
  2068 
  1985     if ( !listbox || !listbox->BackgroundDrawingSuppressed() )
  2069     if ( !listbox || !listbox->BackgroundDrawingSuppressed() )
  2015         {
  2099         {
  2016         AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin );
  2100         AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin );
  2017         }
  2101         }
  2018     DrawHighLight( aGc, aRect, aHighlight, skin );
  2102     DrawHighLight( aGc, aRect, aHighlight, skin );
  2019     
  2103     
       
  2104     if ( markingMode && !aItemProperties.IsSelectionHidden() )
       
  2105         {
       
  2106         TAknLayoutRect layoutRect;
       
  2107         layoutRect.LayoutRect( aRect, 
       
  2108                 AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ) );
       
  2109         
       
  2110         aGc.SetPenColor( aColors.iText );
       
  2111         aGc.SetPenStyle( CGraphicsContext::ESolidPen );
       
  2112 
       
  2113         CGulIcon* icon = (*iExtension->iMarkingIconArray)[1]; // unchecked
       
  2114 
       
  2115         if ( listbox->View()->ItemIsSelected( iExtension->iCurrentRow ) )
       
  2116             {
       
  2117             icon = (*iExtension->iMarkingIconArray)[0];
       
  2118             }
       
  2119         
       
  2120         CFbsBitmap* bitmap = icon->Bitmap();
       
  2121 
       
  2122         if ( bitmap )
       
  2123             {
       
  2124             TSize size( bitmap->SizeInPixels() ); // set size if not already
       
  2125             TSize targetSize( layoutRect.Rect().Size() );
       
  2126             
       
  2127             if ( size.iWidth != targetSize.iWidth && size.iHeight != targetSize.iHeight )
       
  2128                 {
       
  2129                 AknIconUtils::SetSize( bitmap, targetSize,
       
  2130                         EAspectRatioPreservedAndUnusedSpaceRemoved ); 
       
  2131                 }
       
  2132 
       
  2133             aGc.BitBltMasked( layoutRect.Rect().iTl, bitmap, TRect( layoutRect.Rect().Size() ), icon->Mask(), EFalse );
       
  2134             }
       
  2135         
       
  2136         }
       
  2137     
  2020     // The column draw loop
  2138     // The column draw loop
  2021     column = 0;
  2139     column = 0;
  2022     TInt subCellIndex = 0;
  2140     TInt subCellIndex = 0;
  2023 
       
  2024     if ( !iExtension ) { return; }
       
  2025     
  2141     
  2026 #ifdef RD_UI_TRANSITION_EFFECTS_LIST   
  2142 #ifdef RD_UI_TRANSITION_EFFECTS_LIST   
  2027     if ( transApi )
  2143     if ( transApi )
  2028         {
  2144         {
  2029         transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
  2145         transApi->StartDrawing( MAknListBoxTfxInternal::EListItem );
  2127                     default:  break;
  2243                     default:  break;
  2128                     };
  2244                     };
  2129                 }
  2245                 }
  2130             
  2246             
  2131             TAknLayoutText textLayout;
  2247             TAknLayoutText textLayout;
  2132             textLayout.LayoutText( aRect, textLineLayout, usedFont );
  2248             textLayout.LayoutText( itemRect, textLineLayout, usedFont );
  2133             // *2 == leave some room for marquee
  2249             // *2 == leave some room for marquee
  2134             const TInt maxlen( KMaxColumnDataLength * 2 ); 
  2250             const TInt maxlen( KMaxColumnDataLength * 2 ); 
  2135             TBuf<maxlen> convBuf = text.Left(maxlen);
  2251             TBuf<maxlen> convBuf = text.Left(maxlen);
  2136 
  2252 
  2137             // Note that this potentially modifies the text so its lenght in pixels
  2253             // Note that this potentially modifies the text so its lenght in pixels
  2174             
  2290             
  2175             if ( iExtension->IsMarqueeOn() && doesNotFit && !marqueeDisabled )
  2291             if ( iExtension->IsMarqueeOn() && doesNotFit && !marqueeDisabled )
  2176                 {
  2292                 {
  2177                 iExtension->iMarquee->UseLogicalToVisualConversion( bidiConv );
  2293                 iExtension->iMarquee->UseLogicalToVisualConversion( bidiConv );
  2178                 
  2294                 
  2179                 if ( iExtension->iMarquee->DrawText( aGc, aRect, textLineLayout, convBuf, usedFont, textColor ) )
  2295                 if ( iExtension->iMarquee->DrawText( aGc, itemRect, textLineLayout, convBuf, usedFont, textColor ) )
  2180                     {
  2296                     {
  2181                     // all the loops have been executed
  2297                     // all the loops have been executed
  2182                     textLayout.DrawText( aGc, convBuf, bidiConv, textColor );
  2298                     textLayout.DrawText( aGc, convBuf, bidiConv, textColor );
  2183                     }
  2299                     }
  2184                 }
  2300                 }
  2264             __ASSERT_DEBUG((index>=0 && index<IconArray()->Count()),Panic(EEikPanicColumnListInvalidBitmapIndex));
  2380             __ASSERT_DEBUG((index>=0 && index<IconArray()->Count()),Panic(EEikPanicColumnListInvalidBitmapIndex));
  2265             
  2381             
  2266             TAknWindowLineLayout graphicLayout = iExtension->AtSL(subCellIndex).iGraphicLayout;
  2382             TAknWindowLineLayout graphicLayout = iExtension->AtSL(subCellIndex).iGraphicLayout;
  2267             TAknLayoutRect graphicRect; 
  2383             TAknLayoutRect graphicRect; 
  2268             
  2384             
  2269             graphicRect.LayoutRect(aRect,graphicLayout);
  2385             graphicRect.LayoutRect( itemRect,graphicLayout );
  2270             TSize graphicSize( graphicRect.Rect().Size() );
  2386             TSize graphicSize( graphicRect.Rect().Size() );
  2271             
  2387             
  2272             if ( index>=0 && IconArray() )
  2388             if ( index>=0 && IconArray() )
  2273                 {
  2389                 {
  2274                 CGulIcon* icon=(*IconArray())[index];
  2390                 CGulIcon* icon=(*IconArray())[index];
  2307                                const TDesC* aText,
  2423                                const TDesC* aText,
  2308                                const TRect& aRect,
  2424                                const TRect& aRect,
  2309                                TBool aHighlight,
  2425                                TBool aHighlight,
  2310                                const TColors& aColors ) const
  2426                                const TColors& aColors ) const
  2311     {
  2427     {
       
  2428 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  2312     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); 
  2429     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); 
  2313 
  2430 
  2314     if ( aHighlight )
  2431     if ( aHighlight )
  2315         {
  2432         {
  2316         iExtension->iClippedColumns = 0;
  2433         iExtension->iClippedColumns = 0;
  2340             aGc.DiscardFont();
  2457             aGc.DiscardFont();
  2341             }
  2458             }
  2342         return;
  2459         return;
  2343         }
  2460         }
  2344 
  2461 
       
  2462     CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
       
  2463     TBool markingMode = EFalse;
       
  2464     TRect itemRect( aRect );
       
  2465     
       
  2466     if ( listbox->View() && listbox->View()->ItemDrawer() )
       
  2467         {
       
  2468         if ( listbox->View()->ItemDrawer()->Flags() 
       
  2469                 & CListItemDrawer::EMarkingModeEnabled &&
       
  2470              iExtension->iMarkingIconArray && 
       
  2471              iExtension->iMarkingIconArray->Count() == 2 )
       
  2472             {
       
  2473             markingMode = ETrue;
       
  2474             itemRect.iTl.iX += 
       
  2475                 AknLayoutScalable_Avkon::list_single_graphic_pane_t1( 0 ).LayoutLine().il;
       
  2476             }
       
  2477         }
       
  2478     
  2345     TInt extraVerticalSpace=(aRect.Height()-font->HeightInPixels());
  2479     TInt extraVerticalSpace=(aRect.Height()-font->HeightInPixels());
  2346     TInt baseLineOffset=extraVerticalSpace/2+font->AscentInPixels();
  2480     TInt baseLineOffset=extraVerticalSpace/2+font->AscentInPixels();
  2347     TRect textRect( aRect );
  2481     TRect textRect( itemRect );
  2348     TRect textMRect; // textrect with margins.
  2482     TRect textMRect; // textrect with margins.
  2349     textRect.iBr.iX=aRect.iTl.iX;
  2483     textRect.iBr.iX = itemRect.iTl.iX;
  2350     TInt column=0;
  2484     TInt column=0;
  2351     TPtrC text;
  2485     TPtrC text;
  2352 
  2486 
  2353     TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText;
  2487     TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText;
  2354 
  2488 
  2355     // Turned the drawing to multipass algorithm, because optionalcolumns drawing will
  2489     // Turned the drawing to multipass algorithm, because optionalcolumns drawing will
  2356     // be too difficult to do without - and this is cleaner solution.
  2490     // be too difficult to do without - and this is cleaner solution.
  2357     
  2491     
  2358     // pass 1, figures out x-coordinates for columns.
  2492     // pass 1, figures out x-coordinates for columns.
  2359     TInt x = aRect.iTl.iX;
  2493     TInt x = itemRect.iTl.iX;
  2360     TBool mirror = AknLayoutUtils::LayoutMirrored();
  2494     TBool mirror = AknLayoutUtils::LayoutMirrored();
  2361     if (mirror)
  2495     if (mirror)
  2362         {
  2496         {
  2363         x = aRect.iBr.iX;
  2497         x = itemRect.iBr.iX;
  2364         }
  2498         }
  2365     TInt maxx = x;
  2499     TInt maxx = x;
  2366     while(column <= lastColumn)
  2500     while(column <= lastColumn)
  2367         {
  2501         {
  2368         // order of instructions is important here, do not change.
  2502         // order of instructions is important here, do not change.
  2431     if (!cc)
  2565     if (!cc)
  2432         {
  2566         {
  2433         cc = SkinBackgroundContext();
  2567         cc = SkinBackgroundContext();
  2434         }
  2568         }
  2435 
  2569 
  2436     // aRect is list item's rect, width of which is smaller than width of the list
       
  2437     // with a scroll bar. List needs to draw under scroll bar anyway, so we need to
       
  2438     // modify given rect here.
       
  2439     TRect r(aRect);
       
  2440     
       
  2441     CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl );
       
  2442 
       
  2443 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  2570 #ifdef RD_UI_TRANSITION_EFFECTS_LIST
  2444 
  2571 
  2445     MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
  2572     MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc );
  2446 
  2573 
  2447 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2574 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2473             transApi->StopDrawing();
  2600             transApi->StopDrawing();
  2474             }
  2601             }
  2475 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2602 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2476         }
  2603         }
  2477 
  2604 
  2478     CEikListBox* list = static_cast<CEikListBox*>( iExtension->iControl );
  2605     if ( iExtension->iCurrentRow < listbox->BottomItemIndex() )
  2479 
       
  2480     if ( iExtension->iCurrentRow < list->BottomItemIndex() )
       
  2481         {
  2606         {
  2482         AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin );
  2607         AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin );
  2483         }
  2608         }
  2484     
  2609     
  2485  // LISTBOX LINES NEED TO BE DRAWN HERE.
  2610  // LISTBOX LINES NEED TO BE DRAWN HERE.
  2492         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  2617         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  2493         aGc.SetClippingRect( view->ViewRect() );
  2618         aGc.SetClippingRect( view->ViewRect() );
  2494         }
  2619         }
  2495 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2620 #endif // RD_UI_TRANSITION_EFFECTS_LIST
  2496 
  2621 
       
  2622     if ( markingMode && !aItemProperties.IsSelectionHidden() )
       
  2623         {
       
  2624         TAknLayoutRect layoutRect;
       
  2625         layoutRect.LayoutRect(
       
  2626             aRect, 
       
  2627             AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ) );
       
  2628         
       
  2629         aGc.SetPenColor( aColors.iText );
       
  2630         aGc.SetPenStyle( CGraphicsContext::ESolidPen );
       
  2631 
       
  2632         CGulIcon* icon = (*iExtension->iMarkingIconArray)[1]; // unchecked
       
  2633 
       
  2634         if ( listbox->View()->ItemIsSelected( iExtension->iCurrentRow ) )
       
  2635             {
       
  2636             icon = (*iExtension->iMarkingIconArray)[0];
       
  2637             }
       
  2638         
       
  2639         CFbsBitmap* bitmap = icon->Bitmap();
       
  2640 
       
  2641         if ( bitmap )
       
  2642             {
       
  2643             TSize size( bitmap->SizeInPixels() ); // set size if not already
       
  2644             TSize targetSize( layoutRect.Rect().Size() );
       
  2645             
       
  2646             if ( size.iWidth != targetSize.iWidth &&
       
  2647                  size.iHeight != targetSize.iHeight )
       
  2648                 {
       
  2649                 AknIconUtils::SetSize(
       
  2650                     bitmap,
       
  2651                     targetSize,
       
  2652                     EAspectRatioPreservedAndUnusedSpaceRemoved ); 
       
  2653                 }
       
  2654 
       
  2655             aGc.BitBltMasked( layoutRect.Rect().iTl,
       
  2656                               bitmap,
       
  2657                               TRect( layoutRect.Rect().Size() ),
       
  2658                               icon->Mask(),
       
  2659                               EFalse );
       
  2660             }
       
  2661         }
       
  2662     
  2497     // The column draw loop
  2663     // The column draw loop
  2498     column = 0;
  2664     column = 0;
  2499     FOREVER
  2665     FOREVER
  2500         {
  2666         {
  2501         if (column > lastColumn) break;
  2667         if (column > lastColumn) break;
  2545                     {
  2711                     {
  2546                     aGc.SetPenColor(aColors.iHighlightedText);
  2712                     aGc.SetPenColor(aColors.iHighlightedText);
  2547                     aGc.SetBrushColor(aColors.iHighlightedBack);    
  2713                     aGc.SetBrushColor(aColors.iHighlightedBack);    
  2548                     }
  2714                     }
  2549 
  2715 
  2550                 if (AknsUtils::AvkonSkinEnabled() && iExtension)
  2716                 if ( AknsUtils::AvkonSkinEnabled() )
  2551                     {
  2717                     {
  2552                     if (iExtension->iTextColor != NULL)
  2718                     if (iExtension->iTextColor != NULL)
  2553                         {
  2719                         {
  2554                         aGc.SetPenColor(iExtension->iTextColor);
  2720                         aGc.SetPenColor(iExtension->iTextColor);
  2555                         }
  2721                         }
  2678                     bmpRect.iTl=textMRect.iTl;
  2844                     bmpRect.iTl=textMRect.iTl;
  2679                     if (index>=0 && IconArray())
  2845                     if (index>=0 && IconArray())
  2680                         {
  2846                         {
  2681                         CGulIcon* icon=(*IconArray())[index];
  2847                         CGulIcon* icon=(*IconArray())[index];
  2682                         
  2848                         
  2683                         if ( iExtension
  2849                         if ( iExtension->iSubCellIconSize[column] != TSize(0,0) )
  2684                              && iExtension->iSubCellIconSize[column] != TSize(0,0) )
       
  2685                             {
  2850                             {
  2686                             TSize wanted( iExtension->iSubCellIconSize[column] );
  2851                             TSize wanted( iExtension->iSubCellIconSize[column] );
  2687                             TSize got( icon->Bitmap()->SizeInPixels() );
  2852                             TSize got( icon->Bitmap()->SizeInPixels() );
  2688                             
  2853                             
  2689                             // correct w or h is enough
  2854                             // correct w or h is enough
  2878 
  3043 
  2879 EXPORT_C void CColumnListBoxData::SetColumnFontForRowL(TInt aRow,
  3044 EXPORT_C void CColumnListBoxData::SetColumnFontForRowL(TInt aRow,
  2880                                                        TInt aColumn,
  3045                                                        TInt aColumn,
  2881                                                        const CFont* aFont)
  3046                                                        const CFont* aFont)
  2882     {
  3047     {
       
  3048 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  2883     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3049     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  2884     if (!iExtension) return;
       
  2885     TInt index = 0;
  3050     TInt index = 0;
  2886     iExtension->FindRowAndColumnIndexOrAddL(index,aRow,aColumn);
  3051     iExtension->FindRowAndColumnIndexOrAddL(index,aRow,aColumn);
  2887     iExtension->At(index).iFont=aFont;
  3052     iExtension->At(index).iFont=aFont;
  2888     }
  3053     }
  2889 
  3054 
  2890 EXPORT_C const CFont* 
  3055 EXPORT_C const CFont* 
  2891 CColumnListBoxData::RowAndColumnFont(TInt aRow,TInt aColumn) const
  3056 CColumnListBoxData::RowAndColumnFont(TInt aRow,TInt aColumn) const
  2892     {
  3057     {
  2893     if (!iExtension) return 0;
  3058 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  2894     TInt index = 0;
  3059     TInt index = 0;
  2895     if (iExtension->FindRowAndColumnIndex(index,aRow,aColumn)!=0)
  3060     if (iExtension->FindRowAndColumnIndex(index,aRow,aColumn)!=0)
  2896         return 0;
  3061         return 0;
  2897     return(iExtension->At(index).iFont);
  3062     return(iExtension->At(index).iFont);
  2898     }
  3063     }
  2899 
  3064 
  2900 void CColumnListBoxData::SetCurrentItemIndex(TInt aIndex)
  3065 void CColumnListBoxData::SetCurrentItemIndex(TInt aIndex)
  2901     {
  3066     {
       
  3067 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  2902     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3068     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  2903     if( iExtension->iCurrentRow != aIndex )
  3069     if( iExtension->iCurrentRow != aIndex )
  2904         {
  3070         {
  2905         iExtension->iAnimFlags.Set( CColumnListBoxDataExtension::EFlagUpdateBg );
  3071         iExtension->iAnimFlags.Set( CColumnListBoxDataExtension::EFlagUpdateBg );
  2906         }
  3072         }
  2923     const CGraphicsContext::TTextAlign aAlign,
  3089     const CGraphicsContext::TTextAlign aAlign,
  2924     const CFont& aFont,
  3090     const CFont& aFont,
  2925     const TBool aHighlight,
  3091     const TBool aHighlight,
  2926     const TBool aIsTextClipped ) const
  3092     const TBool aIsTextClipped ) const
  2927     {
  3093     {
       
  3094 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  2928     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3095     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  2929     TBool marqueeDisabled =
  3096     TBool marqueeDisabled =
  2930         static_cast<CEikListBox*>(
  3097         static_cast<CEikListBox*>(
  2931             Control() )->View()->ItemDrawer()->Flags() & CListItemDrawer::EDisableMarquee;
  3098             Control() )->View()->ItemDrawer()->Flags() & CListItemDrawer::EDisableMarquee;
  2932 
  3099 
  2950     }
  3117     }
  2951 
  3118 
  2952 
  3119 
  2953 EXPORT_C void CColumnListBoxData::SetMarqueeParams(const TInt aLoops, const TInt aScrollAmount, const TInt aScrollDelay)
  3120 EXPORT_C void CColumnListBoxData::SetMarqueeParams(const TInt aLoops, const TInt aScrollAmount, const TInt aScrollDelay)
  2954     {
  3121     {
       
  3122 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  2955     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3123     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  2956     if ( iExtension->iMarquee )
  3124     if ( iExtension->iMarquee )
  2957         {
  3125         {
  2958         iExtension->iMarquee->SetLoops( aLoops );
  3126         iExtension->iMarquee->SetLoops( aLoops );
  2959         iExtension->iMarquee->SetSpeedInPixels( aScrollAmount );
  3127         iExtension->iMarquee->SetSpeedInPixels( aScrollAmount );
  2968     }
  3136     }
  2969     
  3137     
  2970 EXPORT_C void CColumnListBoxData::SetMarqueeParams(const TInt aLoops, const TInt aScrollAmount, 
  3138 EXPORT_C void CColumnListBoxData::SetMarqueeParams(const TInt aLoops, const TInt aScrollAmount, 
  2971                                                    const TInt aScrollDelay, const TInt aInterval)
  3139                                                    const TInt aScrollDelay, const TInt aInterval)
  2972     {
  3140     {
       
  3141 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  2973     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3142     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  2974     if ( iExtension->iMarquee )
  3143     if ( iExtension->iMarquee )
  2975         {
  3144         {
  2976         iExtension->iMarquee->SetInterval( aInterval );
  3145         iExtension->iMarquee->SetInterval( aInterval );
  2977         iExtension->i2ndLineMarquee->SetInterval( aInterval );
  3146         iExtension->i2ndLineMarquee->SetInterval( aInterval );
  2981 
  3150 
  2982 
  3151 
  2983 EXPORT_C
  3152 EXPORT_C
  2984 void CColumnListBoxData::SetSubCellIconSize(TInt aIndex, TSize aSize)
  3153 void CColumnListBoxData::SetSubCellIconSize(TInt aIndex, TSize aSize)
  2985     {
  3154     {
       
  3155 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  2986     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3156     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  2987     if (iExtension && aIndex < 6 && aIndex >= 0)
  3157     if ( aIndex < 6 && aIndex >= 0 )
  2988         {
  3158         {
  2989         iExtension->iSubCellIconSize[aIndex] = aSize;
  3159         iExtension->iSubCellIconSize[aIndex] = aSize;
  2990         }
  3160         }
  2991     }
  3161     }
  2992 
  3162 
  2993 TSize CColumnListBoxData::GetSubCellIconSize(TInt aIndex)
  3163 TSize CColumnListBoxData::GetSubCellIconSize(TInt aIndex)
  2994     {
  3164     {
  2995     if (iExtension && aIndex < 6 && aIndex >= 0)
  3165 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
       
  3166     if ( aIndex < 6 && aIndex >= 0 )
  2996         {
  3167         {
  2997         return iExtension->iSubCellIconSize[aIndex];
  3168         return iExtension->iSubCellIconSize[aIndex];
  2998         }
  3169         }
  2999     return TSize(0,0);
  3170     return TSize(0,0);
  3000     }
  3171     }
  3003 // CColumnListBoxData::HighlightAnim
  3174 // CColumnListBoxData::HighlightAnim
  3004 // -----------------------------------------------------------------------------
  3175 // -----------------------------------------------------------------------------
  3005 //
  3176 //
  3006 EXPORT_C const CAknsEffectAnim* CColumnListBoxData::HighlightAnim() const
  3177 EXPORT_C const CAknsEffectAnim* CColumnListBoxData::HighlightAnim() const
  3007     {
  3178     {
  3008     if( iExtension )
  3179 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3009         return iExtension->iAnimation;
  3180     return iExtension->iAnimation;
  3010     return NULL;
       
  3011     }
  3181     }
  3012 
  3182 
  3013 // -----------------------------------------------------------------------------
  3183 // -----------------------------------------------------------------------------
  3014 // AboutToDrawHighlightAnim
  3184 // AboutToDrawHighlightAnim
  3015 // -----------------------------------------------------------------------------
  3185 // -----------------------------------------------------------------------------
  3016 //
  3186 //
  3017 EXPORT_C void CColumnListBoxData::AboutToDrawHighlightAnim() const
  3187 EXPORT_C void CColumnListBoxData::AboutToDrawHighlightAnim() const
  3018     {
  3188     {
  3019     if( !iExtension )
  3189 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3020         {
       
  3021         return;
       
  3022         }
       
  3023     if( !iExtension->iAnimation || !iExtension->iControl )
  3190     if( !iExtension->iAnimation || !iExtension->iControl )
  3024         {
  3191         {
  3025         return;
  3192         return;
  3026         }
  3193         }
  3027 
  3194 
  3046 // -----------------------------------------------------------------------------
  3213 // -----------------------------------------------------------------------------
  3047 //
  3214 //
  3048 EXPORT_C void CColumnListBoxData::SetHighlightAnimBackgroundDrawer(
  3215 EXPORT_C void CColumnListBoxData::SetHighlightAnimBackgroundDrawer(
  3049     MColumnListBoxAnimBackgroundDrawer* aDrawer )
  3216     MColumnListBoxAnimBackgroundDrawer* aDrawer )
  3050     {
  3217     {
       
  3218 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3051     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3219     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3052     if( iExtension )
  3220     iExtension->iHighlightBgDrawer = aDrawer;
  3053         {
       
  3054         iExtension->iHighlightBgDrawer = aDrawer;
       
  3055         }
       
  3056     }
  3221     }
  3057 
  3222 
  3058 // -----------------------------------------------------------------------------
  3223 // -----------------------------------------------------------------------------
  3059 // CColumnListBoxData::SetItemCellSize
  3224 // CColumnListBoxData::SetItemCellSize
  3060 // -----------------------------------------------------------------------------
  3225 // -----------------------------------------------------------------------------
  3061 //
  3226 //
  3062 EXPORT_C void CColumnListBoxData::SetItemCellSize( const TSize& aSizeInPixels )
  3227 EXPORT_C void CColumnListBoxData::SetItemCellSize( const TSize& aSizeInPixels )
  3063     {
  3228     {
       
  3229 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3064     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3230     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3065     if( iExtension )
  3231  
  3066         {
  3232     if( iExtension->iAnimSize != aSizeInPixels )
  3067         if( iExtension->iAnimSize != aSizeInPixels )
  3233         {
  3068             {
  3234         iExtension->Play();
  3069             iExtension->Play();
  3235         }
  3070             }
  3236     iExtension->iAnimSize = aSizeInPixels;
  3071         iExtension->iAnimSize = aSizeInPixels;
       
  3072         }
       
  3073     }
  3237     }
  3074 
  3238 
  3075 // -----------------------------------------------------------------------------
  3239 // -----------------------------------------------------------------------------
  3076 // CColumnListBoxData::HasHighlightAnim
  3240 // CColumnListBoxData::HasHighlightAnim
  3077 // -----------------------------------------------------------------------------
  3241 // -----------------------------------------------------------------------------
  3078 //
  3242 //
  3079 EXPORT_C TBool CColumnListBoxData::HasHighlightAnim() const
  3243 EXPORT_C TBool CColumnListBoxData::HasHighlightAnim() const
  3080     {
  3244     {
  3081     if( !iExtension )
  3245 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3082         return EFalse;
       
  3083     if( !iExtension->iAnimation )
  3246     if( !iExtension->iAnimation )
  3084         return EFalse;
  3247         return EFalse;
  3085     return ETrue;
  3248     return ETrue;
  3086     }
  3249     }
  3087 
  3250 
  3090 // -----------------------------------------------------------------------------
  3253 // -----------------------------------------------------------------------------
  3091 //
  3254 //
  3092 EXPORT_C TBool CColumnListBoxData::DrawHighlightAnim(
  3255 EXPORT_C TBool CColumnListBoxData::DrawHighlightAnim(
  3093         CBitmapContext& aGc, const TRect& aRect ) const
  3256         CBitmapContext& aGc, const TRect& aRect ) const
  3094     {
  3257     {
  3095     if( !iExtension )
  3258 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3096         return EFalse;
       
  3097 
       
  3098     if( !iExtension->iAnimation )
  3259     if( !iExtension->iAnimation )
  3099         return EFalse;
  3260         return EFalse;
  3100 
  3261 
  3101     return iExtension->SyncAndDrawAnim( aGc, aRect );
  3262     return iExtension->SyncAndDrawAnim( aGc, aRect );
  3102     }
  3263     }
  3105 // CColumnListBoxData::FocusGained
  3266 // CColumnListBoxData::FocusGained
  3106 // -----------------------------------------------------------------------------
  3267 // -----------------------------------------------------------------------------
  3107 //
  3268 //
  3108 void CColumnListBoxData::FocusGained()
  3269 void CColumnListBoxData::FocusGained()
  3109     {
  3270     {
       
  3271 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3110     iExtension->FocusGained();
  3272     iExtension->FocusGained();
  3111     }
  3273     }
  3112 
  3274 
  3113 // -----------------------------------------------------------------------------
  3275 // -----------------------------------------------------------------------------
  3114 // CColumnListBoxData::FocusLost
  3276 // CColumnListBoxData::FocusLost
  3115 // -----------------------------------------------------------------------------
  3277 // -----------------------------------------------------------------------------
  3116 //
  3278 //
  3117 void CColumnListBoxData::FocusLost()
  3279 void CColumnListBoxData::FocusLost()
  3118     {
  3280     {
       
  3281 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3119     iExtension->FocusLost();
  3282     iExtension->FocusLost();
  3120     }
  3283     }
  3121 
  3284 
  3122 void CColumnListBoxData::HandleResourceChange( TInt aType )
  3285 void CColumnListBoxData::HandleResourceChange( TInt aType )
  3123     {
  3286     {
       
  3287 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3124     _AKNTRACE( "[%s][%s] aType = %d", "CColumnListBoxData", __FUNCTION__, aType  );
  3288     _AKNTRACE( "[%s][%s] aType = %d", "CColumnListBoxData", __FUNCTION__, aType  );
  3125     // Animation is skin dependent, whenever skin changes animation changes
  3289     // Animation is skin dependent, whenever skin changes animation changes
  3126     // too.
  3290     // too.
  3127     if( KAknsMessageSkinChange == aType )
  3291     if( KAknsMessageSkinChange == aType )
  3128         {
  3292         {
  3129         iExtension->SkinChanged();
  3293         TRAP_IGNORE( iExtension->SkinChangedL() );
  3130         }
  3294         }
  3131     else if(aType == KEikDynamicLayoutVariantSwitch)
  3295     else if(aType == KEikDynamicLayoutVariantSwitch)
  3132         {
  3296         {
  3133         // What is under highlight may have changed -> we need to update
  3297         // What is under highlight may have changed -> we need to update
  3134         // highlight background to animation.
  3298         // highlight background to animation.
  3176         }
  3340         }
  3177     }
  3341     }
  3178 
  3342 
  3179 void CColumnListBoxData::SetESSTextColor(TRgb aTextColor)
  3343 void CColumnListBoxData::SetESSTextColor(TRgb aTextColor)
  3180     {
  3344     {
  3181     if (iExtension)
  3345 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3182         iExtension->iTextColor = aTextColor;
  3346     iExtension->iTextColor = aTextColor;
  3183     }
  3347     }
  3184 
  3348 
  3185 void CColumnListBoxData::SetESSHighlightedTextColor(TRgb aHighlightedTextColor)
  3349 void CColumnListBoxData::SetESSHighlightedTextColor(TRgb aHighlightedTextColor)
  3186     {
  3350     {
  3187     if (iExtension)
  3351 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3188         iExtension->iHighlightedTextColor = aHighlightedTextColor;
  3352     iExtension->iHighlightedTextColor = aHighlightedTextColor;
  3189     }
  3353     }
  3190 
  3354 
  3191 EXPORT_C void CColumnListBoxData::SetColumnUnderlined( TBitFlags32 aUnderlinedColumns )
  3355 EXPORT_C void CColumnListBoxData::SetColumnUnderlined( TBitFlags32 aUnderlinedColumns )
  3192     {
  3356     {
  3193     if ( iExtension )
  3357 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3194         {
  3358     iExtension->iUnderlineFlagSet = ETrue;
  3195         iExtension->iUnderlineFlagSet = ETrue;
  3359     iExtension->iUnderlineFlags   = aUnderlinedColumns;
  3196         iExtension->iUnderlineFlags   = aUnderlinedColumns;
       
  3197         }
       
  3198     }
  3360     }
  3199 
  3361 
  3200 void CColumnListBoxData::SetUnderlineStyle( TListItemProperties aProperties,
  3362 void CColumnListBoxData::SetUnderlineStyle( TListItemProperties aProperties,
  3201                                             CWindowGc& aGc,
  3363                                             CWindowGc& aGc,
  3202                                             TInt aColumn ) const
  3364                                             TInt aColumn ) const
  3203     {
  3365     {
  3204     if ( !iExtension )
  3366 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3205         {
       
  3206         return;
       
  3207         }
       
  3208 
       
  3209     if ( !iExtension->iUnderlineFlagSet )
  3367     if ( !iExtension->iUnderlineFlagSet )
  3210         {
  3368         {
  3211         // underlining is already either on or off and
  3369         // underlining is already either on or off and
  3212         // hardcoded off turning will ensure old style
  3370         // hardcoded off turning will ensure old style
  3213         // behaviour
  3371         // behaviour
  3230 // CColumnListBoxData::ResetSLSubCellArray
  3388 // CColumnListBoxData::ResetSLSubCellArray
  3231 // -----------------------------------------------------------------------------
  3389 // -----------------------------------------------------------------------------
  3232 //
  3390 //
  3233 EXPORT_C void CColumnListBoxData::ResetSLSubCellArray()
  3391 EXPORT_C void CColumnListBoxData::ResetSLSubCellArray()
  3234     {
  3392     {
  3235     if ( !iExtension )
  3393 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3236         {
       
  3237         return;
       
  3238         }
       
  3239 
       
  3240     iExtension->iMarginRect = TRect::EUninitialized;
  3394     iExtension->iMarginRect = TRect::EUninitialized;
  3241     if ( iExtension && iExtension->iUseLayoutData )
  3395     if ( iExtension->iUseLayoutData )
  3242         {
  3396         {
  3243         iExtension->iUseLayoutData = EFalse;
  3397         iExtension->iUseLayoutData = EFalse;
  3244 #ifdef RD_UI_TRANSITION_EFFECTS_LIST 
  3398 #ifdef RD_UI_TRANSITION_EFFECTS_LIST 
  3245         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  3399         CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View();
  3246         MAknListBoxTfxInternal* transApi =
  3400         MAknListBoxTfxInternal* transApi =
  3264 // -----------------------------------------------------------------------------
  3418 // -----------------------------------------------------------------------------
  3265 //
  3419 //
  3266 EXPORT_C void CColumnListBoxData::SetGraphicSubCellL(TInt aSubCell,
  3420 EXPORT_C void CColumnListBoxData::SetGraphicSubCellL(TInt aSubCell,
  3267                                                    const TAknWindowLineLayout &aGraphicLayout)       
  3421                                                    const TAknWindowLineLayout &aGraphicLayout)       
  3268     {
  3422     {
       
  3423 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3269     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3424     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3270     if (!iExtension) return;
       
  3271     TInt index = 0;
  3425     TInt index = 0;
  3272     iExtension->FindSLSubCellIndexOrAddL(index,aSubCell);
  3426     iExtension->FindSLSubCellIndexOrAddL(index,aSubCell);
  3273     iExtension->AtSL(index).iTextLayout=NULL;
  3427     iExtension->AtSL(index).iTextLayout=NULL;
  3274     iExtension->AtSL(index).iGraphicLayout=aGraphicLayout;
  3428     iExtension->AtSL(index).iGraphicLayout=aGraphicLayout;
  3275     iExtension->AtSL(index).iSubCellType=CColumnListBoxDataExtension::EEikSLGraphic;
  3429     iExtension->AtSL(index).iSubCellType=CColumnListBoxDataExtension::EEikSLGraphic;
  3313 // -----------------------------------------------------------------------------
  3467 // -----------------------------------------------------------------------------
  3314 //
  3468 //
  3315 EXPORT_C void CColumnListBoxData::SetTextSubCellL(TInt aSubCell,
  3469 EXPORT_C void CColumnListBoxData::SetTextSubCellL(TInt aSubCell,
  3316                                                 const TAknTextLineLayout &aTextLayout)
  3470                                                 const TAknTextLineLayout &aTextLayout)
  3317     {
  3471     {
       
  3472 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3318     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3473     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3319     if (!iExtension) return;
       
  3320     TInt index = 0;
  3474     TInt index = 0;
  3321     iExtension->FindSLSubCellIndexOrAddL(index,aSubCell);
  3475     iExtension->FindSLSubCellIndexOrAddL(index,aSubCell);
  3322     iExtension->AtSL(index).iTextLayout=aTextLayout;
  3476     iExtension->AtSL(index).iTextLayout=aTextLayout;
  3323     iExtension->AtSL(index).iGraphicLayout=NULL;
  3477     iExtension->AtSL(index).iGraphicLayout=NULL;
  3324     iExtension->AtSL(index).iSubCellType=CColumnListBoxDataExtension::EEikSLText;
  3478     iExtension->AtSL(index).iSubCellType=CColumnListBoxDataExtension::EEikSLText;
  3363 //
  3517 //
  3364 EXPORT_C void CColumnListBoxData::SetConditionalSubCellL(TInt aSubCell,
  3518 EXPORT_C void CColumnListBoxData::SetConditionalSubCellL(TInt aSubCell,
  3365                                                          const TAknTextLineLayout &aTextLayout,
  3519                                                          const TAknTextLineLayout &aTextLayout,
  3366                                                          TInt aAffectedSubCell)  
  3520                                                          TInt aAffectedSubCell)  
  3367     {
  3521     {
       
  3522 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3368     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3523     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3369     // iConditionValue of affected subcell (=text subcell, which has different layouts)
  3524     // iConditionValue of affected subcell (=text subcell, which has different layouts)
  3370     // contains index of graphical subcell, which existence should be checked first.
  3525     // contains index of graphical subcell, which existence should be checked first.
  3371     // This graphical subcell has in iConditionValue index of graphical subcell,
  3526     // This graphical subcell has in iConditionValue index of graphical subcell,
  3372     // which existence should be checked second etc. Each graphical subcell can
  3527     // which existence should be checked second etc. Each graphical subcell can
  3373     // affect only to 1 text subcell (or none).
  3528     // affect only to 1 text subcell (or none).
  3374 
  3529 
  3375     // for compabitility - needed at least for text wrapping
  3530     // for compabitility - needed at least for text wrapping
  3376     SetOptionalColumnL( aSubCell, ETrue );
  3531     SetOptionalColumnL( aSubCell, ETrue );
  3377     if (!iExtension) return;
       
  3378 
  3532 
  3379     TInt i = 0x01;
  3533     TInt i = 0x01;
  3380     i = i << aSubCell;
  3534     i = i << aSubCell;
  3381     iExtension->iConditionalCells = iExtension->iConditionalCells | i;
  3535     iExtension->iConditionalCells = iExtension->iConditionalCells | i;
  3382 
  3536 
  3499 // CColumnListBoxData::UsesScalableLayoutData
  3653 // CColumnListBoxData::UsesScalableLayoutData
  3500 // -----------------------------------------------------------------------------
  3654 // -----------------------------------------------------------------------------
  3501 //
  3655 //
  3502 TBool CColumnListBoxData::UsesScalableLayoutData() const
  3656 TBool CColumnListBoxData::UsesScalableLayoutData() const
  3503     {
  3657     {
  3504     if (iExtension)
  3658 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3505         return iExtension->iUseLayoutData;
  3659     return iExtension->iUseLayoutData;
  3506 
       
  3507     return EFalse;
       
  3508     }
  3660     }
  3509 
  3661 
  3510 // -----------------------------------------------------------------------------
  3662 // -----------------------------------------------------------------------------
  3511 // CColumnListBoxData::EnableStretching
  3663 // CColumnListBoxData::EnableStretching
  3512 // -----------------------------------------------------------------------------
  3664 // -----------------------------------------------------------------------------
  3513 //
  3665 //
  3514 void CColumnListBoxData::EnableStretching( const TBool aEnabled )
  3666 void CColumnListBoxData::EnableStretching( const TBool aEnabled )
  3515     {
  3667     {
  3516     if ( !iExtension )
  3668 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3517         {
       
  3518         return;
       
  3519         }
       
  3520         
       
  3521     iExtension->iStretchingEnabled = aEnabled;        
  3669     iExtension->iStretchingEnabled = aEnabled;        
  3522     }
  3670     }
  3523 
  3671 
  3524 #ifdef RD_LIST_STRETCH
  3672 #ifdef RD_LIST_STRETCH
  3525 // -----------------------------------------------------------------------------
  3673 // -----------------------------------------------------------------------------
  3526 // CColumnListBoxData::StretchingEnabled
  3674 // CColumnListBoxData::StretchingEnabled
  3527 // -----------------------------------------------------------------------------
  3675 // -----------------------------------------------------------------------------
  3528 //
  3676 //
  3529 EXPORT_C TBool CColumnListBoxData::StretchingEnabled() const
  3677 EXPORT_C TBool CColumnListBoxData::StretchingEnabled() const
  3530     {
  3678     {
  3531     if ( !iExtension )
  3679 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );      
  3532         {
       
  3533         return EFalse;
       
  3534         }
       
  3535         
       
  3536     return iExtension->iStretchingEnabled;        
  3680     return iExtension->iStretchingEnabled;        
  3537     }
  3681     }
  3538 
  3682 
  3539 #else
  3683 #else
  3540 // -----------------------------------------------------------------------------
  3684 // -----------------------------------------------------------------------------
  3556     TAknTextLineLayout* aLayouts, 
  3700     TAknTextLineLayout* aLayouts, 
  3557     TBool* aResults, 
  3701     TBool* aResults, 
  3558     const TDesC& aText, 
  3702     const TDesC& aText, 
  3559     const TRect& aItemRect ) const
  3703     const TRect& aItemRect ) const
  3560     {
  3704     {
       
  3705 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3561     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3706     _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ );
  3562 
  3707 
  3563     TInt column = 0;
  3708     TInt column = 0;
  3564     TInt column2;
  3709     TInt column2;
  3565     TInt subCellIndex;
  3710     TInt subCellIndex;
  3670 // CColumnListBoxData::SubCellsMightIntersect
  3815 // CColumnListBoxData::SubCellsMightIntersect
  3671 // -----------------------------------------------------------------------------
  3816 // -----------------------------------------------------------------------------
  3672 //
  3817 //
  3673 EXPORT_C void CColumnListBoxData::SubCellsMightIntersect( const TBool aMightIntersect )
  3818 EXPORT_C void CColumnListBoxData::SubCellsMightIntersect( const TBool aMightIntersect )
  3674     {
  3819     {
       
  3820 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3675     iExtension->iSubCellsMightIntersect = aMightIntersect;
  3821     iExtension->iSubCellsMightIntersect = aMightIntersect;
  3676     }
  3822     }
  3677     
  3823     
  3678 void CColumnListBoxDataExtension::CreateColorBitmapsL()
  3824 void CColumnListBoxDataExtension::CreateColorBitmapsL()
  3679     {
  3825     {
  3770     }
  3916     }
  3771 
  3917 
  3772 
  3918 
  3773 EXPORT_C TUint32 CColumnListBoxData::CurrentItemTextWasClipped() const
  3919 EXPORT_C TUint32 CColumnListBoxData::CurrentItemTextWasClipped() const
  3774     {
  3920     {
  3775     return iExtension ? iExtension->iClippedColumns : 0;
  3921 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
       
  3922     return iExtension->iClippedColumns;
  3776     }
  3923     }
  3777 
  3924 
  3778 TBool CColumnListBoxData::KineticScrollingEnabled() const
  3925 TBool CColumnListBoxData::KineticScrollingEnabled() const
  3779     {
  3926     {
  3780     if ( iExtension )
  3927 	__ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) );
  3781         {
  3928     return iExtension->iKineticScrolling;       
  3782         return iExtension->iKineticScrolling;       
       
  3783         }
       
  3784     return EFalse;
       
  3785     }
  3929     }
  3786 
  3930 
  3787 
  3931 
  3788 // End of File
  3932 // End of File