本文整理汇总了C++中CMsvEntry::EntryId方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntry::EntryId方法的具体用法?C++ CMsvEntry::EntryId怎么用?C++ CMsvEntry::EntryId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvEntry
的用法示例。
在下文中一共展示了CMsvEntry::EntryId方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CountLinesOfBodyTextL
/**
CountLinesOfBodyTextL()
Counts the lines of body text in the email aEntry
@param aEntry
A reference to an object representing the email
@param aFooterExists
Reference to a boolean variable - set to ETrue if the footer string is found in the body text
@param aFooterSize
Expected KB left on server inserted into footer string if present
@return
Number of lines in the body text
*/
TInt CT_MsgComparePopEmailMsgs::CountLinesOfBodyTextL(CMsvEntry& aEntry, TBool& aFooterExists, TInt& aFooterSize)
{
TInt lines = 0;
aFooterExists=EFalse;
aFooterSize=0;
aEntry.SetEntryL(aEntry.EntryId());
if(aEntry.HasStoreL())
{
CMsvStore* msvStore1= aEntry.ReadStoreL();
CleanupStack::PushL(msvStore1);
CParaFormatLayer* paraFormatLayer1 = CParaFormatLayer::NewL();
CleanupStack::PushL(paraFormatLayer1);
CCharFormatLayer* charFormatLayer1 = CCharFormatLayer::NewL();
CleanupStack::PushL(charFormatLayer1);
CRichText* bodyText1=CRichText::NewL(paraFormatLayer1, charFormatLayer1, CEditableText::EFlatStorage, 256);
CleanupStack::PushL(bodyText1);
bodyText1->Reset();
if (msvStore1->HasBodyTextL())
{
msvStore1->RestoreBodyTextL(*bodyText1);
TUint16 val = CEditableText::ELineBreak;
TInt n = 0;
TInt pos = 0;
for(;;)
{
TPtrC bodyText = bodyText1->Read(pos);
n = bodyText.Find(&val, 1);
if(n < 0)
break;
lines++;
pos += n+1;
//This Check is needed to delete the extra line introduced by communigate Pro Server
TInt fpos = CheckIfServerMessageExists(bodyText);
if (fpos != KErrNotFound)
{
lines--;
}
}
TPtrC pBt = bodyText1->Read(0);
aFooterExists = CheckIfFooterMessageExistsL(pBt , aFooterSize);
}
CleanupStack::PopAndDestroy(4, msvStore1); //bodyText1,charFormatLayer1,paraFormatLayer1,msvStore1.
}
return lines;
}
示例2: CountLinesOfHtmlL
/**
CountLinesOfHtmlL()
Counts the number of lines of HTML
@param aEntry
A reference to an object representing the email
@return
Number of lines of HTML
*/
TInt CT_MsgComparePopEmailMsgs::CountLinesOfHtmlL(CMsvEntry& aEntry)
{
TInt lines = 0;
aEntry.SetEntryL(aEntry.EntryId());
CMsvStore* store = aEntry.ReadStoreL();
CleanupStack::PushL(store);
MMsvAttachmentManager& attManager = store->AttachmentManagerL();
RFile htmlFile = attManager.GetAttachmentFileL(0);
CleanupClosePushL(htmlFile);
_LIT8(KFindData, "\r\n");
TInt htmlSize = 0;
User::LeaveIfError(htmlFile.Size(htmlSize));
HBufC8* fBuf = HBufC8::NewLC(htmlSize);
TPtr8 p = fBuf->Des();
htmlFile.Read(p);
TInt pos = 0;
for(;;)
{
pos = p.Find(KFindData);
if(pos < 0)
{
break;
}
p = p.Mid(pos+2);
lines++;
}
CleanupStack::PopAndDestroy(fBuf);
CleanupStack::PopAndDestroy(); // htmlFile
CleanupStack::PopAndDestroy(store);
return lines;
}
示例3: CreateEntry
LOCAL_C void CreateEntry(TMsvEntry& aNewEntry, CMsvEntry& aClientEntry, TInt aError, CEntryObserver& aObserver)
{
CTestActive* active = new (ELeave) CTestActive;
CleanupStack::PushL(active);
active->StartL();
aObserver.Start();
CMsvOperation* opert = aClientEntry.CreateL(aNewEntry, active->iStatus);
CActiveScheduler::Start(); // operation complete
CActiveScheduler::Start(); // cEntry changed
test(opert->iStatus.Int()==KErrNone);
test(opert->Mtm()==KUidMsvLocalServiceMtm);
test(opert->Service()==KMsvLocalServiceIndexEntryId);
TMsvLocalOperationProgress details;
TPckgC<TMsvLocalOperationProgress> package(details);
package.Set(opert->ProgressL());
test(package().iType==TMsvLocalOperationProgress::ELocalNew);
test(package().iTotalNumberOfEntries==1);
test(package().iError==aError);
if (aError)
{
test(package().iNumberCompleted==0);
test(package().iNumberFailed==1);
}
else
{
test(package().iNumberCompleted==1);
test(package().iNumberFailed==0);
TTestMsvEntry* ptr = (TTestMsvEntry*)&aNewEntry;
ptr->SetId(package().iId);
ptr->SetParent(aClientEntry.EntryId());
if (aNewEntry.iType==KUidMsvServiceEntry)
aNewEntry.iServiceId = aNewEntry.Id();
}
test(package().iNumberRemaining==0);
delete opert;
opert=NULL;
CleanupStack::PopAndDestroy(); // active
}
示例4: RemoveDefaultEntryL
void CTestUTCSort::RemoveDefaultEntryL()
{
TMsvSelectionOrdering ordering;
//sort the gloabl inbox by date
CMsvEntry* inboxEntry = CMsvEntry::NewL(*iSession, KMsvDraftEntryIdValue,ordering);
CleanupStack::PushL(inboxEntry);
if(inboxEntry->Count()==1)
{
CMsvEntrySelection* mvEntrySelection;
mvEntrySelection=inboxEntry->ChildrenL();
CleanupStack::PushL(mvEntrySelection);
CMsvEntry* child;
child=iSession->GetEntryL((*mvEntrySelection)[0]);
iSession->RemoveEntry(child->EntryId());
delete child;
CleanupStack::PopAndDestroy(mvEntrySelection);
}
CleanupStack::PopAndDestroy(inboxEntry);
}
示例5: createMMS
//---------------------------------------------------------------
// TestUniDataModelPlugin::createMMS
//---------------------------------------------------------------
void TestUniDataModelMMSPlugin::createMMS(TMsvId pId, TBool subjectField)
{
TMsvEntry indexEntry;
indexEntry.iType = KUidMsvMessageEntry;
indexEntry.iMtm = KUidMsgTypeMultimedia;
indexEntry.iServiceId = iServiceId;
indexEntry.iDate.HomeTime();
// Convert TTime to QDateTime , this will be used for comparing the time of mesage
// when fetched from datamodel
TTime unixEpoch(KUnixEpoch);
TTimeIntervalSeconds seconds;
TTime timeStamp = indexEntry.iDate;
timeStamp.SecondsFrom(unixEpoch, seconds);
retTimeStamp.setTime_t(seconds.Int());
TMsvId parentId = pId;
CMsvEntry* entry = CMsvEntry::NewL(*iMSession,parentId,TMsvSelectionOrdering());
CleanupStack::PushL(entry);
entry->SetEntryL(parentId);
entry->CreateL(indexEntry);
entry->SetEntryL(indexEntry.Id());
iMmsClientMtm->SwitchCurrentEntryL(entry->EntryId());
CMsvStore* store = iMmsClientMtm->Entry().EditStoreL();
CleanupStack::PushL(store);
//MMS Message ID Saved
iMessageId = indexEntry.Id();
//Adding Subject
if(subjectField)
{
QString subject(TEST_MSG_SUBJECT);
HBufC* subj = XQConversions::qStringToS60Desc(subject);
iMmsClientMtm->SetSubjectL(*subj);
}
//Adding Sender
QString sender(TEST_MSG_FROM1);
HBufC* addr = XQConversions::qStringToS60Desc(sender);
if (addr)
{
CleanupStack::PushL(addr);
TBuf<32> name;
name.Copy(addr->Left(32));
indexEntry.iDetails.Set(name);
iMmsClientMtm->SetSenderL(*addr);
CleanupStack::PopAndDestroy(addr);
}
//Adding Recipient
QString recipient(TEST_MSG_RECIEPIENT1);
HBufC* addr2 = XQConversions::qStringToS60Desc(recipient);
if (addr2)
{
CleanupStack::PushL(addr2);
iMmsClientMtm->AddAddresseeL(EMsvRecipientTo,*addr2);
CleanupStack::PopAndDestroy(addr2);
}
//Adding cCRecipient
QString recipient2(TEST_MSG_RECIEPIENT2);
HBufC* addr3 = XQConversions::qStringToS60Desc(recipient2);
if (addr3)
{
CleanupStack::PushL(addr3);
iMmsClientMtm->AddAddresseeL(EMsvRecipientCc,*addr3);
CleanupStack::PopAndDestroy(addr3);
}
//Adding bCCRecipient
QString recipient3(TEST_MSG_RECIEPIENT3);
HBufC* addr4 = XQConversions::qStringToS60Desc(recipient3);
if (addr4)
{
CleanupStack::PushL(addr4);
iMmsClientMtm->AddAddresseeL(EMsvRecipientBcc,*addr4);
CleanupStack::PopAndDestroy(addr4);
}
//Create Text Attachment
TMsvAttachmentId attaId = 0;
TFileName attachmentFile( _L("story.txt") );
TBufC<12> story = _L( "Hello world!" );
iMmsClientMtm->CreateTextAttachmentL(*store, attaId, story, attachmentFile, ETrue );
qDebug() << "Text Attachment id" << attaId;
//Image Attachment added to the message entry
RFile attaFile;
// Set filename of attachment
TFileName name( KPictureFileName );
//.........这里部分代码省略.........
示例6: CountLinesOfBodyTextL
/**
CountLinesOfBodyTextL()
Counts the lines of body text in the email aEntry
@param aEntry
A reference to an object representing the email
@param aFooterExists
Reference to a boolean variable - set to ETrue if the footer string is found in the body text
@param aFooterSize
Expected KB left on server inserted into footer string if present
@return
Number of lines in the body text
*/
TInt CT_MsgComparePopEmailMsgs::CountLinesOfBodyTextL(CMsvEntry& aEntry, TBool& aFooterExists, TInt& aFooterSize)
{
TInt lines = 0;
TInt count =0;
aFooterExists=EFalse;
aFooterSize=0;
aEntry.SetEntryL(aEntry.EntryId());
if(aEntry.HasStoreL())
{
CMsvStore* msvStore1= aEntry.ReadStoreL();
CleanupStack::PushL(msvStore1);
CParaFormatLayer* paraFormatLayer1 = CParaFormatLayer::NewL();
CleanupStack::PushL(paraFormatLayer1);
CCharFormatLayer* charFormatLayer1 = CCharFormatLayer::NewL();
CleanupStack::PushL(charFormatLayer1);
CRichText* bodyText1=CRichText::NewL(paraFormatLayer1, charFormatLayer1, CEditableText::EFlatStorage, 256);
CleanupStack::PushL(bodyText1);
bodyText1->Reset();
if (msvStore1->HasBodyTextL())
{
msvStore1->RestoreBodyTextL(*bodyText1);
TUint16 val = CEditableText::ELineBreak;
TUint16 val1 = CEditableText::EParagraphDelimiter;
TUint16 val2 = KUnicodeValue;
TInt n = 0;
TInt pos = 0;
for(;;)
{
TPtrC bodyText = bodyText1->Read(pos);
n = bodyText.Find(&val, 1);
// if iStore8BitData flag is set, the line is terminated by "CEditableText::EParagraphDelimiter"
if(msvStore1->IsPresentL(KMsvPlainBodyText8))
{
if ( 0 == count )
{
TPtrC buffer = bodyText.Mid(0,n+2);
// eg for 8bit the body look as : This is a simple email message.\x2028\x2029\x2029
// eg for 16bit the body look as: This is a simple email message.\x2028\x2028\x2029
if((bodyText.Right(2).Compare(KParagraphDelimiter)==KErrNone) && \
buffer.Find(&val2,1) != 75)
{
lines++;
count++;
}
// Increment the line if EParagraphDelimiter or 0x0046 is found sequence as eg:1. \x2028\x2029
// 2. \x2028\x2029\x2028\x2029\x0046 3. \x2028\x2029\x2028\x2029\x2028\x2029
else if ( (buffer.Find(&val1,1)==0 && n==-1) || (buffer.Find(&val2,1)==1) \
|| (buffer.Find(&val1,1)>0) )
{
lines++;
}
}
}
if(n < 0)
break;
lines++;
pos += n+1;
//This Check is needed to delete the extra line introduced by communigate Pro Server
TInt fpos = CheckIfServerMessageExists(bodyText);
if (fpos != KErrNotFound)
{
lines--;
}
}
TPtrC pBt = bodyText1->Read(0);
aFooterExists = CheckIfFooterMessageExistsL(pBt , aFooterSize);
}
CleanupStack::PopAndDestroy(4, msvStore1); //bodyText1,charFormatLayer1,paraFormatLayer1,msvStore1.
}
return lines;
}