23 #include "WidgetUiAppUi.h" |
23 #include "WidgetUiAppUi.h" |
24 #include "WidgetUiNetworkListener.h" |
24 #include "WidgetUiNetworkListener.h" |
25 #include "WidgetInstallerInternalCRKeys.h" |
25 #include "WidgetInstallerInternalCRKeys.h" |
26 #include "SWInstWidgetUid.h" |
26 #include "SWInstWidgetUid.h" |
27 #include "widgetappdefs.rh" |
27 #include "widgetappdefs.rh" |
28 #include "Browser_platform_variant.hrh" |
28 #include "browser_platform_variant.hrh" |
29 #ifdef BRDO_WRT_HS_FF |
29 #ifdef BRDO_WRT_HS_FF |
30 #include "cpspublisher.h" |
30 #include "cpspublisher.h" |
31 #endif |
31 #endif |
32 |
32 |
33 #include <WidgetUi.rsg> |
33 #include <WidgetUi.rsg> |
34 #include <BrCtlInterface.h> |
34 #include <brctlinterface.h> |
35 #include <WidgetRegistryConstants.h> |
35 #include <widgetregistryconstants.h> |
36 #include <centralrepository.h> |
36 #include <centralrepository.h> |
37 #include <StringLoader.h> |
37 #include <StringLoader.h> |
38 #include <AknNoteDialog.h> |
38 #include <AknNoteDialog.h> |
39 #include <BrowserDialogsProvider.h> |
39 #include <browserdialogsprovider.h> |
40 #include <S32FILE.H> |
40 #include <S32FILE.H> |
41 #include <aknnotewrappers.h> |
41 #include <aknnotewrappers.h> |
42 #include "cpglobals.h" // CPS string definitions. |
42 #include "cpglobals.h" // CPS string definitions. |
43 |
43 |
44 #include <InternetConnectionManager.h> |
44 #include <internetconnectionmanager.h> |
45 #include <ActiveApDb.h> |
45 #include <ActiveApDb.h> |
46 #include <oommonitorsession.h> |
46 #include <oommonitorsession.h> |
47 #include <aknglobalnote.h> |
47 #include <aknglobalnote.h> |
48 |
48 |
49 // LOCAL FUNCTION PROTOTYPES |
49 // LOCAL FUNCTION PROTOTYPES |
341 break; |
341 break; |
342 case WidgetOnline: |
342 case WidgetOnline: |
343 { |
343 { |
344 iNetworkMode = EOnlineMode; |
344 iNetworkMode = EOnlineMode; |
345 CWidgetUiWindow* wdgt_window( GetWindow( aUid ) ); |
345 CWidgetUiWindow* wdgt_window( GetWindow( aUid ) ); |
|
346 if (wdgt_window) |
|
347 { |
346 #ifdef BRDO_WRT_HS_FF |
348 #ifdef BRDO_WRT_HS_FF |
347 if ( wdgt_window->NetworkModeWait()->IsStarted() ) |
349 if ( wdgt_window->NetworkModeWait()->IsStarted() ) |
348 { |
350 { |
349 wdgt_window->NetworkModeWait()->AsyncStop(); |
351 wdgt_window->NetworkModeWait()->AsyncStop(); |
|
352 } |
|
353 #endif |
|
354 wdgt_window->DetermineNetworkState(); |
350 } |
355 } |
351 #endif |
|
352 wdgt_window->DetermineNetworkState(); |
|
353 } |
356 } |
354 break; |
357 break; |
355 case WidgetOffline: |
358 case WidgetOffline: |
356 { |
359 { |
357 iNetworkMode = EOfflineMode; |
360 iNetworkMode = EOfflineMode; |
358 CWidgetUiWindow* wdgt_window( GetWindow( aUid ) ); |
361 CWidgetUiWindow* wdgt_window( GetWindow( aUid ) ); |
|
362 if (wdgt_window) |
|
363 { |
359 #ifdef BRDO_WRT_HS_FF |
364 #ifdef BRDO_WRT_HS_FF |
360 if ( wdgt_window->NetworkModeWait()->IsStarted() ) |
365 if ( wdgt_window->NetworkModeWait()->IsStarted() ) |
361 { |
366 { |
362 wdgt_window->NetworkModeWait()->AsyncStop(); |
367 wdgt_window->NetworkModeWait()->AsyncStop(); |
|
368 } |
|
369 #endif |
|
370 // if no full view widgets open, then close the network connection |
|
371 if ( ( !FullViewWidgetsOpen() ) && ( iConnection->Connected() ) ) |
|
372 { |
|
373 wdgt_window->Engine()->HandleCommandL( |
|
374 (TInt)TBrCtlDefs::ECommandIdBase + |
|
375 (TInt)TBrCtlDefs::ECommandDisconnect ); |
|
376 iConnection->StopConnectionL(); |
|
377 } |
|
378 wdgt_window->DetermineNetworkState(); |
363 } |
379 } |
364 #endif |
|
365 // if no full view widgets open, then close the network connection |
|
366 if ( ( !FullViewWidgetsOpen() ) && ( iConnection->Connected() ) ) |
|
367 { |
|
368 wdgt_window->Engine()->HandleCommandL( |
|
369 (TInt)TBrCtlDefs::ECommandIdBase + |
|
370 (TInt)TBrCtlDefs::ECommandDisconnect ); |
|
371 iConnection->StopConnectionL(); |
|
372 } |
|
373 wdgt_window->DetermineNetworkState(); |
|
374 } |
380 } |
375 break; |
381 break; |
376 case WidgetRestart: |
382 case WidgetRestart: |
377 { |
383 { |
378 OpenOrCreateWindowL( aUid, LaunchMiniview ); |
384 OpenOrCreateWindowL( aUid, LaunchMiniview ); |
995 (TInt)TBrCtlDefs::ECommandAppForeground + |
1001 (TInt)TBrCtlDefs::ECommandAppForeground + |
996 (TInt)TBrCtlDefs::ECommandIdBase); |
1002 (TInt)TBrCtlDefs::ECommandIdBase); |
997 #ifdef BRDO_WRT_HS_FF |
1003 #ifdef BRDO_WRT_HS_FF |
998 wdgt_window->Engine()->MakeVisible( EFalse ); |
1004 wdgt_window->Engine()->MakeVisible( EFalse ); |
999 wdgt_window->Engine()->SetRect( iCpsPublisher->BitmapSize()); |
1005 wdgt_window->Engine()->SetRect( iCpsPublisher->BitmapSize()); |
|
1006 //When HS comes to foreground show the latest updatd content on HS. |
|
1007 //Relayout can sometimes happen only when widget in FullView. |
|
1008 wdgt_window->PublishSnapShot(); |
1000 #endif |
1009 #endif |
1001 } |
1010 } |
1002 } |
1011 } |
1003 |
1012 |
1004 // ----------------------------------------------------------------------------- |
1013 // ----------------------------------------------------------------------------- |
1395 iWidgetUiWindowManager->StartHarvesterNotifyTimer(); |
1404 iWidgetUiWindowManager->StartHarvesterNotifyTimer(); |
1396 } |
1405 } |
1397 else |
1406 else |
1398 { |
1407 { |
1399 NotifyCommandHandled(); |
1408 NotifyCommandHandled(); |
|
1409 TBool lastOne( iWidgetUiWindowManager->WindowListCount() == 0 ); |
|
1410 if( lastOne ) |
|
1411 { |
|
1412 iWidgetUiWindowManager->AppUi().Exit(); |
|
1413 } |
1400 iWidgetUiWindowManager->SendAppToBackground(); |
1414 iWidgetUiWindowManager->SendAppToBackground(); |
1401 iWidgetUiWindowManager->WidgetUIClientSession().SetActive( iUid, EFalse ); |
1415 iWidgetUiWindowManager->WidgetUIClientSession().SetActive( iUid, EFalse ); |
1402 } |
1416 } |
1403 delete this; |
1417 delete this; |
1404 } |
1418 } |