email/mail/ViewerSrc/MsgMailViewerRemoveAttachment.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:  E-mail attachment remove operation.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MSGMAILVIEWERREMOVEATTACMENT_H
       
    20 #define MSGMAILVIEWERREMOVEATTACMENT_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <msvapi.h> // CMsvOperation
       
    24 
       
    25 // FORWARD DECLARATIONS
       
    26 class CImPruneMessage;
       
    27 class CMsvEntry;
       
    28 class CMailMessage;
       
    29 
       
    30 /**
       
    31 *  E-mail attachment remove operation.
       
    32 */
       
    33 class CMsgMailViewerRemoveAttachmentOp :public CMsvOperation
       
    34     {
       
    35     public:  // Constructors and destructor
       
    36         /**
       
    37         * NewLC
       
    38         * @param aMsvSession Message server session
       
    39         * @param aObserverRequestStatus operation status
       
    40         * @param aAttachmentId Attachment to be removed
       
    41         * @param aMsgID message that holds the attachment
       
    42         */        
       
    43         static CMsgMailViewerRemoveAttachmentOp* NewLC(
       
    44             CMsvSession& aMsvSession, 
       
    45             TRequestStatus& aObserverRequestStatus, 
       
    46             const TMsvId aAttachmentId,
       
    47             TMsvId aMsgID);
       
    48             
       
    49         /**
       
    50         * NewL
       
    51         * @since S60 3.1
       
    52         * @param aMailMessage Mail message
       
    53         * @param aObserverRequestStatus operation status
       
    54         * @param aAttachmentId Attachment to be removed
       
    55         */        
       
    56         static CMsgMailViewerRemoveAttachmentOp* NewL(
       
    57             CMailMessage& aMailMessage, 
       
    58             TRequestStatus& aObserverRequestStatus, 
       
    59             TMsvAttachmentId aAttachmentId );            
       
    60 
       
    61         /**
       
    62         * Destructor.
       
    63         */
       
    64         ~CMsgMailViewerRemoveAttachmentOp();
       
    65        
       
    66     public: // Functions from base classes
       
    67         /// From CMsvOperation
       
    68         virtual const TDesC8& ProgressL();        
       
    69        
       
    70     protected:  // Functions from base classes
       
    71         /**
       
    72         * From CActive
       
    73         */
       
    74         void DoCancel();
       
    75 
       
    76         /**
       
    77         * From CActive
       
    78         */
       
    79         void RunL();
       
    80         
       
    81         /**
       
    82         * From CActive
       
    83         */
       
    84         TInt RunError( TInt aError );
       
    85 
       
    86         
       
    87     private:
       
    88         /**
       
    89         * C++ constructor.
       
    90         */
       
    91         CMsgMailViewerRemoveAttachmentOp(CMsvSession& aMsvSession, 
       
    92             TRequestStatus& aObserverRequestStatus,
       
    93             TMsvId aMsgID);
       
    94 
       
    95         /**
       
    96         * Symbian constructor
       
    97         * Sets operation active.
       
    98         */
       
    99         void ConstructL( const TMsvId aAttachmentId );
       
   100         void ConstructL(
       
   101             CMailMessage& aMailMessage, 
       
   102             TMsvAttachmentId aAttachmentId );
       
   103     
       
   104     private: // implementation
       
   105         
       
   106         void UpdateAttachmentStatusL();            
       
   107         void UpdateStatusL();
       
   108         void DoNextStateL();
       
   109 
       
   110    private:    // Data
       
   111         /**
       
   112         * Own: Entry which has attachment
       
   113         */
       
   114         CMsvEntry* iMsgEntry;
       
   115 
       
   116         /**
       
   117         * Own: Mail message which has attachment
       
   118         */
       
   119         CImPruneMessage* iPruneMsg;
       
   120 
       
   121         /**
       
   122         * Package buffer
       
   123         */
       
   124         TPckgBuf<TMsvLocalOperationProgress> iProgress;
       
   125         
       
   126         /**
       
   127         * Own: Mail message id
       
   128         */
       
   129         TMsvId iMsgID;
       
   130         
       
   131         /**
       
   132         * Own: Internal state of object
       
   133         */
       
   134         TInt iState;
       
   135         
       
   136         /**
       
   137         * Own: Mail message's entry
       
   138         */
       
   139         CMsvEntry* iCentry;
       
   140         
       
   141         /**
       
   142         * Own: operation to be handled
       
   143         */
       
   144         CMsvOperation* iMsvOp;
       
   145 
       
   146     };
       
   147 
       
   148 #endif      // MSGMAILEDITORREMOVEATTACMENT_H
       
   149             
       
   150 // End of File