widgets/widgetapp/src/WidgetUiAppUi.cpp
branchRCL_3
changeset 93 79859ed3eea9
parent 91 30342f40acbf
child 94 919f36ff910f
equal deleted inserted replaced
92:e1bea15f9a39 93:79859ed3eea9
    22 #include "WidgetUiWindow.h"
    22 #include "WidgetUiWindow.h"
    23 #include "WidgetUiAsyncExit.h"
    23 #include "WidgetUiAsyncExit.h"
    24 #include "widgetappdefs.rh"
    24 #include "widgetappdefs.rh"
    25 #include <WidgetUi.rsg>
    25 #include <WidgetUi.rsg>
    26 #include "WidgetUi.hrh"
    26 #include "WidgetUi.hrh"
    27 #include <S32MEM.H>
    27 #include <s32mem.h>
    28 #include <avkon.hrh>
    28 #include <avkon.hrh>
    29 #include <e32std.h>
    29 #include <e32std.h>
    30 #include <bautils.h>
    30 #include <bautils.h>
    31 #include <oommonitorplugin.h>
    31 #include <oommonitorplugin.h>
    32 #include <browserdialogsprovider.h>
    32 #include <BrowserDialogsProvider.h>
    33 #include <e32property.h>
    33 #include <e32property.h>
    34 
    34 
    35 #ifdef BRDO_WRT_HS_FF
    35 #ifdef BRDO_WRT_HS_FF
    36 #include <AknToolbar.h>
    36 #include <akntoolbar.h>
    37 #endif
    37 #endif
    38 
    38 
    39 // EXTERNAL DATA STRUCTURES
    39 // EXTERNAL DATA STRUCTURES
    40 
    40 
    41 // EXTERNAL FUNCTION PROTOTYPES
    41 // EXTERNAL FUNCTION PROTOTYPES
   286 void CWidgetUiAppUi::HandleResourceChangeL( TInt aType )
   286 void CWidgetUiAppUi::HandleResourceChangeL( TInt aType )
   287     {
   287     {
   288     CAknViewAppUi::HandleResourceChangeL( aType );
   288     CAknViewAppUi::HandleResourceChangeL( aType );
   289     if ( aType == KEikDynamicLayoutVariantSwitch && iWindowManager && iWindowManager->ActiveWindow())
   289     if ( aType == KEikDynamicLayoutVariantSwitch && iWindowManager && iWindowManager->ActiveWindow())
   290         {
   290         {
   291         iWindowManager->ActiveWindow()->RelayoutL( aType );
   291         iWindowManager->ActiveWindow()->Relayout();
   292         }
   292         }
   293     }
   293     }
   294 
   294 
   295 // ------------------------------------------------------------------------------
   295 // ------------------------------------------------------------------------------
   296 // CWidgetUiAppUi::HandleWsEventL
   296 // CWidgetUiAppUi::HandleWsEventL
   302     const TWsEvent& aEvent, CCoeControl* aDestination )
   302     const TWsEvent& aEvent, CCoeControl* aDestination )
   303     {
   303     {
   304 
   304 
   305     if ( aEvent.Type() == KAknUidValueEndKeyCloseEvent )
   305     if ( aEvent.Type() == KAknUidValueEndKeyCloseEvent )
   306         {
   306         {
   307         	
       
   308 #ifdef BRDO_MULTITOUCH_ENABLED_FF
       
   309         if( IsDisplayingDialog() ) 
       
   310         	   {
       
   311              //Get the top dialog
       
   312              CCoeControl* control = TopFocusedControl();
       
   313              delete control;
       
   314              control = NULL;
       
   315              }
       
   316 #endif
       
   317         // Close the current active widget
   307         // Close the current active widget
   318         iWindowManager->CloseWindowsAsync(EFalse);
   308         iWindowManager->CloseWindowsAsync(EFalse);
   319         return;
   309         return;
   320         }
   310         }
   321 
   311 
   386         {
   376         {
   387         if(aEventType == KAppOomMonitor_FreeRam )
   377         if(aEventType == KAppOomMonitor_FreeRam )
   388             {            
   378             {            
   389 #ifdef OOM_WIDGET_CLOSEALL            
   379 #ifdef OOM_WIDGET_CLOSEALL            
   390             CloseAllWidgetsAndExit();
   380             CloseAllWidgetsAndExit();
   391 #else //if    OOM_WIDGET_CLOSEALL        
   381 #else if    // OOM_WIDGET_CLOSEALL        
   392             iWindowManager->HandleOOMEventL(iIsForeground);
   382             iWindowManager->HandleOOMEventL(iIsForeground);
   393             CloseAndExitIfNoneLeft();
   383             CloseAndExitIfNoneLeft();
   394 #endif            
   384 #endif            
   395             }
   385             }
   396         }
   386         }
   408     TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
   398     TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
   409     TUid wapUid( TUid::Uid( KWidgetAppUid ) );
   399     TUid wapUid( TUid::Uid( KWidgetAppUid ) );
   410     TApaTask task = taskList.FindApp( wapUid );
   400     TApaTask task = taskList.FindApp( wapUid );
   411     task.SendToBackground();
   401     task.SendToBackground();
   412     }
   402     }
   413    
   403     
   414    
       
   415 // -----------------------------------------------------------------------------
       
   416 // CWidgetUiAppUi::SendAppToForeground
       
   417 // force the application to the foreground
       
   418 //
       
   419 // -----------------------------------------------------------------------------
       
   420 //
       
   421 void CWidgetUiAppUi::SendAppToForeground()
       
   422     {
       
   423     TApaTaskList taskList( CEikonEnv::Static()->WsSession() );
       
   424     TUid wapUid( TUid::Uid( KWidgetAppUid ) );
       
   425     TApaTask task = taskList.FindApp( wapUid );
       
   426     task.BringToForeground();
       
   427     }
       
   428         
       
   429 // -----------------------------------------------------------------------------
   404 // -----------------------------------------------------------------------------
   430 // CWidgetUiAppUi::SetRotationSupport()
   405 // CWidgetUiAppUi::SetRotationSupport()
   431 // check to see if screen oriantation can be changed
   406 // check to see if screen oriantation can be changed
   432 // this code must match Widget::Widget in WidgetEngine
   407 // this code must match Widget::Widget in WidgetEngine
   433 //
   408 //
   566     const TDesC8& aLine,
   541     const TDesC8& aLine,
   567     TUid& aUid,
   542     TUid& aUid,
   568     TUint32& aOperation )
   543     TUint32& aOperation )
   569     {
   544     {
   570     __UHEAP_MARK;
   545     __UHEAP_MARK;
   571     TUint32 version( 0 );
   546     TUint32 version( -1 );
   572     TPtrC ptr( NULL, 0 );
   547     TPtrC ptr( NULL, 0 );
   573     
   548     
   574     RDesReadStream stream( aLine );
   549     RDesReadStream stream( aLine );
   575     CleanupClosePushL( stream );
   550     CleanupClosePushL( stream );
   576     
   551