198 conversationCount ); |
198 conversationCount ); |
199 } |
199 } |
200 |
200 |
201 // ---------------------------------------------------------------------------- |
201 // ---------------------------------------------------------------------------- |
202 // CCsConversationCache::GetConversationsL |
202 // CCsConversationCache::GetConversationsL |
|
203 // Get segment of conversations for a given conversation Id, knownIndex and page size. |
|
204 // The return list is set inside aConversationEntryList and aTotalConversationCount |
|
205 // has total conversation count. |
|
206 // ---------------------------------------------------------------------------- |
|
207 void |
|
208 CCsConversationCache::GetConversationsL( |
|
209 const CCsClientConversation* aClientConversation, |
|
210 RPointerArray<CCsConversationEntry>* aConversationEntryList, |
|
211 TInt aKnownIndex, |
|
212 TInt aPageSize, |
|
213 TInt& aTotalConversationCount) |
|
214 { |
|
215 TInt conversationCount = iConversationList->Count(); |
|
216 |
|
217 // Get the entry id from Client Conversation for which conversations are required |
|
218 TCsConversationEntryID conversationEntryID = |
|
219 aClientConversation->GetConversationEntryId(); |
|
220 |
|
221 for (TInt loop= 0; loop < conversationCount; loop++ ) |
|
222 { |
|
223 //match entry ID; |
|
224 CCsConversation* conversation = |
|
225 static_cast<CCsConversation*>((*iConversationList)[loop]); |
|
226 |
|
227 if(conversationEntryID == conversation->GetConversationId()) |
|
228 { |
|
229 TInt endIndex = conversation->GetEntryCount(); |
|
230 TInt startIndex(0); |
|
231 if((aKnownIndex!= 0) || (aPageSize !=0 )) |
|
232 { |
|
233 endIndex = endIndex- aKnownIndex; |
|
234 startIndex = endIndex - aPageSize; |
|
235 if( startIndex < 0 ) startIndex = 0; |
|
236 } |
|
237 // Search the conversation id and get the list inside |
|
238 // No need to check, becz it is initialize here only. |
|
239 conversation->GetEntryListL(aConversationEntryList, |
|
240 startIndex,endIndex); |
|
241 // May, meanwhile new conversation cached. |
|
242 aTotalConversationCount = conversation->GetEntryCount(); |
|
243 break; |
|
244 } |
|
245 } |
|
246 PRINT1 ( _L("CCsConversationCache::GetConversationsL - conversationCount:%d"), |
|
247 conversationCount ); |
|
248 } |
|
249 // ---------------------------------------------------------------------------- |
|
250 // CCsConversationCache::GetConversationsL |
203 // Get All Conversations for a given conversation Id |
251 // Get All Conversations for a given conversation Id |
204 // the return list is set inside aConversationEntryList |
252 // the return list is set inside aConversationEntryList |
205 // ---------------------------------------------------------------------------- |
253 // ---------------------------------------------------------------------------- |
206 void CCsConversationCache::GetConversationsL( |
254 void CCsConversationCache::GetConversationsL( |
207 const CCsClientConversation* aClientConversation, |
255 const CCsClientConversation* aClientConversation, |
687 // CCsConversationCache::GetConversationFromMessageIdL |
735 // CCsConversationCache::GetConversationFromMessageIdL |
688 // --------------------------------------------------------------------------- |
736 // --------------------------------------------------------------------------- |
689 CCsClientConversation* CCsConversationCache::GetConversationFromMessageIdL(TInt aMessageId) |
737 CCsClientConversation* CCsConversationCache::GetConversationFromMessageIdL(TInt aMessageId) |
690 { |
738 { |
691 TInt conversationCount = iConversationList->Count(); |
739 TInt conversationCount = iConversationList->Count(); |
692 |
740 CCsClientConversation *clientConv = NULL; |
693 for ( TInt loop = 0; loop < conversationCount; loop++ ) |
741 for ( TInt loop = 0; loop < conversationCount; loop++ ) |
694 { |
742 { |
695 CCsConversation* conversation = |
743 CCsConversation* conversation = |
696 static_cast<CCsConversation*>((*iConversationList)[loop]); |
744 static_cast<CCsConversation*>((*iConversationList)[loop]); |
697 |
745 |