1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
2<html xml:lang="en-US" lang="en-US" xmlns="http://www.w3.org/1999/xhtml">
3  <head>
4    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
5    <meta http-equiv="Content-Style-Type" content="text/css" />
6    <link rel="stylesheet" href="../../../css/manpage.css" type="text/css" />
7<title>IsExpectedToProcessHomeButton</title>
8  </head>
9  <body>
10<h1><CODE><a href="../../../nn/Overview.html">nn</a>::<a href="../../../nn/applet/Overview.html">applet</a>::<a href="../../../nn/applet/CTR/Overview.html">CTR</a>::IsExpectedToProcessHomeButton</CODE> Function</h1>
11<h2>Syntax</h2>
12    <div class="section">
13      <pre class="definition">
14bool IsExpectedToProcessHomeButton(
15     void
16);
17</pre>
18    </div>
19<h2>Parameters</h2>
20    <div class="section">
21<p>None.</p>
22    </div>
23<h2>Return Values</h2>
24<div class="section">Returns whether there was a processing request. If <CODE>true</CODE>, the HOME Button must be processed. </div>
25<h2>Description</h2>
26    <div class="section">
27<p>Determines whether there has been a request to process the HOME Button.</p><!-- write here --><P>
28A return value of <CODE>true</CODE> indicates that either the HOME Button was pressed to jump to the HOME Menu, or another applet made a similar request to jump to the HOME Menu.
29</P><P>
30In such cases, call the <CODE><a href="../../../nn/applet/CTR/ProcessHomeButton.html">nn::applet::CTR::ProcessHomeButton</a></CODE> function to process the HOME Button. Then call <a href="../../../nn/applet/CTR/WaitForStarting.html"><CODE>nn::applet::CTR::WaitForStarting</CODE></a> to wait if necessary.
31</P><P>
32Example
33</P><PRE>
34   // HOME Button transition check
35   if ( <FONT color="red">applet::IsExpectedToProcessHomeButton()</FONT> )
36   {
37       _save_my_data();
38
39       // HOME Button transition process
40       applet::ProcessHomeButton();
41
42       // Wait
43       applet::WaitForStarting();
44
45       if( applet::IsExpectedToCloseApplication() )
46       {
47             _close_application();
48       }
49
50       _recover_my_data();
51   }
52</PRE><P>
53Prevent other applet-transition functions from being called between this function and <a href="../../../nn/applet/CTR/ProcessHomeButton.html"><CODE>nn::applet::CTR::ProcessHomeButton</CODE></a>. If there is an inconsistency in the internal state, for example because of an attempt to preload library applets from another thread between these two function calls, a warning is generated on an assertion.
54</P><P>
55This example assumes that determination functions such as this one and the function for actually making the transition are called successively in the same thread, but depending on the implementation you may be able to call them in different threads. However, be very careful that the determination thread does not continue executing after execution control is passed.
56</P></div>
57<h2>Revision History</h2>
58    <div class="section">
59      <dl class="history">
60        <dt>2012/11/09</dt>
61<dd>Added a note about calling the determination function and transition functions in different threads.<br />
62        </dd>
63        <dt>2011/11/01</dt>
64<dd>Added a note related to calling applet-transition functions between this function and <CODE>ProcessHomeButton</CODE>.
65        </dd>
66        <dt>2011/06/14</dt>
67<dd>Deleted the <CODE>ClearHomeButtonState</CODE> function from an example.<BR>
68        </dd>
69        <dt>2010/11/10</dt>
70<dd>Initial version.<br />
71        </dd>
72      </dl>
73    </div>
74  <hr><p>CONFIDENTIAL</p></body>
75</html>
76