author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:35:46 +0300 | |
branch | RCL_3 |
changeset 55 | 9c2aa05919d9 |
parent 46 | c74b3d9f6b9e |
permissions | -rw-r--r-- |
46 | 1 |
/* |
2 |
* Copyright (c) 2001-2009 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 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". |
|
8 |
* |
|
9 |
* Initial Contributors: |
|
10 |
* Nokia Corporation - initial contribution. |
|
11 |
* |
|
12 |
* Contributors: |
|
13 |
* |
|
14 |
* Description: Declares dialog. |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
/* |
|
55
9c2aa05919d9
Revision: 201036
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
19 |
* %version: tr1cfwln#20 % |
46 | 20 |
*/ |
21 |
||
22 |
#ifndef WPA_SECURITY_SETTINGS_DLG_H |
|
23 |
#define WPA_SECURITY_SETTINGS_DLG_H |
|
24 |
||
25 |
||
26 |
// ENUMERATIONS |
|
27 |
||
28 |
// Members to be showed in the setting pages |
|
29 |
enum TWpaMember |
|
30 |
{ |
|
31 |
EWpaMode, // WPA mode |
|
32 |
EWpaEapConfig, // EAP Plugin configuration |
|
33 |
EWpaWpa2Only, // Wpa2 only mode |
|
55
9c2aa05919d9
Revision: 201036
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
46
diff
changeset
|
34 |
EWpaPreSharedKey // Pre-shared key |
46 | 35 |
}; |
36 |
||
37 |
||
38 |
// INCLUDES |
|
39 |
#include <AknDialog.h> |
|
40 |
#include <eiklbo.h> |
|
41 |
#include <aknlists.h> |
|
42 |
#ifndef SYMBIAN_ENABLE_SPLIT_HEADERS |
|
43 |
#include <commsdat.h> |
|
44 |
#else |
|
45 |
#include <commsdat.h> |
|
46 |
#include <commsdat_partner.h> |
|
47 |
#endif |
|
48 |
#include "WPASecuritySettingsImpl.h" |
|
49 |
||
50 |
// FORWARD DECLARATIONS |
|
51 |
class CAknTitlePane; |
|
52 |
class CWPASecuritySettingsImpl; |
|
53 |
class CEAPPluginConfigurationIf; |
|
54 |
||
55 |
||
56 |
// CLASS DECLARATION |
|
57 |
/** |
|
58 |
* CWPASecuritySettingsDlg dialog class |
|
59 |
*/ |
|
60 |
NONSHARABLE_CLASS( CWPASecuritySettingsDlg ) : public CAknDialog, |
|
61 |
public MEikListBoxObserver |
|
62 |
{ |
|
63 |
||
64 |
public: // Constructors and destructor |
|
65 |
||
66 |
/** |
|
67 |
* Create and launch dialog. |
|
68 |
* @param aSecuritySettings Security settings |
|
69 |
* @param aTitle Title of the dialog |
|
70 |
* @return The ID of the button that closed the dialog |
|
71 |
*/ |
|
72 |
TInt ConstructAndRunLD( CWPASecuritySettingsImpl* aSecuritySettings, |
|
73 |
const TDesC& aTitle ); |
|
74 |
||
75 |
||
76 |
/** |
|
77 |
* Two-phase construction. |
|
78 |
* @param aEventStore A reference to hold the events happened |
|
79 |
* @param aIapId Id of the IAP. |
|
80 |
* @param aPlugin The EAP Configuration plugin. |
|
81 |
* @return The constructed CWPASecuritySettingsDlg object. |
|
82 |
*/ |
|
83 |
static CWPASecuritySettingsDlg* NewL( TInt& aEventStore, |
|
84 |
const TUint32 aIapId, |
|
85 |
CEAPPluginConfigurationIf* aPlugin ); |
|
86 |
||
87 |
/** |
|
88 |
* Destructor. |
|
89 |
*/ |
|
90 |
~CWPASecuritySettingsDlg(); |
|
91 |
||
92 |
||
93 |
protected: |
|
94 |
/** |
|
95 |
* Constructor. |
|
96 |
* @param aEventStore A reference to hold the events happened |
|
97 |
* @param aIapId Id of the IAP. |
|
98 |
* @param aPlugin The EAP Configuration plugin. |
|
99 |
*/ |
|
100 |
CWPASecuritySettingsDlg( TInt& aEventStore, const TUint32 aIapId, |
|
101 |
CEAPPluginConfigurationIf* aPlugin ); |
|
102 |
||
103 |
||
104 |
public: // Functions from base classes |
|
105 |
/** |
|
106 |
* Handle key events. |
|
107 |
* @param aKeyEvent: key event |
|
108 |
* @param aType: type of event |
|
109 |
* @return The key response, if it was consumed or not. |
|
110 |
*/ |
|
111 |
TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, |
|
112 |
TEventCode aType ); |
|
113 |
||
114 |
private: // Functions from base classes |
|
115 |
||
116 |
/** |
|
117 |
* This function is called by the dialog framework before the dialog is |
|
118 |
* sized and laid out. |
|
119 |
*/ |
|
120 |
virtual void PreLayoutDynInitL(); |
|
121 |
||
122 |
||
123 |
/** |
|
124 |
* Handles a dialog button press for the specified button |
|
125 |
* @param aButtonId The ID of the button that was activated. |
|
126 |
* @return ETrue to validate and exit the dialog, |
|
127 |
* EFalse to keep the dialog active |
|
128 |
*/ |
|
129 |
TBool OkToExitL( TInt aButtonId ); |
|
130 |
||
131 |
||
132 |
/** |
|
133 |
* Processes user commands. |
|
134 |
* @param aCommandId ID of the command to respond to. |
|
135 |
*/ |
|
136 |
virtual void ProcessCommandL( TInt aCommandId ); |
|
137 |
||
138 |
||
139 |
/** |
|
140 |
* Handles list box events. |
|
141 |
* @param aListBox The originating list box. |
|
142 |
* @param aEventType A code for the event. |
|
143 |
*/ |
|
144 |
void HandleListBoxEventL( CEikListBox* aListBox, |
|
145 |
TListBoxEvent aEventType ); |
|
146 |
||
147 |
/** |
|
148 |
* Get help context. |
|
149 |
* @param aContext Help context is returned here. |
|
150 |
*/ |
|
151 |
void GetHelpContext( TCoeHelpContext& aContext ) const; |
|
152 |
||
153 |
/** |
|
154 |
* Initialize menu pane. |
|
155 |
* @param aResourceId Menu pane resource id. |
|
156 |
* @param CEikMenuPane Menu pane. |
|
157 |
*/ |
|
158 |
void DynInitMenuPaneL( TInt aResourceId, CEikMenuPane* aMenuPane ); |
|
159 |
||
160 |
||
161 |
protected: // New functions |
|
162 |
||
163 |
/** |
|
164 |
* Handles listbox data change |
|
165 |
*/ |
|
166 |
void HandleListboxDataChangeL(); |
|
167 |
||
168 |
||
169 |
/** |
|
170 |
* Fills up the listbox with data |
|
171 |
* @param aItemArray Array where to add the elements |
|
172 |
* @param arr Array to be used as list elements |
|
173 |
* @param aRes Array of resource IDs to be used for the |
|
174 |
* elements of arr |
|
175 |
*/ |
|
176 |
void FillListWithDataL( CDesCArrayFlat& aItemArray, |
|
177 |
const TWpaMember& arr, const TInt* aRes ); |
|
178 |
||
179 |
||
180 |
/** |
|
181 |
* Updates one 'textual' listbox item for the given member |
|
182 |
* @param aMember Value specifying which member has to be added to |
|
183 |
* the list |
|
184 |
* @param aRes Resource ID for the 'title text' for this member |
|
185 |
* @param aPos The current position of the item in the list |
|
186 |
*/ |
|
187 |
void UpdateTextualListBoxItemL( TWpaMember aMember, TInt aRes, |
|
188 |
TInt aPos ); |
|
189 |
||
190 |
||
191 |
/** |
|
192 |
* Creates one 'textual' listbox item for the given member |
|
193 |
* @param aMember Value specifying which member has to be added to |
|
194 |
* the list |
|
195 |
* @param aRes Resource ID for the 'title text' for this member |
|
196 |
* @return The created listbox item text. |
|
197 |
*/ |
|
198 |
HBufC* CreateTextualListBoxItemL( TWpaMember aMember, TInt aRes ); |
|
199 |
||
200 |
||
201 |
/** |
|
202 |
* Changes one setting. The setting, which is |
|
203 |
* highlighted as current in the listbox is changed. |
|
204 |
* @param aQuick ETrue if the setting is "two-choices", and can be |
|
205 |
* automatically changed, without showing the list of |
|
206 |
* elements |
|
207 |
*/ |
|
208 |
void ChangeSettingsL( TBool aQuick ); |
|
209 |
||
210 |
||
211 |
/** |
|
212 |
* Shows a popup setting page (radio buttons) for the given member |
|
213 |
* @param aDataMember The member which needs to be changed |
|
214 |
* @return A boolean indicating whether the current setting |
|
215 |
* has been changed or not. |
|
216 |
*/ |
|
217 |
TBool ShowPopupSettingPageL( TWpaMember aDataMember ); |
|
218 |
||
219 |
||
220 |
/** |
|
221 |
* Shows a popup text setting page for the given member |
|
222 |
* @return A boolean indicating whether the current setting |
|
223 |
* has been changed or not. |
|
224 |
*/ |
|
225 |
TBool ShowPopupTextSettingPageL(); |
|
226 |
||
227 |
||
228 |
/** |
|
229 |
* Fills up a pop-up radio button setting page with the currently |
|
230 |
* valid and available choices for the given member. |
|
231 |
* @param aData The member whose new setting is needed |
|
232 |
* @param aCurrvalue The current value of the setting |
|
233 |
* @return An array of choices for the given member, pushed to the |
|
234 |
* CleanupStack. |
|
235 |
*/ |
|
236 |
CDesCArrayFlat* FillPopupSettingPageLC( TWpaMember aData, |
|
237 |
TInt& aCurrvalue ); |
|
238 |
||
239 |
||
240 |
/** |
|
241 |
* Updates the given member's data with the new setting from the setting |
|
242 |
* page. |
|
243 |
* @param aData The member to update |
|
244 |
* @param aCurrvalue The new value |
|
245 |
* @return A boolean indicating if the value is actually changed |
|
246 |
*/ |
|
247 |
TBool UpdateFromPopupSettingPage( TWpaMember aData, TBool aCurrvalue ); |
|
248 |
||
249 |
||
250 |
/** |
|
251 |
* Cleanup for the iEapConfigActive semaphore flag |
|
252 |
* @since S60 5.0 |
|
253 |
* @param aPtr Pointer to this class |
|
254 |
*/ |
|
255 |
static void ResetEapConfigFlag( TAny* aPtr ); |
|
256 |
||
257 |
/** |
|
258 |
* @see CEikDialog |
|
259 |
*/ |
|
260 |
void HandleDialogPageEventL( TInt aEventID ); |
|
261 |
||
262 |
private: //data |
|
263 |
||
264 |
// Stores the name of the connection, to be showed as the title. |
|
265 |
TBuf<CommsDat::KMaxTextLength> iConnectionName; |
|
266 |
||
267 |
// Title pane. Not owned. |
|
268 |
CAknTitlePane* iTitlePane; |
|
269 |
||
270 |
// Pointer to the old title. Owned. |
|
271 |
HBufC* iOldTitleText; |
|
272 |
||
273 |
// Owned through resources, destroyed automatically by the dialog. |
|
274 |
CAknSettingStyleListBox* iList; |
|
275 |
||
276 |
// Array of the items. Not owned. |
|
277 |
CDesCArrayFlat* iItemArray; |
|
278 |
||
279 |
// Fields of the main view. Not owned. |
|
280 |
TWpaMember* iFieldsMain; |
|
281 |
||
282 |
// Titles of the main view. Not owned. |
|
283 |
TInt* iTitlesMain; |
|
284 |
||
285 |
// Pointer to the WPA Security Settings. Not owned. |
|
286 |
CWPASecuritySettingsImpl* iSecuritySettings; |
|
287 |
||
288 |
// To hold the events. Not owned. |
|
289 |
TInt* iEventStore; |
|
290 |
||
291 |
// The Id of the AP. |
|
292 |
TUint32 iIapId; |
|
293 |
||
294 |
// The EAP Configuration plugin. Not owned. |
|
295 |
CEAPPluginConfigurationIf* iPlugin; |
|
296 |
||
297 |
// Indicates whether the EAP plugin configuration is active |
|
298 |
TBool iEapConfigActive; |
|
299 |
||
300 |
TBuf8<KWLANEAPLISTLENGTH> iEnabledPluginList; |
|
301 |
TBuf8<KWLANEAPLISTLENGTH> iDisabledPluginList; |
|
302 |
}; |
|
303 |
||
304 |
||
305 |
#endif // WPA_SECURITY_SETTINGS_DLG_H |
|
306 |
||
307 |
// End of File |