emailuis/emailui/src/FreestyleEmailUiHtmlViewerView.cpp
branchRCL_3
changeset 80 726fba06891a
parent 73 c8382f7b54ef
equal deleted inserted replaced
73:c8382f7b54ef 80:726fba06891a
    36 #include <FreestyleEmailUi.rsg>
    36 #include <FreestyleEmailUi.rsg>
    37 #include <schemehandler.h> // CSchemeHandler
    37 #include <schemehandler.h> // CSchemeHandler
    38 #include <brctlinterface.h>
    38 #include <brctlinterface.h>
    39 #include <csxhelp/cmail.hlp.hrh>
    39 #include <csxhelp/cmail.hlp.hrh>
    40 #include <baclipb.h> // for clipboard copy
    40 #include <baclipb.h> // for clipboard copy
    41 #include <fsmailserver.rsg>
       
    42 #include <aknnotewrappers.h>
       
    43 
    41 
    44 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    42 #ifdef SYMBIAN_ENABLE_SPLIT_HEADERS
    45 #include <txtclipboard.h>
    43 #include <txtclipboard.h>
    46 #endif
    44 #endif
    47 
    45 
    72     CAlfEnv& aEnv,
    70     CAlfEnv& aEnv,
    73     CFreestyleEmailUiAppUi& aAppUi,
    71     CFreestyleEmailUiAppUi& aAppUi,
    74     CAlfControlGroup& aControlGroup )
    72     CAlfControlGroup& aControlGroup )
    75     {
    73     {
    76     FUNC_LOG;
    74     FUNC_LOG;
    77     CFsEmailUiHtmlViewerView* self = new ( ELeave ) CFsEmailUiHtmlViewerView(
    75     CFsEmailUiHtmlViewerView* self = new ( ELeave ) CFsEmailUiHtmlViewerView( aEnv, aAppUi, aControlGroup );
    78         aEnv, aAppUi, aControlGroup );
       
    79     CleanupStack::PushL( self );
    76     CleanupStack::PushL( self );
    80     self->ConstructL();
    77     self->ConstructL();
    81     CleanupStack::Pop( self );
    78     CleanupStack::Pop( self );
    82     return self;
    79     return self;
    83     }
    80     }
   349                  ChangeMsgReadStatusL( ETrue, EFalse );
   346                  ChangeMsgReadStatusL( ETrue, EFalse );
   350                  }
   347                  }
   351                  break;
   348                  break;
   352              case EFsEmailUiCmdActionsMoveMessage:
   349              case EFsEmailUiCmdActionsMoveMessage:
   353                  {
   350                  {
   354                  TBool asyncFetchStatus = GetAsyncFetchStatus();
   351                  OpenFolderListForMessageMovingL();
   355                  if ( asyncFetchStatus )
       
   356                      {
       
   357                      HBufC* noteText = StringLoader::LoadLC( R_FS_MSERVER_TEXT_SERVER_CURRENTLY_BUSY_TRY_AGAIN );
       
   358                      CAknInformationNote* note = new (ELeave) CAknInformationNote();
       
   359                      note->ExecuteLD( *noteText );
       
   360                      CleanupStack::PopAndDestroy( noteText );
       
   361                      }
       
   362                  else
       
   363                      {
       
   364                      OpenFolderListForMessageMovingL();
       
   365                      }
       
   366                  }
   352                  }
   367                  break;
   353                  break;
   368              case EFsEmailUiCmdActionsFlag:
   354              case EFsEmailUiCmdActionsFlag:
   369                  {
   355                  {
   370                  SetMessageFollowupFlagL();
   356                  SetMessageFollowupFlagL();
   469     }
   455     }
   470 
   456 
   471 // ---------------------------------------------------------------------------
   457 // ---------------------------------------------------------------------------
   472 //  hide or show Container ( used for activation of the view )
   458 //  hide or show Container ( used for activation of the view )
   473 //
   459 //
   474 void CFsEmailUiHtmlViewerView::FadeOut( TBool aDirectionOut )
   460 void CFsEmailUiHtmlViewerView::FadeOut(TBool aDirectionOut )
   475 	{
   461 	{
   476 	FUNC_LOG;
   462 	FUNC_LOG;
   477 	if ( !iContainer )
   463 	iContainer->MakeVisible(!aDirectionOut);
   478 		{
       
   479         TFsEmailUiUtility::ShowErrorNoteL( 
       
   480             R_FREESTYLE_EMAIL_ERROR_GENERAL_UNABLE_TO_COMPLETE, ETrue );
       
   481 		}
       
   482 	else
       
   483 		{
       
   484 	    iContainer->MakeVisible( !aDirectionOut );
       
   485 		}
       
   486 	}
   464 	}
   487 
   465 
   488 
   466 
   489 // -----------------------------------------------------------------------------
   467 // -----------------------------------------------------------------------------
   490 // CFsEmailUiHtmlViewerView::DoActivateL()
   468 // CFsEmailUiHtmlViewerView::DoActivateL()
   654                 }
   632                 }
   655 
   633 
   656             iMessage = iOpenMessages->Head();
   634             iMessage = iOpenMessages->Head();
   657             iCreateNewMsgFromEmbeddedMsg = EFalse;
   635             iCreateNewMsgFromEmbeddedMsg = EFalse;
   658 
   636 
   659             if (iMessage && !iMailBox)
       
   660                 {
       
   661                 iMailBox = iAppUi.GetMailClient()->GetMailBoxByUidL( iMessage->GetMailBoxId() );            
       
   662                 }
       
   663             delete iAttachmentsListModel;
   637             delete iAttachmentsListModel;
   664             iAttachmentsListModel = NULL;
   638             iAttachmentsListModel = NULL;
   665             iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this );
   639             iAttachmentsListModel = CFSEmailUiAttachmentsListModel::NewL( iAppUi, *this );
   666 
   640 
   667             if ( iOpenMessages->Head()== iOpenMessages->Last() )
   641             if ( iOpenMessages->Head()== iOpenMessages->Last() )
  1070                 respondStatus, *iMessage, *this );
  1044                 respondStatus, *iMessage, *this );
  1071             }
  1045             }
  1072         }
  1046         }
  1073     }
  1047     }
  1074 
  1048 
       
  1049 void CFsEmailUiHtmlViewerView::HandleStatusPaneSizeChange()
       
  1050     {
       
  1051     CFsEmailUiViewBase::HandleStatusPaneSizeChange();
       
  1052 
       
  1053 	HandleViewRectChange();
       
  1054     }
  1075 
  1055 
  1076 void CFsEmailUiHtmlViewerView::HandleViewRectChange()
  1056 void CFsEmailUiHtmlViewerView::HandleViewRectChange()
  1077     {
  1057     {
  1078     CFsEmailUiViewBase::HandleViewRectChange();
  1058     CFsEmailUiViewBase::HandleViewRectChange();
  1079 
  1059 
  2212                 UpdateMessagePtrL( mailboxId, folderId, messageId );
  2192                 UpdateMessagePtrL( mailboxId, folderId, messageId );
  2213                 reloadContent = ETrue;
  2193                 reloadContent = ETrue;
  2214                 }
  2194                 }
  2215             }
  2195             }
  2216         }
  2196         }
  2217 
  2197     if(iContainer)
  2218     if ( iContainer )
       
  2219         {
  2198         {
  2220         iContainer->HideDownloadStatus();
  2199         iContainer->HideDownloadStatus();
  2221         }
  2200         }
  2222 
       
  2223     if ( reloadContent )
  2201     if ( reloadContent )
  2224         {
  2202         {
  2225         if ( iContainer )
  2203 
  2226             {
  2204         if (  iContainer )
  2227             iContainer->ResetContent( EFalse, EFalse );
  2205             {
  2228             if ( iMessage )
  2206             iContainer->ResetContent();
  2229                 {
  2207             if( iMessage )
  2230                 LoadContentFromMailMessageL( iMessage , EFalse );
  2208                 {
       
  2209                 LoadContentFromMailMessageL( iMessage , EFalse);
  2231                 SetMskL();
  2210                 SetMskL();
  2232                 }
  2211                 }
  2233             }
  2212             }
  2234         }
  2213         }
  2235 
  2214 
  2236     if ( iAsyncProcessComplete && iWaitDialog && iDialogNotDismissed )
  2215 
       
  2216     if(iAsyncProcessComplete && iWaitDialog && iDialogNotDismissed)
  2237         {
  2217         {
  2238         iWaitDialog->ProcessFinishedL(); // deletes the dialog
  2218         iWaitDialog->ProcessFinishedL(); // deletes the dialog
  2239         }
  2219         }
       
  2220 
  2240     }
  2221     }
  2241 
  2222 
  2242 // -----------------------------------------------------------------------------
  2223 // -----------------------------------------------------------------------------
  2243 // CFsEmailUiHtmlViewerView::DialogDismissedL
  2224 // CFsEmailUiHtmlViewerView::DialogDismissedL
  2244 // -----------------------------------------------------------------------------
  2225 // -----------------------------------------------------------------------------