1120 aInnerRect, |
1139 aInnerRect, |
1121 KAknsIIDQsnFrListPressed, |
1140 KAknsIIDQsnFrListPressed, |
1122 KAknsIIDQsnFrListCenterPressed ); |
1141 KAknsIIDQsnFrListCenterPressed ); |
1123 } |
1142 } |
1124 |
1143 |
|
1144 |
|
1145 // ----------------------------------------------------------------------------- |
|
1146 // CColumnListBoxDataExtension::LoadMarkingIconsL |
|
1147 // ----------------------------------------------------------------------------- |
|
1148 // |
|
1149 void CColumnListBoxDataExtension::LoadMarkingIconsL() |
|
1150 { |
|
1151 if ( !iMarkingIconArray ) |
|
1152 { |
|
1153 iMarkingIconArray = new ( ELeave ) CAknIconArray( |
|
1154 KMarkingModeIconArraySize ); |
|
1155 } |
|
1156 else |
|
1157 { |
|
1158 iMarkingIconArray->ResetAndDestroy(); |
|
1159 } |
|
1160 |
|
1161 MAknsSkinInstance* skin = AknsUtils::SkinInstance(); |
|
1162 const TDesC& avkonIconFile = AknIconUtils::AvkonIconFileName(); |
|
1163 |
|
1164 CGulIcon* icon = AknsUtils::CreateGulIconL( skin, |
|
1165 KAknsIIDQgnPropCheckboxOn, |
|
1166 avkonIconFile, |
|
1167 EMbmAvkonQgn_prop_checkbox_on, |
|
1168 EMbmAvkonQgn_prop_checkbox_on_mask ); |
|
1169 |
|
1170 CleanupStack::PushL( icon ); |
|
1171 iMarkingIconArray->AppendL( icon ); |
|
1172 CleanupStack::Pop( icon ); |
|
1173 |
|
1174 icon = AknsUtils::CreateGulIconL( skin, |
|
1175 KAknsIIDQgnPropCheckboxOff, |
|
1176 avkonIconFile, |
|
1177 EMbmAvkonQgn_prop_checkbox_off, |
|
1178 EMbmAvkonQgn_prop_checkbox_off_mask ); |
|
1179 |
|
1180 CleanupStack::PushL( icon ); |
|
1181 iMarkingIconArray->AppendL( icon ); |
|
1182 CleanupStack::Pop( icon ); |
|
1183 } |
|
1184 |
|
1185 |
1125 EXPORT_C CCoeControl *CColumnListBoxData::Control() const |
1186 EXPORT_C CCoeControl *CColumnListBoxData::Control() const |
1126 { |
1187 { |
|
1188 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1127 return iExtension->iControl; |
1189 return iExtension->iControl; |
1128 } |
1190 } |
1129 |
1191 |
1130 EXPORT_C void CColumnListBoxData::SetControl(CCoeControl *aControl) |
1192 EXPORT_C void CColumnListBoxData::SetControl(CCoeControl *aControl) |
1131 { |
1193 { |
|
1194 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1132 iExtension->SetControl( aControl ); |
1195 iExtension->SetControl( aControl ); |
1133 } |
1196 } |
1134 |
1197 |
1135 |
1198 |
1136 EXPORT_C MAknsControlContext* CColumnListBoxData::SkinBackgroundContext() const |
1199 EXPORT_C MAknsControlContext* CColumnListBoxData::SkinBackgroundContext() const |
1137 { |
1200 { |
|
1201 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1138 if (iExtension->iSkinEnabled) |
1202 if (iExtension->iSkinEnabled) |
1139 { |
1203 { |
1140 return iExtension->iSkinControlContext; |
1204 return iExtension->iSkinControlContext; |
1141 } |
1205 } |
1142 |
1206 |
1143 return NULL; |
1207 return NULL; |
1144 } |
1208 } |
1145 |
1209 |
1146 void CColumnListBoxData::SetSkinBackgroundContext(CAknsListBoxBackgroundControlContext *aContext) |
1210 void CColumnListBoxData::SetSkinBackgroundContext(CAknsListBoxBackgroundControlContext *aContext) |
1147 { |
1211 { |
|
1212 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1148 delete iExtension->iSkinControlContext; |
1213 delete iExtension->iSkinControlContext; |
1149 iExtension->iSkinControlContext = aContext; |
1214 iExtension->iSkinControlContext = aContext; |
1150 } |
1215 } |
1151 |
1216 |
1152 void CColumnListBoxData::CreatePictographInterfaceL() |
1217 void CColumnListBoxData::CreatePictographInterfaceL() |
1153 { |
1218 { |
|
1219 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1154 if ( !iExtension->iPictoInterface ) |
1220 if ( !iExtension->iPictoInterface ) |
1155 { |
1221 { |
1156 iExtension->iPictoInterface = CAknPictographInterface::NewL( |
1222 iExtension->iPictoInterface = CAknPictographInterface::NewL( |
1157 *iExtension->iControl, *iExtension ); |
1223 *iExtension->iControl, *iExtension ); |
1158 } |
1224 } |
1159 } |
1225 } |
1160 |
1226 |
1161 EXPORT_C void CColumnListBoxData::SetSkinHighlightFrame(const TAknsItemID *aFrameId, const TAknsItemID *aFrameCenterId) |
1227 EXPORT_C void CColumnListBoxData::SetSkinHighlightFrame(const TAknsItemID *aFrameId, const TAknsItemID *aFrameCenterId) |
1162 { |
1228 { |
|
1229 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1163 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1230 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1164 iExtension->iSkinHighlightFrameId = aFrameId; |
1231 iExtension->iSkinHighlightFrameId = aFrameId; |
1165 iExtension->iSkinHighlightFrameCenterId = aFrameCenterId; |
1232 iExtension->iSkinHighlightFrameCenterId = aFrameCenterId; |
1166 } |
1233 } |
1167 |
1234 |
1168 EXPORT_C void CColumnListBoxData::SetSkinEnabledL(TBool aEnabled) |
1235 EXPORT_C void CColumnListBoxData::SetSkinEnabledL(TBool aEnabled) |
1169 { |
1236 { |
|
1237 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1170 CListBoxData::SetSkinEnabledL(aEnabled); |
1238 CListBoxData::SetSkinEnabledL(aEnabled); |
1171 iExtension->iSkinEnabled = aEnabled; |
1239 iExtension->iSkinEnabled = aEnabled; |
1172 } |
1240 } |
1173 |
1241 |
1174 EXPORT_C void CColumnListBoxData::SetSkinStyle(const TAknsItemID *aId, const TRect &aTileRect) |
1242 EXPORT_C void CColumnListBoxData::SetSkinStyle(const TAknsItemID *aId, const TRect &aTileRect) |
1175 { |
1243 { |
|
1244 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1176 if (iExtension->iSkinControlContext) |
1245 if (iExtension->iSkinControlContext) |
1177 { |
1246 { |
1178 iExtension->iSkinControlContext->SetTiledBitmap(*aId); |
1247 iExtension->iSkinControlContext->SetTiledBitmap(*aId); |
1179 iExtension->iSkinControlContext->SetTiledRect(aTileRect); |
1248 iExtension->iSkinControlContext->SetTiledRect(aTileRect); |
1180 } |
1249 } |
1181 } |
1250 } |
1182 |
1251 |
1183 EXPORT_C void CColumnListBoxData::SetListEndSkinStyle(const TAknsItemID *aId, const TRect &aTileRect) |
1252 EXPORT_C void CColumnListBoxData::SetListEndSkinStyle(const TAknsItemID *aId, const TRect &aTileRect) |
1184 { |
1253 { |
|
1254 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1185 if (iExtension->iSkinControlContext) |
1255 if (iExtension->iSkinControlContext) |
1186 { |
1256 { |
1187 iExtension->iSkinControlContext->SetBottomBitmap(*aId); |
1257 iExtension->iSkinControlContext->SetBottomBitmap(*aId); |
1188 iExtension->iSkinControlContext->SetBottomRect(aTileRect); |
1258 iExtension->iSkinControlContext->SetBottomRect(aTileRect); |
1189 } |
1259 } |
1190 } |
1260 } |
1191 |
1261 |
1192 void CColumnListBoxData::CreateMarqueeControlL() |
1262 void CColumnListBoxData::CreateMarqueeControlL() |
1193 { |
1263 { |
|
1264 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1194 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1265 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1195 if ( !iExtension->iMarquee ) |
1266 if ( !iExtension->iMarquee ) |
1196 { |
1267 { |
1197 iExtension->iMarquee = CAknMarqueeControl::NewL(); |
1268 iExtension->iMarquee = CAknMarqueeControl::NewL(); |
1198 } |
1269 } |
1221 } |
1293 } |
1222 } |
1294 } |
1223 |
1295 |
1224 TInt CColumnListBoxData::CurrentMarqueeItemIndex() |
1296 TInt CColumnListBoxData::CurrentMarqueeItemIndex() |
1225 { |
1297 { |
|
1298 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1226 return iExtension->iCurrentItem; |
1299 return iExtension->iCurrentItem; |
1227 } |
1300 } |
1228 |
1301 |
1229 void CColumnListBoxData::SetCurrentMarqueeItemIndex(TInt aIndex) |
1302 void CColumnListBoxData::SetCurrentMarqueeItemIndex(TInt aIndex) |
1230 { |
1303 { |
|
1304 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1231 iExtension->iCurrentItem = aIndex; |
1305 iExtension->iCurrentItem = aIndex; |
1232 } |
1306 } |
1233 |
1307 |
1234 // |
1308 // |
1235 // Enables or disables marquee. |
1309 // Enables or disables marquee. |
1236 // |
1310 // |
1237 EXPORT_C void CColumnListBoxData::EnableMarqueeL(TBool aEnable) |
1311 EXPORT_C void CColumnListBoxData::EnableMarqueeL(TBool aEnable) |
1238 { |
1312 { |
|
1313 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1239 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1314 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1240 // CreateMarqueeControlL does nothing if marquee already exists, |
1315 // CreateMarqueeControlL does nothing if marquee already exists, |
1241 // so let's just call it just in case. |
1316 // so let's just call it just in case. |
1242 CreateMarqueeControlL(); |
1317 CreateMarqueeControlL(); |
1243 iExtension->iMarquee->EnableMarquee(aEnable); |
1318 iExtension->iMarquee->EnableMarquee(aEnable); |
1244 iExtension->i2ndLineMarquee->EnableMarquee(aEnable); |
1319 iExtension->i2ndLineMarquee->EnableMarquee(aEnable); |
1245 } |
1320 } |
1246 |
1321 |
1247 EXPORT_C void CColumnListBoxData::SetSeparatorLinePosition(TAknSeparatorLinePosition aPosition) |
1322 EXPORT_C void CColumnListBoxData::SetSeparatorLinePosition(TAknSeparatorLinePosition aPosition) |
1248 { |
1323 { |
1249 if (iExtension) |
1324 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1250 iExtension->iSeparatorLinePosition = aPosition; |
1325 iExtension->iSeparatorLinePosition = aPosition; |
1251 } |
1326 } |
1252 EXPORT_C TAknSeparatorLinePosition CColumnListBoxData::SeparatorLinePosition() const |
1327 EXPORT_C TAknSeparatorLinePosition CColumnListBoxData::SeparatorLinePosition() const |
1253 { |
1328 { |
1254 if (iExtension) |
1329 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1255 return iExtension->iSeparatorLinePosition; |
1330 return iExtension->iSeparatorLinePosition; |
1256 else |
|
1257 return ENoLine; |
|
1258 } |
1331 } |
1259 EXPORT_C CAknLayoutData *CColumnListBoxData::LayoutData() const |
1332 EXPORT_C CAknLayoutData *CColumnListBoxData::LayoutData() const |
1260 { |
1333 { |
1261 return NULL; |
1334 return NULL; |
1262 } |
1335 } |
1465 EXPORT_C void CColumnListBoxData::SetColumnBaselinePosL(TInt aColumn,TInt aPos) |
1539 EXPORT_C void CColumnListBoxData::SetColumnBaselinePosL(TInt aColumn,TInt aPos) |
1466 // |
1540 // |
1467 // Set a columns baseline position |
1541 // Set a columns baseline position |
1468 // |
1542 // |
1469 { |
1543 { |
|
1544 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1470 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1545 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1471 TInt index; |
1546 TInt index; |
1472 FindColumnIndexOrAddL(index,aColumn); |
1547 FindColumnIndexOrAddL(index,aColumn); |
1473 At(index).iBaseline=aPos; |
1548 At(index).iBaseline=aPos; |
1474 |
1549 |
1475 // can not be nicely supported by new drawing system |
1550 // can not be nicely supported by new drawing system |
1476 // --> revert to Symbian style drawing |
1551 // --> revert to Symbian style drawing |
1477 if ( iExtension && iExtension->iUseLayoutData ) |
1552 if ( iExtension->iUseLayoutData ) |
1478 { |
1553 { |
1479 iExtension->iUseLayoutData = EFalse; |
1554 iExtension->iUseLayoutData = EFalse; |
1480 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
1555 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
1481 CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View(); |
1556 CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View(); |
1482 MAknListBoxTfxInternal* transApi = |
1557 MAknListBoxTfxInternal* transApi = |
1507 EXPORT_C void CColumnListBoxData::SetColumnMarginsL(TInt aColumn,TMargins aMargins) |
1582 EXPORT_C void CColumnListBoxData::SetColumnMarginsL(TInt aColumn,TMargins aMargins) |
1508 // |
1583 // |
1509 // Set a columns vertical cap |
1584 // Set a columns vertical cap |
1510 // |
1585 // |
1511 { |
1586 { |
|
1587 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1512 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1588 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1513 TInt index; |
1589 TInt index; |
1514 FindColumnIndexOrAddL(index,aColumn); |
1590 FindColumnIndexOrAddL(index,aColumn); |
1515 At(index).iMargins=aMargins; |
1591 At(index).iMargins=aMargins; |
1516 |
1592 |
1517 // can not be nicely supported by new drawing system |
1593 // can not be nicely supported by new drawing system |
1518 // --> revert to Symbian style drawing |
1594 // --> revert to Symbian style drawing |
1519 if ( iExtension && iExtension->iUseLayoutData ) |
1595 if ( iExtension->iUseLayoutData ) |
1520 { |
1596 { |
1521 iExtension->iUseLayoutData = EFalse; |
1597 iExtension->iUseLayoutData = EFalse; |
1522 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
1598 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
1523 CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View(); |
1599 CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View(); |
1524 MAknListBoxTfxInternal* transApi = |
1600 MAknListBoxTfxInternal* transApi = |
1726 EXPORT_C CArrayPtr<CGulIcon>* CColumnListBoxData::IconArray() const |
1803 EXPORT_C CArrayPtr<CGulIcon>* CColumnListBoxData::IconArray() const |
1727 // |
1804 // |
1728 // Return the list of icons |
1805 // Return the list of icons |
1729 // |
1806 // |
1730 { |
1807 { |
1731 if (iExtension) |
1808 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1732 return iExtension->iIconArray; |
1809 return iExtension->iIconArray; |
1733 else |
|
1734 return 0; |
|
1735 } |
1810 } |
1736 |
1811 |
1737 EXPORT_C void CColumnListBoxData::SetIconArray(CArrayPtr<CGulIcon>* aArray) |
1812 EXPORT_C void CColumnListBoxData::SetIconArray(CArrayPtr<CGulIcon>* aArray) |
1738 // |
1813 // |
1739 // Passes ownership of the icon list aArray (assumes any previous list has been deleted by the caller) |
1814 // Passes ownership of the icon list aArray (assumes any previous list has been deleted by the caller) |
1740 // |
1815 // |
1741 { |
1816 { |
|
1817 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1742 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1818 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1743 if (iExtension) |
1819 iExtension->iIconArray=aArray; |
1744 iExtension->iIconArray=aArray; |
|
1745 else |
|
1746 { |
|
1747 aArray->ResetAndDestroy(); |
|
1748 delete aArray; |
|
1749 } |
|
1750 } |
1820 } |
1751 |
1821 |
1752 EXPORT_C CFont* CColumnListBoxData::Font(const TListItemProperties& /*aItemProperties*/, TInt aColumn) const |
1822 EXPORT_C CFont* CColumnListBoxData::Font(const TListItemProperties& /*aItemProperties*/, TInt aColumn) const |
1753 { |
1823 { |
1754 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1824 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
1941 const TDesC* aText, |
2012 const TDesC* aText, |
1942 const TRect& aRect, |
2013 const TRect& aRect, |
1943 TBool aHighlight, |
2014 TBool aHighlight, |
1944 const TColors& aColors ) const |
2015 const TColors& aColors ) const |
1945 { |
2016 { |
|
2017 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
1946 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
2018 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
|
2019 |
|
2020 __ASSERT_DEBUG( iExtension->iControl, Panic( EEikPanicNullPointer )); |
|
2021 |
|
2022 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
|
2023 if ( listbox && !listbox->View()->ViewRect().Intersects( aRect ) ) |
|
2024 { |
|
2025 // outside of the clipping rect -> don't process this item |
|
2026 return; |
|
2027 } |
1947 |
2028 |
1948 TInt lastColumn = Min( LastColumn(), KMaxColumn ); |
2029 TInt lastColumn = Min( LastColumn(), KMaxColumn ); |
1949 TInt column=0; |
2030 TInt column=0; |
1950 TPtrC text; |
2031 TPtrC text; |
1951 TPtrC tempText; |
2032 TPtrC tempText; |
1952 |
2033 |
1953 TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText; |
2034 TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText; |
1954 |
2035 |
1955 MAknsSkinInstance *skin = AknsUtils::SkinInstance(); |
2036 MAknsSkinInstance *skin = AknsUtils::SkinInstance(); |
1956 MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() ); |
2037 MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() ); |
1957 if (!cc) |
2038 if ( !cc ) |
1958 { |
2039 { |
1959 cc = SkinBackgroundContext(); |
2040 cc = SkinBackgroundContext(); |
1960 } |
2041 } |
1961 |
2042 |
1962 TAknTextLineLayout textLines[KMaxColumn]; |
2043 TAknTextLineLayout textLines[KMaxColumn]; |
1963 TBool rectClipped[KMaxColumn]; |
2044 TBool rectClipped[KMaxColumn]; |
1964 |
2045 |
1965 Mem::FillZ( &rectClipped[0], KMaxColumn * sizeof( TBool ) ); |
2046 Mem::FillZ( &rectClipped[0], KMaxColumn * sizeof( TBool ) ); |
1966 |
|
1967 if ( iExtension->iSubCellsMightIntersect ) |
|
1968 { |
|
1969 CheckIfSubCellsIntersect( &textLines[0], &rectClipped[0], *aText, aRect ); |
|
1970 } |
|
1971 |
|
1972 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
|
1973 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
2047 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
1974 MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc ); |
2048 MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc ); |
1975 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2049 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
1976 |
2050 |
1977 if ( !listbox || !listbox->BackgroundDrawingSuppressed() ) |
2051 if ( !listbox || !listbox->BackgroundDrawingSuppressed() ) |
2000 { |
2074 { |
2001 transApi->StopDrawing(); |
2075 transApi->StopDrawing(); |
2002 } |
2076 } |
2003 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2077 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2004 } |
2078 } |
2005 |
2079 if ( iExtension->iCurrentRow < listbox->BottomItemIndex() ) |
2006 DrawHighLight( aGc, aRect, aHighlight, skin ); |
2080 { |
2007 |
2081 AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin ); |
|
2082 } |
|
2083 |
|
2084 DrawHighLight( aGc, aRect, aHighlight, skin ); |
|
2085 TRect itemRect( aRect ); |
|
2086 DrawMarkingModeIcons( aItemProperties, aGc, itemRect ); |
|
2087 if ( iExtension->iSubCellsMightIntersect ) |
|
2088 { |
|
2089 CheckIfSubCellsIntersect( &textLines[0], &rectClipped[0], *aText, itemRect ); |
|
2090 } |
2008 // The column draw loop |
2091 // The column draw loop |
2009 column = 0; |
2092 column = 0; |
2010 TInt subCellIndex = 0; |
2093 TInt subCellIndex = 0; |
2011 |
|
2012 if ( !iExtension ) { return; } |
|
2013 |
2094 |
2014 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
2095 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
2015 if ( transApi ) |
2096 if ( transApi ) |
2016 { |
2097 { |
2017 transApi->StartDrawing( MAknListBoxTfxInternal::EListItem ); |
2098 transApi->StartDrawing( MAknListBoxTfxInternal::EListItem ); |
2018 CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View(); |
2099 CListBoxView* view = listbox->View(); |
2019 aGc.SetClippingRect( view->ViewRect() ); |
2100 aGc.SetClippingRect( view->ViewRect() ); |
2020 } |
2101 } |
2021 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2102 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2022 |
2103 |
2023 for( column = 0; column <= lastColumn; column++ ) |
2104 for( column = 0; column <= lastColumn; column++ ) |
2024 { |
2105 { |
2025 TextUtils::ColumnText( text, column, aText ); |
2106 TextUtils::ColumnText( text, column, aText ); |
2026 if ( text == KNullDesC ) { continue; } |
2107 if ( text == KNullDesC ) { continue; } |
2027 |
2108 |
2028 if ( iExtension->FindSLSubCellIndex( subCellIndex, column )!=0 ) { continue; } |
2109 if ( iExtension->FindSLSubCellIndex( subCellIndex, column )!=0 ) |
|
2110 { |
|
2111 continue; |
|
2112 } |
2029 |
2113 |
2030 CGraphicsContext::TTextAlign align=ColumnAlignment(column); |
2114 CGraphicsContext::TTextAlign align=ColumnAlignment(column); |
2031 TBool isLayoutAlignment = iExtension->ColumnLayoutAlignment(column); |
2115 TBool isLayoutAlignment = iExtension->ColumnLayoutAlignment(column); |
2032 |
2116 |
2033 if ( iExtension->AtSL(subCellIndex).iSubCellType == CColumnListBoxDataExtension::EEikSLText ) |
2117 if ( iExtension->AtSL(subCellIndex).iSubCellType == CColumnListBoxDataExtension::EEikSLText ) |
2034 { |
2118 { |
2035 aGc.SetBrushStyle(CGraphicsContext::ENullBrush); |
2119 aGc.SetBrushStyle(CGraphicsContext::ENullBrush); |
2036 |
2120 |
2037 TRgb textColor( aTextColor ); |
2121 TRgb textColor( aTextColor ); |
2038 |
2122 |
2039 if (aHighlight) |
2123 if ( aHighlight ) |
2040 { |
2124 { |
2041 textColor = aColors.iHighlightedText; |
2125 textColor = aColors.iHighlightedText; |
2042 aGc.SetBrushColor(aColors.iHighlightedBack); |
2126 aGc.SetBrushColor(aColors.iHighlightedBack); |
2043 } |
2127 } |
2044 if (AknsUtils::AvkonSkinEnabled()) |
2128 if ( AknsUtils::AvkonSkinEnabled() ) |
2045 { |
2129 { |
2046 if (iExtension->iTextColor != NULL) |
2130 CListBoxView* view = listbox->View(); |
2047 { |
2131 TBool useOverrideColor = view->ItemDrawer()->Flags() & CListItemDrawer::EUseOverrideSkinTextColor; |
2048 textColor = iExtension->iTextColor; |
2132 if ( !useOverrideColor ) |
2049 } |
2133 { |
2050 |
2134 if ( iExtension->iTextColor != NULL ) |
2051 if (aHighlight && iExtension->iHighlightedTextColor != NULL) |
2135 { |
2052 { |
2136 textColor = iExtension->iTextColor; |
2053 textColor = iExtension->iHighlightedTextColor; |
2137 } |
2054 } |
2138 if ( aHighlight && iExtension->iHighlightedTextColor != NULL ) |
|
2139 { |
|
2140 textColor = iExtension->iHighlightedTextColor; |
|
2141 } |
|
2142 } |
2055 } |
2143 } |
2056 |
2144 |
2057 const CFont* rowAndColFont=RowAndColumnFont(iExtension->iCurrentRow,column); |
2145 const CFont* rowAndColFont=RowAndColumnFont(iExtension->iCurrentRow,column); |
2058 const CFont* colFont=Font(aItemProperties, column); |
2146 const CFont* colFont=Font(aItemProperties, column); |
2059 const CFont* tempFont=(colFont) ? colFont : NULL; |
2147 const CFont* tempFont=(colFont) ? colFont : NULL; |
2151 { |
2239 { |
2152 iExtension->iClippedColumns |= ( 1 << column ); |
2240 iExtension->iClippedColumns |= ( 1 << column ); |
2153 } |
2241 } |
2154 |
2242 |
2155 TBool marqueeDisabled(EFalse); |
2243 TBool marqueeDisabled(EFalse); |
2156 if (listbox != NULL && |
2244 if ( listbox != NULL && |
2157 listbox->View() != NULL && |
2245 listbox->View() != NULL && |
2158 listbox->View()->ItemDrawer() != NULL) |
2246 listbox->View()->ItemDrawer() != NULL) |
2159 { |
2247 { |
2160 marqueeDisabled = listbox->View()->ItemDrawer()->Flags() & CListItemDrawer::EDisableMarquee; |
2248 marqueeDisabled = listbox->View()->ItemDrawer()->Flags() & CListItemDrawer::EDisableMarquee; |
2161 } |
2249 } |
2162 |
2250 |
2163 if ( iExtension->IsMarqueeOn() && doesNotFit && !marqueeDisabled ) |
2251 if ( iExtension->IsMarqueeOn() && doesNotFit && !marqueeDisabled ) |
2164 { |
2252 { |
2165 iExtension->iMarquee->UseLogicalToVisualConversion( bidiConv ); |
2253 iExtension->iMarquee->UseLogicalToVisualConversion( bidiConv ); |
2166 |
2254 |
2167 if ( iExtension->iMarquee->DrawText( aGc, aRect, textLineLayout, convBuf, usedFont, textColor ) ) |
2255 if ( iExtension->iMarquee->DrawText( aGc, itemRect, textLineLayout, convBuf, usedFont, textColor ) ) |
2168 { |
2256 { |
2169 // all the loops have been executed |
2257 // all the loops have been executed |
2170 textLayout.DrawText( aGc, convBuf, bidiConv, textColor ); |
2258 textLayout.DrawText( aGc, convBuf, bidiConv, textColor ); |
2171 } |
2259 } |
2172 } |
2260 } |
2241 if ( !IconArray() ) |
2329 if ( !IconArray() ) |
2242 { |
2330 { |
2243 continue; |
2331 continue; |
2244 } |
2332 } |
2245 |
2333 |
2246 if (aHighlight && (index > 0xffff)) |
2334 if ( aHighlight && (index > 0xffff) ) |
2247 { |
2335 { |
2248 index = index >> 16; // we have different icon for highlight |
2336 index = index >> 16; // we have different icon for highlight |
2249 } |
2337 } |
2250 |
2338 |
2251 index = index & 0xffff; // mask off possible highlight icon |
2339 index = index & 0xffff; // mask off possible highlight icon |
2252 __ASSERT_DEBUG((index>=0 && index<IconArray()->Count()),Panic(EEikPanicColumnListInvalidBitmapIndex)); |
2340 __ASSERT_DEBUG((index>=0 && index<IconArray()->Count()),Panic(EEikPanicColumnListInvalidBitmapIndex)); |
2253 |
2341 |
2254 TAknWindowLineLayout graphicLayout = iExtension->AtSL(subCellIndex).iGraphicLayout; |
2342 TAknWindowLineLayout graphicLayout = iExtension->AtSL(subCellIndex).iGraphicLayout; |
2255 TAknLayoutRect graphicRect; |
2343 TAknLayoutRect graphicRect; |
2256 |
2344 |
2257 graphicRect.LayoutRect(aRect,graphicLayout); |
2345 graphicRect.LayoutRect( itemRect,graphicLayout ); |
2258 TSize graphicSize( graphicRect.Rect().Size() ); |
2346 TSize graphicSize( graphicRect.Rect().Size() ); |
2259 |
2347 |
2260 if (index>=0 && IconArray()) |
2348 if ( index>=0 && IconArray() ) |
2261 { |
2349 { |
2262 CGulIcon* icon=(*IconArray())[index]; |
2350 CGulIcon* icon=(*IconArray())[index]; |
2263 CFbsBitmap* bitmap=icon->Bitmap(); |
2351 CFbsBitmap* bitmap=icon->Bitmap(); |
2264 // Sometimes we get fake bitmap... |
2352 // Sometimes we get fake bitmap... |
2265 if ( bitmap ) |
2353 if ( bitmap ) |
2266 { |
2354 { |
2267 TSize size( bitmap->SizeInPixels() ); |
2355 TSize size( bitmap->SizeInPixels() ); |
2268 |
2356 |
2269 if (size.iWidth != graphicSize.iWidth && |
2357 if ( size.iWidth != graphicSize.iWidth && |
2270 size.iHeight != graphicSize.iHeight ) |
2358 size.iHeight != graphicSize.iHeight ) |
2271 { |
2359 { |
2272 AknIconUtils::SetSize( bitmap, |
2360 AknIconUtils::SetSize( bitmap, |
2273 graphicSize, |
2361 graphicSize, |
2274 EAspectRatioPreservedAndUnusedSpaceRemoved ); |
2362 EAspectRatioPreservedAndUnusedSpaceRemoved ); |
2275 } |
2363 } |
2328 aGc.DiscardFont(); |
2417 aGc.DiscardFont(); |
2329 } |
2418 } |
2330 return; |
2419 return; |
2331 } |
2420 } |
2332 |
2421 |
|
2422 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
|
2423 TRect itemRect( aRect ); |
|
2424 |
2333 TInt extraVerticalSpace=(aRect.Height()-font->HeightInPixels()); |
2425 TInt extraVerticalSpace=(aRect.Height()-font->HeightInPixels()); |
2334 TInt baseLineOffset=extraVerticalSpace/2+font->AscentInPixels(); |
2426 TInt baseLineOffset=extraVerticalSpace/2+font->AscentInPixels(); |
2335 TRect textRect( aRect ); |
2427 // SERIES60 Background drawing. |
|
2428 MAknsSkinInstance *skin = AknsUtils::SkinInstance(); |
|
2429 MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() ); |
|
2430 if (!cc) |
|
2431 { |
|
2432 cc = SkinBackgroundContext(); |
|
2433 } |
|
2434 |
|
2435 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
2436 |
|
2437 MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc ); |
|
2438 |
|
2439 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
2440 |
|
2441 if ( !listbox || !listbox->BackgroundDrawingSuppressed() ) |
|
2442 { |
|
2443 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
2444 if ( transApi ) |
|
2445 { |
|
2446 transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); |
|
2447 } |
|
2448 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
2449 |
|
2450 aGc.SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
2451 aGc.SetPenStyle(CGraphicsContext::ESolidPen); |
|
2452 |
|
2453 if ( listbox ) |
|
2454 { |
|
2455 AknsDrawUtils::Background( skin, cc, listbox, aGc, aRect ); |
|
2456 } |
|
2457 else |
|
2458 { |
|
2459 aGc.Clear(aRect); |
|
2460 } |
|
2461 |
|
2462 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
2463 if ( transApi ) |
|
2464 { |
|
2465 transApi->StopDrawing(); |
|
2466 } |
|
2467 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
2468 } |
|
2469 if ( iExtension->iCurrentRow < listbox->BottomItemIndex() ) |
|
2470 { |
|
2471 AknListUtils::DrawSeparator( aGc, aRect, aColors.iText, skin ); |
|
2472 } |
|
2473 DrawHighLight( aGc, aRect, aHighlight, skin ); |
|
2474 DrawMarkingModeIcons( aItemProperties, aGc, itemRect ); |
|
2475 TRect textRect( itemRect ); |
|
2476 textRect.iBr.iX = itemRect.iTl.iX; |
2336 TRect textMRect; // textrect with margins. |
2477 TRect textMRect; // textrect with margins. |
2337 textRect.iBr.iX=aRect.iTl.iX; |
|
2338 TInt column=0; |
2478 TInt column=0; |
2339 TPtrC text; |
2479 TPtrC text; |
2340 |
2480 |
2341 TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText; |
2481 TRgb aTextColor = aHighlight ? aColors.iHighlightedText : aColors.iText; |
2342 |
2482 |
2343 // Turned the drawing to multipass algorithm, because optionalcolumns drawing will |
2483 // Turned the drawing to multipass algorithm, because optionalcolumns drawing will |
2344 // be too difficult to do without - and this is cleaner solution. |
2484 // be too difficult to do without - and this is cleaner solution. |
2345 |
2485 |
2346 // pass 1, figures out x-coordinates for columns. |
2486 // pass 1, figures out x-coordinates for columns. |
2347 TInt x = aRect.iTl.iX; |
2487 TInt x = itemRect.iTl.iX; |
2348 TBool mirror = AknLayoutUtils::LayoutMirrored(); |
2488 TBool mirror = AknLayoutUtils::LayoutMirrored(); |
2349 if (mirror) |
2489 if (mirror) |
2350 { |
2490 { |
2351 x = aRect.iBr.iX; |
2491 x = itemRect.iBr.iX; |
2352 } |
2492 } |
2353 TInt maxx = x; |
2493 TInt maxx = x; |
2354 while(column <= lastColumn) |
2494 while(column <= lastColumn) |
2355 { |
2495 { |
2356 // order of instructions is important here, do not change. |
2496 // order of instructions is important here, do not change. |
2411 column++; |
2551 column++; |
2412 } |
2552 } |
2413 |
2553 |
2414 // pass 3 drawing |
2554 // pass 3 drawing |
2415 |
2555 |
2416 // SERIES60 Background drawing. |
2556 |
2417 MAknsSkinInstance *skin = AknsUtils::SkinInstance(); |
|
2418 MAknsControlContext *cc = AknsDrawUtils::ControlContext( Control() ); |
|
2419 if (!cc) |
|
2420 { |
|
2421 cc = SkinBackgroundContext(); |
|
2422 } |
|
2423 |
|
2424 // aRect is list item's rect, width of which is smaller than width of the list |
|
2425 // with a scroll bar. List needs to draw under scroll bar anyway, so we need to |
|
2426 // modify given rect here. |
|
2427 TRect r(aRect); |
|
2428 |
|
2429 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
|
2430 |
|
2431 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
2432 |
|
2433 MAknListBoxTfxInternal *transApi = CAknListLoader::TfxApiInternal( &aGc ); |
|
2434 |
|
2435 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
2436 |
|
2437 if ( !listbox || !listbox->BackgroundDrawingSuppressed() ) |
|
2438 { |
|
2439 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
2440 if ( transApi ) |
|
2441 { |
|
2442 transApi->StartDrawing( MAknListBoxTfxInternal::EListView ); |
|
2443 } |
|
2444 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
2445 |
|
2446 aGc.SetBrushStyle(CGraphicsContext::ESolidBrush); |
|
2447 aGc.SetPenStyle(CGraphicsContext::ESolidPen); |
|
2448 |
|
2449 if ( listbox ) |
|
2450 { |
|
2451 AknsDrawUtils::Background( skin, cc, listbox, aGc, aRect ); |
|
2452 } |
|
2453 else |
|
2454 { |
|
2455 aGc.Clear(aRect); |
|
2456 } |
|
2457 |
|
2458 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
|
2459 if ( transApi ) |
|
2460 { |
|
2461 transApi->StopDrawing(); |
|
2462 } |
|
2463 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
|
2464 } |
|
2465 |
|
2466 // LISTBOX LINES NEED TO BE DRAWN HERE. |
|
2467 DrawHighLight( aGc, aRect, aHighlight, skin ); |
|
2468 |
2557 |
2469 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
2558 #ifdef RD_UI_TRANSITION_EFFECTS_LIST |
2470 if ( transApi ) |
2559 if ( transApi ) |
2471 { |
2560 { |
2472 transApi->StartDrawing( MAknListBoxTfxInternal::EListItem ); |
2561 transApi->StartDrawing( MAknListBoxTfxInternal::EListItem ); |
2473 CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View(); |
2562 CListBoxView* view = static_cast<CEikListBox*>( iExtension->iControl )->View(); |
2474 aGc.SetClippingRect( view->ViewRect() ); |
2563 aGc.SetClippingRect( view->ViewRect() ); |
2475 } |
2564 } |
2476 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2565 #endif // RD_UI_TRANSITION_EFFECTS_LIST |
2477 |
|
2478 // The column draw loop |
2566 // The column draw loop |
2479 column = 0; |
2567 column = 0; |
2480 FOREVER |
2568 FOREVER |
2481 { |
2569 { |
2482 if (column > lastColumn) break; |
2570 if (column > lastColumn) break; |
2733 transApi->StopDrawing(); |
2820 transApi->StopDrawing(); |
2734 } |
2821 } |
2735 #endif //RD_UI_TRANSITION_EFFECTS_LIST |
2822 #endif //RD_UI_TRANSITION_EFFECTS_LIST |
2736 } |
2823 } |
2737 |
2824 |
|
2825 // ----------------------------------------------------------------------------- |
|
2826 // CColumnListBoxData::DrawMarkingModeIcons |
|
2827 // ----------------------------------------------------------------------------- |
|
2828 // |
|
2829 void CColumnListBoxData::DrawMarkingModeIcons( |
|
2830 const TListItemProperties& aProperties, |
|
2831 CWindowGc& aGc, |
|
2832 TRect& aItemRect ) const |
|
2833 { |
|
2834 CEikListBox* listbox = static_cast<CEikListBox*>( iExtension->iControl ); |
|
2835 TRect textRect( aItemRect ); |
|
2836 |
|
2837 if ( listbox->View() && listbox->View()->ItemDrawer() ) |
|
2838 { |
|
2839 if ( listbox->View()->ItemDrawer()->Flags() |
|
2840 & CListItemDrawer::EMarkingModeEnabled && |
|
2841 !aProperties.IsSelectionHidden() && |
|
2842 iExtension->iMarkingIconArray && |
|
2843 iExtension->iMarkingIconArray->Count() == |
|
2844 KMarkingModeIconArraySize ) |
|
2845 { |
|
2846 if ( AknLayoutUtils::LayoutMirrored() ) |
|
2847 { |
|
2848 textRect.iBr.iX -= |
|
2849 AknLayoutScalable_Avkon::list_single_graphic_pane_t1( |
|
2850 0 ).LayoutLine().ir; |
|
2851 } |
|
2852 else |
|
2853 { |
|
2854 textRect.iTl.iX += |
|
2855 AknLayoutScalable_Avkon::list_single_graphic_pane_t1( |
|
2856 0 ).LayoutLine().il; |
|
2857 } |
|
2858 TAknLayoutRect layoutRect; |
|
2859 layoutRect.LayoutRect( aItemRect, |
|
2860 AknLayoutScalable_Avkon::list_single_graphic_pane_g1( 0 ) ); |
|
2861 |
|
2862 // unchecked icon |
|
2863 CGulIcon* icon = (*iExtension->iMarkingIconArray)[1]; |
|
2864 |
|
2865 if ( listbox->View()->ItemIsSelected( iExtension->iCurrentRow ) ) |
|
2866 { |
|
2867 icon = (*iExtension->iMarkingIconArray)[0]; |
|
2868 } |
|
2869 CFbsBitmap* bitmap = icon->Bitmap(); |
|
2870 |
|
2871 if ( bitmap ) |
|
2872 { |
|
2873 TSize size( bitmap->SizeInPixels() ); // set size if not already |
|
2874 TSize targetSize( layoutRect.Rect().Size() ); |
|
2875 |
|
2876 if ( size.iWidth != targetSize.iWidth && |
|
2877 size.iHeight != targetSize.iHeight ) |
|
2878 { |
|
2879 AknIconUtils::SetSize( |
|
2880 bitmap, |
|
2881 targetSize, |
|
2882 EAspectRatioPreservedAndUnusedSpaceRemoved ); |
|
2883 } |
|
2884 |
|
2885 aGc.BitBltMasked( layoutRect.Rect().iTl, |
|
2886 bitmap, |
|
2887 TRect( layoutRect.Rect().Size() ), |
|
2888 icon->Mask(), |
|
2889 EFalse ); |
|
2890 } |
|
2891 aItemRect = textRect; |
|
2892 } |
|
2893 } |
|
2894 } |
2738 |
2895 |
2739 void CColumnListBoxData::AddColumnL(TInt aColumn) |
2896 void CColumnListBoxData::AddColumnL(TInt aColumn) |
2740 // |
2897 // |
2741 // Add a column's worth of data |
2898 // Add a column's worth of data |
2742 // |
2899 // |
2859 |
3016 |
2860 EXPORT_C void CColumnListBoxData::SetColumnFontForRowL(TInt aRow, |
3017 EXPORT_C void CColumnListBoxData::SetColumnFontForRowL(TInt aRow, |
2861 TInt aColumn, |
3018 TInt aColumn, |
2862 const CFont* aFont) |
3019 const CFont* aFont) |
2863 { |
3020 { |
|
3021 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
2864 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3022 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
2865 if (!iExtension) return; |
|
2866 TInt index = 0; |
3023 TInt index = 0; |
2867 iExtension->FindRowAndColumnIndexOrAddL(index,aRow,aColumn); |
3024 iExtension->FindRowAndColumnIndexOrAddL(index,aRow,aColumn); |
2868 iExtension->At(index).iFont=aFont; |
3025 iExtension->At(index).iFont=aFont; |
2869 } |
3026 } |
2870 |
3027 |
2871 EXPORT_C const CFont* |
3028 EXPORT_C const CFont* |
2872 CColumnListBoxData::RowAndColumnFont(TInt aRow,TInt aColumn) const |
3029 CColumnListBoxData::RowAndColumnFont(TInt aRow,TInt aColumn) const |
2873 { |
3030 { |
2874 if (!iExtension) return 0; |
3031 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
2875 TInt index = 0; |
3032 TInt index = 0; |
2876 if (iExtension->FindRowAndColumnIndex(index,aRow,aColumn)!=0) |
3033 if (iExtension->FindRowAndColumnIndex(index,aRow,aColumn)!=0) |
2877 return 0; |
3034 return 0; |
2878 return(iExtension->At(index).iFont); |
3035 return(iExtension->At(index).iFont); |
2879 } |
3036 } |
2880 |
3037 |
2881 void CColumnListBoxData::SetCurrentItemIndex(TInt aIndex) |
3038 void CColumnListBoxData::SetCurrentItemIndex(TInt aIndex) |
2882 { |
3039 { |
|
3040 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
2883 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3041 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
2884 if( iExtension->iCurrentRow != aIndex ) |
3042 if( iExtension->iCurrentRow != aIndex ) |
2885 { |
3043 { |
2886 iExtension->iAnimFlags.Set( CColumnListBoxDataExtension::EFlagUpdateBg ); |
3044 iExtension->iAnimFlags.Set( CColumnListBoxDataExtension::EFlagUpdateBg ); |
2887 } |
3045 } |
3027 // ----------------------------------------------------------------------------- |
3186 // ----------------------------------------------------------------------------- |
3028 // |
3187 // |
3029 EXPORT_C void CColumnListBoxData::SetHighlightAnimBackgroundDrawer( |
3188 EXPORT_C void CColumnListBoxData::SetHighlightAnimBackgroundDrawer( |
3030 MColumnListBoxAnimBackgroundDrawer* aDrawer ) |
3189 MColumnListBoxAnimBackgroundDrawer* aDrawer ) |
3031 { |
3190 { |
|
3191 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3032 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3192 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3033 if( iExtension ) |
3193 iExtension->iHighlightBgDrawer = aDrawer; |
3034 { |
|
3035 iExtension->iHighlightBgDrawer = aDrawer; |
|
3036 } |
|
3037 } |
3194 } |
3038 |
3195 |
3039 // ----------------------------------------------------------------------------- |
3196 // ----------------------------------------------------------------------------- |
3040 // CColumnListBoxData::SetItemCellSize |
3197 // CColumnListBoxData::SetItemCellSize |
3041 // ----------------------------------------------------------------------------- |
3198 // ----------------------------------------------------------------------------- |
3042 // |
3199 // |
3043 EXPORT_C void CColumnListBoxData::SetItemCellSize( const TSize& aSizeInPixels ) |
3200 EXPORT_C void CColumnListBoxData::SetItemCellSize( const TSize& aSizeInPixels ) |
3044 { |
3201 { |
|
3202 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3045 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3203 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3046 if( iExtension ) |
3204 |
3047 { |
3205 if( iExtension->iAnimSize != aSizeInPixels ) |
3048 if( iExtension->iAnimSize != aSizeInPixels ) |
3206 { |
3049 { |
3207 iExtension->Play(); |
3050 iExtension->Play(); |
3208 } |
3051 } |
3209 iExtension->iAnimSize = aSizeInPixels; |
3052 iExtension->iAnimSize = aSizeInPixels; |
|
3053 } |
|
3054 } |
3210 } |
3055 |
3211 |
3056 // ----------------------------------------------------------------------------- |
3212 // ----------------------------------------------------------------------------- |
3057 // CColumnListBoxData::HasHighlightAnim |
3213 // CColumnListBoxData::HasHighlightAnim |
3058 // ----------------------------------------------------------------------------- |
3214 // ----------------------------------------------------------------------------- |
3059 // |
3215 // |
3060 EXPORT_C TBool CColumnListBoxData::HasHighlightAnim() const |
3216 EXPORT_C TBool CColumnListBoxData::HasHighlightAnim() const |
3061 { |
3217 { |
3062 if( !iExtension ) |
3218 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3063 return EFalse; |
|
3064 if( !iExtension->iAnimation ) |
3219 if( !iExtension->iAnimation ) |
3065 return EFalse; |
3220 return EFalse; |
3066 return ETrue; |
3221 return ETrue; |
3067 } |
3222 } |
3068 |
3223 |
3086 // CColumnListBoxData::FocusGained |
3239 // CColumnListBoxData::FocusGained |
3087 // ----------------------------------------------------------------------------- |
3240 // ----------------------------------------------------------------------------- |
3088 // |
3241 // |
3089 void CColumnListBoxData::FocusGained() |
3242 void CColumnListBoxData::FocusGained() |
3090 { |
3243 { |
|
3244 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3091 iExtension->FocusGained(); |
3245 iExtension->FocusGained(); |
3092 } |
3246 } |
3093 |
3247 |
3094 // ----------------------------------------------------------------------------- |
3248 // ----------------------------------------------------------------------------- |
3095 // CColumnListBoxData::FocusLost |
3249 // CColumnListBoxData::FocusLost |
3096 // ----------------------------------------------------------------------------- |
3250 // ----------------------------------------------------------------------------- |
3097 // |
3251 // |
3098 void CColumnListBoxData::FocusLost() |
3252 void CColumnListBoxData::FocusLost() |
3099 { |
3253 { |
|
3254 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3100 iExtension->FocusLost(); |
3255 iExtension->FocusLost(); |
3101 } |
3256 } |
3102 |
3257 |
3103 void CColumnListBoxData::HandleResourceChange( TInt aType ) |
3258 void CColumnListBoxData::HandleResourceChange( TInt aType ) |
3104 { |
3259 { |
|
3260 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3105 _AKNTRACE( "[%s][%s] aType = %d", "CColumnListBoxData", __FUNCTION__, aType ); |
3261 _AKNTRACE( "[%s][%s] aType = %d", "CColumnListBoxData", __FUNCTION__, aType ); |
3106 // Animation is skin dependent, whenever skin changes animation changes |
3262 // Animation is skin dependent, whenever skin changes animation changes |
3107 // too. |
3263 // too. |
3108 if( KAknsMessageSkinChange == aType ) |
3264 if( KAknsMessageSkinChange == aType ) |
3109 { |
3265 { |
3110 iExtension->SkinChanged(); |
3266 TRAP_IGNORE( iExtension->SkinChangedL() ); |
3111 } |
3267 } |
3112 else if(aType == KEikDynamicLayoutVariantSwitch) |
3268 else if(aType == KEikDynamicLayoutVariantSwitch) |
3113 { |
3269 { |
3114 // What is under highlight may have changed -> we need to update |
3270 // What is under highlight may have changed -> we need to update |
3115 // highlight background to animation. |
3271 // highlight background to animation. |
3157 } |
3313 } |
3158 } |
3314 } |
3159 |
3315 |
3160 void CColumnListBoxData::SetESSTextColor(TRgb aTextColor) |
3316 void CColumnListBoxData::SetESSTextColor(TRgb aTextColor) |
3161 { |
3317 { |
3162 if (iExtension) |
3318 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3163 iExtension->iTextColor = aTextColor; |
3319 iExtension->iTextColor = aTextColor; |
3164 } |
3320 } |
3165 |
3321 |
3166 void CColumnListBoxData::SetESSHighlightedTextColor(TRgb aHighlightedTextColor) |
3322 void CColumnListBoxData::SetESSHighlightedTextColor(TRgb aHighlightedTextColor) |
3167 { |
3323 { |
3168 if (iExtension) |
3324 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3169 iExtension->iHighlightedTextColor = aHighlightedTextColor; |
3325 iExtension->iHighlightedTextColor = aHighlightedTextColor; |
3170 } |
3326 } |
3171 |
3327 |
3172 EXPORT_C void CColumnListBoxData::SetColumnUnderlined( TBitFlags32 aUnderlinedColumns ) |
3328 EXPORT_C void CColumnListBoxData::SetColumnUnderlined( TBitFlags32 aUnderlinedColumns ) |
3173 { |
3329 { |
3174 if ( iExtension ) |
3330 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3175 { |
3331 iExtension->iUnderlineFlagSet = ETrue; |
3176 iExtension->iUnderlineFlagSet = ETrue; |
3332 iExtension->iUnderlineFlags = aUnderlinedColumns; |
3177 iExtension->iUnderlineFlags = aUnderlinedColumns; |
|
3178 } |
|
3179 } |
3333 } |
3180 |
3334 |
3181 void CColumnListBoxData::SetUnderlineStyle( TListItemProperties aProperties, |
3335 void CColumnListBoxData::SetUnderlineStyle( TListItemProperties aProperties, |
3182 CWindowGc& aGc, |
3336 CWindowGc& aGc, |
3183 TInt aColumn ) const |
3337 TInt aColumn ) const |
3184 { |
3338 { |
3185 if ( !iExtension ) |
3339 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3186 { |
|
3187 return; |
|
3188 } |
|
3189 |
|
3190 if ( !iExtension->iUnderlineFlagSet ) |
3340 if ( !iExtension->iUnderlineFlagSet ) |
3191 { |
3341 { |
3192 // underlining is already either on or off and |
3342 // underlining is already either on or off and |
3193 // hardcoded off turning will ensure old style |
3343 // hardcoded off turning will ensure old style |
3194 // behaviour |
3344 // behaviour |
3245 // ----------------------------------------------------------------------------- |
3391 // ----------------------------------------------------------------------------- |
3246 // |
3392 // |
3247 EXPORT_C void CColumnListBoxData::SetGraphicSubCellL(TInt aSubCell, |
3393 EXPORT_C void CColumnListBoxData::SetGraphicSubCellL(TInt aSubCell, |
3248 const TAknWindowLineLayout &aGraphicLayout) |
3394 const TAknWindowLineLayout &aGraphicLayout) |
3249 { |
3395 { |
|
3396 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3250 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3397 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3251 if (!iExtension) return; |
|
3252 TInt index = 0; |
3398 TInt index = 0; |
3253 iExtension->FindSLSubCellIndexOrAddL(index,aSubCell); |
3399 iExtension->FindSLSubCellIndexOrAddL(index,aSubCell); |
3254 iExtension->AtSL(index).iTextLayout=NULL; |
3400 iExtension->AtSL(index).iTextLayout=NULL; |
3255 iExtension->AtSL(index).iGraphicLayout=aGraphicLayout; |
3401 iExtension->AtSL(index).iGraphicLayout=aGraphicLayout; |
3256 iExtension->AtSL(index).iSubCellType=CColumnListBoxDataExtension::EEikSLGraphic; |
3402 iExtension->AtSL(index).iSubCellType=CColumnListBoxDataExtension::EEikSLGraphic; |
3294 // ----------------------------------------------------------------------------- |
3440 // ----------------------------------------------------------------------------- |
3295 // |
3441 // |
3296 EXPORT_C void CColumnListBoxData::SetTextSubCellL(TInt aSubCell, |
3442 EXPORT_C void CColumnListBoxData::SetTextSubCellL(TInt aSubCell, |
3297 const TAknTextLineLayout &aTextLayout) |
3443 const TAknTextLineLayout &aTextLayout) |
3298 { |
3444 { |
|
3445 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3299 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3446 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3300 if (!iExtension) return; |
|
3301 TInt index = 0; |
3447 TInt index = 0; |
3302 iExtension->FindSLSubCellIndexOrAddL(index,aSubCell); |
3448 iExtension->FindSLSubCellIndexOrAddL(index,aSubCell); |
3303 iExtension->AtSL(index).iTextLayout=aTextLayout; |
3449 iExtension->AtSL(index).iTextLayout=aTextLayout; |
3304 iExtension->AtSL(index).iGraphicLayout=NULL; |
3450 iExtension->AtSL(index).iGraphicLayout=NULL; |
3305 iExtension->AtSL(index).iSubCellType=CColumnListBoxDataExtension::EEikSLText; |
3451 iExtension->AtSL(index).iSubCellType=CColumnListBoxDataExtension::EEikSLText; |
3344 // |
3490 // |
3345 EXPORT_C void CColumnListBoxData::SetConditionalSubCellL(TInt aSubCell, |
3491 EXPORT_C void CColumnListBoxData::SetConditionalSubCellL(TInt aSubCell, |
3346 const TAknTextLineLayout &aTextLayout, |
3492 const TAknTextLineLayout &aTextLayout, |
3347 TInt aAffectedSubCell) |
3493 TInt aAffectedSubCell) |
3348 { |
3494 { |
|
3495 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3349 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3496 _AKNTRACE( "[%s][%s][%d].", "CColumnListBoxData", __FUNCTION__, __LINE__ ); |
3350 // iConditionValue of affected subcell (=text subcell, which has different layouts) |
3497 // iConditionValue of affected subcell (=text subcell, which has different layouts) |
3351 // contains index of graphical subcell, which existence should be checked first. |
3498 // contains index of graphical subcell, which existence should be checked first. |
3352 // This graphical subcell has in iConditionValue index of graphical subcell, |
3499 // This graphical subcell has in iConditionValue index of graphical subcell, |
3353 // which existence should be checked second etc. Each graphical subcell can |
3500 // which existence should be checked second etc. Each graphical subcell can |
3354 // affect only to 1 text subcell (or none). |
3501 // affect only to 1 text subcell (or none). |
3355 |
3502 |
3356 // for compabitility - needed at least for text wrapping |
3503 // for compabitility - needed at least for text wrapping |
3357 SetOptionalColumnL( aSubCell, ETrue ); |
3504 SetOptionalColumnL( aSubCell, ETrue ); |
3358 if (!iExtension) return; |
|
3359 |
3505 |
3360 TInt i = 0x01; |
3506 TInt i = 0x01; |
3361 i = i << aSubCell; |
3507 i = i << aSubCell; |
3362 iExtension->iConditionalCells = iExtension->iConditionalCells | i; |
3508 iExtension->iConditionalCells = iExtension->iConditionalCells | i; |
3363 |
3509 |
3480 // CColumnListBoxData::UsesScalableLayoutData |
3626 // CColumnListBoxData::UsesScalableLayoutData |
3481 // ----------------------------------------------------------------------------- |
3627 // ----------------------------------------------------------------------------- |
3482 // |
3628 // |
3483 TBool CColumnListBoxData::UsesScalableLayoutData() const |
3629 TBool CColumnListBoxData::UsesScalableLayoutData() const |
3484 { |
3630 { |
3485 if (iExtension) |
3631 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3486 return iExtension->iUseLayoutData; |
3632 return iExtension->iUseLayoutData; |
3487 |
|
3488 return EFalse; |
|
3489 } |
3633 } |
3490 |
3634 |
3491 // ----------------------------------------------------------------------------- |
3635 // ----------------------------------------------------------------------------- |
3492 // CColumnListBoxData::EnableStretching |
3636 // CColumnListBoxData::EnableStretching |
3493 // ----------------------------------------------------------------------------- |
3637 // ----------------------------------------------------------------------------- |
3494 // |
3638 // |
3495 void CColumnListBoxData::EnableStretching( const TBool aEnabled ) |
3639 void CColumnListBoxData::EnableStretching( const TBool aEnabled ) |
3496 { |
3640 { |
3497 if ( !iExtension ) |
3641 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3498 { |
|
3499 return; |
|
3500 } |
|
3501 |
|
3502 iExtension->iStretchingEnabled = aEnabled; |
3642 iExtension->iStretchingEnabled = aEnabled; |
3503 } |
3643 } |
3504 |
3644 |
3505 #ifdef RD_LIST_STRETCH |
3645 #ifdef RD_LIST_STRETCH |
3506 // ----------------------------------------------------------------------------- |
3646 // ----------------------------------------------------------------------------- |
3507 // CColumnListBoxData::StretchingEnabled |
3647 // CColumnListBoxData::StretchingEnabled |
3508 // ----------------------------------------------------------------------------- |
3648 // ----------------------------------------------------------------------------- |
3509 // |
3649 // |
3510 EXPORT_C TBool CColumnListBoxData::StretchingEnabled() const |
3650 EXPORT_C TBool CColumnListBoxData::StretchingEnabled() const |
3511 { |
3651 { |
3512 if ( !iExtension ) |
3652 __ASSERT_DEBUG( iExtension, Panic( EEikPanicNullPointer ) ); |
3513 { |
|
3514 return EFalse; |
|
3515 } |
|
3516 |
|
3517 return iExtension->iStretchingEnabled; |
3653 return iExtension->iStretchingEnabled; |
3518 } |
3654 } |
3519 |
3655 |
3520 #else |
3656 #else |
3521 // ----------------------------------------------------------------------------- |
3657 // ----------------------------------------------------------------------------- |