61 |
61 |
62 #include "FreestyleEmailUiMailViewerConstants.h" |
62 #include "FreestyleEmailUiMailViewerConstants.h" |
63 #include "FSDelayedLoader.h" |
63 #include "FSDelayedLoader.h" |
64 #include "FreestyleMessageHeaderURL.h" |
64 #include "FreestyleMessageHeaderURL.h" |
65 #include "FreestyleEmailUiAknStatusIndicator.h" |
65 #include "FreestyleEmailUiAknStatusIndicator.h" |
66 #include <akntoolbar.h> |
66 |
67 |
67 #include <eiksoftkeyimage.h> |
68 CFsEmailUiHtmlViewerView* CFsEmailUiHtmlViewerView::NewL( |
68 |
|
69 CFsEmailUiHtmlViewerView* CFsEmailUiHtmlViewerView::NewL( |
69 CAlfEnv& aEnv, |
70 CAlfEnv& aEnv, |
70 CFreestyleEmailUiAppUi& aAppUi, |
71 CFreestyleEmailUiAppUi& aAppUi, |
71 CAlfControlGroup& aControlGroup ) |
72 CAlfControlGroup& aControlGroup ) |
72 { |
73 { |
73 FUNC_LOG; |
74 FUNC_LOG; |
74 CFsEmailUiHtmlViewerView* self = new ( ELeave ) CFsEmailUiHtmlViewerView( aEnv, aAppUi, aControlGroup ); |
75 CFsEmailUiHtmlViewerView* self = new ( ELeave ) CFsEmailUiHtmlViewerView( aEnv, aAppUi, aControlGroup ); |
75 CleanupStack::PushL( self ); |
76 CleanupStack::PushL( self ); |
114 delete iOpenMessages; |
113 delete iOpenMessages; |
115 iOpenMessages = NULL; |
114 iOpenMessages = NULL; |
116 delete iEmbeddedMessages; |
115 delete iEmbeddedMessages; |
117 iEmbeddedMessages = NULL; |
116 iEmbeddedMessages = NULL; |
118 iMessage = NULL; |
117 iMessage = NULL; |
119 |
118 |
120 delete iMailBox; |
119 delete iMailBox; |
121 iMailBox = NULL; |
120 iMailBox = NULL; |
122 delete iAsyncCallback; |
121 delete iAsyncCallback; |
123 } |
122 } |
124 |
123 |
125 void CFsEmailUiHtmlViewerView::ConstructL() |
124 void CFsEmailUiHtmlViewerView::ConstructL() |
126 { |
125 { |
127 FUNC_LOG; |
126 FUNC_LOG; |
128 BaseConstructL( R_FSEMAILUI_HTML_VIEW ); |
127 BaseConstructL( R_FSEMAILUI_HTML_VIEW_FULLSCREEN ); |
129 iAsyncCallback = new (ELeave) CAsyncCallBack( CActive::EPriorityLow ); |
128 iAsyncCallback = new (ELeave) CAsyncCallBack( CActive::EPriorityLow ); |
130 iOpenMessages = new (ELeave) CStack<CFSMailMessage, ETrue>(); |
129 iOpenMessages = new (ELeave) CStack<CFSMailMessage, ETrue>(); |
131 iEmbeddedMessages = new (ELeave) CStack<CFSMailMessage, EFalse>(); |
130 iEmbeddedMessages = new (ELeave) CStack<CFSMailMessage, EFalse>(); |
132 iNextOrPrevMessageSelected = EFalse; |
131 iNextOrPrevMessageSelected = EFalse; |
133 iForwardingMessage = EFalse; |
132 iForwardingMessage = EFalse; |
134 iMessageIsDeleted = EFalse; |
133 iMessageIsDeleted = EFalse; |
135 } |
134 } |
136 |
135 |
137 // ----------------------------------------------------------------------------- |
136 // ----------------------------------------------------------------------------- |
513 pckgData.Copy( aCustomMessage ); |
512 pckgData.Copy( aCustomMessage ); |
514 iActivationData = pckgData(); |
513 iActivationData = pckgData(); |
515 } |
514 } |
516 |
515 |
517 CleanupClosePushL( iActivationData.iFile ); |
516 CleanupClosePushL( iActivationData.iFile ); |
518 |
517 |
519 if ( !iMessage && iContainer ) |
518 if ( !iMessage && iContainer ) |
520 { |
519 { |
521 iContainer->ResetContent(); |
520 iContainer->ResetContent(); |
522 iAppUi.RemoveFromStack( iContainer ); |
521 iAppUi.RemoveFromStack( iContainer ); |
523 iContainer->CancelFetch(); |
522 iContainer->CancelFetch(); |
524 iContainer->ClearCacheAndLoadEmptyContent(); |
523 iContainer->ClearCacheAndLoadEmptyContent(); |
525 } |
524 } |
526 |
525 |
527 if ( !iContainer ) |
526 if ( !iContainer ) |
528 { |
527 { |
529 iContainer = CFsEmailUiHtmlViewerContainer::NewL( iAppUi, *this ); |
528 iContainer = CFsEmailUiHtmlViewerContainer::NewL( iAppUi, *this ); |
530 } |
529 } |
531 |
530 |
532 // Check whether this activation is actually for a meeting request |
531 // Check whether this activation is actually for a meeting request |
533 TBool openedInMrViewer( EFalse ); |
532 TBool openedInMrViewer( EFalse ); |
534 if ( THtmlViewerActivationData::EMailMessage == iActivationData.iActivationDataType ) |
533 if ( THtmlViewerActivationData::EMailMessage == iActivationData.iActivationDataType ) |
535 { |
534 { |
536 openedInMrViewer = IsOpenedInMRViewerL(); |
535 openedInMrViewer = IsOpenedInMRViewerL(); |
537 } |
536 } |
538 |
537 |
539 if ( openedInMrViewer ) |
538 if ( openedInMrViewer ) |
540 { |
539 { |
541 // The previous contents are cleared (otherwise they are shown just |
540 // The previous contents are cleared (otherwise they are shown just |
542 // before the meeting request viewer kicks in, especially annoying |
541 // before the meeting request viewer kicks in, especially annoying |
543 // when navigating between prev/next meeting requests by using navi |
542 // when navigating between prev/next meeting requests by using navi |
544 // decorator array buttons. |
543 // decorator array buttons. |
545 iContainer->ClearCacheAndLoadEmptyContent(); |
544 iContainer->ClearCacheAndLoadEmptyContent(); |
546 ClearMailViewer(); |
545 ClearMailViewer(); |
547 } |
546 } |
548 |
547 |
549 ShowContainerL(); |
548 ShowContainerL(); |
550 |
549 |
551 switch ( iActivationData.iActivationDataType ) |
550 switch ( iActivationData.iActivationDataType ) |
552 { |
551 { |
553 case THtmlViewerActivationData::EMailMessage: |
552 case THtmlViewerActivationData::EMailMessage: |
554 { |
553 { |
555 |
554 |
556 if ( iMessage && iAppUi.DownloadInfoMediator() ) |
555 if ( iMessage && iAppUi.DownloadInfoMediator() ) |
557 { |
556 { |
558 iAppUi.DownloadInfoMediator()->StopObserving( this, iMessage->GetMessageId() ); |
557 iAppUi.DownloadInfoMediator()->StopObserving( this, iMessage->GetMessageId() ); |
559 } |
558 } |
560 |
559 |
561 //clean message stack which owns object iMessage |
560 //clean message stack which owns object iMessage |
562 EraseMessageStack(); |
561 EraseMessageStack(); |
563 iMessage = NULL; |
562 iMessage = NULL; |
564 iMessage = iAppUi.GetMailClient()->GetMessageByUidL( |
563 iMessage = iAppUi.GetMailClient()->GetMessageByUidL( |
565 iActivationData.iMailBoxId, |
564 iActivationData.iMailBoxId, |
566 iActivationData.iFolderId, |
565 iActivationData.iFolderId, |
567 iActivationData.iMessageId, |
566 iActivationData.iMessageId, |
568 EFSMsgDataEnvelope ); |
567 EFSMsgDataEnvelope ); |
569 |
|
570 UpdateToolbarL(); |
|
571 |
568 |
572 if ( iMessage && iAppUi.DownloadInfoMediator() ) |
569 if ( iMessage && iAppUi.DownloadInfoMediator() ) |
573 { |
570 { |
574 iAppUi.DownloadInfoMediator()->AddObserver( this, iMessage->GetMessageId() ); |
571 iAppUi.DownloadInfoMediator()->AddObserver( this, iMessage->GetMessageId() ); |
575 } |
572 } |
576 |
573 |
577 delete iAttachmentsListModel; |
574 delete iAttachmentsListModel; |
578 iAttachmentsListModel = NULL; |
575 iAttachmentsListModel = NULL; |
579 |
576 |
580 if ( iMessage ) |
577 if ( iMessage ) |
581 { |
578 { |
584 { |
581 { |
585 //take ownership of iMessage |
582 //take ownership of iMessage |
586 PushMessageL( iMessage, EFalse ); |
583 PushMessageL( iMessage, EFalse ); |
587 } |
584 } |
588 |
585 |
589 if ( openedInMrViewer ) |
586 if ( openedInMrViewer ) |
590 { |
587 { |
|
588 iContainer->DisplayStatusIndicatorL(); |
|
589 iAppUi.GetMailClient()->PrepareMrDescriptionL( iActivationData.iMailBoxId, |
|
590 iActivationData.iMessageId ); |
|
591 |
591 // Setting MSK empty. This blocks unwanted MSK keypresses before MrViewer is initialized. |
592 // Setting MSK empty. This blocks unwanted MSK keypresses before MrViewer is initialized. |
592 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
593 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
593 iMrUiActive = ETrue; |
594 iMrUiActive = ETrue; |
594 iAppUi.MrViewerInstanceL()->ExecuteViewL( *iMessage, *this ); |
595 iAppUi.MrViewerInstanceL()->ExecuteViewL( *iMessage, *this ); |
595 } |
596 } |
596 else |
597 else |
597 { |
598 { |
598 // Attachment list model is not created when opening mrViewer, so attachment options menu is |
599 // Attachment list model is not created when opening mrViewer, so attachment options menu is |
599 // not working with MR messages |
600 // not working with MR messages |
600 iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this ); |
601 iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this ); |
601 TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId ); |
602 TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId ); |
602 iAttachmentsListModel->UpdateListL( msgPartData ); |
603 iAttachmentsListModel->UpdateListL( msgPartData ); |
603 CheckMessageBodyL( *iMessage, msgBodyStructurePresent, msgBodyContentPresent ); |
604 CheckMessageBodyL( *iMessage, msgBodyStructurePresent, msgBodyContentPresent ); |
604 LoadContentFromMailMessageL( iMessage, ETrue ); |
605 LoadContentFromMailMessageL( iMessage, ETrue ); |
605 } |
606 } |
606 } |
607 } |
607 else |
608 else |
608 { |
609 { |
609 User::Leave( KErrNotFound ); |
610 User::Leave( KErrNotFound ); |
610 } |
611 } |
611 |
612 |
612 if ( aCustomMessageId != KStartViewerReturnToPreviousMsg && iMessage ) |
613 if ( aCustomMessageId != KStartViewerReturnToPreviousMsg && iMessage ) |
613 { |
614 { |
614 delete iMailBox; iMailBox = NULL; |
615 delete iMailBox; iMailBox = NULL; |
615 iMailBox = iAppUi.GetMailClient()->GetMailBoxByUidL( iMessage->GetMailBoxId() ); |
616 iMailBox = iAppUi.GetMailClient()->GetMailBoxByUidL( iMessage->GetMailBoxId() ); |
616 |
617 |
617 // Change active mailbox if necessary |
618 // Change active mailbox if necessary |
618 if ( !iMessage->GetMailBoxId().IsNullId() ) |
619 if ( !iMessage->GetMailBoxId().IsNullId() ) |
619 { |
620 { |
620 iAppUi.SetActiveMailboxL( iMessage->GetMailBoxId(), EFalse ); |
621 iAppUi.SetActiveMailboxL( iMessage->GetMailBoxId(), EFalse ); |
621 } |
622 } |
627 { |
628 { |
628 if ( aCustomMessageId != KStartViewerReturnFromEmbeddedMsg && !iCreateNewMsgFromEmbeddedMsg ) |
629 if ( aCustomMessageId != KStartViewerReturnFromEmbeddedMsg && !iCreateNewMsgFromEmbeddedMsg ) |
629 { |
630 { |
630 PushMessageL(iActivationData.iEmbeddedMessage, ETrue); |
631 PushMessageL(iActivationData.iEmbeddedMessage, ETrue); |
631 } |
632 } |
632 |
633 |
633 iMessage = iOpenMessages->Head(); |
634 iMessage = iOpenMessages->Head(); |
634 iCreateNewMsgFromEmbeddedMsg = EFalse; |
635 iCreateNewMsgFromEmbeddedMsg = EFalse; |
635 |
636 |
636 delete iAttachmentsListModel; |
637 delete iAttachmentsListModel; |
637 iAttachmentsListModel = NULL; |
638 iAttachmentsListModel = NULL; |
638 iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this ); |
639 iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this ); |
639 |
640 |
640 if ( iOpenMessages->Head()== iOpenMessages->Last() ) |
641 if ( iOpenMessages->Head()== iOpenMessages->Last() ) |
641 { |
642 { |
642 TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId); |
643 TPartData msgPartData( iActivationData.iMailBoxId, iActivationData.iFolderId, iActivationData.iMessageId); |
643 iAttachmentsListModel->UpdateListL( msgPartData ); |
644 iAttachmentsListModel->UpdateListL( msgPartData ); |
644 |
645 |
645 } |
646 } |
646 else{ |
647 else{ |
647 iAttachmentsListModel->UpdateListL( iOpenMessages->Head() ); |
648 iAttachmentsListModel->UpdateListL( iOpenMessages->Head() ); |
648 } |
649 } |
649 |
650 |
650 CheckMessageBodyL( *iOpenMessages->Head(), msgBodyStructurePresent, msgBodyContentPresent ); |
651 CheckMessageBodyL( *iOpenMessages->Head(), msgBodyStructurePresent, msgBodyContentPresent ); |
651 LoadContentFromMailMessageL( iOpenMessages->Head(), ETrue ); |
652 LoadContentFromMailMessageL( iOpenMessages->Head(), ETrue ); |
652 |
653 |
653 // update tool bar as some action menu boton should not appear in embbeded messages. |
|
654 UpdateToolbarL(); |
|
655 |
|
656 } |
654 } |
657 break; |
655 break; |
658 case THtmlViewerActivationData::EFile: |
656 case THtmlViewerActivationData::EFile: |
659 { |
657 { |
660 LoadContentFromFileL( iActivationData.iFile ); |
658 LoadContentFromFileL( iActivationData.iFile ); |
730 } |
728 } |
731 } |
729 } |
732 } |
730 } |
733 iNextOrPrevMessageSelected = EFalse; |
731 iNextOrPrevMessageSelected = EFalse; |
734 iForwardingMessage = EFalse; |
732 iForwardingMessage = EFalse; |
735 |
733 |
736 //update rect only if it has changed from previous time. |
734 //update rect only if it has changed from previous time. |
737 if ( iContainer->Rect() != ContainerRect() ) |
735 if ( iContainer->Rect() != ContainerRect() ) |
738 { |
736 { |
739 iContainer->SetRect( ContainerRect() ); |
737 iContainer->SetRect( ContainerRect() ); |
740 } |
738 } |
741 |
739 |
742 TIMESTAMP( "Html viewer opened" ); |
740 TIMESTAMP( "Html viewer opened" ); |
743 } |
|
744 |
|
745 // ----------------------------------------------------------------------------- |
|
746 // CFsEmailUiHtmlViewerView::OfferToolbarEventL |
|
747 // ----------------------------------------------------------------------------- |
|
748 void CFsEmailUiHtmlViewerView::OfferToolbarEventL( TInt aCommand ) |
|
749 { |
|
750 FUNC_LOG; |
|
751 switch (aCommand) |
|
752 { |
|
753 case EFsEmailUiTbCmdReply: |
|
754 { |
|
755 HandleCommandL(EFsEmailUiCmdActionsReply); |
|
756 break; |
|
757 } |
|
758 |
|
759 case EFsEmailUiTbCmdForward: |
|
760 { |
|
761 HandleCommandL(EFsEmailUiCmdActionsForward); |
|
762 break; |
|
763 } |
|
764 case EFsEmailUiTbCmdDelete: |
|
765 { |
|
766 iAsyncCallback->Cancel(); |
|
767 iAsyncCallback->Set( TCallBack( DeleteMail, this ) ); |
|
768 iAsyncCallback->SetPriority( CActive::EPriorityHigh ); |
|
769 iAsyncCallback->CallBack(); |
|
770 break; |
|
771 } |
|
772 case EFsEmailUiTbCmdReplyAll: |
|
773 { |
|
774 HandleCommandL(EFsEmailUiCmdActionsReplyAll); |
|
775 break; |
|
776 } |
|
777 default: |
|
778 break; |
|
779 } |
|
780 } |
|
781 |
|
782 // ----------------------------------------------------------------------------- |
|
783 // CFsEmailUiHtmlViewerView::ToolbarResourceId |
|
784 // ----------------------------------------------------------------------------- |
|
785 TInt CFsEmailUiHtmlViewerView::ToolbarResourceId() const |
|
786 { |
|
787 TInt resourceId( R_FREESTYLE_EMAIL_UI_TOOLBAR_HTML_MESSAGE_VIEWER_NO_REPLY_ALL ); |
|
788 if (iMessage) |
|
789 { |
|
790 if (!iActivationData.iEmbeddedMessageMode && |
|
791 TFsEmailUiUtility::CountRecipientsSmart( iAppUi, iMessage ) > 1) |
|
792 { |
|
793 resourceId = R_FREESTYLE_EMAIL_UI_TOOLBAR_HTML_MESSAGE_VIEWER; |
|
794 } |
|
795 } |
|
796 return resourceId; |
|
797 } |
|
798 |
|
799 // ----------------------------------------------------------------------------- |
|
800 // CFsEmailUiHtmlViewerView::GetInitiallyDimmedItemsL |
|
801 // ----------------------------------------------------------------------------- |
|
802 void CFsEmailUiHtmlViewerView::GetInitiallyDimmedItemsL( const TInt aResourceId, |
|
803 RArray<TInt>& aDimmedItems ) const |
|
804 { |
|
805 if ( R_FREESTYLE_EMAIL_UI_TOOLBAR_HTML_MESSAGE_VIEWER == aResourceId || |
|
806 R_FREESTYLE_EMAIL_UI_TOOLBAR_HTML_MESSAGE_VIEWER_NO_REPLY_ALL == aResourceId ) |
|
807 { |
|
808 if ( iActivationData.iEmbeddedMessageMode ) |
|
809 { |
|
810 aDimmedItems.AppendL(EFsEmailUiTbCmdActions); |
|
811 aDimmedItems.AppendL(EFsEmailUiTbCmdDelete); |
|
812 aDimmedItems.AppendL(EFsEmailUiTbCmdReply); |
|
813 aDimmedItems.AppendL(EFsEmailUiTbCmdForward); |
|
814 aDimmedItems.AppendL(EFsEmailUiTbCmdReplyAll); |
|
815 } |
|
816 } |
|
817 } |
741 } |
818 |
742 |
819 // ----------------------------------------------------------------------------- |
743 // ----------------------------------------------------------------------------- |
820 // CFsEmailUiHtmlViewerView::ChildDoDeactivate() |
744 // CFsEmailUiHtmlViewerView::ChildDoDeactivate() |
821 // Deactivate the HTML view |
745 // Deactivate the HTML view |
884 if( tmp ) |
807 if( tmp ) |
885 { |
808 { |
886 delete tmp; |
809 delete tmp; |
887 tmp = NULL; |
810 tmp = NULL; |
888 } |
811 } |
889 |
812 |
890 if ( iFlagSelectionHandler ) |
813 if ( iFlagSelectionHandler ) |
891 { |
814 { |
892 iFlagSelectionHandler->Cancel(); |
815 iFlagSelectionHandler->Cancel(); |
893 delete iFlagSelectionHandler; |
816 delete iFlagSelectionHandler; |
894 iFlagSelectionHandler = NULL; |
817 iFlagSelectionHandler = NULL; |
895 } |
818 } |
896 |
819 |
897 // Return to previous message in the stack if there is still some left |
820 // Return to previous message in the stack if there is still some left |
898 if ( !iOpenMessages->IsEmpty() ) |
821 if ( !iOpenMessages->IsEmpty() ) |
899 { |
822 { |
900 |
823 |
901 THtmlViewerActivationData htmlData; |
824 THtmlViewerActivationData htmlData; |
902 if ( iOpenMessages->Head()!= iOpenMessages->Last() ) |
825 if ( iOpenMessages->Head()!= iOpenMessages->Last() ) |
903 { |
826 { |
904 htmlData.iActivationDataType = THtmlViewerActivationData::EmbeddedEmailMessage; |
827 htmlData.iActivationDataType = THtmlViewerActivationData::EmbeddedEmailMessage; |
905 htmlData.iEmbeddedMessageMode = ETrue; |
828 htmlData.iEmbeddedMessageMode = ETrue; |
906 |
829 |
907 } |
830 } |
908 else |
831 else |
909 { |
832 { |
910 htmlData.iActivationDataType = THtmlViewerActivationData::EMailMessage; |
833 htmlData.iActivationDataType = THtmlViewerActivationData::EMailMessage; |
911 htmlData.iMailBoxId = iOpenMessages->Head()->GetMailBoxId(); |
834 htmlData.iMailBoxId = iOpenMessages->Head()->GetMailBoxId(); |
912 htmlData.iFolderId = iOpenMessages->Head()->GetFolderId(); |
835 htmlData.iFolderId = iOpenMessages->Head()->GetFolderId(); |
913 htmlData.iMessageId = iOpenMessages->Head()->GetMessageId(); |
836 htmlData.iMessageId = iOpenMessages->Head()->GetMessageId(); |
914 } |
837 } |
915 |
838 |
916 TPckgBuf<THtmlViewerActivationData> pckgData( htmlData ); |
839 TPckgBuf<THtmlViewerActivationData> pckgData( htmlData ); |
917 iAppUi.EnterFsEmailViewL( HtmlViewerId, KStartViewerReturnFromEmbeddedMsg, pckgData ); |
840 iAppUi.EnterFsEmailViewL( HtmlViewerId, KStartViewerReturnFromEmbeddedMsg, pckgData ); |
918 |
841 |
919 } |
842 } |
920 // In usual case we use the base view implementation |
843 // In usual case we use the base view implementation |
921 else |
844 else |
922 { |
845 { |
923 iMessage = NULL; |
846 iMessage = NULL; |
928 { |
851 { |
929 HideContainer(); |
852 HideContainer(); |
930 iContainer->ResetContent(); |
853 iContainer->ResetContent(); |
931 } |
854 } |
932 } |
855 } |
|
856 } |
|
857 |
|
858 // --------------------------------------------------------------------------- |
|
859 // Wrapper for implementation in view base class |
|
860 // --------------------------------------------------------------------------- |
|
861 // |
|
862 void CFsEmailUiHtmlViewerView::ChangeMskCommandL( TInt /*aLabelResourceId*/ ) |
|
863 { |
|
864 CEikButtonGroupContainer* cba( Cba() ); |
|
865 if ( cba ) |
|
866 { |
|
867 cba->SetCommandSetL( R_FREESTYLE_EMAUIL_UI_SK_OPTIONS_BACK_FULLSCREEN ); |
|
868 CEikCba* eikCba( static_cast< CEikCba* >( cba->ButtonGroup() ) ); |
|
869 TFileName filename; |
|
870 TFsEmailUiUtility::GetFullIconFileNameL( filename ); |
|
871 if (iActivationData.iEmbeddedMessageMode) |
|
872 { |
|
873 eikCba->UpdateMSKIconL( KAknsIIDQsnIconColors, filename, |
|
874 EMbmFreestyleemailuiQgn_graf_cmail_blank, |
|
875 EMbmFreestyleemailuiQgn_graf_cmail_blank_mask, ETrue ); |
|
876 } |
|
877 else |
|
878 { |
|
879 eikCba->UpdateMSKIconL( KAknsIIDQsnIconColors, filename, |
|
880 EMbmFreestyleemailuiQgn_prop_cmail_action_delete, |
|
881 EMbmFreestyleemailuiQgn_prop_cmail_action_delete_mask, ETrue ); |
|
882 } |
|
883 } |
|
884 } |
|
885 |
|
886 // --------------------------------------------------------------------------- |
|
887 // Sets status bar layout |
|
888 // --------------------------------------------------------------------------- |
|
889 // |
|
890 TBool CFsEmailUiHtmlViewerView::IsStatusPaneVisible() const |
|
891 { |
|
892 return EFalse; |
933 } |
893 } |
934 |
894 |
935 // --------------------------------------------------------------------------- |
895 // --------------------------------------------------------------------------- |
936 // Sets status bar layout |
896 // Sets status bar layout |
937 // --------------------------------------------------------------------------- |
897 // --------------------------------------------------------------------------- |
938 // |
898 // |
939 void CFsEmailUiHtmlViewerView::SetStatusBarLayout() |
899 void CFsEmailUiHtmlViewerView::SetStatusBarLayout() |
940 { |
900 { |
941 TInt res = R_AVKON_STATUS_PANE_LAYOUT_USUAL_FLAT; |
901 if( StatusPane()->CurrentLayoutResId() != R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT ) |
942 if( Layout_Meta_Data::IsLandscapeOrientation() ) |
902 { |
943 { |
903 TRAP_IGNORE( StatusPane()->SwitchLayoutL( R_AVKON_STATUS_PANE_LAYOUT_IDLE_FLAT ) ); |
944 // landscape must use different layout |
904 } |
945 res = R_AVKON_STATUS_PANE_LAYOUT_USUAL_EXT; |
|
946 } |
|
947 |
|
948 if( StatusPane()->CurrentLayoutResId() != res ) |
|
949 { |
|
950 TRAP_IGNORE( |
|
951 StatusPane()->SwitchLayoutL( res )); |
|
952 } |
|
953 } |
905 } |
954 |
906 |
955 void CFsEmailUiHtmlViewerView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) |
907 void CFsEmailUiHtmlViewerView::DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ) |
956 { |
908 { |
957 FUNC_LOG; |
909 FUNC_LOG; |
958 |
910 |
959 if ( aResourceId == R_FSEMAILUI_HTMLVIEWER_MENUPANE ) |
911 if ( aResourceId == R_FSEMAILUI_HTMLVIEWER_MENUPANE ) |
960 { |
912 { |
961 // Pinch zoom only |
913 // Pinch zoom only |
962 aMenuPane->SetItemDimmed( EFsEmailUiCmdZoomLevel, ETrue ); |
914 aMenuPane->SetItemDimmed( EFsEmailUiCmdZoomLevel, ETrue ); |
963 |
915 |
964 if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) |
916 if ( FeatureManager::FeatureSupported( KFeatureIdFfCmailIntegration ) ) |
965 { |
917 { |
966 // remove help support in pf5250 |
918 // remove help support in pf5250 |
967 aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
919 aMenuPane->SetItemDimmed( EFsEmailUiCmdHelp, ETrue); |
968 } |
920 } |
969 |
921 |
970 TBool toolbarExists = EFalse; |
922 const TBool toolbarExists( EFalse ); |
971 if( iAppUi.CurrentFixedToolbar() ) |
923 |
972 { |
|
973 toolbarExists = iAppUi.CurrentFixedToolbar()->IsVisible(); |
|
974 } |
|
975 |
|
976 // Some commands are blocked when viewing embedded message object |
924 // Some commands are blocked when viewing embedded message object |
977 // or separate HTML file. |
925 // or separate HTML file. |
978 const TBool blockCmds( !iMessage || iActivationData.iEmbeddedMessageMode || toolbarExists ); |
926 const TBool blockCmds( !iMessage || iActivationData.iEmbeddedMessageMode || toolbarExists ); |
979 const TBool blockReplyALLCmd( toolbarExists || !iMessage || iActivationData.iEmbeddedMessageMode || |
927 const TBool blockReplyALLCmd( toolbarExists || !iMessage || iActivationData.iEmbeddedMessageMode || |
980 TFsEmailUiUtility::CountRecipientsSmart( iAppUi, iMessage ) < 2 ); |
928 TFsEmailUiUtility::CountRecipientsSmart( iAppUi, iMessage ) < 2 ); |
981 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReply, blockCmds ); |
929 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReply, blockCmds ); |
982 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, blockReplyALLCmd ); |
930 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsReplyAll, blockReplyALLCmd ); |
983 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward, blockCmds ); |
931 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsForward, blockCmds ); |
984 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsDelete, blockCmds ); |
932 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsDelete, blockCmds ); |
985 |
933 |
986 if( iActivationData.iEmbeddedMessageMode ) |
934 if( iActivationData.iEmbeddedMessageMode ) |
987 { |
935 { |
988 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
936 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, ETrue ); |
989 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
937 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, ETrue ); |
990 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
938 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsMoveMessage, ETrue ); |
991 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
939 aMenuPane->SetItemDimmed( EFsEmailUiCmdActionsFlag, ETrue ); |
992 } |
940 } |
993 |
941 |
994 TBool hideNext = !ShowNextMessageMenuInOptions(); |
942 TBool hideNext = !ShowNextMessageMenuInOptions(); |
995 TBool blockNextCmd = !iMessage || iActivationData.iEmbeddedMessageMode || hideNext; |
943 TBool blockNextCmd = !iMessage || iActivationData.iEmbeddedMessageMode || hideNext; |
996 TInt menuPos; |
944 TInt menuPos; |
997 if( aMenuPane->MenuItemExists( EFsEmailUiCmdNextMessage, menuPos ) ) |
945 if( aMenuPane->MenuItemExists( EFsEmailUiCmdNextMessage, menuPos ) ) |
998 { |
946 { |
1002 TBool blockPrevCmd = !iMessage || iActivationData.iEmbeddedMessageMode || hidePrev; |
950 TBool blockPrevCmd = !iMessage || iActivationData.iEmbeddedMessageMode || hidePrev; |
1003 if( aMenuPane->MenuItemExists( EFsEmailUiCmdPreviousMessage, menuPos ) ) |
951 if( aMenuPane->MenuItemExists( EFsEmailUiCmdPreviousMessage, menuPos ) ) |
1004 { |
952 { |
1005 aMenuPane->SetItemDimmed( EFsEmailUiCmdPreviousMessage, blockPrevCmd ); |
953 aMenuPane->SetItemDimmed( EFsEmailUiCmdPreviousMessage, blockPrevCmd ); |
1006 } |
954 } |
1007 |
955 |
1008 CFSMailFolder* currentFolder = NULL; |
956 CFSMailFolder* currentFolder = NULL; |
1009 if ( iMessage ) |
957 if ( iMessage ) |
1010 { |
958 { |
1011 TRAP_IGNORE( currentFolder = |
959 TRAP_IGNORE( currentFolder = |
1012 iAppUi.GetMailClient()->GetFolderByUidL( |
960 iAppUi.GetMailClient()->GetFolderByUidL( |
1013 iMessage->GetMailBoxId(), |
961 iMessage->GetMailBoxId(), |
1014 iMessage->GetFolderId() ) ); |
962 iMessage->GetFolderId() ) ); |
1015 } |
963 } |
1016 |
964 |
1017 if ( currentFolder && |
965 if ( currentFolder && |
1018 currentFolder->GetFolderType() != EFSOutbox ) |
966 currentFolder->GetFolderType() != EFSOutbox ) |
1019 { |
967 { |
1020 // Mark as read/unread options |
968 // Mark as read/unread options |
1021 TBool messageIsRead( iMessage->IsFlagSet( EFSMsgFlag_Read ) ); |
969 TBool messageIsRead( iMessage->IsFlagSet( EFSMsgFlag_Read ) ); |
1022 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageIsRead ); |
970 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsRead, messageIsRead ); |
1023 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !messageIsRead ); |
971 aMenuPane->SetItemDimmed( EFsEmailUiCmdMarkAsUnread, !messageIsRead ); |
1024 |
972 |
1025 // Move to another folder option |
973 // Move to another folder option |
1026 aMenuPane->SetItemDimmed( |
974 aMenuPane->SetItemDimmed( |
1027 EFsEmailUiCmdActionsMoveMessage, |
975 EFsEmailUiCmdActionsMoveMessage, |
1028 !iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ) ); |
976 !iAppUi.GetActiveMailbox()->HasCapability( EFSMBoxCapaMoveToFolder ) ); |
1029 |
977 |
1030 // Follow-up flag option |
978 // Follow-up flag option |
1031 aMenuPane->SetItemDimmed( |
979 aMenuPane->SetItemDimmed( |
1032 EFsEmailUiCmdActionsFlag, |
980 EFsEmailUiCmdActionsFlag, |
1033 !( iMailBox && TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ) ) ); |
981 !( iMailBox && TFsEmailUiUtility::IsFollowUpSupported( *iMailBox ) ) ); |
1034 } |
982 } |
1035 else |
983 else |
1036 { |
984 { |
1095 } |
1043 } |
1096 |
1044 |
1097 void CFsEmailUiHtmlViewerView::HandleStatusPaneSizeChange() |
1045 void CFsEmailUiHtmlViewerView::HandleStatusPaneSizeChange() |
1098 { |
1046 { |
1099 CFsEmailUiViewBase::HandleStatusPaneSizeChange(); |
1047 CFsEmailUiViewBase::HandleStatusPaneSizeChange(); |
1100 |
1048 |
1101 HandleViewRectChange(); |
1049 HandleViewRectChange(); |
1102 } |
1050 } |
1103 |
1051 |
1104 void CFsEmailUiHtmlViewerView::HandleViewRectChange() |
1052 void CFsEmailUiHtmlViewerView::HandleViewRectChange() |
1105 { |
1053 { |
1106 CFsEmailUiViewBase::HandleViewRectChange(); |
1054 CFsEmailUiViewBase::HandleViewRectChange(); |
1107 |
1055 |
1108 if ( iContainer ) |
1056 if ( iContainer ) |
1109 { |
1057 { |
1110 iContainer->SetRect( ContainerRect() ); |
1058 iContainer->SetRect( ContainerRect() ); |
1111 } |
1059 } |
1112 } |
1060 } |
1113 |
1061 |
1114 void CFsEmailUiHtmlViewerView::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ) |
1062 void CFsEmailUiHtmlViewerView::HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType ) |
1115 { |
1063 { |
1116 FUNC_LOG; |
1064 FUNC_LOG; |
1117 |
1065 |
1118 if ( aType == EScreenLayoutChanged ) |
1066 if ( aType == EScreenLayoutChanged ) |
1119 { |
1067 { |
1120 SetStatusBarLayout(); |
1068 SetStatusBarLayout(); |
1121 } |
1069 } |
1122 |
1070 |
1123 if ( iContainer ) |
1071 if ( iContainer ) |
1124 { |
1072 { |
1125 iContainer->SetRect( ContainerRect() ); |
1073 iContainer->SetRect( ContainerRect() ); |
1126 iContainer->HandleResourceChange( aType ); |
1074 iContainer->HandleResourceChange( aType ); |
1127 } |
1075 } |
1128 } |
1076 } |
1129 |
1077 |
1130 TRect CFsEmailUiHtmlViewerView::ContainerRect() const |
1078 TRect CFsEmailUiHtmlViewerView::ContainerRect() const |
1131 { |
1079 { |
1132 TRect rect = ClientRect(); |
1080 TRect rect( ClientRect() ); |
1133 |
1081 return rect; |
1134 CAknToolbar* toolbar = iAppUi.CurrentFixedToolbar(); |
|
1135 if( toolbar && toolbar->IsVisible() && Layout_Meta_Data::IsLandscapeOrientation() ) |
|
1136 { |
|
1137 TPoint pos = toolbar->PositionRelativeToScreen(); |
|
1138 |
|
1139 // In some LS status pane layouts the toolbar will be shown on top of the client area |
|
1140 if( pos.iX > 0 ) |
|
1141 { |
|
1142 rect.iBr.iX = pos.iX; |
|
1143 } |
|
1144 } |
|
1145 return rect; |
|
1146 } |
1082 } |
1147 |
1083 |
1148 void CFsEmailUiHtmlViewerView::LoadContentFromFileL( const TDesC& aFileName ) |
1084 void CFsEmailUiHtmlViewerView::LoadContentFromFileL( const TDesC& aFileName ) |
1149 { |
1085 { |
1150 FUNC_LOG; |
1086 FUNC_LOG; |
1226 if ( iContainer ) |
1162 if ( iContainer ) |
1227 { |
1163 { |
1228 HideContainer(); |
1164 HideContainer(); |
1229 iContainer->ResetContent(); |
1165 iContainer->ResetContent(); |
1230 } |
1166 } |
1231 |
1167 |
1232 RArray<TFSMailMsgId> msgIds; |
1168 RArray<TFSMailMsgId> msgIds; |
1233 CleanupClosePushL( msgIds ); |
1169 CleanupClosePushL( msgIds ); |
1234 |
1170 |
1235 msgIds.Append( currentMsgId ); |
1171 msgIds.Append( currentMsgId ); |
1236 TFSMailMsgId mailBox = iMessage->GetMailBoxId(); |
1172 TFSMailMsgId mailBox = iMessage->GetMailBoxId(); |
1237 TFSMailMsgId folderId = iMessage->GetFolderId(); |
1173 TFSMailMsgId folderId = iMessage->GetFolderId(); |
1238 |
1174 |
1239 //Get the id and check if there is a previous message available |
1175 //Get the id and check if there is a previous message available |
1240 TFSMailMsgId prevMsgId; |
1176 TFSMailMsgId prevMsgId; |
1241 TFSMailMsgId prevMsgFolderId; |
1177 TFSMailMsgId prevMsgFolderId; |
1242 |
1178 |
1243 //Get the previous message if it exists |
1179 //Get the previous message if it exists |
1244 TBool available = iAppUi.IsPreviousMsgAvailable( currentMsgId, |
1180 TBool available = iAppUi.IsPreviousMsgAvailable( currentMsgId, |
1245 prevMsgId, |
1181 prevMsgId, |
1246 prevMsgFolderId ); |
1182 prevMsgFolderId ); |
1247 |
1183 |
1248 //Delete the message |
1184 //Delete the message |
1249 iLastDeletedMessageID = iMessage->GetMessageId(); |
1185 iLastDeletedMessageID = iMessage->GetMessageId(); |
1250 iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds ); |
1186 iAppUi.GetMailClient()->DeleteMessagesByUidL( mailBox, folderId, msgIds ); |
1251 CleanupStack::PopAndDestroy( &msgIds ); |
1187 CleanupStack::PopAndDestroy( &msgIds ); |
1252 |
1188 |
1253 // Notify appui of deleted mail item |
1189 // Notify appui of deleted mail item |
1254 SendEventToAppUiL( TFSEventMailDeletedFromViewer ); |
1190 SendEventToAppUiL( TFSEventMailDeletedFromViewer ); |
1255 |
1191 |
1256 |
1192 |
1257 if ( iAppUi.CurrentActiveView()->Id() == HtmlViewerId ) |
1193 if ( iAppUi.CurrentActiveView()->Id() == HtmlViewerId ) |
1258 { |
1194 { |
1259 //Open the previous message or navigate back to list viewer |
1195 //Open the previous message or navigate back to list viewer |
1260 if ( available ) |
1196 if ( available ) |
1261 { |
1197 { |
1262 iMessageIsDeleted = ETrue; |
1198 iMessageIsDeleted = ETrue; |
1263 TRAPD( err, iAppUi.MoveToPreviousMsgAfterDeleteL( prevMsgId ) ); |
1199 TRAPD( err, iAppUi.MoveToPreviousMsgAfterDeleteL( prevMsgId ) ); |
1264 iMessageIsDeleted = EFalse; |
1200 iMessageIsDeleted = EFalse; |
1265 |
1201 |
1266 User::LeaveIfError( err ); |
1202 User::LeaveIfError( err ); |
1267 } |
1203 } |
1268 else |
1204 else |
1269 { |
1205 { |
1270 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
1206 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
1271 NavigateBackL(); |
1207 NavigateBackL(); |
1272 } |
1208 } |
1287 { |
1223 { |
1288 FUNC_LOG; |
1224 FUNC_LOG; |
1289 if ( /*iFirstStartCompleted &&*/ iMessage && aMailbox.Id() == iAppUi.GetActiveMailboxId().Id() && |
1225 if ( /*iFirstStartCompleted &&*/ iMessage && aMailbox.Id() == iAppUi.GetActiveMailboxId().Id() && |
1290 (aEvent == TFSEventMailDeleted || aEvent == TFSEventMailDeletedFromViewer) && aParam1 ) // Safety, in list events that only concern active mailbox are handled |
1226 (aEvent == TFSEventMailDeleted || aEvent == TFSEventMailDeletedFromViewer) && aParam1 ) // Safety, in list events that only concern active mailbox are handled |
1291 { |
1227 { |
1292 TFSMailMsgId curMsgId = iMessage->GetMessageId(); |
1228 TFSMailMsgId curMsgId = iMessage->GetMessageId(); |
1293 RArray<TFSMailMsgId>* removedEntries = static_cast<RArray<TFSMailMsgId>*>( aParam1 ); |
1229 RArray<TFSMailMsgId>* removedEntries = static_cast<RArray<TFSMailMsgId>*>( aParam1 ); |
1294 TBool cont = ETrue; |
1230 TBool cont = ETrue; |
1295 for ( TInt i = 0 ; i < removedEntries->Count() && cont; i++ ) |
1231 for ( TInt i = 0 ; i < removedEntries->Count() && cont; i++ ) |
1296 { |
1232 { |
1297 if ( ( curMsgId == ( *removedEntries )[i] ) && |
1233 if ( ( curMsgId == ( *removedEntries )[i] ) && |
1298 (iDeletedMessageFromMrui != curMsgId) ) |
1234 (iDeletedMessageFromMrui != curMsgId) ) |
1299 { |
1235 { |
1300 cont = EFalse; |
1236 cont = EFalse; |
1301 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
1237 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
1302 if( aEvent == TFSEventMailDeleted && !iMessageIsDeleted ) |
1238 if( aEvent == TFSEventMailDeleted && !iMessageIsDeleted ) |
1303 { //Delete event came from server; close the viewer. |
1239 { //Delete event came from server; close the viewer. |
1304 HandleCommandL( EAknSoftkeyBack ); |
1240 HandleCommandL( EAknSoftkeyBack ); |
1305 // The message we are viewing was deleted => stop here |
1241 // The message we are viewing was deleted => stop here |
1306 return; |
1242 return; |
1307 } |
1243 } |
1308 } |
1244 } |
1309 } |
1245 } |
1310 } |
1246 } |
1311 |
1247 |
1312 if ( iContainer && iMessage && aMailbox.Id() == iAppUi.GetActiveMailboxId().Id() ) |
1248 if ( iContainer && iMessage && aMailbox.Id() == iAppUi.GetActiveMailboxId().Id() ) |
1313 { |
1249 { |
1314 if ( aEvent == TFSEventNewMail || |
1250 if ( aEvent == TFSEventNewMail || |
1315 aEvent == TFSEventMailDeleted || |
1251 aEvent == TFSEventMailDeleted || |
1316 aEvent == TFSEventMailChanged ) |
1252 aEvent == TFSEventMailChanged ) |
1317 { |
1253 { |
1318 iContainer->MailListModelUpdatedL(); |
1254 iContainer->MailListModelUpdatedL(); |
1319 } |
1255 } |
1320 |
1256 |
1321 // DSW fix for FAMZ-82YJQ2 |
1257 // DSW fix for FAMZ-82YJQ2 |
1322 // Dismiss the download status dialog after sync has been finished or cancelled |
1258 // Dismiss the download status dialog after sync has been finished or cancelled |
1323 |
1259 |
1324 if ( aEvent == TFSEventMailboxSyncStateChanged ) |
1260 if ( aEvent == TFSEventMailboxSyncStateChanged ) |
1325 { |
1261 { |
1326 TSSMailSyncState* newSyncState = static_cast<TSSMailSyncState*>( aParam1 ); |
1262 TSSMailSyncState* newSyncState = static_cast<TSSMailSyncState*>( aParam1 ); |
1327 if ( newSyncState && ( *newSyncState == FinishedSuccessfully || |
1263 if ( newSyncState && ( *newSyncState == FinishedSuccessfully || |
1328 *newSyncState == SyncCancelled || |
1264 *newSyncState == SyncCancelled || |
1329 *newSyncState == Idle || |
1265 *newSyncState == Idle || |
1330 *newSyncState == SyncError )) |
1266 *newSyncState == SyncError )) |
1331 { |
1267 { |
1332 iContainer->HideDownloadStatus(); |
1268 iContainer->HideDownloadStatus(); |
1333 } |
1269 } |
1334 } |
1270 } |
1335 } |
1271 } |
1336 } |
1272 } |
1337 |
1273 |
1338 void CFsEmailUiHtmlViewerView::DynInitZoomMenuL( CEikMenuPane* aMenuPane ) |
1274 void CFsEmailUiHtmlViewerView::DynInitZoomMenuL( CEikMenuPane* aMenuPane ) |
1339 { |
1275 { |
1340 FUNC_LOG; |
1276 FUNC_LOG; |
1341 /* -- Pinch zoom only -- |
1277 /* -- Pinch zoom only -- |
1342 TInt zoomLevelIdx = iContainer->ZoomLevelL(); |
1278 TInt zoomLevelIdx = iContainer->ZoomLevelL(); |
1343 |
1279 |
1344 // Set the radio button state to match current zoom level |
1280 // Set the radio button state to match current zoom level |
1345 if ( zoomLevelIdx >= 0 && zoomLevelIdx < iContainer->MaxZoomLevel() ) |
1281 if ( zoomLevelIdx >= 0 && zoomLevelIdx < iContainer->MaxZoomLevel() ) |
1536 { |
1472 { |
1537 // this method assumes that remote lookup is available with current plugin. |
1473 // this method assumes that remote lookup is available with current plugin. |
1538 HBufC* textData = aEmailAddress.AllocLC(); |
1474 HBufC* textData = aEmailAddress.AllocLC(); |
1539 CFSMailBox* mailBox = iAppUi.GetMailClient()->GetMailBoxByUidL( iMessage->GetMailBoxId() ); |
1475 CFSMailBox* mailBox = iAppUi.GetMailClient()->GetMailBoxByUidL( iMessage->GetMailBoxId() ); |
1540 CleanupStack::PushL( mailBox ); |
1476 CleanupStack::PushL( mailBox ); |
1541 |
|
1542 //UI options Delete and Actions dimmed in Remote Lookup. |
|
1543 const TInt resourceId(ToolbarResourceId()); |
|
1544 RArray<TInt> dimmedItems; |
|
1545 CleanupClosePushL(dimmedItems); |
|
1546 GetInitiallyDimmedItemsL(resourceId, dimmedItems); // get the currently dimmed buttons |
|
1547 |
|
1548 SetToolbarItemDimmed( EFsEmailUiTbCmdActions, ETrue); |
|
1549 SetToolbarItemDimmed( EFsEmailUiTbCmdDelete, ETrue); |
|
1550 |
|
1551 HideToolbar(); |
|
1552 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->LaunchRemoteLookupWithQueryL( *mailBox, *textData ); |
1477 CFsDelayedLoader::InstanceL()->GetContactHandlerL()->LaunchRemoteLookupWithQueryL( *mailBox, *textData ); |
1553 ShowToolbar(); |
|
1554 |
|
1555 SetToolbarItemDimmed( EFsEmailUiTbCmdActions, EFalse); |
|
1556 SetToolbarItemDimmed( EFsEmailUiTbCmdDelete, EFalse); |
|
1557 |
|
1558 for (TInt i = 0; i < dimmedItems.Count(); i++) // restore the buttons |
|
1559 { |
|
1560 SetToolbarItemDimmed(dimmedItems[i], ETrue); |
|
1561 } |
|
1562 CleanupStack::PopAndDestroy(); // dimmedItems.Close() |
|
1563 CleanupStack::PopAndDestroy( mailBox ); |
1478 CleanupStack::PopAndDestroy( mailBox ); |
1564 CleanupStack::PopAndDestroy( textData ); |
1479 CleanupStack::PopAndDestroy( textData ); |
1565 } |
1480 } |
1566 |
1481 |
1567 // ----------------------------------------------------------------------------- |
1482 // ----------------------------------------------------------------------------- |
1690 return iActivationData.iEmbeddedMessageMode; |
1605 return iActivationData.iEmbeddedMessageMode; |
1691 } |
1606 } |
1692 |
1607 |
1693 TBool CFsEmailUiHtmlViewerView::IsEmbeddedMsgSavingAllowed() |
1608 TBool CFsEmailUiHtmlViewerView::IsEmbeddedMsgSavingAllowed() |
1694 { |
1609 { |
1695 return iMailBox->HasCapability( |
1610 return iMailBox->HasCapability( |
1696 EFSMboxCapaSupportsSavingOfEmbeddedMessages ); |
1611 EFSMboxCapaSupportsSavingOfEmbeddedMessages ); |
1697 } |
1612 } |
1698 |
1613 |
1699 void CFsEmailUiHtmlViewerView::UpdateDownloadIndicatorL( |
1614 void CFsEmailUiHtmlViewerView::UpdateDownloadIndicatorL( |
1700 const TPartData& aPart, |
1615 const TPartData& aPart, |
1701 const TFSProgress& aEvent ) |
1616 const TFSProgress& aEvent ) |
1702 { |
1617 { |
1703 FUNC_LOG; |
1618 FUNC_LOG; |
1704 |
1619 |
1705 if ( !iMessage || !iContainer || ( aEvent.iError != KErrNone ) ) |
1620 if ( !iMessage || !iContainer || ( aEvent.iError != KErrNone ) ) |
1706 return; |
1621 return; |
1707 |
1622 |
1708 TAttachmentData* attachment = NULL; |
1623 TAttachmentData* attachment = NULL; |
1709 const RArray<TAttachmentData>& attachments = iAttachmentsListModel->GetModel(); |
1624 const RArray<TAttachmentData>& attachments = iAttachmentsListModel->GetModel(); |
1710 for ( TInt i=0; i < attachments.Count(); i++ ) |
1625 for ( TInt i=0; i < attachments.Count(); i++ ) |
1711 { |
1626 { |
1712 if ( attachments[i].partData == aPart ) |
1627 if ( attachments[i].partData == aPart ) |
1713 { |
1628 { |
1714 attachment = CONST_CAST( TAttachmentData*, &iAttachmentsListModel->GetModel()[i] ); |
1629 attachment = CONST_CAST( TAttachmentData*, &iAttachmentsListModel->GetModel()[i] ); |
1715 break; |
1630 break; |
1716 } |
1631 } |
1717 } |
1632 } |
1718 |
1633 |
1719 if ( attachment ) |
1634 if ( attachment ) |
1720 { |
1635 { |
1721 switch ( aEvent.iProgressStatus ) |
1636 switch ( aEvent.iProgressStatus ) |
1722 { |
1637 { |
1723 case TFSProgress::EFSStatus_Status: |
1638 case TFSProgress::EFSStatus_Status: |
1957 { |
1872 { |
1958 TFSMailMsgId currentMsgId = iMessage->GetMessageId(); |
1873 TFSMailMsgId currentMsgId = iMessage->GetMessageId(); |
1959 TFSMailMsgId prevMsgId; |
1874 TFSMailMsgId prevMsgId; |
1960 TFSMailMsgId prevMsgFolderId; |
1875 TFSMailMsgId prevMsgFolderId; |
1961 if ( iAppUi.IsPreviousMsgAvailable( currentMsgId, prevMsgId, prevMsgFolderId ) ) |
1876 if ( iAppUi.IsPreviousMsgAvailable( currentMsgId, prevMsgId, prevMsgFolderId ) ) |
1962 { |
1877 { |
1963 if (iContainer) |
1878 if (iContainer) |
1964 { |
1879 { |
1965 iContainer->PrepareForMessageNavigation(); |
1880 iContainer->PrepareForMessageNavigation(); |
1966 } |
1881 } |
1967 |
1882 |
1968 // Stop timer and cancel fetchings before showing prev message |
1883 // Stop timer and cancel fetchings before showing prev message |
1969 CancelFetchings(); |
1884 CancelFetchings(); |
1970 |
1885 |
1971 // Change empty msk when moving to previous |
1886 // Change empty msk when moving to previous |
1972 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
1887 ChangeMskCommandL( R_FSE_QTN_MSK_EMPTY ); |
1973 |
1888 |
1974 iAppUi.MoveToPreviousMsgL( currentMsgId, prevMsgId ); |
1889 iAppUi.MoveToPreviousMsgL( currentMsgId, prevMsgId ); |
1975 // Previous message is displayed in this view through doactivate, because view is re-activate by mail list |
1890 // Previous message is displayed in this view through doactivate, because view is re-activate by mail list |
2997 // |
2910 // |
2998 TBool CFsEmailUiHtmlViewerView::IsOpenedInMRViewerL() |
2911 TBool CFsEmailUiHtmlViewerView::IsOpenedInMRViewerL() |
2999 { |
2912 { |
3000 FUNC_LOG; |
2913 FUNC_LOG; |
3001 TBool retVal( EFalse ); |
2914 TBool retVal( EFalse ); |
3002 CFSMailMessage* msg = iAppUi.GetMailClient()->GetMessageByUidL( |
2915 CFSMailMessage* msg = iAppUi.GetMailClient()->GetMessageByUidL( |
3003 iActivationData.iMailBoxId, iActivationData.iFolderId, |
2916 iActivationData.iMailBoxId, iActivationData.iFolderId, |
3004 iActivationData.iMessageId, EFSMsgDataEnvelope ); |
2917 iActivationData.iMessageId, EFSMsgDataEnvelope ); |
3005 |
2918 |
3006 if ( msg ) |
2919 if ( msg ) |
3007 { |
2920 { |
3008 CleanupStack::PushL( msg ); |
2921 CleanupStack::PushL( msg ); |
3009 if ( msg->IsFlagSet( EFSMsgFlag_CalendarMsg ) && |
2922 if ( msg->IsFlagSet( EFSMsgFlag_CalendarMsg ) && |
3010 iAppUi.MrViewerInstanceL() ) |
2923 iAppUi.MrViewerInstanceL() ) |
3011 { |
2924 { |
3012 TESMRMeetingRequestMethod mrMethod( EESMRMeetingRequestMethodUnknown ); |
2925 TESMRMeetingRequestMethod mrMethod( EESMRMeetingRequestMethodUnknown ); |
3013 mrMethod = iAppUi.MrViewerInstanceL()->ResolveMeetingRequestMethodL( *msg ); |
2926 mrMethod = iAppUi.MrViewerInstanceL()->ResolveMeetingRequestMethodL( *msg ); |
3014 // Opened in MR viewer if request/cancellation or unknown MR |
2927 // Opened in MR viewer if request/cancellation or unknown MR |
3015 retVal = |
2928 retVal = |
3016 mrMethod == EESMRMeetingRequestMethodRequest || |
2929 mrMethod == EESMRMeetingRequestMethodRequest || |
3017 mrMethod == EESMRMeetingRequestMethodCancellation || |
2930 mrMethod == EESMRMeetingRequestMethodCancellation || |
3018 mrMethod == EESMRMeetingRequestMethodUnknown; |
2931 mrMethod == EESMRMeetingRequestMethodUnknown; |
3019 } |
2932 } |
3020 CleanupStack::PopAndDestroy( msg ); |
2933 CleanupStack::PopAndDestroy( msg ); |
3040 plainText->InsertL( 0 , *clipBoardText ); |
2953 plainText->InsertL( 0 , *clipBoardText ); |
3041 plainText->CopyToStoreL( cb->Store(), cb->StreamDictionary(), 0, plainText->DocumentLength() ); |
2954 plainText->CopyToStoreL( cb->Store(), cb->StreamDictionary(), 0, plainText->DocumentLength() ); |
3042 CleanupStack::PopAndDestroy( plainText ); |
2955 CleanupStack::PopAndDestroy( plainText ); |
3043 cb->CommitL(); |
2956 cb->CommitL(); |
3044 CleanupStack::PopAndDestroy( cb ); |
2957 CleanupStack::PopAndDestroy( cb ); |
3045 CleanupStack::PopAndDestroy( clipBoardText ); |
2958 CleanupStack::PopAndDestroy( clipBoardText ); |
3046 } |
2959 } |
3047 } |
2960 } |
3048 |
2961 |
3049 // -------------------------------------------------------------------------------- |
2962 // -------------------------------------------------------------------------------- |
3050 // CFsEmailUiHtmlViewerView::OpenLinkInBrowserL |
2963 // CFsEmailUiHtmlViewerView::OpenLinkInBrowserL |
3051 // -------------------------------------------------------------------------------- |
2964 // -------------------------------------------------------------------------------- |
3052 void CFsEmailUiHtmlViewerView::OpenLinkInBrowserL( const TDesC& aUrl ) const |
2965 void CFsEmailUiHtmlViewerView::OpenLinkInBrowserL( const TDesC& aUrl ) const |
3053 { |
2966 { |
3054 FUNC_LOG; |
2967 FUNC_LOG; |
3055 |
2968 |
3056 // Create session |
2969 // Create session |
3057 RApaLsSession session; |
2970 RApaLsSession session; |
3058 User::LeaveIfError( session.Connect() ); |
2971 User::LeaveIfError( session.Connect() ); |
3059 CleanupClosePushL( session ); |
2972 CleanupClosePushL( session ); |
3060 |
2973 |
3061 // Gets the default application UID for for the given MIME type |
2974 // Gets the default application UID for for the given MIME type |
3062 TUid uid; |
2975 TUid uid; |
3063 TDataType dataType( _L8( "text/html" ) ); |
2976 TDataType dataType( _L8( "text/html" ) ); |
3064 session.AppForDataType( dataType, uid ); |
2977 session.AppForDataType( dataType, uid ); |
3065 |
2978 |
3066 // Runs the default application using the dataType |
2979 // Runs the default application using the dataType |
3067 TThreadId threadId; |
2980 TThreadId threadId; |
3068 User::LeaveIfError( session.StartDocument( aUrl , dataType, threadId ) ); |
2981 User::LeaveIfError( session.StartDocument( aUrl , dataType, threadId ) ); |
3069 |
2982 |
3070 CleanupStack::PopAndDestroy(); // session |
2983 CleanupStack::PopAndDestroy(); // session |
3071 } |
2984 } |
3072 |
2985 |
3073 // -------------------------------------------------------------------------------- |
2986 // -------------------------------------------------------------------------------- |
3074 // CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL |
2987 // CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL |
3075 // -------------------------------------------------------------------------------- |
2988 // -------------------------------------------------------------------------------- |
3076 void CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL( const TDesC& aUrl ) const |
2989 void CFsEmailUiHtmlViewerView::SaveWebAddressToFavouritesL( const TDesC& aUrl ) const |
3077 { |
2990 { |
3078 FUNC_LOG; |
2991 FUNC_LOG; |
3079 HBufC* url = aUrl.AllocLC(); |
2992 HBufC* url = aUrl.AllocLC(); |
3080 |
2993 |
3081 RFavouritesSession fSession; |
2994 RFavouritesSession fSession; |
3082 User::LeaveIfError( fSession.Connect() ); |
2995 User::LeaveIfError( fSession.Connect() ); |
3083 CleanupClosePushL( fSession ); |
2996 CleanupClosePushL( fSession ); |
3084 |
2997 |
3085 RFavouritesDb favourites; |
2998 RFavouritesDb favourites; |