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 the main handler CWPASecuritySettings, UI CWPASecuritySettingsUI and public API for the WPA Security Settings. |
|
15 * |
|
16 */ |
|
17 |
|
18 /* |
|
19 * %version: 5 % |
|
20 */ |
|
21 |
|
22 #ifndef WPASECURITYSETTINGSUI_H |
|
23 #define WPASECURITYSETTINGSUI_H |
|
24 |
|
25 // INCLUDES |
|
26 |
|
27 #include <e32base.h> |
|
28 |
|
29 #include <metadatabase.h> |
|
30 using namespace CommsDat; |
|
31 |
|
32 // FORWARD DECLARATIONS |
|
33 class CEikonEnv; |
|
34 class CWPASecuritySettingsUi; |
|
35 class CWPASecuritySettingsUiImpl; |
|
36 class CWPASecuritySettingsImpl; |
|
37 class CCommsDatabase; |
|
38 |
|
39 |
|
40 // ENUMERATIONS |
|
41 |
|
42 // Security mode in use |
|
43 enum TSecurityMode |
|
44 { |
|
45 ESecurityMode8021x = 4, // 802.1x |
|
46 ESecurityModeWpa = 8 // WPA |
|
47 }; |
|
48 |
|
49 |
|
50 // Type of saving |
|
51 enum TTypeOfSaving |
|
52 { |
|
53 ESavingEditedAP, // Save an already existing AP that was edited. |
|
54 ESavingBrandNewAP, // Save a just created AP started from default values |
|
55 ESavingNewAPAsACopy // Save a new AP as a copy of an already existing AP |
|
56 }; |
|
57 |
|
58 |
|
59 |
|
60 |
|
61 // CLASS DECLARATION |
|
62 /* |
|
63 * WPA Security Settings. Enables loading, saving and editing the settings |
|
64 * (editing via CWPASecuritySettingsUi). |
|
65 * Proxy around the real implementation in CWPASecuritySettingsUiImpl. |
|
66 * No details of the actual data are exposed. |
|
67 */ |
|
68 NONSHARABLE_CLASS( CWPASecuritySettings ) : public CBase |
|
69 { |
|
70 |
|
71 public: // Constructors and destructor |
|
72 |
|
73 /** |
|
74 * Two-phased constructor. Leaves on failure. |
|
75 * @param aSecurityMode The chosen security mode. It can be |
|
76 * ESecurityMode8021x or ESecurityModeWpa |
|
77 * @return The constructed CWPASecuritySettings object. |
|
78 */ |
|
79 IMPORT_C static CWPASecuritySettings* NewL( |
|
80 TSecurityMode aSecurityMode ); |
|
81 |
|
82 |
|
83 /** |
|
84 * Destructor. |
|
85 */ |
|
86 IMPORT_C ~CWPASecuritySettings(); |
|
87 |
|
88 |
|
89 public: // Types |
|
90 |
|
91 enum TEvent // Events happening during edit. |
|
92 { |
|
93 ENone = 0x0000, // Nothing happened. |
|
94 EModified = 0x0001, // Data changed. |
|
95 EValid = 0x0010, // All data entererd are valid, they |
|
96 // can be saved |
|
97 EExitReq = 0x0020, // Exit option requested, also caller |
|
98 // app should close |
|
99 EShutDownReq = 0x0040 // ShutDown was requested |
|
100 }; |
|
101 |
|
102 |
|
103 public: // New methods |
|
104 |
|
105 /** |
|
106 * Load from database. |
|
107 * @param Wlan Service Table Id of the IAP to be loaded |
|
108 * @param aCommsDb Comms database. |
|
109 */ |
|
110 IMPORT_C void LoadL( TUint32 aIapId, CCommsDatabase& aCommsDb ); |
|
111 |
|
112 |
|
113 /** |
|
114 * Edit the settings. |
|
115 * @param aUi UI to be used. |
|
116 * @param aTitle Title Pane text to display during edit. |
|
117 * @return Exit reason. |
|
118 */ |
|
119 IMPORT_C TInt EditL( CWPASecuritySettingsUi& aUi, |
|
120 const TDesC& aTitle ); |
|
121 |
|
122 /** |
|
123 * Save to database. |
|
124 * @param aIapId Wlan Service Table Id of the IAP to be saved |
|
125 * @param aCommsDb Comms database. |
|
126 * @param aTypeOfSaving Tells what kind of AP we are going to save: it |
|
127 * can be ESavingEditedAP, ESavingBrandNewAP, or |
|
128 * ESavingNewAPAsACopy |
|
129 * @param aOldIapId The old Id of the IAP; it is used to save the EAP |
|
130 * configuration, only when aIsNewAP is ETrue |
|
131 */ |
|
132 IMPORT_C void SaveL( TUint32 aIapId, |
|
133 CCommsDatabase& aCommsDb, |
|
134 TTypeOfSaving aTypeOfSaving, |
|
135 TUint32 aOldIapId ) const; |
|
136 |
|
137 |
|
138 /** |
|
139 * Delete from database. It actually just removes EAP Configuration. |
|
140 * @param aIapId Id of the IAP to be saved |
|
141 */ |
|
142 IMPORT_C void DeleteL( TUint32 aIapId ) const; |
|
143 |
|
144 |
|
145 /** |
|
146 * Tells if the settings are valid and can be saved |
|
147 * @return ETrue if all the compulsory settings have been entered |
|
148 */ |
|
149 IMPORT_C TBool IsValid() const; |
|
150 |
|
151 |
|
152 /** |
|
153 * Sets the Pre-shared key |
|
154 * @param aPreSharedKey The key to be set |
|
155 * @return KErrNone if successful, or an error code |
|
156 */ |
|
157 IMPORT_C TInt SetWPAPreSharedKey( const TDesC& aPreSharedKey ); |
|
158 |
|
159 |
|
160 /** |
|
161 * Load from database. |
|
162 * @param aIapId Wlan Service Table Id of the IAP to be loaded |
|
163 * @param aSession CommsDat session. |
|
164 */ |
|
165 IMPORT_C void LoadL( TUint32 aIapId, CMDBSession& aSession ); |
|
166 |
|
167 |
|
168 /** |
|
169 * Save to database. |
|
170 * @param aIapId Wlan Service Table Id of the IAP to be saved |
|
171 * @param aSession CommsDat session. |
|
172 * @param aTypeOfSaving Tells what kind of AP we are going to save: it |
|
173 * can be ESavingEditedAP, ESavingBrandNewAP, or |
|
174 * ESavingNewAPAsACopy |
|
175 * @param aOldIapId The old Id of the IAP; it is used to save the EAP |
|
176 * configuration, only when aIsNewAP is ETrue |
|
177 */ |
|
178 IMPORT_C void SaveL( TUint32 aIapId, |
|
179 CMDBSession& aSession, |
|
180 TTypeOfSaving aTypeOfSaving, |
|
181 TUint32 aOldIapId ) const; |
|
182 |
|
183 /** |
|
184 * Sets the list of enabled EAP types. |
|
185 * @param aEnabledPluginList Enumeration of enabled plugins |
|
186 * in expanded EAP type format |
|
187 * @return KErrNone if successful, or an error code |
|
188 */ |
|
189 IMPORT_C TInt SetWPAEnabledEAPPlugin( const TDesC8& aEnabledPluginList ); |
|
190 |
|
191 |
|
192 /** |
|
193 * Sets the list of disabled EAP types |
|
194 * @param aDisabledPluginList Enumeration of disabled plugins |
|
195 * in expanded EAP type format |
|
196 * @return KErrNone if successful, or an error code |
|
197 */ |
|
198 IMPORT_C TInt SetWPADisabledEAPPlugin( const TDesC8& aDisabledPluginList ); |
|
199 |
|
200 |
|
201 private: // Data |
|
202 |
|
203 // Implementation. Owned. |
|
204 CWPASecuritySettingsImpl* iImpl; |
|
205 |
|
206 }; |
|
207 |
|
208 |
|
209 |
|
210 /** |
|
211 * User interface to edit WPA Security Settings. |
|
212 * Proxy around the real implementation in CWPASecuritySettingsUiImpl. |
|
213 */ |
|
214 NONSHARABLE_CLASS( CWPASecuritySettingsUi ) : public CBase |
|
215 { |
|
216 |
|
217 public: // Constructors and destructor |
|
218 |
|
219 /** |
|
220 * Two-phased constructor. Leaves on failure. |
|
221 * @param aEikEnv Eikon environment. |
|
222 * @return The constructed CWPASecuritySettingsUi object. |
|
223 */ |
|
224 IMPORT_C static CWPASecuritySettingsUi* NewL( CEikonEnv& aEikEnv ); |
|
225 |
|
226 /** |
|
227 * Destructor. |
|
228 */ |
|
229 IMPORT_C virtual ~CWPASecuritySettingsUi(); |
|
230 |
|
231 public: // New methods |
|
232 |
|
233 /** |
|
234 * Component Validation Test. |
|
235 * @return KErrNone. |
|
236 */ |
|
237 IMPORT_C static TInt Cvt(); |
|
238 |
|
239 private: // Friends |
|
240 |
|
241 friend class CWPASecuritySettings; |
|
242 |
|
243 private: // Data |
|
244 |
|
245 // Implementation. Owned. |
|
246 CWPASecuritySettingsUiImpl* iImpl; |
|
247 |
|
248 }; |
|
249 #endif |
|
250 |
|
251 |
|
252 // End of File |
|