|
1 /* |
|
2 * Copyright (c) 2004 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: |
|
15 * Declaration of class CConnectionUiUtilitiesImpl. |
|
16 * |
|
17 * |
|
18 */ |
|
19 |
|
20 |
|
21 #ifndef CONNECTIONUIUTILITIESIMPL_H |
|
22 #define CONNECTIONUIUTILITIESIMPL_H |
|
23 |
|
24 // INCLUDES |
|
25 #include <e32base.h> |
|
26 #include "ConnectionUiUtilitiesClient.h" |
|
27 #include "ConnectionUiUtilitiesCommon.h" |
|
28 #include "ActiveWrapper.h" |
|
29 |
|
30 // CONST DECLARATIONS |
|
31 |
|
32 _LIT( KMrouterName, "mRouter" ); |
|
33 |
|
34 #if defined(_DEBUG) |
|
35 _LIT( KErrNullPointer, "NULL pointer" ); |
|
36 #endif |
|
37 |
|
38 |
|
39 // FORWARD DECLARATIONS |
|
40 class CCommsDatabase; |
|
41 class TConnectionPrefs; |
|
42 class CAknGlobalNote; |
|
43 |
|
44 |
|
45 // CLASS DECLARATION |
|
46 |
|
47 /** |
|
48 * Connection Ui Utilities. |
|
49 * Implementation behind proxy class CConnectionUiUtilities. |
|
50 */ |
|
51 NONSHARABLE_CLASS( CConnectionUiUtilitiesImpl ) : public CBase |
|
52 { |
|
53 |
|
54 public: // Constructors and destructor |
|
55 |
|
56 /** |
|
57 * Two-phased constructor. Leaves on failure. |
|
58 * @return The constructed CConnectionUiUtilities object. |
|
59 */ |
|
60 static CConnectionUiUtilitiesImpl* NewL(); |
|
61 |
|
62 /** |
|
63 * Destructor. |
|
64 */ |
|
65 virtual ~CConnectionUiUtilitiesImpl(); |
|
66 |
|
67 protected: // Constructors |
|
68 |
|
69 /** |
|
70 * Constructor. |
|
71 */ |
|
72 CConnectionUiUtilitiesImpl(); |
|
73 |
|
74 /** |
|
75 * Second-phase constructor. |
|
76 */ |
|
77 void ConstructL(); |
|
78 |
|
79 public: // New methods |
|
80 /** |
|
81 * @param aResult contains ECuuAlwaysAsk if always ask radio button |
|
82 * was selected, and ECuuUserDefined if user defined |
|
83 * radio button was selected by user |
|
84 * It acts also as input parameter to default this setting. |
|
85 * @return ETrue if OK Soft key was pressed, |
|
86 * EFalse if Cancel Soft key was selected on the dialog. |
|
87 */ |
|
88 TBool AlwaysAskPageL( TCuuAlwaysAskResults& aResult ); |
|
89 |
|
90 /** |
|
91 * @param aIAPId gives back the iapid of selected connection |
|
92 * @param aPrefs Specifies the rank and desired direction and bearer |
|
93 * of the connections will appear in the dialog |
|
94 * @return ETrue if Select Soft key was pressed, |
|
95 * EFalse if Cancel Soft key was selected on the dialog. |
|
96 */ |
|
97 TBool ChangeConnectionL( TUint32& aUid, TConnectionPrefs aPrefs ); |
|
98 |
|
99 /** |
|
100 * Pops up an information note, about connection is changed to |
|
101 * the given accespont |
|
102 * @param aIAPId The id of access point which has been selected. |
|
103 */ |
|
104 void ShowConnectionChangedNoteL( const TUint32& aIAPId ); |
|
105 |
|
106 /** |
|
107 * Notifier. Search available WLAN networks, and user can select one of |
|
108 * them |
|
109 * @param aSSID the id of selected wlan network |
|
110 * @param aConnectionMode connection mode of selected wlan network |
|
111 * @param aSecurityMode security mode of selected wlan network |
|
112 * @return ETrue if user selected one of networks, EFalse if an error |
|
113 * is occured or user does not select a network. |
|
114 */ |
|
115 TBool SearchWLANNetwork( TWlanSsid& aSSID, |
|
116 TWlanConnectionMode& aConnectionMode, |
|
117 TWlanConnectionSecurityMode& aSecurityMode ); |
|
118 |
|
119 /** |
|
120 * Notifier. Search available WLAN networks, and user can select one of |
|
121 * them |
|
122 * @param aSSID the id of selected wlan network |
|
123 * @param aConnectionMode connection mode of selected wlan network |
|
124 * @param aExtSecurityMode extended security mode of selected wlan network |
|
125 * @return ETrue if user selected one of networks, EFalse if an error |
|
126 * is occured or user does not select a network. |
|
127 */ |
|
128 TBool SearchWLANNetwork( TWlanSsid& aSSID, |
|
129 TWlanConnectionMode& aConnectionMode, |
|
130 TWlanConnectionExtentedSecurityMode& aExtSecurityMode ); |
|
131 |
|
132 /** |
|
133 * Notifier. Search available WLAN networks, and user can select one of |
|
134 * them |
|
135 * @param aSSID the id of selected wlan network |
|
136 * @param aConnectionMode connection mode of selected wlan network |
|
137 * @param aSecurityMode security mode of selected wlan network |
|
138 * @param aProtectedSetupSupported if the wlan supports Protected Setup |
|
139 * @return ETrue if user selected one of networks, EFalse if an error |
|
140 * is occured or user does not select a network. |
|
141 */ |
|
142 TBool SearchWLANNetwork( TWlanSsid& aSSID, |
|
143 TWlanConnectionMode& aConnectionMode, |
|
144 TWlanConnectionSecurityMode& aSecurityMode, |
|
145 TBool& aProtectedSetupSupported ); |
|
146 |
|
147 /** |
|
148 * Notifier. Search available WLAN networks, and user can select one of |
|
149 * them |
|
150 * @param aSSID the id of selected wlan network |
|
151 * @param aConnectionMode connection mode of selected wlan network |
|
152 * @param aExtSecurityMode security mode of selected wlan network |
|
153 * @param aProtectedSetupSupported if the wlan supports Protected Setup |
|
154 * @return ETrue if user selected one of networks, EFalse if an error |
|
155 * is occured or user does not select a network. |
|
156 */ |
|
157 TBool SearchWLANNetwork( TWlanSsid& aSSID, |
|
158 TWlanConnectionMode& aConnectionMode, |
|
159 TWlanConnectionExtentedSecurityMode& aExtSecurityMode, |
|
160 TBool& aProtectedSetupSupported ); |
|
161 |
|
162 |
|
163 /** |
|
164 * Notifier. Search available WLAN networks, and user can select one of |
|
165 * them |
|
166 * @param aSSID the id of selected wlan network |
|
167 * @param aConnectionMode connection mode of selected wlan network |
|
168 * @param aSecurityMode security mode of selected wlan network |
|
169 * @param aExtSecurityMode security mode of selected wlan network |
|
170 * @param aProtectedSetupSupported if the wlan supports Protected Setup |
|
171 * @return ETrue if user selected one of networks, EFalse if an error |
|
172 * is occured or user does not select a network. |
|
173 */ |
|
174 TBool SearchWLANNetwork( TWlanSsid& aSSID, |
|
175 TWlanConnectionMode& aConnectionMode, |
|
176 TWlanConnectionSecurityMode& aSecurityMode, |
|
177 TWlanConnectionExtentedSecurityMode& aExtSecurityMode, |
|
178 TBool& aProtectedSetupSupported ); |
|
179 |
|
180 /** |
|
181 * Notifier. Search available WLAN networks, and user can select one of |
|
182 * them. |
|
183 * Totally synchronous version, to be used from Engines, not from UIs |
|
184 * @param aSSID the id of selected wlan network |
|
185 * @param aConnectionMode connection mode of selected wlan network |
|
186 * @param aSecurityMode security mode of selected wlan network |
|
187 * @return ETrue if user selected one of networks, EFalse if an error |
|
188 * is occured or user does not select a network. |
|
189 */ |
|
190 TBool SearchWLANNetworkSync( TWlanSsid& aSSID, |
|
191 TWlanConnectionMode& aConnectionMode, |
|
192 TWlanConnectionSecurityMode& aSecurityMode ); |
|
193 |
|
194 |
|
195 /** |
|
196 * Notifier. Search available WLAN networks, and user can select one of |
|
197 * them. |
|
198 * Totally synchronous version, to be used from Engines, not from UIs |
|
199 * @param aSSID the id of selected wlan network |
|
200 * @param aConnectionMode connection mode of selected wlan network |
|
201 * @param aSecurityMode security mode of selected wlan network |
|
202 * @param aProtectedSetupSupported if the wlan supports Protected Setup |
|
203 * @return ETrue if user selected one of networks, EFalse if an error |
|
204 * is occured or user does not select a network. |
|
205 */ |
|
206 TBool SearchWLANNetworkSync( TWlanSsid& aSSID, |
|
207 TWlanConnectionMode& aConnectionMode, |
|
208 TWlanConnectionSecurityMode& aSecurityMode, |
|
209 TBool& aProtectedSetupSupported ); |
|
210 |
|
211 |
|
212 /** |
|
213 * Notifier. Search available WLAN networks, and user can select one of |
|
214 * them. Totally asynchronous version, to be used from Engines, not |
|
215 * from UIs |
|
216 * @param aStatus status object of notifier |
|
217 * @param aSSID the id of selected wlan network |
|
218 * @param aConnectionMode connection mode of selected wlan network |
|
219 * @param aSecurityMode security mode of selected wlan network |
|
220 * @return |
|
221 */ |
|
222 void SearchWLANNetworkAsync( TRequestStatus& aStatus, |
|
223 TWlanSsid& aSSID, |
|
224 TWlanConnectionMode& aConnectionMode, |
|
225 TWlanConnectionSecurityMode& aSecurityMode ); |
|
226 |
|
227 /** |
|
228 * Notifier. Search available WLAN networks, and user can select one of |
|
229 * them. Totally asynchronous version, to be used from Engines, not |
|
230 * from UIs |
|
231 * @param aStatus status object of notifier |
|
232 * @param aSSID the id of selected wlan network |
|
233 * @param aConnectionMode connection mode of selected wlan network |
|
234 * @param aExtSecurityMode extented security mode of selected wlan network |
|
235 * @return |
|
236 */ |
|
237 void SearchWLANNetworkAsync( TRequestStatus& aStatus, |
|
238 TWlanSsid& aSSID, |
|
239 TWlanConnectionMode& aConnectionMode, |
|
240 TWlanConnectionExtentedSecurityMode& aExtSecurityMode ); |
|
241 |
|
242 /** |
|
243 * Notifier. Search available WLAN networks, and user can select one of |
|
244 * them. Totally asynchronous version, to be used from Engines, not |
|
245 * from UIs |
|
246 * @param aStatus status object of notifier |
|
247 * @param aSSID the id of selected wlan network |
|
248 * @param aConnectionMode connection mode of selected wlan network |
|
249 * @param aSecurityMode security mode of selected wlan network |
|
250 * @param aProtectedSetupSupported if the wlan supports Protected Setup |
|
251 * @return |
|
252 */ |
|
253 void SearchWLANNetworkAsync( TRequestStatus& aStatus, |
|
254 TWlanSsid& aSSID, |
|
255 TWlanConnectionMode& aConnectionMode, |
|
256 TWlanConnectionSecurityMode& aSecurityMode, |
|
257 TBool& aProtectedSetupSupported ); |
|
258 |
|
259 /** |
|
260 * Notifier. Search available WLAN networks, and user can select one of |
|
261 * them. Totally asynchronous version, to be used from Engines, not |
|
262 * from UIs |
|
263 * @param aStatus status object of notifier |
|
264 * @param aSSID the id of selected wlan network |
|
265 * @param aConnectionMode connection mode of selected wlan network |
|
266 * @param aExtSecurityMode extended security mode of selected wlan network |
|
267 * @param aProtectedSetupSupported if the wlan supports Protected Setup |
|
268 * @return |
|
269 */ |
|
270 void SearchWLANNetworkAsync( TRequestStatus& aStatus, |
|
271 TWlanSsid& aSSID, |
|
272 TWlanConnectionMode& aConnectionMode, |
|
273 TWlanConnectionExtentedSecurityMode& aExtSecurityMode, |
|
274 TBool& aProtectedSetupSupported ); |
|
275 |
|
276 /** |
|
277 * Notifier. Search available WLAN networks, and user can select one of |
|
278 * them. Totally asynchronous version, to be used from Engines, not |
|
279 * from UIs |
|
280 * @param aStatus status object of notifier |
|
281 * @param aSSID the id of selected wlan network |
|
282 * @param aConnectionMode connection mode of selected wlan network |
|
283 * @param aSecurityMode security mode of selected wlan network |
|
284 * @param aExtSecurityMode extended security mode of selected wlan network |
|
285 * @param aProtectedSetupSupported if the wlan supports Protected Setup |
|
286 * @return |
|
287 */ |
|
288 void SearchWLANNetworkAsync( TRequestStatus& aStatus, |
|
289 TWlanSsid& aSSID, |
|
290 TWlanConnectionMode& aConnectionMode, |
|
291 TWlanConnectionSecurityMode& aSecurityMode, |
|
292 TWlanConnectionExtentedSecurityMode& aExtSecurityMode, |
|
293 TBool& aProtectedSetupSupported ); |
|
294 |
|
295 |
|
296 /** |
|
297 * Cancel SearchWLANNetwork |
|
298 */ |
|
299 void CancelSearchWLANNetwork(); |
|
300 |
|
301 /** |
|
302 * Notifier. Shows a query, "Do you want to create a WLAN connection in |
|
303 * Off-line mode?" |
|
304 * @return ETrue if user select Yes, EFalse otherwise |
|
305 */ |
|
306 TBool OffLineWlanNote(); |
|
307 |
|
308 /** |
|
309 * Notifier. Shows a query, "Do you want to create a WLAN connection in |
|
310 * Off-line mode?" |
|
311 * Asynchronous. |
|
312 * @param aStatus Status object of notifier. |
|
313 */ |
|
314 void OffLineWlanNote( TRequestStatus& aStatus ); |
|
315 |
|
316 /** |
|
317 * Cancel OffLineWlan Note |
|
318 */ |
|
319 void CancelOffLineWlanNote(); |
|
320 |
|
321 /** |
|
322 * Notifier. Pops up an information note: |
|
323 * "Operation not possible in Off-line mode" |
|
324 */ |
|
325 void OffLineWlanDisabledNote(); |
|
326 |
|
327 /** |
|
328 * Notifier. Shows a data query, "Enter WEP key for WLAN" |
|
329 * @param aKey Key entered by user |
|
330 * @return ETrue if user select OK, EFalse otherwise |
|
331 */ |
|
332 TBool EasyWepDlg( TDes* aKey, TBool& aHex ); |
|
333 |
|
334 /** |
|
335 * Notifier. Shows a data query, "Enter WEP key for WLAN" |
|
336 * Async version |
|
337 * @param aKey Key entered by user |
|
338 * @param aStatus caller's TRequestStatus to handle asynchronous call. |
|
339 */ |
|
340 void EasyWepDlgAsync( TRequestStatus& aStatus, TDes* aKey, TBool& aHex ); |
|
341 |
|
342 /** |
|
343 * Cancel Easy Wep dialog |
|
344 */ |
|
345 void CancelEasyWepDlg(); |
|
346 |
|
347 /** |
|
348 * Notifier. Shows a data query, "Enter pre-shared key for WLAN" |
|
349 * @param aKey Key entered by user |
|
350 * @return ETrue if user select OK, EFalse otherwise |
|
351 */ |
|
352 TBool EasyWpaDlg( TDes* aKey ); |
|
353 |
|
354 /** |
|
355 * Notifier. Shows a data query, "Enter pre-shared key for WLAN" |
|
356 * @param aKey Key entered by user |
|
357 * @param aStatus caller's TRequestStatus to handle asynchronous call. |
|
358 */ |
|
359 void EasyWpaDlgAsync( TRequestStatus& aStatus, TDes* aKey ); |
|
360 |
|
361 /** |
|
362 * Cancel Easy Wpa dialog |
|
363 */ |
|
364 void CancelEasyWpaDlg(); |
|
365 |
|
366 /** |
|
367 * Pops up an information note: |
|
368 * "Selected WLAN network has no coverage" |
|
369 */ |
|
370 void WLANNetworkUnavailableNote(); |
|
371 |
|
372 /** |
|
373 * DEPRECATED, PLEASE USE ASYNC VERSION! |
|
374 * Confirmation note is used after the connection has been successfully |
|
375 * established via destination and connection method. |
|
376 * @param aDestId Id of used destination. |
|
377 * @param aConnMId Id of used connection method. |
|
378 */ |
|
379 void ConnectedViaDestAndConnMethodNote( const TUint32 aDestId, |
|
380 const TUint32 aConnMId ); |
|
381 |
|
382 /** |
|
383 * Confirmation note is used after the connection has been successfully |
|
384 * established via destination and connection method. |
|
385 * @param aDestId Id of used destination. |
|
386 * @param aConnMId Id of used connection method. |
|
387 * @param aStatus caller's TRequestStatus to handle asynchronous call. |
|
388 */ |
|
389 void ConnectedViaDestAndConnMethodNote( const TUint32 aDestId, |
|
390 const TUint32 aConnMId, |
|
391 TRequestStatus& aStatus ); |
|
392 |
|
393 /** |
|
394 * Cancel ConnectedViaDestAndConnMethodNote notifier. |
|
395 */ |
|
396 void CancelConnectedViaDestAndConnMethodNote(); |
|
397 |
|
398 |
|
399 /** |
|
400 * Information note is used when "Automatically" roaming is enabled. The |
|
401 * actual connection establishment take places in the background |
|
402 * (no wait note). |
|
403 * @param aConnMId Id of used connection method. |
|
404 */ |
|
405 void ChangingConnectionToNote( const TUint32 aConnMId ); |
|
406 |
|
407 /** |
|
408 * Information note is used when "Automatically" roaming is enabled. The |
|
409 * actual connection establishment take places in the background |
|
410 * (no wait note). |
|
411 * @param aConnMId Id of used connection method. |
|
412 * @param aStatus Status object of notifier. |
|
413 */ |
|
414 void ChangingConnectionToNote( const TUint32 aConnMId, |
|
415 TRequestStatus& aStatus ); |
|
416 |
|
417 /** |
|
418 * Cancel ChangingConnectionToNote notifier. |
|
419 */ |
|
420 void CancelChangingConnectionToNote(); |
|
421 |
|
422 /** |
|
423 * Notifier. Shows a query, "Connect to\n '%0U' via\n '%1U'?" |
|
424 * @param aResult Result of user selection, ETrue if user accepted |
|
425 * roaming, to more preferred method, EFlase otherwise |
|
426 * @param aHomeNetwork home or foreign network |
|
427 * @param aStatus Status object of notifier. |
|
428 */ |
|
429 void ConfirmMethodUsageQuery( TMsgQueryLinkedResults& aResult, |
|
430 const TBool aHomeNetwork, |
|
431 TRequestStatus& aStatus ); |
|
432 |
|
433 /** |
|
434 * Cancel ConfirmMethodUsageQuery |
|
435 */ |
|
436 void CancelConfirmMethodUsageQuery(); |
|
437 |
|
438 /** |
|
439 * DEPRECATED, PLEASE USE ASYNC VERSION! |
|
440 * Confirmation note is used after the connection has been successfully |
|
441 * established via a connection method. |
|
442 * @param aConnMId Id of used connection method. |
|
443 */ |
|
444 void ConnectedViaConnMethodNote( const TUint32 aConnMId ); |
|
445 |
|
446 /** |
|
447 * Confirmation note is used after the connection has been successfully |
|
448 * established via a connection method. |
|
449 * @param aConnMId Id of used connection method. |
|
450 * @param aStatus caller's TRequestStatus to handle asynchronous call. |
|
451 */ |
|
452 void ConnectedViaConnMethodNote( const TUint32 aConnMId, |
|
453 TRequestStatus& aStatus ); |
|
454 /** |
|
455 * Cancel ConnectedViaConnMethodNote notifier. |
|
456 */ |
|
457 void CancelConnectedViaConnMethodNote(); |
|
458 |
|
459 /** |
|
460 * This note is displayed when power-save feature of the WLAN station |
|
461 * is incompatible and thus battery consumption of the mobile will increase. |
|
462 * @param aDisable ETrue if user wants to disable this note in the future. |
|
463 * @param aStatus Status object of notifier. |
|
464 */ |
|
465 void WlanPowerSaveTestNote( TBool& aDisable, TRequestStatus& aStatus ); |
|
466 |
|
467 /** |
|
468 * Cancel WlanPowerSaveTestNote notifier. |
|
469 */ |
|
470 void CancelWlanPowerSaveTestNote(); |
|
471 |
|
472 /** |
|
473 * Notifier. Query for prompting WAPI-PSK. |
|
474 * Displays a query: "Enter pre-shared key for WLAN" |
|
475 * @param aKey Key entered by user |
|
476 * @return ETrue if user select OK, EFalse otherwise |
|
477 */ |
|
478 TBool EasyWapiDlg( TDes* aKey ); |
|
479 |
|
480 /** |
|
481 * Pops up an information note: |
|
482 * "No WLAN networks are available at the moment. Connection not available." |
|
483 */ |
|
484 void NoWLANNetworksAvailableNote(); |
|
485 |
|
486 /** |
|
487 * Discreet popup. Shows "Connecting via %U" discreet popup |
|
488 * @param aIapId IAP id of the access point. |
|
489 */ |
|
490 void ConnectingViaDiscreetPopup( const TUint32& aIapId, |
|
491 TBool aConnectionAlreadyActive ); |
|
492 |
|
493 |
|
494 /** |
|
495 * Discreet popup. Shows discreet popup about connection errors |
|
496 * @param aErrorCode Error code |
|
497 */ |
|
498 void ConnectionErrorDiscreetPopup( const TInt& aErrorCode ); |
|
499 |
|
500 private: // New methods |
|
501 |
|
502 /** |
|
503 * Gives back the name of connection uses aIAPId |
|
504 * @param aIAPId access point used for connection |
|
505 * @param aDb CCommsDatabase ofr seaching name of connection |
|
506 * @param aConnectionName asked connection name |
|
507 */ |
|
508 void GetConnectionNameL( const TUint32& aIAPId, |
|
509 CCommsDatabase& aDb, |
|
510 TDes& aConnectionName ); |
|
511 |
|
512 /** |
|
513 * Loads resource file of dll. It can be used if there is CCoeEnv. |
|
514 */ |
|
515 void LoadResourceFileL(); |
|
516 |
|
517 private: // Data |
|
518 |
|
519 TInt iResOffset; ///< offset of loaded resource file |
|
520 |
|
521 RConnectionUiUtilitiesSession iNotif; ///< notifier client |
|
522 |
|
523 TPckgBuf< TWepKeyData > iWepKey; |
|
524 |
|
525 TPckgBuf< TBuf< KEasyWpaQueryMaxLength > > iWpaKey; |
|
526 |
|
527 //return information from Notifier |
|
528 TPckgBuf<TConnUiUiWlanNetworkPrefs> iNetworkPrefs; |
|
529 |
|
530 TBool iIsWlanSupported; |
|
531 |
|
532 TBool iDummy; |
|
533 |
|
534 TWlanConnectionSecurityMode iDummySecMode; |
|
535 |
|
536 TWlanConnectionExtentedSecurityMode iDummyExtSecMode; |
|
537 |
|
538 // Use one wrapper for each note, to avoid to be overwritten, when |
|
539 // some instance is used to show more dialogs at the same time! |
|
540 CActiveWrapper* iActiveWrapper[KNumberOfWrappedDialogs]; |
|
541 |
|
542 // buffer for passing WAPI key between client and server |
|
543 TPckgBuf< TBuf< KEasyWapiQueryMaxLength > > iWapiKey; |
|
544 |
|
545 // buffer for passing connecting discreet popup info |
|
546 TPckgBuf< TConnUiConnectingViaDiscreetPopup > iConnInfo; |
|
547 |
|
548 }; |
|
549 |
|
550 |
|
551 #endif // CONNECTIONUIUTILITIESIMPL_H |
|
552 |
|
553 // End of File |
|
554 |