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