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.
15 * Client-side API via which the system server uses the user prompt service.
30 #include <scs/scsclient.h>
31 #include <ups/upstypes.h>
33 namespace UserPromptService
36 class CUpsClientConfig;
37 class CPolicyChangeWatcher;
38 class RUpsSession : public RScsClientBase
40 The system server uses this class to establish a connection with
43 Internally it retrieves and caches authorisation policy information for all the
44 services supported by the current server SID. This information is used to allow
45 the RUpsSubsession to avoid creating a subsession and/or querying the UPS
46 if the request does not require UPS interaction.
51 IMPORT_C RUpsSession();
52 IMPORT_C TInt Connect();
53 IMPORT_C void Close();
56 void NotifyPolicyFileChangedL();
59 friend class RUpsSubsession;
60 CPolicyChangeWatcher *iPolicyChangeWatcher;
61 void RetrieveClientConfigL();
62 CUpsClientConfig* iClientConfig;
65 class RUpsManagement : public RScsClientBase
67 This class supports the management API for the UPS.
71 IMPORT_C RUpsManagement();
72 IMPORT_C TInt Connect();
73 IMPORT_C void Close();
75 // Needs ReadDeviceData
76 IMPORT_C void CreateView(const CDecisionFilter& aFilter, TRequestStatus &aStatus);
77 IMPORT_C CDecisionRecord *NextMatchL();
78 IMPORT_C void CancelAndCloseView();
80 // Needs WriteDeviceData
81 IMPORT_C void RemoveDecisionsL(const CDecisionFilter& aFilter);
82 IMPORT_C void DeleteDatabaseL();
85 IMPORT_C void UpdateDecision(TUint32 aRecordId, TBool aAllow, TRequestStatus &aStatus);
86 IMPORT_C void CancelUpdateDecision();
89 The following three APIs are only for use by the UPS swi observer plugin and are discouraged for general use
91 IMPORT_C void DeleteDecisionsForExeL(const TSecureId& aExeSid);
92 IMPORT_C void NotifyPluginsMayHaveChangedL();
93 IMPORT_C void NotifyPolicyFilesChanged(TRequestStatus &aStatus);
94 IMPORT_C void CancelNotifyPolicyFilesChanged();
97 RBuf8 iCreateViewFilterBuf;
98 TPckgBuf<TUint32> iMatchLengthBuf;
101 class RUpsSubsession : public RScsClientSubsessionBase
103 System servers use this class to establish a connection to the UPS for a specific
105 Before checking a request with the User Prompt Service the Authorise method
106 first checks whether authorisation from the User Prompt Service is required. If
107 authorisation is not required e.g. the client has the correct capabilities for the
108 service then Authorise completes immediately.
112 IMPORT_C RUpsSubsession();
113 IMPORT_C TInt Initialise(RUpsSession& aSession, const RThread& aClient);
115 IMPORT_C void Authorise(TBool aServerCheckOk,
116 const TServiceId& aServiceId, const TDesC& aDestination,
117 TUpsDecision& aDecision, TRequestStatus& aStatus);
118 IMPORT_C void Authorise(TBool aServerCheckOk,
119 const TServiceId& aServiceId, const TDesC& aDestination,
120 const TDesC8& aOpaqueData,
121 TUpsDecision& aDecision, TRequestStatus& aStatus);
122 IMPORT_C void CancelPrompt();
124 IMPORT_C void Close();
127 TInt CreateSubsession();
128 void AuthoriseInternal(TBool aServerCheckOk,
129 const TServiceId& aServiceId, const TDesC& aDestination, const TDesC8& aOpaqueData,
130 TUpsDecision& aDecision, TRequestStatus& aStatus);
131 TInt PreparePrompt(const TServiceId& aServiceId, const TDesC& aDestination, const TDesC8& aOpaqueData);
132 void ExecutePrompt(TBool aServerCheckOk, TUpsDecision& aDecision, TRequestStatus& aStatus);
135 /** Describes the TUpsDecision reference passed into Authorise. */
138 TBool iSubsessionCreated;
139 TThreadId iClientTid;
140 TSecureId iClientSid;
141 TProcessId iClientPid;
142 RUpsSession* iUpsSession;
145 } // End of namespace UserPromptService
147 #endif // #ifndef UPSCLIENT_H