phonebookui/Phonebook2/CommonUI/inc/CPbk2ContactNavigation.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 contact navigator.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CPBK2CONTACTNAVIGATION_H
       
    20 #define CPBK2CONTACTNAVIGATION_H
       
    21 
       
    22 //  INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "CPbk2NavigationBase.h"
       
    25 #include <MPbk2ContactNavigationLoader.h>
       
    26 #include <AknNaviDecoratorObserver.h>
       
    27 
       
    28 //  FORWARD DECLARATIONS
       
    29 class MVPbkContactLink;
       
    30 class MVPbkContactViewBase;
       
    31 class MPbk2NavigationObserver;
       
    32 
       
    33 //  CLASS DECLARATION
       
    34 
       
    35 /**
       
    36  * Phonebook 2 contact navigator.
       
    37  * Responsible for implementing 'sideways navigation' navigation strategy.
       
    38  * Listens to users navigation events, which are then processed by it.
       
    39  * The next action is determined by the set scroll view. A navigation
       
    40  * event initates the loading of the next viewed contact.
       
    41  */
       
    42 class CPbk2ContactNavigation : public CPbk2NavigationBase,
       
    43                                private MAknNaviDecoratorObserver
       
    44     {
       
    45     public:  // Constructors and destructor
       
    46 
       
    47         /**
       
    48          * Creates a new instance of this class.
       
    49          *
       
    50          * @param aViewId                       View id.
       
    51          * @param aObserver                     Navigation observer.
       
    52          * @param aNavigationLoader             Navigation interface for
       
    53          *                                      loading contacts.
       
    54          * @param aStoreList                    List of stores this
       
    55          *                                      navigator observes.
       
    56          * @param aNavigatorFormatResourceId    Id of the textual format
       
    57          *                                      resource string used in
       
    58          *                                      the indicator.
       
    59          * @return  A new instance of this class.
       
    60          */
       
    61         static CPbk2ContactNavigation* NewL(
       
    62                 TUid aViewId,
       
    63                 MPbk2NavigationObserver& aObserver,
       
    64                 MPbk2ContactNavigationLoader& aNavigationLoader,
       
    65                 TArray<MVPbkContactStore*> aStoreList,
       
    66                 const TInt aNavigatorFormatResourceId );
       
    67 
       
    68         /**
       
    69          * Destructor.
       
    70          */
       
    71         ~CPbk2ContactNavigation();
       
    72 
       
    73     public: // From MPbk2ContactNavigation
       
    74         void UpdateNaviIndicatorsL(
       
    75                 const MVPbkContactLink& aContactLink ) const;
       
    76         TBool HandleCommandKeyL(
       
    77                 const TKeyEvent& aKeyEvent,
       
    78                 TEventCode aType );
       
    79 
       
    80     private: // From MVPbkContactViewObserver
       
    81         void ContactAddedToView(
       
    82                 MVPbkContactViewBase& aView,
       
    83                 TInt aIndex,
       
    84                 const MVPbkContactLink& aContactLink );
       
    85         void ContactRemovedFromView(
       
    86                 MVPbkContactViewBase& aView,
       
    87                 TInt aIndex,
       
    88                 const MVPbkContactLink& aContactLink );
       
    89         
       
    90     private: // From MAknNaviDecoratorObserver
       
    91         void HandleNaviDecoratorEventL(
       
    92                 TInt aEventID );
       
    93 
       
    94     private: // Implementation
       
    95         CPbk2ContactNavigation(
       
    96                 TUid aViewId,
       
    97                 MPbk2NavigationObserver& aObserver,
       
    98                 MPbk2ContactNavigationLoader& aNavigationLoader,
       
    99                 TArray<MVPbkContactStore*> aStoreList,
       
   100                 const TInt aNavigatorFormatResourceId );
       
   101         void ConstructL();
       
   102         void NavigateContactL(
       
   103                 TInt aDirection );
       
   104         void UpdateAfterViewEventL() const;
       
   105         void SetTabTextL(
       
   106                 const TUid aViewId,
       
   107                 const TDesC& aText ) const;
       
   108 
       
   109     private: // Data
       
   110         /// Own: View id
       
   111         TUid iViewId;
       
   112         /// Own: Format for the navigation text
       
   113         const TInt iNavigatorFormatResourceId;
       
   114     };
       
   115 
       
   116 #endif // CPBK2CONTACTNAVIGATION_H
       
   117 
       
   118 // End of File