本文整理汇总了C++中CMsvEntry::MoveL方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntry::MoveL方法的具体用法?C++ CMsvEntry::MoveL怎么用?C++ CMsvEntry::MoveL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvEntry
的用法示例。
在下文中一共展示了CMsvEntry::MoveL方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: FinalizeMessageL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CFakeSMSSender::FinalizeMessageL(TMsvId aEntryId,const TDesC& aBody,const TDesC& aRecipientName,TTime aMsgTime)
{
CMsvEntry* entry = iMsvSession->GetEntryL(aEntryId);
CleanupStack::PushL(entry);
TMsvEntry newEntry(entry->Entry()); // This represents an entry in the Message Server index
newEntry.SetInPreparation(EFalse); // a flag that this message is in preparation
newEntry.iDetails.Set(aRecipientName);
newEntry.SetUnread(ETrue);
newEntry.iDate = aMsgTime;
newEntry.SetReadOnly(ETrue);
CMsvStore* srore = entry->EditStoreL();
CleanupStack::PushL(srore);
if(srore)
{
CParaFormatLayer* paraFormatLayer = CParaFormatLayer::NewL();
CleanupStack::PushL(paraFormatLayer);
CCharFormatLayer* charFormatLayer = CCharFormatLayer::NewL();
CleanupStack::PushL(charFormatLayer);
CRichText* messageBodyContent = CRichText::NewL(paraFormatLayer, charFormatLayer);
CleanupStack::PushL(messageBodyContent);
messageBodyContent->InsertL(0,aBody);
srore->StoreBodyTextL(*messageBodyContent);
srore->CommitL();
CleanupStack::PopAndDestroy(3); // messageBodyContent, charFormatLayer,paraFormatLayer
if(aBody.Length() > 50)
newEntry.iDescription.Set(aBody.Left(50));
else
newEntry.iDescription.Set(aBody);
}
CleanupStack::PopAndDestroy(srore);
entry->ChangeL(newEntry);
entry->MoveL(aEntryId,KMsvGlobalInBoxIndexEntryId);
CleanupStack::PopAndDestroy(entry);
}
示例2: ExecuteActionL
void CMtfTestActionMoveSelection::ExecuteActionL()
{
TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionMoveSelection);
CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
CMsvEntrySelection* paramSelection = ObtainParameterReferenceL<CMsvEntrySelection>(TestCase(),ActionParameters().Parameter(1));
TMsvId paramTargetId = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(2));
TInt count = paramSelection->Count();
if (count == 0)
User::Leave(KErrArgument);
TMsvId entryId = (*paramSelection)[0];
CMsvEntry* entry = CMsvEntry::NewL(*paramSession,entryId,TMsvSelectionOrdering());
CleanupStack::PushL(entry);
entry->SetEntryL(entryId);
entry->SetEntryL(entry->Entry().Parent());
iOperation = entry->MoveL(*paramSelection,paramTargetId,iStatus);
CleanupStack::PopAndDestroy(entry);
CActiveScheduler::Add(this);
SetActive();
TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionMoveSelection);
}
示例3: MoveMessageEntryL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
TBool CSMSSender::MoveMessageEntryL(TMsvId aTarget)
{
ASSERT(iMtm);
TMsvEntry msvEntry((iMtm->Entry()).Entry());
if (msvEntry.Parent() != aTarget)
{
TMsvSelectionOrdering sort;
sort.SetShowInvisibleEntries(ETrue); // we want to also handle the invisible entries
// Take a handle to the parent entry
CMsvEntry* parentEntry = CMsvEntry::NewL(iMtm->Session(), msvEntry.Parent(), sort);
CleanupStack::PushL(parentEntry);
// Move original from the parent to the new location
iOperation = parentEntry->MoveL(msvEntry.Id(), aTarget, iStatus);
CleanupStack::PopAndDestroy(parentEntry);
SetActive();
return ETrue;
}
return EFalse;
}
示例4: TestMoveMultipleEntry
void CTestPerformanceM::TestMoveMultipleEntry()
{
_LIT(KFunction, "TestMoveMultipleEntry");
INFO_PRINTF1(KFunction);
TSecureId owner = 0x999;
TUint32 start, stop;
TMsvEntry entry;
CMsvEntry* parent = NULL;
TMsvLocalOperationProgress progress = TMsvLocalOperationProgress();
CMsvEntrySelection* entries = new(ELeave) CMsvEntrySelection;
TReal64 diff = 0;
iServerSide = EFalse;
INFO_PRINTF1(_L("<b>CLIENT SIDE</b>"));
TInt frequency;
HAL::Get(HALData::EFastCounterFrequency, frequency);
INFO_PRINTF2(_L("<b>FastCounter frequency: %d</b>"), frequency);
parent = iTestUtils->iMsvSession->GetEntryL(KMsvDraftEntryId);
//[1]. Move entries from Drafts to Outbox, and back again, and so on.
for(TInt index = 0; index < 10; ++index)
{
TMsvEntry entry;
entry.SetId((TMsvId)20000+index);
entry.SetParent(KMsvDraftEntryId);
entry.iType = KUidMsvMessageEntry;
entry.iMtm = KUidMsvMessageEntry;
entry.iServiceId = KMsvLocalServiceIndexEntryId;
parent->CreateL(entry);
entries->AppendL(entry.iId);
}
parent->SetEntryNoCheckL(KMsvDraftEntryId); //bring to cache
start = User::FastCounter();
parent->MoveL(*entries, KMsvGlobalOutBoxIndexEntryId, progress); //iTestActive->iStatus);
stop = User::FastCounter();
diff = (TReal64)(stop-start)/frequency;
INFO_PRINTF3(_L("---Time taken to MOVE %d entries from Drafts which has 10 entries: <b>%f sec</b>"), 10, diff);
MY_ASSERT_EQUALS(entries->Count(), 10);
parent->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
for(TInt index = 0; index < 90; ++index)
{
TMsvEntry entry;
entry.SetId((TMsvId)21000+index);
entry.SetParent(KMsvGlobalOutBoxIndexEntryId);
entry.iType = KUidMsvMessageEntry;
entry.iMtm = KUidMsvMessageEntry;
entry.iServiceId = KMsvLocalServiceIndexEntryId;
parent->CreateL(entry);
entries->AppendL(entry.iId);
}
parent->SetEntryNoCheckL(KMsvGlobalOutBoxIndexEntryId); //bring to cache
start = User::FastCounter();
parent->MoveL(*entries, KMsvDraftEntryId, progress);
stop = User::FastCounter();
diff = (TReal64)(stop-start)/frequency;
INFO_PRINTF3(_L("---Time taken to MOVE %d entries from Outbox which has 100 entries: <b>%f sec</b>"), 100, diff);
MY_ASSERT_EQUALS(entries->Count(), 100);
parent->SetEntryL(KMsvDraftEntryId);
for(TInt index = 0; index < 400; ++index)
{
TMsvEntry entry;
entry.SetId((TMsvId)22000+index);
entry.SetParent(KMsvDraftEntryId);
entry.iType = KUidMsvMessageEntry;
entry.iMtm = KUidMsvMessageEntry;
entry.iServiceId = KMsvLocalServiceIndexEntryId;
parent->CreateL(entry);
entries->AppendL(entry.iId);
}
start = User::FastCounter();
parent->MoveL(*entries, KMsvGlobalOutBoxIndexEntryId, progress);
stop = User::FastCounter();
diff = (TReal64)(stop-start)/frequency;
INFO_PRINTF3(_L("---Time taken to MOVE %d entries from Drafts which has 500 entries: <b>%f sec</b>"), 500, diff);
MY_ASSERT_EQUALS(entries->Count(), 500);
parent->SetEntryL(KMsvGlobalOutBoxIndexEntryId);
for(TInt index = 0; index < 500; ++index)
{
TMsvEntry entry;
entry.SetId((TMsvId)22000+index);
entry.SetParent(KMsvGlobalOutBoxIndexEntryId);
entry.iType = KUidMsvMessageEntry;
entry.iMtm = KUidMsvMessageEntry;
entry.iServiceId = KMsvLocalServiceIndexEntryId;
parent->CreateL(entry);
entries->AppendL(entry.iId);
}
start = User::FastCounter();
parent->MoveL(*entries, KMsvDraftEntryId, progress);
stop = User::FastCounter();
diff = (TReal64)(stop-start)/frequency;
INFO_PRINTF3(_L("---Time taken to MOVE %d entries from Outbox which has 1000 entries: <b>%f sec</b>"), 1000, diff);
MY_ASSERT_EQUALS(entries->Count(), 1000);
//.........这里部分代码省略.........
示例5: TestMultipleNotifsL
//.........这里部分代码省略.........
delete operation;
operation=NULL;
// test
cEntry->SetEntryL(folder3.Id());
selection = cEntry->ChildrenL();
test(selection->Count()==count);
delete selection;
if (ob->iEvents>1)
test(ob->iSelection.Count()>TMsvPackedChangeNotification::KMsvPackedChangeLimit);
else if (count>TMsvPackedChangeNotification::KMsvPackedChangeLimit)
{
ob->Wait();
CActiveScheduler::Start();
}
// test
selection = cEntry->ChildrenL();
test(selection->Count()==count);
delete selection;
if (ob->iEvents>2)
test(ob->iSelection.Count()>2*TMsvPackedChangeNotification::KMsvPackedChangeLimit);
else if (count>2*TMsvPackedChangeNotification::KMsvPackedChangeLimit)
{
ob->Wait();
CActiveScheduler::Start();
}
test(ob->iSelection.Count()==count);
ob->Finish();
// move all entries to folder 1
selection = cEntry->ChildrenL();
test(selection->Count()==count);
ob->Start(MMsvSessionObserver::EMsvEntriesMoved, folder1.Id(), folder3.Id());
active->StartL();
operation = cEntry->MoveL(*selection, folder1.Id(), active->iStatus);
delete selection;
CActiveScheduler::Start(); // operation complete
test(operation->iStatus.Int()==KErrNone);
test(operation->Mtm()==KUidMsvLocalServiceMtm);
test(operation->Service()==KMsvLocalServiceIndexEntryId);
prog = McliUtils::GetLocalProgressL(*operation);
test(prog.iTotalNumberOfEntries==count);
test(prog.iNumberCompleted==count);
test(prog.iNumberFailed==0);
test(prog.iError==KErrNone);
delete operation;
operation=NULL;
cEntry->SetEntryL(folder1.Id());
selection = cEntry->ChildrenL();
test(selection->Count()==count);
delete selection;
if (ob->iEvents>1)
test(ob->iSelection.Count()>TMsvPackedChangeNotification::KMsvPackedChangeLimit);
else if (count>TMsvPackedChangeNotification::KMsvPackedChangeLimit)
{
test(ob->iEvents==1);
ob->Wait();
CActiveScheduler::Start();
test(ob->iEvents==2);
}
if (ob->iEvents>2)
test(ob->iSelection.Count()>2*TMsvPackedChangeNotification::KMsvPackedChangeLimit);
else if (count>2*TMsvPackedChangeNotification::KMsvPackedChangeLimit)
{
test(ob->iEvents==2);
ob->Wait();
CActiveScheduler::Start();
示例6: HandleMsgMovedL
// -----------------------------------------------------------------------------
// CMessageMonitorPlugin::HandleMsgMovedL
// -----------------------------------------------------------------------------
//
void CMessageMonitorPlugin::HandleMsgMovedL( const TMsvId aFolderId1,
const TMsvId aFolderId2,
const CMsvEntrySelection& aSelection )
{
WRITELOG("ENTER CMessageMonitorPlugin::HandleMsgMovedL");
TInt count( aSelection.Count() );
// cycle through every message in the CMsvEntrySelection
for ( TInt i=0; i < count; ++i )
{
TMsvId msgId = aSelection[i];
WRITELOG1("msgId: %d", msgId );
TMsvId service = 0;
TMsvEntry entry;
TInt err = iMsvSession->GetEntry( msgId, service, entry );
// if we have a message and it has been moved from the outbox to the sent
// items, and it is a valid message
if ( ( !err ) &&
( KUidMsvMessageEntry == entry.iType ) &&
( KMsvSentEntryId == aFolderId1 ) &&
( KMsvGlobalOutBoxIndexEntryId == aFolderId2 ) &&
( IsValidMessageTypeL( entry, *iMsvSession ) ) )
{
HBufC* uri = CreateUriL( entry.iMtm, msgId );
CleanupStack::PushL( uri );
CHarvesterData* hd = CHarvesterData::NewL( uri );
CleanupStack::Pop( uri );
hd->SetEventType( EHarvesterAdd );
hd->SetTakeSnapshot( EFalse );
hd->SetBinary( EFalse );
iMonitorPluginObserver->MonitorEvent( hd );
}
#ifdef __WINSCW__
else if (!err && KMsvDraftEntryId == aFolderId2 && KMsvGlobalOutBoxIndexEntryId == aFolderId1 )
{
if( entry.iMtm.iUid != KUidMsgTypeMultimedia.iUid )
{
CClientMtmRegistry* clientMtmReg;
clientMtmReg = CClientMtmRegistry::NewL(*iMsvSession);
CleanupStack::PushL(clientMtmReg);
CSmsClientMtm* smsMtm = static_cast<CSmsClientMtm*>(clientMtmReg->NewMtmL(KUidMsgTypeSMS));
CleanupStack::PushL(smsMtm);
smsMtm->SwitchCurrentEntryL( msgId );
TMsvSelectionOrdering selection;
selection.SetShowInvisibleEntries(ETrue);
CMsvEntry* parentEntry = CMsvEntry::NewL( smsMtm->Session(),
smsMtm->Entry().Entry().Parent(), selection );
CleanupStack::PushL(parentEntry);
// Move the message
TRAP_IGNORE( parentEntry->MoveL( msgId, KMsvSentEntryId ) );
CleanupStack::PopAndDestroy(3,clientMtmReg); // parentEntry
}
}
#endif
}
WRITELOG("END CMessageMonitorPlugin::HandleMsgMovedL");
}