emailuis/nmailuiengine/src/nmdatamanager.cpp
changeset 27 9ba4404ef423
parent 23 2dc6caa42ec3
child 30 759dc5235cdb
--- a/emailuis/nmailuiengine/src/nmdatamanager.cpp	Fri May 14 15:41:10 2010 +0300
+++ b/emailuis/nmailuiengine/src/nmdatamanager.cpp	Thu May 27 12:43:55 2010 +0300
@@ -280,4 +280,32 @@
 }
 
 
+/*!
+    Returns folder type by id
 
+    \param mailboxId The ID of the mailbox containing the folder
+
+    \param folderId The ID of the folder 
+
+    \return Folder type
+*/
+NmFolderType NmDataManager::folderTypeById(NmId mailboxId, NmId folderId)
+{
+    NmFolderType folderType(NmFolderOther);
+    if (getStandardFolderId(mailboxId,NmFolderInbox)==folderId){
+        folderType=NmFolderInbox;
+    }
+    else if (getStandardFolderId(mailboxId,NmFolderOutbox)==folderId){
+        folderType=NmFolderOutbox; 
+    }
+    else if (getStandardFolderId(mailboxId,NmFolderDrafts)==folderId){
+        folderType=NmFolderDrafts;
+    }
+    else if (getStandardFolderId(mailboxId,NmFolderSent)==folderId){
+        folderType=NmFolderSent; 
+    }    
+    else if (getStandardFolderId(mailboxId,NmFolderDeleted)==folderId){
+        folderType=NmFolderDeleted;  
+    }    
+    return folderType;
+}