|
1 /* |
|
2 * Copyright (c) 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: Station Directory View |
|
15 * |
|
16 */ |
|
17 |
|
18 /* --------------------------------------------------------------------------- |
|
19 * Version history: |
|
20 * Template version: |
|
21 * <ccm_history> |
|
22 * |
|
23 * Version: 2, Fri March 21 17:20:00 2008 by Prabina |
|
24 * Ref: |
|
25 * Added WorkAround for supporting different Resolutions , Added Wait Dialog for Loading of stations , |
|
26 * Handled Single/Double tapping on the list itmes |
|
27 * |
|
28 * </ccm_history> |
|
29 * ============================================================================ |
|
30 */ |
|
31 /* --------------------------------------------------------------------------- |
|
32 * Version history: |
|
33 * Template version: |
|
34 * <ccm_history> |
|
35 * |
|
36 * Version: 3, Tues March 25 17:30:00 2008 by Prabina |
|
37 * Ref: |
|
38 * Fixing the PCLint errors |
|
39 * |
|
40 * |
|
41 * </ccm_history> |
|
42 * ============================================================================ |
|
43 */ |
|
44 /* --------------------------------------------------------------------------- |
|
45 * Version history: |
|
46 * Template version: |
|
47 * <ccm_history> |
|
48 * |
|
49 * Version: 4, Tues April 04 16:40:00 2008 by Prabina |
|
50 * Ref: |
|
51 * Added WorkAround for retaining of focus & Page retaining |
|
52 * |
|
53 * |
|
54 * </ccm_history> |
|
55 * ============================================================================ |
|
56 */ |
|
57 /* --------------------------------------------------------------------------- |
|
58 * Version history: |
|
59 * Template version: |
|
60 * <ccm_history> |
|
61 * |
|
62 * Version: 5, Thurs July 18 12:00:00 2008 by Prabina |
|
63 * Ref: |
|
64 * Code Review Comments Fixed |
|
65 * |
|
66 * |
|
67 * </ccm_history> |
|
68 * ============================================================================ |
|
69 */ |
|
70 // SYSTEM INCLUDE FILES |
|
71 #include <akntitle.h> |
|
72 #include <eikmenup.h> |
|
73 #include <psserv.h> |
|
74 #include <hlplch.h> |
|
75 #include <eikenv.h> |
|
76 #include <internetradio.rsg> |
|
77 |
|
78 // INCLUDE FILES |
|
79 #include "irdebug.h" |
|
80 #include "irui.h" |
|
81 #include "irbaseview.h" |
|
82 #include "irstationdirectoryview.h" |
|
83 #include "irstationdirectorycontainer.h" |
|
84 #include "ircategoryview.h" |
|
85 #include "ir.hrh" |
|
86 #include "ircommon.h" |
|
87 #include "irviewstack.h" |
|
88 #include "irisdswrapper.h" |
|
89 #include "irnowplayingwrapper.h" |
|
90 #include "hlplch.h" |
|
91 #include "irsettings.h" |
|
92 #include "irnetworkcontroller.h" //Added for demo of ALR //TO DO::Remove after demo |
|
93 #include "iractivenetworkobserver.h" |
|
94 #include "irtopstationsview.h" |
|
95 |
|
96 // ==================== LOCAL FUNCTIONS ==================== |
|
97 |
|
98 // ================= MEMBER FUNCTIONS ======================= |
|
99 |
|
100 |
|
101 // --------------------------------------------------------------------------- |
|
102 // C++ default constructor can NOT contain any code, that might leave. |
|
103 // --------------------------------------------------------------------------- |
|
104 // |
|
105 CIRStationDirectoryView::CIRStationDirectoryView( ):iCallRequestPending(EFalse) |
|
106 { |
|
107 IRLOG_DEBUG( "CIRStationDirectoryView::CIRStationDirectoryView" ); |
|
108 } |
|
109 // --------------------------------------------------------------------------- |
|
110 // EPOC default constructor can leave. |
|
111 // --------------------------------------------------------------------------- |
|
112 // |
|
113 void CIRStationDirectoryView::ConstructL() |
|
114 { |
|
115 IRLOG_DEBUG( "CIRStationDirectoryView::ConstructL - Entering" ); |
|
116 CIRBaseView::ConstructL( R_IR_STATION_DIRECTORY ); |
|
117 SetCurrentFocus(0); |
|
118 iRequestPending = EFalse; |
|
119 IRLOG_DEBUG( "CIRStationDirectoryView::ConstructL - Exiting" ); |
|
120 } |
|
121 |
|
122 // ----------------------------------------------------------------------------- |
|
123 // CIRStationDirectoryView::NewL() |
|
124 // Two-phased constructor. |
|
125 // ----------------------------------------------------------------------------- |
|
126 // |
|
127 CIRStationDirectoryView* CIRStationDirectoryView::NewL() |
|
128 { |
|
129 IRLOG_DEBUG( "CIRStationDirectoryView::NewL" ); |
|
130 CIRStationDirectoryView* self = CIRStationDirectoryView::NewLC(); |
|
131 CleanupStack::Pop( self ); |
|
132 IRLOG_DEBUG( "CIRStationDirectoryView::NewL - Exiting" ); |
|
133 return self; |
|
134 } |
|
135 |
|
136 // --------------------------------------------------------------------------- |
|
137 // CIRStationDirectoryView::NewLC() |
|
138 // Two-phased constructor. |
|
139 // --------------------------------------------------------------------------- |
|
140 // |
|
141 CIRStationDirectoryView* CIRStationDirectoryView::NewLC() |
|
142 { |
|
143 IRLOG_DEBUG( "CIRStationDirectoryView::NewLC" ); |
|
144 CIRStationDirectoryView* self = new( ELeave ) CIRStationDirectoryView(); |
|
145 CleanupStack::PushL( self ); |
|
146 self->ConstructL(); |
|
147 IRLOG_DEBUG( "CIRStationDirectoryView::NewLC - Exiting" ); |
|
148 return self; |
|
149 } |
|
150 // --------------------------------------------------------------------------- |
|
151 // Destructor |
|
152 // --------------------------------------------------------------------------- |
|
153 // |
|
154 CIRStationDirectoryView::~CIRStationDirectoryView() |
|
155 { |
|
156 IRLOG_DEBUG( "CIRStationDirectoryView::~CIRStationDirectoryView - Entering" ); |
|
157 if ( iContainer ) |
|
158 { |
|
159 AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
160 iContainer->MakeVisible( EFalse ); |
|
161 delete iContainer; |
|
162 iContainer = NULL; |
|
163 } |
|
164 IRLOG_DEBUG( "CIRStationDirectoryView::~CIRStationDirectoryView - Exiting" ); |
|
165 } |
|
166 |
|
167 // --------------------------------------------------------------------------- |
|
168 // From class CAknView. |
|
169 // Returns view id. |
|
170 // --------------------------------------------------------------------------- |
|
171 // |
|
172 TUid CIRStationDirectoryView::Id() const |
|
173 { |
|
174 IRLOG_DEBUG( "CIRStationDirectoryView::Id" ); |
|
175 return KIRStationDirectoryViewId; |
|
176 } |
|
177 |
|
178 // --------------------------------------------------------------------------- |
|
179 // From class CAknView. |
|
180 // Event handler for status pane size changes. |
|
181 // --------------------------------------------------------------------------- |
|
182 // |
|
183 void CIRStationDirectoryView::HandleStatusPaneSizeChange() |
|
184 { |
|
185 IRLOG_DEBUG( "CIRStationDirectoryView::HandleStatusPaneSizeChange - Entering" ); |
|
186 CIRBaseView::HandleStatusPaneSizeChange(); |
|
187 |
|
188 if ( iContainer ) |
|
189 { |
|
190 iContainer->SetRect( ClientRect() ); |
|
191 } |
|
192 IRLOG_DEBUG( "CIRStationDirectoryView::HandleStatusPaneSizeChange - Exiting" ); |
|
193 } |
|
194 |
|
195 // --------------------------------------------------------------------------- |
|
196 // From class CAknView. |
|
197 // Handles view activation. |
|
198 // --------------------------------------------------------------------------- |
|
199 // |
|
200 void CIRStationDirectoryView::DoActivateL( const TVwsViewId& aPrevViewId, TUid aCustomMessageId, |
|
201 const TDesC8& aCustomMessage ) |
|
202 { |
|
203 IRLOG_DEBUG( "CIRStationDirectoryView::DoActivateL - Entering" ); |
|
204 |
|
205 TInt customMessageId = aCustomMessageId.iUid; |
|
206 if(customMessageId == 1) |
|
207 { |
|
208 SetCurrentFocus(0); |
|
209 } |
|
210 aCustomMessageId.iUid = 0; |
|
211 iUi->iPresentViewID = KIRStationDirectoryViewId; |
|
212 |
|
213 if ( !iContainer ) |
|
214 { |
|
215 iContainer = CIRStationDirectoryContainer::NewL( *this, ClientRect() ); |
|
216 iContainer->SetMopParent( this ); |
|
217 AppUi()->AddToViewStackL( *this, iContainer ); |
|
218 } |
|
219 else |
|
220 { |
|
221 iContainer->SetRect( ClientRect( ) ); |
|
222 iContainer->HandleResourceChange(KEikDynamicLayoutVariantSwitch); |
|
223 } |
|
224 |
|
225 iContainer->ActivateL( ); |
|
226 iContainer->MakeVisible( ETrue ); |
|
227 |
|
228 SetTitleL(R_IRAPP_STAT_DIR_TITLE); |
|
229 CIRBaseView::DoActivateL( aPrevViewId, aCustomMessageId, aCustomMessage ); |
|
230 HandleStatusPaneSizeChange(); |
|
231 |
|
232 iUi->iNetworkController->RegisterActiveNetworkObserverL(*this); |
|
233 EnableObserverL(EIRSystemEventObserver); |
|
234 IRLOG_DEBUG( "CIRStationDirectoryView::DoActivateL - Exiting" ); |
|
235 } |
|
236 |
|
237 // --------------------------------------------------------------------------- |
|
238 // From class CAknView. |
|
239 // Handles view deactivation. |
|
240 // --------------------------------------------------------------------------- |
|
241 // |
|
242 void CIRStationDirectoryView::DoDeactivate() |
|
243 { |
|
244 IRLOG_DEBUG( "CIRStationDirectoryView::DoDeactivate - Entering" ); |
|
245 if(&(iUi->SystemEventCollector())) |
|
246 { |
|
247 DisableObserver(EIRSystemEventObserver); |
|
248 } |
|
249 if ( iContainer ) |
|
250 { |
|
251 AppUi()->RemoveFromViewStack( *this, iContainer ); |
|
252 iContainer->MakeVisible( EFalse ); |
|
253 delete iContainer; |
|
254 iContainer = NULL; |
|
255 } |
|
256 iUi->iNetworkController->DeleteActiveNetworkObserver(*this); |
|
257 IRLOG_DEBUG( "CIRStationDirectoryView::DoDeactivate - Exiting" ); |
|
258 } |
|
259 |
|
260 |
|
261 // --------------------------------------------------------------------------- |
|
262 // From class CAknView. |
|
263 // Command handling function. |
|
264 // --------------------------------------------------------------------------- |
|
265 // |
|
266 void CIRStationDirectoryView::HandleCommandL( TInt aCommand ) |
|
267 { |
|
268 IRLOG_DEBUG( "CIRStationDirectoryView::HandleCommandL - Entering" ); |
|
269 CIRUi* appUi = static_cast<CIRUi*>( AppUi() ); |
|
270 CIRViewStack& viewStack = appUi->ViewStack(); |
|
271 switch ( aCommand ) |
|
272 { |
|
273 case ESelectCmd: |
|
274 { |
|
275 if( iUi->CheckAndNotifyLowDiskSpaceL() ) |
|
276 { |
|
277 break; |
|
278 } |
|
279 else if( iUi->VerifyNetworkConnectivityL() ) |
|
280 { |
|
281 iRequestPending = ETrue; |
|
282 } |
|
283 else |
|
284 { |
|
285 SetCurrentFocus(iContainer->GetCurrentItemIndex()); |
|
286 iRequestIssued = ETrue; |
|
287 DoCategoryRequestL(); |
|
288 } |
|
289 } |
|
290 break; |
|
291 |
|
292 case EGotoNowPlayingViewCmd: |
|
293 { |
|
294 appUi->SetHistory(EFalse); |
|
295 appUi->SavePrevIDL(KIRStationDirectoryViewId, aCommand); |
|
296 } |
|
297 break; |
|
298 //Activate settings view. |
|
299 case ESettingsCmd: |
|
300 { |
|
301 AppUi()->ActivateLocalViewL(KIRSettingsViewId); |
|
302 } |
|
303 break; |
|
304 |
|
305 case EHelpCmd: |
|
306 { |
|
307 if ( !iUi->CheckAndNotifyLowDiskSpaceL() ) |
|
308 { |
|
309 HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), |
|
310 AppUi()->AppHelpContextL()); |
|
311 } |
|
312 } |
|
313 break; |
|
314 case EAknSoftkeyBack: |
|
315 { |
|
316 if((appUi->IsFirstTime())) |
|
317 { |
|
318 CIRBaseView::HandleCommandL( aCommand ); |
|
319 } |
|
320 else |
|
321 { |
|
322 if(viewStack.Count() == 2 ) |
|
323 { |
|
324 TUid topView = viewStack.Pop(); |
|
325 if(viewStack.Peek()==KIRMainChoiceViewID) |
|
326 { |
|
327 viewStack.PushL(topView); |
|
328 CIRBaseView::HandleCommandL( aCommand ); |
|
329 } |
|
330 else |
|
331 { |
|
332 viewStack.Pop(); |
|
333 appUi->ActivateLocalViewL(KIRMainChoiceViewID); |
|
334 } |
|
335 } |
|
336 |
|
337 else if(viewStack.Count() >2 ) |
|
338 { |
|
339 CIRBaseView::HandleCommandL( aCommand ); |
|
340 } |
|
341 else |
|
342 { |
|
343 viewStack.Pop(); |
|
344 appUi->ActivateLocalViewL(KIRMainChoiceViewID); |
|
345 } |
|
346 } |
|
347 } |
|
348 break; |
|
349 default: |
|
350 { |
|
351 CIRBaseView::HandleCommandL( aCommand ); |
|
352 } |
|
353 break; |
|
354 } |
|
355 IRLOG_DEBUG( "CIRStationDirectoryView::HandleCommandL - Exiting" ); |
|
356 } |
|
357 |
|
358 // --------------------------------------------------------------------------- |
|
359 // From class CAknView. |
|
360 // Foreground event handling function. |
|
361 // --------------------------------------------------------------------------- |
|
362 // |
|
363 void CIRStationDirectoryView::HandleForegroundEventL( TBool aForeground ) |
|
364 { |
|
365 IRLOG_DEBUG( "CIRStationDirectoryView::HandleForegroundEventL - Entering" ); |
|
366 |
|
367 CIRBaseView::HandleForegroundEventL( aForeground ); |
|
368 if ( aForeground ) |
|
369 { |
|
370 if ( iContainer ) |
|
371 { |
|
372 iContainer->DrawDeferred(); |
|
373 } |
|
374 } |
|
375 IRLOG_DEBUG( "CIRStationDirectoryView::HandleForegroundEventL - Exiting" ); |
|
376 } |
|
377 |
|
378 // --------------------------------------------------------------------------- |
|
379 // CIRStationDirectoryView::DoCategoryRequestL() |
|
380 // |
|
381 // --------------------------------------------------------------------------- |
|
382 // |
|
383 void CIRStationDirectoryView::DoCategoryRequestL() |
|
384 { |
|
385 IRLOG_DEBUG( "CIRStationDirectoryView::DoCategoryRequestL - Entering" ); |
|
386 iLoadingCancelled = EFalse; |
|
387 TInt currentIndex = iContainer->GetCurrentItemIndex(); |
|
388 if(currentIndex >= 0) |
|
389 { |
|
390 switch (currentIndex) |
|
391 { |
|
392 // if the browse by genre's is selected. |
|
393 case EGenreData: |
|
394 { |
|
395 iIsdsWrapper->IsdsCategoryRequestL(this,CIRIsdsClient::EGenre); |
|
396 iUi->iCategoryView->iCategoryReqMade = ETrue; |
|
397 } |
|
398 break; |
|
399 // if the browse by language's is selected. |
|
400 case ELanguageData: |
|
401 { |
|
402 iIsdsWrapper->IsdsCategoryRequestL(this,CIRIsdsClient::ELanguages); |
|
403 iUi->iCategoryView->iCategoryReqMade = ETrue; |
|
404 } |
|
405 break; |
|
406 // if the browse by country is selected. |
|
407 case ECountryData: |
|
408 { |
|
409 iIsdsWrapper->IsdsCategoryRequestL(this,CIRIsdsClient::ECountries); |
|
410 iUi->iCategoryView->iCategoryReqMade = ETrue; |
|
411 } |
|
412 break; |
|
413 // if top station's is selected. |
|
414 case ETopStationData: |
|
415 { |
|
416 iIsdsWrapper->IsdsCategoryRequestL(this,CIRIsdsClient::Ehotpicks); |
|
417 iUi->iTopStationsView->iResultsReqMade = ETrue; |
|
418 } |
|
419 break; |
|
420 default: |
|
421 { |
|
422 //No implementation |
|
423 } |
|
424 break; |
|
425 } |
|
426 } |
|
427 IRLOG_DEBUG( "CIRStationDirectoryView::DoCategoryRequestL - Exiting" ); |
|
428 } |
|
429 |
|
430 // --------------------------------------------------------------------------- |
|
431 // void CIRStationDirectoryView::ResponseL() |
|
432 // Activates the SearchResults view after getting the IsdsResponse |
|
433 // --------------------------------------------------------------------------- |
|
434 // |
|
435 void CIRStationDirectoryView::ResponseL( CIRIsdsPreset* /*aPreset*/ ) |
|
436 { |
|
437 IRLOG_DEBUG( "CIRStationDirectoryView::ResponseL - Entering" ); |
|
438 ResetPendingRequests(EFalse); |
|
439 if(!iLoadingCancelled) |
|
440 { |
|
441 TInt currentIndex = iContainer->GetCurrentItemIndex(); |
|
442 if(currentIndex >= 0) |
|
443 { |
|
444 switch (currentIndex) |
|
445 { |
|
446 // if the browse by genre's is selected. |
|
447 case EGenreData: |
|
448 { |
|
449 iUi->iCategoryViewTitleType = EGenreData; |
|
450 ActivateCategoryViewL(); |
|
451 } |
|
452 break; |
|
453 // if the browse by language's is selected. |
|
454 case ELanguageData: |
|
455 { |
|
456 iUi->iCategoryViewTitleType = ELanguageData; |
|
457 ActivateCategoryViewL(); |
|
458 } |
|
459 break; |
|
460 // if the browse by country is selected. |
|
461 case ECountryData: |
|
462 { |
|
463 iUi->iCategoryViewTitleType = ECountryData; |
|
464 ActivateCategoryViewL(); |
|
465 } |
|
466 break; |
|
467 // if top station's is selected. |
|
468 case ETopStationData: |
|
469 { |
|
470 iUi->iCategoryViewTitleType = ETopStationData; |
|
471 TBuf8<2> dummy; |
|
472 TVwsViewId viewId(TUid::Uid(KUIDIRAPP),KIRTopStationsViewId); |
|
473 if(iUi->IsForeground()) |
|
474 { |
|
475 AppUi()->ActivateViewL(viewId ,TUid::Uid(1),dummy); |
|
476 iUi->iActivationPending = KNullUid ; |
|
477 } |
|
478 else |
|
479 { |
|
480 iUi->iActivationPending =KIRTopStationsViewId; |
|
481 } |
|
482 } |
|
483 break; |
|
484 default: |
|
485 { |
|
486 //No implementation |
|
487 } |
|
488 break; |
|
489 } |
|
490 } |
|
491 } |
|
492 IRLOG_DEBUG( "CIRStationDirectoryView::ResponseL - Exiting" ); |
|
493 } |
|
494 // --------------------------------------------------------------------------- |
|
495 // void CIRStationDirectoryView::ActivateCategoryViewL() |
|
496 // Activates the Category view |
|
497 // --------------------------------------------------------------------------- |
|
498 // |
|
499 void CIRStationDirectoryView::ActivateCategoryViewL() |
|
500 { |
|
501 IRLOG_DEBUG( "CIRStationDirectoryView::ActivateCategoryViewL - Entering" ); |
|
502 CIRUi* appUi = static_cast< CIRUi*>(AppUi()); |
|
503 TBuf8<2> dummy; |
|
504 TVwsViewId viewId(TUid::Uid(KUIDIRAPP),KIRCategoryViewId); |
|
505 |
|
506 if(appUi->IsForeground()) |
|
507 { |
|
508 AppUi()->ActivateViewL(viewId ,TUid::Uid(1),dummy); |
|
509 appUi->iActivationPending = KNullUid ; |
|
510 } |
|
511 else |
|
512 { |
|
513 appUi->iActivationPending =KIRCategoryViewId; |
|
514 } |
|
515 IRLOG_DEBUG( "CIRStationDirectoryView::ActivateCategoryViewL - Exiting" ); |
|
516 |
|
517 } |
|
518 // --------------------------------------------------------------------------- |
|
519 // void CIRStationDirectoryView::PresetResponseL() |
|
520 // Issues Request to listen to a particular channel |
|
521 // --------------------------------------------------------------------------- |
|
522 // |
|
523 void CIRStationDirectoryView::PresetResponseL(CIRIsdsPreset* /*aPreset*/) |
|
524 { |
|
525 IRLOG_DEBUG( "CIRStationDirectoryView::PresetResponseL - Entering" ); |
|
526 |
|
527 //No Implementation Required |
|
528 |
|
529 IRLOG_DEBUG( "CIRStationDirectoryView::PresetResponseL - Exiting" ); |
|
530 } |
|
531 // --------------------------------------------------------------------------- |
|
532 // void CIRStationDirectoryView::ErrorL() |
|
533 // Handles the errors from Isds |
|
534 // --------------------------------------------------------------------------- |
|
535 // |
|
536 void CIRStationDirectoryView::ErrorL() |
|
537 { |
|
538 IRLOG_DEBUG( "CIRStationDirectoryView::ErrorL - Entering" ); |
|
539 if(iIsdsWrapper->iConnTimeOut) |
|
540 { |
|
541 iIsdsWrapper->iConnTimeOut = EFalse; |
|
542 } |
|
543 IRLOG_DEBUG( "CIRStationDirectoryView::ErrorL - Exiting" ); |
|
544 } |
|
545 |
|
546 // --------------------------------------------------------------------------- |
|
547 // void CIRStationDirectoryView::DynInitMenuPaneL() |
|
548 // Dynamically initialises a menu pane |
|
549 // --------------------------------------------------------------------------- |
|
550 // |
|
551 void CIRStationDirectoryView::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane) |
|
552 { |
|
553 IRLOG_DEBUG( "CIRStationDirectoryView::DynInitMenuPaneL - Entering" ); |
|
554 CIRUi* appUi = static_cast<CIRUi*>( AppUi() ); |
|
555 |
|
556 if(!aMenuPane) User::Leave(KErrNotFound); |
|
557 { |
|
558 if(aResourceId == R_IR_STATION_DIRECTORY_MENU) |
|
559 { |
|
560 // Now Playing option |
|
561 if(iNowPlayingWrapper->iPlaying) |
|
562 { |
|
563 aMenuPane->SetItemDimmed(EGotoNowPlayingViewCmd,EFalse); |
|
564 } |
|
565 else |
|
566 { |
|
567 aMenuPane->SetItemDimmed(EGotoNowPlayingViewCmd,ETrue); |
|
568 } |
|
569 } |
|
570 } |
|
571 IRLOG_DEBUG( "CIRStationDirectoryView::DynInitMenuPaneL - Exiting" ); |
|
572 } |
|
573 // --------------------------------------------------------------------------- |
|
574 //Notifies all observers whose network request is active |
|
575 // to reissue the request |
|
576 //NotifyActiveNetworkObserversL() |
|
577 // --------------------------------------------------------------------------- |
|
578 |
|
579 void CIRStationDirectoryView::NotifyActiveNetworkObserversL(TIRNetworkEvent aEvent) |
|
580 { |
|
581 IRLOG_DEBUG( "CIRStationDirectoryView::NotifyActiveNetworkObserversL - Entering" ); |
|
582 IRRDEBUG2("CIRStationDirectoryView::NotifyActiveNetworkObserversL entering ", KNullDesC); |
|
583 |
|
584 switch(aEvent) |
|
585 { |
|
586 case ENetworkConnectionDisconnected: |
|
587 { |
|
588 iNowPlayingWrapper->HandleNetworkDisconnected(); |
|
589 } |
|
590 break; |
|
591 case ENetworkConnectionEstablished: |
|
592 { |
|
593 if(iContainer) |
|
594 { |
|
595 if(iRequestPending) |
|
596 { |
|
597 iRequestIssued = ETrue; |
|
598 SetCurrentFocus(iContainer->GetCurrentItemIndex()); |
|
599 iRequestPending=EFalse; |
|
600 DoCategoryRequestL(); |
|
601 } |
|
602 |
|
603 if(iUi->iNetworkController->IsHandingOverConnection()) |
|
604 { |
|
605 if(iRequestIssued) |
|
606 { |
|
607 iRequestIssued=EFalse; |
|
608 SetCurrentFocus(iContainer->GetCurrentItemIndex()); |
|
609 DoCategoryRequestL(); |
|
610 } |
|
611 } |
|
612 } |
|
613 } |
|
614 } |
|
615 |
|
616 IRLOG_DEBUG( "CIRStationDirectoryView::NotifyActiveNetworkObserversL - Exiting" ); |
|
617 IRRDEBUG2("CIRStationDirectoryView::NotifyActiveNetworkObserversL exiting ", KNullDesC); |
|
618 |
|
619 } |
|
620 |
|
621 |
|
622 |
|
623 |
|
624 // ----------------------------------------------------------------------------- |
|
625 // Notified by network controller when user cancels network connection, to reset |
|
626 // the pending requests |
|
627 // ResetPendingRequests() |
|
628 // ----------------------------------------------------------------------------- |
|
629 void CIRStationDirectoryView::ResetPendingRequests(TBool aValue) |
|
630 { |
|
631 iRequestPending = aValue; |
|
632 iRequestIssued = aValue; |
|
633 } |
|
634 |
|
635 // --------------------------------------------------------- |
|
636 // CIRStationDirectoryView::HandleSystemEventL |
|
637 // from base class MIRSystemEventObserver |
|
638 // --------------------------------------------------------- |
|
639 // |
|
640 void CIRStationDirectoryView::HandleSystemEventL(TIRSystemEventType aEventType) |
|
641 { |
|
642 IRLOG_DEBUG(" CIRStationDirectoryView::HandleSystemEventL - Entering"); |
|
643 |
|
644 switch (aEventType) |
|
645 { |
|
646 case EIRCallActivated: |
|
647 { |
|
648 if( iUi->GetNetworkControllerInstance()->IdentifyConnectionType() != EWiFi ) |
|
649 { |
|
650 if(iUi->iIsdsWrapper->iIsdsWaitDialog) |
|
651 { |
|
652 TRAP_IGNORE( iUi->iIsdsWrapper->DestroyWaitDialogL() ); |
|
653 } |
|
654 if(!iCallRequestPending && iCommand==ESelectCmd) |
|
655 { |
|
656 iUi->iIsdsWrapper->IsdsCancelRequest(); |
|
657 iCallRequestPending = ETrue; |
|
658 } |
|
659 } |
|
660 break; |
|
661 } |
|
662 case EIRCallDeactivated: |
|
663 { |
|
664 if(iCallRequestPending && iCommand==ESelectCmd) |
|
665 { |
|
666 iCallRequestPending = EFalse; |
|
667 HandleCommandL( iCommand ); |
|
668 } |
|
669 break; |
|
670 } |
|
671 default: |
|
672 { |
|
673 break; |
|
674 } |
|
675 } |
|
676 IRLOG_DEBUG( "CIRStationDirectoryView::HandleSystemEventL - Exiting." ); |
|
677 } |
|
678 // --------------------------------------------------------------------------- |
|
679 // void CIRStationDirectoryView::IssueSearchRequestL() |
|
680 // Issues a search request to the Isds Client |
|
681 // --------------------------------------------------------------------------- |
|
682 // |
|
683 void CIRStationDirectoryView::RefreshView() |
|
684 { |
|
685 IRLOG_DEBUG( "CIRStationDirectoryView::IssueSearchRequestL - Entering" ); |
|
686 if ( iContainer ) |
|
687 { |
|
688 iContainer->SetRect( ClientRect() ); |
|
689 } |
|
690 IRLOG_DEBUG( "CIRStationDirectoryView::IssueSearchRequestL - Exiting" ); |
|
691 } |
|
692 // End of file |