omaprovisioning/provisioning/ProvisioningEngine/Src/WPContextManagerFactoryMulti.cpp
changeset 0 b497e44ab2fc
equal deleted inserted replaced
-1:000000000000 0:b497e44ab2fc
       
     1 /*
       
     2 * Copyright (c) 2002-2006 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:  Multiple context manager.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 //  INCLUDE FILES
       
    20 
       
    21 #include <centralrepository.h>
       
    22 #include "ProvisioningVariant.hrh"
       
    23 #include "WPContextManagerFactory.h"
       
    24 #include "CWPBindingContextManager.h"
       
    25 #include "CWPMultiContextManager.h"
       
    26 #include "ProvisioningInternalCRKeys.h"
       
    27 
       
    28 
       
    29 // CONSTANTS
       
    30 
       
    31 // ============================ MEMBER FUNCTIONS ===============================
       
    32 
       
    33 // -----------------------------------------------------------------------------
       
    34 // WPContextManagerFactory::CreateL
       
    35 // Two-phased constructor.
       
    36 // -----------------------------------------------------------------------------
       
    37 //
       
    38 MWPContextManager* WPContextManagerFactory::CreateL()
       
    39 	{
       
    40 
       
    41     TInt value( 0 );
       
    42 
       
    43     CRepository* repository = CRepository::NewLC( KCRUidOMAProvisioningLV );
       
    44     User::LeaveIfError( repository->Get( KOMAProvisioningLVFlag, value ) );
       
    45     CleanupStack::PopAndDestroy(); // repository
       
    46 
       
    47     MWPContextManager* manager = NULL;
       
    48     if( value & EWPMultipleCxBinding )
       
    49         {
       
    50         manager = CWPBindingContextManager::NewL();
       
    51         }
       
    52     else
       
    53         {
       
    54         manager = CWPMultiContextManager::NewL();
       
    55         }
       
    56 
       
    57     return manager;
       
    58 	}
       
    59 
       
    60 //  End of File