profilesapplication/Profiles/ProfilesGSTonesPlugin/src/CProfilesGSTonesViewFeatures.cpp
branchRCL_3
changeset 19 cd54903d48da
parent 0 ca436256272f
equal deleted inserted replaced
18:b7fa36b488f8 19:cd54903d48da
       
     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:  Wraps the information about variable features of GS Tones
       
    15 *                View.
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 // CLASS HEADER
       
    22 #include "CProfilesGSTonesViewFeatures.h"
       
    23 
       
    24 // INTERNAL INCLUDES
       
    25 #include "ProfilesDebug.h"
       
    26 
       
    27 // SYSTEM INCLUDES
       
    28 #include <centralrepository.h>
       
    29 #include <ProfileEngineDomainCRKeys.h>
       
    30 
       
    31 // ============================ MEMBER FUNCTIONS ===============================
       
    32 
       
    33 // Destructor
       
    34 CProfilesGSTonesViewFeatures::~CProfilesGSTonesViewFeatures()
       
    35     {
       
    36     }
       
    37 
       
    38 // -----------------------------------------------------------------------------
       
    39 // CProfilesGSTonesViewFeatures::ConstructL
       
    40 // -----------------------------------------------------------------------------
       
    41 //
       
    42 void CProfilesGSTonesViewFeatures::ConstructL()
       
    43     {
       
    44     PRODEBUG( "CProfilesGSTonesViewFeatures::ConstructL begin" );
       
    45     CRepository* profilesLVSession = CRepository::NewLC( KCRUidProfilesLV );
       
    46     TInt error( profilesLVSession->Get( KProEngTonesViewLVFlags,
       
    47                                         iLocalFeatures ) );
       
    48     // If the key isn't found, all the local features are disabled:
       
    49     if( error && ( error != KErrNotFound ) )
       
    50         {
       
    51         User::Leave( error );
       
    52         }
       
    53 
       
    54     CleanupStack::PopAndDestroy( profilesLVSession );
       
    55     PRODEBUG( "CProfilesGSTonesViewFeatures::ConstructL end" );
       
    56     }
       
    57 
       
    58 // -----------------------------------------------------------------------------
       
    59 // CProfilesGSTonesViewFeatures::NewL
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CProfilesGSTonesViewFeatures*
       
    63         CProfilesGSTonesViewFeatures::NewL()
       
    64     {
       
    65     CProfilesGSTonesViewFeatures* self = new ( ELeave )
       
    66         CProfilesGSTonesViewFeatures();
       
    67     CleanupStack::PushL( self );
       
    68     self->ConstructL();
       
    69     CleanupStack::Pop( self );
       
    70     return self;
       
    71     }
       
    72 
       
    73 // -----------------------------------------------------------------------------
       
    74 // CProfilesGSTonesViewFeatures::IsLocalFeatureSupported
       
    75 // -----------------------------------------------------------------------------
       
    76 //
       
    77 TBool CProfilesGSTonesViewFeatures::IsLocalFeatureSupported(
       
    78         TUint32 aFeatureId ) const
       
    79     {
       
    80     return ( iLocalFeatures & aFeatureId );
       
    81     }
       
    82 
       
    83 // End Of File
       
    84 
       
    85 
       
    86