System events

System events are enumerated in TApaSystemEvent , which is defined in the apgtask.h . You must override CCoeAppUI::HandleSystemEventL() to handle these events, which should be done in the UI controller. The default implementation is empty. The possible events are as follows:

      
       
      
      enum TApaSystemEvent
    {
    EApaSystemEventShutdown = 1,
    EApaSystemEventBackupStarting,
    EApaSystemEventBackupComplete,
    EApaSystemEventBroughtToForeground
    };
     

The following is a code example of system event handling:

      
       
      
      void CExampleAppUI::HandleSystemEvent( const TWsEvent& aEvent )
    {
    switch( *( TApaSystemEvent* )( aEvent.EventData() ) )
        {
        case EApaSystemEventBackupStarting:
            {
            // Handle backup starting
            //...
            break;
            }
        case EApaSystemEventBackupComplete:
            {
            // Handle backup complete
            //...
            break;
            }
        case EApaSystemEventShutdown:
            {
            // Handle shutdown
            //...
            break;
            }
        default:
            {
            break;
            }

        }
        // Call the base class implementation
        CAknAppUi::HandleSystemEvent( aEvent );
    }