idlefw/src/framework/aistateprovider.cpp
branchRCL_3
changeset 14 15e4dd19031c
parent 11 bd874ee5e5e2
child 19 edd621764147
equal deleted inserted replaced
12:502e5d91ad42 14:15e4dd19031c
    17 
    17 
    18 // System includes
    18 // System includes
    19 #include <AknDef.h>
    19 #include <AknDef.h>
    20 #include <connect/sbdefs.h>
    20 #include <connect/sbdefs.h>
    21 #include <e32property.h>
    21 #include <e32property.h>
       
    22 #include <swi/swispubsubdefs.h>
       
    23 #include <swi/swiutils.h>
       
    24 #include <sacls.h> // KSWIUidsCurrentlyBeingProcessed
    22 
    25 
    23 // User includes
    26 // User includes
    24 #include <aipspropertyobserver.h>
    27 #include <aipspropertyobserver.h>
    25 #include <aiutility.h>
    28 #include <aiutility.h>
    26 #include <aifwdefs.h>
    29 #include <aifwdefs.h>
    27 #include "aiecomobserver.h"
    30 #include "aiecomobserver.h"
    28 #include "aistateobserver.h"
    31 #include "aistateobserver.h"
    29 
    32 
    30 #include "aistateprovider.h"
    33 #include "aistateprovider.h"
    31 
    34 
       
    35 #include "debug.h"
       
    36 
    32 // Constants
    37 // Constants
    33 
    38 
    34 // ======== LOCAL FUNCTIONS ========
    39 // ======== LOCAL FUNCTIONS ========
    35 
    40 
    36 // ======== MEMBER FUNCTIONS ========
    41 // ======== MEMBER FUNCTIONS ========
   111         iLightObserver = CHWRMLight::NewL( this );
   116         iLightObserver = CHWRMLight::NewL( this );
   112         
   117         
   113         iBackupRestoreObserver = AiUtility::CreatePSPropertyObserverL(
   118         iBackupRestoreObserver = AiUtility::CreatePSPropertyObserverL(
   114             TCallBack( BackupRestoreEvent, this ),
   119             TCallBack( BackupRestoreEvent, this ),
   115             KUidSystemCategory, conn::KUidBackupRestoreKey );
   120             KUidSystemCategory, conn::KUidBackupRestoreKey );
   116         
   121 
       
   122         iSwiUidListObserver = AiUtility::CreatePSPropertyObserverL(
       
   123                 TCallBack( SwiUidListEvent, this ),
       
   124                 KUidSystemCategory, KSWIUidsCurrentlyBeingProcessed );
       
   125 
   117         User::LeaveIfError( iSkinSrv.Connect( this ) );
   126         User::LeaveIfError( iSkinSrv.Connect( this ) );
   118            
   127            
   119         iEcomObserver = CAiEcomObserver::NewL();
   128         iEcomObserver = CAiEcomObserver::NewL();
   120         iEcomObserver->AddObserverL( this );
   129         iEcomObserver->AddObserverL( this );
   121         
   130         
   150         
   159         
   151         iSkinSrv.Close();
   160         iSkinSrv.Close();
   152                
   161                
   153         Release( iBackupRestoreObserver );
   162         Release( iBackupRestoreObserver );
   154         iBackupRestoreObserver = NULL;
   163         iBackupRestoreObserver = NULL;
   155         
   164 
       
   165         Release( iSwiUidListObserver );
       
   166         iSwiUidListObserver = NULL;
       
   167 
   156         delete iLightObserver;      
   168         delete iLightObserver;      
   157         iLightObserver = NULL;
   169         iLightObserver = NULL;
   158         }           
   170         }           
   159     }
   171     }
   160 
   172 
   236 // 
   248 // 
   237 // ----------------------------------------------------------------------------
   249 // ----------------------------------------------------------------------------
   238 //
   250 //
   239 void CAiStateProvider::NotifyEcomRegistryChanged()
   251 void CAiStateProvider::NotifyEcomRegistryChanged()
   240     {
   252     {
   241     iObserver.NotifyUpdatePlugins();
   253     __PRINTS( "CAiStateProvider::NotifyEcomRegistryChanged" );    
       
   254     iObserver.NotifyReloadPlugins();
       
   255     __PRINTS( "CAiStateProvider::NotifyEcomRegistryChanged - return void" );    
   242     }
   256     }
   243 
   257 
   244 // ----------------------------------------------------------------------------
   258 // ----------------------------------------------------------------------------
   245 // CAiStateProvider::LoadPlugin()
   259 // CAiStateProvider::LoadPlugin()
   246 // 
   260 // 
   275         iObserver.NotifyStateChange( aState );
   289         iObserver.NotifyStateChange( aState );
   276         }
   290         }
   277     }
   291     }
   278 
   292 
   279 // ----------------------------------------------------------------------------
   293 // ----------------------------------------------------------------------------
   280 // CAiStateProvider::OnlineStateInUse()
       
   281 // 
       
   282 // ----------------------------------------------------------------------------
       
   283 //
       
   284 TBool CAiStateProvider::OnlineStateInUse() const
       
   285     {
       
   286     return iObserver.OnlineStateInUse();
       
   287     }
       
   288 
       
   289 // ----------------------------------------------------------------------------
       
   290 // CAiStateProvider::BackupRestoreEvent()
   294 // CAiStateProvider::BackupRestoreEvent()
   291 // 
   295 // 
   292 // ----------------------------------------------------------------------------
   296 // ----------------------------------------------------------------------------
   293 //
   297 //
   294 /* static */ TInt CAiStateProvider::BackupRestoreEvent( TAny* aAny )
   298 /* static */ TInt CAiStateProvider::BackupRestoreEvent( TAny* aAny )
   313         }
   317         }
   314     
   318     
   315     return KErrNone;
   319     return KErrNone;
   316     }
   320     }
   317 
   321 
       
   322 // ----------------------------------------------------------------------------
       
   323 // CAiStateProvider::SwiUidLIstEvent()
       
   324 // 
       
   325 // ----------------------------------------------------------------------------
       
   326 //
       
   327 /* static */ TInt CAiStateProvider::SwiUidListEvent( TAny* aAny )
       
   328     {
       
   329     CAiStateProvider* self = static_cast< CAiStateProvider* >( aAny );
       
   330 
       
   331     RArray<TUid> uidList;
       
   332     if ( KErrNone == Swi::GetAllUids( uidList ) )
       
   333         {
       
   334         self->iObserver.NotifyReleasePlugins( uidList );
       
   335         }
       
   336 
       
   337     return KErrNone;
       
   338     }
       
   339 
   318 // End of file
   340 // End of file
   319 
   341