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 the License "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: // e32\include\drivers\resourceman.h sl@0: // sl@0: // sl@0: sl@0: /** sl@0: @file sl@0: @publishedPartner sl@0: @released 9.5 sl@0: */ sl@0: #ifndef __RESOURCEMAN_H__ sl@0: #define __RESOURCEMAN_H__ sl@0: sl@0: #ifdef PRM_ENABLE_EXTENDED_VERSION sl@0: #include sl@0: #else sl@0: #include sl@0: #endif sl@0: sl@0: static const TUint KResManControlIoGetVersion=0x0; sl@0: static const TUint KResManControlIoRegisterDynamicResource=0x1; sl@0: static const TUint KResManControlIoDeregisterDynamicResource=0x2; sl@0: static const TUint KResManControlIoRegisterDependency=0x3; sl@0: static const TUint KResManControlIoDeregisterDependency=0x4; sl@0: static const TUint KResManControlIoGetNumDependents=0x5; sl@0: static const TUint KResManControlIoGetDependentsId=0x6; sl@0: sl@0: //Resource controller versions sl@0: static const TUint KResControllerBasicVersion=0x0; sl@0: static const TUint KResControllerExtendedVersion=0x01; sl@0: sl@0: /** sl@0: Resource Manager API class sl@0: API's are exported from this class to kernel side components sl@0: */ sl@0: NONSHARABLE_CLASS (PowerResourceManager) sl@0: { sl@0: public: sl@0: IMPORT_C static TInt RegisterClient(TUint& aClientId, const TDesC8& aName, TOwnerType aType=EOwnerProcess); sl@0: IMPORT_C static TInt DeRegisterClient(TUint aClientId); sl@0: IMPORT_C static TInt GetClientName(TUint aClientId, TUint aTargetClientId, TDes8& aName); sl@0: IMPORT_C static TInt GetClientId(TUint aClientId, TDesC8& aClientName, TUint& aTargetClientId); sl@0: IMPORT_C static TInt GetResourceId(TUint aClientId, TDesC8& aResourceName, TUint& aResourceId); sl@0: IMPORT_C static TInt GetResourceInfo(TUint aClientId, TUint aResourceId, TAny* aInfo); sl@0: IMPORT_C static TInt GetNumResourcesInUseByClient(TUint aClientId, TUint aTargetClientId, TUint& aNumResources); sl@0: IMPORT_C static TInt GetInfoOnResourcesInUseByClient(TUint aClientId, TUint aTargetClientId, TUint& aNumResources, TAny* aInfo); sl@0: IMPORT_C static TInt GetNumClientsUsingResource(TUint aClientId, TUint aResourceId, TUint& aNumClients); sl@0: IMPORT_C static TInt GetInfoOnClientsUsingResource(TUint aClientId, TUint aResourceId, TUint& aNumClients, TAny* aInfo); sl@0: IMPORT_C static TInt AllocReserve(TUint aClientId, TUint8 aNumCl, TUint8 aNumRm); sl@0: IMPORT_C static TInt ChangeResourceState(TUint aClientId, TUint aResourceId, TInt aNewState, TPowerResourceCb* aCb=NULL); sl@0: IMPORT_C static TInt GetResourceState(TUint aClientId, TUint aResourceId, TBool aCached, TInt& aState, TInt& aLevelOwnerId); sl@0: IMPORT_C static TInt GetResourceState(TUint aClientId, TUint aResourceId, TBool aCached, TPowerResourceCb& aCb); sl@0: IMPORT_C static TInt CancelAsyncRequestCallBack(TUint aClientId, TUint aResourceId, TPowerResourceCb& aCb); sl@0: IMPORT_C static TInt RequestNotification(TUint aClientId, TUint aResourceId, DPowerResourceNotification& aN); sl@0: IMPORT_C static TInt RequestNotification(TUint aClientId, TUint aResourceId, DPowerResourceNotification& aN, TInt aThreshold, TBool aDirection); sl@0: IMPORT_C static TInt CancelNotification(TUint aClientId, TUint aResourceId, DPowerResourceNotification& aN); sl@0: IMPORT_C static TInt DeRegisterClientLevelFromResource(TUint aClientId, TUint aResourceId); sl@0: IMPORT_C static TInt ControlIO(TUint aClientId, TUint aFunction, TAny* aParam1, TAny* aParam2, TAny* aParam3 = NULL); sl@0: inline static TInt GetResourceControllerVersion(TUint aClientId, TUint& aVersion); sl@0: #ifdef PRM_ENABLE_EXTENDED_VERSION sl@0: inline static TInt RegisterDynamicResource(TUint aClientId, DDynamicPowerResource* aResource, TUint& aResourceId); sl@0: inline static TInt DeRegisterDynamicResource(TUint aClientId, TUint aResourceId, TInt* aState); sl@0: inline static TInt RegisterResourceDependency(TUint aClientId, SResourceDependencyInfo* aResDependecyInfo1, SResourceDependencyInfo* aResDependencyInfo2); sl@0: inline static TInt DeRegisterResourceDependency(TUint aClientId, TUint aResourceId1, TUint aResourceId2); sl@0: inline static TInt GetNumDependentsForResource(TUint aClientId, TUint aResourceId, TUint& aNumDepResource); sl@0: inline static TInt GetDependentsIdForResource(TUint aClientId, TUint aResourceId, TAny* aResIdArray, TUint& aNumDepResources); sl@0: #endif sl@0: }; sl@0: sl@0: #include sl@0: sl@0: #endif //__RESOURCEMAN_H__