|
1 <?xml version="1.0" encoding="utf-8"?> |
|
2 <!-- Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies) All rights reserved. --> |
|
3 <!-- This component and the accompanying materials are made available under the terms of the License |
|
4 "Eclipse Public License v1.0" which accompanies this distribution, |
|
5 and is available at the URL "http://www.eclipse.org/legal/epl-v10.html". --> |
|
6 <!-- Initial Contributors: |
|
7 Nokia Corporation - initial contribution. |
|
8 Contributors: |
|
9 --> |
|
10 <!DOCTYPE concept |
|
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
|
12 <concept id="GUID-868C1A38-3CD0-4082-8106-DC3EE1F815D8" xml:lang="en"><title>System |
|
13 events</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
|
14 <p>System events are enumerated in <xref href="GUID-95954F7F-E214-309C-AF32-3A9BD77BDC31.dita"><apiname>TApaSystemEvent</apiname></xref>, |
|
15 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 |
|
16 handle these events, which should be done in the UI controller. The default |
|
17 implementation is empty. The possible events are as follows:</p> |
|
18 <codeblock id="GUID-F0606F71-729A-4D6B-AAC6-876A526DDFAC" xml:space="preserve">enum TApaSystemEvent |
|
19 { |
|
20 EApaSystemEventShutdown = 1, |
|
21 EApaSystemEventBackupStarting, |
|
22 EApaSystemEventBackupComplete, |
|
23 EApaSystemEventBroughtToForeground |
|
24 }; |
|
25 </codeblock> |
|
26 <p>The following is a code example of system event handling:</p> |
|
27 <codeblock id="GUID-86877508-AD28-4576-B9D5-55565B0F4A4A" xml:space="preserve">void CExampleAppUI::HandleSystemEvent( const TWsEvent& aEvent ) |
|
28 { |
|
29 switch( *( TApaSystemEvent* )( aEvent.EventData() ) ) |
|
30 { |
|
31 case EApaSystemEventBackupStarting: |
|
32 { |
|
33 // Handle backup starting |
|
34 //... |
|
35 break; |
|
36 } |
|
37 case EApaSystemEventBackupComplete: |
|
38 { |
|
39 // Handle backup complete |
|
40 //... |
|
41 break; |
|
42 } |
|
43 case EApaSystemEventShutdown: |
|
44 { |
|
45 // Handle shutdown |
|
46 //... |
|
47 break; |
|
48 } |
|
49 } |
|
50 // Call the base class implementation |
|
51 CAknAppUi::HandleSystemEvent( aEvent ); |
|
52 } |
|
53 </codeblock> |
|
54 </conbody></concept> |