ipsservices/ipssosplugin/inc/ipsplgimap4populateop.h
branchRCL_3
changeset 64 3533d4323edc
parent 63 d189ee25cf9d
equal deleted inserted replaced
63:d189ee25cf9d 64:3533d4323edc
    13 *
    13 *
    14 * Description:  IMAP4 populate messages operation
    14 * Description:  IMAP4 populate messages operation
    15 *
    15 *
    16 */
    16 */
    17 
    17 
    18 #ifndef IPSPLGIMAP4POPULATEOP_H
    18 #ifndef __IPSPLGIMAP4POPULATEOP_H__
    19 #define IPSPLGIMAP4POPULATEOP_H
    19 #define __IPSPLGIMAP4POPULATEOP_H__
    20 
    20 
    21 #include "ipsplgonlineoperation.h"
    21 #include "ipsplgonlineoperation.h"
    22 
    22 
    23 class CIpsPlgEventHandler;
    23 class CIpsPlgEventHandler;
    24 
    24 
    25 /**
    25 /**
    26 * class CIpsPlgImap4PopulateOp
    26 * class CIpsPlgImap4PopulateOp
    27 * loads message's actual content/ message parts
    27 *
    28 */
    28 */
    29 NONSHARABLE_CLASS ( CIpsPlgImap4PopulateOp ) :
    29 
       
    30 class CIpsPlgImap4PopulateOp :
    30     public CIpsPlgOnlineOperation
    31     public CIpsPlgOnlineOperation
    31     {
    32     {
    32 public:
    33     public:
    33 
    34 
    34     /**
    35         /**
    35     * NewL()
    36         * NewL()
    36     * Basic factory function - creates dialog with standard title resource
    37         * Basic factory function - creates dialog with standard title resource
    37     * @param aMsvSession client/server session to msvServer 
    38         * @param CMsvSession& 
    38     * @param aObserverRequestStatus caller's status
    39         *
    39     * @param aService serviceId of the mailbox
    40         *
    40     * @param aActivityTimer mailbox specific activity timer
    41         *
    41     * @param aPartialMailInfo parameter struct for the service request to msvServer
    42         *
    42     * @param aSel selection of messages to populate (first entry contains service entry)
    43         *
    43     * @param aFSMailBoxId mailbox identifier
    44         *
    44     * @param aFSOperationObserver observer for this operation
    45         * @return CIpsPlgImap4PopulateOperation* self pointer
    45     * @param aFSRequestId client assigned request Id
    46         */
    46     * @param aEventHandler 
    47 
    47     * @param aDoFilterSelection specifies whether a full populate is requested (i.e. refetch already fecthed or not)
    48         IMPORT_C static CIpsPlgImap4PopulateOp* NewL(
    48     * @return CIpsPlgImap4PopulateOperation* self pointer
    49             CMsvSession& aMsvSession,
    49     */
    50             TRequestStatus& aObserverRequestStatus,
    50     // <qmail> priority parameter has been removed
    51             TInt aPriority,
    51 	// <qmail> MFSMailRequestObserver& changed to pointer
    52             TMsvId aService,
    52     IMPORT_C static CIpsPlgImap4PopulateOp* NewL(
    53             CIpsPlgTimerOperation& aActivityTimer,
    53         CMsvSession& aMsvSession,
    54             const TImImap4GetPartialMailInfo& aPartialMailInfo,
    54         TRequestStatus& aObserverRequestStatus,
    55             const CMsvEntrySelection& aSel,
    55         TMsvId aService,
    56             TFSMailMsgId aFSMailBoxId,
    56         CIpsPlgTimerOperation& aActivityTimer,
    57             MFSMailRequestObserver& aFSOperationObserver,
    57         const TImImap4GetPartialMailInfo& aPartialMailInfo,
    58             TInt aFSRequestId,
    58         const CMsvEntrySelection& aSel,
    59             CIpsPlgEventHandler* aEventHandler,  
    59         TFSMailMsgId aFSMailBoxId,
    60             TBool aDoFilterSelection = ETrue );
    60         MFSMailRequestObserver* aFSOperationObserver,
    61 
    61         TInt aFSRequestId,
    62         /**
    62         CIpsPlgEventHandler* aEventHandler,  
    63         * ~CIpsPlgImap4PopulateOp()
    63         TBool aDoFilterSelection = ETrue );
    64         * destructor
    64 
    65         */
    65     virtual ~CIpsPlgImap4PopulateOp();
    66 
    66 
    67         virtual ~CIpsPlgImap4PopulateOp();
    67     /**
    68 
    68     * From MsvOperation
    69         /**
    69     * Gets information on the progress of the operation
    70         *
    70     * (see MsvOperation header)
    71         */
    71     */
    72         const TDesC8& ProgressL();
    72     const TDesC8& ProgressL();
    73 
    73     
    74         
    74     /**
    75         /**
    75     * From CIpsPlgBaseOperation
    76         *
    76     * For reporting if DoRunL leaves
    77         */
    77     */
    78         const TDesC8& GetErrorProgressL( TInt aError );
    78     const TDesC8& GetErrorProgressL( TInt aError );
    79         
    79     
    80         /**
    80     TFSProgress GetFSProgressL() const;
    81         *
    81      
    82         */        
    82     // <qmail> change ret val type
    83         TFSProgress GetFSProgressL() const;
    83     /**
    84         
    84      * Returns operation type
    85         /**
    85      */
    86         *
    86     TIpsOpType IpsOpType() const;
    87         */
    87     
    88         virtual TInt IpsOpType() const;
    88 private:
    89         
    89     // <qmail> priority parameter has been removed
    90     private:
    90     CIpsPlgImap4PopulateOp(
    91 
    91         CMsvSession& aMsvSession,
    92 
    92         TRequestStatus& aObserverRequestStatus,
    93         /**
    93         TMsvId aService,
    94         * CIpsPlgImap4PopulateOp()
    94         CIpsPlgTimerOperation& aActivityTimer,
    95         * @param 
    95         const TImImap4GetPartialMailInfo& aGetMailInfo,
    96         *
    96         TFSMailMsgId aFSMailBoxId,
    97         *
    97         MFSMailRequestObserver* aFSOperationObserver,
    98         *
    98         TInt aFSRequestId,
    99         *
    99         CIpsPlgEventHandler* aEventHandler );
   100         *
   100 
   101         *
   101     void ConstructL( const CMsvEntrySelection& aSel, TBool aDoFilterSelection );
   102         
   102 
   103         */
   103     void RunL();
   104 
   104 
   105         CIpsPlgImap4PopulateOp(
   105     void DoRunL();
   106             CMsvSession& aMsvSession,
   106     
   107             TRequestStatus& aObserverRequestStatus,
   107     void DoCancel();
   108             TInt aPriority,
   108 
   109             TMsvId aService,
   109     /**
   110             CIpsPlgTimerOperation& aActivityTimer,
   110      * completes the status of the observer
   111             const TImImap4GetPartialMailInfo& aGetMailInfo,
   111      */
   112             TFSMailMsgId aFSMailBoxId,
   112     void Complete();
   113             MFSMailRequestObserver& aFSOperationObserver,
   113     
   114             TInt aFSRequestId,
   114     /**
   115             CIpsPlgEventHandler* aEventHandler );
   115     * handle connecting state
   116 
   116     */
   117         /**
   117     void DoConnectL();
   118         * 
   118     
   119         */
   119     /**
   120 
   120     * Filters given selection of entries
   121         void ConstructL( 
   121     * The result is set to internal iSelection member
   122                 const CMsvEntrySelection& aSel, 
   122     * (filtering is done on basis of what is the current populate status of the particular message)
   123                 TBool aDoFilterSelection );
   123     * @param aSelection list of entries to fetch
   124 
   124     */
   125 
   125     void FilterSelectionL( const CMsvEntrySelection& aSelection );
   126         /**
   126     
   127         * 
   127     /**
   128         */
   128     * helper for selection filtering
   129 
   129     */
   130         void RunL();
   130     TBool IsPartialPopulate();
   131 
   131 
   132         /**
   132 protected:
   133         * 
   133     
   134         */
   134     /**
   135         void DoRunL();
   135     * starts the actual populate command to msvserver
   136         
   136     */
   137         /**
   137     void DoPopulateL();
   138         * 
   138     
   139         */
   139     // <qmail> remove GetEngineProgress( const TDesC8& aProgress );
   140         void DoCancel();
   140     
   141 
   141 private: //Data
   142         /**
   142     // <qmail> members changed
   143         * 
   143     // internal state of the operation
   144         */
   144     enum TFetchState 
   145 
   145         {
   146         void Complete();
   146         EStateIdle,
   147         
   147         EStateConnecting,
   148         /**
   148         EStateFetching,
   149         *
   149         EStateInfoEntryChange
   150         */
   150         };
   151         void DoConnectL();
   151     TFetchState                       iState;
   152         
   152     
   153         /**
   153     // parameter struct for the populate command to msvserver
   154         *
   154     TImImap4GetPartialMailInfo        iPartialMailInfo;
   155         */
   155     // contains full list of messages to fetch
   156         void FilterSelectionL( const CMsvEntrySelection& aSelection );
   156     CMsvEntrySelection*               iSelection;
   157         
   157     // contains serviceId and one message entry id from iSelection list
   158         /**
   158     // i.e. populate op loops through iSelection with this iTempSelection
   159         *
   159     CMsvEntrySelection*               iTempSelection;
   160         */
   160     // not owned
   161         TBool IsPartialPopulate( );
   161     CIpsPlgEventHandler*              iEventHandler;
   162 
   162     TDesC8*                           iFetchErrorProgress;
   163     protected:
   163     TPckgBuf<TImap4SyncProgress>      iSyncProgress;
   164         
       
   165         /**
       
   166         *
       
   167         */
       
   168         void DoPopulateL();
       
   169         
       
   170         /**
       
   171         * From CIpsPlgOnlineoperation
       
   172         */
       
   173         TInt GetEngineProgress( const TDesC8& aProgress );
       
   174         
       
   175     protected:
       
   176 
       
   177         enum TFetchState 
       
   178             {
       
   179             EStateIdle,
       
   180             EStateConnecting,
       
   181             EStateFetching,
       
   182             EStateInfoEntryChange
       
   183             };
       
   184 
       
   185    
       
   186     private: //Data
       
   187         
       
   188         TImImap4GetPartialMailInfo        iPartialMailInfo;
       
   189         RArray<TMsvId>                    iSelection;
       
   190         // not owned
       
   191         CIpsPlgEventHandler*              iEventHandler;
       
   192         CMsvEntrySelection*               iTempSelection;
       
   193         TDesC8*                           iFetchErrorProgress;
       
   194         TPckgBuf<TImap4SyncProgress>      iSyncProgress;
       
   195         TMsvId                            iParent;
       
   196         TFetchState                       iState;
       
   197         
   164     };
   198     };
   165 
   199 
   166 #endif // IPSPLGIMAP4POPULATEOP_H
   200 #endif //__IPSPLGIMAP4POPULATEOP_H__