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