ipsservices/ipssosplugin/inc/ipsplgdeleteoperation.h
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Deletes messages first locally and then from server
       
    15 *
       
    16 */
       
    17 //<qmail> class renamed
       
    18 #ifndef IPSPLGDELETEOPERATION_H
       
    19 #define IPSPLGDELETEOPERATION_H
       
    20 //</qmail>
       
    21 //  INCLUDES
       
    22 #include <e32def.h>
       
    23 #include <e32des8.h>    // TDesC8
       
    24 
       
    25 class CMsvOperation;
       
    26 class CMsvEntry;
       
    27 class CMsvEntrySelection;
       
    28 class CMsvSession;
       
    29 class TRequestStatus;
       
    30 
       
    31 /**
       
    32 * class CIpsPlgDeleteOperation
       
    33 * Encapsulates delete locally operation and delete from server operation.
       
    34 * First deletes message locally and after it has been completed, deletes from the server
       
    35 */
       
    36 //<qmail>
       
    37 NONSHARABLE_CLASS ( CIpsPlgDeleteOperation ) : public CMsvOperation
       
    38 //</qmail>        
       
    39     {
       
    40     public:
       
    41         // <qmail>
       
    42         /**
       
    43         * Two-phased constructor
       
    44         * 
       
    45         * @param aMsvSession                client/server session to MsvServer
       
    46         * @param aObserverRequestStatus     operations observer status
       
    47         * @param aEntriesToDelete           Message entries to be deleted from server and locally  
       
    48         *
       
    49         * @return CIpsPlgCreateForwardMessageOperation* self pointer                                  
       
    50         */
       
    51         static CIpsPlgDeleteOperation* NewL(
       
    52             CMsvSession& aMsvSession,
       
    53             TRequestStatus& aObserverRequestStatus,
       
    54             CMsvEntrySelection* aEntriesToDelete );
       
    55         
       
    56         /**
       
    57         * Two-phased constructor
       
    58         * 
       
    59         * @param aMsvSession                client/server session to MsvServer
       
    60         * @param aObserverRequestStatus     operations observer status
       
    61         * @param aEntriesToDelete           Message entries to be deleted from server and locally
       
    62         * @param aOperationObserver         observes the progress of this operation
       
    63         * @param aRequestId                 identifier for this instance of operation, 
       
    64         *                                   assigned by the client
       
    65         * @return CIpsPlgCreateForwardMessageOperation* self pointer                                  
       
    66         */
       
    67         static CIpsPlgDeleteOperation* NewL(
       
    68             CMsvSession& aMsvSession,
       
    69             TRequestStatus& aObserverRequestStatus,
       
    70             CMsvEntrySelection* aEntriesToDelete,
       
    71             MFSMailRequestObserver& aOperationObserver,
       
    72             const TInt aRequestId);
       
    73         // </qmail>    
       
    74 //<qmail> class renamed + comments removed
       
    75         virtual ~CIpsPlgDeleteOperation();
       
    76         
       
    77         virtual const TDesC8& ProgressL();
       
    78 //</qmail> 
       
    79 
       
    80 // <qmail>
       
    81     protected:        
       
    82         void SignalFSObserver( TInt aStatus );
       
    83 // </qmail>
       
    84         
       
    85     private:
       
    86         // <qmail>   
       
    87         enum TIpsPlgDeleteMessagesState 
       
    88             {
       
    89             ESetFlags = 0,    
       
    90             ELocally,
       
    91             EFromServer
       
    92             };
       
    93         // </qmail>
       
    94 
       
    95         /**
       
    96         * Constructor.
       
    97         */
       
    98 		//<qmail> class renamed
       
    99         CIpsPlgDeleteOperation(
       
   100             CMsvSession& aMsvSession,
       
   101             TRequestStatus& aObserverRequestStatus );
       
   102 		//</qmail>
       
   103         //<qmail>
       
   104         CIpsPlgDeleteOperation(
       
   105             CMsvSession& aMsvSession,
       
   106             TRequestStatus& aObserverRequestStatus,
       
   107             MFSMailRequestObserver& aOperationObserver,
       
   108             const TInt aRequestId);
       
   109         //</qmail>
       
   110         // <qmail> 
       
   111         /**
       
   112         * 2nd phase constructor
       
   113         */
       
   114         void ConstructL( CMsvEntrySelection* aEntriesToDelete );
       
   115         // </qmail>
       
   116         
       
   117         /**
       
   118         * From CActive
       
   119         */
       
   120         void DoCancel();
       
   121         
       
   122         /**
       
   123         * From CActive
       
   124         */
       
   125         void RunL();
       
   126 
       
   127         /**
       
   128         * Starts new local delete progress
       
   129         */
       
   130         void StartNextDeleteLocally();
       
   131         //<qmail>
       
   132         /**
       
   133         * Creates object of CIpsPlgDeleteLocal
       
   134         */
       
   135         void MakeNextDeleteLocallyL();
       
   136         //</qmail>
       
   137 
       
   138         /**
       
   139         * Starts entry delete after local delete is completed.
       
   140         */
       
   141         void StartDeleteFromServer();
       
   142 
       
   143         /**
       
   144         * Creates delete operation
       
   145         */
       
   146         void MakeDeleteFromServerL();
       
   147 
       
   148 		// <qmail>    
       
   149         /**
       
   150         * Sets the locally deleted flag for the next item (iSetFlagIndex)
       
   151         * return true if operation started successfully, otherwise false
       
   152         */
       
   153         TBool SetNextLocallyDeletedFlagL();
       
   154 		// </qmail>    
       
   155 
       
   156     private:
       
   157         // <qmail>
       
   158         CMsvOperation*              iOperation; // owned
       
   159         CMsvEntry*                  iEntry; // owned
       
   160         CMsvEntrySelection*         iEntrySelection; // owned
       
   161         MFSMailRequestObserver* iOperationObserver;  // not owned
       
   162         TFSProgress iFSProgress;
       
   163         TInt iFSRequestId;
       
   164         // <qmail> removed member iEntryCount
       
   165         TInt                        iSetFlagIndex;
       
   166         CMsvEntry*                  iSetFlagEntry; // owned
       
   167         // <qmail> removed member iBlank
       
   168 		//<qmail> enum renamed
       
   169         TIpsPlgDeleteMessagesState  iState;
       
   170         // </qmail>
       
   171         
       
   172     };
       
   173 
       
   174 #endif      // IPSPLGDELETEREMOTE_H
       
   175 
       
   176 // End of File