contactextensions/predefinedcontacts/inc/pdccontactdeletion.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2007 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:    Responsible for the deletion of existing predefined contacts
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef C_PDCCONTACTDELETION_H
       
    19 #define C_PDCCONTACTDELETION_H
       
    20 
       
    21 // System includes
       
    22 #include <e32base.h>                        // CBase
       
    23 #include <MVPbkBatchOperationObserver.h>    // MVPbkBatchOperationObserver
       
    24 
       
    25 // Forward declarations
       
    26 class MVPbkContactOperationBase;
       
    27 class CVPbkContactManager;
       
    28 class MVPbkContactLinkArray;
       
    29 class CVPbkContactLinkArray;
       
    30 
       
    31 /**
       
    32  *  This class is responsible for the deletion of
       
    33  *  any existing predefined contacts.
       
    34  */
       
    35 NONSHARABLE_CLASS( CPdcContactDeletion ): public CBase,
       
    36                             public MVPbkBatchOperationObserver
       
    37     {
       
    38 public:
       
    39     /**
       
    40     * Symbian 1st phase constructor
       
    41     * @return Self pointer to CPdcContactDeletion
       
    42     * @param    aContactManager   contacts manager
       
    43     */
       
    44     static CPdcContactDeletion* NewL( CVPbkContactManager& aContactManager );
       
    45     
       
    46     /**
       
    47     * Destructor.
       
    48     */
       
    49     virtual ~CPdcContactDeletion();
       
    50 
       
    51 public:
       
    52     /**
       
    53     * Deletes a list of contacts
       
    54     * @param    aLinkArray   array of links to contacts to be deleted,
       
    55     *                        takes ownership
       
    56     * @param    aCallerStatus     Caller's iStatus.
       
    57     */
       
    58     void DeleteContactsL( MVPbkContactLinkArray* aLinkArray,
       
    59                                      TRequestStatus& aCallerStatus ,TBool aDeleteStoredContact ); 
       
    60     
       
    61     /** 
       
    62      * Cancels the deletion process
       
    63      */
       
    64      void Cancel(); 
       
    65      void DeleteStoredContactsL(MVPbkContactLinkArray* aLinkArray,
       
    66                                      TRequestStatus& aCallerStatus,TBool aDeleteStoredContact  );
       
    67                                      
       
    68 private: // C++ constructor and the Symbian second-phase constructor
       
    69     CPdcContactDeletion( CVPbkContactManager& aContactManager );
       
    70     void ConstructL();
       
    71     
       
    72 private:
       
    73     void DeleteNextContact();
       
    74     TBool DeleteNextContactL();
       
    75     
       
    76 private: // from MVPbkBatchOperationObserver
       
    77     void StepComplete( MVPbkContactOperationBase& aOperation,
       
    78                                     TInt aStepSize );
       
    79     TBool StepFailed( MVPbkContactOperationBase& aOperation,
       
    80                                     TInt aStepSize, TInt aError );
       
    81     void OperationComplete( MVPbkContactOperationBase& aOperation );
       
    82 	
       
    83 private: // data
       
    84     /// Ref: Contact manager
       
    85     CVPbkContactManager& iContactManager;
       
    86     /// Ref: Array of links to be deleted
       
    87     MVPbkContactLinkArray* iLinkArray;
       
    88     /// Ref: Link currently being deleted
       
    89     CVPbkContactLinkArray* iDeleteArray;
       
    90     /// Own: Async delete operation
       
    91     MVPbkContactOperationBase* iDeleteOp;
       
    92     /// Callers iStatus
       
    93     TRequestStatus* iCallerStatus;
       
    94     /// Index of contact being deleted 
       
    95     TInt iIndex;
       
    96     /// Judge the type of deletion operator
       
    97     TBool iDeleteStoredContact;
       
    98     };
       
    99 
       
   100 #endif // C_PDCCONTACTDELETION_H