cellular/telephonysettings/src/PsetVariationProxy.cpp
changeset 46 2fa1fa551b0b
parent 42 35488577e233
child 48 78df25012fda
equal deleted inserted replaced
42:35488577e233 46:2fa1fa551b0b
     1 /*
       
     2 * Copyright (c) 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: Implementation of CPSetVariationProxy class.
       
    15 *
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include "psetvariationproxy.h" 
       
    21 #include <centralrepository.h>
       
    22 #include <settingsinternalcrkeys.h> 
       
    23 #include <telservicesinternalcrkeys.h>
       
    24 
       
    25 // ---------------------------------------------------------------------------
       
    26 // Constructor
       
    27 // ---------------------------------------------------------------------------
       
    28 //
       
    29 CPSetVariationProxy::CPSetVariationProxy()
       
    30     {   
       
    31     }
       
    32 
       
    33 // ---------------------------------------------------------------------------
       
    34 // Destructor
       
    35 // ---------------------------------------------------------------------------
       
    36 //
       
    37 CPSetVariationProxy::~CPSetVariationProxy()
       
    38     {       
       
    39     }
       
    40 
       
    41 // ---------------------------------------------------------------------------
       
    42 // NewL
       
    43 // ---------------------------------------------------------------------------
       
    44 //
       
    45 CPSetVariationProxy* CPSetVariationProxy::NewL( 
       
    46         const TUid& aUid, 
       
    47         const TUint aId )
       
    48     {
       
    49     CPSetVariationProxy* self = new ( ELeave ) CPSetVariationProxy();  
       
    50     CleanupStack::PushL( self );
       
    51     self->ConstructL( aUid, aId );
       
    52     CleanupStack::Pop( self );         
       
    53     return self;
       
    54     }
       
    55 
       
    56 // ---------------------------------------------------------------------------
       
    57 // ConstructL
       
    58 // ---------------------------------------------------------------------------
       
    59 //
       
    60 void CPSetVariationProxy::ConstructL( 
       
    61         const TUid& aUid, 
       
    62         const TUint aId  )
       
    63     {
       
    64     TInt keySetting = 0;
       
    65     CRepository* centralRepository = CRepository::NewLC( aUid );
       
    66     User::LeaveIfError( centralRepository->Get( aId, keySetting ) );
       
    67     
       
    68     if( ( aUid == KCRUidPhoneSettings ) && 
       
    69         ( keySetting ) )
       
    70         {
       
    71         iFeature |= KCallWaitingDistiquishNotProvisioned;   
       
    72         }
       
    73     else if ( aUid == KCRUidTelSrvVariation )
       
    74         {
       
    75         iFeature |= keySetting;
       
    76         }
       
    77     
       
    78     CleanupStack::PopAndDestroy( centralRepository );
       
    79     }
       
    80 
       
    81 // ---------------------------------------------------------------------------
       
    82 // IsFeatureEnabled
       
    83 // ---------------------------------------------------------------------------
       
    84 //
       
    85 TBool CPSetVariationProxy::IsFeatureEnabled( TUint aFeature ) const
       
    86     {
       
    87     return aFeature&iFeature;
       
    88     }