Symbian3/SDK/Source/GUID-868C1A38-3CD0-4082-8106-DC3EE1F815D8.dita
author Dominic Pinkman <dominic.pinkman@nokia.com>
Fri, 11 Jun 2010 12:39:03 +0100
changeset 8 ae94777fff8f
parent 7 51a74ef9ed63
permissions -rw-r--r--
Week 23 contribution of SDK documentation content. See release notes for details. Fixes bugs Bug 2714, Bug 462.

<?xml version="1.0" encoding="utf-8"?>
<!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. -->
<!-- This component and the accompanying materials are made available under the terms of the License 
"Eclipse Public License v1.0" which accompanies this distribution, 
and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". -->
<!-- Initial Contributors:
    Nokia Corporation - initial contribution.
Contributors: 
-->
<!DOCTYPE concept
  PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd">
<concept id="GUID-868C1A38-3CD0-4082-8106-DC3EE1F815D8" xml:lang="en"><title>System
events</title><prolog><metadata><keywords/></metadata></prolog><conbody>
<p>System events are enumerated in <xref href="GUID-95954F7F-E214-309C-AF32-3A9BD77BDC31.dita"><apiname>TApaSystemEvent</apiname></xref>,
which is defined in the <parmname>apgtask.h</parmname>. You must override <xref href="GUID-92361912-7768-3D2C-835E-BD3EF1366D6D.dita#GUID-92361912-7768-3D2C-835E-BD3EF1366D6D/GUID-71190B7E-A39E-3F20-A0D6-A519776A1480"><apiname>CCoeAppUI::HandleSystemEventL()</apiname></xref> to
handle these events, which should be done in the UI controller. The default
implementation is empty. The possible events are as follows:</p>
<codeblock id="GUID-F0606F71-729A-4D6B-AAC6-876A526DDFAC" xml:space="preserve">enum TApaSystemEvent
    {
    EApaSystemEventShutdown = 1,
    EApaSystemEventBackupStarting,
    EApaSystemEventBackupComplete,
    EApaSystemEventBroughtToForeground
    };
</codeblock>
<p>The following is a code example of system event handling:</p>
<codeblock id="GUID-86877508-AD28-4576-B9D5-55565B0F4A4A" xml:space="preserve">void CExampleAppUI::HandleSystemEvent( const TWsEvent&amp; 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 );
    }
</codeblock>
</conbody></concept>