messagingapp/msgappfw/client/src/rcssession.cpp
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 37 518b245aa84c
child 47 5b14749788d7
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
   123 // Shutsdown the CS Server. Synchronous.
   123 // Shutsdown the CS Server. Synchronous.
   124 // ----------------------------------------------------------------------------
   124 // ----------------------------------------------------------------------------
   125 void RCsSession::ShutdownServerL()
   125 void RCsSession::ShutdownServerL()
   126 {
   126 {
   127     TIpcArgs args;
   127     TIpcArgs args;
   128     TRequestStatus status;
   128     User::LeaveIfError (SendReceive(EShutdown, args));
   129     SendReceive(EShutdown, args, status);
       
   130     User::WaitForRequest(status);
       
   131 
       
   132     PRINT ( _L("RCsSession::ShutdownServerL - ServerShutDown") );
   129     PRINT ( _L("RCsSession::ShutdownServerL - ServerShutDown") );
   133 }
   130 }
   134 
   131 
   135 // ----------------------------------------------------------------------------
   132 // ----------------------------------------------------------------------------
   136 // RCsSession::GetConversationListL
   133 // RCsSession::GetConversationListL
   162 void RCsSession::GetConversationUnreadListL(TPtr8 aOverflow, TPtr8 aResultsBuffer)
   159 void RCsSession::GetConversationUnreadListL(TPtr8 aOverflow, TPtr8 aResultsBuffer)
   163   {
   160   {
   164   PRINT( _L("Enter RCsSession::GetConversationEntryListL") );
   161   PRINT( _L("Enter RCsSession::GetConversationEntryListL") );
   165 
   162 
   166   TIpcArgs args(&aOverflow, &aResultsBuffer);
   163   TIpcArgs args(&aOverflow, &aResultsBuffer);
   167 
       
   168   TRequestStatus status;
       
   169 
       
   170   // Initiate the request
   164   // Initiate the request
   171   SendReceive(EGetConversationUnreadList, args, status);
   165   User::LeaveIfError (SendReceive(EGetConversationUnreadList, args));
   172 
       
   173   User::WaitForRequest(status);
       
   174 
       
   175   PRINT( _L("End RCsSession::GetConversationEntryListL") );
   166   PRINT( _L("End RCsSession::GetConversationEntryListL") );
   176   }
   167   }
   177 
   168 
   178 // ----------------------------------------------------------------------------
   169 // ----------------------------------------------------------------------------
   179 // RCsSession::GetConversationsL
   170 // RCsSession::GetConversationsL
   223 // to get caching status.
   214 // to get caching status.
   224 // ----------------------------------------------------------------------------
   215 // ----------------------------------------------------------------------------
   225 void RCsSession::GetCachingStatusL(TPtr8 aResultsBuffer)
   216 void RCsSession::GetCachingStatusL(TPtr8 aResultsBuffer)
   226 {
   217 {
   227     TIpcArgs args(TIpcArgs::ENothing, &aResultsBuffer);
   218     TIpcArgs args(TIpcArgs::ENothing, &aResultsBuffer);
   228 
   219     // Initiate the request
   229     TRequestStatus status;
   220     User::LeaveIfError (SendReceive(EGetCachingStatus, args));
   230 
       
   231     // Initiate the request
       
   232     SendReceive(EGetCachingStatus, args, status);
       
   233 
       
   234     User::WaitForRequest(status);
       
   235 }
   221 }
   236 
   222 
   237 // ----------------------------------------------------------------------------
   223 // ----------------------------------------------------------------------------
   238 // RCsSession::GetTotalUnreadCountL
   224 // RCsSession::GetTotalUnreadCountL
   239 // This function sends the request to conversation server
   225 // This function sends the request to conversation server
   240 // to get caching status.
   226 // to get caching status.
   241 // ----------------------------------------------------------------------------
   227 // ----------------------------------------------------------------------------
   242 void RCsSession::GetTotalUnreadCountL(TPtr8 aResultsBuffer)
   228 void RCsSession::GetTotalUnreadCountL(TPtr8 aResultsBuffer)
   243     {
   229     {
   244     TIpcArgs args(TIpcArgs::ENothing, &aResultsBuffer);
   230     TIpcArgs args(TIpcArgs::ENothing, &aResultsBuffer);
   245 
   231     // Initiate the request
   246     TRequestStatus status;
   232     User::LeaveIfError (SendReceive(EGetTotalUnreadCount, args));
   247 
       
   248     // Initiate the request
       
   249     SendReceive(EGetTotalUnreadCount, args, status);
       
   250 
       
   251     User::WaitForRequest(status);
       
   252     }
   233     }
   253 
   234 
   254 // ----------------------------------------------------------------------------
   235 // ----------------------------------------------------------------------------
   255 // RCsSession::SetConversationListChangeObserverL
   236 // RCsSession::SetConversationListChangeObserverL
   256 // This function sends the request to conversation server
   237 // This function sends the request to conversation server
   258 // ----------------------------------------------------------------------------
   239 // ----------------------------------------------------------------------------
   259 void RCsSession::SetConversationListChangeObserverL()
   240 void RCsSession::SetConversationListChangeObserverL()
   260 {
   241 {
   261     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   242     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   262 
   243 
   263     TRequestStatus status;
   244     // Initiate the request
   264 
   245     User::LeaveIfError ( SendReceive(ESetConversationListChangeObserver, args));
   265     // Initiate the request
   246 
   266     SendReceive(ESetConversationListChangeObserver, args, status);
   247   
   267 
       
   268     User::WaitForRequest(status);
       
   269 }
   248 }
   270 
   249 
   271 // ----------------------------------------------------------------------------
   250 // ----------------------------------------------------------------------------
   272 // RCsSession::ResetConversationListChangeObserverL
   251 // RCsSession::ResetConversationListChangeObserverL
   273 // This function sends the request to conversation server
   252 // This function sends the request to conversation server
   274 // to reset conversation list change observer flag.
   253 // to reset conversation list change observer flag.
   275 // ----------------------------------------------------------------------------
   254 // ----------------------------------------------------------------------------
   276 void RCsSession::ResetConversationListChangeObserverL()
   255 void RCsSession::ResetConversationListChangeObserverL()
   277 {
   256 {
   278     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   257     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   279 
   258     // Initiate the request
   280     TRequestStatus status;
   259     User::LeaveIfError ( SendReceive(EResetConversationListChangeObserver, args));
   281 
       
   282     // Initiate the request
       
   283     SendReceive(EResetConversationListChangeObserver, args, status);
       
   284 
       
   285     User::WaitForRequest(status);
       
   286 }
   260 }
   287 
   261 
   288 // ----------------------------------------------------------------------------
   262 // ----------------------------------------------------------------------------
   289 // RCsSession::SetConversationChangeObserverL
   263 // RCsSession::SetConversationChangeObserverL
   290 // This function sends the request to conversation server
   264 // This function sends the request to conversation server
   293 // ----------------------------------------------------------------------------
   267 // ----------------------------------------------------------------------------
   294 void RCsSession::SetConversationChangeObserverL(
   268 void RCsSession::SetConversationChangeObserverL(
   295                                                 const TDes8& aClientConversation)
   269                                                 const TDes8& aClientConversation)
   296 {
   270 {
   297     TIpcArgs args(&aClientConversation);
   271     TIpcArgs args(&aClientConversation);
   298 
   272     // Initiate the request
   299     TRequestStatus status;
   273     User::LeaveIfError (SendReceive(ESetConversationChangeObserver, args));
   300 
       
   301     // Initiate the request
       
   302     SendReceive(ESetConversationChangeObserver, args, status);
       
   303 
       
   304     User::WaitForRequest(status);
       
   305 }
   274 }
   306 
   275 
   307 // ----------------------------------------------------------------------------
   276 // ----------------------------------------------------------------------------
   308 // RCsSession::ResetConversationChangeObserverL
   277 // RCsSession::ResetConversationChangeObserverL
   309 // This function sends the request to conversation server
   278 // This function sends the request to conversation server
   312 // ----------------------------------------------------------------------------
   281 // ----------------------------------------------------------------------------
   313 void RCsSession::ResetConversationChangeObserverL(
   282 void RCsSession::ResetConversationChangeObserverL(
   314                                                   const TDes8& aClientConversation)
   283                                                   const TDes8& aClientConversation)
   315 {
   284 {
   316     TIpcArgs args(&aClientConversation);
   285     TIpcArgs args(&aClientConversation);
   317 
   286     // Initiate the request
   318     TRequestStatus status;
   287     User::LeaveIfError (SendReceive(EResetConversationChangeObserver, args));
   319 
       
   320     // Initiate the request
       
   321     SendReceive(EResetConversationChangeObserver, args, status);
       
   322 
       
   323     User::WaitForRequest(status);
       
   324 }
   288 }
   325 
   289 
   326 // ----------------------------------------------------------------------------
   290 // ----------------------------------------------------------------------------
   327 // RCsSession::SetCachingStatusObserverL
   291 // RCsSession::SetCachingStatusObserverL
   328 // This function sends the request to conversation server
   292 // This function sends the request to conversation server
   330 // ----------------------------------------------------------------------------
   294 // ----------------------------------------------------------------------------
   331 void RCsSession::SetCachingStatusObserverL()
   295 void RCsSession::SetCachingStatusObserverL()
   332 {
   296 {
   333     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   297     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   334 
   298 
   335     TRequestStatus status;
   299     // Initiate the request
   336 
   300     User::LeaveIfError (SendReceive(ESetCachingStatusObserver, args));
   337     // Initiate the request
       
   338     SendReceive(ESetCachingStatusObserver, args, status);
       
   339 
       
   340     User::WaitForRequest(status);
       
   341 }
   301 }
   342 
   302 
   343 // ----------------------------------------------------------------------------
   303 // ----------------------------------------------------------------------------
   344 // RCsSession::ResetConversationListChangeObserverL
   304 // RCsSession::ResetConversationListChangeObserverL
   345 // This function sends the request to conversation server
   305 // This function sends the request to conversation server
   347 // ----------------------------------------------------------------------------
   307 // ----------------------------------------------------------------------------
   348 void RCsSession::ResetCachingStatusObserverL()
   308 void RCsSession::ResetCachingStatusObserverL()
   349 {
   309 {
   350     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   310     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   351 
   311 
   352     TRequestStatus status;
   312     // Initiate the request
   353 
   313     User::LeaveIfError (SendReceive(EResetCachingStatusObserver, args));
   354     // Initiate the request
       
   355     SendReceive(EResetCachingStatusObserver, args, status);
       
   356 
       
   357     User::WaitForRequest(status);
       
   358 }
   314 }
   359 
   315 
   360 // ----------------------------------------------------------------------------
   316 // ----------------------------------------------------------------------------
   361 // RCsSession::RequestChangeEventL
   317 // RCsSession::RequestChangeEventL
   362 // This function sends the request to conversation server
   318 // This function sends the request to conversation server
   385 // ----------------------------------------------------------------------------
   341 // ----------------------------------------------------------------------------
   386 void RCsSession::RemoveChangeEventL()
   342 void RCsSession::RemoveChangeEventL()
   387 {
   343 {
   388     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   344     TIpcArgs args(TIpcArgs::ENothing, TIpcArgs::ENothing);
   389 
   345 
   390     TRequestStatus status;
   346     // Initiate the request
   391 
   347     User::LeaveIfError ( SendReceive(ERemoveChangeEvent, args));
   392     // Initiate the request
       
   393     SendReceive(ERemoveChangeEvent, args, status);
       
   394 
       
   395     User::WaitForRequest(status);
       
   396 }
   348 }
   397 
   349 
   398 // ----------------------------------------------------------------------------
   350 // ----------------------------------------------------------------------------
   399 // RCsSession::DeleteConversationL
   351 // RCsSession::DeleteConversationL
   400 // ----------------------------------------------------------------------------
   352 // ----------------------------------------------------------------------------
   418 // ----------------------------------------------------------------------------
   370 // ----------------------------------------------------------------------------
   419 void RCsSession::GetConversationIdL(TInt aContactId, TPtr8 aResultsBuffer)
   371 void RCsSession::GetConversationIdL(TInt aContactId, TPtr8 aResultsBuffer)
   420     {
   372     {
   421     PRINT( _L("Enter RCsSession::GetConversationIdL") );
   373     PRINT( _L("Enter RCsSession::GetConversationIdL") );
   422 
   374 
   423     TRequestStatus status;
   375 
   424     TIpcArgs args(aContactId, &aResultsBuffer);
   376     TIpcArgs args(aContactId, &aResultsBuffer);
   425 
   377 
   426     // Initiate the request
   378     // Initiate the request
   427     SendReceive(EGetConversationId,
   379     User::LeaveIfError (SendReceive(EGetConversationId, args) );
   428             args,
       
   429             status );
       
   430 
       
   431     User::WaitForRequest(status);
       
   432 
       
   433     PRINT( _L("End RCsSession::GetConversationIdL") );
   380     PRINT( _L("End RCsSession::GetConversationIdL") );
   434     }
   381     }
   435 
   382 
   436 // ----------------------------------------------------------------------------
   383 // ----------------------------------------------------------------------------
   437 // RCsSession::GetConversationIdFromAddressL
   384 // RCsSession::GetConversationIdFromAddressL
   438 // ----------------------------------------------------------------------------
   385 // ----------------------------------------------------------------------------
   439 void RCsSession::GetConversationIdFromAddressL(TDesC& aContactAddress, TPtr8 aResultsBuffer)
   386 void RCsSession::GetConversationIdFromAddressL(TDesC& aContactAddress, TPtr8 aResultsBuffer)
   440     {
   387     {
   441     PRINT( _L("Enter RCsSession::GetConversationIdFromAddressL") );
   388     PRINT( _L("Enter RCsSession::GetConversationIdFromAddressL") );
   442 
   389 
   443     TRequestStatus status;
       
   444     TIpcArgs args(&aContactAddress, &aResultsBuffer);
   390     TIpcArgs args(&aContactAddress, &aResultsBuffer);
   445 
   391 
   446     // Initiate the request
   392     // Initiate the request
   447     SendReceive(EGetConversationIdFromAddress,
   393     User::LeaveIfError (SendReceive(EGetConversationIdFromAddress,
   448             args,
   394             args ));
   449             status );
       
   450 
       
   451     User::WaitForRequest(status);
       
   452 
   395 
   453     PRINT( _L("End RCsSession::GetConversationIdFromAddressL") );
   396     PRINT( _L("End RCsSession::GetConversationIdFromAddressL") );
   454     }
   397     }
       
   398 	
       
   399 // ----------------------------------------------------------------------------
       
   400 // RCsSession::GetConversationFromMessageIdL
       
   401 // ----------------------------------------------------------------------------
       
   402 void RCsSession::GetConversationFromMessageIdL(TInt aMessageId, TPtr8 aResultsBuffer)
       
   403     {
       
   404     PRINT( _L("Enter RCsSession::GetConversationFromMessageIdL") );
       
   405     
       
   406     TIpcArgs args(aMessageId, &aResultsBuffer);
       
   407 
       
   408     // Initiate the request
       
   409     User::LeaveIfError (SendReceive(EGetConversationFromMessageId, args ) );
       
   410     PRINT( _L("End RCsSession::GetConversationFromMessageIdL") );
       
   411     }
       
   412 	
   455 // ----------------------------------------------------------------------------
   413 // ----------------------------------------------------------------------------
   456 // RCsSession::MarkConversationReadL
   414 // RCsSession::MarkConversationReadL
   457 // ----------------------------------------------------------------------------
   415 // ----------------------------------------------------------------------------
   458 void RCsSession::MarkConversationReadL(TInt aConversationId)
   416 void RCsSession::MarkConversationReadL(TInt aConversationId)
   459     {
   417     {