messagingapp/msgappfw/client/src/ccsrequesthandler.cpp
changeset 48 4f501b74aeb1
parent 37 518b245aa84c
child 67 fc91263aee62
--- a/messagingapp/msgappfw/client/src/ccsrequesthandler.cpp	Tue Jul 13 22:09:22 2010 +0530
+++ b/messagingapp/msgappfw/client/src/ccsrequesthandler.cpp	Sun Jul 25 18:59:19 2010 +0530
@@ -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;