611 const TFSMailMsgId& aMailBox, |
621 const TFSMailMsgId& aMailBox, |
612 RPointerArray<CFSMailMessage> &messages, |
622 RPointerArray<CFSMailMessage> &messages, |
613 MFSMailRequestObserver& aOperationObserver, |
623 MFSMailRequestObserver& aOperationObserver, |
614 const TInt aRequestId) |
624 const TInt aRequestId) |
615 : iMailBox( aMailBox ), |
625 : iMailBox( aMailBox ), |
616 iOperationObserver( aOperationObserver ), |
|
617 iRequestId( aRequestId ), |
|
618 iType(EHeaders) |
626 iType(EHeaders) |
619 { |
627 { |
|
628 |
|
629 CDelayedOp::iOperationObserver = &aOperationObserver ; |
|
630 CDelayedOp::iRequestId = aRequestId ; |
|
631 |
620 for(TInt i=0; i < messages.Count(); i++) |
632 for(TInt i=0; i < messages.Count(); i++) |
621 { |
633 { |
622 iMessages.Append(messages[i]); |
634 iMessages.Append(messages[i]); |
623 } |
635 } |
624 } |
636 } |
628 */ |
640 */ |
629 /*private*/ CDelayedMessageStorerOp::CDelayedMessageStorerOp( |
641 /*private*/ CDelayedMessageStorerOp::CDelayedMessageStorerOp( |
630 RPointerArray<CFSMailMessagePart>& aMessageParts, |
642 RPointerArray<CFSMailMessagePart>& aMessageParts, |
631 MFSMailRequestObserver& aOperationObserver, |
643 MFSMailRequestObserver& aOperationObserver, |
632 const TInt aRequestId) |
644 const TInt aRequestId) |
633 :iOperationObserver( aOperationObserver ), |
645 :iType(EParts) |
634 iRequestId( aRequestId ), |
646 { |
635 iType(EParts) |
647 |
636 { |
648 CDelayedOp::iOperationObserver = &aOperationObserver ; |
|
649 CDelayedOp::iRequestId = aRequestId ; |
|
650 |
637 for(TInt i=0; i < aMessageParts.Count(); i++) |
651 for(TInt i=0; i < aMessageParts.Count(); i++) |
638 { |
652 { |
639 iMessageParts.Append(aMessageParts[i]); |
653 iMessageParts.Append(aMessageParts[i]); |
640 } |
654 } |
641 } |
655 } |
702 if( err == KErrNone ) |
716 if( err == KErrNone ) |
703 { |
717 { |
704 progress.iError = KErrNone; |
718 progress.iError = KErrNone; |
705 progress.iProgressStatus = TFSProgress::EFSStatus_RequestComplete; |
719 progress.iProgressStatus = TFSProgress::EFSStatus_RequestComplete; |
706 } |
720 } |
707 |
721 |
708 iOperationObserver.RequestResponseL( progress, iRequestId ); |
722 if(iOperationObserver) |
|
723 { |
|
724 iOperationObserver->RequestResponseL( progress, iRequestId ); |
|
725 } |
|
726 |
709 |
727 |
710 __LOG_EXIT; |
728 __LOG_EXIT; |
711 } |
729 } |
712 |
730 |
713 |
731 |
714 /** |
732 /** |
715 * |
733 * |
716 */ |
734 */ |
717 void CDelayedMessageStorerOp::StorePartL( |
735 void CDelayedMessageStorerOp::StorePartL(CFSMailMessagePart* aPart) |
718 CFSMailMessagePart* aPart) |
|
719 { |
736 { |
720 User::LeaveIfNull(aPart); |
737 User::LeaveIfNull(aPart); |
721 |
738 |
722 // Text buffer for html text content |
739 // Text buffer for html text content |
723 HBufC* data16 = aPart->GetLocalTextContentLC(); |
740 HBufC* data16 = aPart->GetLocalTextContentLC(); |
724 |
741 |
725 TPtrC8 ptr8(reinterpret_cast<const TUint8*>( data16->Ptr() ), |
742 // Convert from 16 to 8 bit data - |
726 data16->Size() ); |
743 HBufC8* dataBuffer = HBufC8::NewLC((data16->Length() * 2) + 1); |
727 |
744 TPtr8 ptr8(dataBuffer->Des()); |
|
745 CnvUtfConverter::ConvertFromUnicodeToUtf8(ptr8, *data16); |
|
746 |
728 //get msgstore part |
747 //get msgstore part |
729 CMailboxInfo& mailBox = GetPlugin().GetMailboxInfoL( aPart->GetMailBoxId().Id() ); |
748 CMailboxInfo& mailBox = GetPlugin().GetMailboxInfoL( |
730 |
749 aPart->GetMailBoxId().Id()); |
|
750 |
731 CMsgStoreMessage* msg = mailBox().FetchMessageL( |
751 CMsgStoreMessage* msg = mailBox().FetchMessageL( |
732 aPart->GetMessageId().Id(), KMsgStoreInvalidId ); |
752 aPart->GetMessageId().Id(), KMsgStoreInvalidId); |
733 CleanupStack::PushL( msg ); |
753 CleanupStack::PushL(msg); |
734 |
754 |
735 CMsgStoreMessagePart* part= msg->ChildPartL( aPart->GetPartId().Id(), ETrue ); |
755 CMsgStoreMessagePart* part = msg->ChildPartL(aPart->GetPartId().Id(), |
736 |
756 ETrue); |
737 CleanupStack::PopAndDestroy( msg ); |
757 |
738 CleanupStack::PushL( part ); |
758 CleanupStack::PopAndDestroy(msg); |
|
759 CleanupStack::PushL(part); |
739 |
760 |
740 //replace content |
761 //replace content |
741 part->ReplaceContentL(ptr8); |
762 part->ReplaceContentL(ptr8); |
742 |
763 |
743 CleanupStack::PopAndDestroy( part ); |
764 CleanupStack::PopAndDestroy(part); |
744 CleanupStack::PopAndDestroy( data16 ); |
765 CleanupStack::PopAndDestroy(dataBuffer); |
745 |
766 CleanupStack::PopAndDestroy(data16); |
|
767 |
746 } |
768 } |
747 |
769 |
748 |
770 |
749 /////////////////////////////////////////////////// |
771 /////////////////////////////////////////////////// |
750 // CDelayedMessageToSendOp // |
772 // CDelayedMessageToSendOp // |
792 CBasePlugin& aPlugin, |
814 CBasePlugin& aPlugin, |
793 const TFSMailMsgId& aMailBox, |
815 const TFSMailMsgId& aMailBox, |
794 MFSMailRequestObserver& aOperationObserver, |
816 MFSMailRequestObserver& aOperationObserver, |
795 const TInt aRequestId) |
817 const TInt aRequestId) |
796 : iBasePlugin(aPlugin), |
818 : iBasePlugin(aPlugin), |
797 iMailBox( aMailBox ), |
819 iMailBox( aMailBox ) |
798 iOperationObserver( aOperationObserver ), |
820 { |
799 iRequestId( aRequestId ) |
821 |
800 { |
822 CDelayedOp::iOperationObserver = &aOperationObserver ; |
|
823 CDelayedOp::iRequestId = aRequestId ; |
801 |
824 |
802 } |
825 } |
803 |
826 |
804 |
827 |
805 /** |
828 /** |
883 const TInt aRequestId) : |
909 const TInt aRequestId) : |
884 iMailBoxId( aMailBoxId ), |
910 iMailBoxId( aMailBoxId ), |
885 iParentFolderId( aParentFolderId ), |
911 iParentFolderId( aParentFolderId ), |
886 iMessageId( aMessageId ), |
912 iMessageId( aMessageId ), |
887 iParentPartId( aParentPartId ), |
913 iParentPartId( aParentPartId ), |
888 iOperationObserver( aOperationObserver ), |
|
889 iRequestId( aRequestId ), |
|
890 iActionType( AddNewChild) |
914 iActionType( AddNewChild) |
891 { |
915 { |
|
916 CDelayedOp::iOperationObserver = &aOperationObserver ; |
|
917 CDelayedOp::iRequestId = aRequestId ; |
892 } |
918 } |
893 |
919 |
894 /** |
920 /** |
895 * |
921 * |
896 */ |
922 */ |
905 iMailBoxId( aMailBoxId ), |
931 iMailBoxId( aMailBoxId ), |
906 iParentFolderId( aParentFolderId ), |
932 iParentFolderId( aParentFolderId ), |
907 iMessageId( aMessageId ), |
933 iMessageId( aMessageId ), |
908 iParentPartId( aParentPartId ), |
934 iParentPartId( aParentPartId ), |
909 iPartId( aPartId ), |
935 iPartId( aPartId ), |
910 iOperationObserver( aOperationObserver ), |
|
911 iRequestId( aRequestId ), |
|
912 iActionType( RemoveChild) |
936 iActionType( RemoveChild) |
913 { |
937 { |
|
938 CDelayedOp::iOperationObserver = &aOperationObserver ; |
|
939 CDelayedOp::iRequestId = aRequestId ; |
914 } |
940 } |
915 |
941 |
916 /** |
942 /** |
917 * |
943 * |
918 */ |
944 */ |