idlehomescreen/xmluirendering/uiengine/src/xnappuiadapterimpl.cpp
branchRCL_3
changeset 34 d05a55b217df
parent 15 ff572dfe6d86
child 47 7be2816dbabd
equal deleted inserted replaced
30:b8fae6b8a148 34:d05a55b217df
    20 #include <hscontentcontroller.h>
    20 #include <hscontentcontroller.h>
    21 #include <hscontentcontrolui.h>
    21 #include <hscontentcontrolui.h>
    22 #include <hspluginsettings.h>
    22 #include <hspluginsettings.h>
    23 #include <bautils.h>
    23 #include <bautils.h>
    24 #include <data_caging_path_literals.hrh>
    24 #include <data_caging_path_literals.hrh>
       
    25 #include <connect/sbdefs.h>
       
    26 #include <e32property.h>
       
    27 #include <xnuiengine.rsg>
    25 
    28 
    26 // User includes
    29 // User includes
    27 #include "xnappuiadapter.h"
    30 #include "xnappuiadapter.h"
    28 #include "xnuiengine.h"
    31 #include "xnuiengine.h"
    29 #include "xnviewmanager.h"
    32 #include "xnviewmanager.h"
    32 #include "xnbackgroundmanager.h"
    35 #include "xnbackgroundmanager.h"
    33 #include "hscontentcontrolfactory.h"
    36 #include "hscontentcontrolfactory.h"
    34 #include "xneditor.h"
    37 #include "xneditor.h"
    35 #include "xnwallpaperview.h"
    38 #include "xnwallpaperview.h"
    36 #include "xneffectmanager.h"
    39 #include "xneffectmanager.h"
       
    40 #include "xnwaitdialog.h"
    37 
    41 
    38 #include "xnappuiadapterimpl.h"
    42 #include "xnappuiadapterimpl.h"
    39 
    43 
    40 #include "debug.h"
    44 #include "debug.h"
    41 
    45 
   119     iAdapter.AddViewL( wallpaper );
   123     iAdapter.AddViewL( wallpaper );
   120     CleanupStack::Pop( wallpaper );
   124     CleanupStack::Pop( wallpaper );
   121     
   125     
   122     iEffectManager = CXnEffectManager::NewL();   
   126     iEffectManager = CXnEffectManager::NewL();   
   123     
   127     
       
   128     iBackupRestoreObserver = CXnPropertySubscriber::NewL( 
       
   129             KUidSystemCategory, conn::KUidBackupRestoreKey, *this );
       
   130 
   124     __TIME_ENDMARK( "CXnAppUiAdapterImpl::ConstructL, done", time );    
   131     __TIME_ENDMARK( "CXnAppUiAdapterImpl::ConstructL, done", time );    
   125     }
   132     }
   126 
   133 
   127 // -----------------------------------------------------------------------------
   134 // -----------------------------------------------------------------------------
   128 // CXnAppUiAdapterImpl::ReloadUiL
   135 // CXnAppUiAdapterImpl::ReloadUiL
   145 // Destructor
   152 // Destructor
   146 //
   153 //
   147 // -----------------------------------------------------------------------------
   154 // -----------------------------------------------------------------------------
   148 //
   155 //
   149 CXnAppUiAdapterImpl::~CXnAppUiAdapterImpl()
   156 CXnAppUiAdapterImpl::~CXnAppUiAdapterImpl()
   150     {  
   157     {
       
   158     if ( iXnWaitDialog )
       
   159         {
       
   160         TRAP_IGNORE( iXnWaitDialog->ProcessFinishedL(); );
       
   161         }
       
   162     
       
   163     delete iBackupRestoreObserver;
       
   164     
   151     delete iUiEngine;
   165     delete iUiEngine;
   152     
   166     
   153     delete iUiStateListener;
   167     delete iUiStateListener;
   154            
   168            
   155     delete iViewManager;
   169     delete iViewManager;
   254 void CXnAppUiAdapterImpl::HandleResourceChangeL( TInt aType )
   268 void CXnAppUiAdapterImpl::HandleResourceChangeL( TInt aType )
   255     {
   269     {
   256     iUiStateListener->HandleResourceChangeL( aType );    
   270     iUiStateListener->HandleResourceChangeL( aType );    
   257     }
   271     }
   258 
   272 
       
   273 // -----------------------------------------------------------------------------
       
   274 // CXnAppUiAdapterImpl::DisplayWaitDialogL
       
   275 // Displays wait dialog during backup/restore. 
       
   276 // -----------------------------------------------------------------------------
       
   277 //
       
   278 void CXnAppUiAdapterImpl::DisplayWaitDialogL()
       
   279     {
       
   280     if ( !iXnWaitDialog )
       
   281        {
       
   282        iXnWaitDialog = new( ELeave ) CXnWaitDialog(
       
   283                reinterpret_cast<CEikDialog**>( &iXnWaitDialog ), ETrue );       
       
   284        iXnWaitDialog->SetCallback( this );
       
   285        iXnWaitDialog->ExecuteLD( R_BACKUP_RESTORE_WAIT_DIALOG );
       
   286        }
       
   287     }
       
   288 
       
   289 // -----------------------------------------------------------------------------
       
   290 // CXnAppUiAdapterImpl::BackupRestoreEvent
       
   291 // Property changed notification callback
       
   292 // -----------------------------------------------------------------------------
       
   293 //
       
   294 void CXnAppUiAdapterImpl::PropertyChangedL( const TUint32 aKey, const TInt aValue )
       
   295     {
       
   296     const TUint mask( conn::KBURPartTypeMask ^ conn::EBURNormal );
       
   297     if ( aKey == conn::KUidBackupRestoreKey )
       
   298         {
       
   299         if ( aValue & mask )
       
   300             {
       
   301             // Any type of backup or restore operation started
       
   302             DisplayWaitDialogL();
       
   303             }
       
   304         else if ( iXnWaitDialog )
       
   305             {
       
   306             // Any type of backup or restore operation ended
       
   307             iXnWaitDialog->ProcessFinishedL();
       
   308             // ProcessFinishedL() will NULL iXnWaitDialog
       
   309             }
       
   310         }
       
   311     }
       
   312 
       
   313 // ----------------------------------------------------------------------------
       
   314 // CXnAppUiAdapterImpl::DialogDismissedL()
       
   315 // Callback method from MProgressDialogCallback interface.
       
   316 // ----------------------------------------------------------------------------
       
   317 //
       
   318 void CXnAppUiAdapterImpl::DialogDismissedL(TInt /*aButtonId*/)
       
   319     {
       
   320     // No implementation required.
       
   321     }
       
   322 
   259 // End of file
   323 // End of file