emailuis/emailui/src/FreestyleEmailDownloadInformationMediator.cpp
branchRCL_3
changeset 11 0396474f30f5
parent 10 f5907b1a1053
child 13 8592a65ad3fb
equal deleted inserted replaced
10:f5907b1a1053 11:0396474f30f5
   239             // Notification of saved attachments may be given if all downloads of the given message has been completed.
   239             // Notification of saved attachments may be given if all downloads of the given message has been completed.
   240             if ( download.iNotifyComplete && countObject.iDownloadsCompletedCount &&
   240             if ( download.iNotifyComplete && countObject.iDownloadsCompletedCount &&
   241                  countObject.iDownloadsCompletedCount == countObject.iDownloadsStartedCount &&
   241                  countObject.iDownloadsCompletedCount == countObject.iDownloadsStartedCount &&
   242                  countObject.iSaveRequestedCount > 0 )
   242                  countObject.iSaveRequestedCount > 0 )
   243                  {
   243                  {
       
   244                  TFsEmailUiUtility::SetDownloadSave( ETrue );
   244                  TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( countObject.iSaveRequestedCount );
   245                  TFsEmailUiUtility::ShowFilesSavedToFolderNoteL( countObject.iSaveRequestedCount );
   245                  }        
   246                  }        
   246             // Show "Download completed" if necessary
   247             // Show "Download completed" if necessary
   247             else if ( CompletionNotesInUseL() && completedDownloadsToNotify )
   248             else if ( CompletionNotesInUseL() && completedDownloadsToNotify )
   248                 {
   249                 {
   249                 LaunchDownloadCompleteNoteL( download.iPartData,
   250                 OpenAttachmentL( download.iPartData, completedDownloadsToNotify );            
   250                     completedDownloadsToNotify );
       
   251                 }
   251                 }
   252             else if ( download.iNotifyComplete &&
   252             else if ( download.iNotifyComplete &&
   253                       countObject.iSaveRequestedCount == 0 )
   253                       countObject.iSaveRequestedCount == 0 )
   254                 {
   254                 {
   255                 TFsEmailUiUtility::OpenAttachmentL( download.iPartData );
   255                 TFsEmailUiUtility::OpenAttachmentL( download.iPartData );
   448 void CFSEmailDownloadInfoMediator::DownloadAndSaveL( TPartData aPart, const TDesC& aSaveFileName, TBool aCompleteNote )
   448 void CFSEmailDownloadInfoMediator::DownloadAndSaveL( TPartData aPart, const TDesC& aSaveFileName, TBool aCompleteNote )
   449 	{
   449 	{
   450 	FUNC_LOG;
   450 	FUNC_LOG;
   451 	// now there is at least one download started 
   451 	// now there is at least one download started 
   452 	iDownloadsStarted = ETrue;
   452 	iDownloadsStarted = ETrue;
       
   453 	TFsEmailUiUtility::SetSaveSelect( ETrue );  
   453 	// fetch message part
   454 	// fetch message part
   454 	CFSMailMessage* mailMessage = iMailClient.GetMessageByUidL( aPart.iMailBoxId, aPart.iFolderId, aPart.iMessageId, EFSMsgDataEnvelope );
   455 	CFSMailMessage* mailMessage = iMailClient.GetMessageByUidL( aPart.iMailBoxId, aPart.iFolderId, aPart.iMessageId, EFSMsgDataEnvelope );
   455 	CleanupStack::PushL( mailMessage );
   456 	CleanupStack::PushL( mailMessage );
   456 	CFSMailMessagePart* messagePart = mailMessage->ChildPartL( aPart.iMessagePartId );
   457 	CFSMailMessagePart* messagePart = mailMessage->ChildPartL( aPart.iMessagePartId );
   457 	CleanupStack::PopAndDestroy( mailMessage );
   458 	CleanupStack::PopAndDestroy( mailMessage );
   626 	CFSEmailCRHandler* cenRepHandler = CFSEmailCRHandler::InstanceL();
   627 	CFSEmailCRHandler* cenRepHandler = CFSEmailCRHandler::InstanceL();
   627 	
   628 	
   628 	return cenRepHandler->DownloadNotifications();
   629 	return cenRepHandler->DownloadNotifications();
   629 	}
   630 	}
   630 
   631 
       
   632 void CFSEmailDownloadInfoMediator::OpenAttachmentL( const TPartData& aPart, 
       
   633         const TInt aCompletedCount )
       
   634     {
       
   635     iPopupLaunchData = aPart;
       
   636     if (aCompletedCount > 1)
       
   637         {
       
   638         iPopupLaunchData.iMessagePartId.SetNullId();    
       
   639         }
       
   640     TRequestStatus* status = &iStatus;
       
   641     User::RequestComplete(status, KErrNone);
       
   642     SetActive();
       
   643     }
       
   644 
   631 void CFSEmailDownloadInfoMediator::LaunchDownloadCompleteNoteL(
   645 void CFSEmailDownloadInfoMediator::LaunchDownloadCompleteNoteL(
   632         const TPartData& aPart, TInt aCompletedCount )
   646         const TPartData& aPart, TInt aCompletedCount )
   633     {
   647     {
   634 	FUNC_LOG;
   648 	FUNC_LOG;
   635 
   649