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