|
|
User login
Feeds |
reading MailBox entries
|
|||||
| Mon, 2005-08-01 08:11 | |
How can I read all the entries of MailBox.
Any help.
Regards
CMsvSession* pMsv = CMsvSession::OpenSyncL(*this);
CMsvEntry* pMsvEntry = pMsv->GetEntryL(KMsvGlobalInBoxIndexEntryId);
for(TInt i=0;i<pMsvEntry->Count();i++)
{
TBuf<100> buf;
buf.Append((*pMsvEntry)[i].iDetails);
buf.Append((*pMsvEntry)[i].iDescription);
}
Forum posts: 239
Thanks for ypour reply.
But my question was how can i read all the entries of userdefined mailbox not inbox.
Can u help me..
Might be I have not clear my problem bit clear.Sorry for that.
Hoping for reply
Thanks
---------------
Bhatt Kavita
Forum posts: 192
Forum posts: 239
but from where to get mailbox id.
Is it predefined or have to feteched out from some fuction.
Can u explore the solution pls..
How can i read the entries
---------------
Bhatt Kavita
but from where to get mailbox id.
Is it predefined or have to feteched out from some fuction.
Can u explore the solution pls..
How can i read the entries
Forum posts: 239
I Got following Ids
// Predefined entry ids - values #defined in MSVSTD.HRH
const TMsvId KMsvNullIndexEntryId=KMsvNullIndexEntryIdValue;//0
const TMsvId KMsvTempIndexEntryId=KMsvTempIndexEntryIdValue;//1
const TMsvId KMsvRootIndexEntryId=KMsvRootIndexEntryIdValue;//0x1000
const TMsvId KMsvLocalServiceIndexEntryId=KMsvLocalServiceIndexEntryIdValue;//0x1001
const TMsvId KMsvGlobalInBoxIndexEntryId=KMsvGlobalInBoxIndexEntryIdValue;//0x1002
const TMsvId KMsvGlobalOutBoxIndexEntryId=KMsvGlobalOutBoxIndexEntryIdValue;//0x1003
const TMsvId KMsvDraftEntryId=KMsvDraftEntryIdValue; //0x1004
const TMsvId KMsvSentEntryId=KMsvSentEntryIdValue; //0x1005
const TMsvId KMsvDeletedEntryFolderEntryId=KMsvDeletedEntryFolderEntryIdValue;//0x1006
const TMsvId KMsvUnknownServiceIndexEntryId=KMsvUnkownServiceIndexEntryIdValue; //0x1007
const TMsvId KFirstFreeEntryId=0x100000;
which One should I use for mailbox and which one for MyFolder.
Can u help me hameed.
---------------
Bhatt Kavita
Forum posts: 192
use something like this:
CleanupStack::PushL(localServiceEntry);
CMsvEntrySelection *folders = localServiceEntry->ChildrenWithTypeL(KUidMsvFolderEntry);
CleanupStack::PushL(folders);
TInt count = folders->Count();
for (TInt i = 0;i < folderCount;i++)
{
TMsvEntry entry = localServiceEntry->ChildDataL((*folders)[i]);
// do something here... (e.g., entry.Id() gives you an ID of folder)
}
CleanupStack::PopAndDestroy(2); // localServiceEntry, folders
Forum posts: 239
I am trying like this
iSession=CMsvSession::OpenSyncL(*this);
CMsvEntry *entry = iSession->GetEntryL(KMsvLocalServiceIndexEntryId);
CleanupStack::PushL(entry);
CMsvEntrySelection *entries= entry->ChildrenWithTypeL(KUidMsvFolderEntry);
CleanupStack::PushL(entries);
TInt count = entries->Count();
for (TInt i = 0;i < count ;i++)
{
TMsvEntry entryId =entry->ChildDataL((*entries)[i]);
TMsvId id=entryId.Id();
entry->DeleteL(id);//getttng system err -21
// do something here... (e.g., entry.Id() gives you an ID of folder)
}
CleanupStack::PopAndDestroy(2); //
}
I wants to delete all the entries of myfolder present in Messaging Application.
---------------
Bhatt Kavita
Forum posts: 192
find your mailbox (entry.iDetails.Compare(KMyMailbox)), then get its children and delete'em
Forum posts: 192
Forum posts: 239
TMsvId id=entryId.Id();
I m getting Ids
But how will i Identify that this is for Myfolder or for mailbox
---------------
Bhatt Kavita
Forum posts: 192
{
  myId = entry.Id();
  break;
}
after cycle
{
CMsvEntry *myFolder = iMsvSession->GetEntryL(myId);
CleanupStack::PushL(myFolder);
CMsvEntrySelection *myEntries = myFolder->ChildrenL();
CleanupStack::PushL(myEntries);
CMsvOperationWait *theWaiter = CMsvOperationWait::NewLC(CActive::EPriorityHigh);
CMsvOperation *theOp = myFolder->DeleteL(*myEntries, theWaiter->iStatus);
CleanupStack::PushL(theOp);
theWaiter->Start();
CActiveScheduler::Start();
User::LeaveIfError(theWaiter->iStatus.Int());
CleanupStack::PopAndDestroy(4); // myFolder, myEntries, theWaiter, theOp
}
Forum posts: 239
if (!entry.iDetails.Compare(KMyMailbox)))
{
  myId = entry.Id();
  break;
}
here KMyMailbox may differ for different phones.
Say i have configured my mailbox as kavita
now i can compare it with KMyMailBox
but wht for other phones where i don;t know the details...
That i was asking how will i identify that this particular id refers to inbox.or outbox or myfolder or mailbox.
Hope u r getting me
Thanks
---------------
Bhatt Kavita
Forum posts: 404
http://symbiangeek.blogspot.com
Forum posts: 239
Thanks Mayur
but I am stucked with the problem
I m getting ids
and ids are 4098,4099,4100,4101,4104
and the hexadecimal values for
Inbox is 0x1001
SentFolder 0x1005
Outbox 0x1003
Draft 0x1004
even if I convert these hexadecimal into decimal i m not getting these ids
so how will i compare that this partiular id is for mailbox/myfolder
as for inbox draft and sentfolder i have successfully read the entries by simply passing KMsvDraftEntryId and likewise for inbox,sentfolder...
And as Core[RUS]suggested me to use KMyFolder literal ok this could be done if i know hte details in advance but programmatically how will i compare if i don;t know the mailbox name....
So CORE{RUS} and Mayur could you please ponder over my problem.
TIA
---------------
Bhatt Kavita