11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
11 PUBLIC "-//OASIS//DTD DITA Concept//EN" "concept.dtd"> |
12 <concept id="GUID-11FE772A-E662-4B88-B871-97A40A40FBAB" xml:lang="en"><title>Handling |
12 <concept id="GUID-11FE772A-E662-4B88-B871-97A40A40FBAB" xml:lang="en"><title>Handling |
13 EEikCmdExit</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
13 EEikCmdExit</title><prolog><metadata><keywords/></metadata></prolog><conbody> |
14 <p>If your Symbian GUI-based application should close, for example, in |
14 <p>If your Symbian GUI-based application should close, for example, in |
15 out of memory situations, you must handle the <parmname>EEikCmdExit</parmname> command |
15 out of memory situations, you must handle the <parmname>EEikCmdExit</parmname> command |
16 ID in your override of <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/CEikAppUiClass.html#%3a%3aCEikAppUi%3a%3aHandleCommandL%28%29" format="application/java-archive"><parmname>CEikAppUi::HandleCommandL</parmname></xref>. The UI architecture of your application determines where you |
16 ID in your override of <xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita#GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E/GUID-D6E5C363-CF39-3E56-B717-57CCEE8DC96F"><apiname>CEikAppUi::HandleCommandL()</apiname></xref>. The |
17 override <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/CEikAppUiClass.html#%3a%3aCEikAppUi%3a%3aHandleCommandL%28%29" format="application/java-archive"><parmname>CEikAppUi::HandleCommandL</parmname></xref>. A typical implementation |
17 UI architecture of your application determines where you override <xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita#GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E/GUID-D6E5C363-CF39-3E56-B717-57CCEE8DC96F"><apiname>CEikAppUi::HandleCommandL()</apiname></xref>. |
18 is as follows:</p> |
18 A typical implementation is as follows:</p> |
19 <codeblock id="GUID-80E7C5FF-A507-42FA-ACF0-808539FFF6A5" xml:space="preserve">void CMyCommandHandlingAppUi::HandleCommandL(TInt aCommand) |
19 <codeblock id="GUID-80E7C5FF-A507-42FA-ACF0-808539FFF6A5" xml:space="preserve">void CMyCommandHandlingAppUi::HandleCommandL(TInt aCommand) |
20 { |
20 { |
21 |
21 |
22 switch(aCommand) |
22 switch(aCommand) |
23 { |
23 { |
29 default: |
29 default: |
30 break; |
30 break; |
31 } |
31 } |
32 } |
32 } |
33 </codeblock> |
33 </codeblock> |
34 <p>where <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/CEikAppUiClass.html#%3a%3aCEikAppUi%3a%3aExit%28%29" format="application/java-archive"><parmname>CEikAppUI::Exit()</parmname></xref> closes the application. <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/CEikAppUiClass.html#%3a%3aCEikAppUi" format="application/java-archive"><parmname>CEikAppUI</parmname></xref> also provides <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/CEikAppUiClass.html#%3a%3aCEikAppUi%3a%3aSaveAnyChangesL%28%29" format="application/java-archive"><parmname>SaveAnyChangesL</parmname></xref> and <xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/CEikAppUiClass.html#%3a%3aCEikAppUi%3a%3aSaveL%28%29" format="application/java-archive"><parmname>SaveL</parmname></xref> methods |
34 <p>where <xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita#GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E/GUID-6DB0AB66-DC74-33EB-9DA4-8DB6383728F9"><apiname>CEikAppUi::Exit()</apiname></xref> closes the application. <xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita"><apiname>CEikAppUi</apiname></xref> also |
|
35 provides <codeph>SaveAnyChangesL()</codeph> and <parmname>SaveL()</parmname> methods |
35 in case you need to save the application document.</p> |
36 in case you need to save the application document.</p> |
36 <note> |
37 <note> |
37 <p>In Symbian view architecture applications, the <parmname>EEikCmdExit</parmname> command |
38 <p>In Symbian view architecture applications, the <parmname>EEikCmdExit</parmname> command |
38 must be only handled once: either in the UI controller or in a view. Since |
39 must be only handled once: either in the UI controller or in a view. Since |
39 the exit command is an application wide command, it is recommended that it |
40 the exit command is an application wide command, it is recommended that it |
40 be handled in the UI controller implementation.</p> |
41 be handled in the UI controller implementation.</p> |
41 </note> |
42 </note> |
42 <p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/CEikAppUiClass.html#%3a%3aCEikAppUi%3a%3aExit%28%29" format="application/java-archive"><parmname>CEikAppUI::Exit()</parmname></xref> exits the application. |
43 <p><xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita#GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E/GUID-6DB0AB66-DC74-33EB-9DA4-8DB6383728F9"><apiname>CEikAppUi::Exit()</apiname></xref> exits the application. If the application |
43 If the application is embedded, control returns to the parent, which should |
44 is embedded, control returns to the parent, which should also exit. The application |
44 also exit. The application framework sends an <parmname>EEikCmdExit</parmname> command |
45 framework sends an <parmname>EEikCmdExit</parmname> command ID to each application |
45 ID to each application in this chain to support this behavior.</p> |
46 in this chain to support this behavior.</p> |
46 <note> |
47 <note> |
47 <p><xref href="jar:GUID-35228542-8C95-4849-A73F-2B4F082F0C44.jar!/sdk/doc_source/reference/reference-cpp/UIKON/CEikAppUiClass.html#%3a%3aCEikAppUi%3a%3aExit%28%29" format="application/java-archive"><parmname>CEikAppUI::Exit()</parmname></xref> is guaranteed not to |
48 <p><xref href="GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E.dita#GUID-1185F595-0488-3E93-8D60-6B3A1A3AC32E/GUID-6DB0AB66-DC74-33EB-9DA4-8DB6383728F9"><apiname>CEikAppUi::Exit()</apiname></xref> is guaranteed not to return. This |
48 return. This means that you should not trap this method. Among other things, |
49 means that you should not trap this method. Among other things, do not call |
49 do not call another method when you handle the command ID that triggers an |
50 another method when you handle the command ID that triggers an exit.</p> |
50 exit.</p> |
|
51 </note> |
51 </note> |
52 </conbody></concept> |
52 </conbody></concept> |