phonebookui/Phonebook/App/src/PbkContactInfoNavigationStrategyFactory.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2002 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 *       Contact Info View group members navigation strategy factory.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include "PbkContactInfoNavigationStrategyFactory.h"  // This class' declaration
       
    22 #include "CPbkContactInfoGroupMemberNavigationStrategy.h"
       
    23 #include "CPbkContactInfoContactNavigationStrategy.h"
       
    24 #include "CPbkContactInfoNoNavigationStrategy.h"
       
    25 #include <pbkconfig.hrh>
       
    26 #include <CPbkContactEngine.h>
       
    27 #include <CPbkConstants.h>
       
    28 
       
    29 
       
    30 
       
    31 // ================= MEMBER FUNCTIONS =======================
       
    32 
       
    33 MPbkContactInfoNavigationStrategy* PbkContactInfoNavigationStrategyFactory::CreateL
       
    34         (CPbkContactEngine& aEngine,
       
    35         MPbkContactInfoNavigationCallback& aCallback,
       
    36         TContactItemId aParentContactId)
       
    37     {
       
    38     MPbkContactInfoNavigationStrategy* ret = NULL;
       
    39 
       
    40     // Check is the contact info view navigation feature enabled
       
    41     TBool navigationEnabled = aEngine.Constants()->
       
    42         LocallyVariatedFeatureEnabled(EPbkLVContactInfoViewNavigation);
       
    43     
       
    44     if (!navigationEnabled)
       
    45         {
       
    46         // No navigation
       
    47         ret = CPbkContactInfoNoNavigationStrategy::NewL();
       
    48         }
       
    49     else if (aParentContactId != KNullContactId)
       
    50         {
       
    51         // Navigate group members
       
    52         ret = CPbkContactInfoGroupMemberNavigationStrategy::NewL(
       
    53                 aEngine, aCallback, aParentContactId);
       
    54         }
       
    55     else
       
    56         {
       
    57         // Navigate all contacts
       
    58         ret = CPbkContactInfoContactNavigationStrategy::NewL(
       
    59                 aEngine, aCallback);
       
    60         }
       
    61 
       
    62     return ret;
       
    63     }
       
    64 
       
    65 //  End of File