userlibandfileserver/domainmgr/inc/domainpolicy.h
author hgs
Mon, 04 Oct 2010 12:03:52 +0100
changeset 279 957c583b417b
parent 0 a41df078684a
permissions -rw-r--r--
201039_07
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
     1
// Copyright (c) 2002-2010 Nokia Corporation and/or its subsidiary(-ies).
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     2
// All rights reserved.
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     3
// This component and the accompanying materials are made available
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     4
// under the terms of the License "Eclipse Public License v1.0"
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     5
// which accompanies this distribution, and is available
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     7
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     8
// Initial Contributors:
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    10
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    11
// Contributors:
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    12
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    13
// Description:
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    14
// Contains the Domain Manager interface for clients providing policy 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    15
// information. Typically this is the same client that acts in the 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    16
// "Domain Controller" role.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    17
//
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    18
// There are two versions of the policy API - the original V1 and the new V2.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    19
// V2 builds upon V1 and specifies the states which clients are allowed to defer 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    20
// their transition timeout if they have not finished, up to a max number of 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    21
// times. This is part of the Domain Manager Transition Monitoring feature.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    22
//
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    23
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    24
// WARNING: This file contains some APIs which are internal and are subject
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    25
//          to change without notice. Such APIs should therefore not be used
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    26
//          outside the Kernel and Hardware Services package.
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    27
//
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    28
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    29
#ifndef __DOMAIN_POLICY_H__
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    30
#define __DOMAIN_POLICY_H__
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    31
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    32
#include <e32std.h>
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    33
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    34
#include <domaindefs.h>
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    35
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    36
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    37
/**
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    38
Defines the characteristics of a domain.
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    39
*/
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    40
struct TDmDomainSpec
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    41
	{
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    42
	/**	The 16-bit domain identifier */
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    43
	TDmDomainId					iId;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    44
	
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    45
	/**	The domain identifier of the domain's parent */
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    46
	TDmDomainId					iParentId;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    47
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    48
	/**	The security capability required to join this domain */
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    49
	TStaticSecurityPolicy		iJoinPolicy;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    50
	
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    51
	/**	The initial state of the domain after construction */
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    52
	TDmDomainState				iInitState;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    53
	
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    54
	/**	The total time allowed for the domain to complete a state transition.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    55
	Members of the domain must acknowledge a transition within this time.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    56
	Measured in microseconds. */
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    57
	TUint32						iTimeBudgetUs;
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    58
	};
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    59
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    60
#define TDM_DOMAIN_SPEC_END  {KDmIdNone, KDmIdNone,	_INIT_SECURITY_POLICY_PASS,	0, 0}
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    61
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    62
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    63
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    64
/**
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    65
Defines the overall traversal and failure policy for a particular 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    66
domain hierarchy and is returned by DmPolicy::GetPolicy().
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    67
Note the failure policy can be overridden for individual 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    68
states in V2 policies. 
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    69
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    70
@see TDmTransitionFailurePolicy
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    71
*/
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    72
class TDmHierarchyPolicy
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    73
	{
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    74
public:
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    75
	/** Direction of traversal if target state is after current state */
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    76
	TDmTraverseDirection iPositiveTransitions;
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    77
	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    78
	/**	Direction of traversal if target state is before current state */
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    79
	TDmTraverseDirection iNegativeTransitions;
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    80
	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    81
	/** Policy which outlines the action upon transition failure */
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    82
	TDmTransitionFailurePolicy iFailurePolicy;
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    83
	};
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    84
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    85
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    86
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    87
/**
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    88
Defines the characteristics of a state and is used by entry points introduced
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    89
in version 2 of the policy API. The structure itself is also versioned with V1 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    90
in use with version 2 policy libraries. 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    91
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    92
Policy providers provide an object of this type for each state they want to:
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    93
- enable the Transition Monitoring feature or/and
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    94
- override the default failure policy
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
    95
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    96
Enabling transition monitoring will allow trusted clients to receive more time
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    97
to complete their work before final acknowledgment. Enable transition 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    98
monitoring to ensure a fair completion of the transition e.g. shutdown system.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
    99
Where transition monitoring is enabled the Domain level timer is not used
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   100
and iTimeBudgetUs provided in TDmDomainSpec is ignored.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   101
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   102
The global failure policy is returned by DmPolicy::GetPolicy() and in V1 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   103
policies this applies to all state transitions. iFailurePolicy in this 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   104
structure allows different failure policies for different state transitions. 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   105
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   106
@see DmPolicy::GetStateSpec()
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   107
*/
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   108
struct SDmStateSpecV1
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   109
	{
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   110
	/**	The destination state of the transition */
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   111
	TDmDomainState		iState;
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   112
	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   113
	/** Transition Monitoring: member transition timeout granularity, in 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   114
	milliseconds, e.g. 200ms. Set to 0 to not use transition monitoring for 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   115
	this state. */
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   116
	TInt16				iTimeoutMs;	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   117
		
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   118
	/** Transition Monitoring: maximum number of times a domain member may be 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   119
	granted an additional timeout period. Set to 0 when transition 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   120
	monitoring not used for this state. */	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   121
	TInt16				iDeferralLimit;	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   122
	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   123
	/** Specifies the failure policy for transitions to the target state, see
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   124
	TDmTransitionFailurePolicy. Overrides the global value returned by 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   125
	the policy function DmPolicyGetPolicy(). 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   126
	Set to ETransitionFailureUsePolicyFromOrdinal3 if override not required. */	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   127
	TInt16			    iFailurePolicy;
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   128
	};
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   129
	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   130
const TInt KSDmStateSpecV1 = 1;
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   131
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   132
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   133
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   134
/**
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   135
Defines the function type for a static function that is implemented by
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   136
a device's domain policy DLL at ordinal 1.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   137
The domain manager uses this function to access the domain
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   138
hierarchy specification. The pointer returned must point to an array of
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   139
TDmDomainSpec objects where the last object in the array is defined
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   140
using the END macro, as shown below.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   141
@code
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   142
	. . .
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   143
	TDM_DOMAIN_SPEC_END
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   144
	};
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   145
@endcode
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   146
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   147
The implementation should return NULL if it is unable to supply the requested
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   148
information due to an error. This will abort policy loading and hierarchy 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   149
creation. 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   150
The implementation must never panic or leave in any way.
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   151
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   152
@see DmPolicy
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   153
*/
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   154
typedef const TDmDomainSpec* (*DmPolicyGetDomainSpecs)();
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   155
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   156
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   157
/**
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   158
Defines the function type for a static function that is implemented by
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   159
a device's domain policy DLL at ordinal 2. The domain manager uses this 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   160
function to release the domain hierarchy specification returned by ordinal 1.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   161
The implementation must never panic or leave in any way.
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   162
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   163
@see DmPolicy
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   164
*/
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   165
typedef void (*DmPolicyRelease) (const TDmDomainSpec* aDomainSpec);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   166
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   167
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   168
/**
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   169
Defines the function type for a static function that is implemented by
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   170
a device's domain policy DLL at ordinal 3. The domain manager uses this 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   171
function to access the hierarchy's policy.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   172
The implementation may return a system-wide error code if it encounters an
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   173
error. This will abort policy loading and hierarchy creation. 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   174
The implementation must never panic or leave in any way.
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   175
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   176
@see DmPolicy
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   177
*/
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   178
typedef TInt (*DmPolicyGetPolicy) (TDmHierarchyPolicy& aPolicy);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   179
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   180
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   181
/**
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   182
Defines the function type for a static function that is implemented by
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   183
a device's domain policy DLL at ordinal 4. The domain manager uses this
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   184
function to obtain the state specification to configure the client transition
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   185
monitoring feature. 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   186
This method is new in V2 of the domain policy and should not be present in 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   187
V1 policy library.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   188
The implementation must never panic or leave in any way.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   189
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   190
The implementation returns either an error or the version of the state 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   191
specification structure used in the array pointed to by aPtr on exit. 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   192
When the return value is >=1, aNumElements must be >0.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   193
Where a state specification is not required (i.e. client transition monitoring 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   194
is not required) the implementation returns 0. When an error occurs a negative
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   195
system-wide error code is returned. In both these cases the output parameters are
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   196
ignored.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   197
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   198
@see SDmStateSpecV1
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   199
@see DmPolicy
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   200
*/
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   201
typedef TInt (*DmPolicyGetStateSpec) (TAny*& aPtr, TUint& aNumElements);
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   202
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   203
/**
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   204
Defines the function type for a static function that is implemented by
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   205
a device's domain policy DLL at ordinal 5. The domain manager uses this 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   206
function to release the state specification returned by ordinal 4. The 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   207
implementation may be empty and simply return if no release action needs 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   208
to be taken.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   209
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   210
This method is new in V2 of the domain policy and should not be present in 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   211
V1 policy library.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   212
The implementation must never panic or leave in any way.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   213
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   214
@see DmPolicy
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   215
*/
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   216
typedef void (*DmPolicyReleaseStateSpec) (TAny* aStateSpec);
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   217
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   218
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   219
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   220
/**
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   221
A set of static functions implemented in a domain hierarchy policy DLL that
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   222
the domain manager uses to access and release the domain hierarchy and 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   223
domain state specifications.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   224
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   225
@see DmPolicyOrdinals
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   226
*/
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   227
class DmPolicy
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   228
	{
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   229
public:
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   230
	// Original policy version methods
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   231
	IMPORT_C static const TDmDomainSpec* GetDomainSpecs();
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   232
	IMPORT_C static void Release(const TDmDomainSpec* aDomainSpec);
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   233
	IMPORT_C static TInt GetPolicy(TDmHierarchyPolicy& aPolicy);
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   234
	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   235
	// Version 2 methods
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   236
	IMPORT_C static TInt GetStateSpec(TAny*& aPtr, TUint& aNumElements);
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   237
	IMPORT_C static void ReleaseStateSpec(TAny* aStateSpec);
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   238
	};
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   239
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   240
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   241
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   242
/**
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   243
Describes the purpose (and thus each function prototype) of each ordinal in the
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   244
policy DLL. There are two versions of this DLL in use:
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   245
- V1 DLLs implement ordinals 1..3
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   246
- V2 DLLs implement ordinals 1..5 
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   247
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   248
@see DmPolicy 
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   249
*/
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   250
enum DmPolicyOrdinals
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   251
	{
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   252
	// Policy DLL version 1 ordinals 
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   253
	EDmPolicyGetDomainSpecs = 1,
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   254
	EDmPolicyRelease,
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   255
	EDmPolicyGetPolicy,
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   256
	
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   257
	// Policy DLL version 2 ordinals for the "Transition Monitoring" feature.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   258
	// These entry points are not needed in V1 policy libraries.
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   259
	EDmPolicyGetStateSpec,
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   260
	EDmPolicyReleaseStateSpec			
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   261
	};
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   262
279
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   263
957c583b417b 201039_07
hgs
parents: 0
diff changeset
   264
0
a41df078684a Convert Kernelhwsrv package from SFL to EPL
John Imhofe
parents:
diff changeset
   265
#endif