messagingapp/msgappfw/client/src/ccsrequesthandler.cpp
changeset 52 12db4185673b
parent 44 36f374c67aa8
child 72 6f657153cbc5
--- a/messagingapp/msgappfw/client/src/ccsrequesthandler.cpp	Tue Jul 06 14:12:40 2010 +0300
+++ b/messagingapp/msgappfw/client/src/ccsrequesthandler.cpp	Wed Aug 18 09:45:25 2010 +0300
@@ -232,6 +232,8 @@
     TInt error = KErrNone;
 
     RPointerArray<CCsConversationEntry> ConversationEntryList;
+    TInt totalConversationCount(0);
+    
     // Parse the results
     RDesReadStream resultStream(iConvResultsBuffer->Des());
     TInt  conversationEntryCount = 0;
@@ -240,6 +242,9 @@
 
     conversationEntryCount = resultStream.ReadInt32L();
 
+    //Read total conversation count
+   totalConversationCount = resultStream.ReadInt32L();
+
     resultStream.Pop());
 
     if(error != KErrNone)
@@ -289,7 +294,7 @@
     // Pass the results to the observer
     if ( iResultsObserver )
         {
-        iResultsObserver->Conversations(ConversationEntryList);
+        iResultsObserver->Conversations(ConversationEntryList, totalConversationCount);
         }
         
     // cleanup heap data
@@ -705,7 +710,9 @@
 // convresation view.
 // -----------------------------------------------------------------------------
 EXPORT_C void CCSRequestHandler::GetConversationsL(
-        CCsClientConversation*  aClientConversation)
+        CCsClientConversation*  aClientConversation,
+        TInt aKnownIndex, 
+        TInt aPageSize)
     {
     PRINT( _L("Enter CCSRequestHandler::GetConversationsL") );
 
@@ -724,7 +731,11 @@
     // Stream over the temp buffer
     RBufWriteStream dataStream(*dataBuf);
     dataStream.PushL();
-
+    
+    //Write requested details in buffer.
+    dataStream.WriteInt32L(aKnownIndex);
+    dataStream.WriteInt32L(aPageSize);
+    
     // Write the Client Conversation in the stream
     aClientConversation->ExternalizeL(dataStream);
     dataStream.CommitL();
@@ -1332,7 +1343,9 @@
 // -----------------------------------------------------------------------------
 // CCSRequestHandler::GetMessagingHistoryL()
 // -----------------------------------------------------------------------------
-EXPORT_C void CCSRequestHandler::GetMessagingHistoryL(TInt aContactId)
+EXPORT_C void CCSRequestHandler::GetMessagingHistoryL(TInt aContactId,
+        TInt aKnownIndex, 
+        TInt aPageSize)
     {
     TInt conversationId = GetConversationIdL(aContactId);
     if ( conversationId == -1 )
@@ -1343,7 +1356,7 @@
     //set dummy entry
     CCsConversationEntry *entry = CCsConversationEntry::NewL();
     clientConversation->SetConversationEntryL(entry);
-    GetConversationsL(clientConversation);
+    GetConversationsL(clientConversation,aKnownIndex,aPageSize);
     
     //delete 
     delete clientConversation;