epoc32/include/e32capability.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
// Copyright (c) 2001-2009 Nokia Corporation and/or its subsidiary(-ies).
williamr@2
     2
// All rights reserved.
williamr@2
     3
// This component and the accompanying materials are made available
williamr@4
     4
// under the terms of the License "Eclipse Public License v1.0"
williamr@2
     5
// which accompanies this distribution, and is available
williamr@4
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     7
//
williamr@2
     8
// Initial Contributors:
williamr@2
     9
// Nokia Corporation - initial contribution.
williamr@2
    10
//
williamr@2
    11
// Contributors:
williamr@2
    12
//
williamr@2
    13
// Description:
williamr@2
    14
// e32\include\e32capability.h
williamr@2
    15
// Platform security capability definitions
williamr@2
    16
// Used by both source code and tools
williamr@2
    17
// This file can be directly included into C++ tools such as ROMBUILD to allow
williamr@2
    18
// capabilities to be specified by name. To do the same for MAKMAKE (in MMP
williamr@2
    19
// files) some perl code will be needed to parse this file and extract the
williamr@2
    20
// capability names and values.
williamr@2
    21
// 
williamr@2
    22
//
williamr@2
    23
williamr@2
    24
#ifndef __E32CAPABILITY_H__
williamr@2
    25
#define __E32CAPABILITY_H__
williamr@2
    26
williamr@2
    27
/**
williamr@2
    28
An enumeration that defines the set of all supported capabilities.
williamr@2
    29
williamr@2
    30
@publishedAll
williamr@2
    31
@released
williamr@2
    32
*/
williamr@2
    33
enum TCapability
williamr@2
    34
	{
williamr@2
    35
	/**
williamr@2
    36
	Grants write access to executables and shared read-only resources.
williamr@2
    37
	
williamr@2
    38
	This is the most critical capability as it grants access to executables and
williamr@2
    39
	therefore to their capabilities. It also grants write access to
williamr@2
    40
	the /sys and /resource directories.
williamr@2
    41
	*/
williamr@2
    42
	ECapabilityTCB				= 0,
williamr@2
    43
	
williamr@2
    44
	
williamr@2
    45
	/**
williamr@2
    46
	Grants direct access to all communication device drivers. This includes:
williamr@2
    47
	the EComm, Ethernet, USB device drivers etc.
williamr@2
    48
	*/
williamr@2
    49
	ECapabilityCommDD			= 1,
williamr@2
    50
	
williamr@2
    51
	
williamr@2
    52
	/**
williamr@2
    53
	Grants the right:
williamr@2
    54
	
williamr@2
    55
	- to kill any process in the system
williamr@2
    56
	- to power off unused peripherals
williamr@2
    57
	- to switch the machine into standby state
williamr@2
    58
	- to wake the machine up
williamr@2
    59
	- to power the machine down completely.
williamr@2
    60
	
williamr@2
    61
	Note that this does not control access to anything and everything
williamr@2
    62
	that might drain battery power.
williamr@2
    63
	*/
williamr@2
    64
	ECapabilityPowerMgmt		= 2,
williamr@2
    65
williamr@2
    66
williamr@2
    67
    /**
williamr@2
    68
    Grants direct access to all multimedia device drivers.
williamr@2
    69
    
williamr@2
    70
    This includes the sound, camera, video device drivers etc.
williamr@2
    71
    */
williamr@2
    72
	ECapabilityMultimediaDD		= 3,
williamr@2
    73
williamr@2
    74
williamr@2
    75
    /**
williamr@2
    76
    Grants read access to network operator, phone manufacturer and device
williamr@2
    77
    confidential settings or data.
williamr@2
    78
    
williamr@2
    79
    For example, the pin lock code, the list of applications that are installed.
williamr@2
    80
    */
williamr@2
    81
	ECapabilityReadDeviceData	= 4,
williamr@2
    82
	
williamr@2
    83
	
williamr@2
    84
    /**
williamr@2
    85
    Grants write access to settings that control the behaviour of the device.
williamr@2
    86
    
williamr@2
    87
    For example, device lock settings, system time, time zone, alarms, etc.
williamr@2
    88
    */	
williamr@2
    89
	ECapabilityWriteDeviceData	= 5,
williamr@2
    90
williamr@2
    91
williamr@2
    92
    /**
williamr@2
    93
    Grants access to protected content.
williamr@2
    94
    
williamr@2
    95
    DRM (Digital Rights Management) agents use this capability to decide whether
williamr@2
    96
    or not an application should have access to DRM content. 
williamr@2
    97
    Applications granted DRM are trusted to respect the rights associated
williamr@2
    98
    with the content.
williamr@2
    99
    */	
williamr@2
   100
	ECapabilityDRM				= 6,
williamr@2
   101
williamr@2
   102
williamr@2
   103
    /**
williamr@2
   104
    Grants the right to create a trusted UI session, and therefore to display
williamr@2
   105
    dialogs in a secure UI environment.
williamr@2
   106
    
williamr@2
   107
    Trusted UI dialogs are rare. They must be used only when confidentiality
williamr@2
   108
    and security are critical; for example, for password dialogs. 
williamr@2
   109
    
williamr@2
   110
    Normal access to the user interface and the screen does not require
williamr@2
   111
    this capability.
williamr@2
   112
    */	
williamr@2
   113
	ECapabilityTrustedUI		= 7,
williamr@2
   114
williamr@2
   115
williamr@2
   116
    /**
williamr@2
   117
    Grants the right to a server to register with a protected name.
williamr@2
   118
    
williamr@2
   119
    Currently, protected names start with a "!" character. The kernel prevents
williamr@2
   120
    servers without this capability from using such a name, and therefore
williamr@2
   121
    prevents protected servers from being impersonated.
williamr@2
   122
    */	
williamr@2
   123
	ECapabilityProtServ			= 8,
williamr@2
   124
williamr@2
   125
williamr@2
   126
    /**
williamr@2
   127
    Grants access to disk administration operations that affect more than one
williamr@2
   128
    file or one directory (or overall filesystem integrity/behaviour, etc).
williamr@2
   129
    
williamr@2
   130
    For examples, reformatting a disk partition.
williamr@2
   131
    */	
williamr@2
   132
	ECapabilityDiskAdmin		= 9,
williamr@2
   133
williamr@2
   134
williamr@2
   135
    /**
williamr@2
   136
    Grants the right to modify or access network protocol controls.
williamr@2
   137
    
williamr@2
   138
    Typically when an action can change the behaviour of all existing and
williamr@2
   139
    future connections, it should be protected by this capability.
williamr@2
   140
    
williamr@2
   141
    For example, forcing all existing connections on a specific protocol
williamr@2
   142
    to be dropped, or changing the priority of a call.
williamr@2
   143
    */	
williamr@2
   144
	ECapabilityNetworkControl	= 10,
williamr@2
   145
williamr@2
   146
williamr@2
   147
    /**
williamr@2
   148
    Grants read access to the entire file system; grants write access to
williamr@2
   149
    the private directories of other processes.
williamr@2
   150
    
williamr@2
   151
    This capability is very strictly controlled and should rarely be granted.
williamr@2
   152
    */	
williamr@2
   153
	ECapabilityAllFiles			= 11,
williamr@2
   154
williamr@2
   155
williamr@2
   156
    /**
williamr@2
   157
    Grants the right to generate software key & pen events, and to capture any
williamr@2
   158
    of them regardless of the status of the application.
williamr@2
   159
    
williamr@2
   160
    Note that after obtaining the focus, normal applications do not need this
williamr@2
   161
    capability to be dispatched key and pen events.
williamr@2
   162
    */	
williamr@2
   163
	ECapabilitySwEvent			= 12,
williamr@2
   164
williamr@2
   165
williamr@2
   166
    /**
williamr@2
   167
    A user capability that grants access to remote services without any
williamr@2
   168
    restriction on its physical location.
williamr@2
   169
    
williamr@2
   170
    Typically, such a location is unknown to the phone user, and such services
williamr@2
   171
    may incur cost for the phone user.
williamr@2
   172
    
williamr@2
   173
    Voice calls, SMS, and internet services are good examples of
williamr@2
   174
    such network services. They are supported by GSM, CDMA and all IP transport
williamr@2
   175
    protocols including Bluetooth profiles over IP.
williamr@2
   176
    */	
williamr@2
   177
	ECapabilityNetworkServices	= 13,
williamr@2
   178
williamr@2
   179
williamr@2
   180
    /**
williamr@2
   181
    A user capability that grants access to remote services in the close
williamr@2
   182
    vicinity of the phone.
williamr@2
   183
    
williamr@2
   184
    The location of the remote service is well-known to the phone user, and in
williamr@2
   185
    most cases, such services will not incur cost for the phone user.
williamr@2
   186
    */	
williamr@2
   187
	ECapabilityLocalServices	= 14,
williamr@2
   188
williamr@2
   189
williamr@2
   190
    /**
williamr@2
   191
    A user capability that grants read access to data that is confidential to
williamr@2
   192
    the phone user. 
williamr@2
   193
    
williamr@2
   194
    This capability supports the management of the user's privacy.
williamr@2
   195
    
williamr@2
   196
    Typically, contacts, messages and appointments are always seen user
williamr@2
   197
    confidential data.
williamr@2
   198
    */	
williamr@2
   199
	ECapabilityReadUserData		= 15,
williamr@2
   200
williamr@2
   201
williamr@2
   202
    /**
williamr@2
   203
    A user capability that grants write access to user data. 
williamr@2
   204
    
williamr@2
   205
    This capability supports the management of the integrity of user data.
williamr@2
   206
    
williamr@2
   207
    Note that this capability is not symmetric with the ECapabilityReadUserData
williamr@2
   208
    capability. For example, you may want to prevent rogue applications from
williamr@2
   209
    deleting music tracks but you may not want to restrict read access to them.
williamr@2
   210
    */	
williamr@2
   211
    ECapabilityWriteUserData	= 16,
williamr@2
   212
    
williamr@2
   213
    
williamr@2
   214
    /**
williamr@2
   215
    A user capability that grants access to the location of the device.
williamr@2
   216
    
williamr@2
   217
    This capability supports the management of the user's privacy with regard
williamr@2
   218
    to the phone location.
williamr@2
   219
    */
williamr@2
   220
	ECapabilityLocation			= 17,
williamr@2
   221
williamr@2
   222
williamr@2
   223
	/**
williamr@2
   224
	Grants access to logical device drivers that provide input information about
williamr@2
   225
	the surroundings of the device. 
williamr@2
   226
williamr@2
   227
	Good examples of drivers that require this capability would be GPS and biometrics
williamr@2
   228
	device drivers. For complex multimedia logical device drivers that provide both
williamr@2
   229
	input and output functions, such as Sound device driver, the  MultimediaDD
williamr@2
   230
	capability should be used if it is too difficult to separate the input from the
williamr@2
   231
	output calls at its API level.
williamr@2
   232
	*/
williamr@2
   233
	ECapabilitySurroundingsDD	= 18,
williamr@2
   234
williamr@2
   235
williamr@2
   236
	/**
williamr@2
   237
	Grants access to live confidential information about the user and his/her
williamr@2
   238
	immediate environment. This capability protect the user's privacy.
williamr@2
   239
williamr@2
   240
	Examples are audio, picture and video recording, biometrics (such as blood
williamr@2
   241
	pressure) recording.
williamr@2
   242
williamr@2
   243
	Please note that the location of the device is excluded from this capability.
williamr@2
   244
	The protection of this is achieved by using the dedicated capability Location
williamr@2
   245
	*/
williamr@2
   246
	ECapabilityUserEnvironment	= 19,
williamr@2
   247
williamr@2
   248
williamr@2
   249
	ECapability_Limit,					/**< @internalTechnology */
williamr@2
   250
williamr@2
   251
	ECapability_HardLimit		= 255,	/**< @internalTechnology */
williamr@2
   252
williamr@2
   253
	ECapability_None			= -1,	/**< Special value used to specify 'do not care' or 'no capability'.*/
williamr@2
   254
williamr@2
   255
	ECapability_Denied			= -2	/**< Special value used to indicate a capability that is never granted. */	
williamr@2
   256
	};
williamr@2
   257
williamr@2
   258
williamr@2
   259
/** Define this macro to reference the names of the capabilities. This is here so
williamr@2
   260
	that ROMBUILD can accept capability names.
williamr@2
   261
*/
williamr@2
   262
#ifdef __REFERENCE_CAPABILITY_NAMES__
williamr@2
   263
williamr@2
   264
extern const char* const CapabilityNames[ECapability_Limit];
williamr@2
   265
williamr@2
   266
#endif	// __REFERENCE_CAPABILITY_NAMES__
williamr@2
   267
williamr@2
   268
/** Define this macro to include the names of the capabilities. This is here so
williamr@2
   269
	that ROMBUILD can accept capability names.
williamr@2
   270
*/
williamr@2
   271
#ifdef __INCLUDE_CAPABILITY_NAMES__
williamr@2
   272
williamr@2
   273
/** List of names of all supported capabilities
williamr@2
   274
	Must be in the same order as the enumerators in TCapability
williamr@2
   275
williamr@2
   276
@publishedAll
williamr@2
   277
@released
williamr@2
   278
*/
williamr@2
   279
extern const char* const CapabilityNames[ECapability_Limit] =
williamr@2
   280
	{
williamr@2
   281
	"TCB",
williamr@2
   282
	"CommDD",
williamr@2
   283
	"PowerMgmt",
williamr@2
   284
	"MultimediaDD",
williamr@2
   285
	"ReadDeviceData",
williamr@2
   286
	"WriteDeviceData",
williamr@2
   287
	"DRM",
williamr@2
   288
	"TrustedUI",
williamr@2
   289
	"ProtServ",
williamr@2
   290
	"DiskAdmin",
williamr@2
   291
	"NetworkControl",
williamr@2
   292
	"AllFiles",
williamr@2
   293
	"SwEvent",
williamr@2
   294
	"NetworkServices",
williamr@2
   295
	"LocalServices",
williamr@2
   296
	"ReadUserData",
williamr@2
   297
	"WriteUserData",
williamr@2
   298
	"Location",
williamr@2
   299
	"SurroundingsDD",
williamr@2
   300
	"UserEnvironment"
williamr@2
   301
	};
williamr@2
   302
williamr@2
   303
#endif	// __INCLUDE_CAPABILITY_NAMES__
williamr@2
   304
williamr@2
   305
#endif	// __E32CAPABILITY_H__