Update contrib.
1 // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
2 // All rights reserved.
3 // This component and the accompanying materials are made available
4 // under the terms of "Eclipse Public License v1.0"
5 // which accompanies this distribution, and is available
6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
8 // Initial Contributors:
9 // Nokia Corporation - initial contribution.
19 #include <featmgr/featmgr.h>
20 #include "featmgrtlsdata.h"
21 #include <featmgr/featurecontrol.h>
22 #include "featmgrdebug.h"
25 // LOCAL CONSTANTS AND MACROS
26 _LIT( KPanicCategory, "FeatMgr" );
29 // ============================= LOCAL FUNCTIONS ===============================
31 // ============================ MEMBER FUNCTIONS ===============================
33 // -----------------------------------------------------------------------------
34 // FeatureManager::InitializeLibL()
35 // -----------------------------------------------------------------------------
37 EXPORT_C void FeatureManager::InitializeLibL()
43 Dll::SetTls( CFeatMgrTlsData::NewL() );
46 // Increase the client count (self)
47 TlsData()->IncreaseClientCount();
50 // -----------------------------------------------------------------------------
51 // FeatureManager::UnInitializeLibL()
52 // -----------------------------------------------------------------------------
54 EXPORT_C void FeatureManager::UnInitializeLib()
60 CFeatMgrTlsData::DeleteClient();
64 // -----------------------------------------------------------------------------
65 // FeatureManager::FeatureSupported()
66 // -----------------------------------------------------------------------------
68 EXPORT_C TBool FeatureManager::FeatureSupported( TInt aFeature )
70 TFeatureEntry feature( TUid::Uid(aFeature) );
71 TInt err( TlsData()->FeatureSupported( feature ) );
73 return (( err > 0 ) ? ETrue : EFalse );
76 // -----------------------------------------------------------------------------
77 // FeatureManager::TlsData()
78 // -----------------------------------------------------------------------------
80 CFeatMgrTlsData* FeatureManager::TlsData()
82 CFeatMgrTlsData* tlsData = STATIC_CAST( CFeatMgrTlsData*, Dll::Tls() );
84 __ASSERT_ALWAYS( tlsData, User::Panic( KPanicCategory, ELibNotInitialized ) );