sl@0: // Copyright (c) 2002-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: // sl@0: // WARNING: This file contains some APIs which are internal and are subject sl@0: // to change without notice. Such APIs should therefore not be used sl@0: // outside the Kernel and Hardware Services package. sl@0: // sl@0: sl@0: #ifndef __DOMAIN_POLICY_H__ sl@0: #define __DOMAIN_POLICY_H__ sl@0: sl@0: #include sl@0: sl@0: #include sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: Defines the characteristics of a domain. sl@0: */ sl@0: struct TDmDomainSpec sl@0: { sl@0: /** sl@0: The domain identifier. sl@0: */ sl@0: TDmDomainId iId; sl@0: sl@0: /** sl@0: The domain identifier of the domain's parent. sl@0: */ sl@0: TDmDomainId iParentId; sl@0: sl@0: /** sl@0: The security capability required to join this domain sl@0: */ sl@0: TStaticSecurityPolicy iJoinPolicy; sl@0: sl@0: /** sl@0: The initial state of the domain after construction. sl@0: */ sl@0: TDmDomainState iInitState; sl@0: sl@0: /** sl@0: The total time allowed for members of the domain to acknowledge sl@0: a transition. sl@0: */ sl@0: TUint32 iTimeBudgetUs; sl@0: }; sl@0: sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: The possible ways in which the domain manager can behave sl@0: when a transition fails. sl@0: sl@0: This is defined for each domain hierarchy. sl@0: sl@0: @see TDmHierarchyPolicy sl@0: */ sl@0: enum TDmTransitionFailurePolicy sl@0: { sl@0: /** sl@0: The domain manager stops at the first transition failure. sl@0: */ sl@0: ETransitionFailureStop, sl@0: sl@0: /** sl@0: The domain manager continues at any transition failure. sl@0: */ sl@0: ETransitionFailureContinue sl@0: }; sl@0: sl@0: sl@0: sl@0: /** sl@0: @internalTechnology sl@0: sl@0: Defines the policy for a particular domain hierarchy. sl@0: */ sl@0: class TDmHierarchyPolicy sl@0: { sl@0: public: sl@0: /** sl@0: direction of traverse if target state is after current state sl@0: */ sl@0: TDmTraverseDirection iPositiveTransitions; sl@0: /** sl@0: direction of traverse if target state is before current state sl@0: */ sl@0: TDmTraverseDirection iNegativeTransitions; sl@0: /** sl@0: policy which outlines the action upon transition failure sl@0: */ sl@0: TDmTransitionFailurePolicy iFailurePolicy; sl@0: }; sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: Defines the function type for a static function that is implemented by sl@0: a device's domain policy DLL. sl@0: sl@0: The domain manager uses this function to access the hierarchy's policy. sl@0: */ sl@0: typedef const TDmDomainSpec* (*DmPolicyGetDomainSpecs)(); sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: Defines the function type for a static function that is implemented by sl@0: a device's domain policy DLL. sl@0: sl@0: The domain manager uses this function to release the domain sl@0: hierarchy specification. sl@0: */ sl@0: typedef void (*DmPolicyRelease) (const TDmDomainSpec* aDomainSpec); sl@0: sl@0: sl@0: /** sl@0: @internalAll sl@0: sl@0: Defines the function type for a static function that is implemented by sl@0: a device's domain policy DLL. sl@0: sl@0: The domain manager uses this function to access the domain sl@0: hierarchy specification. sl@0: */ sl@0: typedef TInt (*DmPolicyGetPolicy) (TDmHierarchyPolicy& aPolicy); sl@0: sl@0: /** sl@0: @publishedPartner sl@0: @released sl@0: sl@0: A set of static functions implemented by a device's domain policy DLL that sl@0: the domain manager uses to access, and release, the domain sl@0: hierarchy specification. sl@0: */ sl@0: class DmPolicy sl@0: { sl@0: public: sl@0: IMPORT_C static const TDmDomainSpec* GetDomainSpecs(); sl@0: IMPORT_C static void Release(const TDmDomainSpec* aDomainSpec); sl@0: IMPORT_C static TInt GetPolicy(TDmHierarchyPolicy& aPolicy); sl@0: }; sl@0: sl@0: sl@0: /** sl@0: @internalTechnology sl@0: */ sl@0: enum DmPolicyOrdinals sl@0: { sl@0: EDmPolicyGetDomainSpecs = 1, sl@0: EDmPolicyRelease, sl@0: EDmPolicyGetPolicy sl@0: }; sl@0: sl@0: #endif