void CSmtpClientMtm::RestoreEmailMessageL() { // Get a reference to TMsvEnhanceSearchSortUtil instance set by CMsvSearchsortOpOnHeaderBody class // If advanced search and sort is being performed than do not load the message header and body. // These are loaded when the search criteria is known in DoFindL() // For API's other than CMsvSearchsortOpOnHeaderBody-> FindInHeaderBodyL(), a call to LoadMessageL() // loads the body and the header. TMsvEnhanceSearchSortUtil* searchsortutil = (TMsvEnhanceSearchSortUtil*)(GetExtensionData()); if ( searchsortutil == NULL ) { CMsvStore* msvStore = iMsvEntry->ReadStoreL(); CleanupStack::PushL(msvStore); // message must have a CImHeader stream...if it's not there leave as there's something wrong iHeader->RestoreL(*msvStore); TPtrC subject = iHeader->Subject(); TPtrC to; if (iHeader->ToRecipients().Count()) to.Set(iHeader->ToRecipients()[0]); else if (iHeader->CcRecipients().Count()) to.Set(iHeader->CcRecipients()[0]); else if (iHeader->BccRecipients().Count()) to.Set(iHeader->BccRecipients()[0]); //else do nothing as there are no recipients! SetSubjectL(subject); SetAddresseeListL(); // Get the attachments and the body text... TMsvEntry messageEntry=iMsvEntry->Entry(); CleanupStack::PopAndDestroy(); // msvStore CImEmailMessage* emailMessage = CImEmailMessage::NewLC(*iMsvEntry); GetBodyTextL(*emailMessage, messageEntry.Id()); TInt32 totalSizeOfAllAttachments = GetAttachmentSizeL(*emailMessage, messageEntry.Id()); messageEntry.iSize = iHeader->DataSize() + Body().DocumentLength() + totalSizeOfAllAttachments; messageEntry.iDescription.Set(subject); messageEntry.iDetails.Set(to); // update the contents of the message entry iMsvEntry->ChangeL(messageEntry); CleanupStack::PopAndDestroy(); // emailMessage } }
void RTPPacket::Dump() { int i; printf("Payload type: %d\n",(int)GetPayloadType()); printf("Extended sequence number: 0x%08x\n",GetExtendedSequenceNumber()); printf("Timestamp: 0x%08x\n",GetTimestamp()); printf("SSRC: 0x%08x\n",GetSSRC()); printf("Marker: %s\n",HasMarker()?"yes":"no"); printf("CSRC count: %d\n",GetCSRCCount()); for (i = 0 ; i < GetCSRCCount() ; i++) printf(" CSRC[%02d]: 0x%08x\n",i,GetCSRC(i)); printf("Payload: %s\n",GetPayloadData()); printf("Payload length: %d\n",GetPayloadLength()); printf("Packet length: %d\n",GetPacketLength()); printf("Extension: %s\n",HasExtension()?"yes":"no"); if (HasExtension()) { printf(" Extension ID: 0x%04x\n",GetExtensionID()); printf(" Extension data: %s\n",GetExtensionData()); printf(" Extension length: %d\n",GetExtensionLength()); } }
TMsvPartList CSmtpClientMtm::DoFindL(const TDesC& aTextToFind, TMsvPartList aPartList) { CImClientMTMUtils* clientMTMUtils = CImClientMTMUtils::NewL(); CleanupStack::PushL(clientMTMUtils); TMsvPartList retList = KMsvMessagePartNone; // Get a reference to TMsvEnhanceSearchSortUtil instance set by CMsvSearchsortOpOnHeaderBody class TMsvEnhanceSearchSortUtil* searchsortutil = (TMsvEnhanceSearchSortUtil*)(GetExtensionData()); // searchsortuitl variable will not be NULL for Advanced Search and Sort called from CMsvSearchsortOpOnHeaderBody // For the old implementation, it will be NULL if(searchsortutil != NULL) { // Get the searchsort setting flags TUint32 searchsortsetting=searchsortutil->GetSearchSortSetting(); // The body was not loaded in LoadMessageL() // If 2 search query options are on the body or on the header, than it sets EMessagePartBodyLoaded flag // or EMessagePartHeaderLoaded of searchsortsetting if(aPartList & KMsvMessagePartBody && !(searchsortsetting & EMessagePartBodyLoaded)) { // Restore the body Body().Reset(); // Get the attachments and the body text... TMsvEntry messageEntry=iMsvEntry->Entry(); CImEmailMessage* emailMessage = CImEmailMessage::NewLC(*iMsvEntry); GetBodyTextL(*emailMessage, messageEntry.Id()); CleanupStack::PopAndDestroy(); // emailMessage searchsortutil->SetSearchSortSetting(EMessagePartBodyLoaded); } else if (!(searchsortsetting & EMessagePartHeaderLoaded)) { // Restore the header CMsvStore* msvStore = iMsvEntry->ReadStoreL(); CleanupStack::PushL(msvStore); // message must have a CImHeader stream...if it's not there leave as there's something wrong iHeader->RestoreL(*msvStore); TPtrC subject = iHeader->Subject(); TPtrC to; if (iHeader->ToRecipients().Count()) to.Set(iHeader->ToRecipients()[0]); else if (iHeader->CcRecipients().Count()) to.Set(iHeader->CcRecipients()[0]); else if (iHeader->BccRecipients().Count()) to.Set(iHeader->BccRecipients()[0]); //else do nothing as there are no recipients! SetSubjectL(subject); SetAddresseeListL(); // Get the attachments and the body text... TMsvEntry messageEntry=iMsvEntry->Entry(); CleanupStack::PopAndDestroy(); // msvStore searchsortutil->SetSearchSortSetting(EMessagePartHeaderLoaded); } // Issue a request to FindL clientMTMUtils->FindL(aTextToFind, Body(), *iHeader, aPartList, retList); /* Copy the sort data if sorting is specified. The operations being performed could be only be sort or it could be search and sort If the operation is search and sort than copy the sort data only if the search operation succeeded */ if ((searchsortsetting & EMessagePartSort ) || (((searchsortsetting & EMessagePartSearchSort) && (searchsortsetting & EMessagePartLastQueryOption) && (retList)))) { /* Copy the data to be sorted from the header stream. This done by setting iExtensionData to point to the field being copied */ if (iHeader) { if (searchsortsetting & EMessagePartToSort ) { SetExtensionData((TAny*)&iHeader->ToRecipients()); } else if(searchsortsetting & EMessagePartCcSort) { SetExtensionData((TAny*)&iHeader->CcRecipients()); } else if(searchsortsetting & EMessagePartBccSort) { SetExtensionData((TAny*)&iHeader->BccRecipients()); } else if(searchsortsetting & EMessagePartFromSort) { SetExtensionData((TAny*)(iHeader->From().Ptr())); } else if(searchsortsetting & EMessagePartSubjectSort) { SetExtensionData((TAny*)(iHeader->Subject().Ptr())); } } } } else { clientMTMUtils->FindL(aTextToFind, Body(), *iHeader, aPartList, retList); } CleanupStack::PopAndDestroy(clientMTMUtils); return retList; }
COLORREF CDirstatDoc::GetCushionColor(LPCTSTR ext) { SExtensionRecord r; VERIFY(GetExtensionData()->Lookup(ext, r)); return r.color; }