email/mail/ViewerSrc/CMailForwardOperation.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  Handles Message forwarding
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CMAILFORWARDOPERATION_H
       
    21 #define CMAILFORWARDOPERATION_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32cmn.h>
       
    25 
       
    26 #include "cmailoperation.h"
       
    27 #include "MMessageLoadObserver.h"
       
    28 // FORWARD DECLARATIONS
       
    29 class CMsgMailViewerDocument;
       
    30 class MMsvProgressReporter;
       
    31 
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 *  Forward operation
       
    37 *
       
    38 *  @since S60 3.0
       
    39 */
       
    40 class CMailForwardOperation : public CMailOperation, MMessageLoadObserver
       
    41     {
       
    42     public:  // Constructors and destructor
       
    43         
       
    44         /**
       
    45         * Two-phased constructor.
       
    46         * @param aReporter UI progress reporter.
       
    47         * @param aDocument Mail viewer document.
       
    48         * @param aObserverRequestStatus completion status.
       
    49         * @parma aSuspend ETrue if operatino should be suspended.
       
    50         */
       
    51         static CMailForwardOperation* NewL(
       
    52         	MMsvProgressReporter& aReporter,
       
    53             CMsgMailViewerDocument& aDocument,
       
    54             TRequestStatus& aObserverRequestStatus,
       
    55             TBool aSetSuspend );
       
    56         
       
    57         /**
       
    58         * Destructor.
       
    59         */
       
    60         ~CMailForwardOperation();
       
    61 
       
    62     private: // Functions from base classes
       
    63 	    
       
    64 	    // From CMailOperation
       
    65 	    void SuspendL( TBool aSetSuspend );
       
    66 	    TBool CompletedL( TInt aCompletionCode );
       
    67 	    
       
    68 	    // From CMsvOperation
       
    69 	    const TDesC8& ProgressL();
       
    70 	    
       
    71 	    // From CActive
       
    72 	    void DoCancel();
       
    73         void RunL();
       
    74 	    TInt RunError( TInt aError );
       
    75 	    
       
    76 	    // From MMessageLoadObserver
       
    77 	    void MessageLoadingL( TInt aStatus, CMailMessage& aMessage );
       
    78 	                           
       
    79     private:
       
    80 
       
    81         /**
       
    82         * C++ constructor.
       
    83         */
       
    84         CMailForwardOperation( 
       
    85             CMsgMailViewerDocument& aDocument,
       
    86             TRequestStatus& aObserverRequestStatus );
       
    87 
       
    88         /**
       
    89         * By default Symbian 2nd phase constructor is private.
       
    90         */
       
    91         void ConstructL();
       
    92 
       
    93     private:  // Implementation
       
    94         void CompleteObserver( TInt aStatus );
       
    95         void ConnectToServiceL();
       
    96         void CheckAttachmentsL();
       
    97         void LoadAttachmentsL();
       
    98         void FetchAttachmentsL( 
       
    99             CMsvEntrySelection& aSelection, TInt aMaxSize );
       
   100         void FetchAttachmentsL( CMsvEntrySelection& aSelection );
       
   101         void ForwardMessageL();
       
   102         void UpdateEntryFlagsL();
       
   103         TBool NexStateL();
       
   104      //   TBool ShowDRMNotesL();    
       
   105 
       
   106     private:    // Data
       
   107         // Own: operation to complete
       
   108         CMsvOperation* iOperation;
       
   109         // Own: attachment selection
       
   110         CMsvEntrySelection* iSelection;
       
   111         // Ref: mail viewer document
       
   112         CMsgMailViewerDocument& iDocument;
       
   113         // Ref: UI progress reporter
       
   114         MMsvProgressReporter* iReporter;
       
   115         // Operation internal state
       
   116         TInt iOperationState;        
       
   117         
       
   118     };
       
   119 
       
   120 #endif      // CMAILFORWARDOPERATION_H   
       
   121             
       
   122 // End of File