email/mail/ViewerSrc/MsgMailViewerDocument.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  Declares document for application.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef MSGMAILVIEWERDOCUMENT_H
       
    19 #define MSGMAILVIEWERDOCUMENT_H
       
    20 
       
    21 // INCLUDES
       
    22 #include "MsgMailDocument.h"
       
    23 #include <cmsvattachment.h>
       
    24 
       
    25 // CONSTANTS
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class  CEikAppUi;
       
    29 class MsgMailDRMHandler;
       
    30 class CSendUi;
       
    31 class CMailOperation;
       
    32 class MMsvProgressReporter;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 
       
    36 /**
       
    37 *  CMsgMailViewerDocument application class.
       
    38 */
       
    39 class CMsgMailViewerDocument : public CMsgMailDocument
       
    40     {
       
    41     public: // Constructors and destructor
       
    42         /**
       
    43         * Two-phased constructor.
       
    44         */
       
    45         static CMsgMailViewerDocument* NewL(CEikApplication& aApp);
       
    46 
       
    47         /**
       
    48         * Destructor.
       
    49         */
       
    50         virtual ~CMsgMailViewerDocument();
       
    51 
       
    52     public: // New functions
       
    53     	/**
       
    54     	* Add Attachment to viewer attachment model.
       
    55     	* @param aAttachmentInfo attachment info.
       
    56     	* @param aCanBeRemoved ETrue if attachment can be removed
       
    57     	* via attachment view.
       
    58     	*/
       
    59     	void AddAttachmentL( 
       
    60     		CMsvAttachment& aAttachmentInfo, 
       
    61     		TBool aCanBeRemoved );
       
    62         
       
    63         /**
       
    64         * CanSaveFileL
       
    65         * @since Series 60 3.0        
       
    66         * @param aDataType type to be checked.
       
    67         * @return ETrue if system can save attachments with this mime type.
       
    68         */      	
       
    69     	TBool CanSaveFileL( TDataType aDataType );
       
    70     
       
    71         /// Returns character set
       
    72         TUint Charset() const;
       
    73         
       
    74         /**
       
    75         * DeleteMessageL
       
    76         * @since Series 60 3.0        
       
    77 		* Delete message from server.
       
    78 		* @return ETrue if operation was cancelled.
       
    79         */          
       
    80         TBool DeleteMessageL();
       
    81         
       
    82         /**
       
    83         * FetchAttachmentL
       
    84         * @since Series 60 3.0        
       
    85         * @param aSelection attachments to be fetched.
       
    86         * @param aCompletionStatus operation completion status.
       
    87         * @return CMsvOperation
       
    88         */          
       
    89         CMsvOperation* FetchAttachmentL( 
       
    90             CMsvEntrySelection& aSelection, 
       
    91             TRequestStatus& aCompletionStatus );
       
    92         
       
    93         /**
       
    94         * FetchAttachmentL
       
    95         * @since Series 60 3.0        
       
    96         * @param aSelection attachments to be fetched.
       
    97         * Operation is not completed immediately when this method returns.
       
    98         */         
       
    99         void FetchAttachmentL( CMsvEntrySelection& aSelection );
       
   100 
       
   101         /**
       
   102         * FetchAttachmentL
       
   103         * @since Series 60 3.0        
       
   104         * @param aAttachmentId attachment id.
       
   105         * Operation is not completed immediately when this method returns.        
       
   106         */         
       
   107         void FetchAttachmentL( TMsvAttachmentId aAttachmentId );
       
   108 
       
   109         /**
       
   110         * RemoveAttachmentL
       
   111         * @since Series 60 3.0 
       
   112         * @param aAttachmentId attachment id.
       
   113         */         
       
   114         void RemoveAttachmentL( TMsvAttachmentId aAttachmentId );
       
   115         
       
   116         /// Sets character set.
       
   117         void SetCharSet(const TUint aCharSet);
       
   118 
       
   119         /**
       
   120         * Check connection status.
       
   121         * @return ETrue if connected.
       
   122         **/
       
   123         TBool IsOnLineL() const;
       
   124         
       
   125         /**
       
   126         * RetrieveMessageL
       
   127         * @since Series 60 3.0
       
   128         * Retrieves current mail message from the server.
       
   129         */          
       
   130         void RetrieveMessageL();
       
   131         
       
   132         /**
       
   133         * SendUiL
       
   134         * Returns Send UI instance.
       
   135         * @since Series 60 3.0        
       
   136         */         
       
   137         CSendUi& SendUiL();
       
   138         
       
   139         /**
       
   140         * ShowMessageInfoL
       
   141         * Opens message info popup
       
   142         * @since Series 60 3.0        
       
   143         */         
       
   144         void ShowMessageInfoL();
       
   145                
       
   146         /**
       
   147         * OpenMessageEntryL
       
   148         * @since Series 60 3.0        
       
   149         * Opens entry if it is a message.
       
   150         * @param aEntryId message entry id.
       
   151         * @return ETrue if entry was opened.
       
   152         */      	
       
   153     	TBool OpenMessageEntryL( TMsvId aEntryId );
       
   154 		        
       
   155         /**
       
   156         * @return mail message
       
   157         */
       
   158         CMailMessage& MailMessage();
       
   159         
       
   160         /**
       
   161         * MoveRemoteEntryL
       
   162         * Moves remote messages.
       
   163         * @since Series 60 3.0        
       
   164         */          
       
   165         void MoveRemoteEntryL( 
       
   166         	TMsvId aTo, 
       
   167         	TMsvId aService, 
       
   168         	TBool aDestinationIsRemote );
       
   169         
       
   170         /**
       
   171         * UpdateAttachmentModelFromMessageL
       
   172         * Updates attachment model.
       
   173         * @since Series 60 3.0        
       
   174         */         	
       
   175         void UpdateAttachmentModelFromMessageL();
       
   176         
       
   177         /**
       
   178         * ForwardMailMessageL
       
   179         * @param aReporter operation UI progress reporter.
       
   180         * @param aStatus operation status.
       
   181         * @param aSetSuspend ETrue if operation should be suspended.        
       
   182         * @return CMailOperation        
       
   183         * @since Series 60 3.1        
       
   184         */         	        
       
   185         CMailOperation* ForwardMailMessageL( 
       
   186             MMsvProgressReporter& aReporter,
       
   187             TRequestStatus& aStatus, 
       
   188             TBool aSetSuspend );
       
   189 
       
   190     private: // implementation
       
   191 
       
   192         CMsgMailViewerDocument(CEikApplication& aApp);
       
   193         void ConstructL();
       
   194         void DoInitDRMHandlerL();
       
   195 
       
   196     private:
       
   197 
       
   198 		/// From CEikDocument, create CMsgMailViewerAppUi "App UI" object.
       
   199         CEikAppUi* CreateAppUiL();
       
   200         
       
   201         /// From MMsgAttachmentModelObserver
       
   202         void NotifyChanges(TMsgAttachmentCommand aCommand, 
       
   203             CMsgAttachmentInfo* aAttachmentInfo );
       
   204 		/// From MMsgAttachmentModelObserver
       
   205 		RFile GetAttachmentFileL( TMsvAttachmentId aId );
       
   206 		
       
   207 		// From CMsgEditorDocument
       
   208 		void EntryChangedL();	
       
   209 		
       
   210     private: // Member data
       
   211         /**
       
   212         * Character set used for the message.
       
   213         */
       
   214         TUint iCharSet;
       
   215         		
       
   216 		// Own DRM handler
       
   217 		MsgMailDRMHandler* iDRMHandler;
       
   218         
       
   219         /**
       
   220         * Own: Pointer to Send UI object
       
   221         */
       
   222         CSendUi* iSendUi;
       
   223     };
       
   224 
       
   225 #include "MsgMailViewerDocument.inl"
       
   226 
       
   227 #endif
       
   228 
       
   229 // End of File
       
   230