本文整理汇总了C++中TMsvEntry类的典型用法代码示例。如果您正苦于以下问题:C++ TMsvEntry类的具体用法?C++ TMsvEntry怎么用?C++ TMsvEntry使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TMsvEntry类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: BaseConstructL
// ----------------------------------------------------------------------------
// CIpsPlgPop3ConnectOp::ConstructL()
// ----------------------------------------------------------------------------
//
void CIpsPlgPop3ConnectOp::ConstructL()
{
FUNC_LOG;
BaseConstructL( KUidMsgTypePOP3 );
// <qmail> iSelection construction has been removed
CMsvEntry* cEntry = iMsvSession.GetEntryL( iService );
User::LeaveIfNull( cEntry );
// NOTE: Not using cleanupStack as it is not needed in this situation:
const TMsvEntry tentry = cEntry->Entry();
delete cEntry;
cEntry = NULL;
if ( tentry.iType.iUid != KUidMsvServiceEntryValue )
{
// should we panic with own codes?
User::Leave( KErrNotSupported );
}
// <qmail> no need to have population limit as member variable
// <qmail> it is read from settings when needed
if ( tentry.Connected() )
{
iState = EConnected;
// <qmail> iAlreadyConnected removed
}
else
{
iState = EStartConnect;
}
// <qmail> SetActive(); moved inside CompleteThis();
CompleteThis();
}
示例2: AddEmailFoldersL
/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CMailBoxContainer::AddEmailFoldersL(CMsvSession* aSession)
{
if(aSession)
{
CMsvEntry *localServiceEntry = aSession->GetEntryL(KMsvRootIndexEntryId);//KMsvLocalServiceIndexEntryId);
CleanupStack::PushL(localServiceEntry);
CMsvEntrySelection *folders = localServiceEntry->ChildrenL();
CleanupStack::PushL(folders);
if(folders->Count() > 1) // first is local folder
{
for (TInt i = 1;i < folders->Count();i++)
{
TMsvEntry ExtraFolder = localServiceEntry->ChildDataL((*folders)[i]);
CMailFldItem* NewIttem = new(ELeave)CMailFldItem();
CleanupStack::PushL(NewIttem);
NewIttem->iTitle = ExtraFolder.iDetails.AllocL();
NewIttem->iMscId = ExtraFolder.Id();
CleanupStack::Pop();//NewIttem
iFolderArray.Append(NewIttem);
}
}
CleanupStack::PopAndDestroy(2); // localServiceEntry, folders
}
}
示例3: CompleteMessage
TInt CIacSettingsParser::CompleteMessage()
{
TMsvEntry entry = iEntry.Entry();
entry.SetMtmData3(KBIO_MSG_ENTRY_PROCESSED);
TRAPD(error, iEntry.ChangeL(entry));
return error;
}
示例4: new
// methods from CSendAsEditUtils
void CSendAsTestEditUtils::LaunchEditorL(TMsvId /*aId*/, TRequestStatus& aStatus)
{
CDummyObserver* ob1 = new(ELeave) CDummyObserver;
CleanupStack::PushL(ob1);
CMsvSession* session = CMsvSession::OpenSyncL(*ob1);
CleanupStack::PushL(session);
CMsvEntry* cEntry = CMsvEntry::NewL(*session, KMsvDraftEntryId,
TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
CleanupStack::PushL(cEntry);
CMsvEntrySelection* selection = cEntry->ChildrenL();
CleanupStack::PushL(selection);
CMsvEntry* cEntry2 = session->GetEntryL(selection->At(0));
CleanupStack::PushL(cEntry2);
TMsvEntry entry = cEntry2->Entry();
entry.SetMtmData3(234567890); // Show we've been called by touching the TMsvEntry.
cEntry2->ChangeL(entry);
CleanupStack::PopAndDestroy(5, ob1); // cEntry2, selection, cEntry, session, ob1
iUserStatus = &aStatus;
aStatus = KRequestPending;
// wait a few seconds before completing
iEditTimer->After(KSendAsTestEditWaitTime);
}
示例5: InitL
LOCAL_C void InitL()
{
// Connect to the file system...
gFs.Connect();
// Connect to the Message Server...
pObserver = new (ELeave) CObserver();
CleanupStack::PushL(pObserver);
pSession = CMsvSession::OpenSyncL(*pObserver);
CleanupStack::PushL(pSession);
// Create a test entry with some dummy values so the Message Server
// will not panic when the entry is created in the message store...
pContext = CMsvEntry::NewL(*pSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
CleanupStack::PushL(pContext);
TMsvEntry testEntry;
TUid entryMtm;
entryMtm.iUid = 11;
testEntry.iMtm = entryMtm;
testEntry.iServiceId = pContext->OwningService();
testEntry.iType = KUidMsvMessageEntry;
// Create the entry in the message store and set the current context to it...
pContext->CreateL(testEntry);
gTestEntryId = testEntry.Id();
pContext->SetEntryL(gTestEntryId);
}
示例6: CreateEntry
/**
Creates a new entry as a child of the current context.
Ownership of the created entry is given to the process with the specified SID.
The parent ID and entry ID are set by the Message Server.
@param aEntry
Index entry value for the new entry
@param aOwnerId
The SID of the process that will own the create entry.
@param aBulk
A boolean value to indicate whether this is part of a bulk operation. (ETrue = bulk)
@return
KErrNone - success; KErrNoMemory - a memory allocation failed;
KErrNotSupported - aEntry is invalid
*/
EXPORT_C TInt CMsvServerEntry::CreateEntry(TMsvEntry& aEntry, TSecureId aOwnerId, TBool aBulk)
{
__ASSERT_DEBUG(iEntry.Id()!=KMsvNullIndexEntryId, PanicServer(EMsvEntryWithNoContext2));
aEntry.SetParent(iEntry.Id());
__ASSERT_DEBUG(MsvUtils::ValidEntry(aEntry, ETrue), PanicServer(EMsvBadEntryContents));
// if valid - try to create the new child
TInt error;
if (iEntry.Id()==KMsvNullIndexEntryId || !MsvUtils::ValidEntry(aEntry, ETrue))
error = KErrNotSupported;
else
{
error = iServer.AddEntry(aEntry, aOwnerId, ETrue, aBulk);
// if the child was created,then notify everyone, otherwise reset the parent
if (error)
aEntry.SetParent(KMsvNullIndexEntryId);
else
{
if (!aBulk)
{
iServer.NotifyChanged(EMsvEntriesCreated, aEntry.Id(), aEntry.Parent());
}
iEntry.SetOwner(ETrue);
}
}
return error;
}
示例7: INFO_PRINTF1
void CT_CMsvSession::TestIncPcSyncCountL()
{
TInt error = KErrGeneral;
INFO_PRINTF1(_L("Testing: Increment PC Sync Count -- started"));
TRAP(error, iSession = CMsvSession::OpenSyncL(*this));
TEST(error == KErrNone);
CMsvOperationWait* active = CMsvOperationWait::NewLC();
CMsvEntry* cEntry = CMsvEntry::NewL(*iSession, KMsvGlobalInBoxIndexEntryId, TMsvSelectionOrdering());
CleanupStack::PushL(cEntry);
CMsvEntrySelection* selection = new(ELeave)CMsvEntrySelection;
CleanupStack::PushL(selection);
TInt ret = iSession->InstallMtmGroup(KDataComponentFilename);
TEST(ret==KErrNone|| ret==KErrAlreadyExists);
cEntry->SetEntryL(KMsvRootIndexEntryId);
TMsvEntry service;
service.iType=KUidMsvServiceEntry;
service.iMtm = KUidTestServerMtmType;
cEntry->CreateL(service);
selection->AppendL(service.Id());
TBuf8<256> progress;
TBuf8<32> param;
TRAP(error, iSession->IncPcSyncCountL(*selection);)
示例8: found
// -----------------------------------------------------------------------------
// CMmsAdapterMsvApi::FindUserFolderL
// -----------------------------------------------------------------------------
//
TBool CMmsAdapterMsvApi::FindUserFolderL( const TDesC& aName, TMsvId& aFolder )
{
CMsvEntry* entry = iSession.GetEntryL( KMsvMyFoldersEntryIdValue );
CleanupStack::PushL( entry );
CMsvEntrySelection* selection = entry->ChildrenL();
CleanupStack::PushL( selection );
TBool found( EFalse );
TMsvId serviceId;
TMsvEntry entryT;
for ( TInt i = 0; i < selection->Count(); i++ )
{
User::LeaveIfError( iSession.GetEntry( selection->At( i ), serviceId, entryT ) );
if ( !entryT.Deleted() && entryT.iType == KUidMsvFolderEntry &&
aName.Compare(entryT.iDescription) == 0 )
{
found = ETrue;
aFolder = entryT.Id();
break;
}
}
CleanupStack::PopAndDestroy( selection );
CleanupStack::PopAndDestroy( entry );
return found;
}
示例9: TRAPD
/**
Creates a New Service
If a Service Exists it doesnot create a new one
@param aSession Current Session reference
@param aDescription Entry Description Descriptor
@param aDetail Entry Details Descriptor
@internalTechnology
*/
void CentralRepoUtils::CreateServiceL(CMsvSession* aSession, const TDesC& aDescription, const TDesC& aDetail)
{
TMsvId serviceId=0;
TRAPD(err,TSmsUtilities::ServiceIdL(*aSession,serviceId));
if(err == KErrNotFound) // If Service Already Exists Do not create new One
{
TInt priority = EMsvMediumPriority;
TInt readOnlyFlag = EFalse;
TInt visibleFlag = ETrue;
TMsvEntry indexEntry;
indexEntry.iType = KUidMsvServiceEntry;
indexEntry.iMtm = KUidMsgTypeSMS;
indexEntry.SetReadOnly(readOnlyFlag);
indexEntry.SetVisible(visibleFlag);
indexEntry.SetPriority(TMsvPriority(priority));
indexEntry.iDescription.Set(aDescription);
indexEntry.iDetails.Set(aDetail);
indexEntry.iDate.HomeTime();
CMsvEntry* entry = CMsvEntry::NewL(*aSession,KMsvRootIndexEntryId,TMsvSelectionOrdering());
CleanupStack::PushL(entry);
entry->CreateL(indexEntry);
CleanupStack::PopAndDestroy(entry);
}
}
示例10: new
void CPigeonServerMtm::ConstructL()
{
iScheduleSend = CPigeonScheduledSend::NewL(*iServerEntry);
// Get the entry id for the pigeon service entry.
User::LeaveIfError(iServerEntry->SetEntry(KMsvRootIndexEntryId));
CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
CleanupStack::PushL(sel);
User::LeaveIfError(iServerEntry->GetChildrenWithMtm(KUidMsgTypePigeon, *sel));
TInt count = sel->Count();
if( count > 1 ) // should only be one service entry
User::Leave(KErrCorrupt);
if( count == 0 )
{
// Create the settings
TMsvEntry serviceEntry;
serviceEntry.iType= KUidMsvServiceEntry;
serviceEntry.iMtm = KUidMsgTypePigeon;
User::LeaveIfError(iServerEntry->CreateEntry(serviceEntry));
iServiceId = serviceEntry.Id();
}
else
{
iServiceId = sel->At(0);
}
CleanupStack::PopAndDestroy(sel);
User::LeaveIfError(iServerEntry->SetEntry(KMsvNullIndexEntryId));
iHeapFailure = EFalse;
}
示例11: new
void CBulkCommitServerMtm::ConstructL()
{
// Get the entry id for the bulkcommit service entry.
User::LeaveIfError(iServerEntry->SetEntry(KMsvRootIndexEntryId));
CMsvEntrySelection* sel = new (ELeave) CMsvEntrySelection();
CleanupStack::PushL(sel);
User::LeaveIfError(iServerEntry->GetChildrenWithMtm(KUidBulkCommitTestMtm, *sel));
TInt count = sel->Count();
if( count > 1 ) // should only be one service entry
{
User::Leave(KErrCorrupt);
}
if( count == 0 )
{
// Create the settings
TMsvEntry serviceEntry;
serviceEntry.iType= KUidMsvServiceEntry;
serviceEntry.iMtm = KUidBulkCommitTestMtm;
User::LeaveIfError(iServerEntry->CreateEntry(serviceEntry));
iServiceId = serviceEntry.Id();
}
else
{
iServiceId = sel->At(0);
}
CleanupStack::PopAndDestroy(sel);
}
示例12: new
void CPopsTestHarness::DoLocalCopyTestL()
// Test copying a message locally. ie create a message in the Drafts folder
// and copy it to a local sub folder
{
// Create the Message in the Drafts Folder
iTestUtils->CreateMessageL(KTestMsgPath, KMsvDraftEntryId, KMsvDraftEntryId);
CMsvServerEntry* serverEntry = iTestUtils->iServerEntry;
serverEntry->SetEntry(KMsvDraftEntryId);
CMsvEntrySelection* newMessageList = new (ELeave)CMsvEntrySelection();
CleanupStack::PushL(newMessageList);
serverEntry->GetChildren(*newMessageList);
TMsvId newMessageId = (*newMessageList)[0];
// Create a local folder under the Drafts folder
TMsvEntry parentEntry = serverEntry->Entry();
TMsvEntry newFolder;
newFolder.SetStandardFolder(ETrue);
newFolder.iDetails.Set(KSubFolder);
newFolder.iType.iUid=KUidMsvFolderEntryValue;
newFolder.iMtm=parentEntry.iMtm;
newFolder.iServiceId = parentEntry.iServiceId;
serverEntry->CreateEntry(newFolder);
// Fill the Disk Space and attempt to do the Copy
FillDiskL();
// Copy the message into the new LOCAL Sub-Folder
CTestActive* active = new(ELeave) CTestActive;
CleanupStack::PushL(active);
serverEntry->CopyEntryL(newMessageId, newFolder.Id(), active->iStatus);
active->StartL();
CActiveScheduler::Start();
CleanupStack::PopAndDestroy(2); // newMessageList, active
}
示例13: GetFoldersL
/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CMailBoxContainer::GetFoldersL(void)
{
iFolderArray.ResetAndDestroy();
if(iSession)
{
CMsvEntry *localServiceEntry = iSession->GetEntryL(KMsvLocalServiceIndexEntryId);
CleanupStack::PushL(localServiceEntry);
CMsvEntrySelection *folders = localServiceEntry->ChildrenWithTypeL(KUidMsvFolderEntry);
CleanupStack::PushL(folders);
for (TInt i = 0;i < folders->Count();i++)
{
TMsvEntry ExtraFolder = localServiceEntry->ChildDataL((*folders)[i]);
CMailFldItem* NewIttem = new(ELeave)CMailFldItem();
CleanupStack::PushL(NewIttem);
NewIttem->iTitle = ExtraFolder.iDetails.AllocL();
NewIttem->iMscId = ExtraFolder.Id();
CleanupStack::Pop();//NewIttem
iFolderArray.Append(NewIttem);
}
CleanupStack::PopAndDestroy(2); // localServiceEntry, folders
AddEmailFoldersL(iSession);
}
}
示例14: Cancel
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CSMSSender::CreateNewMessageL()
{
Cancel();
iMessageMade = iMessageSent = iMessageReceived = EFalse;
delete iMtm;
iMtm = NULL;
TMsvEntry newEntry; // This represents an entry in the Message Server index
newEntry.iMtm = KUidMsgTypeSMS; // message type is SMS
newEntry.iType = KUidMsvMessageEntry; // this defines the type of the entry: message
newEntry.iServiceId = KMsvLocalServiceIndexEntryId; // ID of local service (containing the standard folders)
newEntry.iDate.UniversalTime(); // set the date of the entry to home time
newEntry.SetInPreparation(ETrue); // a flag that this message is in preparation
newEntry.SetReadOnly(EFalse);
// - CMsvEntry accesses and acts upon a particular Message Server entry.
// - NewL() does not create a new entry, but simply a new object to access an existing entry.
// - It takes in as parameters the client's message server session,
// ID of the entry to access and initial sorting order of the children of the entry.
CMsvEntry* entry = CMsvEntry::NewL(*iSession, KMsvDraftEntryIdValue, TMsvSelectionOrdering());
CleanupStack::PushL(entry);
delete iOperation;
iOperation = NULL;
iOperation = entry->CreateL(newEntry, iStatus);
CleanupStack::PopAndDestroy(entry);
iPhase = EWaitingForCreate;
SetActive();
}
示例15: CreateNewMessageL
TMsvId CFakeSMSSender::CreateNewMessageL(TTime aMsgTime)
{
CMsvEntry* Draftentry = CMsvEntry::NewL(*iMsvSession, KMsvDraftEntryIdValue ,TMsvSelectionOrdering());
CleanupStack::PushL(Draftentry);
CMsvOperationWait* wait = CMsvOperationWait::NewLC();
wait->Start();
TMsvEntry newEntry; // This represents an entry in the Message Server index
newEntry.iMtm = KUidMsgTypeSMS; // message type is SMS
newEntry.iType = KUidMsvMessageEntry; //KUidMsvServiceEntry // this defines the type of the entry: message
newEntry.iServiceId = KMsvLocalServiceIndexEntryId; // // ID of local service (containing the standard folders)
newEntry.iDate = aMsgTime; // set the date of the entry to home time
newEntry.SetInPreparation(ETrue); // a flag that this message is in preparation
newEntry.SetReadOnly(EFalse);
CMsvOperation* oper = Draftentry->CreateL(newEntry,wait->iStatus);
CleanupStack::PushL(oper);
CActiveScheduler::Start();
while( wait->iStatus.Int() == KRequestPending )
{
CActiveScheduler::Start();
}
// ...and keep track of the progress of the create operation.
TMsvLocalOperationProgress progress = McliUtils::GetLocalProgressL(*oper);
User::LeaveIfError(progress.iError);
// Draftentry->MoveL(progress.iId,KMsvGlobalInBoxIndexEntryId);
CleanupStack::PopAndDestroy(3);//Draftentry,wait,oper
return progress.iId;
}