phonebookui/Phonebook2/NamesListExtension/inc/cpbk2deletemycardcmd.h
branchRCL_3
changeset 3 04ab22b956c2
parent 0 e686773b3f54
child 64 c1e8ba0c2b16
equal deleted inserted replaced
0:e686773b3f54 3:04ab22b956c2
    19 #define CPBK2DELETEMYCARDCMD_H
    19 #define CPBK2DELETEMYCARDCMD_H
    20 
    20 
    21 // INCLUDES
    21 // INCLUDES
    22 #include <e32base.h>
    22 #include <e32base.h>
    23 #include <MPbk2Command.h>
    23 #include <MPbk2Command.h>
    24 #include <MVPbkSingleContactOperationObserver.h>
       
    25 #include <MVPbkBatchOperationObserver.h>
    24 #include <MVPbkBatchOperationObserver.h>
    26 
    25 
    27 // FORWARD DECLARATIONS
    26 // FORWARD DECLARATIONS
    28 class MPbk2ContactUiControl;
    27 class MPbk2ContactUiControl;
    29 class MVPbkContactLink;
    28 class MVPbkContactLink;
    37  * Phonebook 2 delete mycard command.
    36  * Phonebook 2 delete mycard command.
    38  */
    37  */
    39 NONSHARABLE_CLASS( CPbk2DeleteMyCardCmd ) :
    38 NONSHARABLE_CLASS( CPbk2DeleteMyCardCmd ) :
    40     public CActive,
    39     public CActive,
    41     public MPbk2Command,
    40     public MPbk2Command,
    42     public MVPbkSingleContactOperationObserver,
       
    43     public MVPbkBatchOperationObserver
    41     public MVPbkBatchOperationObserver
    44     {
    42     {
    45 public: // Construction and destruction
    43 public: // Construction and destruction
    46 
    44 
    47     /**
    45     /**
    70     
    68     
    71     void DoCancel();
    69     void DoCancel();
    72     void RunL();
    70     void RunL();
    73     TInt RunError( TInt aError );
    71     TInt RunError( TInt aError );
    74 
    72 
    75 private: // From MVPbkSingleContactOperationObserver
       
    76     
       
    77     void VPbkSingleContactOperationComplete(
       
    78         MVPbkContactOperationBase& aOperation,
       
    79         MVPbkStoreContact* aContact );
       
    80     void VPbkSingleContactOperationFailed(
       
    81         MVPbkContactOperationBase& aOperation, 
       
    82         TInt aError );
       
    83 
       
    84 private: // From MVPbkBatchOperationObserver
    73 private: // From MVPbkBatchOperationObserver
    85     
    74     
    86     void StepComplete( 
    75     void StepComplete( 
    87         MVPbkContactOperationBase& aOperation,
    76         MVPbkContactOperationBase& aOperation,
    88         TInt aStepSize );
    77         TInt aStepSize );
    94 
    83 
    95 private: // Data structures
    84 private: // Data structures
    96     /// Process states
    85     /// Process states
    97     enum TProcessState
    86     enum TProcessState
    98         {
    87         {
    99         ERetrieving,
       
   100         EConfirming,
    88         EConfirming,
   101         EStarting,
    89         EStarting,
   102         EDeleting,
    90         EDeleting,
   103         EStopping,
    91         EStopping,
   104         ECanceling
    92         ECanceling
   133      * @param aCancelCode result of the command process
   121      * @param aCancelCode result of the command process
   134      */
   122      */
   135     void ProcessDismissed( TInt aCancelCode );
   123     void ProcessDismissed( TInt aCancelCode );
   136 
   124 
   137     /**
   125     /**
   138      * Retrieve contact
       
   139      * 
       
   140      * @param aContactLink link for the contact to retrieve 
       
   141      */
       
   142     void RetrieveContactL( const MVPbkContactLink& aContactLink );
       
   143 
       
   144     /**
       
   145      * Delete contact that was given in the construction
   126      * Delete contact that was given in the construction
   146      */
   127      */
   147     void DeleteContactL();
   128     void DeleteContactL();
   148     
   129     
   149     /**
   130     /**
   157     /// Ref: Command observer
   138     /// Ref: Command observer
   158     MPbk2CommandObserver* iCommandObserver;
   139     MPbk2CommandObserver* iCommandObserver;
   159     
   140     
   160     /// Own: Current state of process
   141     /// Own: Current state of process
   161     TProcessState iState;
   142     TProcessState iState;
   162     /// Own: Retrieve operation
       
   163     MVPbkContactOperationBase* iRetrieveOperation;
       
   164     /// Own: Delete operation
   143     /// Own: Delete operation
   165     MVPbkContactOperationBase* iDeleteOperation;
   144     MVPbkContactOperationBase* iDeleteOperation;
   166     /// Own: The store contact to delete
       
   167     MVPbkStoreContact* iStoreContact;
       
   168     /// Own: Contact to be deleted (only one contact)
   145     /// Own: Contact to be deleted (only one contact)
   169     CVPbkContactLinkArray* iContactsArray;
   146     CVPbkContactLinkArray* iContactsArray;
   170     /// Own: Application Services instance
   147     /// Own: Application Services instance
   171     CPbk2ApplicationServices* iAppServices;
   148     CPbk2ApplicationServices* iAppServices;
   172     };
   149     };