Add C# API guide template. 64/129864/4
authorYoung-Ae Kang <youngae.kang@samsung.com>
Thu, 18 May 2017 08:08:42 +0000 (17:08 +0900)
committerchanywa <cbible.kim@samsung.com>
Tue, 20 Jun 2017 11:45:49 +0000 (20:45 +0900)
Change-Id: I615ea3b096741a8a425233244b5aa0b2a670df56

template/images/context_trigger_rule_components.png [new file with mode: 0644]
template/template_guides.htm [new file with mode: 0644]

diff --git a/template/images/context_trigger_rule_components.png b/template/images/context_trigger_rule_components.png
new file mode 100644 (file)
index 0000000..eeb73ab
Binary files /dev/null and b/template/images/context_trigger_rule_components.png differ
diff --git a/template/template_guides.htm b/template/template_guides.htm
new file mode 100644 (file)
index 0000000..5a8cfd8
--- /dev/null
@@ -0,0 +1,266 @@
+<!--
+This is template for API Guide document
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+       <meta http-equiv="content-type" content="text/html; charset=utf-8" />
+       <meta http-equiv="X-UA-Compatible" content="IE=9" />
+       <link rel="stylesheet" type="text/css" href="css/styles.css" />
+       <link rel="stylesheet" type="text/css" href="css/snippet.css" />
+       <script type="text/javascript" src="scripts/snippet.js"></script>
+       <script type="text/javascript" src="scripts/jquery.util.js" charset="utf-8"></script>
+       <script type="text/javascript" src="scripts/common.js" charset="utf-8"></script>
+       <script type="text/javascript" src="scripts/core.js" charset="utf-8"></script>
+       <script type="text/javascript" src="scripts/search.js" charset="utf-8"></script>
+
+
+<!-- Title shows up at the browser tap -->
+       <title>TITLE</title>
+
+</head>
+
+<!--
+       Title shows up at the browser tap.
+-->
+
+<body onload="prettyPrint()" style="overflow: auto;">
+
+
+<div id="toc-navigation">
+
+<!-- 14.Profile -->
+<!--
+       Choose profile icons among the four cases: mobile, wearable, or/and TV.
+       Note: Doc part will add C# icon files.
+-->
+       <div id="profile">
+               <p><img alt="Mobile C#" src="mages/mobile_s_cs.png">
+               <img alt="Wearable C#" src="images/wearable_s_cs.png">
+               <img alt="TV C#" src="images/wearable_s_cs.png">
+               </p>
+       </div>
+
+<!-- 15.Infobox -->
+<!-- 15.1.Dependencies -->
+<!-- This section shows the supported platform versions. -->
+<!-- Please choose one from the list. -->
+       <div id="toc_border"><div id="toc">
+               <p class="toc-title">Dependencies</p>
+               <ul class="toc">
+                       <li>Tizen 4.0 and Higher for Mobile</li>
+                       <li>Tizen 4.0 and Higher for Wearable</li>
+                       <li>Tizen 4.0 and Higher for Mobile and Wearable</li>
+                       <li>Tizen 4.0 and Higher for Mobile and TV</li>
+                       <li>Tizen 4.0 and Higher for Mobile, Wearable, and TV</li>
+               </ul>
+
+<!-- 15.2.Content -->
+<!-- This section shows contents of the document -->
+               <p class="toc-title">Content</p>
+                       <ul class="toc">
+                               <li><a href="#prerequisites">Prerequisites</a></li>
+                               <li><a href="#scenario_1">Setting an Alarm after Specific Time</a></li>
+                               <li><a href="#scenario_2">Setting an Alarm on a Specific Date</a></li>
+                               <li><a href="#scenario_3">~~~</a></li>
+                       </ul>
+               <p></p>
+
+<!-- 15.3.Related Info -->
+<!--
+               This section shows the related documents such as other guides and API reference.
+               Note: The URL of C# API Reference can be changed.
+-->
+               <p class="toc-title">Related Info</p>
+               <ul class="toc">
+<!-- API Reference -->
+                       <li><a href="https://developer.tizen.org/dev-guide/csapi/classTizen_1_1Applications_1_1Alarm.html">Alarm API</a></li>
+<!-- Samples, if exists -->
+                       <li><a href="https://developer.tizen.org/development/sample/native/AppFW/Alarm" target="_blank">Alarm Sample Description</a></li>
+               </ul>
+       </div></div>
+</div>
+
+<div id="container"><div id="contents"><div class="content">
+
+<!-- 1.Title -->
+<!-- This section shows the title of the contents with <h1> -->
+       <h1>Alarm</h1>
+
+<!-- 2.Overview -->
+<!-- This section shows what the API is. -->
+       <p>You can launch an application at a specific time using alarms. The mechanism involved in launching the application is the App Control API (in <a href="../../../../org.tizen.native.mobile.apireference/group__CAPI__APP__CONTROL__MODULE.html">mobile</a> and <a href="../../../../org.tizen.native.wearable.apireference/group__CAPI__APP__CONTROL__MODULE.html">wearable</a> applications).</p>
+<p>The AppControl API allows <a href="../app_management/app_controls_n.htm">launching an application</a> explicitly, giving its package name, or providing certain criteria that the application must meet. For example, the criteria can include the type of data on which the application must be able to operate. The structure containing the criteria is called an application control.</p>
+
+       <p>The following figure illustrates the rule components and their relations.</p>
+
+<!-- 4.Image -->
+<!-- Image MUST be center-aligned and have a caption -->
+       <p align="center"><strong>Figure: Rule components</strong></p>
+       <p align="center"><img alt="Rule components" src="images/context_trigger_rule_components.png"></p>
+
+
+<!-- 6.Main feature -->
+<!-- Main features MUST be described in the form of a gerund. -->
+       <p>The main features of the Alarm API include:</p>
+       <ul>
+                <li>Setting alarms after a specific time
+                                <p>You can <a href="#scenario_1">set an alarm to trigger after a specific amount of time</a>.</p></li>
+                <li>Setting alarms on specific dates
+                                <p>You can <a href="#scenario_2">set an alarm on a specific date</a>.</p></li>
+                <li>Setting recurring alarms
+                                <p>You can <a href="#scenario_3">set a recurring alarm</a> to trigger at a specific time of the day.</p></li>
+                <li>Managing existing alarms
+                                <p>You can <a href="#scenario_4">list all scheduled alarms and cancel them</a>.</p></li>
+       </ul>
+
+<!-- 7.Feature -->
+<!-- This section shows the detailed features -->
+       <h2 id="trigerring_events">Trigering events </h2>
+       <p> This feature is ...... </p>
+
+<!-- 13. Prerequisites -->
+<!-- This section shows the required features, privileges, or conditions. -->
+        <h2 id="prerequisites">Prerequisites</h2>
+        <p>To enable your application to use the alarm functionality:</p>
+        <ol>
+                <li>To use the Alarm API (in <a href="file:///home/journey2w/git/swc/public/org.tizen.native.mobile.apireference/group__CAPI__ALARM__MODULE.html">mobile</a> and <a href="file:///home/journey2w/git/swc/public/org.tizen.native.wearable.apireference/group__CAPI__ALARM__MODULE.html">wearable</a> applications), the application has to request permission by adding the following privileges to the <code>tizen-manifest.xml</code> file:
+
+                <pre class="prettyprint">
+&lt;privileges&gt;
+   &lt;privilege&gt;http://tizen.org/privilege/alarm.get&lt;/privilege&gt;
+   &lt;privilege&gt;http://tizen.org/privilege/alarm.set&lt;/privilege&gt;
+&lt;/privileges&gt;
+                </pre>
+
+                </li>
+                <li>To use the functions and data types of the Alarm API, include the <code>&lt;app_alarm.h&gt;</code> header file in your application:
+                <pre class="prettyprint">
+#include &lt;app_alarm.h&gt;
+                </pre>
+                </li>
+        </ol>
+
+<!-- 16.Procedure -->
+<!--
+       This section shows steps to explain how to do.
+       MUST set "name" attribute to jump here from Content in infobox.
+-->
+       <h2 id="scenario_1" name="scenario_1">Setting an Alarm after Specific Time</h2>
+
+<!-- 18.Note -->
+<!-- MUST add "Note" with <strong> -->
+       <div class="note">
+               <strong>Note</strong>
+               Since 2.4, the <code>alarm_schedule_after_delay()</code> function does
+ not support an exact period and delay to minimize the wake-ups of the
+device. The system can adjust when the alarm expires.
+       </div>
+
+       <p>To set an alarm after a specific time:</p>
+
+       <ol>
+               <li>
+               <p>Implement the AlarmRegister application:</p>
+               <ol type="a"><li>
+                       <p>To identify which application to start when the alarm expires, the Alarm API needs the <code>app_control_h</code> handle.</p>
+                       <p>Obtain the <code>app_control_h</code> handle of a specific app by calling the <code>app_control_set_app_id()</code> function. You can get the AlarmTarget <code>app_id</code> from the <code>tizen-manifest.xml</code> file. </p>
+
+<!-- 23. Code example -->
+<!-- This section shows code example. -->
+                       <pre class="prettyprint">
+bool
+init_alarm()
+{
+    int ret;
+    int DELAY = 2;
+    int REMIND = 1;
+    int alarm_id;
+
+    app_control_h app_control = NULL;
+    ret = app_control_create(&amp;app_control);
+    ret = app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
+    ret = app_control_set_app_id(app_control, "org.tizen.alarmslave");
+                       </pre>
+                       </li>
+
+                       <li>
+                       <p>To schedule an alarm after a delay, use the <code>alarm_schedule_after_delay()</code> function:</p>
+
+                       <pre class="prettyprint">
+void
+service_app_control(app_control_h app_control, void *data)
+{
+    dlog_print(DLOG_INFO, LOG_TAG, "app_control called by Alarm API.");
+}
+                       </pre>
+
+                       </li></ol>
+               <li>
+
+               <li>
+                       <p>Implement the AlarmTarget application:</p>
+                       <p>A scheduled alarm calls AlarmTarget's <code>app_control_cb()</code> callback when the alarm expires:</p>
+                       <pre class="prettyprint">
+void
+service_app_control(app_control_h app_control, void *data)
+{
+    dlog_print(DLOG_INFO, LOG_TAG, "app_control called by Alarm API.");
+}
+                       </pre>
+               </li>
+       </ol>
+
+       <h2 id="scenario_2" name="scenario_2">Setting an Alarm on a Specific Date</h2>
+
+       <p>To schedule an alarm on a specific date, use the <code>alarm_schedule_at_date()</code> function.</p>
+       <p>The second parameter defines the time of the first active alarm. It can be defined using the <code>tm</code> struct included in the <code>&lt;time.h&gt;</code> header file. The following table lists the selected <code>tm</code> fields.</p>
+
+<!-- 12.Table -->
+<!-- This section shows table element. -->
+       <p class="Table" align="center"><strong>Table: tm fields</strong></p>
+       <div class="table"><table>
+       <tbody>
+               <tr>
+                       <th>Member</th>
+                       <th>Type</th>
+                       <th>Meaning</th>
+                       <th>Range</th>
+               </tr>
+               <tr>
+                       <td><code>tm_sec</code></td>
+                       <td>int</td>
+                       <td>Seconds after the minute</td>
+                       <td>0-61*</td>
+               </tr>
+       </tbody>
+       </table>
+
+<!--
+       These 2 javascripts are for showing infobox.
+       Please change "scripts" directory.
+-->
+<script type="text/javascript" src="scripts/jquery.zclip.min.js"></script>
+<script type="text/javascript" src="scripts/showhide.js"></script>
+</div></div></div>
+
+
+<a class="top sms" href="#"><img src="images/btn_top.gif" alt="Go to top"></a>
+
+<div id="footer">
+<p class="footer">Except as noted, this content - excluding the Code Examples - is licensed under <a href="http://creativecommons.org/licenses/by/3.0/legalcode" target="_blank">Creative Commons Attribution 3.0</a> and all of the Code Examples contained herein are licensed under <a href="https://www.tizen.org/bsd-3-clause-license" target="_blank">BSD-3-Clause</a>.<br>For details, see the <a href="https://www.tizen.org/content-license" target="_blank">Content License</a>.</p>
+</div>
+
+<script type="text/javascript">
+var _gaq = _gaq || [];
+_gaq.push(['_setAccount', 'UA-25976949-1']);
+_gaq.push(['_trackPageview']);
+(function() {
+var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
+ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
+var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
+})();
+</script>
+
+
+</div></div></div></body></html>