本文整理汇总了C++中CMsvEntry::HasStoreL方法的典型用法代码示例。如果您正苦于以下问题:C++ CMsvEntry::HasStoreL方法的具体用法?C++ CMsvEntry::HasStoreL怎么用?C++ CMsvEntry::HasStoreL使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CMsvEntry
的用法示例。
在下文中一共展示了CMsvEntry::HasStoreL方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: CheckNoAttachmentsL
void CheckNoAttachmentsL()
{
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);
test(selection->Count() == 1);
cEntry->SetEntryL((*selection)[0]);
if (cEntry->HasStoreL())
{
CMsvStore* store = cEntry->ReadStoreL();
CleanupStack::PushL(store);
MMsvAttachmentManager& attachmentMgr = store->AttachmentManagerL();
test(attachmentMgr.AttachmentCount() == 0);
CleanupStack::PopAndDestroy(store);
}
CleanupStack::PopAndDestroy(4, ob1); // selection, cEntry, session, ob1
}
示例2: GetAttachmentFileL
/*
-----------------------------------------------------------------------------
RFile GetAttachmentFileL(TMsvAttachmentId aId)
----------------------------------------------------------------------------
*/
void CMailBoxContainer::OpenFileL(TBool /*aOpenWith*/)
{
if(iSession && iSelectionBox)
{
TInt CurrItmIndex = iSelectionBox->CurrentItemIndex();
TMsvSelectionOrdering sort;
sort.SetShowInvisibleEntries(ETrue);
sort.SetSorting(EMsvSortByDate);
// Take a handle to the folder entry
CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession,iCurrentMailBox,sort);
CleanupStack::PushL(parentEntry);
// A selection of all BT entries
CMsvEntrySelection* entries = parentEntry->ChildrenL();//ChildrenWithMtmL(KUidMsgTypeBt);
CleanupStack::PushL(entries);
//Process all entries
if(CurrItmIndex >= 0 && CurrItmIndex < iIDArray->Count())
{
//Get entry
CMsvEntry* btEntry = iSession->GetEntryL(iIDArray->At(CurrItmIndex).iEnt);
CleanupStack::PushL(btEntry);
//Then get entrys child
CMsvEntrySelection* btChildren = btEntry->ChildrenL();
CleanupStack::PushL(btChildren);
btEntry->SetEntryL(iIDArray->At(CurrItmIndex).iMsg);
if (btEntry->HasStoreL())
{
CMsvStore* store = btEntry->ReadStoreL();
CleanupStack::PushL(store);
MMsvAttachmentManager& attMngr = store->AttachmentManagerL();
CMsvAttachment* attachment = attMngr.GetAttachmentInfoL(iIDArray->At(CurrItmIndex).iAtt);
if(attachment)
{
RFile SourceFil(attMngr.GetAttachmentFileL(iIDArray->At(CurrItmIndex).iAtt));
iUtils.GetFileUtils().OpenFileWithHandler(SourceFil);
SourceFil.Close();
}
CleanupStack::PopAndDestroy(store);
}
CleanupStack::PopAndDestroy(2);
}
CleanupStack::PopAndDestroy(2);
}
}
示例3: 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;
}
示例4: TestEntryStream
LOCAL_C void TestEntryStream(CMsvEntry& aEntry, TMsvId aId, TMsvId aService, TBool aAllDescendents)
{
// get the store
aEntry.SetEntryL(aId);
CMsvStore* store=NULL;
if(aEntry.HasStoreL()) store = aEntry.ReadStoreL();
test(store==NULL || store->IsPresentL(KUidMsvHiddenEntryStream)==EFalse);
delete store;
// recurse into the children
if (aAllDescendents)
{
CMsvEntrySelection* selection = aEntry.ChildrenL();
TInt count=selection->Count();
while (count--)
TestEntryStream(aEntry, selection->At(count), aService, EFalse);
delete selection;
}
}
示例5: 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;
}
示例6: ReadMailFolderL
/*
-----------------------------------------------------------------------------
----------------------------------------------------------------------------
*/
void CMailBoxContainer::ReadMailFolderL(TMsvId aSelected)
{
iCurrentMailBox = aSelected;
delete iIDArray;
iIDArray = NULL;
if(iSession && iSelectionBox)
{
TInt OrgCount = iSelectionBox->Model()->ItemTextArray()->MdcaCount();
STATIC_CAST(CDesCArray*,iSelectionBox->Model()->ItemTextArray())->Reset();
RPointerArray<CFFileTypeItem> ItemTypeArray = iUtils.GetFileUtils().GetItemTypeArray();
iIDArray = new(ELeave)CArrayFixFlat<TMyMailEntry>(10);
TMsvSelectionOrdering sort;
sort.SetShowInvisibleEntries(ETrue);
sort.SetSorting(EMsvSortByDate);
// Take a handle to the folder entry
CMsvEntry* parentEntry = CMsvEntry::NewL(*iSession,aSelected,sort);
CleanupStack::PushL(parentEntry);
// A selection of all BT entries
CMsvEntrySelection* entries = parentEntry->ChildrenL();//ChildrenWithMtmL(KUidMsgTypeBt);
CleanupStack::PushL(entries);
//Process all entries
for(TInt ii = 0; ii < entries->Count(); ii++)
{
//Get entry
CMsvEntry* btEntry = iSession->GetEntryL((*entries)[ii]);
CleanupStack::PushL(btEntry);
//Then get entrys child
CMsvEntrySelection* btChildren = btEntry->ChildrenL();
CleanupStack::PushL(btChildren);
TInt childc = btChildren->Count();
if (childc>0)
{
for(TInt i=0; i<childc; i++)
{
TMsvId btAtt = (*btChildren)[i];
btEntry->SetEntryL(btAtt);
if(btEntry->Entry().iMtm == KUidMsgTypePOP3)
{
CImEmailMessage* emailMessage = CImEmailMessage::NewL(*btEntry);
CleanupStack::PushL(emailMessage);
MMsvAttachmentManager& attMngr = emailMessage->AttachmentManager();
GetAttachmentsL(attMngr,*btEntry,(*entries)[ii],btAtt);
CleanupStack::PopAndDestroy(emailMessage);
}
else if (btEntry->HasStoreL())
{
CMsvStore* store = btEntry->ReadStoreL();
CleanupStack::PushL(store);
MMsvAttachmentManager& attMngr = store->AttachmentManagerL();
GetAttachmentsL(attMngr,*btEntry,(*entries)[ii],btAtt);
CleanupStack::PopAndDestroy(store);
}
}
}
CleanupStack::PopAndDestroy(2);
}
CleanupStack::PopAndDestroy(2);
CDesCArray* itemArray = STATIC_CAST( CDesCArray* ,iSelectionBox->Model()->ItemTextArray());
if(itemArray->Count() > OrgCount)
{
iSelectionBox->HandleItemAdditionL();
iSelectionBox->SetCurrentItemIndex(0);
}
else
{
iSelectionBox->HandleItemRemovalL();
if(itemArray->Count())
{
iSelectionBox->SetCurrentItemIndex(0);
}
}
UpdateScrollBar(iSelectionBox);
DrawNow();
}
示例7: PrepareStoreL
// ----------------------------------------------------------------------------
// CIpsPlgNewChildPartFromFileOperation::PrepareStoreL
// ----------------------------------------------------------------------------
//
void CIpsPlgNewChildPartFromFileOperation::PrepareStoreL()
{
CMsvEntry* cAtta = iMsvSession.GetEntryL( iNewAttachmentId );
CleanupStack::PushL( cAtta );
TBool parentToMultipartAlternative( EFalse );
if( cAtta->HasStoreL() )
{
CMsvStore* store = cAtta->EditStoreL();
CleanupStack::PushL( store );
CImMimeHeader* mimeHeader = CImMimeHeader::NewLC();
if( store->IsPresentL( KUidMsgFileMimeHeader ) )
{
mimeHeader->RestoreL( *store );
CDesC8Array& array = mimeHeader->ContentTypeParams();
array.AppendL( KMethod );
parentToMultipartAlternative = ETrue;
if( iContentType->Des().Find( KMimeTextCalRequest ) != KErrNotFound )
{
array.AppendL( KRequest );
}
else if( iContentType->Des().Find( KMimeTextCalResponse ) != KErrNotFound )
{
array.AppendL( KResponse );
}
else if( iContentType->Des().Find( KMimeTextCalCancel ) != KErrNotFound )
{
array.AppendL( KCancel );
}
else
{
parentToMultipartAlternative = EFalse;
}
mimeHeader->StoreWithoutCommitL( *store );
store->CommitL();
}
CleanupStack::PopAndDestroy( 2, store );
}
if( parentToMultipartAlternative &&
iFilePath->Find( KFileExtensionICS ) != KErrNotFound )
{
TMsvEntry tAttaEntry = cAtta->Entry();
TMsvId id = tAttaEntry.Parent();
CMsvEntry* cParent = iMsvSession.GetEntryL( id );
CleanupStack::PushL( cParent );
TMsvEmailEntry tEntry = cParent->Entry();
tEntry.SetMessageFolderType( EFolderTypeAlternative );
// Do async again if needed
iOperation = cParent->ChangeL( tEntry, iStatus );
CleanupStack::PopAndDestroy( cParent );
CleanupStack::PopAndDestroy( cAtta );
}
else
{
CleanupStack::PopAndDestroy( cAtta );
iStatus = KRequestPending;
TRequestStatus* status = &iStatus;
User::RequestComplete(status,KErrNone);
}
iStep = EStoreMessagePart; // Next step
SetActive();
}