|
1 /* |
|
2 * Copyright (c) 2002 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 "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: WIM Authentication Object Handler |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 #ifndef CWIMAUTHOBJHANDLER_H |
|
21 #define CWIMAUTHOBJHANDLER_H |
|
22 |
|
23 // INCLUDES |
|
24 #include <e32base.h> |
|
25 #include <secdlg.h> |
|
26 #include "WimResponse.h" |
|
27 #include "WimUtilityFuncs.h" |
|
28 |
|
29 // FORWARD DECLARATIONS |
|
30 class CWimSecurityDlgHandler; |
|
31 class CWimMemMgmt; |
|
32 class CWimUtilityFuncs; |
|
33 |
|
34 // CONSTANTS |
|
35 _LIT( KUnblockingPinLabel, "Unblocking PIN" ); |
|
36 |
|
37 // CLASS DECLARATION |
|
38 |
|
39 /** |
|
40 * WIM Authentication Object Handler. |
|
41 * Handles authentication objects, such as PIN. |
|
42 * |
|
43 * @since Series60 2.1 |
|
44 */ |
|
45 class CWimAuthObjHandler : public CActive |
|
46 { |
|
47 public: // Constructors and destructor |
|
48 |
|
49 /** |
|
50 * Two-phased constructor. |
|
51 */ |
|
52 static CWimAuthObjHandler* NewL(); |
|
53 |
|
54 /** |
|
55 * Destructor. |
|
56 */ |
|
57 virtual ~CWimAuthObjHandler(); |
|
58 |
|
59 public: // New functions |
|
60 |
|
61 /** |
|
62 * Get PIN count from the WIM card. |
|
63 * @param aMessage Encapsulates a client request. |
|
64 * @return void |
|
65 */ |
|
66 void GetPINCountL( const RMessage2& aMessage ) const; |
|
67 |
|
68 /** |
|
69 * Get reference list for PINs. |
|
70 * @param aMessage Encapsulates a client request. |
|
71 * @param aWimMgmt Pointer to WIM reference management class. |
|
72 * @return void |
|
73 */ |
|
74 void GetPINRefListL( const RMessage2& aMessage, |
|
75 CWimMemMgmt* aWimMgmt ); |
|
76 |
|
77 /** |
|
78 * Get detailed information about the PIN. |
|
79 * @param aMessage Encapsulates a client request. |
|
80 * @return void |
|
81 */ |
|
82 void GetPINInfoL( const RMessage2& aMessage ) ; |
|
83 |
|
84 /** |
|
85 * Get detailed information about the PINs. |
|
86 * @param aMessage Encapsulates a client request. |
|
87 * @return void |
|
88 */ |
|
89 void GetPINsInfoL( const RMessage2& aMessage ); |
|
90 |
|
91 /** |
|
92 * Verifies PIN number. |
|
93 * @since Series60 2.6 |
|
94 * @param aMessage Encapsulates a client request. |
|
95 * @param aShowDialog Tells whether to show security dialog |
|
96 for PIN query or not. |
|
97 * @return void |
|
98 */ |
|
99 void VerifyPINRequestL( const RMessage2& aMessage, TBool aShowDialog ); |
|
100 |
|
101 /** |
|
102 * Cancel Verifies PIN number. |
|
103 * @since Series60 3.0 |
|
104 * @param aMessage Encapsulates a client request. |
|
105 * @return void |
|
106 */ |
|
107 void CancelVerifyPin( const RMessage2& aMessage ); |
|
108 |
|
109 /** |
|
110 * Verifies Disabled PIN status. |
|
111 * @since Series60 3.0 |
|
112 * @param aMessage Encapsulates a client request. |
|
113 * @param aShowDialog Tells whether to show security dialog |
|
114 for PIN query or not. |
|
115 * @return void |
|
116 */ |
|
117 void VerifyDisabledPINRequestL( const RMessage2& aMessage ); |
|
118 |
|
119 /** |
|
120 * Changes a PIN number. |
|
121 * @since Series60 2.6 |
|
122 * @param aMessage Encapsulates a client request. |
|
123 * @return void |
|
124 */ |
|
125 void ChangePINRequestL( const RMessage2& aMessage ); |
|
126 |
|
127 /** |
|
128 * Cancel Changes a PIN number. |
|
129 * @since Series60 3.0 |
|
130 * @param aMessage Encapsulates a client request. |
|
131 * @return void |
|
132 */ |
|
133 void CancelChangePin( const RMessage2& aMessage ); |
|
134 |
|
135 /** |
|
136 * Enables/disables PIN query. |
|
137 * @since Series60 2.6 |
|
138 * @param aMessage Encapsulates a client request. |
|
139 * @return void |
|
140 */ |
|
141 void EnablePINReqL( const RMessage2& aMessage ); |
|
142 |
|
143 /** |
|
144 * Enables/disables PIN query. |
|
145 * @since Series60 3.0 |
|
146 * @param aMessage Encapsulates a client request. |
|
147 * @return void |
|
148 */ |
|
149 void CancelEnablePin( const RMessage2& aMessage ); |
|
150 |
|
151 /** |
|
152 * Unblocks blocked PIN. |
|
153 * @since Series60 2.6 |
|
154 * @param aMessage Encapsulates a client request. |
|
155 * @return void |
|
156 */ |
|
157 void UnblockPinReqL( const RMessage2& aMessage ); |
|
158 |
|
159 /** |
|
160 * Cancel Unblocks blocked PIN. |
|
161 * @since Series60 3.0 |
|
162 * @param aMessage Encapsulates a client request. |
|
163 * @return void |
|
164 */ |
|
165 void CancelUnblockPin( const RMessage2& aMessage ); |
|
166 |
|
167 /** |
|
168 * Retrive authentication object's info |
|
169 * @since S60 3.2 |
|
170 * @param aMessage Encapsulates a client request. |
|
171 * @return void |
|
172 */ |
|
173 void RetrieveAuthObjectsInfo( const RMessage2& aMessage ); |
|
174 |
|
175 private: |
|
176 |
|
177 /** |
|
178 * C++ default constructor. |
|
179 */ |
|
180 CWimAuthObjHandler(); |
|
181 |
|
182 /** |
|
183 * By default Symbian 2nd phase constructor is private. |
|
184 */ |
|
185 void ConstructL(); |
|
186 |
|
187 /** |
|
188 * Continue Verify PIN request after PIN is asked. Calls WIMI. |
|
189 * @since Series60 2.6 |
|
190 * @return void |
|
191 */ |
|
192 void VerifyPINAskPIN(); |
|
193 void ContinueVerifyPINReqL(); |
|
194 |
|
195 /** |
|
196 * Continue Change PIN request after PIN is asked. Calls WIMI. |
|
197 * @since Series60 2.6 |
|
198 * @return void |
|
199 */ |
|
200 void ChangePINAskPIN(); |
|
201 void ContinueChangePINReqL(); |
|
202 |
|
203 /** |
|
204 * Continue Enable/Disable PIN request after PIN is asked. Calls WIMI. |
|
205 * @since Series60 2.6 |
|
206 * @return void |
|
207 */ |
|
208 void EnablePINAskPIN(); |
|
209 void ContinueEnablePINReqL(); |
|
210 |
|
211 /** |
|
212 * Continue Unblock PIN request after PIN is asked. Calls WIMI. |
|
213 * @since Series60 2.6 |
|
214 * @return void |
|
215 */ |
|
216 void UnblockPINAskPIN(); |
|
217 void ContinueUnblockPinReqL(); |
|
218 |
|
219 /** |
|
220 * From CActive. Asyncronous PIN query ready. Call ContinueXXX |
|
221 * function depending what we are requesting. |
|
222 */ |
|
223 void RunL(); |
|
224 |
|
225 /** |
|
226 * From CActive. Cancel asynchronous request. |
|
227 */ |
|
228 void DoCancel(); |
|
229 |
|
230 /** |
|
231 * From CActive. Handle leave from RunL() |
|
232 * @param aError leave code from RunL() |
|
233 */ |
|
234 TInt RunError( TInt aError ); |
|
235 |
|
236 private: // Data |
|
237 // Enumerator for ongoing request |
|
238 enum TAuthObjectRequest |
|
239 { |
|
240 EVerifyPINAskPIN, |
|
241 EVerifyPINCallBackResponse, |
|
242 EChangePINAskPIN, |
|
243 EChangePINCallBackResponse, |
|
244 EEnablePINAskPIN, |
|
245 EEnablePINCallBackResponse, |
|
246 EDisablePINAskPIN, |
|
247 EDisablePINCallBackResponse, |
|
248 EUnblockPINAskPIN, |
|
249 EUnblockPINCallBackResponse, |
|
250 EShowPINBlocked, |
|
251 EShowCardIsRemoved, |
|
252 EWIMIError, |
|
253 EIdle |
|
254 }; |
|
255 |
|
256 // Pointer to utility function class. Owned. |
|
257 CWimUtilityFuncs* iWimUtilFuncs; |
|
258 // Pointer to security handler class. Owned. |
|
259 CWimSecurityDlgHandler* iWimSecDlg; |
|
260 // Authentication object ongoing request |
|
261 TAuthObjectRequest iRequest; |
|
262 |
|
263 // PIN value that user has given |
|
264 TPINValue iPinValue; |
|
265 // Old PIN value in PIN change |
|
266 TPINValue iOldPinValue; |
|
267 // New PIN value in Change PIN and Unblock PIN |
|
268 TPINValue iNewPinValue; |
|
269 // Unblocking PIN |
|
270 TPINValue iUnblockingPinValue; |
|
271 // Enable/Disable PIN query |
|
272 TBool iEnablePinQuery; |
|
273 |
|
274 TBool iRetry; |
|
275 |
|
276 TBool iShowDialog; |
|
277 |
|
278 CWimResponse* iResponseID; |
|
279 |
|
280 TWimReqTrId* iTrId; |
|
281 |
|
282 TPINParams iPinParams; |
|
283 |
|
284 TPINParams iUnblockingPinParams; |
|
285 TBool iDisablePINBlocked; |
|
286 TBool iUnblockPING; |
|
287 |
|
288 WIMI_Ref_pt iPinGRef; |
|
289 |
|
290 }; |
|
291 |
|
292 #endif // CWIMAUTHOBJHANDLER_H |
|
293 |
|
294 // End of File |