messagingapp/msgui/appengine/src/conversationsengine.cpp
changeset 25 84d9eb65b26f
parent 23 238255e8b033
child 27 e4592d119491
child 37 518b245aa84c
equal deleted inserted replaced
23:238255e8b033 25:84d9eb65b26f
   152         d_ptr->deleteMessages(idArray);
   152         d_ptr->deleteMessages(idArray);
   153     }
   153     }
   154 }
   154 }
   155 
   155 
   156 //---------------------------------------------------------------
   156 //---------------------------------------------------------------
       
   157 // ConversationsEngine::deleteAllDraftMessages
       
   158 // @see header
       
   159 //---------------------------------------------------------------
       
   160 void ConversationsEngine::deleteAllDraftMessages()
       
   161 {
       
   162     int error;
       
   163     TRAP(error, d_ptr->deleteAllDraftMessagesL());
       
   164 }
       
   165 
       
   166 //---------------------------------------------------------------
   157 // ConversationsEngine::markConversationRead
   167 // ConversationsEngine::markConversationRead
   158 // @see header
   168 // @see header
   159 //---------------------------------------------------------------
   169 //---------------------------------------------------------------
   160 bool ConversationsEngine::markConversationRead(qint64 conversationId)
   170 bool ConversationsEngine::markConversationRead(qint64 conversationId)
   161 {
   171 {
   186 //---------------------------------------------------------------
   196 //---------------------------------------------------------------
   187 // ConversationsEngine::getContactDetails
   197 // ConversationsEngine::getContactDetails
   188 // @see header
   198 // @see header
   189 //---------------------------------------------------------------
   199 //---------------------------------------------------------------
   190 void ConversationsEngine::getContactDetails(qint64 conversationId,
   200 void ConversationsEngine::getContactDetails(qint64 conversationId,
   191     QString& firstName,
   201     QString& displayName,
   192     QString& lastName,
       
   193     QString& address)
   202     QString& address)
   194 {
   203 {
   195     QModelIndexList indexList = mConversationsSummaryModel->match(
   204     QModelIndexList indexList = mConversationsSummaryModel->match(
   196             mConversationsSummaryModel->index(0, 0), 
   205             mConversationsSummaryModel->index(0, 0), 
   197             ConversationId, 
   206             ConversationId, 
   199             1, // One match 
   208             1, // One match 
   200             Qt::MatchExactly);
   209             Qt::MatchExactly);
   201 
   210 
   202     if(indexList.count() > 0)
   211     if(indexList.count() > 0)
   203     {
   212     {
   204         firstName = indexList[0].data(FirstName).toString();
   213         displayName = indexList[0].data(DisplayName).toString();
   205         lastName = indexList[0].data(LastName).toString();
       
   206         address = indexList[0].data(ConversationAddress).toString();
   214         address = indexList[0].data(ConversationAddress).toString();
   207     }         
   215     }         
   208 }
   216 }
   209 
   217 
   210 //---------------------------------------------------------------
   218 //---------------------------------------------------------------
   282 void ConversationsEngine::fetchMoreConversations()
   290 void ConversationsEngine::fetchMoreConversations()
   283 {
   291 {
   284     d_ptr->fetchMoreConversations();
   292     d_ptr->fetchMoreConversations();
   285 }
   293 }
   286 
   294 
       
   295 //---------------------------------------------------------------
       
   296 // ConversationsEngine::resendMessage()
       
   297 // @see header
       
   298 //---------------------------------------------------------------
       
   299 
       
   300 bool ConversationsEngine::resendMessage(qint32 messageId)
       
   301 {
       
   302     return d_ptr->resendMessage(messageId);
       
   303 }
       
   304 
       
   305 //---------------------------------------------------------------
       
   306 // ConversationsEngine::downloadMessage()
       
   307 // @see header
       
   308 //---------------------------------------------------------------
       
   309 
       
   310 int ConversationsEngine::downloadMessage(qint32 messageId)
       
   311 {
       
   312     return d_ptr->downloadMessage(messageId);
       
   313 }
       
   314 
       
   315 //---------------------------------------------------------------
       
   316 // ConversationsEngine::downloadOperationSupported()
       
   317 // @see header
       
   318 //---------------------------------------------------------------
       
   319 bool ConversationsEngine::downloadOperationSupported(qint32 messageId)
       
   320 {
       
   321     return d_ptr->downloadOperationSupported(messageId);
       
   322 }
       
   323 
       
   324 //---------------------------------------------------------------
       
   325 // ConversationsEngine::markAsReadAndGetType()
       
   326 // @see header
       
   327 //---------------------------------------------------------------
       
   328 
       
   329 void ConversationsEngine::markAsReadAndGetType(qint32 messageId,
       
   330                                                int& msgType,
       
   331                                                int& msgSubType)
       
   332 {
       
   333 mConversationMsgStoreHandler->markAsReadAndGetType(messageId,
       
   334                                                     msgType,
       
   335                                                     msgSubType);
       
   336 }
       
   337 
       
   338 
       
   339 
   287 //EOF
   340 //EOF
   288 
   341