phonebookui/Phonebook2/NamesListExtension/inc/CPbk2NlxMoveTopContactsCmd.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-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:  Phonebook 2 Organize top contacts command
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPbk2NlxMoveTopContactsCmd_H
       
    20 #define CPbk2NlxMoveTopContactsCmd_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2Command.h>
       
    25 #include <CVPbkTopContactManager.h>
       
    26 #include <MVPbkOperationObserver.h>
       
    27 #include <MPbk2ProcessDecorator.h>
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class MPbk2ContactUiControl;
       
    31 class MVPbkContactOperationBase;
       
    32 class CPbk2NlxReorderingModel;
       
    33 class MVPbkContactViewBase;
       
    34 class MVPbkContactLink;
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * Phonebook 2 move top contacts command object.
       
    39  */
       
    40 class CPbk2NlxMoveTopContactsCmd : 
       
    41     public CActive,
       
    42     public MPbk2Command,
       
    43     private MVPbkOperationObserver,
       
    44     private MVPbkOperationErrorObserver,
       
    45     private MPbk2ProcessDecoratorObserver
       
    46     {
       
    47     public: // Construction and destruction
       
    48 
       
    49         /**
       
    50          * Creates a new instance of this class.
       
    51          *
       
    52          * @return  A new instance of this class.
       
    53          */
       
    54         static CPbk2NlxMoveTopContactsCmd* NewL( 
       
    55             MPbk2ContactUiControl& aUiControl );
       
    56 
       
    57         /**
       
    58          * Destructor.
       
    59          */
       
    60         ~CPbk2NlxMoveTopContactsCmd();
       
    61         
       
    62     public: //From MPbk2Command
       
    63         void ExecuteLD();
       
    64         void ResetUiControl( MPbk2ContactUiControl& aUiControl );
       
    65         void AddObserver( MPbk2CommandObserver& aObserver );
       
    66 
       
    67     private: // From MVPbkOperationObserver
       
    68         void VPbkOperationCompleted(MVPbkContactOperationBase*);
       
    69     private: // From MVPbkOperationErrorObserver        
       
    70         void VPbkOperationFailed( MVPbkContactOperationBase*,TInt aError );
       
    71         
       
    72     private: //Construction
       
    73         CPbk2NlxMoveTopContactsCmd( 
       
    74             MPbk2ContactUiControl& aUiControl );
       
    75         void ConstructL();
       
    76         
       
    77     private: //From CActive
       
    78         void DoCancel();
       
    79         void RunL();
       
    80         TInt RunError(TInt aError);
       
    81         
       
    82     public: // From MPbk2ProcessDecoratorObserver
       
    83         void ProcessDismissed(
       
    84                 TInt aCancelCode );    
       
    85         
       
    86     private:
       
    87         /// Command states
       
    88         enum TState
       
    89             {
       
    90             EShowMoveDlg,
       
    91             ESavingTopContacts,
       
    92             ECompleteCommand
       
    93             };
       
    94         
       
    95     private: //implementation
       
    96     	void ShowDlgL();
       
    97     	void FinishCommand(TInt aError);
       
    98     	void IssueRequest(TState aNextState);
       
    99         void ShowWaitNoteL();
       
   100         
       
   101     private: // Data
       
   102         //Ref: Command observer
       
   103         MPbk2CommandObserver* iCommandObserver;
       
   104         //Ref: Current ui control
       
   105         MPbk2ContactUiControl *iUiControl;        
       
   106         //Own: Provides top contacts services       
       
   107         CVPbkTopContactManager* iVPbkTopContactManager;
       
   108         //Own: listbox model that supports reordering
       
   109         //		uses TopContactManager to handle top contacts
       
   110         CPbk2NlxReorderingModel* iReorderingModel;
       
   111         /// Own: State of the command
       
   112         TState iState;
       
   113         /// Own: Top contacts view
       
   114         MVPbkContactViewBase* iView;
       
   115         /// Own: Top contact manager oepration
       
   116         MVPbkContactOperationBase* iTopContactOperation;
       
   117         /// Own: focused contact from move dialog, used to keep the same contact
       
   118         ///      focused when back to the main namelist view
       
   119         const MVPbkContactLink* iFocusedContact;
       
   120         /// Own: Decorator for the wait note process
       
   121         MPbk2ProcessDecorator* iDecorator;
       
   122     };
       
   123 
       
   124 #endif // CPbk2NlxMoveTopContactsCmd_H
       
   125 
       
   126 // End of File