|
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: Connection handler implementation. |
|
15 * |
|
16 */ |
|
17 |
|
18 // INCLUDE FILES |
|
19 #include "CCnUiConnectionHandler.h" |
|
20 #include "CCnUiSapStoreProxy.h" |
|
21 |
|
22 #include "MCnUiClientStatusHandler.h" |
|
23 #include "CnUiErrors.h" |
|
24 #include "IMPSCommonUiDebugPrint.h" |
|
25 |
|
26 #include <e32std.h> |
|
27 |
|
28 #include <CIMPSSAPSettings.h> |
|
29 #include <CIMPSSAPSettingsStore.h> |
|
30 #include <CPEngNWSessionSlot2.h> |
|
31 #include <CPEngNWSessionSlotID2.h> |
|
32 #include <CPEngNWSessionSlotManager2.h> |
|
33 |
|
34 |
|
35 |
|
36 /** |
|
37 * WV protocol prefix. |
|
38 */ |
|
39 _LIT( KWVIdPrefix, "wv:" ); |
|
40 |
|
41 |
|
42 /** |
|
43 * Domain separator @. |
|
44 */ |
|
45 _LIT( KDomainSeparatorAt, "@" ); |
|
46 |
|
47 /** |
|
48 * Length of WV protocol prefix. |
|
49 */ |
|
50 const TInt KWVIdPrefixLength = 3; |
|
51 |
|
52 |
|
53 // ================= GLOBAL FUNCTIONS ==================== |
|
54 // ----------------------------------------------------------------------------- |
|
55 // CreateConnHandlerL() |
|
56 // ----------------------------------------------------------------------------- |
|
57 // |
|
58 GLREF_C MCnUiConnectionHandler* CreateConnHandlerL( CCnUiSapStoreProxy& aSapProxy ) |
|
59 { |
|
60 return CCnUiConnectionHandler::NewL( aSapProxy ); |
|
61 } |
|
62 |
|
63 |
|
64 // ================= LOCAL FUNCTIONS ==================== |
|
65 |
|
66 // ----------------------------------------------------------------------------- |
|
67 // StripWVSchemaPrefix() |
|
68 // ----------------------------------------------------------------------------- |
|
69 // |
|
70 LOCAL_D TPtrC StripWVSchemaPrefix( const TDesC& aFullPresenceId ) |
|
71 { |
|
72 TPtrC prefix( aFullPresenceId.Left( KWVIdPrefixLength ) ); |
|
73 if ( prefix.CompareF( KWVIdPrefix ) == 0 ) |
|
74 { |
|
75 //has prefix |
|
76 return aFullPresenceId.Mid( KWVIdPrefixLength ); |
|
77 } |
|
78 return aFullPresenceId; |
|
79 } |
|
80 |
|
81 |
|
82 // ----------------------------------------------------------------------------- |
|
83 // StripDomainPart() |
|
84 // ----------------------------------------------------------------------------- |
|
85 // |
|
86 LOCAL_D TPtrC StripDomainPart( const TDesC& aFullPresenceId ) |
|
87 { |
|
88 TInt domainStartPos = aFullPresenceId.Find( KDomainSeparatorAt ); |
|
89 if ( domainStartPos == KErrNotFound ) |
|
90 { |
|
91 return aFullPresenceId; |
|
92 } |
|
93 return aFullPresenceId.Left( domainStartPos ); |
|
94 } |
|
95 |
|
96 |
|
97 |
|
98 // ================= MEMBER FUNCTIONS ======================= |
|
99 // Two-phased constructor. |
|
100 CCnUiConnectionHandler* CCnUiConnectionHandler::NewL( CCnUiSapStoreProxy& aSapProxy ) |
|
101 { |
|
102 CCnUiConnectionHandler* self = new ( ELeave ) CCnUiConnectionHandler( aSapProxy ); |
|
103 |
|
104 CleanupStack::PushL( self ); |
|
105 self->ConstructL(); |
|
106 CleanupStack::Pop( self ); |
|
107 return self; |
|
108 } |
|
109 |
|
110 |
|
111 // Destructor |
|
112 CCnUiConnectionHandler::~CCnUiConnectionHandler() |
|
113 { |
|
114 if ( iNWSessionSlotID ) |
|
115 { |
|
116 CancelSapConnectionOpen( *iNWSessionSlotID ); |
|
117 CancelSapConnectionClose( *iNWSessionSlotID ); |
|
118 delete iNWSessionSlotID; |
|
119 } |
|
120 |
|
121 delete iClientStatusHandler; |
|
122 delete iNWSessionSlot; |
|
123 } |
|
124 |
|
125 // C++ default constructor can NOT contain any code, that |
|
126 // might leave. |
|
127 // |
|
128 CCnUiConnectionHandler::CCnUiConnectionHandler( CCnUiSapStoreProxy& aSapProxy ) |
|
129 : iSapProxy( aSapProxy ) |
|
130 { |
|
131 } |
|
132 |
|
133 |
|
134 // Symbian OS default constructor can leave. |
|
135 void CCnUiConnectionHandler::ConstructL() |
|
136 { |
|
137 iClientStatusHandler = CreateClientStatusHandlerLC(); |
|
138 CleanupStack::Pop(); //iClientStatusHandler |
|
139 |
|
140 |
|
141 CPEngNWSessionSlotID2* slotID = CPEngNWSessionSlotID2::NewLC(); |
|
142 slotID->SetServiceAddressMatchAnyL(); |
|
143 slotID->SetUserIdMatchAnyL(); |
|
144 slotID->SetAppIdL( KPEngAppIdIM() ); |
|
145 |
|
146 //Clear logged in flags if there doesn't exist a connection |
|
147 if ( !( NwConnectionActiveL( *slotID ) ) ) |
|
148 { |
|
149 iClientStatusHandler->SetClientLoggedOutL( EIMPSConnClientIM ); |
|
150 } |
|
151 |
|
152 CleanupStack::PopAndDestroy( slotID ); |
|
153 } |
|
154 |
|
155 |
|
156 // ----------------------------------------------------------------------------- |
|
157 // CCnUiConnectionHandler::OpenSapConnectionL() |
|
158 // |
|
159 // ----------------------------------------------------------------------------- |
|
160 // |
|
161 void CCnUiConnectionHandler::OpenSapConnectionL( |
|
162 const CIMPSSAPSettings& aSapToLogin, |
|
163 CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
164 MPEngNWSessionOperationObserver2& aSlotOperationObserver ) |
|
165 { |
|
166 if ( !NwConnectionActiveL( aNWSessionSlotID ) ) |
|
167 { |
|
168 //initially there isn't any logged in clients |
|
169 TIMPSConnectionClient client; |
|
170 if ( 0 == aNWSessionSlotID.AppId().Compare( KPEngAppIdPEC() ) ) |
|
171 { |
|
172 client = EIMPSConnClientPEC; |
|
173 } |
|
174 else |
|
175 { |
|
176 client = EIMPSConnClientIM; |
|
177 } |
|
178 iClientStatusHandler->SetClientLoggedOutL( client ); |
|
179 } |
|
180 |
|
181 |
|
182 CPEngNWSessionSlot2* sessionSlot = CPEngNWSessionSlot2::NewL( aNWSessionSlotID ); |
|
183 delete iNWSessionSlot; |
|
184 iNWSessionSlot = sessionSlot; |
|
185 |
|
186 TInt err ( iNWSessionSlot->OpenNWPresenceSession( aSapToLogin, |
|
187 aSlotOperationObserver ) ); |
|
188 |
|
189 if ( err == KErrInUse ) |
|
190 { |
|
191 // this error suggests, that we have a session open already going on from |
|
192 // this same object. This should not happen, but if it does we can ignore it |
|
193 // since we are already doing what we should start doing here |
|
194 err = KErrNone; |
|
195 } |
|
196 |
|
197 //handle connection manager errors |
|
198 if ( err == KErrAccessDenied ) |
|
199 { |
|
200 //network operations not allowed due offline profile |
|
201 User::Leave( KCnUiErrorNetworkConnectionNotAllowed ); |
|
202 } |
|
203 User::LeaveIfError( err ); |
|
204 |
|
205 delete iNWSessionSlotID; |
|
206 iNWSessionSlotID = NULL; |
|
207 iNWSessionSlotID = aNWSessionSlotID.CloneL(); |
|
208 } |
|
209 |
|
210 |
|
211 // ----------------------------------------------------------------------------- |
|
212 // CCnUiConnectionHandler::CancelSapConnectionOpen() |
|
213 // ----------------------------------------------------------------------------- |
|
214 // |
|
215 void CCnUiConnectionHandler::CancelSapConnectionOpen( CPEngNWSessionSlotID2& /* aNWSessionSlotID */ ) |
|
216 { |
|
217 if ( iNWSessionSlot ) |
|
218 { |
|
219 iNWSessionSlot->CancelOpenNWPresenceSession(); |
|
220 } |
|
221 } |
|
222 |
|
223 |
|
224 // ----------------------------------------------------------------------------- |
|
225 // CCnUiConnectionHandler::CloseSapConnectionL() |
|
226 // ----------------------------------------------------------------------------- |
|
227 // |
|
228 void CCnUiConnectionHandler::CloseSapConnectionL( |
|
229 CPEngNWSessionSlotID2& aNWSessionSlotID, |
|
230 MPEngNWSessionOperationObserver2& aSlotOperationObserver ) |
|
231 { |
|
232 // if we already have the same slot id as in the parameter, we are in sync |
|
233 // and slot is also good. in that case we must NOT delete the slot id - if we |
|
234 // do, then PEC Engine CSP session gets closed and OpenNWPresenceSessionOwnership |
|
235 // will leave with -18. |
|
236 CPEngNWSessionSlotID2* tempSlot = aNWSessionSlotID.CloneL(); |
|
237 delete iNWSessionSlotID; |
|
238 iNWSessionSlotID = tempSlot; |
|
239 |
|
240 CPEngNWSessionSlotID2* bSlot = NULL; |
|
241 if ( !iNWSessionSlot ) |
|
242 { |
|
243 CPEngNWSessionSlot2* sessionSlot = CPEngNWSessionSlot2::NewL( *iNWSessionSlotID ); |
|
244 delete iNWSessionSlot; |
|
245 iNWSessionSlot = sessionSlot; |
|
246 } |
|
247 else |
|
248 { |
|
249 bSlot = CPEngNWSessionSlotID2::NewLC(); |
|
250 iNWSessionSlot->GetNWSessionSlotID( *bSlot ); |
|
251 if ( aNWSessionSlotID.MatchBasePart( *bSlot ) != KErrNone ) |
|
252 { |
|
253 CPEngNWSessionSlot2* sessionSlot = CPEngNWSessionSlot2::NewL( *iNWSessionSlotID ); |
|
254 delete iNWSessionSlot; |
|
255 iNWSessionSlot = sessionSlot; |
|
256 } |
|
257 CleanupStack::PopAndDestroy( bSlot ); |
|
258 } |
|
259 |
|
260 TInt err( KErrNone ); |
|
261 |
|
262 err = iNWSessionSlot->OpenNWPresenceSessionOwnership(); |
|
263 |
|
264 // we can ignore KErrAlreadyExists |
|
265 if ( err != KErrNone && err != KErrAlreadyExists ) |
|
266 { |
|
267 User::Leave( err ); |
|
268 } |
|
269 |
|
270 err = iNWSessionSlot->ForceCloseNWPresenceSession( aSlotOperationObserver ); |
|
271 |
|
272 if ( err == KErrInUse ) |
|
273 { |
|
274 // this error suggests, that we have a session close already going on from |
|
275 // this same object. This should not happen, but if it does we can ignore it |
|
276 // since we are already doing what we should start doing here |
|
277 err = KErrNone; |
|
278 } |
|
279 User::LeaveIfError( err ); |
|
280 } |
|
281 |
|
282 |
|
283 // ----------------------------------------------------------------------------- |
|
284 // CCnUiConnectionHandler::CancelSapConnectionClose() |
|
285 // ----------------------------------------------------------------------------- |
|
286 // |
|
287 void CCnUiConnectionHandler::CancelSapConnectionClose( CPEngNWSessionSlotID2& aNWSessionSlotID ) |
|
288 { |
|
289 CPEngNWSessionSlot2* slot = NULL; |
|
290 // we can ignore the error, since if we don't find the slot |
|
291 // there's not really much else we can do here |
|
292 TInt ignore; |
|
293 TRAP( ignore, slot = NetworkSessionSlotForIDL( aNWSessionSlotID ) ); |
|
294 if ( slot ) |
|
295 { |
|
296 slot->CancelCloseNWPresenceSession(); |
|
297 delete slot; |
|
298 } |
|
299 } |
|
300 |
|
301 |
|
302 // ----------------------------------------------------------------------------- |
|
303 // CCnUiConnectionHandler::LoginTheClientL() |
|
304 // Client login handler |
|
305 // ----------------------------------------------------------------------------- |
|
306 // |
|
307 void CCnUiConnectionHandler::LoginTheClientL( TIMPSConnectionClient aClient ) |
|
308 { |
|
309 if ( iClientStatusHandler ) |
|
310 { |
|
311 iClientStatusHandler->SetClientLoggedInL( aClient ); |
|
312 } |
|
313 } |
|
314 |
|
315 |
|
316 // ----------------------------------------------------------------------------- |
|
317 // CCnUiConnectionHandler::LogoutTheClientL() |
|
318 // Client login handler |
|
319 // ----------------------------------------------------------------------------- |
|
320 // |
|
321 void CCnUiConnectionHandler::LogoutTheClientL( TIMPSConnectionClient aClient ) |
|
322 { |
|
323 //remove client from among the logged in ones |
|
324 iClientStatusHandler->SetClientLoggedOutL( aClient ); |
|
325 } |
|
326 |
|
327 |
|
328 // ----------------------------------------------------------------------------- |
|
329 // CCnUiConnectionHandler::TheClientLoggedInL() |
|
330 // Status getter |
|
331 // ----------------------------------------------------------------------------- |
|
332 // |
|
333 TBool CCnUiConnectionHandler::TheClientLoggedInL( TIMPSConnectionClient aClient ) |
|
334 { |
|
335 |
|
336 CPEngNWSessionSlotID2* slotID = CPEngNWSessionSlotID2::NewLC(); |
|
337 slotID->SetServiceAddressMatchAnyL(); |
|
338 slotID->SetUserIdMatchAnyL(); |
|
339 if ( aClient == EIMPSConnClientPEC ) |
|
340 { |
|
341 slotID->SetAppIdL( KPEngAppIdPEC() ); |
|
342 } |
|
343 else |
|
344 { |
|
345 slotID->SetAppIdL( KPEngAppIdIM() ); |
|
346 } |
|
347 |
|
348 //Clear logged in flags if there doesn't exist a connection |
|
349 if ( !NwConnectionActiveL( *slotID ) ) |
|
350 { |
|
351 iClientStatusHandler->SetClientLoggedOutL( aClient ); |
|
352 IMPSCUI_DP( D_IMPSCUI_LIT( "CCnUiConnectionHandler::TheClientLoggedInL( %d ) - [%d] (no nw)" ), aClient, EFalse ); |
|
353 CleanupStack::PopAndDestroy( slotID ); |
|
354 return EFalse; |
|
355 } |
|
356 |
|
357 CleanupStack::PopAndDestroy( slotID ); |
|
358 //active connection so client is in |
|
359 return ETrue; |
|
360 } |
|
361 |
|
362 |
|
363 |
|
364 // ----------------------------------------------------------------------------- |
|
365 // CCnUiConnectionHandler::GetLoggedInSapL() |
|
366 // Status getter |
|
367 // ----------------------------------------------------------------------------- |
|
368 // |
|
369 TBool CCnUiConnectionHandler::GetLoggedInSapL( |
|
370 CIMPSSAPSettings& aSap, |
|
371 TIMPSConnectionClient aClient ) |
|
372 { |
|
373 |
|
374 aSap.Reset(); |
|
375 |
|
376 CPEngNWSessionSlotManager2* slotManager = CPEngNWSessionSlotManager2::NewLC(); |
|
377 |
|
378 CPEngNWSessionSlotID2* pattern = CPEngNWSessionSlotID2::NewLC(); |
|
379 pattern->SetServiceAddressMatchAnyL(); |
|
380 pattern->SetUserIdMatchAnyL(); |
|
381 if ( aClient == EIMPSConnClientPEC ) |
|
382 { |
|
383 pattern->SetAppIdL( KPEngAppIdPEC ); |
|
384 } |
|
385 else |
|
386 { |
|
387 pattern->SetAppIdL( KPEngAppIdIM ); |
|
388 } |
|
389 |
|
390 RPointerArray< CPEngNWSessionSlotID2 > array; |
|
391 TInt err( slotManager->GetNWSessionSlots( array, *pattern, EPEngNWPresenceSessionOpen ) ); |
|
392 CleanupStack::PopAndDestroy( 2, slotManager ); // slotManager, pattern |
|
393 |
|
394 CleanupStack::PushL( TCleanupItem( DestroyCloseModelArray, &array ) ); |
|
395 if ( err == KErrNotFound ) |
|
396 { |
|
397 CleanupStack::PopAndDestroy(); //array |
|
398 return EFalse; |
|
399 } |
|
400 else |
|
401 { |
|
402 User::LeaveIfError( err ); |
|
403 } |
|
404 |
|
405 if ( array.Count() > 0 ) |
|
406 { |
|
407 CPEngNWSessionSlot2* tempSlot = NULL; |
|
408 TRAPD( error, tempSlot = NetworkSessionSlotForIDL( *array[0] ) ); |
|
409 if ( error == KErrNotFound ) |
|
410 { |
|
411 CleanupStack::PopAndDestroy(); //array |
|
412 return EFalse; |
|
413 } |
|
414 else |
|
415 { |
|
416 User::LeaveIfError( error ); |
|
417 } |
|
418 if ( tempSlot ) |
|
419 { |
|
420 tempSlot->OpenNWPresenceSessionOwnership(); |
|
421 TInt err = tempSlot->GetNWPresenceSessionSap( aSap ); |
|
422 delete tempSlot; |
|
423 if ( err == KErrNone ) |
|
424 { |
|
425 // this slot was active and SAP is now filled |
|
426 CleanupStack::PopAndDestroy(); //array |
|
427 return ETrue; |
|
428 } |
|
429 } |
|
430 } |
|
431 CleanupStack::PopAndDestroy(); //array |
|
432 return EFalse; |
|
433 } |
|
434 |
|
435 |
|
436 // ----------------------------------------------------------------------------- |
|
437 // CCnUiConnectionHandler::SapConnectionStatusL() |
|
438 // Status getter |
|
439 // ----------------------------------------------------------------------------- |
|
440 // |
|
441 TCnUiSapCnStatus CCnUiConnectionHandler::SapConnectionStatusL( const CIMPSSAPSettings& aSap, |
|
442 TIMPSConnectionClient aClient ) |
|
443 { |
|
444 CIMPSSAPSettings* loggedinSAP = CIMPSSAPSettings::NewLC(); |
|
445 TBool nwConnectionActive = GetLoggedInSapL( *loggedinSAP, aClient ); |
|
446 |
|
447 //verify connection settings (address & user id) |
|
448 TBool sapAddressMatch = ( loggedinSAP->SAPAddress().Compare( aSap.SAPAddress() ) == 0 ); |
|
449 |
|
450 TPtrC loggedInPlainUserId( |
|
451 StripWVSchemaPrefix( StripDomainPart( loggedinSAP->SAPUserId() ) ) ); |
|
452 TPtrC loginPlainUserId( StripWVSchemaPrefix( StripDomainPart( aSap.SAPUserId() ) ) ); |
|
453 TBool userIdsMatch = ( loggedInPlainUserId.Compare( loginPlainUserId ) == 0 ); |
|
454 |
|
455 |
|
456 //verify passwords |
|
457 TBool pwdsMatch = EFalse; |
|
458 if ( loggedinSAP->SAPUserPassword().Compare( aSap.SAPUserPassword() ) == 0 ) |
|
459 { |
|
460 pwdsMatch = ETrue; |
|
461 } |
|
462 CleanupStack::PopAndDestroy( loggedinSAP ); //loggedinSAP |
|
463 |
|
464 |
|
465 if ( !nwConnectionActive ) |
|
466 { |
|
467 //no active NW connection |
|
468 return ECnUiSCS_NotConnected; |
|
469 } |
|
470 |
|
471 |
|
472 //there is a some network connection, what its state is ? |
|
473 if ( sapAddressMatch && userIdsMatch ) |
|
474 { |
|
475 //session to similar SAP than gived one exist already |
|
476 if ( pwdsMatch ) |
|
477 { |
|
478 //exactly same SAP connected |
|
479 return ECnUiSCS_SapConnected; |
|
480 } |
|
481 //similar SAP but with different password connected |
|
482 return ECnUiSCS_SapConnected_PwdMissMatch; |
|
483 } |
|
484 |
|
485 else |
|
486 { |
|
487 //session to some other SAP exist |
|
488 |
|
489 //is there known clients logged in to this session ? |
|
490 if ( iClientStatusHandler->AnyClientLoggedIn() ) |
|
491 { |
|
492 return ECnUiSCS_AnotherSapConnected; |
|
493 } |
|
494 return ECnUiSCS_AnotherSapConnected_ClientsNotKnown; |
|
495 } |
|
496 } |
|
497 |
|
498 |
|
499 |
|
500 // ----------------------------------------------------------------------------- |
|
501 // CCnUiConnectionHandler::GetLoggedInClientsL() |
|
502 // Status getter |
|
503 // ----------------------------------------------------------------------------- |
|
504 // |
|
505 void CCnUiConnectionHandler::GetLoggedInClientsL( RArray< TIMPSConnectionClient >& aClients ) |
|
506 { |
|
507 aClients.Reset(); |
|
508 if ( iClientStatusHandler->ClientLoggedIn( EIMPSConnClientPEC ) ) |
|
509 { |
|
510 User::LeaveIfError( aClients.Append( EIMPSConnClientPEC ) ); |
|
511 } |
|
512 |
|
513 if ( iClientStatusHandler->ClientLoggedIn( EIMPSConnClientIM ) ) |
|
514 { |
|
515 User::LeaveIfError( aClients.Append( EIMPSConnClientIM ) ); |
|
516 } |
|
517 } |
|
518 |
|
519 |
|
520 |
|
521 // ----------------------------------------------------------------------------- |
|
522 // CCnUiConnectionHandler::NwConnectionActiveL() |
|
523 // Status getter |
|
524 // ----------------------------------------------------------------------------- |
|
525 // |
|
526 TBool CCnUiConnectionHandler::NwConnectionActiveL( CPEngNWSessionSlotID2& aIdToMatch ) |
|
527 { |
|
528 //check do we have a connection or not |
|
529 |
|
530 // assume that if both service address and userid are given it's a full ID |
|
531 // if either is wildcard then assume that only appID is wanted to be matched |
|
532 TBool fullID ( !aIdToMatch.IsServiceAddressWild() | !aIdToMatch.IsUserIdWild() ); |
|
533 |
|
534 CPEngNWSessionSlotManager2* slotManager = CPEngNWSessionSlotManager2::NewLC(); |
|
535 |
|
536 RPointerArray< CPEngNWSessionSlotID2 > array; |
|
537 TInt error( slotManager->GetNWSessionSlots( array, aIdToMatch, |
|
538 EPEngNWPresenceSessionOpen ) ); |
|
539 if ( error != KErrNone ) |
|
540 { |
|
541 array.ResetAndDestroy(); |
|
542 User::Leave( error ); |
|
543 } |
|
544 CleanupStack::PopAndDestroy( slotManager ); // slotManager |
|
545 |
|
546 TBool returnValue( EFalse ); |
|
547 if ( array.Count() > 0 ) |
|
548 { |
|
549 returnValue = ETrue; |
|
550 } |
|
551 |
|
552 array.ResetAndDestroy(); |
|
553 return returnValue; |
|
554 } |
|
555 |
|
556 |
|
557 // ----------------------------------------------------------------------------- |
|
558 // CCnUiConnectionHandler::ServiceStatusL() |
|
559 // Status getter |
|
560 // ----------------------------------------------------------------------------- |
|
561 // |
|
562 TPEngNWSessionSlotState CCnUiConnectionHandler::ServiceStatusL( |
|
563 const CPEngNWSessionSlotID2& aNWSessionSlotID ) |
|
564 { |
|
565 TPEngNWSessionSlotState slotState ( EPEngNWPresenceSessionClosed ); |
|
566 |
|
567 CPEngNWSessionSlot2* slot = NetworkSessionSlotForIDL( aNWSessionSlotID ); |
|
568 slot->GetNWSessionSlotState( slotState ); |
|
569 delete slot; |
|
570 |
|
571 return slotState; |
|
572 } |
|
573 |
|
574 // ----------------------------------------------------------------------------- |
|
575 // CCnUiConnectionHandler::ServiceStatusL() |
|
576 // Status getter |
|
577 // ----------------------------------------------------------------------------- |
|
578 // |
|
579 CPEngNWSessionSlot2* CCnUiConnectionHandler::NetworkSessionSlotForIDL( |
|
580 const CPEngNWSessionSlotID2& aNWSessionSlotID ) |
|
581 { |
|
582 return CPEngNWSessionSlot2::NewL( aNWSessionSlotID ); |
|
583 } |
|
584 |
|
585 // ----------------------------------------------------------------------------- |
|
586 // CCnUiConnectionHandler::SetSessionSlotL() |
|
587 // Status getter |
|
588 // ----------------------------------------------------------------------------- |
|
589 // |
|
590 void CCnUiConnectionHandler::SetSessionSlotL( CPEngNWSessionSlot2* aSlot ) |
|
591 { |
|
592 delete iNWSessionSlot; |
|
593 iNWSessionSlot = aSlot; |
|
594 } |
|
595 |
|
596 // ----------------------------------------------------------------------------- |
|
597 // CCnUiConnectionHandler::DestroyCloseModelArray() |
|
598 // |
|
599 // ----------------------------------------------------------------------------- |
|
600 // |
|
601 void CCnUiConnectionHandler::DestroyCloseModelArray( TAny* aObject ) |
|
602 { |
|
603 reinterpret_cast< RPointerArray< CPEngNWSessionSlotID2 >* >( aObject )->ResetAndDestroy(); |
|
604 } |
|
605 // End of File |
|
606 |
|
607 |