author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 13 Oct 2010 14:20:32 +0300 | |
branch | RCL_3 |
changeset 33 | 2989b291cac7 |
parent 28 | d38647835c2e |
permissions | -rw-r--r-- |
28 | 1 |
/* |
2 |
* Copyright (c) 2008-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: Actual notifier implementation |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
||
19 |
#include <eikenv.h> |
|
20 |
#include <bautils.h> |
|
21 |
#include <eikclbd.h> |
|
22 |
#include <eikimage.h> |
|
23 |
#include <cchuinotif.rsg> |
|
24 |
#include <StringLoader.h> |
|
25 |
#include <aknnotewrappers.h> |
|
26 |
#include <cenrepnotifyhandler.h> |
|
27 |
#include <ctsydomainpskeys.h> |
|
28 |
#include <crcseprofileregistry.h> |
|
29 |
#include <AknNotiferAppServerApplication.h> // Application Key enable/disable |
|
30 |
||
31 |
#include "cchuilogger.h" |
|
32 |
#include "cchuicommon.hrh" |
|
33 |
#include "cchuinotifierimpl.h" |
|
34 |
#include "cchuipluginbrandinghandler.h" |
|
35 |
#include "cchuinotifconnectionhandler.h" |
|
36 |
#include "cchuicallstatelistener.h" |
|
37 |
||
38 |
||
39 |
// ======== MEMBER FUNCTIONS ======== |
|
40 |
||
41 |
CCCHUiNotifierImpl::CCCHUiNotifierImpl() |
|
42 |
{ |
|
43 |
} |
|
44 |
||
45 |
CCCHUiNotifierImpl* CCCHUiNotifierImpl::NewL() |
|
46 |
{ |
|
47 |
CCCHUiNotifierImpl* self = new (ELeave) CCCHUiNotifierImpl(); |
|
48 |
CleanupStack::PushL( self ); |
|
49 |
self->ConstructL(); |
|
50 |
CleanupStack::Pop( self ); |
|
51 |
return self; |
|
52 |
} |
|
53 |
||
54 |
void CCCHUiNotifierImpl::ConstructL() |
|
55 |
{ |
|
56 |
CCCHUiNotifierBase::ConstructL(); |
|
57 |
iCallStateListener = CCchUiCallStateListener::NewL( *this ); |
|
58 |
} |
|
59 |
||
60 |
CCCHUiNotifierImpl::~CCCHUiNotifierImpl() |
|
61 |
{ |
|
62 |
CCHUIDEBUG( "CCCHUiNotifierImpl::~CCCHUiNotifierImpl - IN" ); |
|
63 |
||
64 |
if ( iAppKeyBlocked ) |
|
65 |
{ |
|
66 |
// Remove application key blocking |
|
67 |
(void) ((CAknNotifierAppServerAppUi*) |
|
68 |
iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse); |
|
69 |
iAppKeyBlocked = EFalse; |
|
70 |
} |
|
71 |
||
72 |
CCCHUiNotifierBase::Cancel(); |
|
73 |
iListQueryDialog = NULL; |
|
74 |
delete iBrandingHandler; |
|
75 |
delete iCallStateListener; |
|
76 |
||
77 |
CCHUIDEBUG( "CCCHUiNotifierImpl::~CCCHUiNotifierImpl - OUT" ); |
|
78 |
} |
|
79 |
||
80 |
// --------------------------------------------------------------------------- |
|
81 |
// RunL |
|
82 |
// From CActive. |
|
83 |
// --------------------------------------------------------------------------- |
|
84 |
// |
|
85 |
void CCCHUiNotifierImpl::RunL( ) |
|
86 |
{ |
|
87 |
CCHUIDEBUG( "CCCHUiNotifierImpl::RunL - IN" ); |
|
88 |
||
89 |
switch( iDialogMode ) |
|
90 |
{ |
|
91 |
// Only ECchUiDialogTypeNoConnectionAvailable is launched via RunL |
|
92 |
// currently. |
|
93 |
case MCchUiObserver::ECchUiDialogTypeNoConnectionAvailable: |
|
94 |
{ |
|
95 |
CCHUIDEBUG( "CCCHUiNotifierImpl::RunL - ECchUiDialogTypeNoConnectionAvailable" ); |
|
96 |
ShowNoConnectionsQueryL( iReplySlot, iMessage, iServiceId, EFalse ); |
|
97 |
} |
|
98 |
break; |
|
99 |
||
100 |
default: |
|
101 |
{ |
|
102 |
CCHUIDEBUG( "CCCHUiNotifierImpl::RunL - Does nothing" ); |
|
103 |
} |
|
104 |
break; |
|
105 |
} |
|
106 |
||
107 |
CCHUIDEBUG( " CCCHUiNotifierImpl::RunL - OUT" ); |
|
108 |
} |
|
109 |
||
110 |
||
111 |
// --------------------------------------------------------------------------- |
|
112 |
// From class MEikSrvNotifierBase2. |
|
113 |
// Cancelling method. |
|
114 |
// --------------------------------------------------------------------------- |
|
115 |
// |
|
116 |
void CCCHUiNotifierImpl::Cancel() |
|
117 |
{ |
|
118 |
CCHUIDEBUG( "CCCHUiNotifierImpl::Cancel - IN" ); |
|
119 |
if ( iListQueryDialog ) |
|
120 |
{ |
|
121 |
delete iListQueryDialog; |
|
122 |
iListQueryDialog = NULL; |
|
123 |
CCCHUiNotifierBase::Cancel(); |
|
124 |
} |
|
125 |
||
126 |
CCHUIDEBUG( "CCCHUiNotifierImpl::Cancel - OUT" ); |
|
127 |
} |
|
128 |
||
129 |
||
130 |
// --------------------------------------------------------------------------- |
|
131 |
// Shows username & password query. |
|
132 |
// --------------------------------------------------------------------------- |
|
133 |
// |
|
134 |
void CCCHUiNotifierImpl::ShowUsernamePasswordQueryL( |
|
135 |
TInt aReplySlot, |
|
136 |
const RMessagePtr2& aMessage, |
|
137 |
TUint aServiceId, |
|
138 |
const TDesC& aUserName ) |
|
139 |
{ |
|
140 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowUsernamePasswordQueryL - IN" ); |
|
141 |
||
142 |
iMessage = aMessage; |
|
143 |
iReplySlot = aReplySlot; |
|
144 |
||
145 |
HBufC* userName = HBufC::NewLC( KUserNameLength ); |
|
146 |
HBufC* passWord = HBufC::NewLC( KPasswordLength ); |
|
147 |
||
148 |
// Set current username |
|
149 |
userName->Des().Copy( aUserName ); |
|
150 |
||
151 |
TPtr ptrUserName( userName->Des() ); |
|
152 |
TPtr ptrPassWord( passWord->Des() ); |
|
153 |
||
154 |
CCHUIDEBUG( "ShowUsernamePasswordQueryL - create query"); |
|
155 |
||
156 |
CAknMultiLineDataQueryDialog* dlg = CAknMultiLineDataQueryDialog::NewL( |
|
157 |
ptrUserName, ptrPassWord ); |
|
158 |
||
159 |
// Block application key while showing query |
|
160 |
(void) ((CAknNotifierAppServerAppUi*) |
|
161 |
iEikEnv->EikAppUi())->SuppressAppSwitching(ETrue); |
|
162 |
iAppKeyBlocked = ETrue; |
|
163 |
||
164 |
if ( dlg->ExecuteLD( R_CCHUINOTIF_USERNAME_PWD_DIALOG ) ) |
|
165 |
{ |
|
166 |
iResultParams.iDialogMode = |
|
167 |
MCchUiObserver::ECchUiDialogTypeAuthenticationFailed; |
|
168 |
iResultParams.iServiceId = aServiceId; |
|
169 |
iResultParams.iUsername = *userName; |
|
170 |
iResultParams.iPwd = *passWord; |
|
171 |
iMessage.WriteL( iReplySlot, |
|
172 |
TPckgBuf<TCCHUiNotifierParams>( iResultParams ) ); |
|
173 |
CompleteMessage(KErrNone); |
|
174 |
} |
|
175 |
else |
|
176 |
{ |
|
177 |
CCHUIDEBUG( "ShowUsernamePasswordQueryL - cancelled" ); |
|
178 |
CompleteMessage( KErrCancel ); |
|
179 |
} |
|
180 |
||
181 |
// Remove application key blocking |
|
182 |
(void) ((CAknNotifierAppServerAppUi*) |
|
183 |
iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse); |
|
184 |
iAppKeyBlocked = EFalse; |
|
185 |
||
186 |
CleanupStack::PopAndDestroy( passWord ); |
|
187 |
CleanupStack::PopAndDestroy( userName ); |
|
188 |
||
189 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowUsernamePasswordQueryL - OUT" ); |
|
190 |
} |
|
191 |
||
192 |
// --------------------------------------------------------------------------- |
|
193 |
// Shows no connections query. |
|
194 |
// --------------------------------------------------------------------------- |
|
195 |
// |
|
196 |
void CCCHUiNotifierImpl::ShowNoConnectionsQueryL( |
|
197 |
TInt aReplySlot, |
|
198 |
const RMessagePtr2& aMessage, |
|
199 |
TUint aServiceId, |
|
200 |
TBool aNoConnectionsDefined ) |
|
201 |
{ |
|
202 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowNoConnectionsQueryL - IN" ); |
|
203 |
||
204 |
iServiceId = aServiceId; |
|
205 |
iMessage = aMessage; |
|
206 |
iReplySlot = aReplySlot; |
|
207 |
||
208 |
CDesCArray* arrayforDialog = new (ELeave) CDesCArrayFlat( 3 ); |
|
209 |
CleanupStack::PushL( arrayforDialog ); |
|
210 |
||
211 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - form content" ); |
|
212 |
||
213 |
RArray<TCchUiOperationCommand> commandArray; |
|
214 |
CleanupClosePushL( commandArray ); |
|
215 |
||
216 |
TInt result = KErrNotFound; |
|
217 |
MCchUiObserver::TCchUiDialogType currentType = |
|
218 |
MCchUiObserver::ECchUiDialogTypeNotSet; |
|
219 |
HBufC* string = NULL; |
|
220 |
if ( aNoConnectionsDefined ) |
|
221 |
{ |
|
222 |
string = StringLoader::LoadLC( |
|
223 |
R_QTN_CCHUINOTIF_NO_CONNECTIONS_DEFINED_HEADING ); |
|
224 |
FillNoConnectionsDefinedListboxL( *arrayforDialog, commandArray ); |
|
225 |
currentType = MCchUiObserver::ECchUiDialogTypeNoConnectionDefined; |
|
226 |
} |
|
227 |
else |
|
228 |
{ |
|
229 |
string = StringLoader::LoadLC( |
|
230 |
R_QTN_CCHUINOTIF_NO_CONNECTIONS_HEADING ); |
|
231 |
FillNoConnectionsAvailableListboxL( |
|
232 |
*arrayforDialog, commandArray, aServiceId ); |
|
233 |
currentType = MCchUiObserver::ECchUiDialogTypeNoConnectionAvailable; |
|
234 |
} |
|
235 |
||
236 |
iListQueryDialog = new (ELeave) CAknListQueryDialog( &result ); |
|
237 |
iListQueryDialog->PrepareLC( R_CCHUINOTIF_NO_CONNECTIONS_AVAILABLE ); |
|
238 |
||
239 |
iListQueryDialog->MessageBox()->SetMessageTextL( string ); |
|
240 |
||
241 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - form heading" ); |
|
242 |
||
243 |
// Set heading ie. service name |
|
244 |
HBufC* serviceName = HBufC::NewLC( KServiceNameLength ); |
|
245 |
TPtr serviceNamePtr( serviceName->Des() ); |
|
246 |
GetServiceNameL( aServiceId, serviceNamePtr ); |
|
247 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - set heading" ); |
|
248 |
iListQueryDialog->QueryHeading()->SetTextL( serviceNamePtr ); |
|
249 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - heading set ok" ); |
|
250 |
CleanupStack::PopAndDestroy(); // serviceName |
|
251 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - proceed to list items" ); |
|
252 |
||
253 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - set item array" ); |
|
254 |
iListQueryDialog->SetItemTextArray( arrayforDialog ); |
|
255 |
iListQueryDialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
256 |
||
257 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - retrieve branded icon" ); |
|
258 |
CFbsBitmap* myBitmap = NULL; |
|
259 |
CFbsBitmap* myMask = NULL; |
|
260 |
TRAPD( err, BrandingHandlerL().RetrieveServiceIconL( |
|
261 |
aServiceId, myBitmap, myMask ) ); |
|
262 |
CCHUIDEBUG2( "ShowNoConnectionsQueryL - brand err: %d", err ); |
|
263 |
||
264 |
if ( !err && iListQueryDialog->QueryHeading() ) |
|
265 |
{ |
|
266 |
CleanupStack::PushL( myBitmap ); |
|
267 |
CleanupStack::PushL( myMask ); |
|
268 |
CEikImage* image = new (ELeave) CEikImage(); |
|
269 |
image->SetPicture( myBitmap, myMask ); |
|
270 |
CleanupStack::Pop( myMask ); |
|
271 |
CleanupStack::Pop( myBitmap ); |
|
272 |
CleanupStack::PushL( image ); |
|
273 |
iListQueryDialog->QueryHeading()->SetHeaderImageL( image ); |
|
274 |
iListQueryDialog->QueryHeading()->ActivateL(); |
|
275 |
CleanupStack::PopAndDestroy( image ); |
|
276 |
} |
|
277 |
else if ( !err ) |
|
278 |
{ |
|
279 |
delete myMask; |
|
280 |
delete myBitmap; |
|
281 |
} |
|
282 |
else |
|
283 |
{ |
|
284 |
// Error occurred in RetrieveServiceIconL. Nothing to do. |
|
285 |
} |
|
286 |
||
287 |
// Block application key while showing query |
|
288 |
(void) ((CAknNotifierAppServerAppUi*) |
|
289 |
iEikEnv->EikAppUi())->SuppressAppSwitching(ETrue); |
|
290 |
iAppKeyBlocked = ETrue; |
|
291 |
||
292 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - run dialog" ); |
|
293 |
iListQueryDialog->RunLD(); |
|
294 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - run dialog done" ); |
|
295 |
||
296 |
// write result, result now holds the item number |
|
297 |
if ( KErrNotFound != result ) |
|
298 |
{ |
|
299 |
iResultParams.iDialogMode = currentType; |
|
300 |
iResultParams.iServiceId = aServiceId; |
|
301 |
iResultParams.iOperationCommand = commandArray[ result ]; |
|
302 |
TInt error = KErrNone; |
|
303 |
if ( ECchUiCommandCopyGprs == commandArray[ result ] ) |
|
304 |
{ |
|
305 |
error = ShowGprsSelectionL( aServiceId ); |
|
306 |
} |
|
307 |
if ( !error ) |
|
308 |
{ |
|
309 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - write and complete" ); |
|
310 |
iMessage.WriteL( iReplySlot, |
|
311 |
TPckgBuf<TCCHUiNotifierParams>( iResultParams ) ); |
|
312 |
CompleteMessage( KErrNone ); |
|
313 |
} |
|
314 |
else |
|
315 |
{ |
|
316 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - complete with cancel" ); |
|
317 |
CompleteMessage( error ); |
|
318 |
} |
|
319 |
} |
|
320 |
else |
|
321 |
{ |
|
322 |
CCHUIDEBUG( "ShowNoConnectionsQueryL - complete with cancel" ); |
|
323 |
CompleteMessage( KErrCancel ); |
|
324 |
} |
|
325 |
||
326 |
// Remove application key blocking |
|
327 |
(void) ((CAknNotifierAppServerAppUi*) |
|
328 |
iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse); |
|
329 |
iAppKeyBlocked = EFalse; |
|
330 |
||
331 |
CleanupStack::PopAndDestroy( string ); |
|
332 |
CleanupStack::PopAndDestroy( &commandArray ); |
|
333 |
CleanupStack::PopAndDestroy( arrayforDialog ); |
|
334 |
||
335 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowNoConnectionsQueryL - OUT" ); |
|
336 |
} |
|
337 |
||
338 |
// --------------------------------------------------------------------------- |
|
339 |
// Shows change connection query. |
|
340 |
// --------------------------------------------------------------------------- |
|
341 |
// |
|
342 |
void CCCHUiNotifierImpl::ShowChangeConnectionQueryL( |
|
343 |
TInt aReplySlot, |
|
344 |
const RMessagePtr2& aMessage, |
|
345 |
TUint aServiceId, |
|
346 |
TInt aIapId ) |
|
347 |
{ |
|
348 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowChangeConnectionQueryL - IN" ); |
|
349 |
||
350 |
iMessage = aMessage; |
|
351 |
iReplySlot = aReplySlot; |
|
352 |
||
353 |
CDesCArray* arrayforDialog = new (ELeave) CDesCArrayFlat( 3 ); |
|
354 |
CleanupStack::PushL( arrayforDialog ); |
|
355 |
||
356 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - form content" ); |
|
357 |
||
358 |
RArray<TCchUiOperationCommand> commandArray; |
|
359 |
CleanupClosePushL( commandArray ); |
|
360 |
||
361 |
TInt result = KErrNotFound; |
|
362 |
MCchUiObserver::TCchUiDialogType type = |
|
363 |
MCchUiObserver::ECchUiDialogTypeChangeConnection; |
|
364 |
HBufC* string = NULL; |
|
365 |
||
366 |
RBuf iapName; |
|
367 |
CleanupClosePushL( iapName ); |
|
368 |
||
369 |
// If we have current connection, show it in query heading |
|
370 |
if ( aIapId ) |
|
371 |
{ |
|
372 |
CurrentConnectionNameL( |
|
373 |
aServiceId, |
|
374 |
aIapId, |
|
375 |
iapName ); |
|
376 |
||
377 |
string = StringLoader::LoadLC( |
|
378 |
R_QTN_CCHUINOTIF_CHANGE_CURRENT_CONNECTION_HEADING, iapName ); |
|
379 |
||
380 |
FillChangeCurrentConnectionListboxL( *arrayforDialog, commandArray ); |
|
381 |
} |
|
382 |
else // otherwise show in heading that we have no current connection |
|
383 |
{ |
|
384 |
string = StringLoader::LoadLC( |
|
385 |
R_QTN_CCHUINOTIF_CHANGE_CONNECTION_HEADING ); |
|
386 |
||
387 |
FillChangeConnectionListboxL( *arrayforDialog, commandArray ); |
|
388 |
} |
|
389 |
||
390 |
iListQueryDialog = new (ELeave) CAknListQueryDialog( &result ); |
|
391 |
iListQueryDialog->PrepareLC( R_CCHUINOTIF_CHANGE_CONNECTION_QUERY ); |
|
392 |
||
393 |
iListQueryDialog->MessageBox()->SetMessageTextL( string ); |
|
394 |
||
395 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - form heading" ); |
|
396 |
// Set heading ie. service name |
|
397 |
HBufC* serviceName = HBufC::NewLC( KServiceNameLength ); |
|
398 |
TPtr serviceNamePtr( serviceName->Des() ); |
|
399 |
GetServiceNameL( aServiceId, serviceNamePtr ); |
|
400 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - set heading" ); |
|
401 |
iListQueryDialog->QueryHeading()->SetTextL( serviceNamePtr ); |
|
402 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - heading set ok" ); |
|
403 |
CleanupStack::PopAndDestroy(); // serviceName |
|
404 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - proceed to list items" ); |
|
405 |
||
406 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - set item array" ); |
|
407 |
iListQueryDialog->SetItemTextArray( arrayforDialog ); |
|
408 |
iListQueryDialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
409 |
||
410 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - retrieve branded icon" ); |
|
411 |
||
412 |
CFbsBitmap* myBitmap = NULL; |
|
413 |
CFbsBitmap* myMask = NULL; |
|
414 |
TRAPD( err, BrandingHandlerL().RetrieveServiceIconL( |
|
415 |
aServiceId, myBitmap, myMask ) ); |
|
416 |
||
417 |
CCHUIDEBUG2( "ShowChangeConnectionQueryL - brand err: %d", err ); |
|
418 |
||
419 |
if ( !err && iListQueryDialog->QueryHeading() ) |
|
420 |
{ |
|
421 |
CleanupStack::PushL( myBitmap ); |
|
422 |
CleanupStack::PushL( myMask ); |
|
423 |
CEikImage* image = new (ELeave) CEikImage(); |
|
424 |
image->SetPicture( myBitmap, myMask ); |
|
425 |
CleanupStack::Pop( myMask ); |
|
426 |
CleanupStack::Pop( myBitmap ); |
|
427 |
CleanupStack::PushL( image ); |
|
428 |
iListQueryDialog->QueryHeading()->SetHeaderImageL( image ); |
|
429 |
iListQueryDialog->QueryHeading()->ActivateL(); |
|
430 |
CleanupStack::PopAndDestroy( image ); |
|
431 |
} |
|
432 |
else if ( !err ) |
|
433 |
{ |
|
434 |
delete myMask; |
|
435 |
delete myBitmap; |
|
436 |
} |
|
437 |
else |
|
438 |
{ |
|
439 |
// Error occurred in RetrieveServiceIconL. Nothing to do. |
|
440 |
} |
|
441 |
||
442 |
// Block application key while showing query |
|
443 |
(void) ((CAknNotifierAppServerAppUi*) |
|
444 |
iEikEnv->EikAppUi())->SuppressAppSwitching(ETrue); |
|
445 |
iAppKeyBlocked = ETrue; |
|
446 |
||
447 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - run dialog" ); |
|
448 |
||
449 |
// List query dialog is deleted via RunLD except if there is |
|
450 |
// incoming call at the same time the dialog is shown on screen. |
|
451 |
// In case of incoming call CallStateChanged() method handles |
|
452 |
// the deletion |
|
453 |
iListQueryDialog->RunLD(); |
|
454 |
// coverity[check_after_deref] |
|
455 |
if( iListQueryDialog ) |
|
456 |
{ |
|
457 |
// write result, result now holds the item number |
|
458 |
if ( KErrNotFound != result ) |
|
459 |
{ |
|
460 |
iResultParams.iDialogMode = type; |
|
461 |
iResultParams.iServiceId = aServiceId; |
|
462 |
iResultParams.iOperationCommand = commandArray[ result ]; |
|
463 |
TInt error = KErrNone; |
|
464 |
if ( ECchUiCommandCopyGprs == commandArray[ result ] ) |
|
465 |
{ |
|
466 |
error = ShowGprsSelectionL( aServiceId ); |
|
467 |
} |
|
468 |
if ( !error ) |
|
469 |
{ |
|
470 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - write and complete" ); |
|
471 |
iMessage.WriteL( iReplySlot, |
|
472 |
TPckgBuf<TCCHUiNotifierParams>( iResultParams ) ); |
|
473 |
CompleteMessage( KErrNone ); |
|
474 |
} |
|
475 |
else |
|
476 |
{ |
|
477 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - complete with cancel" ); |
|
478 |
CompleteMessage( error ); |
|
479 |
} |
|
480 |
} |
|
481 |
else |
|
482 |
{ |
|
483 |
CCHUIDEBUG( "ShowChangeConnectionQueryL - complete with cancel" ); |
|
484 |
CompleteMessage( KErrCancel ); |
|
485 |
} |
|
486 |
||
487 |
iListQueryDialog = NULL; |
|
488 |
} |
|
489 |
||
490 |
// Remove application key blocking |
|
491 |
(void) ((CAknNotifierAppServerAppUi*) |
|
492 |
iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse); |
|
493 |
iAppKeyBlocked = EFalse; |
|
494 |
||
495 |
CleanupStack::PopAndDestroy( string ); |
|
496 |
CleanupStack::PopAndDestroy( &iapName ); |
|
497 |
CleanupStack::PopAndDestroy( &commandArray ); |
|
498 |
CleanupStack::PopAndDestroy( arrayforDialog ); |
|
499 |
||
500 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowChangeConnectionQueryL - OUT" ); |
|
501 |
} |
|
502 |
||
503 |
// --------------------------------------------------------------------------- |
|
504 |
// Shows defective settings error note. |
|
505 |
// --------------------------------------------------------------------------- |
|
506 |
// |
|
507 |
void CCCHUiNotifierImpl::ShowDefectiveSettingsL( |
|
508 |
TInt aReplySlot, |
|
509 |
const RMessagePtr2& aMessage, |
|
510 |
TUint aServiceId ) |
|
511 |
{ |
|
512 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowDefectiveSettingsL - IN" ); |
|
513 |
||
514 |
iMessage = aMessage; |
|
515 |
iReplySlot = aReplySlot; |
|
516 |
||
517 |
// Get service name |
|
518 |
HBufC* serviceName = HBufC::NewLC( KServiceNameLength ); |
|
519 |
TPtr serviceNamePtr( serviceName->Des() ); |
|
520 |
GetServiceNameL( aServiceId, serviceNamePtr ); |
|
521 |
||
522 |
// Show info note about defective settings |
|
523 |
HBufC* defectiveText = StringLoader::LoadLC( |
|
524 |
R_QTN_SERVTAB_CONN_ESTABLSH_FAILED_PERMANENTLY_NOTE_TEXT, serviceNamePtr ); |
|
525 |
CAknInformationNote* note = |
|
526 |
new( ELeave ) CAknInformationNote( ETrue ); |
|
527 |
note->SetTimeout(CAknNoteDialog::ELongTimeout); |
|
528 |
note->ExecuteLD( *defectiveText ); |
|
529 |
CleanupStack::PopAndDestroy( defectiveText ); |
|
530 |
CleanupStack::PopAndDestroy( serviceName ); |
|
531 |
||
532 |
iResultParams.iDialogMode = |
|
533 |
MCchUiObserver::ECchUiDialogTypeDefectiveSettings; |
|
534 |
iResultParams.iServiceId = aServiceId; |
|
535 |
iMessage.WriteL( iReplySlot, |
|
536 |
TPckgBuf<TCCHUiNotifierParams>( iResultParams ) ); |
|
537 |
CompleteMessage(KErrNone); |
|
538 |
||
539 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowDefectiveSettingsL - OUT" ); |
|
540 |
} |
|
541 |
||
542 |
// --------------------------------------------------------------------------- |
|
543 |
// Shows error in connection error note. |
|
544 |
// --------------------------------------------------------------------------- |
|
545 |
// |
|
546 |
void CCCHUiNotifierImpl::ShowErrorInConnectionNoteL( |
|
547 |
TInt aReplySlot, |
|
548 |
const RMessagePtr2& aMessage, |
|
549 |
TUint aServiceId ) |
|
550 |
{ |
|
551 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowErrorInConnectionL - IN" ); |
|
552 |
||
553 |
iMessage = aMessage; |
|
554 |
iReplySlot = aReplySlot; |
|
555 |
||
556 |
// Show info note about error in connection |
|
557 |
//(access point not suitable for internet calls) |
|
558 |
HBufC* noteText = StringLoader::LoadLC( |
|
559 |
R_QTN_VOIP_ERROR_IN_CONNECTION_NOTE_TEXT ); |
|
560 |
CAknInformationNote* note = |
|
561 |
new( ELeave ) CAknInformationNote( ETrue ); |
|
562 |
note->SetTimeout(CAknNoteDialog::ELongTimeout); |
|
563 |
note->ExecuteLD( *noteText ); |
|
564 |
CleanupStack::PopAndDestroy( noteText ); |
|
565 |
||
566 |
iResultParams.iDialogMode = |
|
567 |
MCchUiObserver::ECchUiDialogTypeErrorInConnection; |
|
568 |
iResultParams.iServiceId = aServiceId; |
|
569 |
iMessage.WriteL( iReplySlot, |
|
570 |
TPckgBuf<TCCHUiNotifierParams>( iResultParams ) ); |
|
571 |
CompleteMessage(KErrNone); |
|
572 |
||
573 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowErrorInConnectionL - OUT" ); |
|
574 |
} |
|
575 |
||
576 |
// --------------------------------------------------------------------------- |
|
577 |
// Shows invalid username/password note. |
|
578 |
// --------------------------------------------------------------------------- |
|
579 |
// |
|
580 |
void CCCHUiNotifierImpl::ShowInvalidUsernamePasswordNoteL( |
|
581 |
TInt aReplySlot, |
|
582 |
const RMessagePtr2& aMessage, |
|
583 |
TUint aServiceId ) |
|
584 |
{ |
|
585 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowInvalidUsernamePasswordNoteL - IN" ); |
|
586 |
||
587 |
iMessage = aMessage; |
|
588 |
iReplySlot = aReplySlot; |
|
589 |
||
590 |
// Show info note about invalid username password |
|
591 |
HBufC* textForNote = StringLoader::LoadLC( |
|
592 |
R_QTN_VOIP_WRONG_SIP_AUTH_NOTE_TEXT ); |
|
593 |
CAknInformationNote* note = |
|
594 |
new( ELeave ) CAknInformationNote( ETrue ); |
|
595 |
note->SetTimeout(CAknNoteDialog::ELongTimeout); |
|
596 |
note->ExecuteLD( *textForNote ); |
|
597 |
CleanupStack::PopAndDestroy( textForNote ); |
|
598 |
||
599 |
iResultParams.iDialogMode = |
|
600 |
MCchUiObserver::ECchUiDialogTypeUsernamePasswordFailed; |
|
601 |
iResultParams.iServiceId = aServiceId; |
|
602 |
iMessage.WriteL( iReplySlot, |
|
603 |
TPckgBuf<TCCHUiNotifierParams>( iResultParams ) ); |
|
604 |
CompleteMessage(KErrNone); |
|
605 |
||
606 |
CCHUIDEBUG( |
|
607 |
"CCCHUiNotifierImpl::ShowInvalidUsernamePasswordNoteL - OUT" ); |
|
608 |
} |
|
609 |
||
610 |
// --------------------------------------------------------------------------- |
|
611 |
// Shows confirmation note to change connection. |
|
612 |
// --------------------------------------------------------------------------- |
|
613 |
// |
|
614 |
void CCCHUiNotifierImpl::ShowConfirmChangeConnectionL( |
|
615 |
TInt aReplySlot, |
|
616 |
const RMessagePtr2& aMessage, |
|
617 |
TUint aServiceId, |
|
618 |
TInt aIapId ) |
|
619 |
{ |
|
620 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowConfirmChangeConnectionL - IN" ); |
|
621 |
||
622 |
CCHUIDEBUG2( |
|
623 |
"ShowConfirmChangeConnectionL - aServiceId: %d", aServiceId ); |
|
624 |
CCHUIDEBUG2( |
|
625 |
"ShowConfirmChangeConnectionL - aIapId: %d", aIapId ); |
|
626 |
||
627 |
iMessage = aMessage; |
|
628 |
iReplySlot = aReplySlot; |
|
629 |
||
630 |
// Show confirmation note to change connection |
|
631 |
RBuf iapName; |
|
632 |
CleanupClosePushL( iapName ); |
|
633 |
||
634 |
CurrentConnectionNameL( |
|
635 |
aServiceId, |
|
636 |
aIapId, |
|
637 |
iapName ); |
|
638 |
||
639 |
HBufC* textForQuery = NULL; |
|
640 |
CAknQueryDialog* query = |
|
641 |
new( ELeave ) CAknQueryDialog( CAknQueryDialog::ENoTone ); |
|
642 |
||
643 |
CleanupStack::PushL( query ); |
|
644 |
||
645 |
TBool askToRemoveOldConnection( EFalse ); |
|
646 |
||
647 |
// Check if current connection is used by any other service |
|
648 |
if ( aIapId && !ConnectionUsedByOthersL( aServiceId, aIapId ) ) |
|
649 |
{ |
|
650 |
// connection not used by others -> ask to remove old connection |
|
651 |
askToRemoveOldConnection = ETrue; |
|
652 |
} |
|
653 |
||
654 |
if ( askToRemoveOldConnection ) |
|
655 |
{ |
|
656 |
CCHUIDEBUG( |
|
657 |
"ShowConfirmChangeConnectionL - ask to remove connection" ); |
|
658 |
||
659 |
query->PrepareLC( |
|
660 |
R_CCHUINOTIF_REMOVE_AND_CHANGE_CONNECTION_CONFIRMATION_QUERY ); |
|
661 |
||
662 |
textForQuery = StringLoader::LoadLC( |
|
663 |
R_QTN_SERVTAB_AP_VOIP_NOT_SUPPORTED_RECONNECT_QUERY_TEXT, |
|
664 |
iapName ); |
|
665 |
} |
|
666 |
else |
|
667 |
{ |
|
668 |
CCHUIDEBUG( |
|
669 |
"ShowConfirmChangeConnectionL - ask to change connection" ); |
|
670 |
||
671 |
query->PrepareLC( R_CCHUINOTIF_CHANGE_CONNECTION_CONFIRMATION_QUERY ); |
|
672 |
||
673 |
textForQuery = StringLoader::LoadLC( |
|
674 |
R_QTN_SERVTAB_AP_VOIP_NOT_SUPPORTED_QUERY_TEXT, iapName ); |
|
675 |
} |
|
676 |
||
677 |
CCHUIDEBUG( "ShowConfirmChangeConnectionL - set prompt" ); |
|
678 |
||
679 |
query->SetPromptL( *textForQuery ); |
|
680 |
CleanupStack::PopAndDestroy( textForQuery ); |
|
681 |
CleanupStack::Pop( query ); |
|
682 |
||
683 |
// Block application key while showing query |
|
684 |
(void) ((CAknNotifierAppServerAppUi*) |
|
685 |
iEikEnv->EikAppUi())->SuppressAppSwitching(ETrue); |
|
686 |
iAppKeyBlocked = ETrue; |
|
687 |
||
688 |
// Run query |
|
689 |
if( query->RunLD() ) |
|
690 |
{ |
|
691 |
iResultParams.iDialogMode = |
|
692 |
MCchUiObserver::ECchUiDialogTypeConfirmChangeConnection; |
|
693 |
iResultParams.iServiceId = aServiceId; |
|
694 |
||
695 |
if ( askToRemoveOldConnection ) |
|
696 |
{ |
|
697 |
CCHUIDEBUG( |
|
698 |
"ShowConfirmChangeConnectionL - set remove old connection"); |
|
699 |
||
700 |
iResultParams.iRemoveOldConnection = ETrue; |
|
701 |
iResultParams.iCurrentConnectionIapId = aIapId; |
|
702 |
} |
|
703 |
else |
|
704 |
{ |
|
705 |
iResultParams.iRemoveOldConnection = EFalse; |
|
706 |
} |
|
707 |
||
708 |
iMessage.WriteL( iReplySlot, |
|
709 |
TPckgBuf<TCCHUiNotifierParams>( iResultParams ) ); |
|
710 |
||
711 |
CCHUIDEBUG( "ShowConfirmChangeConnectionL - complete message" ); |
|
712 |
||
713 |
CompleteMessage( KErrNone ); |
|
714 |
} |
|
715 |
else |
|
716 |
{ |
|
717 |
CCHUIDEBUG( "ShowConfirmChangeConnectionL - canceled" ); |
|
718 |
||
719 |
CompleteMessage( KErrCancel ); |
|
720 |
} |
|
721 |
||
722 |
// Remove application key blocking |
|
723 |
(void) ((CAknNotifierAppServerAppUi*) |
|
724 |
iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse); |
|
725 |
iAppKeyBlocked = EFalse; |
|
726 |
||
727 |
CleanupStack::PopAndDestroy( &iapName ); |
|
728 |
||
729 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowConfirmChangeConnectionL - OUT" ); |
|
730 |
} |
|
731 |
||
732 |
// --------------------------------------------------------------------------- |
|
733 |
// Shows gprs iap selection. |
|
734 |
// --------------------------------------------------------------------------- |
|
735 |
// |
|
736 |
TInt CCCHUiNotifierImpl::ShowGprsSelectionL( TUint aServiceId ) |
|
737 |
{ |
|
738 |
CCHUIDEBUG( "CCCHUiNotifierImpl::ShowGprsSelectionL - IN" ); |
|
739 |
||
740 |
TInt error = KErrNone; |
|
741 |
RArray<TUint32> iapIds; |
|
742 |
CleanupClosePushL( iapIds ); |
|
743 |
||
744 |
CDesCArray* arrayforDialog = new (ELeave) CDesCArrayFlat( 3 ); |
|
745 |
CleanupStack::PushL( arrayforDialog ); |
|
746 |
CCHUIDEBUG( "ShowGprsSelectionL - form content" ); |
|
747 |
||
748 |
TInt result = KErrNotFound; |
|
749 |
HBufC* string = StringLoader::LoadLC( |
|
750 |
R_QTN_CCHUINOTIF_SELECT_GPRS_ACCESS_POINT_HEADING ); |
|
751 |
||
752 |
CAknListQueryDialog* dialog = new (ELeave) CAknListQueryDialog( &result ); |
|
753 |
dialog->PrepareLC( R_CCHUINOTIF_SELECT_GPRS_DIALOG ); |
|
754 |
||
755 |
CCHUIDEBUG( "ShowGprsSelectionL - form heading" ); |
|
756 |
dialog->QueryHeading()->SetTextL( *string ); |
|
757 |
||
758 |
CCHUIDEBUG( "ShowGprsSelectionL - set item array" ); |
|
759 |
||
760 |
TUint sourceSnap = KErrNone; |
|
761 |
// Fill array here |
|
762 |
sourceSnap = InternetGprsApsMissingFromServiceSnapL( |
|
763 |
*arrayforDialog, iapIds ); |
|
764 |
||
765 |
CCHUIDEBUG( "ShowGprsSelectionL - set item array" ); |
|
766 |
dialog->SetItemTextArray( arrayforDialog ); |
|
767 |
dialog->SetOwnershipType( ELbmDoesNotOwnItemArray ); |
|
768 |
||
769 |
// Block application key while showing query |
|
770 |
(void) ((CAknNotifierAppServerAppUi*) |
|
771 |
iEikEnv->EikAppUi())->SuppressAppSwitching(ETrue); |
|
772 |
iAppKeyBlocked = ETrue; |
|
773 |
||
774 |
CCHUIDEBUG( "ShowGprsSelectionL - run dialog" ); |
|
775 |
||
776 |
dialog->RunLD(); |
|
777 |
||
778 |
// write result, result now holds the item number |
|
779 |
if ( KErrNotFound != result ) |
|
780 |
{ |
|
781 |
iResultParams.iServiceId = aServiceId; |
|
782 |
iResultParams.iGprsSourceSnap = sourceSnap; |
|
783 |
iResultParams.iGprsIapId = iapIds[ result ]; |
|
784 |
} |
|
785 |
else |
|
786 |
{ |
|
787 |
error = KErrCancel; |
|
788 |
} |
|
789 |
||
790 |
// Remove application key blocking |
|
791 |
(void) ((CAknNotifierAppServerAppUi*) |
|
792 |
iEikEnv->EikAppUi())->SuppressAppSwitching(EFalse); |
|
793 |
iAppKeyBlocked = EFalse; |
|
794 |
||
795 |
CleanupStack::PopAndDestroy( string ); |
|
796 |
CleanupStack::PopAndDestroy( arrayforDialog ); |
|
797 |
CleanupStack::PopAndDestroy( &iapIds ); |
|
798 |
||
799 |
CCHUIDEBUG2( "CCCHUiNotifierImpl::ShowGprsSelectionL -return %d", error ); |
|
800 |
return error; |
|
801 |
} |
|
802 |
||
803 |
// --------------------------------------------------------------------------- |
|
804 |
// Returns handle to branding handler. |
|
805 |
// --------------------------------------------------------------------------- |
|
806 |
// |
|
807 |
CCchUiPluginBrandingHandler& CCCHUiNotifierImpl::BrandingHandlerL() |
|
808 |
{ |
|
809 |
if ( !iBrandingHandler ) |
|
810 |
{ |
|
811 |
iBrandingHandler = |
|
812 |
CCchUiPluginBrandingHandler::NewL( *iSettings ); |
|
813 |
} |
|
814 |
return *iBrandingHandler; |
|
815 |
} |
|
816 |
||
817 |
// --------------------------------------------------------------------------- |
|
818 |
// Fills list items and commands for no connections available dialog |
|
819 |
// --------------------------------------------------------------------------- |
|
820 |
// |
|
821 |
void CCCHUiNotifierImpl::FillNoConnectionsAvailableListboxL( |
|
822 |
CDesCArray& aListItems, |
|
823 |
RArray<TCchUiOperationCommand>& aCommandArray, |
|
824 |
TUint aServiceId ) |
|
825 |
{ |
|
826 |
CCHUIDEBUG( |
|
827 |
"CCCHUiNotifierImpl::FillNoConnectionsAvailableListboxL - IN" ); |
|
828 |
||
829 |
HBufC* connectWhenAv = StringLoader::LoadLC( |
|
830 |
R_QTN_CCHUINOTIF_CONNECT_WHEN_AV_TEXT ); |
|
831 |
HBufC* searchWlan = StringLoader::LoadLC( |
|
832 |
R_QTN_CCHUINOTIF_SEARCH_WLAN_NO_COVERAGE_TEXT ); |
|
833 |
HBufC* useGprs = StringLoader::LoadLC( |
|
834 |
R_QTN_CCHUINOTIF_USE_GPRS_NO_COVERAGE_TEXT ); |
|
835 |
||
836 |
// Item is available only for SIP protocol services. |
|
837 |
// Check if service supports SIP/VoIP. |
|
838 |
TBool sipVoip( EFalse ); |
|
839 |
TRAPD( err, sipVoip = IsSIPVoIPL( aServiceId ) ); |
|
840 |
||
841 |
if ( !err && sipVoip && IsVoIPOverWCDMAAllowedL() ) |
|
842 |
{ |
|
843 |
aListItems.AppendL( *connectWhenAv ); |
|
844 |
aCommandArray.AppendL( ECchUiCommandConnectWhenAvailable ); |
|
845 |
} |
|
846 |
||
847 |
aListItems.AppendL( *searchWlan ); |
|
848 |
aCommandArray.AppendL( ECchUiCommandSearchWlan ); |
|
849 |
||
850 |
if ( !IsPhoneOfflineL() && IsGprsIapsAvailableL() |
|
851 |
&& IsVoIPOverWCDMAAllowedL() ) |
|
852 |
{ |
|
853 |
aListItems.AppendL( *useGprs ); |
|
854 |
aCommandArray.AppendL( ECchUiCommandCopyGprs ); |
|
855 |
} |
|
856 |
||
857 |
CleanupStack::PopAndDestroy( useGprs ); |
|
858 |
CleanupStack::PopAndDestroy( searchWlan ); |
|
859 |
CleanupStack::PopAndDestroy( connectWhenAv ); |
|
860 |
||
861 |
CCHUIDEBUG( |
|
862 |
"CCCHUiNotifierImpl::FillNoConnectionsAvailableListboxL - OUT" ); |
|
863 |
} |
|
864 |
||
865 |
// --------------------------------------------------------------------------- |
|
866 |
// Fills list items and commands for no connections defined dialog. |
|
867 |
// --------------------------------------------------------------------------- |
|
868 |
// |
|
869 |
void CCCHUiNotifierImpl::FillNoConnectionsDefinedListboxL( |
|
870 |
CDesCArray& aListItems, RArray<TCchUiOperationCommand>& aCommandArray ) |
|
871 |
{ |
|
872 |
CCHUIDEBUG( |
|
873 |
"CCCHUiNotifierImpl::FillNoConnectionsDefinedListboxL - IN" ); |
|
874 |
||
875 |
CleanupClosePushL( aCommandArray ); |
|
876 |
||
877 |
HBufC* searchWlan = StringLoader::LoadLC( |
|
878 |
R_QTN_CCHUINOTIF_SEARCH_WLAN_NOT_DEF_TEXT ); |
|
879 |
||
880 |
HBufC* useGprs = StringLoader::LoadLC( |
|
881 |
R_QTN_CCHUINOTIF_USE_GPRS_NOT_DEF_TEXT ); |
|
882 |
||
883 |
aListItems.AppendL( *searchWlan ); |
|
884 |
aCommandArray.AppendL( ECchUiCommandSearchWlan ); |
|
885 |
||
886 |
if ( !IsPhoneOfflineL() && IsGprsIapsAvailableL() |
|
887 |
&& IsVoIPOverWCDMAAllowedL() ) |
|
888 |
{ |
|
889 |
aListItems.AppendL( *useGprs ); |
|
890 |
aCommandArray.AppendL( ECchUiCommandCopyGprs ); |
|
891 |
} |
|
892 |
||
893 |
CleanupStack::PopAndDestroy( useGprs ); |
|
894 |
CleanupStack::PopAndDestroy( searchWlan ); |
|
895 |
CleanupStack::Pop( &aCommandArray ); |
|
896 |
||
897 |
CCHUIDEBUG( |
|
898 |
"CCCHUiNotifierImpl::FillNoConnectionsDefinedListboxL - OUT" ); |
|
899 |
} |
|
900 |
||
901 |
// --------------------------------------------------------------------------- |
|
902 |
// Fills list items and commands for no connections defined dialog |
|
903 |
// --------------------------------------------------------------------------- |
|
904 |
// |
|
905 |
void CCCHUiNotifierImpl::FillNoConnectionsFoundListboxL( |
|
906 |
CDesCArray& aListItems, RArray<TCchUiOperationCommand>& aCommandArray ) |
|
907 |
{ |
|
908 |
CCHUIDEBUG( "CCCHUiNotifierImpl::FillNoConnectionsFoundListboxL - IN" ); |
|
909 |
||
910 |
CleanupClosePushL( aCommandArray ); |
|
911 |
||
912 |
HBufC* searchWlan = StringLoader::LoadLC( |
|
913 |
R_QTN_CCHUINOTIF_SEARCH_WLAN_NOT_FOUND_TEXT ); |
|
914 |
||
915 |
HBufC* useGprs = StringLoader::LoadLC( |
|
916 |
R_QTN_CCHUINOTIF_USE_GPRS_NOT_FOUND_TEXT ); |
|
917 |
||
918 |
aListItems.AppendL( *searchWlan ); |
|
919 |
aCommandArray.AppendL( ECchUiCommandSearchWlan ); |
|
920 |
||
921 |
if ( !IsPhoneOfflineL() && IsGprsIapsAvailableL() |
|
922 |
&& IsVoIPOverWCDMAAllowedL() ) |
|
923 |
{ |
|
924 |
aListItems.AppendL( *useGprs ); |
|
925 |
aCommandArray.AppendL( ECchUiCommandCopyGprs ); |
|
926 |
} |
|
927 |
||
928 |
CleanupStack::PopAndDestroy( useGprs ); |
|
929 |
CleanupStack::PopAndDestroy( searchWlan ); |
|
930 |
CleanupStack::Pop( &aCommandArray ); |
|
931 |
||
932 |
CCHUIDEBUG( "CCCHUiNotifierImpl::FillNoConnectionsFoundListboxL - OUT" ); |
|
933 |
} |
|
934 |
||
935 |
// --------------------------------------------------------------------------- |
|
936 |
// Fills list items and commands for change current connection dialog |
|
937 |
// --------------------------------------------------------------------------- |
|
938 |
// |
|
939 |
void CCCHUiNotifierImpl::FillChangeCurrentConnectionListboxL( |
|
940 |
CDesCArray& aListItems, RArray<TCchUiOperationCommand>& aCommandArray ) |
|
941 |
{ |
|
942 |
CCHUIDEBUG( |
|
943 |
"CCCHUiNotifierImpl::FillChangeCurrentConnectionListboxL - IN" ); |
|
944 |
||
945 |
HBufC* searchWlan = StringLoader::LoadLC( |
|
946 |
R_QTN_CCHUINOTIF_SEARCH_WLAN_CHANGE_CURRENT_CONNECTION_TEXT ); |
|
947 |
||
948 |
HBufC* useGprs = StringLoader::LoadLC( |
|
949 |
R_QTN_CCHUINOTIF_USE_GPRS_CHANGE_CURRENT_CONNECTION_TEXT ); |
|
950 |
||
951 |
aListItems.AppendL( *searchWlan ); |
|
952 |
aCommandArray.AppendL( ECchUiCommandSearchWlan ); |
|
953 |
||
954 |
if ( !IsPhoneOfflineL() && IsGprsIapsAvailableL() && |
|
955 |
IsVoIPOverWCDMAAllowedL() && |
|
956 |
IsServiceSnapMissingInternetGprsApsL() ) |
|
957 |
{ |
|
958 |
aListItems.AppendL( *useGprs ); |
|
959 |
aCommandArray.AppendL( ECchUiCommandCopyGprs ); |
|
960 |
} |
|
961 |
||
962 |
CleanupStack::PopAndDestroy( useGprs ); |
|
963 |
CleanupStack::PopAndDestroy( searchWlan ); |
|
964 |
||
965 |
CCHUIDEBUG( |
|
966 |
"CCCHUiNotifierImpl::FillChangeCurrentConnectionListboxL - OUT" ); |
|
967 |
} |
|
968 |
||
969 |
// --------------------------------------------------------------------------- |
|
970 |
// CCCHUiNotifierImpl::IsServiceSnapMissingInternetGprsApsL |
|
971 |
// --------------------------------------------------------------------------- |
|
972 |
// |
|
973 |
TBool CCCHUiNotifierImpl::IsServiceSnapMissingInternetGprsApsL() const |
|
974 |
{ |
|
975 |
CCHUIDEBUG( |
|
976 |
"CCCHUiNotifierImpl::IsServiceSnapMissingInternetGprsApsL - IN" ); |
|
977 |
||
978 |
TBool isMissingGPRSIap = EFalse; |
|
979 |
||
980 |
RArray<TUint32> iapIds; |
|
981 |
CleanupClosePushL( iapIds ); |
|
982 |
||
983 |
CDesCArray* iaps = new (ELeave) CDesCArrayFlat( 1 ); |
|
984 |
CleanupStack::PushL( iaps ); |
|
985 |
||
986 |
InternetGprsApsMissingFromServiceSnapL( *iaps, iapIds ); |
|
987 |
||
988 |
if ( iapIds.Count() ) |
|
989 |
{ |
|
990 |
isMissingGPRSIap = ETrue; |
|
991 |
} |
|
992 |
CleanupStack::PopAndDestroy( iaps ); |
|
993 |
CleanupStack::PopAndDestroy( &iapIds ); |
|
994 |
||
995 |
CCHUIDEBUG2( |
|
996 |
"CCCHUiNotifierImpl::IsServiceSnapMissingInternetGprsApsL - return: %d", isMissingGPRSIap ); |
|
997 |
||
998 |
return isMissingGPRSIap; |
|
999 |
} |
|
1000 |
||
1001 |
// --------------------------------------------------------------------------- |
|
1002 |
// CCCHUiNotifierImpl::InternetGprsApsMissingFromServiceSnapL |
|
1003 |
// --------------------------------------------------------------------------- |
|
1004 |
// |
|
1005 |
TUint32 CCCHUiNotifierImpl::InternetGprsApsMissingFromServiceSnapL( |
|
1006 |
CDesCArray& aIaps, RArray<TUint32>& aIapIds ) const |
|
1007 |
{ |
|
1008 |
CCHUIDEBUG( |
|
1009 |
"CCCHUiNotifierImpl::InternetGprsApsMissingFromServiceSnapL - IN" ); |
|
1010 |
||
1011 |
TUint32 internetSnapId = KErrNone; |
|
1012 |
||
1013 |
CCchUiNotifConnectionHandler* connHandler = |
|
1014 |
CCchUiNotifConnectionHandler::NewLC(); |
|
1015 |
||
1016 |
CDesCArray* voipGprsIaps = new (ELeave) CDesCArrayFlat( 1 ); |
|
1017 |
CleanupStack::PushL( voipGprsIaps ); |
|
1018 |
||
1019 |
RArray<TUint32> voipGprsIapIds; |
|
1020 |
CleanupClosePushL( voipGprsIapIds ); |
|
1021 |
||
1022 |
connHandler->GetGprsAccessPointsSetToServiceSnapL( |
|
1023 |
*voipGprsIaps, voipGprsIapIds, iCurrentConnectionIapId ); |
|
1024 |
||
1025 |
CDesCArray* internetGprsIapNames = new (ELeave) CDesCArrayFlat( 2 ); |
|
1026 |
CleanupStack::PushL( internetGprsIapNames ); |
|
1027 |
||
1028 |
RArray<TUint32> internetGprsIapIds; |
|
1029 |
CleanupClosePushL( internetGprsIapIds ); |
|
1030 |
||
1031 |
TRAPD( err, internetSnapId = connHandler->GetGprsAccessPointsL( |
|
1032 |
*internetGprsIapNames, internetGprsIapIds ) ); |
|
1033 |
CCHUIDEBUG2( "-GetGprsAccessPointsL -Trap err = %d", err ); |
|
1034 |
||
1035 |
if ( !KErrNone == err && !KErrNotFound == err ) |
|
1036 |
{ |
|
1037 |
User::Leave( err ); |
|
1038 |
} |
|
1039 |
||
1040 |
for ( TInt i( 0 ); i < internetGprsIapIds.Count(); i++ ) |
|
1041 |
{ |
|
1042 |
TBool found = EFalse; |
|
1043 |
for ( TInt j( 0 ); j < voipGprsIapIds.Count() && !found; j++ ) |
|
1044 |
{ |
|
1045 |
found = connHandler->IsConnectionMethodSimilarL( |
|
1046 |
internetGprsIapIds[ i ], voipGprsIapIds[ j ] ); |
|
1047 |
} |
|
1048 |
if ( !found ) |
|
1049 |
{ |
|
1050 |
CCHUIDEBUG2( |
|
1051 |
"IsVoIPSNAPMissingInternetGPRSAp -missing GPRS AP id: %d", internetGprsIapIds[ i ] ); |
|
1052 |
aIapIds.AppendL( internetGprsIapIds[ i ] ); |
|
1053 |
aIaps.AppendL( internetGprsIapNames->MdcaPoint( i ) ); |
|
1054 |
} |
|
1055 |
} |
|
1056 |
||
1057 |
CleanupStack::PopAndDestroy( &internetGprsIapIds ); |
|
1058 |
CleanupStack::PopAndDestroy( internetGprsIapNames ); |
|
1059 |
CleanupStack::PopAndDestroy( &voipGprsIapIds ); |
|
1060 |
CleanupStack::PopAndDestroy( voipGprsIaps ); |
|
1061 |
CleanupStack::PopAndDestroy( connHandler ); |
|
1062 |
||
1063 |
CCHUIDEBUG( "CCCHUiNotifierImpl::InternetGprsApsMissingFromServiceSnapL - OUT" ); |
|
1064 |
||
1065 |
return internetSnapId; |
|
1066 |
} |
|
1067 |
||
1068 |
// --------------------------------------------------------------------------- |
|
1069 |
// Fills list items and commands for change connection dialog. |
|
1070 |
// --------------------------------------------------------------------------- |
|
1071 |
// |
|
1072 |
void CCCHUiNotifierImpl::FillChangeConnectionListboxL( |
|
1073 |
CDesCArray& aListItems, RArray<TCchUiOperationCommand>& aCommandArray ) |
|
1074 |
{ |
|
1075 |
CCHUIDEBUG( "CCCHUiNotifierImpl::FillChangeConnectionListboxL - IN" ); |
|
1076 |
||
1077 |
HBufC* searchWlan = StringLoader::LoadLC( |
|
1078 |
R_QTN_CCHUINOTIF_SEARCH_WLAN_CHANGE_CONNECTION_TEXT ); |
|
1079 |
||
1080 |
HBufC* useGprs = StringLoader::LoadLC( |
|
1081 |
R_QTN_CCHUINOTIF_USE_GPRS_CHANGE_CONNECTION_TEXT ); |
|
1082 |
||
1083 |
aListItems.AppendL( *searchWlan ); |
|
1084 |
aCommandArray.AppendL( ECchUiCommandSearchWlan ); |
|
1085 |
||
1086 |
if ( !IsPhoneOfflineL() && IsGprsIapsAvailableL() |
|
1087 |
&& IsVoIPOverWCDMAAllowedL() ) |
|
1088 |
{ |
|
1089 |
aListItems.AppendL( *useGprs ); |
|
1090 |
aCommandArray.AppendL( ECchUiCommandCopyGprs ); |
|
1091 |
} |
|
1092 |
||
1093 |
CleanupStack::PopAndDestroy( useGprs ); |
|
1094 |
CleanupStack::PopAndDestroy( searchWlan ); |
|
1095 |
||
1096 |
CCHUIDEBUG( "CCCHUiNotifierImpl::FillChangeConnectionListboxL - OUT" ); |
|
1097 |
} |
|
1098 |
||
1099 |
// --------------------------------------------------------------------------- |
|
1100 |
// Check if VoIP over WCDMA is allowed |
|
1101 |
// --------------------------------------------------------------------------- |
|
1102 |
// |
|
1103 |
TBool CCCHUiNotifierImpl::IsVoIPOverWCDMAAllowedL() |
|
1104 |
{ |
|
1105 |
CCHUIDEBUG( "CCCHUiNotifierImpl::IsVoIPOverWCDMAAllowed - IN" ); |
|
1106 |
||
1107 |
CRCSEProfileRegistry* cRCSEProfileRegistry; |
|
1108 |
cRCSEProfileRegistry = CRCSEProfileRegistry::NewLC(); |
|
33
2989b291cac7
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
1109 |
TBool ret = EFalse; |
28 | 1110 |
RPointerArray<CRCSEProfileEntry> entries; |
1111 |
cRCSEProfileRegistry->FindByServiceIdL( iServiceId, entries ); |
|
1112 |
if( entries.Count() ) |
|
1113 |
{ |
|
33
2989b291cac7
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
1114 |
ret = CRCSEProfileEntry::EOn == entries[ 0 ]->iAllowVoIPoverWCDMA; |
28 | 1115 |
} |
1116 |
||
33
2989b291cac7
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
1117 |
entries.ResetAndDestroy(); |
2989b291cac7
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
1118 |
entries.Close(); |
2989b291cac7
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
1119 |
CleanupStack::PopAndDestroy(); //cRCSEProfileRegistry |
28 | 1120 |
|
33
2989b291cac7
Revision: 201039
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
28
diff
changeset
|
1121 |
return ret; |
28 | 1122 |
} |
1123 |
||
1124 |
// --------------------------------------------------------------------------- |
|
1125 |
// From class CCCHUiNotifierBase. |
|
1126 |
// --------------------------------------------------------------------------- |
|
1127 |
// |
|
1128 |
CCCHUiNotifierImpl::TNotifierInfo CCCHUiNotifierImpl::RegisterL() |
|
1129 |
{ |
|
1130 |
iInfo.iUid=KCchUiNotifierUid; |
|
1131 |
iInfo.iChannel=KCchUiNotifierChannel; |
|
1132 |
iInfo.iPriority=ENotifierPriorityVHigh; |
|
1133 |
return iInfo; |
|
1134 |
} |
|
1135 |
||
1136 |
// --------------------------------------------------------------------------- |
|
1137 |
// From class CCCHUiNotifierBase. |
|
1138 |
// --------------------------------------------------------------------------- |
|
1139 |
// |
|
1140 |
TPtrC8 CCCHUiNotifierImpl::UpdateL( const TDesC8& /*aBuffer*/ ) |
|
1141 |
{ |
|
1142 |
TPtrC8 ret( KNullDesC8 ); |
|
1143 |
return ret; |
|
1144 |
} |
|
1145 |
||
1146 |
// --------------------------------------------------------------------------- |
|
1147 |
// From class CCCHUiNotifierBase. |
|
1148 |
// --------------------------------------------------------------------------- |
|
1149 |
// |
|
1150 |
void CCCHUiNotifierImpl::StartL( |
|
1151 |
const TDesC8& aBuffer, |
|
1152 |
TInt aReplySlot, |
|
1153 |
const RMessagePtr2& aMessage) |
|
1154 |
{ |
|
1155 |
CCHUIDEBUG( "CCCHUiNotifierImpl::StartL - IN" ); |
|
1156 |
||
1157 |
__ASSERT_DEBUG( iMessage.IsNull(), User::Leave( KErrAlreadyExists ) ); |
|
1158 |
||
1159 |
// Read aBuffer for control information |
|
1160 |
TCCHUiNotifierParams param; |
|
1161 |
TPckgC<TCCHUiNotifierParams> pckg(param); |
|
1162 |
pckg.Set( aBuffer ); |
|
1163 |
||
1164 |
CCCHUiNotifierBase::StartL( aBuffer, aReplySlot, aMessage ); |
|
1165 |
iDialogMode = pckg().iDialogMode; |
|
1166 |
iServiceId = pckg().iServiceId; |
|
1167 |
iCurrentConnectionIapId = pckg().iCurrentConnectionIapId; |
|
1168 |
||
1169 |
switch( pckg().iDialogMode ) |
|
1170 |
{ |
|
1171 |
case MCchUiObserver::ECchUiDialogTypeUsernamePasswordFailed: |
|
1172 |
{ |
|
1173 |
CCHUIDEBUG( "StartL - wrong username/password" ); |
|
1174 |
ShowInvalidUsernamePasswordNoteL( |
|
1175 |
aReplySlot, aMessage, pckg().iServiceId ); |
|
1176 |
} |
|
1177 |
break; |
|
1178 |
case MCchUiObserver::ECchUiDialogTypeAuthenticationFailed: |
|
1179 |
{ |
|
1180 |
CCHUIDEBUG( "StartL - auth failed" ); |
|
1181 |
ShowUsernamePasswordQueryL( |
|
1182 |
aReplySlot, aMessage, pckg().iServiceId, pckg().iUsername ); |
|
1183 |
} |
|
1184 |
break; |
|
1185 |
||
1186 |
case MCchUiObserver::ECchUiDialogTypeNoConnectionAvailable: |
|
1187 |
{ |
|
1188 |
CCHUIDEBUG( "StartL - no connections" ); |
|
1189 |
// Do nothing here. Uses RunL to show notifier instead. |
|
1190 |
// Needed for cancel functionality. |
|
1191 |
} |
|
1192 |
break; |
|
1193 |
case MCchUiObserver::ECchUiDialogTypeNoConnectionDefined: |
|
1194 |
{ |
|
1195 |
CCHUIDEBUG( "StartL - no conn defined" ); |
|
1196 |
ShowNoConnectionsQueryL( |
|
1197 |
aReplySlot, aMessage, pckg().iServiceId, ETrue ); |
|
1198 |
} |
|
1199 |
break; |
|
1200 |
case MCchUiObserver::ECchUiDialogTypeDefectiveSettings: |
|
1201 |
{ |
|
1202 |
CCHUIDEBUG( "StartL - defective settings" ); |
|
1203 |
ShowDefectiveSettingsL( |
|
1204 |
aReplySlot, aMessage, pckg().iServiceId ); |
|
1205 |
} |
|
1206 |
break; |
|
1207 |
case MCchUiObserver::ECchUiDialogTypeErrorInConnection: |
|
1208 |
{ |
|
1209 |
CCHUIDEBUG( "StartL - error in connection" ); |
|
1210 |
ShowErrorInConnectionNoteL( |
|
1211 |
aReplySlot, aMessage, pckg().iServiceId ); |
|
1212 |
} |
|
1213 |
break; |
|
1214 |
case MCchUiObserver::ECchUiDialogTypeConfirmChangeConnection: |
|
1215 |
{ |
|
1216 |
CCHUIDEBUG( "StartL - confirm change connection" ); |
|
1217 |
ShowConfirmChangeConnectionL( |
|
1218 |
aReplySlot, |
|
1219 |
aMessage, |
|
1220 |
pckg().iServiceId, |
|
1221 |
pckg().iCurrentConnectionIapId ); |
|
1222 |
} |
|
1223 |
break; |
|
1224 |
case MCchUiObserver::ECchUiDialogTypeChangeConnection: |
|
1225 |
{ |
|
1226 |
CCHUIDEBUG( "StartL - change connection" ); |
|
1227 |
ShowChangeConnectionQueryL( |
|
1228 |
aReplySlot, |
|
1229 |
aMessage, |
|
1230 |
pckg().iServiceId, |
|
1231 |
pckg().iCurrentConnectionIapId ); |
|
1232 |
} |
|
1233 |
break; |
|
1234 |
default: |
|
1235 |
{ |
|
1236 |
User::Leave( KErrNotSupported ); |
|
1237 |
} |
|
1238 |
break; |
|
1239 |
} |
|
1240 |
||
1241 |
CCHUIDEBUG( "CCCHUiNotifierImpl::StartL - OUT" ); |
|
1242 |
} |
|
1243 |
||
1244 |
// --------------------------------------------------------------------------- |
|
1245 |
// From class MCchUiCallStateObserver. |
|
1246 |
// --------------------------------------------------------------------------- |
|
1247 |
// |
|
1248 |
void CCCHUiNotifierImpl::CallStateChanged( TInt aCallState ) |
|
1249 |
{ |
|
1250 |
CCHUIDEBUG( "CCCHUiNotifierImpl::CallStateChangedL - Start" ); |
|
1251 |
||
1252 |
switch( aCallState ) |
|
1253 |
{ |
|
1254 |
case EPSCTsyCallStateRinging: |
|
1255 |
{ |
|
1256 |
if ( iListQueryDialog ) |
|
1257 |
{ |
|
1258 |
delete iListQueryDialog; |
|
1259 |
iListQueryDialog = NULL; |
|
1260 |
||
1261 |
CompleteMessage( KErrCancel ); |
|
1262 |
CCCHUiNotifierBase::Cancel(); |
|
1263 |
} |
|
1264 |
} |
|
1265 |
break; |
|
1266 |
default: |
|
1267 |
{ |
|
1268 |
// Nothing to do. |
|
1269 |
} |
|
1270 |
break; |
|
1271 |
} |
|
1272 |
||
1273 |
CCHUIDEBUG( "CCCHUiNotifierImpl::CallStateChangedL - End" ); |
|
1274 |
} |