Categories: S60 | Symbian C++ | Messaging | SMS | How To | Code Examples
This page was last modified 13:23, 20 November 2007.
How to create folders and Subfolders inside Inbox
From Forum Nokia Wiki
One can create folders or service entries inside standard messaging folders like InBox or Drafts. The following code for creating subfolders does not result in the creation of a subfolder in older versions of S60 3rd Edition. However it works properly in S60 3rd Edition FP1.
Member Variables
CMsvSession* iSession; // *this represents a class derived from MMsvSessionObserver iSession = CMsvSession::OpenSyncL(*this); CMsvOperationActiveSchedulerWait * iWaitOp; CMsvEntry* iEntry1;
Functions
void CreateFolder() { TMsvEntry folderEntry; folderEntry.iDescription.Set(_L("Folder")); folderEntry.iDetails.Set(_L("Folder")); folderEntry.iType = KUidMsvFolderEntry; folderEntry.iMtm = KUidMsgTypeSMS; folderEntry.SetReadOnly(EFalse); folderEntry.iServiceId = KMsvGlobalInBoxIndexEntryId; folderEntry.iDate.UniversalTime(); folderEntry.SetVisible(ETrue); folderEntry.SetStandardFolder(ETrue); TMsvSelectionOrdering sort1; CMsvEntry* parenfolderEntry = CMsvEntry::NewL (*iSession,KMsvGlobalInBoxIndexEntryId,sort1); if (!iWaitOp) { iWaitOp = CMsvOperationActiveSchedulerWait::NewLC(); CleanupStack::Pop(iWaitOp); } CMsvOperation * pCreateFolderOp = parenfolderEntry->CreateL (folderEntry,iWaitOp->iStatus); CleanupStack::PushL(pCreateFolderOp); iWaitOp->iStatus = KRequestPending; iWaitOp->Start(); CleanupStack::PopAndDestroy(pCreateFolderOp); CMsvEntrySelection* sel= parenfolderEntry->ChildrenWithMtmL (KUidMsgTypeSMS); TMsvId mtmid; mtmid = sel->At(0); //Folder1 Entry Id CreateSubFolderL(mtmid); } void CreateSubFolderL(TMsvId aParentId) { TMsvEntry subfolderEntry; subfolderEntry.iDescription.Set(_L("SubFolder")); subfolderEntry.iDetails.Set(_L("SubFolder")); subfolderEntry.iType = KUidMsvFolderEntry; subfolderEntry.iMtm = KUidMsgTypeSMS; subfolderEntry.iServiceId = aParentId; subfolderEntry.SetVisible(ETrue); subfolderEntry.SetStandardFolder(ETrue); subfolderEntry.iDate.UniversalTime(); TMsvSelectionOrdering sort2; iEntry1 = CMsvEntry::NewL(*iSession, aParentId,sort2); iEntry1->CreateL(subfolderEntry,iStatus); SetActive(); }
Related Links
| Related Discussions | ||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| questions regarding messaging in general | volker.eckert | General Messaging | 0 | 2006-03-27 15:38 |
| Launching Messaging Application | amitaggarwal | General Symbian C++ | 4 | 2005-11-01 15:01 |
| 关于图片显示的问题 | 13880440124 | Symbian | 4 | 2008-03-07 08:00 |
| how to delete stuck folders in n81 8GB | kizgirl | General Discussion | 0 | 2008-01-20 08:32 |
| question where save file | silviuccia | General Symbian C++ | 15 | 2008-02-13 15:57 |
