174 CleanupStack::PopAndDestroy(); |
175 CleanupStack::PopAndDestroy(); |
175 |
176 |
176 |
177 |
177 // todo |
178 // todo |
178 iListBoxText = HBufC::NewL( iDescriptionLength*3 ); |
179 iListBoxText = HBufC::NewL( iDescriptionLength*3 ); |
|
180 iDefaultViewSettings = KMceConversationview; |
179 } |
181 } |
180 |
182 |
181 // Two-phased constructor. |
183 // Two-phased constructor. |
182 CMceMainViewListItemArray* CMceMainViewListItemArray::NewL( |
184 CMceMainViewListItemArray* CMceMainViewListItemArray::NewL( |
183 CMsvSessionPtr aSession, |
185 CMsvSessionPtr aSession, |
456 if ( iSession->GetEntry( item.iMsvId, serviceId, entry ) == KErrNone ) |
462 if ( iSession->GetEntry( item.iMsvId, serviceId, entry ) == KErrNone ) |
457 { |
463 { |
458 if ( item.iIconIndex <= KErrNone || item.iIconIndex >= iBitmapResolver.MtmIconIndex() ) |
464 if ( item.iIconIndex <= KErrNone || item.iIconIndex >= iBitmapResolver.MtmIconIndex() ) |
459 { |
465 { |
460 TInt messageCount = 0; |
466 TInt messageCount = 0; |
461 CONST_CAST( TMceListItem*, &item)->iIconIndex = iBitmapResolver.BitmapIndex( entry, messageCount ); |
467 TMsvId id = entry.Id(); |
|
468 if(iDefaultViewSettings == KMceConversationview && id == KMsvGlobalInBoxIndexEntryId ) |
|
469 { |
|
470 CONST_CAST( TMceListItem*, &item)->iIconIndex = EMceBitmapIndexInbox; |
|
471 } |
|
472 else |
|
473 { |
|
474 CONST_CAST( TMceListItem*, &item)->iIconIndex = iBitmapResolver.BitmapIndex( entry, messageCount ); |
|
475 } |
462 CONST_CAST( TMceListItem*, &item)->iMessageCount = messageCount; |
476 CONST_CAST( TMceListItem*, &item)->iMessageCount = messageCount; |
463 } |
477 } |
464 tempText.AppendNum( item.iIconIndex ); |
478 tempText.AppendNum( item.iIconIndex ); |
465 tempText.Append( KColumnListSeparator ); |
479 tempText.Append( KColumnListSeparator ); |
466 tempText.Append( item.iPrintableText ); |
480 tempText.Append( item.iPrintableText ); |
1012 TMsvEntry entry; |
1026 TMsvEntry entry; |
1013 TMsvId serviceId; |
1027 TMsvId serviceId; |
1014 if ( iSession->GetEntry( item.iMsvId, serviceId, entry ) == KErrNone ) |
1028 if ( iSession->GetEntry( item.iMsvId, serviceId, entry ) == KErrNone ) |
1015 { |
1029 { |
1016 TInt messageCount = 0; |
1030 TInt messageCount = 0; |
1017 item.iIconIndex = iBitmapResolver.BitmapIndex( entry, messageCount ); |
1031 TMsvId id = entry.Id(); |
|
1032 if(iDefaultViewSettings == KMceConversationview && id == KMsvGlobalInBoxIndexEntryId ) |
|
1033 { |
|
1034 item.iIconIndex = EMceBitmapIndexInbox; |
|
1035 } |
|
1036 else |
|
1037 { |
|
1038 item.iIconIndex = iBitmapResolver.BitmapIndex( entry, messageCount ); |
|
1039 } |
1018 item.iMessageCount = messageCount; |
1040 item.iMessageCount = messageCount; |
1019 // item.iUnreadMessageCount = unreadMessageCount; |
1041 // item.iUnreadMessageCount = unreadMessageCount; |
1020 if ( iListItemArrayObserver ) |
1042 if ( iListItemArrayObserver ) |
1021 { |
1043 { |
1022 iListItemArrayObserver->MceListItemArrayChangedL(); |
1044 iListItemArrayObserver->MceListItemArrayChangedL(); |
1143 TMceListItem tempItem; |
1165 TMceListItem tempItem; |
1144 tempItem.iExtraItem = ETrue; |
1166 tempItem.iExtraItem = ETrue; |
1145 tempItem.iMsvId = extraItem.iCommandId; |
1167 tempItem.iMsvId = extraItem.iCommandId; |
1146 tempItem.iPrintableText.Copy( extraItem.iPrintableText ); |
1168 tempItem.iPrintableText.Copy( extraItem.iPrintableText ); |
1147 tempItem.iSecondaryText.Copy(extraItem.iSecondaryText); |
1169 tempItem.iSecondaryText.Copy(extraItem.iSecondaryText); |
|
1170 tempItem.iApplicationUid = extraItem.iApplicationUid; |
1148 TUid appUid; |
1171 TUid appUid; |
1149 appUid.iUid = extraItem.iApplicationUid; |
1172 appUid.iUid = extraItem.iApplicationUid; |
1150 AddExtraItemWithIconL( tempItem, Count(), extraItem.iIconIndex, appUid ); |
1173 AddExtraItemWithIconL( tempItem, Count(), extraItem.iIconIndex, appUid ); |
1151 } |
1174 } |
1152 } |
1175 } |
1247 } |
1270 } |
1248 CleanupStack::PopAndDestroy( smtpselection ); |
1271 CleanupStack::PopAndDestroy( smtpselection ); |
1249 CleanupStack::PopAndDestroy( entry ); |
1272 CleanupStack::PopAndDestroy( entry ); |
1250 return visiblecount; |
1273 return visiblecount; |
1251 } |
1274 } |
|
1275 // ---------------------------------------------------- |
|
1276 // CMceMainViewListItemArray::CreateConversationsListItem() |
|
1277 // ---------------------------------------------------- |
|
1278 TPtrC CMceMainViewListItemArray::CreateConversationsListItem( TInt aIndex ) const |
|
1279 { |
|
1280 const TMceListItem& item = At( aIndex ); |
|
1281 TPtr tempText = iListBoxText->Des(); |
|
1282 tempText.Zero(); |
|
1283 TInt bitmapidx = EMceBitmapIndexConversation; |
|
1284 if(iDefaultViewSettings == KMceConversationview ) |
|
1285 { |
|
1286 TInt msgCount = 0; |
|
1287 TInt unreadCount = 0; |
|
1288 iBitmapResolver.HasUnreadMessagesL(KMsvGlobalInBoxIndexEntryId,msgCount,unreadCount); |
|
1289 if( unreadCount > 0 ) |
|
1290 { |
|
1291 bitmapidx = EMceBitmapIndexConversationNew ; |
|
1292 } |
|
1293 } |
|
1294 tempText.AppendNum(bitmapidx); |
|
1295 TPtrC Ptr(item.iPrintableText); |
|
1296 TInt len = Ptr.Length(); |
|
1297 TInt pos = Ptr.Locate(KColumnListSeparator); |
|
1298 TPtrC Ptr1(Ptr.Mid(pos)); |
|
1299 tempText.Append(Ptr1); |
|
1300 return tempText; |
|
1301 } |
|
1302 |
|
1303 // ---------------------------------------------------- |
|
1304 // CMceMainViewListItemArray::SetDefaultViewSettings() |
|
1305 // ---------------------------------------------------- |
|
1306 void CMceMainViewListItemArray::SetDefaultViewSettings(TBool aVal) |
|
1307 { |
|
1308 iDefaultViewSettings = aVal; |
|
1309 Reset(); |
|
1310 TRAP_IGNORE(AddFoldersL()); |
|
1311 } |
1252 // End of File |
1312 // End of File |