check: enrich wearable check guide 64/95664/3
authorWonki Kim <wonki_.kim@samsung.com>
Fri, 4 Nov 2016 07:00:27 +0000 (16:00 +0900)
committerEditor Lionbridge <TizenEditor.SEL@lionbridge.com>
Mon, 7 Nov 2016 07:43:09 +0000 (09:43 +0200)
enrich documentation and make it following documation convention.

PS2: [LB] Reviewed
PS3: [LB] Reviewed

Change-Id: I88ce4fbf9e713ae0b0808fb735f594fd54fc202c
Signed-off-by: Wonki Kim <wonki_.kim@samsung.com>
org.tizen.guides/html/images/check_default_o_wn.png
org.tizen.guides/html/images/check_onoff_o_wn.png
org.tizen.guides/html/images/check_small_o_wn.png
org.tizen.guides/html/images/check_wear_circle_default.png [new file with mode: 0644]
org.tizen.guides/html/images/check_wear_sq_default.png [new file with mode: 0644]
org.tizen.guides/html/images/circle_default.png [new file with mode: 0644]
org.tizen.guides/html/images/circle_onoff.png [new file with mode: 0644]
org.tizen.guides/html/images/circle_small_popup.png [new file with mode: 0644]
org.tizen.guides/html/images/rect_default_popup.png [new file with mode: 0644]
org.tizen.guides/html/images/rect_onoff.png [new file with mode: 0644]
org.tizen.guides/html/native/ui/efl/component_check_wn.htm

index 8db85e1..e2211d2 100644 (file)
Binary files a/org.tizen.guides/html/images/check_default_o_wn.png and b/org.tizen.guides/html/images/check_default_o_wn.png differ
index 3d0bb7c..c720feb 100644 (file)
Binary files a/org.tizen.guides/html/images/check_onoff_o_wn.png and b/org.tizen.guides/html/images/check_onoff_o_wn.png differ
index 6c66508..9f783cb 100644 (file)
Binary files a/org.tizen.guides/html/images/check_small_o_wn.png and b/org.tizen.guides/html/images/check_small_o_wn.png differ
diff --git a/org.tizen.guides/html/images/check_wear_circle_default.png b/org.tizen.guides/html/images/check_wear_circle_default.png
new file mode 100644 (file)
index 0000000..68f7e05
Binary files /dev/null and b/org.tizen.guides/html/images/check_wear_circle_default.png differ
diff --git a/org.tizen.guides/html/images/check_wear_sq_default.png b/org.tizen.guides/html/images/check_wear_sq_default.png
new file mode 100644 (file)
index 0000000..738580d
Binary files /dev/null and b/org.tizen.guides/html/images/check_wear_sq_default.png differ
diff --git a/org.tizen.guides/html/images/circle_default.png b/org.tizen.guides/html/images/circle_default.png
new file mode 100644 (file)
index 0000000..36bfa06
Binary files /dev/null and b/org.tizen.guides/html/images/circle_default.png differ
diff --git a/org.tizen.guides/html/images/circle_onoff.png b/org.tizen.guides/html/images/circle_onoff.png
new file mode 100644 (file)
index 0000000..ccfeb0e
Binary files /dev/null and b/org.tizen.guides/html/images/circle_onoff.png differ
diff --git a/org.tizen.guides/html/images/circle_small_popup.png b/org.tizen.guides/html/images/circle_small_popup.png
new file mode 100644 (file)
index 0000000..40da6eb
Binary files /dev/null and b/org.tizen.guides/html/images/circle_small_popup.png differ
diff --git a/org.tizen.guides/html/images/rect_default_popup.png b/org.tizen.guides/html/images/rect_default_popup.png
new file mode 100644 (file)
index 0000000..1ca2a2d
Binary files /dev/null and b/org.tizen.guides/html/images/rect_default_popup.png differ
diff --git a/org.tizen.guides/html/images/rect_onoff.png b/org.tizen.guides/html/images/rect_onoff.png
new file mode 100644 (file)
index 0000000..41653e8
Binary files /dev/null and b/org.tizen.guides/html/images/rect_onoff.png differ
index 4ecc3e1..86a7faa 100644 (file)
@@ -5,13 +5,13 @@
        <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/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>Check</title>  
+       <title>Check</title>
 </head>
 
 <body onload="prettyPrint()" style="overflow: auto;">
                <p><img alt="Wearable native" src="../../../images/wearable_s_n.png"/></p>
        </div>
        <div id="toc_border"><div id="toc">
-       <p class="toc-title">Dependencies</p>
+               <p class="toc-title">Dependencies</p>
                <ul class="toc">
                        <li>Tizen 2.3.1 and Higher for Wearable</li>
                </ul>
                <p class="toc-title">Content</p>
                <ul class="toc">
-                       <li><a href="#Adding">Adding a Check Component</a></li>
-                       <li><a href="#Modifying">Configuring the Check Component</a></li>
-                       <li><a href="#Using_Check">Using the Check Component</a></li>
-                       <li><a href="#Using_Check_Callbacks">Using the Check Callbacks</a></li>
+                       <li><a href="#basic">Basic Usage</a></li>
+                       <li><a href="#style">Styles</a></li>
+                       <li><a href="#callback">Callbacks</a></li>
                </ul>
                        <p class="toc-title">Related Info</p>
                <ul class="toc">
                        <li><a href="../../../../../org.tizen.native.wearable.apireference/group__Edje__Group.html">Edje API for Wearable Native</a></li>
                        <li><a href="../../../../../org.tizen.native.wearable.apireference/group__CAPI__EFL__EXTENSION__MODULE.html">Efl Extension API for Wearable Native</a></li>
-                       <li><a href="../../../../../org.tizen.native.wearable.apireference/group__Elementary.html">Elementary API for Wearable Native</a></li>                  
+                       <li><a href="../../../../../org.tizen.native.wearable.apireference/group__Elementary.html">Elementary API for Wearable Native</a></li>
                </ul>
        </div></div>
-</div> 
+</div>
 
 <div id="container"><div id="contents"><div class="content">
 <h1>Check</h1>
 
-<p>This feature is supported in wearable applications only.</p>
-
-<p>The check component is similar to the <a href="component_radio_wn.htm">radio</a> component, except that it does not work as a group. It toggles a Boolean value between true and false.</p>
-
-<p>The check component inherits from the layout component, which means that layout functions can be used on the check component.</p>
-
-<p>For more information, see the <a href="../../../../../org.tizen.native.wearable.apireference/group__Check.html">Check</a> API.</p>
+<p>The check UI component accepts user input by the method of toggling. It is similar to the <a href="component_radio_wn.htm">radio</a> component, except that it does not work as a group. For more information, see the <a href="../../../../../org.tizen.native.wearable.apireference/group__Check.html">Check</a> API.</p>
 
-<p class="figure">Figure: Check component</p> 
-<p align="center"><img alt="Check component" src="../../../images/check_wn.png" /></p> 
-
-<p class="figure">Figure: Check hierarchy</p> 
-<p align="center"><img alt="Check hierarchy" src="../../../images/check_tree.png" /></p> 
-
-<h2 id="Adding" name="Adding">Adding a Check Component</h2>
+<p>This feature is supported in wearable applications only.</p>
 
-<p>To create a check component, use the <span style="font-family: Courier New,Courier,monospace;">elm_check_add()</span> function:</p>
+<h2 id="basic">Basic Usage</h2>
 
+<p>To use a check component in your application:</p>
+<ol>
+<li>Add a check component with the <span style="font-family: Courier New,Courier,monospace;">elm_check_add()</span> function:
 <pre class="prettyprint">
 Evas_Object *check;
-Evas_Object *parent;
 
 check = elm_check_add(parent);
 </pre>
-
-<h2 id="Modifying" name="Modifying">Configuring the Check Component</h2>
-
-<p>To configure the check component:</p>
-
-<ul>
-<li><p>Set the check component style:</p>
-<ul><li><p>The following styles are available for the rectangular screen:</p>
-<ul>
-       <li><span style="font-family: Courier New,Courier,monospace;">default</span></li>
-       <li><span style="font-family: Courier New,Courier,monospace;">on and off</span></li>
-</ul></li>
-<li><p>The following styles are available for the circular screen:</p>
+</li>
+<li>Set a <a href="#style">style</a> and fill the check component with a text or an image according to the style:
 <ul>
-       <li><span style="font-family: Courier New,Courier,monospace;">default</span></li>
-       <li><span style="font-family: Courier New,Courier,monospace;">small</span></li>
-       <li><span style="font-family: Courier New,Courier,monospace;">on and off</span></li>
-</ul></li></ul>
-<pre class="prettyprint">
-elm_object_style_set(check, &quot;on and off&quot;);
-</pre>
-
-<p>To get the current style, use the <span style="font-family: Courier New,Courier,monospace;">elm_object_style_get()</span> function:</p>
+<li>Set a style to the check component with the <span style="font-family: Courier New,Courier,monospace;">elm_object_style_set()</span> function. If you use the default style, you can skip this step.
 <pre class="prettyprint">
-char *style = elm_object_style_get(check);
+elm_object_style_set(check, &quot;popup&quot;);
 </pre>
 </li>
-<li>
-<p>Set an icon for the rectangular screen:</p>
+<li>Set a label to the check component with the <span style="font-family: Courier New,Courier,monospace">elm_object_text_set()</span> function:
 <pre class="prettyprint">
-/* Create a Home icon */
-Evas_Object *icon;
-
-icon = elm_icon_add(parent);
-elm_icon_standard_set(icon, &quot;home&quot;);
-
-/* Set the icon to the check component */
-elm_object_part_content_set(check, &quot;icon&quot;, icon);
+/* Default style */
+elm_object_text_set(check, &quot;Check&quot;);
 </pre>
+
 </li>
 </ul>
-
-<h2 id="Using_Check" name="Using_Check">Using the Check Component</h2>
-
-<p>To use the check component:</p>
-<ul>
-<li>
-<p>Set the check component&#39;s Boolean value to true:</p>
-<pre class="prettyprint">
-elm_check_state_set(check, EINA_TRUE);
-</pre>
 </li>
-<li>
-<p>Retrieve the current value of the check component:</p>
+<li>Register the <a href="#callback">callback</a> functions.
+<p>The following example shows how to define and register a callback for the <span style="font-family: Courier New,Courier,monospace">changed</span> signal:</p>
 <pre class="prettyprint">
-Eina_Bool value = elm_check_state_get(check);
-</pre>
-</li>
+evas_object_smart_callback_add(check, &quot;changed&quot;, changed_cb, data);
 
-<li>
-<p>Retrieve the content set to the check component:</p>
+void
+changed_cb(void *data, Evas_Object *obj, void *event_info)
+{
+&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;The value has changed\n&quot;);
+}
+</pre>
+   </li>
+</ol>
+
+<p>The following example shows a simple use case of the check component.</p>
+<table border="0">
+   <caption>Example: Check use case</caption>
+   <tbody>
+      <tr>
+         <td>
 <pre class="prettyprint">
-/* Get the icon part content */
-Evas_Object *icon = elm_object_part_content_get(check, &quot;icon&quot;);
+Evas_Object *win;
+Evas_Object *conf;
+Evas_Object *nf;
+Evas_Object *box;
+Evas_Object *check;
+
+/* Starting right after <a href="ui_layouts_n.htm#code">the basic EFL UI layout code</a> */
+/* win - conformant - naviframe */
+
+/* Add a box to pack a check */
+box = elm_box_add(nf);
+evas_object_show(box);
+elm_naviframe_item_push(nf, &quot;Check&quot;, NULL, NULL, box, NULL);
+
+check = elm_check_add(box);
+
+elm_object_style_set(check, &quot;default&quot;);
+evas_object_show(check);
+elm_box_pack_end(box, check);
+
+check = elm_check_add(box);
+elm_object_style_set(check, &quot;on&amp;off&quot;);
+evas_object_show(check);
+elm_box_pack_end(box, check);
 </pre>
-</li>
-</ul>
+         </td>
+         <td>
+            <p align="center"><img alt="Circle check component" src="../../../images/check_wear_sq_default.png" /><img alt="Rect check component" src="../../../images/check_wear_circle_default.png"  /></p>
+         </td>
+      </tr>
+   </tbody>
+</table>
+
+
+<h2 id="style">Styles</h2>
+<p>The following table lists the available component styles.</p>
+<table>
+   <caption>Table: Check styles for rectangular devices</caption>
+   <tbody>
+                <tr>
+                               <th>Style</th>
+                               <th>Sample</th>
+                               <th>Text part</th>
+                </tr>
+                <tr>
+                               <td><span style="font-family: Courier New,Courier,monospace">default</span></td>
+                               <td align="center"><img alt="elm/check/base/default" src="../../../images/rect_default_popup.png" /></td>
+                               <td>N/A</td>
+                </tr>
+                <tr>
+                               <td><span style="font-family: Courier New,Courier,monospace">on&amp;off</span></td>
+                               <td align="center"><img alt="elm/check/base/on&amp;off" src="../../../images/rect_onoff.png" /></td>
+                               <td>N/A</td>
+                </tr>
+
+                <tr>
+                               <td><span style="font-family: Courier New,Courier,monospace">popup</span></td>
+                               <td align="center"><img alt="elm/check/base/popup" src="../../../images/rect_default_popup.png" /></td>
+                               <td><span style="font-family: Courier New,Courier,monospace">default</span></td>
+                </tr>
+
+
+   </tbody>
+</table>
+
 
-<h2 id="Using_Check_Callbacks" name="Using_Check_Callbacks">Using the Check Callbacks</h2>
+<table>
+   <caption>Table: Check styles for circular devices</caption>
+   <tbody>
+      <tr>
+         <th>Style</th>
+         <th>Sample</th>
+         <th>Text part</th>
+      </tr>
+      <tr>
+         <td><span style="font-family: Courier New,Courier,monospace">default</span></td>
+         <td align="center"><img alt="elm/check/base/default" src="../../../images/circle_default.png" /></td>
+                                <td>N/A</td>
+      </tr>
+      <tr>
+         <td><span style="font-family: Courier New,Courier,monospace">on&amp;off</span></td>
+         <td align="center"><img alt="elm/check/base/on&amp;off" src="../../../images/circle_onoff.png" /></td>
+         <td>N/A</td>
+      </tr>
+      <tr>
+         <td><span style="font-family: Courier New,Courier,monospace">small popup</span></td>
+         <td align="center"><img alt="elm/check/base/popup" src="../../../images/circle_small_popup.png" /></td>
+         <td><span style="font-family: Courier New,Courier,monospace">default</span></td>
+      </tr>
+   </tbody>
+</table>
+
+<h2 id="callback">Callbacks</h2>
+
+<p>You can register callback functions connected to the following signals for a check object.</p>
+
+<table>
+   <caption>Table: Check callback signals</caption>
+   <tbody>
+      <tr>
+         <th>Signal</th>
+         <th>Description</th>
+         <th><span style="font-family: Courier New,Courier,monospace">event_info</span></th>
+      </tr>
+      <tr>
+         <td><span style="font-family: Courier New,Courier,monospace">changed</span></td>
+         <td>The check component value changes.</td>
+         <td><span style="font-family: Courier New,Courier,monospace;">NULL</span></td>
+      </tr>
+   </tbody>
+</table>
 
-<p>To receive notifications about the check events, listen to the <span style="font-family: Courier New,Courier,monospace">changed</span> signal, which is called when the check component value changes.</p>
 
 <table class="note">
     <tbody>
@@ -151,25 +219,6 @@ Evas_Object *icon = elm_object_part_content_get(check, &quot;icon&quot;);
     </tbody>
 </table>
 
-<p>The <span style="font-family: Courier New,Courier,monospace;">event_info</span> callback parameter is <span style="font-family: Courier New,Courier,monospace;">NULL</span>.</p>
-<p>To register and define a callback for the <span style="font-family: Courier New,Courier,monospace">changed</span> signal:</p>
-
-<pre class="prettyprint">
-{
-&nbsp;&nbsp;&nbsp;&nbsp;evas_object_smart_callback_add(check, &quot;changed&quot;, changed_cb, data);
-}
-
-/* Callback for the &quot;changed&quot; signal */
-/* Called when the check value changes */
-void
-changed_cb(void *data, Evas_Object *obj, void *event_info)
-{
-&nbsp;&nbsp;&nbsp;&nbsp;dlog_print(DLOG_INFO, LOG_TAG, &quot;The value has changed\n&quot;);
-}
-</pre>
-
-
 <table class="note">
     <tbody>
         <tr>
@@ -190,7 +239,7 @@ changed_cb(void *data, Evas_Object *obj, void *event_info)
 
 <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> 
+</div>
 
 
 <script type="text/javascript">
@@ -206,4 +255,3 @@ var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga
 
 </body>
 </html>
-