phonebookui/Phonebook2/USIMExtension/inc/CPsu2LaunchViewCmd.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 USIM UI Extension launch view command.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPSU2LAUNCHVIEWCMD_H
       
    20 #define CPSU2LAUNCHVIEWCMD_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2Command.h>
       
    25 #include <MVPbkContactViewObserver.h>
       
    26 #include "Pbk2USimUI.hrh"
       
    27 #include <MPbk2ProcessDecorator.h>
       
    28 #include "MPsu2ViewLaunchCallback.h"
       
    29 
       
    30 // FORWARD DECLARATIONS
       
    31 class CVPbkContactManager;
       
    32 class CPsu2ViewManager;
       
    33 class MVPbkContactViewBase;
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * Phonebook 2 USIM UI Extension launch view command.
       
    39  */
       
    40 class CPsu2LaunchViewCmd : public CActive,
       
    41                            public MPbk2Command,
       
    42                            private MVPbkContactViewObserver,
       
    43                            private MPbk2ProcessDecoratorObserver,
       
    44                            private MPsu2ViewLaunchCallback
       
    45     {
       
    46     public: // Constructors and destructor
       
    47 
       
    48         /**
       
    49          * Creates a new instance of this class.
       
    50          *
       
    51          * @param aViewManager  View manager.
       
    52          * @param aViewId       Id of the view to launch.
       
    53          * @return  A new instance of this class.
       
    54          */
       
    55         static CPsu2LaunchViewCmd* NewL(
       
    56                 CPsu2ViewManager& aViewManager,
       
    57                 TPsu2ViewId aViewId );
       
    58 
       
    59         /**
       
    60          * Destructor.
       
    61          */
       
    62         virtual ~CPsu2LaunchViewCmd();
       
    63 
       
    64     private: // From CActive
       
    65         void RunL();
       
    66         void DoCancel();
       
    67         TInt RunError(
       
    68                 TInt aError );
       
    69 
       
    70     public: // From MPbk2Command
       
    71         void ExecuteLD();
       
    72         void AddObserver(
       
    73                 MPbk2CommandObserver& aObserver );
       
    74         void ResetUiControl(
       
    75                 MPbk2ContactUiControl& aUiControl );
       
    76 
       
    77     public: // From MPbk2ProcessDecoratorObserver
       
    78         void ProcessDismissed(
       
    79                 TInt aCancelCode );
       
    80 
       
    81     private: // From MVPbkContactViewObserver
       
    82         void ContactViewReady(
       
    83                 MVPbkContactViewBase& aView );
       
    84         void ContactViewUnavailable(
       
    85                 MVPbkContactViewBase& aView );
       
    86         void ContactAddedToView(
       
    87                 MVPbkContactViewBase& aView,
       
    88                 TInt aIndex,
       
    89                 const MVPbkContactLink& aContactLink );
       
    90         void ContactRemovedFromView(
       
    91                 MVPbkContactViewBase& aView,
       
    92                 TInt aIndex,
       
    93                 const MVPbkContactLink& aContactLink );
       
    94         void ContactViewError(
       
    95                 MVPbkContactViewBase& aView,
       
    96                 TInt aError,
       
    97                 TBool aErrorNotified );
       
    98 
       
    99     private: // From MPsu2ViewLaunchCallback
       
   100         void SetContactViewL(
       
   101                 MVPbkContactViewBase& aContactView );
       
   102         void HandleError(
       
   103                 TInt aError );
       
   104 
       
   105     private: // Implementation
       
   106         CPsu2LaunchViewCmd(
       
   107                 CPsu2ViewManager& aViewManager,
       
   108                 TPsu2ViewId aViewId );
       
   109         void ConstructL();
       
   110         void IssueRequest();
       
   111         void OpenStoreAndViewL();
       
   112 
       
   113     private: // Data
       
   114         /// Ref: View manager
       
   115         CPsu2ViewManager& iViewManager;
       
   116         /// Own: Id of the view to launch
       
   117         TPsu2ViewId iViewId;
       
   118         /// Ref: Command observer
       
   119         MPbk2CommandObserver* iCommandObserver;
       
   120         /// Ref: Contact view, owned until given to view manager
       
   121         MVPbkContactViewBase* iVPbkView;
       
   122         /// Own: Command flags
       
   123         TInt iCommandFlags;
       
   124         /// Own: Decorator for the wait note process
       
   125         MPbk2ProcessDecorator* iDecorator;
       
   126         /// Own: Contact view ready indicator
       
   127         TBool iContactViewReady;
       
   128     };
       
   129 
       
   130 #endif // CPSU2LAUNCHVIEWCMD_H
       
   131 
       
   132 // End of File