[Docs] Updating docs/src for Tizen 4.0 07/159507/3
authorSzymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
Thu, 9 Nov 2017 09:28:52 +0000 (10:28 +0100)
committerSzymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
Wed, 15 Nov 2017 07:29:21 +0000 (08:29 +0100)
+ adding conversion table
+ adding guide for example WIDL code style

Change-Id: I59a6d885b567a848c546f0ef3e660057558bfa58
Signed-off-by: Szymon Jastrzebski <s.jastrzebsk@partner.samsung.com>
15 files changed:
doc/README.md
doc/Tizen Avengers - WebApi Guidelines.pdf
doc/Type conversion table.xlsx [new file with mode: 0644]
doc/html/index.html
doc/package.json
doc/src/appendices.md [new file with mode: 0644]
doc/src/appendix_a.md [new file with mode: 0644]
doc/src/appendix_b.md [new file with mode: 0644]
doc/src/guideline.md
doc/src/implementation_cc.md
doc/src/implementation_js.md
doc/src/index.md
doc/src/plugin_structure.md
doc/src/tools.md
doc/src/widl.md

index 8c084bd04f3b73fca0381e8732b78425f22e6467..68c9b63be9a0e88060ca2e3f0b6204c587500d5a 100644 (file)
@@ -4,7 +4,7 @@ HTML is generated from markdown files by:
 npm install # only once to install required packages
 npm run-script generate
 
-PDF is generated by "Print to PDF" in Chrome browser.
+PDF is generated by "Print to PDF" (CTRL+P) in Chrome browser.
 
 =====================================================
 Troubleshooting:
index ac6172fc59857b9e828bce366334d124efa16273..83cce2c43b3dda39ab3693b3b8b4a03c74e03c66 100644 (file)
Binary files a/doc/Tizen Avengers - WebApi Guidelines.pdf and b/doc/Tizen Avengers - WebApi Guidelines.pdf differ
diff --git a/doc/Type conversion table.xlsx b/doc/Type conversion table.xlsx
new file mode 100644 (file)
index 0000000..e29e154
Binary files /dev/null and b/doc/Type conversion table.xlsx differ
index 1328643e650d0d99a6d7856c3bfc867b6188bb07..7253e5abdc8cb910ad5ecc8b6b2e6266a6ec1fa7 100644 (file)
@@ -12,7 +12,7 @@
        <div class="separator"></div>
        <a title="Tizen Avengers - WebApi Guidelines" class="brand" href="#" style="background-image:url(images/tizen-logo_32h.png)"></a>
        <div class="separator"></div>
-       <ul id="sections"><li class="l2"><a href="#revision-history">Revision History</a></li><li class="l2"><a href="#overview">Overview</a></li><li class="l2"><a href="#guideline">Guideline</a><ul><li class="l3"><a href="#guideline/languages">Languages</a></li><li class="l3"><a href="#guideline/coding-style">Coding style</a></li><li class="l3"><a href="#guideline/api-guide">API guide</a></li><li class="l3"><a href="#guideline/unit-test-criteria">Unit test criteria</a></li><li class="l3"><a href="#guideline/source-code">Source code</a></li><li class="l3"><a href="#guideline/license-and-boilerplate">License and Boilerplate</a></li></ul></li><li class="l2"><a href="#plugin-structure">Plugin Structure</a><ul><li class="l3"><a href="#plugin-structure/conventions">Conventions</a></li><li class="l3"><a href="#plugin-structure/structure">Structure</a></li><li class="l3"><a href="#plugin-structure/spec-file">Spec file</a></li><li class="l3"><a href="#plugin-structure/manifest-file">Manifest file</a></li><li class="l3"><a href="#plugin-structure/gyp-file">GYP file</a></li><li class="l3"><a href="#plugin-structure/implementation-files">Implementation files</a></li><li class="l3"><a href="#plugin-structure/plugin-flow">Plugin flow</a></li></ul></li><li class="l2"><a href="#widl">WIDL</a><ul><li class="l3"><a href="#widl/conventions">Conventions</a></li><li class="l3"><a href="#widl/architecture">Architecture</a></li><li class="l3"><a href="#widl/example">Example</a></li></ul></li><li class="l2"><a href="#tools">Tools</a><ul><li class="l3"><a href="#tools/generate-stub-code">Generate stub code</a></li><li class="l3"><a href="#tools/using-multiple-javascript-files">Using multiple JavaScript files</a></li></ul></li><li class="l2"><a href="#implementation-javascript">Implementation - JavaScript</a><ul><li class="l3"><a href="#implementation-javascript/interface-creation">Interface creation</a></li><li class="l3"><a href="#implementation-javascript/creating-manager-entity">Creating Manager entity</a></li><li class="l3"><a href="#implementation-javascript/properties-definition">Properties definition</a></li><li class="l3"><a href="#implementation-javascript/methods-definition">Methods definition</a></li><li class="l3"><a href="#implementation-javascript/exporting-interface">Exporting interface</a></li><li class="l3"><a href="#implementation-javascript/utils">Utils</a></li><li class="l3"><a href="#implementation-javascript/exceptions">Exceptions</a></li><li class="l3"><a href="#implementation-javascript/synchronous-methods">Synchronous methods</a></li><li class="l3"><a href="#implementation-javascript/asynchronous-methods">Asynchronous methods</a></li><li class="l3"><a href="#implementation-javascript/listeners">Listeners</a></li></ul></li><li class="l2"><a href="#implementation-c">Implementation - C++</a><ul><li class="l3"><a href="#implementation-c/lifecycle-and-plugin-state">Lifecycle and plugin state</a></li><li class="l3"><a href="#implementation-c/privileges">Privileges</a></li><li class="l3"><a href="#implementation-c/namespace-and-entry-points">Namespace and entry points</a></li><li class="l3"><a href="#implementation-c/plugin-structure">Plugin structure</a></li><li class="l3"><a href="#implementation-c/asynchronous-calls">Asynchronous calls</a></li><li class="l3"><a href="#implementation-c/listeners">Listeners</a></li><li class="l3"><a href="#implementation-c/logger">Logger</a></li><li class="l3"><a href="#implementation-c/error-handling">Error handling</a></li></ul></li><li class="l2"><a href="#devel-package">Devel package</a><ul><li class="l3"><a href="#devel-package/package-structure">Package structure</a></li><li class="l3"><a href="#devel-package/creating-custom-web-device-plugins-module">Creating custom web device plugins module</a></li></ul></li></ul>
+       <ul id="sections"><li class="l2"><a href="#revision-history">Revision History</a></li><li class="l2"><a href="#overview">Overview</a></li><li class="l2"><a href="#guideline">Guideline</a><ul><li class="l3"><a href="#guideline/languages">Languages</a></li><li class="l3"><a href="#guideline/coding-style">Coding style</a></li><li class="l3"><a href="#guideline/api-guide">API guide</a></li><li class="l3"><a href="#guideline/unit-test-criteria">Unit test criteria</a></li><li class="l3"><a href="#guideline/source-code">Source code</a></li><li class="l3"><a href="#guideline/license-and-boilerplate">License and Boilerplate</a></li></ul></li><li class="l2"><a href="#plugin-structure">Plugin Structure</a><ul><li class="l3"><a href="#plugin-structure/conventions">Conventions</a></li><li class="l3"><a href="#plugin-structure/structure">Structure</a></li><li class="l3"><a href="#plugin-structure/spec-file">Spec file</a></li><li class="l3"><a href="#plugin-structure/manifest-file">Manifest file</a></li><li class="l3"><a href="#plugin-structure/gyp-file">GYP file</a></li><li class="l3"><a href="#plugin-structure/implementation-files">Implementation files</a></li><li class="l3"><a href="#plugin-structure/plugin-flow">Plugin flow</a></li><li class="l3"><a href="#plugin-structure/tizen-unified">Tizen Unified</a></li></ul></li><li class="l2"><a href="#widl">WIDL</a><ul><li class="l3"><a href="#widl/conventions">Conventions</a></li><li class="l3"><a href="#widl/architecture">Architecture</a></li><li class="l3"><a href="#widl/example-code-style">Example code style</a></li><li class="l3"><a href="#widl/example">Example</a></li></ul></li><li class="l2"><a href="#tools">Tools</a><ul><li class="l3"><a href="#tools/generate-stub-code">Generate stub code</a></li><li class="l3"><a href="#tools/using-multiple-javascript-files">Using multiple JavaScript files</a></li><li class="l3"><a href="#tools/format-code">Format code</a></li></ul></li><li class="l2"><a href="#implementation-javascript">Implementation - JavaScript</a><ul><li class="l3"><a href="#implementation-javascript/interface-creation">Interface creation</a></li><li class="l3"><a href="#implementation-javascript/creating-manager-entity">Creating Manager entity</a></li><li class="l3"><a href="#implementation-javascript/properties-definition">Properties definition</a></li><li class="l3"><a href="#implementation-javascript/methods-definition">Methods definition</a></li><li class="l3"><a href="#implementation-javascript/exporting-interface">Exporting interface</a></li><li class="l3"><a href="#implementation-javascript/utils">Utils</a></li><li class="l3"><a href="#implementation-javascript/exceptions">Exceptions</a></li><li class="l3"><a href="#implementation-javascript/synchronous-methods">Synchronous methods</a></li><li class="l3"><a href="#implementation-javascript/asynchronous-methods">Asynchronous methods</a></li><li class="l3"><a href="#implementation-javascript/listeners">Listeners</a></li></ul></li><li class="l2"><a href="#implementation-c">Implementation - C++</a><ul><li class="l3"><a href="#implementation-c/lifecycle-and-plugin-state">Lifecycle and plugin state</a></li><li class="l3"><a href="#implementation-c/privileges">Privileges</a></li><li class="l3"><a href="#implementation-c/namespace-and-entry-points">Namespace and entry points</a></li><li class="l3"><a href="#implementation-c/plugin-structure">Plugin structure</a></li><li class="l3"><a href="#implementation-c/dependencies-between-plugins">Dependencies between plugins</a></li><li class="l3"><a href="#implementation-c/asynchronous-calls">Asynchronous calls</a></li><li class="l3"><a href="#implementation-c/listeners">Listeners</a></li><li class="l3"><a href="#implementation-c/logger">Logger</a></li><li class="l3"><a href="#implementation-c/error-handling">Error handling</a></li></ul></li><li class="l2"><a href="#devel-package">Devel package</a><ul><li class="l3"><a href="#devel-package/package-structure">Package structure</a></li><li class="l3"><a href="#devel-package/creating-custom-web-device-plugins-module">Creating custom web device plugins module</a></li></ul></li><li class="l2"><a href="#appendices">Appendices</a><ul><li class="l3"><a href="#appendices/appendix-a-type-conversion-tables">Appendix A - type conversion tables</a></li><li class="l3"><a href="#appendices/appendix-b-javascript-code-example-style-guide">Appendix B - Javascript code example style guide</a></li></ul></li></ul>
        <div class="separator"></div>
        <div class="extra generated">
                Generated by <a href="https://github.com/DimitarChristoff/doctor" target="_blank" title="generate documentation from markdown">Doctor, MD</a>
 <td>0.1.0</td>
 <td>2015-05-15</td>
 <td>Initial Draft</td>
-<td>Wojciech Kosowicz<br><a href="mailto:w.kosowicz@samsung.com">&#119;&#x2e;&#107;&#x6f;&#x73;&#x6f;&#119;&#x69;&#x63;&#122;&#64;&#115;&#x61;&#x6d;&#115;&#117;&#110;&#103;&#46;&#99;&#x6f;&#109;</a></td>
+<td>Wojciech Kosowicz<br><a href="mailto:w.kosowicz@samsung.com">&#119;&#x2e;&#x6b;&#111;&#x73;&#111;&#119;&#105;&#99;&#x7a;&#64;&#115;&#x61;&#109;&#115;&#117;&#110;&#x67;&#x2e;&#99;&#x6f;&#x6d;</a></td>
 </tr>
 <tr>
 <td>0.2.0</td>
 <td>2015-05-22</td>
 <td>Extended version</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">&#112;&#x2e;&#107;&#x61;&#99;&#122;&#109;&#97;&#x72;&#101;&#x6b;&#51;&#64;&#115;&#97;&#x6d;&#115;&#x75;&#110;&#x67;&#46;&#x63;&#111;&#109;</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">&#x70;&#x2e;&#107;&#97;&#99;&#122;&#x6d;&#x61;&#x72;&#x65;&#107;&#x33;&#64;&#115;&#97;&#109;&#x73;&#117;&#x6e;&#x67;&#x2e;&#99;&#x6f;&#x6d;</a></td>
 </tr>
 <tr>
 <td>0.2.1</td>
 <td>2015-06-01</td>
 <td>Proofreading</td>
-<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">&#x72;&#x2e;&#x67;&#x61;&#108;&#107;&#97;&#x40;&#x73;&#97;&#x6d;&#x73;&#x75;&#110;&#103;&#x2e;&#99;&#111;&#109;</a></td>
+<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">&#x72;&#46;&#x67;&#x61;&#x6c;&#107;&#97;&#64;&#115;&#97;&#109;&#115;&#117;&#110;&#103;&#46;&#x63;&#111;&#109;</a></td>
 </tr>
 <tr>
 <td>0.3.0</td>
 <td>2015-06-08</td>
 <td>Supplemented C++ implementation guide</td>
-<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">&#114;&#x2e;&#103;&#97;&#108;&#107;&#97;&#x40;&#x73;&#97;&#109;&#x73;&#117;&#x6e;&#x67;&#x2e;&#x63;&#x6f;&#109;</a></td>
+<td>Rafal Galka<br><a href="mailto:r.galka@samsung.com">&#114;&#46;&#103;&#x61;&#108;&#x6b;&#97;&#64;&#x73;&#x61;&#x6d;&#x73;&#x75;&#110;&#x67;&#x2e;&#99;&#111;&#x6d;</a></td>
 </tr>
 <tr>
 <td>0.4.0</td>
 <td>2015-06-16</td>
 <td>Guideline</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">&#x70;&#46;&#x6b;&#97;&#99;&#122;&#x6d;&#x61;&#x72;&#x65;&#107;&#x33;&#x40;&#x73;&#x61;&#x6d;&#x73;&#x75;&#x6e;&#103;&#x2e;&#99;&#x6f;&#x6d;</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">&#x70;&#x2e;&#107;&#97;&#x63;&#122;&#x6d;&#97;&#x72;&#x65;&#107;&#51;&#64;&#x73;&#97;&#109;&#x73;&#x75;&#110;&#103;&#x2e;&#99;&#111;&#109;</a></td>
 </tr>
 <tr>
 <td>0.5.0</td>
 <td>2015-06-18</td>
 <td>Devel package</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">&#x70;&#46;&#107;&#97;&#99;&#x7a;&#109;&#97;&#114;&#101;&#107;&#x33;&#64;&#x73;&#97;&#x6d;&#115;&#x75;&#110;&#103;&#x2e;&#99;&#x6f;&#x6d;</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">&#x70;&#46;&#x6b;&#97;&#99;&#122;&#x6d;&#x61;&#114;&#101;&#107;&#51;&#64;&#x73;&#x61;&#109;&#115;&#117;&#110;&#103;&#x2e;&#99;&#111;&#109;</a></td>
 </tr>
 <tr>
 <td>0.5.1</td>
 <td>2015-06-24</td>
 <td>Add info about WAPIOven.py</td>
-<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">&#112;&#46;&#107;&#97;&#99;&#x7a;&#x6d;&#x61;&#x72;&#x65;&#x6b;&#51;&#64;&#x73;&#97;&#x6d;&#115;&#x75;&#110;&#103;&#x2e;&#x63;&#111;&#x6d;</a></td>
+<td>Pawel Kaczmarek<br><a href="mailto:p.kaczmarek3@samsung.com">&#112;&#x2e;&#107;&#97;&#x63;&#122;&#109;&#97;&#x72;&#101;&#x6b;&#51;&#64;&#115;&#x61;&#109;&#x73;&#117;&#x6e;&#x67;&#x2e;&#99;&#x6f;&#x6d;</a></td>
 </tr>
 <tr>
 <td>0.6.0</td>
 <td>2016-10-28</td>
 <td>update devel package for tizen 3.0</td>
-<td>Annie Park<br><a href="mailto:hj.na.park@samsung.com">&#104;&#x6a;&#46;&#110;&#97;&#x2e;&#112;&#97;&#x72;&#107;&#64;&#115;&#x61;&#x6d;&#x73;&#x75;&#110;&#x67;&#x2e;&#99;&#x6f;&#x6d;</a></td>
+<td>Annie Park<br><a href="mailto:hj.na.park@samsung.com">&#x68;&#106;&#x2e;&#x6e;&#97;&#x2e;&#x70;&#97;&#x72;&#x6b;&#x40;&#115;&#x61;&#109;&#x73;&#117;&#110;&#103;&#x2e;&#99;&#111;&#x6d;</a></td>
+</tr>
+<tr>
+<td>0.7.0</td>
+<td>2017-11-09</td>
+<td>Update guidelines for Tizen 4.0</td>
+<td>Szymon Jastrzębski<br><a href="mailto:s.jastrzebsk@partner.samsung.com">&#x73;&#x2e;&#106;&#97;&#115;&#116;&#114;&#122;&#101;&#x62;&#x73;&#x6b;&#x40;&#112;&#97;&#114;&#116;&#x6e;&#101;&#x72;&#46;&#115;&#97;&#109;&#x73;&#117;&#x6e;&#103;&#x2e;&#x63;&#111;&#109;</a></td>
 </tr>
 </tbody>
 </table>
@@ -90,9 +96,12 @@ Each plugin should be written with great attention on JavaScript.</p>
 <h3 id="guideline/languages">Languages</h3>
 <p>C++, JavaScript</p>
 <h3 id="guideline/coding-style">Coding style</h3>
-<p>Use Google style guide,
-C++: <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.html">http://google-styleguide.googlecode.com/svn/trunk/cppguide.html</a></p>
-<p>JavaScript: <a href="http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml">http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml</a></p>
+<p>Use Google style guides (with small exceptions):</p>
+<p>C++: <a href="https://google.github.io/styleguide/cppguide.html">https://google.github.io/styleguide/cppguide.html</a></p>
+<p>JavaScript: <a href="https://google.github.io/styleguide/jsguide.html">https://google.github.io/styleguide/jsguide.html</a></p>
+<p>On branches <code>tizen_3.0</code> and higher, the C++ <del>and JavaScript</del> files are formatted using scripts,
+which its usage is described in the <a href="#tools/format-code">Format code</a> section of this document.
+The section also describes where the exceptions from Google coding style are defined.</p>
 <h3 id="guideline/api-guide">API guide</h3>
 <p>Tizen Web Device API Guide Lines.pptx
 <a href="http://platform.sec.samsung.net/slp/Tizen/Tizen%20Managed%20API/Web%20Device%20API/Tizen%20Web%20Device%20API%20Guide%20Lines.pptx">http://platform.sec.samsung.net/slp/Tizen/Tizen%20Managed%20API/Web%20Device%20API/Tizen%20Web%20Device%20API%20Guide%20Lines.pptx</a></p>
@@ -105,15 +114,15 @@ C++: <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.html">h
 $ cd webapi-plugins
 $ git checkout origin/tizen_2.4
 </code></pre>
-<p>For Tizen 3.0</p>
-<pre><code class="lang-sh">$ git clone ssh://&lt;user.id&gt;@168.219.209.56:29418/framework/web/webapi-plugins
+<p>For Tizen 3.0 and higher</p>
+<pre><code class="lang-sh">$ git clone ssh://&lt;user.id&gt;@review.tizen.org:29418/platform/core/api/webapi-plugins &amp;&amp; scp -p -P 29418 &lt;user.id&gt;@review.tizen.org:hooks/commit-msg webapi-plugins/.git/hooks/
 $ cd webapi-plugins
-$ git checkout origin/tizen_3.0
+$ git checkout origin/tizen_&lt;tizen_version&gt;
 </code></pre>
 <h3 id="guideline/license-and-boilerplate">License and Boilerplate</h3>
 <p>Use this boilerplate in every new created source files.</p>
 <pre><code class="lang-sh">/*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) &lt;year of file creation&gt; Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the &quot;License&quot;);
  *    you may not use this file except in compliance with the License.
@@ -141,13 +150,25 @@ $ git checkout origin/tizen_3.0
 <li><code>&lt;pluginname&gt;_instance.h</code></li>
 <li><code>&lt;pluginname&gt;_instance.cc</code></li>
 </ul>
+<p>Additionally, plugins may contain below structure, depending on the WIDL specification file:</p>
+<ul>
+<li><code>&lt;pluginname&gt;_client.h</code></li>
+<li><code>&lt;pluginname&gt;_client.cc</code></li>
+<li><code>&lt;pluginname&gt;_server.h</code></li>
+<li><code>&lt;pluginname&gt;_server.cc</code></li>
+<li><code>&lt;pluginname&gt;_service.h</code></li>
+<li><code>&lt;pluginname&gt;_service.cc</code></li>
+<li><code>&lt;pluginname&gt;_util.h</code></li>
+<li><code>&lt;pluginname&gt;_util.cc</code></li>
+</ul>
+<p>and other files with similar naming-convention needed by the developer.</p>
 <h3 id="plugin-structure/spec-file">Spec file</h3>
 <p>Spec file (<code>webapi-plugins.spec</code>) kept inside <code>packaging/</code> directory
-is build specification file used by RPM packaging system where variables are defined.
+is build specification file used by RPM packaging system where variables are defined.
 Those variables can be used to include or exclude particular modules from
 build for each profile (mobile, TV, wearable).</p>
 <h3 id="plugin-structure/manifest-file">Manifest file</h3>
-<p>Each RPM package must have a manifest file where developers can specify the access control domain
+<p>Each RPM package must have a manifest file, where developers can specify the access control domain
 in which their application should be running and potentially additional security policies for the
 application. It is necessary to build the project. The manifest file (<code>webapi-plugins.manifest</code>)
 is located in the root directory of the project.</p>
@@ -168,7 +189,7 @@ These files are responsible for communication between JavaScript layer and Nativ
 This file contains all methods required by each API.
 All operation should be done by JavaScript as much as possible.
 If JavaScript can do something, it should do it.
-This file is responsible for checking arguments, calling C++ methods etc.</li>
+This file is responsible for checking and validating arguments, calling C++ methods etc.</li>
 </ul>
 <h3 id="plugin-structure/plugin-flow">Plugin flow</h3>
 <p><img src="images/plugin_flow.png" alt="Plugin flow"></p>
@@ -178,11 +199,26 @@ This file is responsible for checking arguments, calling C++ methods etc.</li>
 This information consists of type of call (asynchronous, synchronous)
 arguments given by user, any additional information that is required to
 successfully acquire required data. Data is sent in form of JSON.</li>
-<li>C++ parses acquired JSON. After the data is processed. Appropriate platform
+<li>C++ parses acquired JSON. After the data is processed, appropriate platform
 functions are called with the specified arguments.</li>
 <li>Platform returns specified values to C++ layer.</li>
-<li>Another JSON is formed. It consists of data that was acquired from platform.</li>
+<li>Another JSON is formed. It consists of data that was acquired from platform.
+The data is sent to JavaScript layer.</li>
 </ol>
+<h3 id="plugin-structure/tizen-unified">Tizen Unified</h3>
+<p>With Tizen 4.0 an idea of Tizen Unified was introduced.</p>
+<p>Before Tizen 4.0, each profile specified in <code>.gbs.conf</code> file defined the package repositories
+for a single device type and a particular architecture.</p>
+<p>Since Tizen 4.0, each GBS profile is associated with a particular architecture and all device types.</p>
+<p>Each device with given profile and architecture requires to have at least 2 RPM files installed:</p>
+<pre><code class="lang-sh">webapi-plugins-x.y-z.ARCH.rpm
+webapi-plugins-profile_PROFILE_NAME-x.y-z.ARCH.rpm
+</code></pre>
+<p>However, emulators require to have 3 RPM files installed:</p>
+<pre><code class="lang-sh">webapi-plugins-x.y-z.i686.rpm
+webapi-plugins-profile_PROFILE_NAME-x.y-z.i686.rpm
+webapi-plugins-PROFILE_NAME-extension-emulator-x.y-z.i686.rpm
+</code></pre>
 <h2 id="widl">WIDL</h2>
 <h3 id="widl/conventions">Conventions</h3>
 <p>Currently WIDL version that is used in Samsung is described here: <a href="http://www.w3.org/TR/WebIDL/">http://www.w3.org/TR/WebIDL/</a>.
@@ -212,7 +248,7 @@ In interface definition you can put following members:</p>
 can be changed, if it is not read only.</li>
 <li>Operation: Interface member, which represents method inside object.
 It is a function of programming language, which can be executed and returns a result.</li>
-<li>Special operation: Performs a specific task. i.e. deleter, getter</li>
+<li>Special operation: Performs a specific task. i.e. deleter, getter.</li>
 <li>Static operation: It is not called for a specific instance of the interface,
 is called for static object regardless of an instance creation.
 It is connected with the interface itself.</li>
@@ -238,8 +274,8 @@ It is connected with the interface itself.</li>
 <pre class="prettyprint linenums"><code>Tizen implements ManagerObject
 </code></pre><p>To provide actual implementations of ManagerObject, instance of its Manager
 interface definition has to be made. Inside this Manager interface all attributes
-and functions that will be available form manager namespace, should be defined.
-There can be attributes which are other interfaces, operations and everything
+and functions that will be available from manager namespace, should be defined.
+There can be attributes, which are other interfaces, operations and everything
 that interfaces allows.</p>
 <p>Additional interface can be available as a standalone types not connected to
 global namespace. Those are either obtained from operation of other interfaces
@@ -270,7 +306,10 @@ lacks of keyword <code>FunctionOnly</code>.</p>
   void secondmethod(type somearg2, ... );
   any additional methods...
 };
-</code></pre><h3 id="widl/example">Example</h3>
+</code></pre><h3 id="widl/example-code-style">Example code style</h3>
+<p>Coding style for example codes put in the between <code>\code</code>  and <code>\endcode</code> tags
+should be written with respect to rules described in <a href="#appendices/appendix-b-javascript-code-example-style-guide">the Appendix B</a>.</p>
+<h3 id="widl/example">Example</h3>
 <p>Example of WIDL file:</p>
 <pre class="prettyprint linenums"><code>module Sample {
 
@@ -301,6 +340,7 @@ lacks of keyword <code>FunctionOnly</code>.</p>
 };
 </code></pre><h2 id="tools">Tools</h2>
 <h3 id="tools/generate-stub-code">Generate stub code</h3>
+<h4 id="-span-style-color-red-the-generator-is-no-longer-maintained-span-"><span style="color:red"><strong>The generator is no longer maintained.</strong></span></h4>
 <p>To generate stub files from the widl you can use stub generator located in
 <code>tools/skeleton_generator/</code> directory and run the python command:</p>
 <pre><code class="lang-sh">$ python WAPIOven.py -d &lt;stub code destination directory name&gt; &lt;widl directory/pluginname&gt;.widl
@@ -321,7 +361,7 @@ $ python WAPIOven.py -d ../../src/notification/ /web-device-api/web/widl/tizen/n
 <p>WIDL files can be found in the project repository:</p>
 <pre><code class="lang-sh">$ git clone ssh://&lt;username&gt;@168.219.209.56:29418/doc/web-device-api
 </code></pre>
-<p>The widl files are placed in: <code>web-device-api/web/widl/tizen/</code></p>
+<p>The widl files are placed in: <code>web-device-api/web/widl/tizen/</code> directory.</p>
 <p>Stub files generated by above command:</p>
 <pre><code class="lang-sh">&lt;pluginname&gt;_api.js
 &lt;pluginname&gt;_extension.h
@@ -350,11 +390,33 @@ plugin directory and place JavaScript files.</p>
 <p>To merge all JavaScript files <code>tools/mergejs.py</code> file is used.
 This script merge all files mentioned in <code>&lt;pluginname&gt;_api.js</code> file into one
 file before build process.</p>
+<h3 id="tools/format-code">Format code</h3>
+<p>To format code use scripts provided in the <code>tools/codestyle</code> directory.</p>
+<p><code>cpplint</code> is used to validate C++ and <code>eslint</code> for JavaScript files.</p>
+<p><strong>Currently, the JavaScript validator and formatter seems to be a little buggy,
+thus it is not recommended to use.</strong></p>
+<p>The developer needs to have <code>python</code>, <code>node.js</code>, <code>eslint</code>, <code>Closure Linter</code> and <code>clang-format</code> installed.</p>
+<p>It is worth to make life easier by creating symbolic link to <code>clang-format</code>.</p>
+<pre><code class="lang-sh">sudo ln -s /usr/bin/clang-format-&lt;clang format version&gt; /usr/bin/clang-format
+</code></pre>
+<p>For convenience, in the root of the project links were provided for easier access:</p>
+<ul>
+<li><code>code_format -&gt; tools/codestyle/code_formatter.sh</code></li>
+<li><code>code_validate -&gt; tools/codestyle/code_validation.sh</code></li>
+</ul>
+<p>Those scripts consist of configuration for rules regarding the Google style guides, with few exceptions.</p>
+<p>To format and validate C++ and JavaScript code run in the root of the project:</p>
+<pre><code class="lang-sh">./code_validate -a # -a for all, -c for C++, -js for JavaScript files
+./code_format -a   # use -h or --help for help
+</code></pre>
+<p>The scripts also accept a path to module&#39;s directory.
+By default every directory module in the <code>src</code> directory is used.</p>
+<p>For more details, please see <code>tools/codestyle/README</code> file.</p>
+<p>This rule concerns to branches <code>tizen_3.0</code> and above.</p>
 <h2 id="implementation-javascript">Implementation - JavaScript</h2>
 <p>Each plugin contains JavaScript files. This is the place where user input is
-being processed validated before send to C++ layer.</p>
-<p>Badge API will be used to show the creation of JavaScript file (lot of content
-of this file will be already generated via Stub Generator).</p>
+being processed validated before sending to C++ layer.</p>
+<p>Badge API will be used to show the creation of JavaScript file.</p>
 <h3 id="implementation-javascript/interface-creation">Interface creation</h3>
 <p>The WIDL of BadgeManager – main entity that holds all the API methods
 looks like following:</p>
@@ -406,12 +468,12 @@ var number = converter_.toLong(result);
 </code></pre>
 <h4 id="validator">Validator</h4>
 <p>When API JavaScript method is called first thing that has to be done in
-JavaScript layer of api implementation is to process and validate arguments
+JavaScript layer of API implementation is to process and validate arguments
 given by the user. The process of validation consists of ensuring that the
 proper amount of arguments was given and that they were of the expected
 type and throwing exception if necessary.</p>
 <p>Validator helps to ensure that user sent proper values. Validator is available
-at <code>xwalk.utils.validator</code> and predefined js types at <code>xwalk.utils.validator.types</code></p>
+at <code>xwalk.utils.validator</code> and predefined JavaScript types at <code>xwalk.utils.validator.types</code></p>
 <p>Below can be found example of using validator inside <code>setBadgeCount</code> method
 that requires appId in form of string and long count value:</p>
 <pre class="prettyprint linenums"><code class="lang-js">var validator_ = xwalk.utils.validator;
@@ -422,6 +484,9 @@ var args = validator_.validateArgs(arguments, [
   {name: &#39;count&#39;, type: types_.LONG}
 ]);
 </code></pre>
+<p>The <code>validateArgs</code> method may also validate optional and nullable arguments.
+See its definition in file <code>src/utils/utils_api.js</code>.</p>
+<p>This method respecting the JavaScript type conversion rules is presented <a href="#appendices/appendix-a-type-conversion-tables">the Appendix A - type conversion tables</a>.</p>
 <h3 id="implementation-javascript/exceptions">Exceptions</h3>
 <p>At some point whether improper data is received or given to JavaScript might
 require to throw exceptions. The example below shows how to throw properly
@@ -431,6 +496,8 @@ predefined exceptions:</p>
 </code></pre>
 <p>WebAPIException constructor takes as argument the type of error to be thrown.
 The second additional argument is error message.</p>
+<p>There might be a need to throw expception because of failure received from C++ layer,
+for this case see below section.</p>
 <h3 id="implementation-javascript/synchronous-methods">Synchronous methods</h3>
 <p>In order to perform synchronous operation (one that does not require callback
 and the result is given instantly) callSync() method of Native manager needs
@@ -450,9 +517,9 @@ Result is assigned to ret variable.</p>
 <h3 id="implementation-javascript/asynchronous-methods">Asynchronous methods</h3>
 <p>In order to work with method that requires callback instead of callSync(),
 call() method needs to be called. Apart from the first two arguments that are
-exactly the same as in call() method (c++ method binding, object) it takes
+exactly the same as in callSync() method (C++ method binding, object) it takes
 additional argument that is a function that will be called when the native
-call is processed:</p>
+call response is processed:</p>
 <pre class="prettyprint linenums"><code class="lang-js">var native_ = new xwalk.utils.NativeManager(extension);
 var callback = function(result) {
   if (native_.isFailure(result)) {
@@ -500,6 +567,13 @@ no strict reference between JavaScript and native data.<br>
 Example: If operation should change some object retrieved from platform,
 identifier should be passed again and additional check if object still exists
 should be made.</p>
+<p>According to <a href="https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables">Google C++ Style Guide</a> static variables should <strong>NOT</strong> be used.</p>
+<p>This rule concerns especially to <code>&lt;pluginname&gt;Manager</code>, <code>&lt;pluginname&gt;Client</code>,
+<code>&lt;pluginname&gt;Server</code> etc. classes, which tend to implement the Singleton design pattern.
+Because of this, the above mentioned classes&#39; instances should <strong>NOT</strong> be declared as <code>static</code>
+and should <strong>NOT</strong> be got through <code>getInstance</code> methods.
+Instead, the classes&#39;s instances should be declared as an <code>private</code> attribute of
+<code>&lt;pluginname&gt;Instance</code> class.</p>
 <h3 id="implementation-c/privileges">Privileges</h3>
 <p>Some of the API methods require privilege access. The privilege engine used in the project is Cynara.
 In Tizen 3.0 checking if application has privilege to call method has been moved to C++ layer. It&#39;s the
@@ -572,13 +646,66 @@ if (!result) {
 
 ReportSuccess(data, out);
 </code></pre>
+<h3 id="implementation-c/dependencies-between-plugins">Dependencies between plugins</h3>
+<p>To allow using methods from module <code>A</code> in module <code>B</code>, you need to add dependencies in <code>&lt;pluginname&gt;.gyp</code> files
+and add <code>XW_EXPORT</code> macro to the definition of methods in module <code>A</code>.</p>
+<p>In below example, linking <code>GetNotiHandleFromJson</code> method of <code>CommonNotification</code> class in module <code>Notification</code>
+is added to the <code>Alarm</code> module.</p>
+<ol>
+<li>Add dependency in <code>.gyp</code> file in module <code>B</code>, in this example it is <code>alarm.gyp</code>:<pre class="prettyprint linenums"><code>&#39;dependencies&#39;: [
+&#39;../common/common.gyp:tizen_common&#39;,
+&#39;../notification/notification.gyp:tizen_notification&#39;,  # add this line
+],
+</code></pre></li>
+<li>Add <code>XW_EXPORT</code> macro available in <code>src/common/XW_Extension.h</code> file to the definition of method from module <code>A</code>:<pre class="prettyprint linenums"><code class="lang-cpp">class UserNotification : public CommonNotification {
+// ...
+XW_EXPORT static common::PlatformResult GetNotiHandleFromJson(const picojson::value&amp; noti_val,
+                                                           bool is_update,
+                                                           notification_h* noti_handle);
+// ...
+}
+</code></pre>
+</li>
+<li>Add dependency in <code>.gyp</code> file in module <code>A</code>, in this example it is <code>notification.gyp</code>:<pre class="prettyprint linenums"><code>{
+&#39;includes&#39;: [
+ &#39;../common/common.gypi&#39;,
+],
+&#39;targets&#39;: [
+ {
+   &#39;target_name&#39;: &#39;tizen_notification&#39;,
+   &#39;type&#39;: &#39;loadable_module&#39;,
+   &#39;dependencies&#39;: [
+     &#39;../common/common.gyp:tizen_common&#39;,
+   ],
+   &#39;sources&#39;: [
+     # ...
+   ],
+   &#39;conditions&#39;: [
+     # ...
+   ],
+   &#39;direct_dependent_settings&#39;: {  # add this property
+     &#39;libraries&#39;: [
+       &#39;-ltizen_notification&#39;,
+     ],
+   },
+ },
+],
+}
+</code></pre></li>
+</ol>
+<p>To make sure you did the good work, you can list dynamic dependencies of given <code>.so</code> file with the <code>ldd</code> command:</p>
+<pre><code class="lang-sh">sh-user-3.2# ldd /usr/lib/tizen-extensions-crosswalk/libtizen_alarm.so | grep noti
+ldd: warning: you do not have execution permission for `/usr/lib/tizen-extensions-crosswalk/libtizen_alarm.so&#39;
+libtizen_notification.so =&gt; /usr/lib/tizen-extensions-crosswalk/libtizen_notification.so (0xb6e52000)  # OK!
+libnotification.so.0 =&gt; /lib/libnotification.so.0 (0xb6c93000)
+</code></pre>
 <h3 id="implementation-c/asynchronous-calls">Asynchronous calls</h3>
 <p>To perform asynchronous request <code>common::TaskQueue</code> component should be used.
 You should use lambda expression which calls business logic and passes result to
 JavaScript layer by calling <code>PostMessage(const char* msg)</code>.</p>
 <p>Asynchronous response is not matched to request automatically. You should pass
 <code>callbackId</code> received from JavaScript layer as an argument. It allows to
-call the appropriate user callback in JS async message handler.</p>
+call the appropriate user callback in JavaScript async message handler.</p>
 <pre class="prettyprint linenums"><code class="lang-cpp">auto search = [this, args]() -&gt; void {
 
   // business logic
@@ -635,8 +762,14 @@ LoggerI(&quot;Data size: %d&quot;, object-&gt;data-&gt;size);
 LoggerW(&quot;Data in %s object is empty&quot;, object-&gt;name);
 LoggerE(&quot;Error occurred while getting data [%d]&quot;, error);
 </code></pre>
+<p>Upon entering and leaving function&#39;s scope, a message should be printed with <code>DEBUG</code> priority using <code>ScopeLogger</code> macro:</p>
+<pre class="prettyprint linenums"><code class="lang-cpp">// print simply, default &quot;Enter&quot; log
+ScopeLogger();
+// print more detailed message
+ScopeLogger(&quot;state: %d; err: %s&quot;, (int) state, err);
+</code></pre>
 <h3 id="implementation-c/error-handling">Error handling</h3>
-<p>Regarding to <a href="http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Exceptions">Google C++ Style Guide</a> we do not use Exceptions.</p>
+<p>Regarding to <a href="https://google.github.io/styleguide/cppguide.html#Exceptions">Google C++ Style Guide</a> we do not use Exceptions.</p>
 <p>To deliver error conditions to JavaScript layer, that can occur in the platform,
 <code>LogAndReportError</code> or <code>ReportError</code> method should be used. All available error codes are defined
 in <code>common/platform_result.h</code></p>
@@ -828,6 +961,1220 @@ After build and installation webapi-plugins-test <code>webapis.test</code> names
 <pre class="prettyprint linenums"><code class="lang-javascript">var test = webapis.test.ping();
 console.log(test); // Hello!
 </code></pre>
+<h2 id="appendices">Appendices</h2>
+<h3 id="appendices/appendix-a-type-conversion-tables">Appendix A - type conversion tables</h3>
+<h4 id="type-conversion-tables">Type conversion tables</h4>
+<p>Below tables present convertions, which are performed by <code>validateArgs</code> method in
+<code>src/utils/utils_api.js</code> file before sending data to C++ layer.</p>
+<ul>
+<li>Boolean</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>false</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>false</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>false</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.POSITIVE_INFINITY</td>
+<td>true</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.NEGATIVE_INFINITY</td>
+<td>true</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-1</td>
+<td>true</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>false</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>1</td>
+<td>true</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>3.14</td>
+<td>true</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;&quot; (Empty String)</td>
+<td>false</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;0&quot;</td>
+<td>true</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>true</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ name : &quot;TIZEN&quot; }</td>
+<td>true</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>true</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Number : long</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>0</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.POSITIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.NEGATIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-1</td>
+<td>-1</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>1</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>3.14</td>
+<td>3</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;&quot; (Empty String)</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;-1&quot;</td>
+<td>-1</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;0&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;1&quot;</td>
+<td>1</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;3.14&quot;</td>
+<td>3</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ name : &quot;TIZEN&quot; }</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>0</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Number : unsigned long</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>0</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.POSITIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.NEGATIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-1</td>
+<td>4294967295</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>1</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>3.14</td>
+<td>3</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;&quot; (Empty String)</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;-1&quot;</td>
+<td>4294967295</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;0&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;1&quot;</td>
+<td>1</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ name : &quot;TIZEN&quot; }</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>0</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Number : unsigned long long</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>0</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.POSITIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.NEGATIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-1</td>
+<td>18446744073709551615</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>1</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>3.14</td>
+<td>3</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;&quot; (Empty String)</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;-1&quot;</td>
+<td>18446744073709551615</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;0&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;1&quot;</td>
+<td>1</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ name : &quot;TIZEN&quot; }</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>0</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Number : byte [-128, 127]</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>0</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.POSITIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.NEGATIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-1</td>
+<td>-1</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>1</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>3.14</td>
+<td>3</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-128</td>
+<td>-128</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-192</td>
+<td>64</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-256</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>127</td>
+<td>127</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>128</td>
+<td>-128</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>256</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;&quot; (Empty String)</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;0&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;1&quot;</td>
+<td>1</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;256&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ name : &quot;TIZEN&quot; }</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>0</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Number : double</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.POSITIVE_INFINITY</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.NEGATIVE_INFINITY</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-1</td>
+<td>-1</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>1</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>3.14</td>
+<td>3.14</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;&quot; (Empty String)</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;0&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;-3.14&quot;</td>
+<td>-3.14</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;3.14&quot;</td>
+<td>3.14</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ name : &quot;TIZEN&quot; }</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>TypeMismatchError</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>String</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>&quot;undefined&quot;</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>&quot;null&quot;</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>&quot;true&quot;</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>&quot;false&quot;</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>&quot;NaN&quot;</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.POSITIVE_INFINITY</td>
+<td>&quot;Infinity&quot;</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.NEGATIVE_INFINITY</td>
+<td>&quot;-Infinity&quot;</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-1</td>
+<td>&quot;-1&quot;</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>&quot;0&quot;</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>1</td>
+<td>&quot;1&quot;</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>3.14</td>
+<td>&quot;3.14&quot;</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ }</td>
+<td>&quot;[object Object]&quot;</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>&quot;function () { }&quot;</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Platform Object</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>nullable: null; non-nullable: TypeMismatchError</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{}</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>TypeMismatchError</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Function Object</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>nullable: null; non-nullable: TypeMismatchError</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ }</td>
+<td>TypeMismatchError</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Array Object</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>nullable: null; non-nullable: TypeMismatchError</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ }</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>TypeMismatchError</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Dictionary</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+<th>Comment</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>nullable: null; non-nullable: TypeMismatchError</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>TypeMismatchError</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ }</td>
+<td>{}</td>
+<td>No exception is thrown</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>function () { }</td>
+<td>No exception is thrown</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Octet [0, 255]</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>0</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>false</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>NaN</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.POSITIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>Number.NEGATIVE_INFINITY</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-1</td>
+<td>255</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>1</td>
+<td>1</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>3.14</td>
+<td>3</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-128</td>
+<td>128</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-192</td>
+<td>64</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>-256</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>256</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;&quot; (Empty String)</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;0&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;1&quot;</td>
+<td>1</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;256&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ name : &quot;TIZEN&quot; }</td>
+<td>0</td>
+</tr>
+<tr>
+<td>Function Object</td>
+<td>function () { }</td>
+<td>0</td>
+</tr>
+</tbody>
+</table>
+<ul>
+<li>Enum</li>
+</ul>
+<table class="table table-striped">
+<thead>
+<tr>
+<th>Input Type</th>
+<th>Input Value</th>
+<th>Result</th>
+<th>Comment</th>
+</tr>
+</thead>
+<tbody>
+<tr>
+<td>undefined</td>
+<td>undefined</td>
+<td>TypeMismatchError</td>
+<td>unless &quot;undefined&quot; is on the list of the Enum values</td>
+</tr>
+<tr>
+<td>null</td>
+<td>null</td>
+<td>TypeMismatchError</td>
+<td>unless &quot;null&quot; is one of the Enum values</td>
+</tr>
+<tr>
+<td>Number</td>
+<td>0</td>
+<td>TypeMismatchError</td>
+<td>unless &quot;0&quot; is one of the Enum values</td>
+</tr>
+<tr>
+<td>Boolean</td>
+<td>true</td>
+<td>TypeMismatchError</td>
+<td>unless &quot;true&quot; is one of the Enum values</td>
+</tr>
+<tr>
+<td>String</td>
+<td>&quot;TIZEN&quot;</td>
+<td>TypeMismatchError</td>
+<td>unless &quot;TIZEN&quot; is one of the Enum values</td>
+</tr>
+<tr>
+<td>String</td>
+<td>any of the Enum values</td>
+<td>given string</td>
+<td>Enum defines valid values, any of those values can be used and are accepted without conversion</td>
+</tr>
+<tr>
+<td>Object</td>
+<td>{ }</td>
+<td>TypeMismatchError</td>
+</tr>
+</tbody>
+</table>
+<h3 id="appendices/appendix-b-javascript-code-example-style-guide">Appendix B - Javascript code example style guide</h3>
+<h4 id="code-example-style-guide">Code Example Style Guide</h4>
+<p>Below guide lists rules of writing example code placed in the WIDL files.</p>
+<p><strong>Whitespaces</strong></p>
+<ul>
+<li>Use only spaces (do not use tabs), one level indent has two spaces</li>
+<li>No whitespace at the end of line</li>
+<li>One extra space after keywords which use round brackets (if, for, while, switch, catch, …)</li>
+<li>Add space between variables and operators</li>
+<li>Initialization lists<ul>
+<li>Space after colon but not before</li>
+<li>Space after comma</li>
+</ul>
+</li>
+</ul>
+<p><strong>Comments</strong></p>
+<ul>
+<li>Use double slash // (do not use /<em> </em>/)</li>
+<li>Start sentence with capital letter</li>
+<li>Do not use dot at the end</li>
+</ul>
+<pre class="prettyprint linenums"><code class="lang-js">// This is a simple comment
+</code></pre>
+<p><strong>Brackets</strong></p>
+<ul>
+<li>Body brackets<ul>
+<li>Opening and closing brackets in new lines</li>
+</ul>
+</li>
+<li>No extra whitespace inside brackets (after opening nor before closing)</li>
+</ul>
+<pre class="prettyprint linenums"><code class="lang-js">try
+{
+  var messages = [&quot;A&quot;, &quot;B&quot;];
+}
+catch (err)
+{
+  console.log(&quot;Error: &quot; + err.message);
+}
+</code></pre>
+<p><strong>Strings</strong></p>
+<ul>
+<li>Use only quotation marks (“), do not use apostrophes (‘) to create strings</li>
+</ul>
+<p><strong>console.log()</strong></p>
+<ul>
+<li>Start log with capital letter</li>
+<li>Do not use dots</li>
+<li>Add space after colon</li>
+</ul>
+<pre class="prettyprint linenums"><code class="lang-js">console.log(“This is example error: “ + err.message);
+</code></pre>
+<p><strong>Multi-line</strong></p>
+<ul>
+<li>Each line should not be more than 100 characters long</li>
+<li>Indentation in second line must match opening bracket</li>
+</ul>
+<pre class="prettyprint linenums"><code class="lang-js">console.log(&quot;This is console log information error: &quot; + error.message +
+            &quot; and there is more”);
+</code></pre>
+<p><strong>Functions with function as an argument</strong></p>
+<ul>
+<li>Name of the function should be written in line with previous function&#39;s closing bracket</li>
+<li>Other parameters can be put in the same line as function&#39;s closing bracket</li>
+</ul>
+<pre class="prettyprint linenums"><code class="lang-js">functionCalculate(&quot;First argument&quot;, function(e)
+{
+  console.log(&quot;Information: &quot; + e.message);
+}, function(e)
+{
+  console.log(&quot;Error: &quot; + e.message);
+}, &quot;Last argument&quot;);
+</code></pre>
+<p><strong>Statement separation</strong></p>
+<ul>
+<li>Each statement has to be in new line and has to end with semicolon</li>
+</ul>
 
 </div>
 <script src="js/mootools-yui-compressed.js"></script>
index 2a7a0694a894e1c9e1568c0f12e216dbb8290fd4..7ead273df6e0508b6e0ce7d1796b28cf391485c6 100644 (file)
@@ -1,6 +1,6 @@
 {
   "name": "WebApiGuidelines",
-  "version": "0.3.0",
+  "version": "0.7.0",
   "dependencies": {
     "doctor-md": "git://github.com/Hagith/doctor.git#print-css"
   },
diff --git a/doc/src/appendices.md b/doc/src/appendices.md
new file mode 100644 (file)
index 0000000..c4ab246
--- /dev/null
@@ -0,0 +1 @@
+## Appendices
diff --git a/doc/src/appendix_a.md b/doc/src/appendix_a.md
new file mode 100644 (file)
index 0000000..fea5a18
--- /dev/null
@@ -0,0 +1,259 @@
+### Appendix A - type conversion tables
+
+#### Type conversion tables
+
+Below tables present convertions, which are performed by ``validateArgs`` method in
+``src/utils/utils_api.js`` file before sending data to C++ layer.
+
+* Boolean
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|false|
+|null|null|false|
+|Number|NaN|false|
+|Number|Number.POSITIVE_INFINITY|true|
+|Number|Number.NEGATIVE_INFINITY|true|
+|Number|-1|true|
+|Number|0|false|
+|Number|1|true|
+|Number|3.14|true|
+|String|"" (Empty String)|false|
+|String|"0"|true|
+|String|"TIZEN"|true|
+|Object|{ name : "TIZEN" }|true|
+|Function Object|function () { }|true|
+
+* Number : long
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|0|
+|null|null|0|
+|Boolean|true|1|
+|Boolean|false|0|
+|Number|NaN|0|
+|Number|Number.POSITIVE_INFINITY|0|
+|Number|Number.NEGATIVE_INFINITY|0|
+|Number|-1|-1|
+|Number|0|0|
+|Number|1|1|
+|Number|3.14|3|
+|String|"" (Empty String)|0|
+|String|"-1"|-1|
+|String|"0"|0|
+|String|"1"|1|
+|String|"3.14"|3|
+|String|"TIZEN"|0|
+|Object|{ name : "TIZEN" }|0|
+|Function Object|function () { }|0|
+
+* Number : unsigned long
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|0|
+|null|null|0|
+|Boolean|true|1|
+|Boolean|false|0|
+|Number|NaN|0|
+|Number|Number.POSITIVE_INFINITY|0|
+|Number|Number.NEGATIVE_INFINITY|0|
+|Number|-1|4294967295|
+|Number|0|0|
+|Number|1|1|
+|Number|3.14|3|
+|String|"" (Empty String)|0|
+|String|"-1"|4294967295|
+|String|"0"|0|
+|String|"1"|1|
+|String|"TIZEN"|0|
+|Object|{ name : "TIZEN" }|0|
+|Function Object|function () { }|0|
+
+* Number : unsigned long long
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|0|
+|null|null|0|
+|Boolean|true|1|
+|Boolean|false|0|
+|Number|NaN|0|
+|Number|Number.POSITIVE_INFINITY|0|
+|Number|Number.NEGATIVE_INFINITY|0|
+|Number|-1|18446744073709551615|
+|Number|0|0|
+|Number|1|1|
+|Number|3.14|3|
+|String|"" (Empty String)|0|
+|String|"-1"|18446744073709551615|
+|String|"0"|0|
+|String|"1"|1|
+|String|"TIZEN"|0|
+|Object|{ name : "TIZEN" }|0|
+|Function Object|function () { }|0|
+
+* Number : byte [-128, 127]
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|0|
+|null|null|0|
+|Boolean|true|1|
+|Boolean|false|0|
+|Number|NaN|0|
+|Number|Number.POSITIVE_INFINITY|0|
+|Number|Number.NEGATIVE_INFINITY|0|
+|Number|-1|-1|
+|Number|0|0|
+|Number|1|1|
+|Number|3.14|3|
+|Number|-128|-128|
+|Number|-192|64|
+|Number|-256|0|
+|Number|127|127|
+|Number|128|-128|
+|Number|256|0|
+|String|"" (Empty String)|0|
+|String|"0"|0|
+|String|"1"|1|
+|String|"256"|0|
+|String|"TIZEN"|0|
+|Object|{ name : "TIZEN" }|0|
+|Function Object|function () { }|0|
+
+* Number : double
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|TypeMismatchError|
+|null|null|0|
+|Boolean|true|1|
+|Boolean|false|0|
+|Number|NaN|TypeMismatchError|
+|Number|Number.POSITIVE_INFINITY|TypeMismatchError|
+|Number|Number.NEGATIVE_INFINITY|TypeMismatchError|
+|Number|-1|-1|
+|Number|0|0|
+|Number|1|1|
+|Number|3.14|3.14|
+|String|"" (Empty String)|0|
+|String|"0"|0|
+|String|"-3.14"|-3.14|
+|String|"3.14"|3.14|
+|String|"TIZEN"|TypeMismatchError|
+|Object|{ name : "TIZEN" }|TypeMismatchError|
+|Function Object|function () { }|TypeMismatchError|
+
+* String
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|"undefined"|
+|null|null|"null"|
+|Boolean|true|"true"|
+|Boolean|false|"false"|
+|Number|NaN|"NaN"|
+|Number|Number.POSITIVE_INFINITY|"Infinity"|
+|Number|Number.NEGATIVE_INFINITY|"-Infinity"|
+|Number|-1|"-1"|
+|Number|0|"0"|
+|Number|1|"1"|
+|Number|3.14|"3.14"|
+|Object|{ }|"[object Object]"|
+|Function Object|function () { }|"function () { }"|
+
+* Platform Object
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|TypeMismatchError|
+|null|null|nullable: null; non-nullable: TypeMismatchError|
+|Boolean|true|TypeMismatchError|
+|Boolean|false|TypeMismatchError|
+|Number|NaN|TypeMismatchError|
+|Number|0|TypeMismatchError|
+|String|"TIZEN"|TypeMismatchError|
+|Object|{}|TypeMismatchError|
+|Function Object|function () { }|TypeMismatchError|
+
+* Function Object
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|TypeMismatchError|
+|null|null|nullable: null; non-nullable: TypeMismatchError|
+|Boolean|true|TypeMismatchError|
+|Boolean|false|TypeMismatchError|
+|Number|NaN|TypeMismatchError|
+|Number|0|TypeMismatchError|
+|String|"TIZEN"|TypeMismatchError|
+|Object|{ }|TypeMismatchError|
+
+* Array Object
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|TypeMismatchError|
+|null|null|nullable: null; non-nullable: TypeMismatchError|
+|Boolean|true|TypeMismatchError|
+|Boolean|false|TypeMismatchError|
+|Number|NaN|TypeMismatchError|
+|Number|0|TypeMismatchError|
+|String|"TIZEN"|TypeMismatchError|
+|Object|{ }|TypeMismatchError|
+|Function Object|function () { }|TypeMismatchError|
+
+* Dictionary
+
+|Input Type|Input Value|Result|Comment|
+|----------|-----------|------|-------|
+|undefined|undefined|TypeMismatchError|
+|null|null|nullable: null; non-nullable: TypeMismatchError|
+|Boolean|true|TypeMismatchError|
+|Boolean|false|TypeMismatchError|
+|Number|NaN|TypeMismatchError|
+|Number|0|TypeMismatchError|
+|String|"TIZEN"|TypeMismatchError|
+|Object|{ }|{}|No exception is thrown
+|Function Object|function () { }|function () { }|No exception is thrown
+
+* Octet [0, 255]
+
+|Input Type|Input Value|Result|
+|----------|-----------|------|
+|undefined|undefined|0|
+|null|null|0|
+|Boolean|true|1|
+|Boolean|false|0|
+|Number|NaN|0|
+|Number|Number.POSITIVE_INFINITY|0|
+|Number|Number.NEGATIVE_INFINITY|0|
+|Number|-1|255|
+|Number|0|0|
+|Number|1|1|
+|Number|3.14|3|
+|Number|-128|128|
+|Number|-192|64|
+|Number|-256|0|
+|Number|256|0|
+|String|"" (Empty String)|0|
+|String|"0"|0|
+|String|"1"|1|
+|String|"256"|0|
+|String|"TIZEN"|0|
+|Object|{ name : "TIZEN" }|0|
+|Function Object|function () { }|0|
+
+* Enum
+
+|Input Type|Input Value|Result|Comment|
+|----------|-----------|------|-------|
+|undefined|undefined|TypeMismatchError|unless "undefined" is on the list of the Enum values
+|null|null|TypeMismatchError|unless "null" is one of the Enum values
+|Number|0|TypeMismatchError|unless "0" is one of the Enum values
+|Boolean|true|TypeMismatchError|unless "true" is one of the Enum values
+|String|"TIZEN"|TypeMismatchError|unless "TIZEN" is one of the Enum values
+|String|any of the Enum values|given string|Enum defines valid values, any of those values can be used and are accepted without conversion
+|Object|{ }|TypeMismatchError|
diff --git a/doc/src/appendix_b.md b/doc/src/appendix_b.md
new file mode 100644 (file)
index 0000000..b725a8d
--- /dev/null
@@ -0,0 +1,85 @@
+### Appendix B - Javascript code example style guide
+
+#### Code Example Style Guide
+
+Below guide lists rules of writing example code placed in the WIDL files.
+
+**Whitespaces**
+
+- Use only spaces (do not use tabs), one level indent has two spaces
+- No whitespace at the end of line
+- One extra space after keywords which use round brackets (if, for, while, switch, catch, …)
+- Add space between variables and operators
+- Initialization lists
+  - Space after colon but not before
+  - Space after comma
+
+**Comments**
+
+- Use double slash // (do not use /* */)
+- Start sentence with capital letter
+- Do not use dot at the end
+
+```js
+// This is a simple comment
+```
+
+**Brackets**
+
+- Body brackets
+  - Opening and closing brackets in new lines
+- No extra whitespace inside brackets (after opening nor before closing)
+
+```js
+try
+{
+  var messages = ["A", "B"];
+}
+catch (err)
+{
+  console.log("Error: " + err.message);
+}
+```
+
+**Strings**
+
+- Use only quotation marks (“), do not use apostrophes (‘) to create strings
+
+**console.log()**
+
+- Start log with capital letter
+- Do not use dots
+- Add space after colon
+
+```js
+console.log(“This is example error: “ + err.message);
+```
+
+**Multi-line**
+
+- Each line should not be more than 100 characters long
+- Indentation in second line must match opening bracket
+
+```js
+console.log("This is console log information error: " + error.message +
+            " and there is more”);
+```
+
+**Functions with function as an argument**
+
+- Name of the function should be written in line with previous function's closing bracket
+- Other parameters can be put in the same line as function's closing bracket
+
+```js
+functionCalculate("First argument", function(e)
+{
+  console.log("Information: " + e.message);
+}, function(e)
+{
+  console.log("Error: " + e.message);
+}, "Last argument");
+```
+
+**Statement separation**
+
+- Each statement has to be in new line and has to end with semicolon
\ No newline at end of file
index 4e39a93f8f9109051ba222eff7aed0d2716e0bb5..78fc78b82569c1d96a4b5740b904e6412e0c9ecc 100644 (file)
@@ -6,10 +6,15 @@ C++, JavaScript
 
 ### Coding style
 
-Use Google style guide,
-C++: http://google-styleguide.googlecode.com/svn/trunk/cppguide.html
+Use Google style guides (with small exceptions):
 
-JavaScript: http://google-styleguide.googlecode.com/svn/trunk/javascriptguide.xml
+C++: https://google.github.io/styleguide/cppguide.html
+
+JavaScript: https://google.github.io/styleguide/jsguide.html
+
+On branches ```tizen_3.0``` and higher, the C++ ~~and JavaScript~~ files are formatted using scripts,
+which its usage is described in the [Format code](#tools/format-code) section of this document.
+The section also describes where the exceptions from Google coding style are defined.
 
 ### API guide
 
@@ -29,11 +34,11 @@ $ git clone ssh://<user.id>@168.219.209.56:29418/framework/web/webapi-plugins
 $ cd webapi-plugins
 $ git checkout origin/tizen_2.4
 ```
-For Tizen 3.0
+For Tizen 3.0 and higher
 ```sh
-$ git clone ssh://<user.id>@168.219.209.56:29418/framework/web/webapi-plugins
+$ git clone ssh://<user.id>@review.tizen.org:29418/platform/core/api/webapi-plugins && scp -p -P 29418 <user.id>@review.tizen.org:hooks/commit-msg webapi-plugins/.git/hooks/
 $ cd webapi-plugins
-$ git checkout origin/tizen_3.0
+$ git checkout origin/tizen_<tizen_version>
 ```
 
 ### License and Boilerplate
@@ -41,7 +46,7 @@ $ git checkout origin/tizen_3.0
 Use this boilerplate in every new created source files.
 ```sh
 /*
- * Copyright (c) 2015 Samsung Electronics Co., Ltd All Rights Reserved
+ * Copyright (c) <year of file creation> Samsung Electronics Co., Ltd All Rights Reserved
  *
  *    Licensed under the Apache License, Version 2.0 (the "License");
  *    you may not use this file except in compliance with the License.
index c6d84e51799313a712593e87b534668c60a479b6..7ea4fdd9cdcc61b080c36502678a1585760bc06b 100644 (file)
@@ -18,6 +18,15 @@ Example: If operation should change some object retrieved from platform,
 identifier should be passed again and additional check if object still exists
 should be made.
 
+According to [Google C++ Style Guide][3] static variables should **NOT** be used.
+
+This rule concerns especially to ```<pluginname>Manager```, ```<pluginname>Client```,
+```<pluginname>Server``` etc. classes, which tend to implement the Singleton design pattern.
+Because of this, the above mentioned classes' instances should **NOT** be declared as ``static``
+and should **NOT** be got through ``getInstance`` methods.
+Instead, the classes's instances should be declared as an ``private`` attribute of
+```<pluginname>Instance``` class.
+
 ### Privileges
 
 Some of the API methods require privilege access. The privilege engine used in the project is Cynara.
@@ -110,6 +119,68 @@ if (!result) {
 ReportSuccess(data, out);
 ```
 
+### Dependencies between plugins
+
+To allow using methods from module ``A`` in module ``B``, you need to add dependencies in ``<pluginname>.gyp`` files
+and add ``XW_EXPORT`` macro to the definition of methods in module ``A``.
+
+In below example, linking ``GetNotiHandleFromJson`` method of ``CommonNotification`` class in module ``Notification``
+is added to the ``Alarm`` module.
+
+1. Add dependency in ``.gyp`` file in module ``B``, in this example it is ``alarm.gyp``:
+```
+'dependencies': [
+  '../common/common.gyp:tizen_common',
+  '../notification/notification.gyp:tizen_notification',  # add this line
+],
+```
+2. Add ``XW_EXPORT`` macro available in ``src/common/XW_Extension.h`` file to the definition of method from module ``A``:
+```cpp
+class UserNotification : public CommonNotification {
+// ...
+XW_EXPORT static common::PlatformResult GetNotiHandleFromJson(const picojson::value& noti_val,
+                                                              bool is_update,
+                                                              notification_h* noti_handle);
+// ...
+}
+```
+3. Add dependency in ``.gyp`` file in module ``A``, in this example it is ``notification.gyp``:
+```
+{
+  'includes': [
+    '../common/common.gypi',
+  ],
+  'targets': [
+    {
+      'target_name': 'tizen_notification',
+      'type': 'loadable_module',
+      'dependencies': [
+        '../common/common.gyp:tizen_common',
+      ],
+      'sources': [
+        # ...
+      ],
+      'conditions': [
+        # ...
+      ],
+      'direct_dependent_settings': {  # add this property
+        'libraries': [
+          '-ltizen_notification',
+        ],
+      },
+    },
+  ],
+}
+```
+
+To make sure you did the good work, you can list dynamic dependencies of given ``.so`` file with the ``ldd`` command:
+```sh
+sh-user-3.2# ldd /usr/lib/tizen-extensions-crosswalk/libtizen_alarm.so | grep noti
+ldd: warning: you do not have execution permission for `/usr/lib/tizen-extensions-crosswalk/libtizen_alarm.so'
+libtizen_notification.so => /usr/lib/tizen-extensions-crosswalk/libtizen_notification.so (0xb6e52000)  # OK!
+libnotification.so.0 => /lib/libnotification.so.0 (0xb6c93000)
+```
+
 ### Asynchronous calls
 
 To perform asynchronous request ```common::TaskQueue``` component should be used.
@@ -118,7 +189,7 @@ JavaScript layer by calling ```PostMessage(const char* msg)```.
 
 Asynchronous response is not matched to request automatically. You should pass
 ```callbackId``` received from JavaScript layer as an argument. It allows to
-call the appropriate user callback in JS async message handler.
+call the appropriate user callback in JavaScript async message handler.
 
 ```cpp
 auto search = [this, args]() -> void {
@@ -184,6 +255,16 @@ LoggerW("Data in %s object is empty", object->name);
 LoggerE("Error occurred while getting data [%d]", error);
 ```
 
+Upon entering and leaving function's scope, a message should be printed with ```DEBUG``` priority using ``ScopeLogger`` macro:
+
+```cpp
+// print simply, default "Enter" log
+ScopeLogger();
+// print more detailed message
+ScopeLogger("state: %d; err: %s", (int) state, err);
+```
+
+
 ### Error handling
 
 Regarding to [Google C++ Style Guide][2] we do not use Exceptions.
@@ -210,4 +291,5 @@ if (native_.isFailure(ret)) {
 ```
 
   [1]: http://en.wikipedia.org/wiki/SOLID_(object-oriented_design)
-  [2]: http://google-styleguide.googlecode.com/svn/trunk/cppguide.html#Exceptions
+  [2]: https://google.github.io/styleguide/cppguide.html#Exceptions
+  [3]: https://google.github.io/styleguide/cppguide.html#Static_and_Global_Variables
index 569060d7e24bf5b6960e49cc0d86177d35f3f49c..4e7ca4327cb7076c5b948d80e432dcce47741f97 100644 (file)
@@ -1,10 +1,9 @@
 ## Implementation - JavaScript
 
 Each plugin contains JavaScript files. This is the place where user input is
-being processed validated before send to C++ layer.
+being processed validated before sending to C++ layer.
 
-Badge API will be used to show the creation of JavaScript file (lot of content
-of this file will be already generated via Stub Generator).
+Badge API will be used to show the creation of JavaScript file.
 
 ### Interface creation
 
@@ -89,13 +88,13 @@ var number = converter_.toLong(result);
 #### Validator
 
 When API JavaScript method is called first thing that has to be done in
-JavaScript layer of api implementation is to process and validate arguments
+JavaScript layer of API implementation is to process and validate arguments
 given by the user. The process of validation consists of ensuring that the
 proper amount of arguments was given and that they were of the expected
 type and throwing exception if necessary.
 
 Validator helps to ensure that user sent proper values. Validator is available
-at ```xwalk.utils.validator``` and predefined js types at ```xwalk.utils.validator.types```
+at ```xwalk.utils.validator``` and predefined JavaScript types at ```xwalk.utils.validator.types```
 
 Below can be found example of using validator inside ```setBadgeCount``` method
 that requires appId in form of string and long count value:
@@ -110,6 +109,11 @@ var args = validator_.validateArgs(arguments, [
 ]);
 ```
 
+The ``validateArgs`` method may also validate optional and nullable arguments.
+See its definition in file ``src/utils/utils_api.js``.
+
+This method respecting the JavaScript type conversion rules is presented [the Appendix A - type conversion tables](#appendices/appendix-a-type-conversion-tables).
+
 ### Exceptions
 
 At some point whether improper data is received or given to JavaScript might
@@ -124,6 +128,9 @@ throw new WebAPIException(WebAPIException.TYPE_MISMATCH_ERR,
 WebAPIException constructor takes as argument the type of error to be thrown.
 The second additional argument is error message.
 
+There might be a need to throw expception because of failure received from C++ layer,
+for this case see below section.
+
 ### Synchronous methods
 
 In order to perform synchronous operation (one that does not require callback
@@ -149,9 +156,9 @@ Result is assigned to ret variable.
 
 In order to work with method that requires callback instead of callSync(),
 call() method needs to be called. Apart from the first two arguments that are
-exactly the same as in call() method (c++ method binding, object) it takes
+exactly the same as in callSync() method (C++ method binding, object) it takes
 additional argument that is a function that will be called when the native
-call is processed:
+call response is processed:
 
 ```js
 var native_ = new xwalk.utils.NativeManager(extension);
index 12d50f4fe3e14dc9086f1bae536afc70ed007483..84bd52ad089e316517dabcb988d23aa44ec3d722 100644 (file)
@@ -11,6 +11,7 @@
 | 0.5.0 | 2015-06-18 | Devel package | Pawel Kaczmarek<br><p.kaczmarek3@samsung.com> |
 | 0.5.1 | 2015-06-24 | Add info about WAPIOven.py | Pawel Kaczmarek<br><p.kaczmarek3@samsung.com> |
 | 0.6.0 | 2016-10-28 | update devel package for tizen 3.0 | Annie Park<br><hj.na.park@samsung.com> |
+| 0.7.0 | 2017-11-09 | Update guidelines for Tizen 4.0 | Szymon Jastrzębski<br><s.jastrzebsk@partner.samsung.com> |
 
 ## Overview
 This document should be used as a guideline for developers who are creating web
@@ -25,3 +26,6 @@ Each plugin should be written with great attention on JavaScript.
 {{>src/implementation_js.md}}
 {{>src/implementation_cc.md}}
 {{>src/devel_package.md}}
+{{>src/appendices.md}}
+{{>src/appendix_a.md}}
+{{>src/appendix_b.md}}
\ No newline at end of file
index 161b0d4ab921b996cf9bac7f804d48805cf983c4..ac1dcceaa1422a761be2a4cbbcc691cdc2a8def7 100644 (file)
@@ -14,16 +14,29 @@ Each plugin contains following structure:
 * ```<pluginname>_instance.h```
 * ```<pluginname>_instance.cc```
 
+Additionally, plugins may contain below structure, depending on the WIDL specification file:
+* ```<pluginname>_client.h```
+* ```<pluginname>_client.cc```
+* ```<pluginname>_server.h```
+* ```<pluginname>_server.cc```
+* ```<pluginname>_service.h```
+* ```<pluginname>_service.cc```
+* ```<pluginname>_util.h```
+* ```<pluginname>_util.cc```
+
+and other files with similar naming-convention needed by the developer.
+
+
 ### Spec file
 
 Spec file (```webapi-plugins.spec```) kept inside ```packaging/``` directory
-is build specification file used by RPM packaging system where variables are defined.
+is build specification file used by RPM packaging system where variables are defined.
 Those variables can be used to include or exclude particular modules from
 build for each profile (mobile, TV, wearable).
 
 ### Manifest file
 
-Each RPM package must have a manifest file where developers can specify the access control domain
+Each RPM package must have a manifest file, where developers can specify the access control domain
 in which their application should be running and potentially additional security policies for the
 application. It is necessary to build the project. The manifest file (```webapi-plugins.manifest```)
 is located in the root directory of the project.
@@ -47,7 +60,7 @@ Description of files required in plugin implementation.
   This file contains all methods required by each API.
   All operation should be done by JavaScript as much as possible.
   If JavaScript can do something, it should do it.
-  This file is responsible for checking arguments, calling C++ methods etc.
+  This file is responsible for checking and validating arguments, calling C++ methods etc.
 
 ### Plugin flow
 
@@ -58,7 +71,30 @@ Explanation of steps:
    This information consists of type of call (asynchronous, synchronous)
    arguments given by user, any additional information that is required to
    successfully acquire required data. Data is sent in form of JSON.
-2. C++ parses acquired JSON. After the data is processed. Appropriate platform
+2. C++ parses acquired JSON. After the data is processed, appropriate platform
    functions are called with the specified arguments.
 3. Platform returns specified values to C++ layer.
 4. Another JSON is formed. It consists of data that was acquired from platform.
+   The data is sent to JavaScript layer.
+
+### Tizen Unified
+
+With Tizen 4.0 an idea of Tizen Unified was introduced.
+
+Before Tizen 4.0, each profile specified in ``.gbs.conf`` file defined the package repositories
+for a single device type and a particular architecture.
+
+Since Tizen 4.0, each GBS profile is associated with a particular architecture and all device types.
+
+Each device with given profile and architecture requires to have at least 2 RPM files installed:
+```sh
+webapi-plugins-x.y-z.ARCH.rpm
+webapi-plugins-profile_PROFILE_NAME-x.y-z.ARCH.rpm
+```
+
+However, emulators require to have 3 RPM files installed:
+```sh
+webapi-plugins-x.y-z.i686.rpm
+webapi-plugins-profile_PROFILE_NAME-x.y-z.i686.rpm
+webapi-plugins-PROFILE_NAME-extension-emulator-x.y-z.i686.rpm
+```
index 1836f6e4cc52381bf8c72bde5c2ff9e73e9be106..2ceb3b7aaed0a258c603edbc06f07ff5c9763071 100644 (file)
@@ -2,6 +2,8 @@
 
 ### Generate stub code
 
+#### <span style="color:red">**The generator is no longer maintained.**</span>
+
 To generate stub files from the widl you can use stub generator located in
 ```tools/skeleton_generator/``` directory and run the python command:
 
@@ -36,7 +38,7 @@ WIDL files can be found in the project repository:
 $ git clone ssh://<username>@168.219.209.56:29418/doc/web-device-api
 ```
 
-The widl files are placed in: ```web-device-api/web/widl/tizen/```
+The widl files are placed in: ```web-device-api/web/widl/tizen/``` directory.
 
 Stub files generated by above command:
 
@@ -72,3 +74,38 @@ Inside ```<pluginname>_api.js``` required JavaScript files should be added:
 To merge all JavaScript files ```tools/mergejs.py``` file is used.
 This script merge all files mentioned in ```<pluginname>_api.js``` file into one
 file before build process.
+
+
+### Format code
+
+To format code use scripts provided in the ``tools/codestyle`` directory.
+
+``cpplint`` is used to validate C++ and ``eslint`` for JavaScript files.
+
+**Currently, the JavaScript validator and formatter seems to be a little buggy,
+thus it is not recommended to use.**
+
+The developer needs to have ``python``, ``node.js``, ``eslint``, ``Closure Linter`` and ``clang-format`` installed.
+
+It is worth to make life easier by creating symbolic link to ``clang-format``.
+```sh
+sudo ln -s /usr/bin/clang-format-<clang format version> /usr/bin/clang-format
+```
+
+For convenience, in the root of the project links were provided for easier access:
+- ``code_format -> tools/codestyle/code_formatter.sh``
+- ``code_validate -> tools/codestyle/code_validation.sh``
+
+Those scripts consist of configuration for rules regarding the Google style guides, with few exceptions.
+
+To format and validate C++ and JavaScript code run in the root of the project:
+```sh
+./code_validate -a # -a for all, -c for C++, -js for JavaScript files
+./code_format -a   # use -h or --help for help
+```
+The scripts also accept a path to module's directory.
+By default every directory module in the ``src`` directory is used.
+
+For more details, please see ``tools/codestyle/README`` file.
+
+This rule concerns to branches ``tizen_3.0`` and above.
index 703958f487d5e8000b45e8620c1c8a1c01fb4b21..fb8166c273415e0f0b0ad74c2576d66d9717a597 100644 (file)
@@ -39,7 +39,7 @@ In interface definition you can put following members:
   can be changed, if it is not read only.
 * Operation: Interface member, which represents method inside object.
   It is a function of programming language, which can be executed and returns a result.
-* Special operation: Performs a specific task. i.e. deleter, getter
+* Special operation: Performs a specific task. i.e. deleter, getter.
 * Static operation: It is not called for a specific instance of the interface,
   is called for static object regardless of an instance creation.
   It is connected with the interface itself.
@@ -72,8 +72,8 @@ Tizen implements ManagerObject
 
 To provide actual implementations of ManagerObject, instance of its Manager
 interface definition has to be made. Inside this Manager interface all attributes
-and functions that will be available form manager namespace, should be defined.
-There can be attributes which are other interfaces, operations and everything
+and functions that will be available from manager namespace, should be defined.
+There can be attributes, which are other interfaces, operations and everything
 that interfaces allows.
 
 Additional interface can be available as a standalone types not connected to
@@ -118,6 +118,11 @@ lacks of keyword ```FunctionOnly```.
 };
 ```
 
+### Example code style
+
+Coding style for example codes put in the between ``\code``  and ``\endcode`` tags
+should be written with respect to rules described in [the Appendix B](#appendices/appendix-b-javascript-code-example-style-guide).
+
 ### Example
 
 Example of WIDL file: