29
|
1 |
// Copyright (c) 2002-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 the License "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".
|
|
7 |
//
|
|
8 |
// Initial Contributors:
|
|
9 |
// Nokia Corporation - initial contribution.
|
|
10 |
//
|
|
11 |
// Contributors:
|
|
12 |
//
|
|
13 |
// Description:
|
|
14 |
//
|
|
15 |
// WARNING: This file contains some APIs which are internal and are subject
|
|
16 |
// to change without notice. Such APIs should therefore not be used
|
|
17 |
// outside the Kernel and Hardware Services package.
|
|
18 |
//
|
|
19 |
|
|
20 |
#ifndef __DOMAIN_POLICY_H__
|
|
21 |
#define __DOMAIN_POLICY_H__
|
|
22 |
|
|
23 |
#include <e32std.h>
|
|
24 |
|
|
25 |
#include <domaindefs.h>
|
|
26 |
|
|
27 |
|
|
28 |
|
|
29 |
|
|
30 |
/**
|
|
31 |
@publishedPartner
|
|
32 |
@released
|
|
33 |
|
|
34 |
Defines the characteristics of a domain.
|
|
35 |
*/
|
|
36 |
struct TDmDomainSpec
|
|
37 |
{
|
|
38 |
/**
|
|
39 |
The domain identifier.
|
|
40 |
*/
|
|
41 |
TDmDomainId iId;
|
|
42 |
|
|
43 |
/**
|
|
44 |
The domain identifier of the domain's parent.
|
|
45 |
*/
|
|
46 |
TDmDomainId iParentId;
|
|
47 |
|
|
48 |
/**
|
|
49 |
The security capability required to join this domain
|
|
50 |
*/
|
|
51 |
TStaticSecurityPolicy iJoinPolicy;
|
|
52 |
|
|
53 |
/**
|
|
54 |
The initial state of the domain after construction.
|
|
55 |
*/
|
|
56 |
TDmDomainState iInitState;
|
|
57 |
|
|
58 |
/**
|
|
59 |
The total time allowed for members of the domain to acknowledge
|
|
60 |
a transition.
|
|
61 |
*/
|
|
62 |
TUint32 iTimeBudgetUs;
|
|
63 |
};
|
|
64 |
|
|
65 |
|
|
66 |
|
|
67 |
|
|
68 |
/**
|
|
69 |
@internalAll
|
|
70 |
|
|
71 |
The possible ways in which the domain manager can behave
|
|
72 |
when a transition fails.
|
|
73 |
|
|
74 |
This is defined for each domain hierarchy.
|
|
75 |
|
|
76 |
@see TDmHierarchyPolicy
|
|
77 |
*/
|
|
78 |
enum TDmTransitionFailurePolicy
|
|
79 |
{
|
|
80 |
/**
|
|
81 |
The domain manager stops at the first transition failure.
|
|
82 |
*/
|
|
83 |
ETransitionFailureStop,
|
|
84 |
|
|
85 |
/**
|
|
86 |
The domain manager continues at any transition failure.
|
|
87 |
*/
|
|
88 |
ETransitionFailureContinue
|
|
89 |
};
|
|
90 |
|
|
91 |
|
|
92 |
|
|
93 |
/**
|
|
94 |
@internalTechnology
|
|
95 |
|
|
96 |
Defines the policy for a particular domain hierarchy.
|
|
97 |
*/
|
|
98 |
class TDmHierarchyPolicy
|
|
99 |
{
|
|
100 |
public:
|
|
101 |
/**
|
|
102 |
direction of traverse if target state is after current state
|
|
103 |
*/
|
|
104 |
TDmTraverseDirection iPositiveTransitions;
|
|
105 |
/**
|
|
106 |
direction of traverse if target state is before current state
|
|
107 |
*/
|
|
108 |
TDmTraverseDirection iNegativeTransitions;
|
|
109 |
/**
|
|
110 |
policy which outlines the action upon transition failure
|
|
111 |
*/
|
|
112 |
TDmTransitionFailurePolicy iFailurePolicy;
|
|
113 |
};
|
|
114 |
|
|
115 |
|
|
116 |
/**
|
|
117 |
@internalAll
|
|
118 |
|
|
119 |
Defines the function type for a static function that is implemented by
|
|
120 |
a device's domain policy DLL.
|
|
121 |
|
|
122 |
The domain manager uses this function to access the hierarchy's policy.
|
|
123 |
*/
|
|
124 |
typedef const TDmDomainSpec* (*DmPolicyGetDomainSpecs)();
|
|
125 |
|
|
126 |
|
|
127 |
/**
|
|
128 |
@internalAll
|
|
129 |
|
|
130 |
Defines the function type for a static function that is implemented by
|
|
131 |
a device's domain policy DLL.
|
|
132 |
|
|
133 |
The domain manager uses this function to release the domain
|
|
134 |
hierarchy specification.
|
|
135 |
*/
|
|
136 |
typedef void (*DmPolicyRelease) (const TDmDomainSpec* aDomainSpec);
|
|
137 |
|
|
138 |
|
|
139 |
/**
|
|
140 |
@internalAll
|
|
141 |
|
|
142 |
Defines the function type for a static function that is implemented by
|
|
143 |
a device's domain policy DLL.
|
|
144 |
|
|
145 |
The domain manager uses this function to access the domain
|
|
146 |
hierarchy specification.
|
|
147 |
*/
|
|
148 |
typedef TInt (*DmPolicyGetPolicy) (TDmHierarchyPolicy& aPolicy);
|
|
149 |
|
|
150 |
/**
|
|
151 |
@publishedPartner
|
|
152 |
@released
|
|
153 |
|
|
154 |
A set of static functions implemented by a device's domain policy DLL that
|
|
155 |
the domain manager uses to access, and release, the domain
|
|
156 |
hierarchy specification.
|
|
157 |
*/
|
|
158 |
class DmPolicy
|
|
159 |
{
|
|
160 |
public:
|
|
161 |
IMPORT_C static const TDmDomainSpec* GetDomainSpecs();
|
|
162 |
IMPORT_C static void Release(const TDmDomainSpec* aDomainSpec);
|
|
163 |
IMPORT_C static TInt GetPolicy(TDmHierarchyPolicy& aPolicy);
|
|
164 |
};
|
|
165 |
|
|
166 |
|
|
167 |
/**
|
|
168 |
@internalTechnology
|
|
169 |
*/
|
|
170 |
enum DmPolicyOrdinals
|
|
171 |
{
|
|
172 |
EDmPolicyGetDomainSpecs = 1,
|
|
173 |
EDmPolicyRelease,
|
|
174 |
EDmPolicyGetPolicy
|
|
175 |
};
|
|
176 |
|
|
177 |
#endif
|