email/imum/Mtms/Inc/Imap4FetchOp.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 *       Populate a selection of incomplete remote messages
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef __IMAP4FETCHOP_H__
       
    20 #define __IMAP4FETCHOP_H__
       
    21 
       
    22 #include <imapset.h>
       
    23 #include <imapcmds.h>
       
    24 #include "IMAPPRGR.H"
       
    25 #include "ImumOnlineOperation.h"
       
    26 #include "Imap4ConnectedOp.h"
       
    27 #include "Imap4MtmUi.hrh" // KImpuIMAPFolderNameLength
       
    28 
       
    29 
       
    30 /**
       
    31 * Populate a selection of incomplete remote messages.
       
    32 * Uses the IMAP4 Client MTM 'Get Mail API'
       
    33 */
       
    34 class CImap4FetchOp : public CImap4ConnectedOp
       
    35     {
       
    36     public:
       
    37         /**
       
    38         *
       
    39         * @param aSession, Reference to MsvServer Session
       
    40         * @param aStatus, Status for Active Scheduler
       
    41         * @param aReporter,
       
    42         * @param aServiceId,
       
    43         * @param aFunctionId, Function id to be used for mail fetching
       
    44         * @param TImImap4GetMailInfo, Fetching settings
       
    45         * @param aSel,
       
    46         * @return, Constructed object
       
    47         */
       
    48         static CImap4FetchOp* NewL(
       
    49             CImumInternalApi& aMailboxApi,
       
    50             TRequestStatus& aObserverRequestStatus,
       
    51             MMsvProgressReporter& aReporter,
       
    52             TMsvId aService,
       
    53             TInt aFunctionId,
       
    54             const TImImap4GetMailInfo& aGetMailInfo,
       
    55             const CMsvEntrySelection& aSel );
       
    56 
       
    57         /**
       
    58         *
       
    59         * @since S60 3.0
       
    60         * @param aSession, Reference to MsvServer Session
       
    61         * @param aStatus, Status for Active Scheduler
       
    62         * @param aReporter,
       
    63         * @param aServiceId,
       
    64         * @param aFunctionId, Function id to be used for mail fetching
       
    65         * @param aPartialGetMailInfo, Fetching settings
       
    66         * @param aSel,
       
    67         */
       
    68         static CImap4FetchOp* NewL(
       
    69             CImumInternalApi& aMailboxApi,
       
    70             TRequestStatus& aObserverRequestStatus,
       
    71             MMsvProgressReporter& aReporter,
       
    72             TMsvId aService,
       
    73             TInt aFunctionId,
       
    74             const TImImap4GetPartialMailInfo& aGetMailInfo,
       
    75             const CMsvEntrySelection& aSel );
       
    76 
       
    77         /**
       
    78         *
       
    79         */
       
    80         virtual ~CImap4FetchOp();
       
    81     protected:
       
    82 
       
    83         /**
       
    84         *
       
    85         */
       
    86         virtual void DoConnectedOpL();
       
    87 
       
    88         /**
       
    89         *
       
    90         */
       
    91         virtual const TDesC8& ConnectedOpErrorProgressL( TInt aError );
       
    92 
       
    93     private: // Constructors
       
    94 
       
    95         /**
       
    96         *
       
    97         */
       
    98         CImap4FetchOp(
       
    99             CImumInternalApi& aMailboxApi,
       
   100             TRequestStatus& aStatus,
       
   101             MMsvProgressReporter& aReporter,
       
   102             TMsvId aServiceId,
       
   103             TInt aFunctionId,
       
   104             const TImImap4GetMailInfo& aGetMailInfo );
       
   105 
       
   106         /**
       
   107         * Constructor
       
   108         * @since S60 3.0
       
   109         */
       
   110         CImap4FetchOp(
       
   111             CImumInternalApi& aMailboxApi,
       
   112             TRequestStatus& aStatus,
       
   113             MMsvProgressReporter& aReporter,
       
   114             TMsvId aServiceId,
       
   115             TInt aFunctionId,
       
   116             const TImImap4GetPartialMailInfo& aPartialGetMailInfo );
       
   117 
       
   118         /**
       
   119         *
       
   120         */
       
   121         void ConstructL(const CMsvEntrySelection& aSel);
       
   122 
       
   123         private: // New functions
       
   124 
       
   125         /**
       
   126         * Fetches the bodies to emails
       
   127         * @since S60 3.0
       
   128         */
       
   129         void DoPopulateL();
       
   130 
       
   131         /**
       
   132         *
       
   133         * @since S60 3.0
       
   134         * @param aEntry, Entry that contains inbox
       
   135         * @return The id of inbox
       
   136         */
       
   137         TMsvId FindInboxL( CMsvEntry& aEntry );
       
   138 
       
   139 
       
   140 
       
   141     private:
       
   142         const TInt iFunctionId;
       
   143         TImImap4GetMailInfo iGetMailInfo;
       
   144         TImImap4GetPartialMailInfo iPartialGetMailInfo;
       
   145         CMsvEntrySelection* iSelection;
       
   146         TBool   iPopulate;
       
   147     };
       
   148 
       
   149 #endif