1 /* |
|
2 * Copyright (c) 2010 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: EAP Authentication Notifier |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 15 % |
|
20 */ |
|
21 |
|
22 #ifndef __EAPAUTHNOTIFIER_H__ |
|
23 #define __EAPAUTHNOTIFIER_H__ |
|
24 |
|
25 // System includes |
|
26 #include <e32base.h> |
|
27 #include <hb/hbcore/hbdevicedialogsymbian.h> |
|
28 |
|
29 // User includes |
|
30 |
|
31 // Forward declarations |
|
32 |
|
33 class TEapExpandedType; |
|
34 class CEapAuthObserver; |
|
35 |
|
36 // External data types |
|
37 |
|
38 //Global function prototypes |
|
39 |
|
40 //Constants |
|
41 |
|
42 const TUint KMaxNotifItemLength = 256; |
|
43 const TUint KMaxUiDataLength = 1024; |
|
44 |
|
45 /** |
|
46 * Callback interface |
|
47 */ |
|
48 class MNotificationCallback |
|
49 { |
|
50 public: |
|
51 /** |
|
52 * Notify for the client that the Dialog is complete |
|
53 * |
|
54 * @param aStatus status |
|
55 * return - |
|
56 */ |
|
57 virtual void DlgComplete( TInt aStatus ) = 0; |
|
58 }; |
|
59 |
|
60 /** |
|
61 * EAP Notifier |
|
62 */ |
|
63 NONSHARABLE_CLASS ( CEapAuthNotifier ): public CBase |
|
64 { |
|
65 public: |
|
66 // Data types |
|
67 |
|
68 /** EAP Notifier types */ |
|
69 enum EEapNotifierType |
|
70 { |
|
71 EEapNotifierTypeLEapUsernamePasswordDialog, |
|
72 EEapNotifierTypeGTCQueryDialog, |
|
73 EEapNotifierTypePapAuthQueryDialog, |
|
74 EEapNotifierTypePapChallengeDialog, |
|
75 EEapNotifierTypeGtcChallengeDialog, |
|
76 EEapNotifierTypeFastInstallPacQueryDialog, |
|
77 EEapNotifierTypeFastPacStorePwQueryDialog, |
|
78 EEapNotifierTypeFastCreateMasterkeyQueryDialog, |
|
79 EEapNotifierTypeFastPacFilePwQueryDialog, |
|
80 EEapNotifierTypeFastStartAuthProvWaitNote, |
|
81 EEapNotifierTypeFastStartUnauthProvWaitNote, |
|
82 EEapNotifierTypePapUsernamePasswordDialog, |
|
83 EEapNotifierTypeFastShowProvNotSuccessNote, |
|
84 EEapNotifierTypeEapMsChapV2UsernamePasswordDialog, |
|
85 EEapNotifierTypeMsChapV2UsernamePasswordDialog, |
|
86 EEapNotifierTypeMsChapV2NewPasswordDialog, |
|
87 EEapNotifierTypeMsChapV2OldPasswordDialog, |
|
88 EEapNotifierTypeMsChapV2PasswordExpiredNote, |
|
89 EEapNotifierTypeGTCUsernamePasswordDialog, |
|
90 }; |
|
91 |
|
92 /** EAP Notifier Data struct */ |
|
93 struct TEapDialogInfo |
|
94 { |
|
95 TBool iPasswordPromptEnabled; |
|
96 TBool iIsIdentityQuery; |
|
97 TBuf16<KMaxNotifItemLength> iUsername; |
|
98 TBuf16<KMaxNotifItemLength> iPassword; |
|
99 TBuf16<KMaxNotifItemLength> iOldPassword; |
|
100 TBool iIsFirstQuery; |
|
101 TBuf16<KMaxUiDataLength> iUidata; |
|
102 }; |
|
103 |
|
104 /** |
|
105 * Two-phased constructor. |
|
106 */ |
|
107 IMPORT_C static CEapAuthNotifier* NewL( MNotificationCallback& aClient ); |
|
108 |
|
109 /** |
|
110 * Destructor |
|
111 */ |
|
112 ~CEapAuthNotifier(); |
|
113 |
|
114 public: |
|
115 /** |
|
116 * Start the Notifier |
|
117 * |
|
118 * @param aType notifier type |
|
119 * @param aPasswordInfo data to be filled |
|
120 * @param aEapType eap type |
|
121 * return - |
|
122 */ |
|
123 IMPORT_C void StartL( EEapNotifierType aType, |
|
124 TEapDialogInfo* aEapInfo, |
|
125 TEapExpandedType& aEapType ); |
|
126 |
|
127 /** |
|
128 * Cancel() the notifier |
|
129 * |
|
130 * @param - |
|
131 * return - |
|
132 */ |
|
133 IMPORT_C void Cancel(); |
|
134 |
|
135 /** |
|
136 * CompleteL the notifier is complete |
|
137 * |
|
138 * @param aStatus status |
|
139 * return - |
|
140 */ |
|
141 void CompleteL( TInt aStatus ); |
|
142 |
|
143 /** |
|
144 * Sets the selected user name and password of the presented dialog |
|
145 * |
|
146 * @param aPasswordInfo password |
|
147 * return - |
|
148 */ |
|
149 void SetSelectedUnameAndPwd( TEapDialogInfo& aPasswordInfo ); |
|
150 |
|
151 /** |
|
152 * Sets the selected password of the presented dialog |
|
153 * |
|
154 * @param aPasswordInfo password |
|
155 * return - |
|
156 */ |
|
157 void SetSelectedPassword( |
|
158 TEapDialogInfo& aPasswordInfo ); |
|
159 |
|
160 /** |
|
161 * Sets the selected Old password of the presented dialog |
|
162 * |
|
163 * @param aPasswordInfo old password |
|
164 * return - |
|
165 */ |
|
166 void SetSelectedOldPassword( |
|
167 TEapDialogInfo& aPasswordInfo ); |
|
168 |
|
169 private: |
|
170 /** |
|
171 * Constructor |
|
172 */ |
|
173 CEapAuthNotifier( MNotificationCallback& aClient ); |
|
174 |
|
175 /** |
|
176 * ConstructL |
|
177 */ |
|
178 void ConstructL(); |
|
179 |
|
180 /** |
|
181 * Set data for the UsernamePassword Dialog(s) |
|
182 * |
|
183 * @param aPasswordInfo data to be filled |
|
184 * @param aEapType Eap type to be used |
|
185 * @param aMap Pointer to variant data |
|
186 * @param aAuthMethod Authentication method to be used |
|
187 * return - |
|
188 */ |
|
189 void SetUsernamePasswordDataL( |
|
190 TEapDialogInfo* aPasswordInfo, |
|
191 TEapExpandedType& aEapType, |
|
192 CHbSymbianVariantMap* aMap, |
|
193 const TDesC& aAuthMethod ); |
|
194 |
|
195 |
|
196 /** |
|
197 * Set data for the query Dialog(s) |
|
198 * |
|
199 * @param aEapInfo data to be filled |
|
200 * @param aMap Pointer to variant data |
|
201 * @param aAuthMethod Authentication method to be used |
|
202 * return - |
|
203 */ |
|
204 void SetQueryDialogDataL( |
|
205 TEapDialogInfo* aEapInfo, |
|
206 CHbSymbianVariantMap* aMap, |
|
207 const TDesC& aAuthMethod ); |
|
208 |
|
209 /** |
|
210 * Set data for the Install Pac query Dialog(s) |
|
211 * |
|
212 * @param aEapInfo data to be filled |
|
213 * @param aMap Pointer to variant data |
|
214 * return - |
|
215 */ |
|
216 void SetFastInstallPacQueryDialogDataL( |
|
217 TEapDialogInfo* aEapInfo, |
|
218 CHbSymbianVariantMap* aMap ); |
|
219 |
|
220 /** |
|
221 * Set data for the Pac file query Dialog(s) |
|
222 * |
|
223 * @param aEapInfo data to be filled |
|
224 * @param aMap Pointer to variant data |
|
225 * return - |
|
226 */ |
|
227 void SetFastPacFileQueryPwDialogDataL( |
|
228 TEapDialogInfo* aEapInfo, |
|
229 CHbSymbianVariantMap* aMap ); |
|
230 |
|
231 /** |
|
232 * Set data for the prov wait note Dialog(s) |
|
233 * |
|
234 * @param aMap Pointer to variant data |
|
235 * @param aAuthProvWaitNote Tells whether auth or unauth |
|
236 * return - |
|
237 */ |
|
238 void SetFastProvWaitNoteDialogDataL( |
|
239 CHbSymbianVariantMap* aMap, |
|
240 TBool aAuthProvWaitNote ); |
|
241 |
|
242 /** |
|
243 * Set data for the Password Dialog(s) |
|
244 * |
|
245 * @param aEapType Eap type to be used |
|
246 * @param aMap Pointer to variant data |
|
247 * @param aAuthMethod Authentication method to be used |
|
248 * return - |
|
249 */ |
|
250 void SetPasswordQueryDataL( |
|
251 TEapExpandedType& aEapType, |
|
252 CHbSymbianVariantMap* aMap, |
|
253 const TDesC& aAuthMethod ); |
|
254 |
|
255 private: // Data |
|
256 |
|
257 /** |
|
258 * For callback |
|
259 */ |
|
260 MNotificationCallback& iClient; |
|
261 |
|
262 /** |
|
263 * Pointer to the device dialog interface for handling the dialog |
|
264 */ |
|
265 CHbDeviceDialogSymbian* iDialog; |
|
266 |
|
267 /** |
|
268 * The observer to handle the data received from the orbit dialog |
|
269 */ |
|
270 CEapAuthObserver* iObserver; |
|
271 |
|
272 /** |
|
273 * Information if request was already completed, in case the |
|
274 * observer receives the data signal and the signal about closing the |
|
275 * dialog. |
|
276 */ |
|
277 TBool iCompleted; |
|
278 |
|
279 /** |
|
280 * Information if request was already cancelled. |
|
281 */ |
|
282 TBool iCancelled; |
|
283 |
|
284 /** |
|
285 * Pointer to the Eap Dialog Info structure |
|
286 */ |
|
287 TEapDialogInfo* iEapInfo; |
|
288 |
|
289 |
|
290 }; |
|
291 |
|
292 #endif //__EAPAUTHNOTIFIER_H__ |
|
293 |
|