email/imum/Mtms/Inc/Imap4CopyMoveLocalOp.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 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: 
       
    15 *       Copy or move a selection of messages that may or may not be complete
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef __IMAP4COPYMOVELOCALOP_H__
       
    20 #define __IMAP4COPYMOVELOCALOP_H__
       
    21 
       
    22 #include <imapset.h>
       
    23 #include <imapcmds.h>
       
    24 #include "IMAPPRGR.H"
       
    25 #include "ImumDiskSpaceObserverOperation.h"
       
    26 #include "Imap4MtmUi.hrh" // KImpuIMAPFolderNameLength
       
    27 
       
    28 /**
       
    29 * Copy or move a selection of messages that may or may not be complete.
       
    30 * Always fetches entire messages.
       
    31 */
       
    32 class CImap4CopyMoveLocalOp :
       
    33     public CImumDiskSpaceObserverOperation
       
    34     {
       
    35     public:
       
    36         /**
       
    37         *
       
    38         * @param aSession: Server session.
       
    39         * @param aStatus: Observer completion status.
       
    40         * @param aReporter: Progress reporter.
       
    41         * @param aSel: The message ids to get.
       
    42         * @param aTargetId: Where to fetch the messages to.
       
    43         * @param aCopy: Copying or moving.
       
    44         */
       
    45         static CImap4CopyMoveLocalOp* NewL(
       
    46             CImumInternalApi& aMailboxApi,
       
    47             TRequestStatus& aStatus,
       
    48             MMsvProgressReporter& aReporter,
       
    49             const CMsvEntrySelection& aSel,
       
    50             TMsvId aTargetId,
       
    51             TBool aCopy);
       
    52 
       
    53         /**
       
    54         *
       
    55         */
       
    56         virtual ~CImap4CopyMoveLocalOp();
       
    57 
       
    58         /**
       
    59         *
       
    60         */
       
    61         virtual const TDesC8& GetErrorProgressL(TInt aError);
       
    62 
       
    63     protected:
       
    64 
       
    65         /**
       
    66         *
       
    67         */
       
    68         virtual void DoRunL();
       
    69     private:
       
    70 
       
    71         /**
       
    72         * for explanation of parameters, see NewL
       
    73         */
       
    74         CImap4CopyMoveLocalOp(
       
    75             CImumInternalApi& aMailboxApi,
       
    76             TRequestStatus& aStatus,
       
    77             MMsvProgressReporter& aReporter,
       
    78             TMsvId aTargetId,
       
    79             TBool aCopy);
       
    80 
       
    81         /**
       
    82         *
       
    83         */
       
    84         void ConstructL(const CMsvEntrySelection& aSel);
       
    85 
       
    86         /**
       
    87         *
       
    88         * Sort messages into complete and incomplete.
       
    89         */
       
    90         void SortMessageSelectionL(const CMsvEntrySelection& aSel);
       
    91 
       
    92         /**
       
    93         *
       
    94         */
       
    95         void DoLocalCopyMoveL();
       
    96 
       
    97         /**
       
    98         *
       
    99         */
       
   100         void DoRemoteFetchL();
       
   101 
       
   102     private:
       
   103         enum TState { EIdle, ELocalMsgs, ERemoteMsgs };
       
   104         TState iState;
       
   105         const TBool iCopying;
       
   106         const TMsvId iTarget;
       
   107         CMsvEntrySelection* iLocalSel;      // Complete messages
       
   108         CMsvEntrySelection* iRemoteSel;     // Incomplete messages to be fetched.
       
   109         TPckgBuf<TImap4CompoundProgress> iProgressBuf;
       
   110     };
       
   111 
       
   112 
       
   113 #endif
       
   114 
       
   115 // End of File