phonebookui/Phonebook2/CommandsExtension/inc/CPbk2RemoveSpeedDialCmd.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002-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: 
       
    15 *      Remove speed dial command object.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef CPBK2REMOVESPEEDDIALCMD_H
       
    21 #define CPBK2REMOVESPEEDDIALCMD_H
       
    22 
       
    23 // INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <MVPbkSingleContactOperationObserver.h>
       
    26 #include <MVPbkContactAttributeManager.h>
       
    27 #include <MVPbkContactObserver.h>
       
    28 #include <MVPbkContactStoreObserver.h>
       
    29 #include "MPbk2Command.h"
       
    30 
       
    31 // FORWARD DECLARATIONS
       
    32 class CAknQueryDialog;
       
    33 class MPbk2ContactUiControl;
       
    34 class MPbk2CommandObserver;
       
    35 class MVPbkContactOperationBase;
       
    36 class CPbk2ApplicationServices;
       
    37 
       
    38 // CLASS DECLARATION
       
    39 
       
    40 /**
       
    41  * Remove speed dial command.
       
    42  */
       
    43 NONSHARABLE_CLASS(CPbk2RemoveSpeedDialCmd) : 
       
    44         public CBase,
       
    45         public MPbk2Command,
       
    46         public MVPbkContactStoreObserver,
       
    47         public MVPbkSingleContactOperationObserver,
       
    48         public MVPbkContactObserver,
       
    49         public MVPbkSetAttributeObserver
       
    50     {
       
    51     public: // Interface
       
    52         /**
       
    53          * Creates a new instance of this class.
       
    54          * @param aParams command parameters
       
    55          * @return a newly created command object
       
    56          */
       
    57         static CPbk2RemoveSpeedDialCmd* NewL(MPbk2ContactUiControl& aUiControl);
       
    58 
       
    59         ~CPbk2RemoveSpeedDialCmd();
       
    60 
       
    61     public:  // From MPbk2Command
       
    62         void ExecuteLD();
       
    63         void AddObserver(MPbk2CommandObserver& aObserver);
       
    64         void ResetUiControl(MPbk2ContactUiControl& aUiControl);
       
    65 
       
    66     public: // From MVPbkContactStoreObserver
       
    67     	void StoreReady(MVPbkContactStore& aContactStore);
       
    68     	void StoreUnavailable(MVPbkContactStore& aContactStore, 
       
    69     	                TInt aReason);
       
    70     	void HandleStoreEventL(
       
    71     	                MVPbkContactStore& aContactStore, 
       
    72     	                TVPbkContactStoreEvent aStoreEvent);
       
    73             
       
    74     public: // From MVPbkSingleContactOperationObserver
       
    75         void VPbkSingleContactOperationComplete(
       
    76                 MVPbkContactOperationBase& aOperation,
       
    77                 MVPbkStoreContact* aContact);
       
    78         void VPbkSingleContactOperationFailed(
       
    79                 MVPbkContactOperationBase& aOperation, 
       
    80                 TInt aError);
       
    81 
       
    82     public: // From MVPbkSetAttributeObserver
       
    83         void AttributeOperationComplete(
       
    84             MVPbkContactOperationBase& aOperation);
       
    85         void AttributeOperationFailed(
       
    86             MVPbkContactOperationBase& aOperation, TInt aError);
       
    87             
       
    88     public: // From MVPbkContactObserver
       
    89         void ContactOperationCompleted(TContactOpResult aResult);
       
    90         void ContactOperationFailed
       
    91             (TContactOp aOpCode, TInt aErrorCode, TBool aErrorNotified);    
       
    92 
       
    93     private:  // Implementation
       
    94         CPbk2RemoveSpeedDialCmd(MPbk2ContactUiControl& aUiControl);
       
    95         void ConstructL();
       
    96         void FinishCommand(TInt aError);
       
    97         TInt ToStoreFieldIndexL(
       
    98 		        TInt aPresIndex,
       
    99 		        const MVPbkStoreContact* aStoreContact );
       
   100         TBool HasSpeedDialL();
       
   101         
       
   102     private:  // Data
       
   103         /// Ref: Ui control
       
   104         MPbk2ContactUiControl* iUiControl;
       
   105         /// Ref: command observer
       
   106         MPbk2CommandObserver* iCommandObserver;
       
   107         /// Own: remove / retrieve operation
       
   108         MVPbkContactOperationBase* iOperation;
       
   109         /// Own: Store Contact
       
   110         MVPbkStoreContact* iStoreContact;
       
   111         /// Own: Application Services pointer
       
   112         CPbk2ApplicationServices* iAppServices;
       
   113         /// Own: Current contact link
       
   114         MVPbkContactLink* iContactLink;
       
   115     };
       
   116 
       
   117 
       
   118 #endif // CPBK2REMOVESPEEDDIALCMD_H
       
   119 
       
   120 // End of File