1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/kernelhwsrv/userlibandfileserver/domainmgr/inc/domainpolicy.h Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,177 @@
1.4 +// Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies).
1.5 +// All rights reserved.
1.6 +// This component and the accompanying materials are made available
1.7 +// under the terms of the License "Eclipse Public License v1.0"
1.8 +// which accompanies this distribution, and is available
1.9 +// at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.10 +//
1.11 +// Initial Contributors:
1.12 +// Nokia Corporation - initial contribution.
1.13 +//
1.14 +// Contributors:
1.15 +//
1.16 +// Description:
1.17 +//
1.18 +// WARNING: This file contains some APIs which are internal and are subject
1.19 +// to change without notice. Such APIs should therefore not be used
1.20 +// outside the Kernel and Hardware Services package.
1.21 +//
1.22 +
1.23 +#ifndef __DOMAIN_POLICY_H__
1.24 +#define __DOMAIN_POLICY_H__
1.25 +
1.26 +#include <e32std.h>
1.27 +
1.28 +#include <domaindefs.h>
1.29 +
1.30 +
1.31 +
1.32 +
1.33 +/**
1.34 +@publishedPartner
1.35 +@released
1.36 +
1.37 +Defines the characteristics of a domain.
1.38 +*/
1.39 +struct TDmDomainSpec
1.40 + {
1.41 + /**
1.42 + The domain identifier.
1.43 + */
1.44 + TDmDomainId iId;
1.45 +
1.46 + /**
1.47 + The domain identifier of the domain's parent.
1.48 + */
1.49 + TDmDomainId iParentId;
1.50 +
1.51 + /**
1.52 + The security capability required to join this domain
1.53 + */
1.54 + TStaticSecurityPolicy iJoinPolicy;
1.55 +
1.56 + /**
1.57 + The initial state of the domain after construction.
1.58 + */
1.59 + TDmDomainState iInitState;
1.60 +
1.61 + /**
1.62 + The total time allowed for members of the domain to acknowledge
1.63 + a transition.
1.64 + */
1.65 + TUint32 iTimeBudgetUs;
1.66 + };
1.67 +
1.68 +
1.69 +
1.70 +
1.71 +/**
1.72 +@internalAll
1.73 +
1.74 +The possible ways in which the domain manager can behave
1.75 +when a transition fails.
1.76 +
1.77 +This is defined for each domain hierarchy.
1.78 +
1.79 +@see TDmHierarchyPolicy
1.80 +*/
1.81 +enum TDmTransitionFailurePolicy
1.82 + {
1.83 + /**
1.84 + The domain manager stops at the first transition failure.
1.85 + */
1.86 + ETransitionFailureStop,
1.87 +
1.88 + /**
1.89 + The domain manager continues at any transition failure.
1.90 + */
1.91 + ETransitionFailureContinue
1.92 + };
1.93 +
1.94 +
1.95 +
1.96 +/**
1.97 +@internalTechnology
1.98 +
1.99 +Defines the policy for a particular domain hierarchy.
1.100 +*/
1.101 +class TDmHierarchyPolicy
1.102 + {
1.103 +public:
1.104 + /**
1.105 + direction of traverse if target state is after current state
1.106 + */
1.107 + TDmTraverseDirection iPositiveTransitions;
1.108 + /**
1.109 + direction of traverse if target state is before current state
1.110 + */
1.111 + TDmTraverseDirection iNegativeTransitions;
1.112 + /**
1.113 + policy which outlines the action upon transition failure
1.114 + */
1.115 + TDmTransitionFailurePolicy iFailurePolicy;
1.116 + };
1.117 +
1.118 +
1.119 +/**
1.120 +@internalAll
1.121 +
1.122 +Defines the function type for a static function that is implemented by
1.123 +a device's domain policy DLL.
1.124 +
1.125 +The domain manager uses this function to access the hierarchy's policy.
1.126 +*/
1.127 +typedef const TDmDomainSpec* (*DmPolicyGetDomainSpecs)();
1.128 +
1.129 +
1.130 +/**
1.131 +@internalAll
1.132 +
1.133 +Defines the function type for a static function that is implemented by
1.134 +a device's domain policy DLL.
1.135 +
1.136 +The domain manager uses this function to release the domain
1.137 +hierarchy specification.
1.138 +*/
1.139 +typedef void (*DmPolicyRelease) (const TDmDomainSpec* aDomainSpec);
1.140 +
1.141 +
1.142 +/**
1.143 +@internalAll
1.144 +
1.145 +Defines the function type for a static function that is implemented by
1.146 +a device's domain policy DLL.
1.147 +
1.148 +The domain manager uses this function to access the domain
1.149 +hierarchy specification.
1.150 +*/
1.151 +typedef TInt (*DmPolicyGetPolicy) (TDmHierarchyPolicy& aPolicy);
1.152 +
1.153 +/**
1.154 +@publishedPartner
1.155 +@released
1.156 +
1.157 +A set of static functions implemented by a device's domain policy DLL that
1.158 +the domain manager uses to access, and release, the domain
1.159 +hierarchy specification.
1.160 +*/
1.161 +class DmPolicy
1.162 + {
1.163 +public:
1.164 + IMPORT_C static const TDmDomainSpec* GetDomainSpecs();
1.165 + IMPORT_C static void Release(const TDmDomainSpec* aDomainSpec);
1.166 + IMPORT_C static TInt GetPolicy(TDmHierarchyPolicy& aPolicy);
1.167 + };
1.168 +
1.169 +
1.170 +/**
1.171 +@internalTechnology
1.172 +*/
1.173 +enum DmPolicyOrdinals
1.174 + {
1.175 + EDmPolicyGetDomainSpecs = 1,
1.176 + EDmPolicyRelease,
1.177 + EDmPolicyGetPolicy
1.178 + };
1.179 +
1.180 +#endif