[event_system] Add Reference API.
authorhyunho kang <hhstark.kang@samsung.com>
Thu, 24 Sep 2015 02:59:35 +0000 (11:59 +0900)
committerHyunho Kang <hhstark.kang@samsung.com>
Thu, 24 Sep 2015 04:00:43 +0000 (13:00 +0900)
Change-Id: I3b9531076cbfbbd33f6a0de0a19313828e4f14b6
Signed-off-by: hyunho kang <hhstark.kang@samsung.com>
org.tizen.guides/html/native/app/event_n.htm

index 8715817..1f217e5 100644 (file)
@@ -36,7 +36,7 @@
 
 <p>The application can broadcast its own events to all listeners, and subscribe to events. The events can be either predefined system events from the platform (only platform modules can broadcast system events) or user-defined events (broadcast by UI and service applications).</p>
 
-<p>The main features of the Event API are:</p>
+<p><b>The main features of the Event API are:</b></p>
 <ul>
 <li>Event publication
 <p>To publish an event, use the <span style="font-family: Courier New,Courier,monospace">event_publish_app_event()</span> and <span style="font-family: Courier New,Courier,monospace">event_publish_trusted_app_event()</span> functions. The <span style="font-family: Courier New,Courier,monospace">event_publish_trusted_app_event()</span> function publishes a trusted event which can only be received by the application that has the same signature as the publishing application.</p>
 </li>
 </ul>
 
-<p>The following table lists the platform event types.</p>
+       <p><b>Managing event handler with suspended state changes :</b><br><br>
+               The application'state can be changed to suspended state in the background.
+               In the suspended state, the application can not receive the event anymore, and the application will be received all the events which is occurred in the suspended_state in series after exit from suspended state.
+               If the application wants to handle the event in the background without suspended state, the application should declare background-category. (Refer to "Allowing Applications to Run on the Background" section of the application guide.)
+               Or, If the application does not want to get the events in series after exit from suspended state, remove the event handler before the suspended state and re-add the event handler after exit from suspended state.
+               The application can do this with adding the callback which is called before/after suspended state. (Refer to APP_EVENT_SUSPENDED_STATE_CHANGED) <br><br>
+       </p>
+
+<p><b>The following table lists the platform event types.</b></p>
 <table>
           <caption>
                           Table: Platform event types
                                           <p>"charging" - Charging is enabled</p>
                                           <p>"discharging" - Charging is disabled (ex, 100% full state etc) </p>
                                   </li>
+                                  <li>
+                                          If there is earlier occurrence regarding this event,
+
+                                          you will receive the event as soon as you register event handler for this event.
+
+                                          You can use this earlier event-data as initial value <br>
+
+                                  </li>
                           </td>
           </tr>
           <tr>
 
 
                           </li>
+                          <li>Reference API
+                                  <p>device_battery_get_level_status()</p>
+                          </li>
                   </td>
           </tr>
           <tr>
                                   <p>"available" - usb service is available (ex. mtp, sdb, ...)</p>
 
                           </li>
+                          <li>
+                                  RUNTIME_INFO_KEY_USB_CONNECTED
+                                  <br>
+
+                          </li>
                   </td>
           </tr>
           <tr>
                                   <p>"disconnected": ear-jack is not connected</p>
                                   <p>"connected": ear-jack is connected</p>
                           </li>
+                          <li>RUNTIME_INFO_KEY_AUDIO_JACK_STATUS
+
+                          </li>
                   </td>
                </tr>
                <tr>
                                        <p>"dim" - display on, dim brightness</p>
                                        <p>"off" - display off</p>
                                </li>
+                               <li>Reference API
+                                       <p>device_display_get_state()</p>
+                               </li>
                        </td>
                </tr>
                <tr>
                           <td rowspan="2">system</td>
                           <td><span style="font-family: Courier New,Courier,monospace">tizen.system.event.boot_completed</span></td>
                           <td><span style="font-family: Courier New,Courier,monospace">boot_completed</span></td>
-                          <td><span style="font-family: Courier New,Courier,monospace">&quot;true&quot;</span>
-                               <p>=&gt; send <span style="font-family: Courier New,Courier,monospace">&quot;true&quot;</span> only</p>
-                               </td>
+                          <td><span style="font-family: Courier New,Courier,monospace">N/A</span></td>
                        <td>
                                <li>Condition
                                        <p>when platform booting has been completed</p>
                                </li>
                                <li>value description
-                                       <p>"true" - boot completed</p>
+                                       <p>There is no corresponding key/value.
+                                               You can treat the initial value as "false" before you receive this event.
+                                               If it's already boot-completed state before you regiser event handler,
+                                               you can receive the event as soon as you register the event handler.</p>
                                </li>
                        </td>
           </tr>
           <tr>
                                <td><span style="font-family: Courier New,Courier,monospace">tizen.system.event.system_shutdown</span></td>
                           <td><span style="font-family: Courier New,Courier,monospace">system_shutdown</span></td>
-                          <td><span style="font-family: Courier New,Courier,monospace">&quot;true&quot;</span>
-                               <p>=&gt; send <span style="font-family: Courier New,Courier,monospace">&quot;true&quot;</span> only</p>
-                               </td>
+                          <td><span style="font-family: Courier New,Courier,monospace">N/A</span></td>
                   <td>
                           <li>Condition
                                   <p>when the system power-off has been started</p>
                           </li>
                           <li>value description
-                                  <p>"true": system power-off start now or started</p>
+                                  <p>There is no corresponding key/value.
+                                          You can treat the inital value as "false" before you receive this event.
+                                          If it's already shutting-down state before you regiser event handler,
+                                          you can receive the event as soon as you register the event handler.
+                                  </p>
                           </li>
                   </td>
                </tr>
                                <li>Note
                                        <p>Above numbers can be different according to total ram size of target device</p>
                                </li>
+                               <li>If there is earlier occurrence regarding this event,
+
+                                       you will receive the event as soon as you register event handler for this event.
+
+                                       You can use this earlier event-data as initial value<br>
+
+
+                               </li>
                        </td>
           </tr>
           <tr>
                                   <p>"off" - wi-fi off</p>
                                   <p>"connected" - wi-fi connection established</p>
                           </li>
+                          <li>Reference API
+                                  <p>connection_get_wifi_state()</p>
+                          </li>
                   </td>
           </tr>
           <tr>
                                   <p>"on" - legacy bluetooth on</p>
 
                           </li>
+                          <li>Reference API
+                                  <p>bt_adapter_get_state()</p>
+                          </li>
                   </td>
                </tr>
                <tr>
                                        <p>"enabled"  - location enabled</p>
 
                                </li>
+                               <li>Reference API
+                                       <p>location_manager_is_enabled_method()</p>
+                               </li>
                        </td>
                </tr>
                <tr>
                                        <p>"enabled"  - gbs enabled</p>
 
                                </li>
+                               <li>Reference API
+                                       <p>location_manager_is_enabled_method()</p>
+                               </li>
                        </td>
                </tr>
                <tr>
                                        <p>"enabled"  - nps enabled</p>
 
                                </li>
+                               <li>Reference API
+                                       <p>location_manager_is_enabled_method()</p>
+                               </li>
                        </td>
                </tr>
                <tr>
                                <li>Condition
                                        <p>when the time-zone has been changed</p>
                                </li>
+                               <li>SYSTEM_SETTINGS_KEY_LOCALE_TIMEZONE<br>
+
+                               </li>
 
                        </td>
                </tr>
                                <li>Condition
                                        <p>When the hour_format has been changed, for example, by the user toggling the date and time settings. “ON” stands for 24-hour clock, and “OFF” stands for 12-hour clock.</p>
                                </li>
+                               <li>SYSTEM_SETTINGS_KEY_LOCALE_TIMEFORMAT_24HOUR
+                                       <br>
+
+                               </li>
 
                        </td>
                </tr>
 
 
                                </li>
+                               <li>SYSTEM_SETTINGS_KEY_LOCALE_LANGUAGE
+                                       <br>
+
+                               </li>
                        </td>
                </tr>
                <tr>
 
 
                                </li>
+                               <li>SYSTEM_SETTINGS_KEY_LOCALE_COUNTRY
+
+
+                                       <br>
+
+                               </li>
                        </td>
                </tr>
                <tr>
                                        <p>when the Ringtone has been changed to 0 or to others</p>
                                        <p>ex) Setting > Sound > Call slider, if the call slider has been changed to 0 then silent_mode is "on", else silent_mode is "off"</p>
                                </li>
+                               <li>SYSTEM_SETTINGS_KEY_SOUND_SILENT_MODE
+
+
+
+                                       <br>
+
+                               </li>
 
                        </td>
                </tr>
                                <li>Condition
                                        <p>when the vibration state has been changed</p>
                                </li>
+                               <li>RUNTIME_INFO_KEY_VIBRATION_ENABLED
+
+
+
+
+                                       <br>
+
+                               </li>
 
                        </td>
                </tr>
                                        <p>when the screen-auto-rotate state has been changed</p>
                                        <p>ex) Setting > Display > Auto rotation on/off toggle</p>
                                </li>
+                               <li>SYSTEM_SETTINGS_KEY_DISPLAY_SCREEN_ROTATION_AUTO
+
+
+
+
+
+                                       <br>
+
+                               </li>
 
                        </td>
                </tr>
                                        <p>when the mobile-data state has been changed</p>
                                        <p>ex) Setting > network > mobile data on/off toggle</p>
                                </li>
+                               <li>SYSTEM_SETTINGS_KEY_3G_DATA_NETWORK_ENABLED
+
+
+
+
+
+                                       <br>
+
+                               </li>
 
                        </td>
                </tr>
                                        <p>when the data-roaming state has been changed</p>
                                        <p>ex) Setting > network > data roaming on/off toggle</p>
                                </li>
+                               <li>RUNTIME_INFO_KEY_DATA_ROAMING_ENABLED
+
+
+
+
+
+
+                                       <br>
+
+                               </li>
 
                        </td>
                </tr>
                                        <p>the value is font name of string type by font-config.</p>
 
                                </li>
+                               <li>SYSTEM_SETTINGS_KEY_FONT_TYPE
+
+
+
+
+
+
+
+
+                                       <br>
+
+                               </li>
                        </td>
                </tr>
           </tbody>