email/mail/EditorSrc/cmsgmailrestoresuperop.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002-2007 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:  
       
    15 * 		State machine -based operation for restoring attachments and attached 
       
    16 * 		messages.
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 
       
    22 #ifndef CMSGMAILRESTORESUPEROP_H
       
    23 #define CMSGMAILRESTORESUPEROP_H
       
    24 
       
    25 //  INCLUDES
       
    26 #include "cmsgmailbaseop.h"
       
    27 
       
    28 // DATA TYPES
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CMsgMailRestoreAttMsgsOp;
       
    32 class CMsgMailRestoreAttasOp;
       
    33 
       
    34 // CLASS DECLARATION
       
    35 /**
       
    36 * State machine -based operation for restoring attachments and attached 
       
    37 * messages. Utilizes CMsgMailRestoreAttasOp and CMsgMailRestoreAttMsgsOp.
       
    38 */
       
    39 NONSHARABLE_CLASS( CMsgMailRestoreSuperOp ) : public CMsgMailBaseOp
       
    40     {
       
    41     protected:
       
    42     
       
    43         enum TLaunchState
       
    44             {
       
    45             ERestoreAttachments = EFirstFreeState, // restore attachments
       
    46             ERestoreAttachedMsgs, // restore attached messages
       
    47             };
       
    48     
       
    49     public:  // Constructors and destructor
       
    50     
       
    51         /**
       
    52         * Two-phased constructor.
       
    53         * @param aDocument Editor's document
       
    54         */
       
    55         static CMsgMailRestoreSuperOp* NewL(
       
    56             CMsgMailEditorDocument& aDocument );
       
    57 
       
    58         /**
       
    59         * Destructor. Cancels operation.
       
    60         */
       
    61         virtual ~CMsgMailRestoreSuperOp();
       
    62         
       
    63     public: // API
       
    64     
       
    65         /**
       
    66         * Method to show a proper note if there was one or more invalid
       
    67         * attachments or attached messages.
       
    68         * @return ETrue if there was reason to show a note
       
    69         */
       
    70         TBool ShowNoteIfInvalidAttaL() const;
       
    71         
       
    72         /**
       
    73         * Method to show a proper note if there was one or more DRM restricted
       
    74         * attachments that were removed from attachment list.
       
    75         * @return ETrue if there was reason to show a note
       
    76         */
       
    77         TBool ShowNoteIfDRMAttaL() const;    
       
    78 
       
    79     protected: // from CMsgMailBaseOp
       
    80     
       
    81         void SetNextState();
       
    82         
       
    83         void HandleStateActionL();
       
    84         
       
    85         void HandleOperationCancel();
       
    86         
       
    87     private:  // Implementation
       
    88         
       
    89         void RestoreAttachmentsL();
       
    90         
       
    91         void RestoreAttachedMsgsL();
       
    92 
       
    93     private:
       
    94     
       
    95         /**
       
    96         * Constructor.
       
    97         * @param aDocument Editor's document       
       
    98         */
       
    99         CMsgMailRestoreSuperOp( CMsgMailEditorDocument& aDocument );
       
   100 
       
   101         /**
       
   102         * By default Symbian 2nd phase constructor is private.
       
   103         */
       
   104         void ConstructL();
       
   105         
       
   106     private:
       
   107 
       
   108         // Operation for adding attached messages, own
       
   109         CMsgMailRestoreAttMsgsOp* iRestoreAttMsgsOp;
       
   110         
       
   111         // Operation for adding attachments, own
       
   112         CMsgMailRestoreAttasOp* iRestoreAttasOp;          
       
   113     };
       
   114 
       
   115 #endif      // CMSGMAILRESTORESUPEROP_H
       
   116 
       
   117 // End of File