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.
15 * Types required to use the UPS server.
32 // Work around broken TRAP handling.......... See DEF108105
33 #undef TRAP_INSTRUMENTATION_END
34 #define TRAP_INSTRUMENTATION_END (void)User::Allocator()
42 Decisions which can be returned by the UPS server to the
47 The action can be performed. This response does not distinguish
48 between a one-shot or an always approval.
52 The action cannot be performed.
56 The action can be performed for a session, as defined by the
61 The action can not be performed for a session, as defined by the
69 Convenience typedef wraps up an instance of TUpsDecision which
70 can be supplied to a server. Note the APIs themselves take TDes8&
71 arguments, not specifically references to an instance of this type.
73 typedef TPckgBuf<TUpsDecision> TUpsDecisionPckgBuf;
76 Uniquely identifies a service. UIDs should be reserved via Symbian Signed.
78 typedef TUid TServiceId;
80 namespace UserPromptService
83 //Number of columns exist in a filter key
84 static const TUint8 KFilterKeysNumber = 0x0B;
86 /** Comparision types used in the querying of the decision database. */
87 //4 bytes on the right side are used to indicate whether a columns is set.
91 ENotEqual = 0x00020000,
92 ELessThan = 0x00040000,
93 EGreaterThan = 0x00080000,
94 ELessThanOrEqual = 0x00100000,
95 EGreaterThanOrEqual = 0x00200000
98 NONSHARABLE_CLASS(CDecisionFilter):public CBase
100 Stores the filter key values that used to query the database.
101 A filter object can be created in one phase by supplying all required parameters,
102 or an empty filter is first created and then required filter keys are set separately.
105 friend class CDecisionDb;
106 friend class CDecisionDbW;
109 IMPORT_C static CDecisionFilter *NewL ();
110 IMPORT_C static CDecisionFilter *NewLC();
111 IMPORT_C static CDecisionFilter *NewL (const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid,
112 const TDesC8& aFingerprint,const TDesC8& aClientEntity,const TUint16& aVersion);
113 IMPORT_C static CDecisionFilter *NewLC(const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid,
114 const TDesC8& aFingerprint,const TDesC8& aClientEntity,const TUint16& aVersion);
117 IMPORT_C void SetClientSid(const TSecureId& aSid, const TComparisonOp aOp);
118 IMPORT_C void SetEvaluatorId(const TUid& aUid, const TComparisonOp aOp);
119 IMPORT_C void SetServiceId(const TUid& aUid, const TComparisonOp aOp);
120 IMPORT_C void SetServerSid(const TSecureId& aSid, const TComparisonOp aOp);
121 IMPORT_C void SetFingerprintL(const TDesC8& aFingerprint, const TComparisonOp aOp);
122 IMPORT_C void SetClientEntityL(const TDesC8& aClientEntity, const TComparisonOp aOp);
123 IMPORT_C void SetMajorPolicyVersion(const TUint16& aVersion, const TComparisonOp aOp);
124 IMPORT_C void SetRecordId(const TUint32& aId, const TComparisonOp aOp);
125 IMPORT_C void SetDescriptionL(const TDesC& aDescription, const TComparisonOp aOp);
126 IMPORT_C void SetResult(const TUint8& aResult, const TComparisonOp aOp);
127 IMPORT_C void SetEvaluatorInfo(const TUint32& aEvaluatorInfo, const TComparisonOp aOp);
129 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
130 IMPORT_C void InternalizeL(RReadStream& aStream);
133 CDecisionFilter(const TSecureId& aClientSid, const TUid& aEvaluatorId, const TUid& aServiceId, const TSecureId& aServerSid, const TUint16& aVersion);
135 void ConstructL(const TDesC8& aFingerprint, const TDesC8& aClientEntity);
140 Secure Id for client application
142 TSecureId iClientSid;
144 UID for the policy evaluator DLL
152 Secure Id for system server
154 TSecureId iServerSid;
157 NULL pointer if not specified.
159 HBufC8* iFingerprint;
161 Name of the entity within client
162 NULL pointer if not specified.
164 HBufC8* iClientEntity;
166 An array of flags which shows which attributes are set and what operator(=,!=,<,>, etc.) is assigned.
167 NULL pointer if not specified.
169 TUint32 iSetFlag[KFilterKeysNumber];
171 Major version of policy file.
173 TUint16 iMajorPolicyVersion;
175 Unique decision record Id.
179 A copy of description and/or opaque
183 Whether the request should be approved
187 Policy evaluator specific data
189 TUint32 iEvaluatorInfo;
193 NONSHARABLE_CLASS(CDecisionRecord):public CBase
195 Stores all the field values in a decision database row. All member variables of the class
196 are constant and public. Therefore, the members are assigned during construction and then
197 they can be accessible directly, however, it is not possible to modify them.
201 IMPORT_C static CDecisionRecord *NewL(const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid,const TDesC8& aFingerprint,
202 const TDesC8& aClientEntity,const TDesC& aDescription, const TUint8 aResult,const TUint16& aMajorPolicyVersion,
203 const TUint32 aEvaluatorInfo, const TUint32& aRecordId=0);
205 IMPORT_C static CDecisionRecord *NewLC(const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid,const TDesC8& aFingerprint,
206 const TDesC8& aClientEntity,const TDesC& aDescription, const TUint8 aResult,const TUint16& aMajorPolicyVersion,
207 const TUint32 aEvaluatorInfo, const TUint32& aRecordId=0);
209 IMPORT_C static CDecisionRecord *NewLC();
212 IMPORT_C void ExternalizeL(RWriteStream& aStream) const;
213 IMPORT_C void InternalizeL(RReadStream& aStream);
217 CDecisionRecord(const TSecureId& aClientSid,const TUid& aEvaluatorId,const TUid& aServiceId,const TSecureId& aServerSid,const TUint8 aResult,
218 const TUint16& aMajorPolicyVersion, const TUint32 aEvaluatorInfo, const TUint32& aRecordId);
220 void ConstructL(const TDesC8& aFingerprint,const TDesC8& aClientEntity,const TDesC& aDescription);
225 Secure Id of client application
227 TSecureId iClientSid;
229 UID for the policy evaluator DLL
237 Secure Id for system server
239 TSecureId iServerSid;
245 Name of the entity within client
249 A copy of description and/or opaque
253 Whether the request should be approved
257 Major policy version which this decision record possesses to.
259 TUint16 iMajorPolicyVersion;
261 Unique decision record Id.
265 Policy evaluator specific data
267 TUint32 iEvaluatorInfo;
270 } // End of UserPromptService namespace
273 #endif // #ifndef UPSTYPES_H