本文整理汇总了C++中CMsvEntry::Entry方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntry::Entry方法的具体用法?C++ CMsvEntry::Entry怎么用?C++ CMsvEntry::Entry使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvEntry
的用法示例。
在下文中一共展示了CMsvEntry::Entry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: doTestStepL
/**
doTestStepL()
Performs the comparison of POP messages
@return
Returns the teststep result.
*/
TVerdict CT_MsgComparePopEmailMsgs::doTestStepL()
{
INFO_PRINTF1(_L("Test Step: Compare Pop Email Msgs"));
if(LoadParametersL())
{
User::LeaveIfError(iFs.Connect());
CleanupClosePushL(iFs);
// Normally do not push an object that is a data member of another object.
// But in this case we want to close early if we get a leave.
// Otherwise the iFs would be open till the thread had begun to die.
if(TestStepResult() == EPass)
{
CMsvEntry* recvMsvEntry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId);
CleanupStack::PushL(recvMsvEntry);
CMsvEntry* sentMsvEntry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId);
CleanupStack::PushL(sentMsvEntry);
for(TInt i = 0;i < iInboxSelectionList->Count();i++)
{
recvMsvEntry->SetEntryL(iInboxSelectionList->At(i));
TMsvEntry recvEntry = recvMsvEntry->Entry();
for(TInt j = 0;j < iSentSelectionList->Count();j++)
{
sentMsvEntry->SetEntryL(iSentSelectionList->At(j));
TMsvEntry sentEntry = sentMsvEntry->Entry();
if(recvEntry.iDescription.Compare(sentEntry.iDescription) == 0)
{
CExpPop3MailInfo* pExpMailInfo = NULL;
for(int k = 0;k < iExpResults.Count();k++)
{
if(iExpResults[k]->GetDescription().Compare(recvEntry.iDescription) == 0)
{
pExpMailInfo = iExpResults[k];
break;
}
}
if(! pExpMailInfo)
{
ERR_PRINTF2(_L("Test %d failed could not retrieve expected mail info"), j+1);
SetTestStepResult(EFail);
break;
}
if(! DoCompareL(recvEntry, *pExpMailInfo, sentEntry))
{
INFO_PRINTF2(_L("Test %d failed"), j + 1);
SetTestStepResult(EFail);
}
}
}
}
CleanupStack::PopAndDestroy(2, recvMsvEntry); // recvMsvEntry, sentMsvEntry
}
CleanupStack::PopAndDestroy();
}
INFO_PRINTF1(_L("T_ComparePopEmailMsgs Completed"));
return TestStepResult();
}
示例2: GetMessagePartIndexL
/**
GetMessagePartIndexL()
Retrieves the part index id for the email identified by aEntry
@param aEntry
A valid email identifier
@param aUid
An identifier tfor the type of message part to be retrieved
@return
TMsvId - message part identifier
*/
TMsvId CT_MsgComparePopEmailMsgs::GetMessagePartIndexL(TMsvEntry& aEntry, TUid aUid)
{
static TBool msgPartFound = EFalse;
TMsvId msgPartId = 0;
CMsvEntry* baseEntry = iSharedDataPOP.iSession->GetEntryL(aEntry.Id());
CleanupStack::PushL(baseEntry);
CMsvEntrySelection* selection = baseEntry->ChildrenL();
CleanupStack::PushL(selection);
TInt count = selection->Count();
TInt ind1;
CMsvEntry* entry = iSharedDataPOP.iSession->GetEntryL(KMsvRootIndexEntryId);
CleanupStack::PushL(entry);
for (ind1=0, msgPartFound=EFalse; ind1 < count; ind1++)
{
if(msgPartFound)
{
break;
}
TMsvId childId = selection->At(ind1);
entry->SetEntryL(childId);
if (entry->Entry().iType == aUid)
{
msgPartId = childId;
break;
}
else if (entry->Entry().iType == KUidMsvFolderEntry)
{
TMsvEntry ent = entry->Entry();
msgPartId = GetMessagePartIndexL(ent, aUid);
}
}
CleanupStack::PopAndDestroy(3, baseEntry); // entry,selection,baseEntry
return msgPartId;
}
示例3: AppendPDUDataL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CFakeSMSSender::AppendPDUDataL(TMsvId aEntryId, const TDesC& aRecipient,TBool aUnicodeMsg,const TDesC& aBody)
{
CMsvEntry* entry = iMsvSession->GetEntryL(aEntryId);
CleanupStack::PushL(entry);
CMsvStore* srore= entry->EditStoreL();
CleanupStack::PushL(srore);
if(srore)
{
CSmsBuffer* smsBuffer = CSmsBuffer::NewL();
CSmsMessage* smsMsg = CSmsMessage::NewL(iFsSession,CSmsPDU::ESmsDeliver, smsBuffer);
CleanupStack::PushL(smsMsg);
smsMsg->SetTime(entry->Entry().iDate);
if(aRecipient.Length() > 20)
smsMsg->SetToFromAddressL(aRecipient.Left(20));
else
smsMsg->SetToFromAddressL(aRecipient);
smsBuffer->InsertL(0,aBody);
CSmsDeliver& DSMSPDU = STATIC_CAST(CSmsDeliver&,smsMsg->SmsPDU());
DSMSPDU.SetMoreMessagesToSend(EFalse);
DSMSPDU.SetReplyPath(EFalse);
DSMSPDU.SetStatusReportIndication(EFalse);
TInt Hours(0x20);
DSMSPDU.SetServiceCenterTimeStamp(entry->Entry().iDate,Hours);
DSMSPDU.SetTextCompressed(EFalse);
DSMSPDU.SetPIDType(TSmsProtocolIdentifier::ESmsPIDShortMessageType);
//DSMSPDU.SetTextCompressed(TBool aCompressed);
//DSMSPDU.SetAlphabet(TSmsDataCodingScheme::TSmsAlphabet aAlphabet);
CSmsHeader* MyHeader = CSmsHeader::NewL(smsMsg);
CleanupStack::Pop(1);//smsMsg
CleanupStack::PushL(MyHeader);
CSmsSettings* MySetting = CSmsSettings::NewL();
CleanupStack::PushL(MySetting);
if(aUnicodeMsg)
MySetting->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabetUCS2);
else
MySetting->SetCharacterSet(TSmsDataCodingScheme::ESmsAlphabet7Bit);
//MySetting->StoreL(*srore);//InternalizeL
MyHeader->SetSmsSettingsL(*MySetting);
MyHeader->StoreL(*srore);
srore->CommitL();
CleanupStack::PopAndDestroy(2);//MySetting,MyHeader,
}
CleanupStack::PopAndDestroy(2);//entry,srore
}
示例4: 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();
}
示例5: PrepareMsvEntryL
// ----------------------------------------------------------------------------
// CIpsPlgNewChildPartFromFileOperation::PrepareMsvEntryL
// ----------------------------------------------------------------------------
//
void CIpsPlgNewChildPartFromFileOperation::PrepareMsvEntryL()
{
// Dig out the entry ID of the new attachment
iMessage->GetAttachmentsListL( iEntry->Entry().Id( ),
CImEmailMessage::EAllAttachments, CImEmailMessage::EThisMessageOnly );
TKeyArrayFix key( 0, ECmpTInt32 );
CMsvEntrySelection* attachmentIds = iMessage->Selection().CopyLC();
attachmentIds->Sort( key );
if ( !attachmentIds->Count() )
{
User::Leave( KErrGeneral );
}
iNewAttachmentId = (*attachmentIds)[ attachmentIds->Count()-1 ];
CleanupStack::PopAndDestroy( attachmentIds );
CMsvEntry* cAtta = iMsvSession.GetEntryL( iNewAttachmentId );
CleanupStack::PushL( cAtta );
// Set filename to iDetails
TMsvEntry tEntry = cAtta->Entry();
tEntry.iDetails.Set(iFilePath->Des());
// Do async
iOperation = cAtta->ChangeL( tEntry, iStatus );
CleanupStack::PopAndDestroy( cAtta );
iStep = EPrepareStore; // Next step
SetActive();
}
示例6: HandleSessionEventL
void CScheduleTestActive::HandleSessionEventL(TMsvSessionEvent eventType, TAny* p1, TAny*, TAny*)
{
if (iStopAtRunL) return;
if (eventType != EMsvEntriesCreated) return;
CMsvEntrySelection* entries = STATIC_CAST(CMsvEntrySelection*, p1);
CMsvEntry* cEntry = iSession.GetEntryL((*entries)[0]);
CleanupStack::PushL(cEntry);
TMsvEntry entry(cEntry->Entry());
if(entry.iDetails == KSchSendTestDetails)
{
iTest.Printf(_L("Scheduled message has been sent\n"));
//We found the right message!
CActiveScheduler::Stop();
//Delete the new message
CMsvOperationWait* wait = CMsvOperationWait::NewLC();
wait->Start();
cEntry->SetEntryL(entry.Parent());
CMsvOperation* op = cEntry->DeleteL(entry.Id(), wait->iStatus);
CActiveScheduler::Start();
delete op;
CleanupStack::PopAndDestroy(wait);
}
CleanupStack::PopAndDestroy(cEntry);
}
示例7: ExecuteActionL
void CMtfTestActionDeleteEntry::ExecuteActionL()
{
TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionDeleteEntry);
CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession>(TestCase(),ActionParameters().Parameter(0));
TMsvId paramEntryId = ObtainValueParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
CMsvEntry* entry = CMsvEntry::NewL(*paramSession,paramEntryId,TMsvSelectionOrdering());
CleanupStack::PushL(entry);
entry->SetEntryL(paramEntryId);
entry->SetEntryL(entry->Entry().Parent());
if (entry->OwningService() == KMsvLocalServiceIndexEntryId)
{
entry->DeleteL(paramEntryId);
DeleteParameterL<TMsvId>(TestCase(),ActionParameters().Parameter(1));
TestCase().ActionCompletedL(*this);
}
else
{
iOperation = entry->DeleteL(paramEntryId,iStatus);
SetActive();
}
CleanupStack::PopAndDestroy(entry);
TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionDeleteEntry);
}
示例8: ExecuteActionL
void CMtfTestActionSetUserResponse::ExecuteActionL()
{
TestCase().INFO_PRINTF2(_L("Test Action %S start..."), &KTestActionSetUserResponse);
CMsvSession* paramSession = ObtainParameterReferenceL<CMsvSession> (TestCase(),ActionParameters().Parameter(0));
TInt paramUserResponse = ObtainValueParameterL<TInt>(TestCase(),ActionParameters().Parameter(1),EFalse);
CMsvEntry* cEntry = CMsvEntry::NewL(*paramSession, KMsvDraftEntryId,
TMsvSelectionOrdering(KMsvNoGrouping,EMsvSortByNone,ETrue));
CleanupStack::PushL(cEntry);
CMsvEntrySelection* selection = cEntry->ChildrenL();
CleanupStack::PushL(selection);
TestCase().INFO_PRINTF2(_L("Count of Draft Folder's selection is %d"),selection->Count());
if (selection->Count() == 0)
{
User::Leave(KErrNotFound);
}
cEntry->SetEntryL((*selection)[0]);
if (!paramUserResponse)
{
TMsvEntry entry = cEntry->Entry();
entry.iError = KErrCancel;
cEntry->ChangeL(entry);
}
CleanupStack::PopAndDestroy(2);
TestCase().INFO_PRINTF2(_L("Test Action %S completed."), &KTestActionSetUserResponse);
TestCase().ActionCompletedL(*this);
}
示例9: CountChildrenL
TInt CMtfTestActionCheckChildrenCountWithFlagBase::CountChildrenL(TMsvId aParent, CMsvSession& aSession)
{
TInt children = 0;
// Get children at this level
CMsvEntry* entryContext = CMsvEntry::NewL(aSession, aParent,
TMsvSelectionOrdering(KMsvNoGrouping, EMsvSortByNone, ETrue));
CleanupStack::PushL(entryContext);
entryContext->SetEntryL(aParent);
TMsvSelectionOrdering order;
order.SetShowInvisibleEntries(ETrue);
entryContext->SetSortTypeL(order);
CMsvEntrySelection* selection = entryContext->ChildrenL();
CleanupStack::PushL(selection);
// for each child
TInt count=selection->Count();
for(TInt child=0;child<count;child++)
{
entryContext->SetEntryL((*selection)[child]);
TMsvEntry entry=entryContext->Entry();
if (entry.iType==KUidMsvMessageEntry && FlagIsSet(entry) )
{
++children;
}
// if this is a folder then recurse
if (entry.iType==KUidMsvFolderEntry)
children +=CountChildrenL((*selection)[child], aSession);
}
CleanupStack::PopAndDestroy(2); // selection,entryContext
return children;
}
示例10: UpdateUserFolderL
// -----------------------------------------------------------------------------
// CMmsAdapterMsvApi::UpdateUserFolderL
// Updates user folder (changes name)
// -----------------------------------------------------------------------------
TInt CMmsAdapterMsvApi::UpdateUserFolderL( TMsvId aFolder, const TDesC& aName )
{
TRACE_FUNC_ENTRY;
LOGGER_WRITE_1( "aName: %S", &aName );
CMsvEntry* entry = iSession.GetEntryL( aFolder );
CleanupStack::PushL( entry );
TMsvEntry tEntry = entry->Entry();
if ( tEntry.iType != KUidMsvFolderEntry )
{
CleanupStack::PopAndDestroy( entry );
LOGGER_WRITE( "No message folder" );
TRACE_FUNC_EXIT;
return KErrNotSupported;
}
tEntry.iDetails.Set( aName );
tEntry.iDescription.Set( aName );
entry->ChangeL( tEntry );
CleanupStack::PopAndDestroy( entry );
TRACE_FUNC_EXIT;
return KErrNone;
}
示例11: MultipleRecipient
/**
Calls the MultipleRecipient() to check if it has been set to True
*/
TInt CMtfTestActionSendAsCheckMultipleRecipientFlag::CheckFlag(CMsvEntry& aMsgEntry)
{
TInt returnValue = KErrNotFound;
TBool check = aMsgEntry.Entry().MultipleRecipients();
if (check)
{
return KErrNone;
}
return returnValue ;
}
示例12: SetMtmEntryL
/*
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
*/
void CSMSSender::SetMtmEntryL(TMsvId aEntryId)
{
// Get the server entry from our session
CMsvEntry* entry = iSession->GetEntryL(aEntryId);
CleanupStack::PushL(entry);
// Check if our mtm is different from the mtm set to our entry
if ((iMtm == NULL) || (entry->Entry().iMtm != (iMtm->Entry()).Entry().iMtm))
{
// If so, we delete the old...
delete iMtm;
iMtm = NULL;
// ...and get a new one from the MtmRegistry
iMtm = iMtmRegistry->NewMtmL(entry->Entry().iMtm);
}
iMtm->SetCurrentEntryL(entry);
CleanupStack::Pop(entry);
}
示例13: RunL
void MsgStoreHandler::RunL()
{
TSsmState ssmState = iStateAwareSession.State();
if (ssmState.MainState() != ESsmNormal)
{
iStateAwareSession.RequestStateNotification(iStatus);
SetActive();
}
else
{
//Create the query/operation object
CMsvSearchSortOperation *operation = CMsvSearchSortOperation::NewL(*iMsvSession);
CleanupStack::PushL(operation);
CMsvSearchSortQuery *query = CMsvSearchSortQuery::NewL();
CleanupStack::PushL(query);
//set the query options
query->SetParentId(KMsvGlobalInBoxIndexEntryId);
query->SetResultType(EMsvResultAsTMsvId);
query->AddSearchOptionL(EMsvMtmTypeUID, KSenduiMtmSmsUidValue, EMsvEqual);
query->AddSearchOptionL(EMsvUnreadMessages, ETrue);
CleanupStack::Pop(query);
CMsvOperationActiveSchedulerWait* wait = CMsvOperationActiveSchedulerWait::NewLC();
//ownership of Query transferred to Operation
operation->RequestL(query, EFalse, wait->iStatus);
wait->Start();
//Get No of entries
RArray<TMsvId> messageArray;
operation->GetResultsL(messageArray);
CMsvEntry* entry = NULL;
for (TInt i = 0; i < messageArray.Count(); ++i)
{
entry = iMsvSession->GetEntryL(messageArray[i]);
TMsvSmsEntry smsEntry = entry->Entry();
TSmsDataCodingScheme::TSmsClass classType(TSmsDataCodingScheme::ESmsClass0);
if (smsEntry.Class(classType))
{
HandleClass0SmsL(entry, smsEntry.Id());
}
else
{
delete entry;
entry = NULL;
}
}
messageArray.Close();
CleanupStack::PopAndDestroy(2, operation);
}
}
示例14: TestSetSendingStateAttributeL
LOCAL_C void TestSetSendingStateAttributeL()
{
CDummyObserver* ob = new(ELeave)CDummyObserver;
CleanupStack::PushL(ob);
CMsvSession* session = CMsvSession::OpenSyncL(*ob);
CleanupStack::PushL(session);
CMsvEntry* cEntry = CMsvEntry::NewL(*session, KMsvDraftEntryId, TMsvSelectionOrdering());
CleanupStack::PushL(cEntry);
CMsvEntrySelection* selection = new(ELeave)CMsvEntrySelection;
CleanupStack::PushL(selection);
TMsvEntry entry1;
entry1.iType = KUidMsvMessageEntry;
entry1.iMtm = KUidMsvLocalServiceMtm;
entry1.iServiceId = KMsvLocalServiceIndexEntryId;
entry1.SetSendingState(12);
cEntry->CreateL(entry1);
selection->AppendL(entry1.Id());
TMsvEntry entry2;
entry2.iType = KUidMsvMessageEntry;
entry2.iMtm = KUidMsvLocalServiceMtm;
entry2.iServiceId = KMsvLocalServiceIndexEntryId;
entry2.SetSendingState(3);
cEntry->CreateL(entry2);
selection->AppendL(entry2.Id());
session->ChangeAttributesL(*selection, 6<<KMsvSendingStateShift, 0);
cEntry->SetEntryL(entry1.Id());
test(cEntry->Entry().SendingState() == 6);
cEntry->SetEntryL(entry2.Id());
test(cEntry->Entry().SendingState() == 6);
CleanupStack::PopAndDestroy(4); // selection, cEntry, session, ob
}
示例15: DeleteServiceL
/**
Delete Existing Service
@param aSession Current Session reference
@internalTechnology
*/
void CentralRepoUtils::DeleteServiceL(CMsvSession* aSession)
{
TMsvId serviceId;
TRAPD(err,TSmsUtilities::ServiceIdL(*aSession,serviceId));
if(err !=KErrNotFound)
{
CMsvEntry* entry = CMsvEntry::NewL(*aSession,serviceId,TMsvSelectionOrdering());
CleanupStack::PushL(entry);
entry->SetEntryL(serviceId);
entry->SetEntryL(entry->Entry().Parent());
entry->DeleteL(serviceId);
CleanupStack::PopAndDestroy(entry);
}
}