idlefw/plugins/sapidataplugin/src/sapidataplugin.cpp
changeset 1 844b978f8d5e
parent 0 79c6a41cd166
child 9 d0529222e3f0
equal deleted inserted replaced
0:79c6a41cd166 1:844b978f8d5e
    85 void CSapiDataPlugin::ConstructL()
    85 void CSapiDataPlugin::ConstructL()
    86     { 
    86     { 
    87     iInfo.iUid.iUid = SAPIDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; 
    87     iInfo.iUid.iUid = SAPIDP_UID_ECOM_IMPLEMENTATION_CONTENTPUBLISHER_DATAPLUGIN; 
    88     iPluginState = ENone;
    88     iPluginState = ENone;
    89     iHSForeGround = EFalse;
    89     iHSForeGround = EFalse;
       
    90     iKeyLockOn = EFalse;
    90     iNetworkStatus = EUnknown;
    91     iNetworkStatus = EUnknown;
    91     iData = CSapiData::NewL(this);
    92     iData = CSapiData::NewL(this);
    92 
    93 
    93     }
    94     }
    94     
    95     
   209 // Publishes widget's texts and images
   210 // Publishes widget's texts and images
   210 // ---------------------------------------------------------------------------
   211 // ---------------------------------------------------------------------------
   211 //
   212 //
   212 void CSapiDataPlugin::PublishL()
   213 void CSapiDataPlugin::PublishL()
   213     {
   214     {
   214     TInt err( KErrNone );
       
   215     User::LeaveIfError( iRfs.Connect() );
   215     User::LeaveIfError( iRfs.Connect() );
   216 
   216 
   217     TInt observers( iObservers.Count() );        
   217     TInt observers( iObservers.Count() );        
   218     TInt transactionId = reinterpret_cast<TInt>( this );
   218     TInt transactionId = reinterpret_cast<TInt>( this );
   219 
   219 
   441 //Refresh a specific image of text in the widget
   441 //Refresh a specific image of text in the widget
   442 // ---------------------------------------------------------------------------
   442 // ---------------------------------------------------------------------------
   443 //
   443 //
   444 void CSapiDataPlugin::RefreshL(TDesC& aContentType, TDesC& aOperation)
   444 void CSapiDataPlugin::RefreshL(TDesC& aContentType, TDesC& aOperation)
   445     {
   445     {
   446      TInt err( KErrNone );
       
   447      User::LeaveIfError( iRfs.Connect() );
   446      User::LeaveIfError( iRfs.Connect() );
   448 	 TInt observers( iObservers.Count() );        
   447 	 TInt observers( iObservers.Count() );        
   449 	 TInt transactionId = reinterpret_cast<TInt>( this );
   448 	 TInt transactionId = reinterpret_cast<TInt>( this );
   450 	 
   449 	 
   451 	 for ( TInt obsIndex = 0; obsIndex < observers; obsIndex++ )
   450 	 for ( TInt obsIndex = 0; obsIndex < observers; obsIndex++ )
   520 		{
   519 		{
   521 		case EAiKeylockDisabled:
   520 		case EAiKeylockDisabled:
   522         case EAiKeylockEnabled:
   521         case EAiKeylockEnabled:
   523         	{
   522         	{
   524         	// handled in resume 
   523         	// handled in resume 
       
   524         	TRAP_IGNORE( DoResumeL( aReason ) ); 
   525         	break;
   525         	break;
   526         	}
   526         	}
   527         default :
   527         default :
   528         	{
   528         	{
   529         	iPluginState = ESuspend;
   529         	iPluginState = ESuspend;
   684     		{
   684     		{
   685 			iHSForeGround = ETrue;
   685 			iHSForeGround = ETrue;
   686     		}
   686     		}
   687     	case EAiBacklightOn:    		
   687     	case EAiBacklightOn:    		
   688     		{
   688     		{
   689     		if ( iPluginState == ESuspend )
   689     		if ( iPluginState == ESuspend  && !iKeyLockOn )
   690 				{
   690 				{
   691 				iPluginState = EResume;
   691 				iPluginState = EResume;
   692 				iData->ResumeL();
   692 				iData->ResumeL();
   693 				}
   693 				}
   694     		break;
   694     		break;
   695 			}
   695 			}
   696     	case EAiKeylockDisabled:
   696     	case EAiKeylockDisabled:
   697         	{
   697         	{
       
   698         	iKeyLockOn = EFalse;
   698         	// Key lock events considered only if HS is in foreground  
   699         	// Key lock events considered only if HS is in foreground  
   699         	if ( iHSForeGround && iPluginState == ESuspend )
   700         	if ( iHSForeGround && iPluginState == ESuspend )
   700         		{
   701         		{
   701         		iPluginState = EResume;
   702         		iPluginState = EResume;
   702 				iData->ResumeL();
   703 				iData->ResumeL();
   703         		}
   704         		}
   704         	break;
   705         	break;
   705         	}
   706         	}
   706     	case EAiKeylockEnabled:
   707     	case EAiKeylockEnabled:
   707         	{
   708         	{
       
   709         	iKeyLockOn = ETrue;
   708         	// Key lock events considered only if HS is in foreground
   710         	// Key lock events considered only if HS is in foreground
   709         	if ( iHSForeGround && iPluginState == EResume )
   711         	if ( iHSForeGround && iPluginState == EResume )
   710         		{
   712         		{
   711 				iPluginState = ESuspend ;
   713 				iPluginState = ESuspend ;
   712 				iData->SuspendL();
   714 				iData->SuspendL();