email/imum/Mtms/Inc/ImumDisconnectOperation.h
branchRCL_3
changeset 60 7fdbb852d323
parent 0 72b543305e3a
equal deleted inserted replaced
57:ebe688cedc25 60:7fdbb852d323
       
     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 *       Very simple layer over base class just for setting up progress reporter
       
    16 *
       
    17 *
       
    18 */
       
    19 
       
    20 #ifndef __IMUMDISCONNECTOPERATION_H__
       
    21 #define __IMUMDISCONNECTOPERATION_H__
       
    22 
       
    23 #include <pop3set.h>
       
    24 #include <msvstd.h>
       
    25 #include <MsvPrgReporter.h>
       
    26 #include <ImumInternalApi.h>        // CImumInternalApi
       
    27 #include "PROGTYPE.H"
       
    28 #include "ImumOnlineOperation.h"
       
    29 #include <imapset.h>
       
    30 
       
    31 class CEikonEnv;
       
    32 class CBaseMtmUi;
       
    33 class CMsvEntrySelection;
       
    34 class MMsvProgressReporter;
       
    35 
       
    36 
       
    37 /**
       
    38 * class CImumDisconnectOperation
       
    39 *
       
    40 * Very simple layer over base class just for setting up progress reporter.
       
    41 */
       
    42 class CImumDisconnectOperation :
       
    43     public CImumOnlineOperation,
       
    44     public MMsvProgressDecoder
       
    45     {
       
    46     public:
       
    47 
       
    48         /**
       
    49         * NewL
       
    50         * @param CMsvSession&, session reference
       
    51         * @param TRequestStatus&, request status
       
    52         * @param MMsvProgressReporter&, progress reporter
       
    53         * @param TMsvId, entry id
       
    54         * @param TInt, function id
       
    55         * @param TUid, mtm type. Pop or Imap
       
    56         * @return CImumDisconnectOperation*, self pointer
       
    57         */
       
    58         static CImumDisconnectOperation* NewL(
       
    59             CImumInternalApi& aMailboxApi,
       
    60             TRequestStatus& aObserverRequestStatus,
       
    61             MMsvProgressReporter& aReporter,
       
    62             TMsvId aService,
       
    63             TInt aFunctionId,
       
    64             TUid aMtmType);
       
    65 
       
    66         /**
       
    67         * ~CImumDisconnectOperation
       
    68         * Destructor
       
    69         */
       
    70         virtual ~CImumDisconnectOperation();
       
    71 
       
    72         /**
       
    73         * GetErrorProgressL
       
    74         * @param TInt, error
       
    75         */
       
    76         virtual const TDesC8& GetErrorProgressL(TInt aError);
       
    77 
       
    78         /**
       
    79         * ProgressL
       
    80         * @return TDesC8&, progress
       
    81         */
       
    82         virtual const TDesC8& ProgressL();
       
    83 
       
    84         /**
       
    85         * DecodeProgress
       
    86         * From MMsvProgressDecoder
       
    87         * @param const TDesC8&, progress
       
    88         * @param TBuf<CBaseMtmUi::EProgressStringMaxLen>&, return string
       
    89         * @param TInt& total entry count
       
    90         * @param TInt& entries done
       
    91         * @param TInt& current entry size
       
    92         * @param TInt& current bytes trasferred
       
    93         * @param TBool, aInternal
       
    94         * @return TInt
       
    95         */
       
    96         virtual TInt DecodeProgress(
       
    97             const TDesC8& aProgress,
       
    98             TBuf<CBaseMtmUi::EProgressStringMaxLen>& aReturnString,
       
    99             TInt& aTotalEntryCount,
       
   100             TInt& aEntriesDone,
       
   101             TInt& aCurrentEntrySize,
       
   102             TInt& aCurrentBytesTrans,
       
   103             TBool aInternal );
       
   104 
       
   105     protected:
       
   106         /**
       
   107         * DoRunL
       
   108         * From CImumOnlineOperation
       
   109         */
       
   110         virtual void DoRunL();
       
   111 
       
   112     private:
       
   113         /**
       
   114         * C++ constructor
       
   115         * @param CMsvSession&, session reference
       
   116         * @param TRequestStatus&, request status
       
   117         * @param MMsvProgressReporter&, progress reporter
       
   118         * @param TMsvId, entry id
       
   119         */
       
   120         CImumDisconnectOperation(
       
   121             CImumInternalApi& aMailboxApi,
       
   122             TRequestStatus& aObserverRequestStatus,
       
   123             MMsvProgressReporter& aReporter,
       
   124             TMsvId aService);
       
   125 
       
   126         /**
       
   127         * Symbian OS constructor
       
   128         * @param TInt, function id
       
   129         * @param TUid, Mtm type. Pop or Imap
       
   130         */
       
   131         void ConstructL(TInt aFunctionId, TUid aMtmType);
       
   132 
       
   133     };
       
   134 
       
   135 #endif