|
1 /* |
|
2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of the License "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: Security Manager common header |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 #ifndef _RTSECMGR_COMMON_DEF_H_ |
|
24 #define _RTSECMGR_COMMON_DEF_H_ |
|
25 |
|
26 #include <e32base.h> |
|
27 #include <avkon.hrh> |
|
28 |
|
29 typedef TInt TPolicyID; |
|
30 typedef TInt TExecutableID; |
|
31 typedef TUint32 TPermGrant; |
|
32 typedef RArray<TCapability> RCapabilityArray; |
|
33 typedef TUid TProviderUid; |
|
34 typedef RArray<TProviderUid> RProviderArray; |
|
35 |
|
36 typedef TUint32 TCapabilityBitSet; |
|
37 |
|
38 //constant for default NULL capability bitset |
|
39 const TCapabilityBitSet KDefaultNullBit = 0x0000; |
|
40 |
|
41 //constant for default capability bitset with LSB enabled |
|
42 const TCapabilityBitSet KDefaultEnableBit = 0x0001; |
|
43 |
|
44 enum TAccessCheckCode |
|
45 { |
|
46 EAccessNok = -1, |
|
47 EAccessOk |
|
48 }; |
|
49 |
|
50 enum |
|
51 { |
|
52 EPromptOk = EAknSoftkeyOk, |
|
53 EPromptCancel = EAknSoftkeyCancel |
|
54 }; |
|
55 |
|
56 /* |
|
57 * Enumerations for various duration option |
|
58 */ |
|
59 const TUint32 DEFAULT_ONESHOT = 0x80000000; |
|
60 const TUint32 DEFAULT_SESSION = 0x40000000; |
|
61 const TUint32 DEFAULT_BLANKET = 0x20000000; |
|
62 |
|
63 const TUint32 CONDITION_ONESHOT = 0x8000000; |
|
64 const TUint32 CONDITION_SESSION = 0x4000000; |
|
65 const TUint32 CONDITION_BLANKET = 0x2000000; |
|
66 |
|
67 const TUint32 ONESHOT_DENIED = 0x88000000; |
|
68 const TUint32 SESSION_DENIED = 0x44000000; |
|
69 const TUint32 BLANKET_DENIED = 0x22000000; |
|
70 |
|
71 const TUint32 DEFAULT_ALL = 0xE0000000; |
|
72 const TUint32 CONDITION_ALL = 0xE000000; |
|
73 const TUint32 CAPABILITY_ALL = 0xFFFFF; |
|
74 |
|
75 const TUint32 NetworkServices_CAP = 0x00002000; |
|
76 |
|
77 enum TUserPromptOption |
|
78 { |
|
79 RTUserPrompt_UnDefined = 0, //can be used for permisssions denied by default |
|
80 RTUserPrompt_OneShot = CONDITION_ONESHOT, |
|
81 RTUserPrompt_Session = CONDITION_SESSION, |
|
82 RTUserPrompt_Permanent = CONDITION_BLANKET, |
|
83 RTUserPrompt_Denied = ONESHOT_DENIED, |
|
84 RTUserPrompt_SessionDenied = SESSION_DENIED, |
|
85 RTUserPrompt_PermDenied = BLANKET_DENIED |
|
86 }; |
|
87 |
|
88 enum TSecMgrPromptUIOption |
|
89 { |
|
90 RTPROMPTUI_DEFAULT = 0, |
|
91 RTPROMPTUI_ADVANCED, |
|
92 RTPROMPTUI_PROVIDER |
|
93 }; |
|
94 |
|
95 //error code used btn server and client |
|
96 //error code starts with -101 as predefined symbian codes |
|
97 //range upto -48 |
|
98 enum TSecMgrErrCode |
|
99 { |
|
100 ErrInvalidParameters = -101, |
|
101 ErrFileSessionNotShared = ErrInvalidParameters -1, |
|
102 ErrInvalidPolicyFormat = ErrFileSessionNotShared -1, |
|
103 ErrFatalDBError = ErrInvalidPolicyFormat -1, |
|
104 ErrSetPolicyFailed = ErrFatalDBError -1, |
|
105 ErrUpdatePolicyFailed = ErrSetPolicyFailed -1, |
|
106 ErrInvalidPolicyID = ErrUpdatePolicyFailed -1, |
|
107 ErrPolicyIDDoesNotExist = ErrInvalidPolicyID -1, |
|
108 ErrInvalidScriptID = ErrPolicyIDDoesNotExist -1, |
|
109 ErrRegisterScriptFailed = ErrInvalidScriptID -1, |
|
110 ErrUpdateGrantFailed = ErrRegisterScriptFailed -1, |
|
111 ErrServerReadConfig = ErrUpdateGrantFailed -1, |
|
112 ErrUnRegisterScriptFailed = ErrServerReadConfig -1, |
|
113 ErrUnSetPolicyFailed = ErrUnRegisterScriptFailed -1, |
|
114 ErrUpdatePermGrantFailed = ErrUnSetPolicyFailed -1, |
|
115 ErrBackupNotCreated = ErrUpdatePermGrantFailed - 1, |
|
116 ErrRestoreTempFailed = ErrBackupNotCreated - 1, |
|
117 ErrAccessDenied = ErrRestoreTempFailed - 1 |
|
118 }; |
|
119 |
|
120 const TInt KAnonymousScript = -1; |
|
121 const TInt KInvalidPolicyID = -1; |
|
122 const TInt KMaxTrustInfoLen = 512; //magic number - half of 1 KB |
|
123 |
|
124 #endif //_RTSECMGR_COMMON_DEF_H_ |