emailuis/emailui/inc/FreestyleEmailUiHtmlViewerView.h
branchRCL_3
changeset 22 d620048b4810
parent 20 efd4f1afd43e
child 23 dcf0eedfc1a3
equal deleted inserted replaced
20:efd4f1afd43e 22:d620048b4810
    54     	public MESMRIcalViewerObserver
    54     	public MESMRIcalViewerObserver
    55     {
    55     {
    56 public:
    56 public:
    57 
    57 
    58     /** Two-phased constructor. */
    58     /** Two-phased constructor. */
    59     static CFsEmailUiHtmlViewerView* NewL( CAlfEnv& aEnv, 
    59     static CFsEmailUiHtmlViewerView* NewL( CAlfEnv& aEnv,
    60                                            CFreestyleEmailUiAppUi& aAppUi,
    60                                            CFreestyleEmailUiAppUi& aAppUi,
    61                                            CAlfControlGroup& aControlGroup );
    61                                            CAlfControlGroup& aControlGroup );
    62 
    62 
    63     /** Destructor. */
    63     /** Destructor. */
    64     ~CFsEmailUiHtmlViewerView();
    64     ~CFsEmailUiHtmlViewerView();
    70     * @return Id Uid value
    70     * @return Id Uid value
    71     */
    71     */
    72     TUid Id() const;
    72     TUid Id() const;
    73 
    73 
    74     void HandleStatusPaneSizeChange();
    74     void HandleStatusPaneSizeChange();
    75     
    75 
    76     void HandleViewRectChange();
    76     void HandleViewRectChange();
    77     
    77 
    78     /**
    78     /**
    79     * HandleCommandL
    79     * HandleCommandL
    80     * From CAknView, takes care of command handling.
    80     * From CAknView, takes care of command handling.
    81     * @param aCommand Command to be handled
    81     * @param aCommand Command to be handled
    82     */
    82     */
    83     void HandleCommandL( TInt aCommand );
    83     void HandleCommandL( TInt aCommand );
    84     
    84 
    85     // Handle accept/decline/tentative/remove commands given for meeting request message directly from list UI.
    85     // Handle accept/decline/tentative/remove commands given for meeting request message directly from list UI.
    86 	void HandleMrCommandL( TInt aCommandId, TFSMailMsgId aMailboxId, TFSMailMsgId aFolderId, TFSMailMsgId aMessageId );
    86 	void HandleMrCommandL( TInt aCommandId, TFSMailMsgId aMailboxId, TFSMailMsgId aFolderId, TFSMailMsgId aMessageId );
    87     
    87 
    88 	void CompletePendingMrCommand();
    88 	void CompletePendingMrCommand();
    89 	void CancelPendingMrCommandL();
    89 	void CancelPendingMrCommandL();
    90 	
    90 
    91     /**
    91     /**
    92     * ChildDoDeactivate
    92     * ChildDoDeactivate
    93     * From CFsEmailUiViewBase, deactivate the AknView
    93     * From CFsEmailUiViewBase, deactivate the AknView
    94     * Remove the container class instance from the App UI's stack and
    94     * Remove the container class instance from the App UI's stack and
    95     * deletes the instance
    95     * deletes the instance
   104 
   104 
   105     void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
   105     void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane );
   106 
   106 
   107     void SetMskL();
   107     void SetMskL();
   108     void PrepareForExit();
   108     void PrepareForExit();
   109     
   109 
   110 public : // for MFSMailRequestObserver
   110 public : // for MFSMailRequestObserver
   111     void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
   111     void RequestResponseL( TFSProgress aEvent, TInt aRequestId );
   112     
   112 
   113 public: 
   113 public:
   114     // from MProgressDialogCallback
   114     // from MProgressDialogCallback
   115     void DialogDismissedL( TInt aButtonId);
   115     void DialogDismissedL( TInt aButtonId);
   116     
   116 
   117     CFSMailMessage* CurrentMessage();
   117     CFSMailMessage* CurrentMessage();
   118     CFSEmailUiAttachmentsListModel* CurrentAttachmentsListModel();
   118     CFSEmailUiAttachmentsListModel* CurrentAttachmentsListModel();
   119     
   119 
   120     // Return view area that can be used for container
   120     // Return view area that can be used for container
   121     TRect ContainerRect() const;
   121     TRect ContainerRect() const;
   122 
   122 
   123 public: 
   123 public:
   124     void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType );
   124     void HandleDynamicVariantSwitchL( CFsEmailUiViewBase::TDynamicSwitchType aType );
   125     void HandleMailBoxEventL( TFSMailEvent aEvent,
   125     void HandleMailBoxEventL( TFSMailEvent aEvent,
   126                               TFSMailMsgId aMailbox, TAny* aParam1, TAny* /*aParam2*/, TAny* /*aParam3*/ );
   126                               TFSMailMsgId aMailbox, TAny* aParam1, TAny* /*aParam2*/, TAny* /*aParam3*/ );
   127     
   127 
   128     void HandleEmailAddressCommandL( TInt aCommand, const TDesC& aEmailAddress ); 
   128     void HandleEmailAddressCommandL( TInt aCommand, const TDesC& aEmailAddress );
   129     void HandleWebAddressCommandL( TInt aCommand, const TDesC& aUrl );
   129     void HandleWebAddressCommandL( TInt aCommand, const TDesC& aUrl );
   130     
   130 
   131     void DownloadAttachmentL( const TAttachmentData& aAttachment );
   131     void DownloadAttachmentL( const TAttachmentData& aAttachment );
   132     void DownloadAllAttachmentsL();
   132     void DownloadAllAttachmentsL();
   133     void CancelAttachmentL( const TAttachmentData& aAttachment );    
   133     void CancelAttachmentL( const TAttachmentData& aAttachment );
   134     void CancelAllAttachmentsL();    
   134     void CancelAllAttachmentsL();
   135     void OpenAttachmentL( const TAttachmentData& aAttachment );
   135     void OpenAttachmentL( const TAttachmentData& aAttachment );
   136     void SaveAttachmentL( const TAttachmentData& aAttachment );
   136     void SaveAttachmentL( const TAttachmentData& aAttachment );
   137     void SaveAllAttachmentsL();
   137     void SaveAllAttachmentsL();
   138     void RemoveAttachmentContentL( const TAttachmentData& aAttachment );
   138     void RemoveAttachmentContentL( const TAttachmentData& aAttachment );
   139     void OpenAttachmentsListViewL();
   139     void OpenAttachmentsListViewL();
   140     TBool IsEmbeddedMsgView();
   140     TBool IsEmbeddedMsgView();
   141     TBool IsEmbeddedMsgSavingAllowed();
   141     TBool IsEmbeddedMsgSavingAllowed();
   142     // Helper funcitons to get viewed message ID and Folder id
   142     // Helper funcitons to get viewed message ID and Folder id
   143     TFSMailMsgId ViewedMessageFolderId();
   143     TFSMailMsgId ViewedMessageFolderId();
   144     TFSMailMsgId ViewedMessageId(); 
   144     TFSMailMsgId ViewedMessageId();
   145     
   145 
   146     TBool GetAsyncFetchStatus();
   146     TBool GetAsyncFetchStatus();
   147     void StartFetchingMessageL();
   147     void StartFetchingMessageL();
   148     void ReloadPageL();
   148     void ReloadPageL();
   149 public: // from MFSEmailUiContactHandlerObserver
   149 public: // from MFSEmailUiContactHandlerObserver
   150     void OperationCompleteL( TContactHandlerCmd aCmd,
   150     void OperationCompleteL( TContactHandlerCmd aCmd,
   152     void OperationErrorL( TContactHandlerCmd, TInt aError );
   152     void OperationErrorL( TContactHandlerCmd, TInt aError );
   153     TBool IsRemoteLookupSupportedL();
   153     TBool IsRemoteLookupSupportedL();
   154 
   154 
   155 public : // from MFSEmailDownloadInformationObserver
   155 public : // from MFSEmailDownloadInformationObserver
   156     void RequestResponseL( const TFSProgress& aEvent, const TPartData& aPart );
   156     void RequestResponseL( const TFSProgress& aEvent, const TPartData& aPart );
   157     
   157 
   158 public: // from MFSEmailUiAttachmentsStatusObserver
   158 public: // from MFSEmailUiAttachmentsStatusObserver
   159     void DownloadStatusChangedL( TInt aIndex );
   159     void DownloadStatusChangedL( TInt aIndex );
   160     
   160 
   161 public: // from MESMRIcalViewerCallback
   161 public: // from MESMRIcalViewerCallback
   162     void ProcessAsyncCommandL( TESMRIcalViewerOperationType aCommandId,	const CFSMailMessage& aMessage, MESMRIcalViewerObserver* aObserver = NULL );   
   162     void ProcessAsyncCommandL( TESMRIcalViewerOperationType aCommandId,	const CFSMailMessage& aMessage, MESMRIcalViewerObserver* aObserver = NULL );
   163 	  void ProcessSyncCommandL( TESMRIcalViewerOperationType aCommandId, const CFSMailMessage& aMessage );   
   163 	  void ProcessSyncCommandL( TESMRIcalViewerOperationType aCommandId, const CFSMailMessage& aMessage );
   164     TBool CanProcessCommand( TESMRIcalViewerOperationType aCommandId  ) const;  
   164     TBool CanProcessCommand( TESMRIcalViewerOperationType aCommandId  ) const;
   165      
   165 
   166 public: // from MESMRIcalViewerObserver
   166 public: // from MESMRIcalViewerObserver
   167     void OperationCompleted( TIcalViewerOperationResult aResult );        
   167     void OperationCompleted( TIcalViewerOperationResult aResult );
   168     void OperationError( TIcalViewerOperationResult aResult );
   168     void OperationError( TIcalViewerOperationResult aResult );
   169 	
   169 
   170     void FadeOut(TBool aDirectionOut);
   170     void FadeOut(TBool aDirectionOut);
   171     
   171 
   172 private: // from
   172 private: // from
   173     /**
   173     /**
   174      * @see CFsEmailUiViewBase::ChildDoActivateL
   174      * @see CFsEmailUiViewBase::ChildDoActivateL
   175      */
   175      */
   176     void ChildDoActivateL( const TVwsViewId& aPrevViewId,
   176     void ChildDoActivateL( const TVwsViewId& aPrevViewId,
   177                            TUid aCustomMessageId,
   177                            TUid aCustomMessageId,
   178                            const TDesC8& aCustomMessage );
   178                            const TDesC8& aCustomMessage );
   179 
   179 
   180     /**
   180     /**
   181      * @see CFsEmailUiViewBase::ToolbarResourceId
   181      * @see CFsEmailUiViewBase::NavigateBackL
   182      */
   182      */
   183     TInt ToolbarResourceId() const;
   183     void NavigateBackL();
   184     
   184 
   185     /**
   185     /**
   186      * @see CFsEmailUiViewBase::GetInitiallyDimmedItemsL
   186      * @see CFsEmailUiViewBase::ChangeMskCommandL
   187      */
   187      */
   188     virtual void GetInitiallyDimmedItemsL( const TInt aResourceId,
   188     void ChangeMskCommandL( TInt aLabelResourceId );
   189                 RArray<TInt>& aDimmedItems ) const;
   189 
   190 
   190     /**
   191     /**
   191      * @see CFsEmailUiViewBase::IsStatusPaneVisible
   192      * @see CFsEmailUiViewBase::OfferToolbarEventL
       
   193      */
   192      */
   194     void OfferToolbarEventL( TInt aCommand );
   193     TBool IsStatusPaneVisible() const;
   195   
   194 
   196     /**
       
   197      * @see CFsEmailUiViewBase::NavigateBackL
       
   198      */ 
       
   199     void NavigateBackL();
       
   200     
       
   201     /**
   195     /**
   202 	 * @see CFsEmailUiViewBase::SetStatusBarLayout
   196 	 * @see CFsEmailUiViewBase::SetStatusBarLayout
   203 	 */ 
   197 	 */
   204     void SetStatusBarLayout();
   198     void SetStatusBarLayout();
       
   199 
   205 private: // New functions
   200 private: // New functions
       
   201 
   206     // list of different types of content
   202     // list of different types of content
   207     enum TFetchedType
   203     enum TFetchedType
   208         {
   204         {
   209         EMessagePlainTextBodyPart = 0,
   205         EMessagePlainTextBodyPart = 0,
   210         EMessageHtmlBodyPart,
   206         EMessageHtmlBodyPart,
   227     //new functions for support of HTML viewer
   223     //new functions for support of HTML viewer
   228     void CallAdressL( const TDesC& aEmailAddress, TBool aVideoCall );
   224     void CallAdressL( const TDesC& aEmailAddress, TBool aVideoCall );
   229     void OpenContactDetailsL( const TDesC& aEmailAddress );
   225     void OpenContactDetailsL( const TDesC& aEmailAddress );
   230     void LaunchRemoteLookupL( const TDesC& aEmailAddress );
   226     void LaunchRemoteLookupL( const TDesC& aEmailAddress );
   231     void CreateMessageL( const TDesC& aEmailAddress );
   227     void CreateMessageL( const TDesC& aEmailAddress );
   232     
   228 
   233     void UpdateDownloadIndicatorL( const TPartData& aPart, 
   229     void UpdateDownloadIndicatorL( const TPartData& aPart,
   234                                    const TFSProgress& aEvent );
   230                                    const TFSProgress& aEvent );
   235     //fetching related API
   231     //fetching related API
   236     TBool MessagePartFullyFetchedL( TFetchedType aFetchedContentType ) const;
   232     TBool MessagePartFullyFetchedL( TFetchedType aFetchedContentType ) const;
   237     void StartFetchingMessagePartL( CFSMailMessage& aMessagePtr,
   233     void StartFetchingMessagePartL( CFSMailMessage& aMessagePtr,
   238                                                 TFetchedType aFetchedContentType );
   234                                                 TFetchedType aFetchedContentType );
   257     void SendEventToAppUiL( TFSMailEvent aEventType );
   253     void SendEventToAppUiL( TFSMailEvent aEventType );
   258     // Message is moved and viewer is closed asynchronously after selecting a folder
   254     // Message is moved and viewer is closed asynchronously after selecting a folder
   259       // from the move to folder dialog. This is necessary because view swithching is asynchronous.
   255       // from the move to folder dialog. This is necessary because view swithching is asynchronous.
   260     static TInt MoveToFolderAndExitL( TAny* aMailViewerVisualiser );
   256     static TInt MoveToFolderAndExitL( TAny* aMailViewerVisualiser );
   261     void FolderSelectedL( TFSMailMsgId aSelectedFolderId,
   257     void FolderSelectedL( TFSMailMsgId aSelectedFolderId,
   262                           TFSEmailUiCtrlBarResponse aResponse ); 
   258                           TFSEmailUiCtrlBarResponse aResponse );
   263     
   259 
   264     void UpdateEmailHeaderIndicators();
   260     void UpdateEmailHeaderIndicators();
   265     TBool IsOpenedInMRViewerL();
   261     TBool IsOpenedInMRViewerL();
   266     void CopyCurrentToClipBoardL( const TDesC& aArgument) const;
   262     void CopyCurrentToClipBoardL( const TDesC& aArgument) const;
   267     void OpenLinkInBrowserL( const TDesC& aUrl) const;
   263     void OpenLinkInBrowserL( const TDesC& aUrl) const;
   268     void SaveWebAddressToFavouritesL( const TDesC& aUrl ) const;
   264     void SaveWebAddressToFavouritesL( const TDesC& aUrl ) const;
   269     void SetScrollPosition(TInt aPosition);
   265     void SetScrollPosition(TInt aPosition);
   270     
   266 
   271     void CheckMessageBodyL( CFSMailMessage& aMessage, TBool& aMessageBodyStructurePresent, TBool& aMessageBodyContentPresent);
   267     void CheckMessageBodyL( CFSMailMessage& aMessage, TBool& aMessageBodyStructurePresent, TBool& aMessageBodyContentPresent);
   272     
   268 
   273 private: // Constructors
   269 private: // Constructors
   274     
   270 
   275     void ConstructL();
   271     void ConstructL();
   276     CFsEmailUiHtmlViewerView( CAlfEnv& aEnv, 
   272     CFsEmailUiHtmlViewerView( CAlfEnv& aEnv,
   277                               CFreestyleEmailUiAppUi& aAppUi, 
   273                               CFreestyleEmailUiAppUi& aAppUi,
   278                               CAlfControlGroup& aControlGroup );
   274                               CAlfControlGroup& aControlGroup );
   279 
   275 
   280 private:
   276 private:
   281     CAlfEnv& iEnv;
   277     CAlfEnv& iEnv;
   282     CFsEmailUiHtmlViewerContainer* iContainer;
   278     CFsEmailUiHtmlViewerContainer* iContainer;
   283     CFSMailMessage* iMessage;
   279     CFSMailMessage* iMessage;
   284     THtmlViewerActivationData iActivationData;
   280     THtmlViewerActivationData iActivationData;
   285     CFSEmailUiAttachmentsListModel* iAttachmentsListModel;
   281     CFSEmailUiAttachmentsListModel* iAttachmentsListModel;
   286 
   282 
   287     // Stack of open messages. Messages are owned by this stack. 
   283     // Stack of open messages. Messages are owned by this stack.
   288     CStack<CFSMailMessage, ETrue>* iOpenMessages;
   284     CStack<CFSMailMessage, ETrue>* iOpenMessages;
   289     // Stack of embedded messages. Message are NOT owned by this stack. Similar to iOpenMessages
   285     // Stack of embedded messages. Message are NOT owned by this stack. Similar to iOpenMessages
   290     // but has NULL pointer in slots which correspond non-embedded messages.
   286     // but has NULL pointer in slots which correspond non-embedded messages.
   291     CStack<CFSMailMessage, EFalse>* iEmbeddedMessages;
   287     CStack<CFSMailMessage, EFalse>* iEmbeddedMessages;
   292     TBool iCreateNewMsgFromEmbeddedMsg;
   288     TBool iCreateNewMsgFromEmbeddedMsg;
   293         
   289 
   294     // <cmail>
   290     // <cmail>
   295     // Temporary mail address for opening editor
   291     // Temporary mail address for opening editor
   296     CFSMailAddress* iNewMailTempAddress;
   292     CFSMailAddress* iNewMailTempAddress;
   297     // </cmail>
   293     // </cmail>
   298     CFSMailBox* iMailBox;
   294     CFSMailBox* iMailBox;
   325     TBool iAsyncProcessComplete;
   321     TBool iAsyncProcessComplete;
   326     CActiveSchedulerWait iWait;
   322     CActiveSchedulerWait iWait;
   327 	TBool iMoveToFolderOngoing;
   323 	TBool iMoveToFolderOngoing;
   328     TBool iMovingMeetingRequest;
   324     TBool iMovingMeetingRequest;
   329     CAsyncCallBack* iAsyncCallback;
   325     CAsyncCallBack* iAsyncCallback;
   330     
   326 
   331     TFSMailMsgId iMoveDestinationFolder;  
   327     TFSMailMsgId iMoveDestinationFolder;
   332     	// Meeting request observer stuff.
   328     	// Meeting request observer stuff.
   333 		// Pointer to observer to inform, not owned.
   329 		// Pointer to observer to inform, not owned.
   334 		MESMRIcalViewerObserver* iMrObserverToInform;
   330 		MESMRIcalViewerObserver* iMrObserverToInform;
   335 		MESMRIcalViewerObserver::TIcalViewerOperationResult iOpResult;
   331 		MESMRIcalViewerObserver::TIcalViewerOperationResult iOpResult;
   336 		TBool iMrUiActive;
   332 		TBool iMrUiActive;
   337 	  //<cmail>
   333 	  //<cmail>
   338     // Message pointer to a deleted mail from Mrui
   334     // Message pointer to a deleted mail from Mrui
   339     TFSMailMsgId iDeletedMessageFromMrui;
   335     TFSMailMsgId iDeletedMessageFromMrui;
   340     // Flag selection handler active object for global note
   336     // Flag selection handler active object for global note
   341     CFlagSelectionNoteHandler* iFlagSelectionHandler;  
   337     CFlagSelectionNoteHandler* iFlagSelectionHandler;
   342     TBool iNextOrPrevMessageSelected;
   338     TBool iNextOrPrevMessageSelected;
   343     TBool iMessageIsDeleted;
   339     TBool iMessageIsDeleted;
   344     
   340 
   345     // Id of last deleted message
   341     // Id of last deleted message
   346     TFSMailMsgId iLastDeletedMessageID;
   342     TFSMailMsgId iLastDeletedMessageID;
   347     };
   343     };
   348 
   344 
   349 ////////////////////////////////////////
   345 ////////////////////////////////////////
   352 class CFlagSelectionNoteHandler : public CActive
   348 class CFlagSelectionNoteHandler : public CActive
   353     {
   349     {
   354     public:  // Constructors and destructor
   350     public:  // Constructors and destructor
   355         static CFlagSelectionNoteHandler* NewL( CFsEmailUiHtmlViewerView& aViewerVisualiser );
   351         static CFlagSelectionNoteHandler* NewL( CFsEmailUiHtmlViewerView& aViewerVisualiser );
   356         virtual ~CFlagSelectionNoteHandler();
   352         virtual ~CFlagSelectionNoteHandler();
   357         void Cancel();       
   353         void Cancel();
   358         void LaunchFlagListQueryDialogL();       
   354         void LaunchFlagListQueryDialogL();
   359             
   355 
   360     private: 
   356     private:
   361     
   357 
   362         void RunL();       
   358         void RunL();
   363         void DoCancel();       
   359         void DoCancel();
   364         TInt RunError( TInt aError );
   360         TInt RunError( TInt aError );
   365         
   361 
   366     private:
   362     private:
   367         CFlagSelectionNoteHandler(  CFsEmailUiHtmlViewerView& aVoIPDialogObserver );
   363         CFlagSelectionNoteHandler(  CFsEmailUiHtmlViewerView& aVoIPDialogObserver );
   368 
   364 
   369         
   365 
   370     private:      
   366     private:
   371         CFsEmailUiHtmlViewerView& iViewerView;
   367         CFsEmailUiHtmlViewerView& iViewerView;
   372         CAknGlobalListQuery* iGlobalFlagQuery;
   368         CAknGlobalListQuery* iGlobalFlagQuery;
   373         HBufC* iPrompt;
   369         HBufC* iPrompt;
   374         TInt iSelection;
   370         TInt iSelection;
   375     };
   371     };