sl@0: // Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). sl@0: // All rights reserved. sl@0: // This component and the accompanying materials are made available sl@0: // under the terms of "Eclipse Public License v1.0" sl@0: // which accompanies this distribution, and is available sl@0: // at the URL "http://www.eclipse.org/legal/epl-v10.html". sl@0: // sl@0: // Initial Contributors: sl@0: // Nokia Corporation - initial contribution. sl@0: // sl@0: // Contributors: sl@0: // sl@0: // Description: sl@0: // sl@0: sl@0: sl@0: sl@0: // INCLUDE FILES sl@0: #include sl@0: #include "featmgrtlsdata.h" sl@0: #include sl@0: #include "featmgrdebug.h" sl@0: #include sl@0: sl@0: // LOCAL CONSTANTS AND MACROS sl@0: _LIT( KPanicCategory, "FeatMgr" ); sl@0: sl@0: sl@0: // ============================= LOCAL FUNCTIONS =============================== sl@0: sl@0: // ============================ MEMBER FUNCTIONS =============================== sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // FeatureManager::InitializeLibL() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void FeatureManager::InitializeLibL() sl@0: { sl@0: FUNC_LOG sl@0: sl@0: if ( !Dll::Tls() ) sl@0: { sl@0: Dll::SetTls( CFeatMgrTlsData::NewL() ); sl@0: } sl@0: sl@0: // Increase the client count (self) sl@0: TlsData()->IncreaseClientCount(); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // FeatureManager::UnInitializeLibL() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C void FeatureManager::UnInitializeLib() sl@0: { sl@0: FUNC_LOG sl@0: sl@0: if ( Dll::Tls() ) sl@0: { sl@0: CFeatMgrTlsData::DeleteClient(); sl@0: } sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // FeatureManager::FeatureSupported() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: EXPORT_C TBool FeatureManager::FeatureSupported( TInt aFeature ) sl@0: { sl@0: TFeatureEntry feature( TUid::Uid(aFeature) ); sl@0: TInt err( TlsData()->FeatureSupported( feature ) ); sl@0: sl@0: return (( err > 0 ) ? ETrue : EFalse ); sl@0: } sl@0: sl@0: // ----------------------------------------------------------------------------- sl@0: // FeatureManager::TlsData() sl@0: // ----------------------------------------------------------------------------- sl@0: // sl@0: CFeatMgrTlsData* FeatureManager::TlsData() sl@0: { sl@0: CFeatMgrTlsData* tlsData = STATIC_CAST( CFeatMgrTlsData*, Dll::Tls() ); sl@0: sl@0: __ASSERT_ALWAYS( tlsData, User::Panic( KPanicCategory, ELibNotInitialized ) ); sl@0: sl@0: return tlsData; sl@0: } sl@0: sl@0: // End of File