phonebookui/Phonebook2/inc/CPbk2CommandHandler.h
changeset 0 e686773b3f54
child 21 9da50d567e3c
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 command handler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2COMMANDHANDLER_H
       
    20 #define CPBK2COMMANDHANDLER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MPbk2CommandHandler.h>
       
    25 #include <MPbk2ContactUiControl.h>
       
    26 #include <Pbk2Commands.hrh>
       
    27 
       
    28 // FORWARDS
       
    29 class MPbk2CommandFactory;
       
    30 class CEikMenuPane;
       
    31 class CPbk2CommandStore;
       
    32 class CPbk2AiwInterestArray;
       
    33 class MPbk2ViewExplorer;
       
    34 class MPbk2Command;
       
    35 class CPbk2AppViewBase;
       
    36 class CPbk2UIExtensionManager;
       
    37 class CVPbkContactStoreUriArray;
       
    38 class CPbk2ContactRelocator;
       
    39 class CPbk2ApplicationServices;
       
    40 class MVPbkContactLink;
       
    41 
       
    42 //  CLASS DECLARATION
       
    43 
       
    44 /**
       
    45  * Phonebook 2 command handler.
       
    46  * Responsible for handling all Phonebook 2 commands and
       
    47  * filtering of Phonebook 2 menus.
       
    48  */
       
    49 class CPbk2CommandHandler : public CBase,
       
    50                             public MPbk2CommandHandler
       
    51     {
       
    52     public: // Construction and destruction
       
    53 
       
    54         /**
       
    55          * Creates a new instance of this class.
       
    56          *
       
    57          * @return  A new instance of this class.
       
    58          */
       
    59         IMPORT_C static CPbk2CommandHandler* NewL();
       
    60 
       
    61         /**
       
    62          * Destructor.
       
    63          */
       
    64         ~CPbk2CommandHandler();
       
    65 
       
    66     public: // From MPbk2CommandHandler
       
    67         TBool HandleCommandL(
       
    68                 const TInt aCommandId,
       
    69                 MPbk2ContactUiControl& aControl,
       
    70                 const CPbk2AppViewBase* aAppView );
       
    71         void DynInitMenuPaneL(
       
    72                 TInt aResourceId,
       
    73                 CEikMenuPane* aMenuPane,
       
    74                 CPbk2AppViewBase& aViewBase,
       
    75                 MPbk2ContactUiControl& aControl );
       
    76         void RegisterAiwInterestL(
       
    77                 const TInt aInterestId,
       
    78                 const TInt aMenuResourceId,
       
    79                 const TInt aInterestResourceId,
       
    80                 const TBool aAttachBaseService );
       
    81         TInt ServiceCmdByMenuCmd(
       
    82                 TInt aMenuCmdId ) const;
       
    83         void AddAndExecuteCommandL(
       
    84                 MPbk2Command* aCommand );
       
    85         void AddMenuCommandObserver(
       
    86                 MPbk2MenuCommandObserver& aObserver );
       
    87         void RemoveMenuCommandObserver(
       
    88                 MPbk2MenuCommandObserver& aObserver );
       
    89         void DynInitToolbarL(
       
    90                 TInt aResourceId,
       
    91                 CAknToolbar* aToolbar,
       
    92                 const CPbk2AppViewBase& aAppView,
       
    93                 MPbk2ContactUiControl& aControl );
       
    94         void OfferToolbarEventL(
       
    95                 TInt aCommand,
       
    96                 MPbk2ContactUiControl& aControl,
       
    97                 const CPbk2AppViewBase* aAppView );
       
    98 
       
    99     private: // Command handlers, use Cmd prefix
       
   100          void CmdOpenSettingsViewL(
       
   101                 MPbk2ContactUiControl& aControl,
       
   102                 const CPbk2AppViewBase* aAppView,
       
   103                 TUid aViewId );
       
   104         void CmdOpenPreviousViewL(
       
   105                 MPbk2ContactUiControl& aControl,
       
   106                 const CPbk2AppViewBase* aAppView );
       
   107         void CmdOpenHelpL(
       
   108                 MPbk2ContactUiControl& aControl,
       
   109                 const CPbk2AppViewBase* aAppView );
       
   110         TBool CmdGenericCommandL(
       
   111                 TPbk2CommandId aCommandId,
       
   112                 MPbk2ContactUiControl& aControl );
       
   113 
       
   114     private: // Implementation
       
   115         CPbk2CommandHandler();
       
   116         void ConstructL();
       
   117         void PerformStandardMenuFilteringL(
       
   118                 TInt aResourceId,
       
   119                 CEikMenuPane* aMenuPane,
       
   120                 MPbk2ContactUiControl& aControl );
       
   121         void PerformStoreSpecificFilteringL(
       
   122                 TInt aResourceId,
       
   123                 CEikMenuPane* aMenuPane,
       
   124                 MPbk2ContactUiControl& aControl );
       
   125         void PerformFieldTypeBasedFilteringL(
       
   126                 TInt aResourceId,
       
   127                 CEikMenuPane* aMenuPane,
       
   128                 MPbk2ContactUiControl& aControl );
       
   129         TBool AreSelectedContactsFromReadOnlyStoreL(
       
   130                 MPbk2ContactUiControl& aControl );
       
   131         TBool IsFromReadOnlyStore(
       
   132                 const MVPbkContactLink& aContactLink ) const;
       
   133         TBool HasSpeedDialL(
       
   134                 MPbk2ContactUiControl& aControl );
       
   135         TInt ToStoreFieldIndexL(
       
   136                 TInt aPresIndex,
       
   137                 const MVPbkStoreContact* aStoreContact );
       
   138 
       
   139     private: // Data
       
   140         /// Own: Command factory
       
   141         MPbk2CommandFactory* iCommandFactory;
       
   142         /// Own: Command store
       
   143         CPbk2CommandStore* iCommandStore;
       
   144         /// Own: AIW interest array
       
   145         CPbk2AiwInterestArray* iAiwInterestArray;
       
   146         /// Own: Application services
       
   147         CPbk2ApplicationServices* iAppServices;
       
   148         /// Own: Extension manager
       
   149         CPbk2UIExtensionManager* iExtensionManager;
       
   150         /// Own: Contact relocator
       
   151         CPbk2ContactRelocator* iContactRelocator;
       
   152     };
       
   153 
       
   154 #endif // CPBK2COMMANDHANDLER_H
       
   155 
       
   156 // End of File