ipsservices/ipssosplugin/inc/ipsplgdeleteremote.h
changeset 23 2dc6caa42ec3
parent 20 ecc8def7944a
child 25 61b206842ac4
child 27 9ba4404ef423
child 38 b4618f2cf6ac
equal deleted inserted replaced
20:ecc8def7944a 23:2dc6caa42ec3
     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 
       
    18 #ifndef IPSPLGDELETEREMOTE_H
       
    19 #define IPSPLGDELETEREMOTE_H
       
    20 
       
    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 CIpsPlgDeleteRemote
       
    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 NONSHARABLE_CLASS ( CIpsPlgDeleteRemote ) :
       
    37     public CMsvOperation
       
    38     {
       
    39     public:
       
    40         /**
       
    41         * Constructor.
       
    42         */
       
    43         static CIpsPlgDeleteRemote* NewL(
       
    44             CMsvSession& aMsvSession,
       
    45             TRequestStatus& aObserverRequestStatus,
       
    46             CMsvEntrySelection& aDeletedEntries );
       
    47             
       
    48         /**
       
    49         * Destructor.
       
    50         */
       
    51         virtual ~CIpsPlgDeleteRemote();
       
    52         
       
    53         /**
       
    54         *
       
    55         */
       
    56         virtual const TDesC8& ProgressL();
       
    57 
       
    58 
       
    59     private:
       
    60     
       
    61         enum IpsPlgDeleteMessagesState 
       
    62             {
       
    63 			// <qmail>    
       
    64             EDeletingMessagesStateSetFlags = 0,
       
    65 			// </qmail>    
       
    66             EDeletingMessagesStateLocally,
       
    67             EDeletingMessagesStateFromServer
       
    68             };
       
    69 
       
    70         /**
       
    71         * Constructor.
       
    72         */
       
    73         CIpsPlgDeleteRemote(
       
    74             CMsvSession& aMsvSession,
       
    75             TRequestStatus& aObserverRequestStatus );
       
    76 
       
    77         /**
       
    78         * Constructor.
       
    79         */
       
    80         void ConstructL( CMsvEntrySelection& aDeletedEntries );
       
    81         
       
    82         /**
       
    83         * From CActive
       
    84         */
       
    85         void DoCancel();
       
    86         
       
    87         /**
       
    88         * From CActive
       
    89         */
       
    90         void RunL();
       
    91 
       
    92         /**
       
    93         * Starts new local delete progress
       
    94         */
       
    95         void StartNextDeleteLocally();
       
    96 
       
    97         /**
       
    98         * Creates object of CImumDeleteMessagesLocally
       
    99         */
       
   100         void MakeNextDeleteLocallyL();
       
   101 
       
   102         /**
       
   103         * Starts entry delete after local delete is completed.
       
   104         */
       
   105         void StartDeleteFromServer();
       
   106 
       
   107         /**
       
   108         * Creates delete operation
       
   109         */
       
   110         void MakeDeleteFromServerL();
       
   111 
       
   112 		// <qmail>    
       
   113         /**
       
   114         * Sets the locally deleted flag for the next item (iSetFlagIndex)
       
   115         * return true if operation started successfully, otherwise false
       
   116         */
       
   117         TBool SetNextLocallyDeletedFlagL();
       
   118 		// </qmail>    
       
   119 
       
   120     private:
       
   121         CMsvOperation*              iOperation;
       
   122         CMsvEntry*                  iEntry;
       
   123         CMsvEntrySelection*         iEntrySelection; 
       
   124         TInt                        iEntryCount;
       
   125         // <qmail>
       
   126         TInt                        iSetFlagIndex;
       
   127         CMsvEntry*                  iSetFlagEntry;
       
   128         // </qmail>
       
   129         TBuf8<1>                    iBlank;
       
   130         IpsPlgDeleteMessagesState   iState;
       
   131         
       
   132     };
       
   133 
       
   134 #endif      // IPSPLGDELETEREMOTE_H
       
   135 
       
   136 // End of File