Update contrib.
2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
31 namespace UserPromptService
34 Defines a set of SID classes.
35 See Symbian Signed UID FAQ for the definition of SID classes.
37 NONSHARABLE_CLASS(TSidClasses)
40 IMPORT_C TSidClasses(TUint16 aSidClasses);
41 IMPORT_C TBool Contains(const TSecureId& aSid) const;
43 const TUint16 iSidClasses; ///< A bitmask that defines the set SID classes.
47 Class for a single policy record.
49 NONSHARABLE_CLASS(CPolicy) : public CBase
53 Defines the elements in the options field that determines
54 whether a prompt should be displayed and if so what buttons are
57 All other bits are reserved for future use and should be ignored
58 by the custom Policy Evaluators and Dialog Creators.
62 EYes = 0x01, ///< The 'Yes' button should be displayed in the prompt.
63 ENo = 0x02, ///< The 'No' button should be displayed in the prompt.
64 ESession = 0x04, ///< The 'SessionYes' button should be displayed in the prompt.
65 ESessionYes = 0x04, ///< The 'SessionYes' button should be displayed in the prompt.
66 EAlways = 0x08, ///< The 'Always' button should be displayed in the prompt.
67 ENever = 0x10, ///< The 'Never' button should be displayed in the prompt.
68 ESessionNo = 0x20 ///< The 'SessionNo' button should be displayed in the prompt.
72 Allows policies to be matched according to whether the client process
73 passed security check defined by the system server.
74 Typically, this corresponds to whether the client has the correct capabilities
75 for the requested service. However, system servers are free to use features
76 other than capabilities in their security check.
78 E.g. If the client has the correct capabilities for the requested service then
79 the "Always" and "Never" options will be enabled in the policy; otherwise, a
80 different policy will be matched where the prompt is limited to one-shot
81 permissions ("Yes" and "No").
86 The policy applies regardless of whether the client process passed the
87 system server's security check.
89 ESystemServerSecurityPassedOrFailed = 0,
91 The policy only applies if the client process failed the system server's
94 ESystemServerSecurityFailed = 1,
96 The policy only applies if the client process passed the system server's
99 ESystemServerSecurityPassed = 2
100 } TSystemServerSecurity;
102 IMPORT_C static CPolicy* NewL(const TSidClasses& aSidClasses, const RArray<TSecureId>& aSidList,
103 const TDesC& aDestination, TUint aOptions, const TUid& aPolicyEvaluator,
104 const TUid& aDialogCreator, TUint16 aFlags,
105 TSystemServerSecurity aSystemServerSecurity,
106 TUint16 aMajorVersion, TUint16 aMinorVersion, TBool aDefault = EFalse);
108 IMPORT_C static CPolicy* NewLC(const TSidClasses& aSidClasses, const RArray<TSecureId>& aSidList,
109 const TDesC& aDestination, TUint aOptions, const TUid& aPolicyEvaluator,
110 const TUid& aDialogCreator, TUint16 aFlags,
111 TSystemServerSecurity aSystemServerSecurity,
112 TUint16 aMajorVersion, TUint16 aMinorVersion, TBool aDefault = EFalse);
114 IMPORT_C TBool Matches(const TSecureId& aClientSid, const TDesC& aDestination, TBool aSecurityResult) const;
115 IMPORT_C TBool PromptRequired() const;
117 IMPORT_C TOptions Options() const;
118 IMPORT_C const TUid& PolicyEvaluator() const;
119 IMPORT_C const TUid& DialogCreator() const;
120 IMPORT_C const TDesC& Destination() const;
121 IMPORT_C const TSidClasses& SidClasses() const;
122 IMPORT_C const RArray<TSecureId>& SidList() const;
123 IMPORT_C TUint16 Flags() const;
124 IMPORT_C TBool Default() const;
125 IMPORT_C TSystemServerSecurity SystemServerSecurity() const;
126 IMPORT_C TUint16 MajorVersion() const;
127 IMPORT_C TUint16 MinorVersion() const;
131 CPolicy(const TSidClasses& aSidClasses, TUint aOptions,
132 const TUid& aPolicyEvaluator, const TUid& aDialogCreator,
133 TUint16 aFlags, TSystemServerSecurity aSystemServerSecurity,
134 TUint16 aMajorVersion, TUint16 aMinorVersion, TBool aDefault);
136 void ConstructL(const RArray<TSecureId>& aSidList, const TDesC& aDescription);
138 TSidClasses iSidClasses; ///< The clases of SIDs that this policy applies to.
139 RArray<TSecureId> iSidList; ///< The set of individual SIDs that this policy applies to.
140 HBufC* iDestination; ///< Wildcard string to match against the request's destination.
141 TUint iOptions; ///< Options for evaluator EYes|ENo|ESessionYes|EAlways|ENever.
142 TUid iPolicyEvaluator; ///< Implementation UID of the associated policy evaluator.
143 TUid iDialogCreator; ///< Implementation UID of the associated dialog creator.
144 TUint16 iFlags; ///< Policy Evaluator specific flags
145 /** Whether this policy is specific to clients that passed/failed the system server's
147 TSystemServerSecurity iSystemServerSecurity;
148 TUint16 iMajorVersion; ///< Major version of the UPS policy file.
149 TUint16 iMinorVersion; ///< Minor version of the UPS policy file.
150 TBool iDefault; ///< ETrue if no match was found in the policy file.