<h2>Implementation</h2>
-<h3>Type definitions</h3>
+<h3 id="type-defs">Type definitions</h3>
+
+<pre class="prettyprint">
+/* The general structure for application's data storage. */
+struct __appdata {
+ viewdata_s view;
+};
+</pre>
+
+<pre class="prettyprint">
+/* All the Evas_Object objects represent UI widgets. */
+struct __viewdata {
+ Evas_Object *win;
+ Evas_Object *conform;
+ Evas_Object *layout_main_panel;
+ Evas_Object *main_toolbar;
+ Evas_Object *main_toolbar_item_system_ev;
+ Evas_Object *main_toolbar_item_custom_ev;
+ Evas_Object *layout_system_ev;
+ Evas_Object *system_ev_list;
+ Evas_Object *layout_custom_ev;
+ Evas_Object *custom_ev_name;
+ Evas_Object *custom_ev_submit;
+ Evas_Object *custom_ev_list;
+ Elm_Genlist_Item_Class *custom_ev_itc;
+ /* The structure of callbacks handlers used by the Controller module to establish interaction with the Model module. */
+ viewcallbacks_s *callbacks;
+};
+
+typedef struct __viewdata viewdata_s;
+</pre>
+
+<pre class="prettyprint">
+/* All the callbacks handlers are hooked by the Controller module in order to relate the control flow between the View and the Model modules. */
+struct __viewcallbacks {
+ /* The callback handler is invoked when the custom event needs to be published. */
+ event_do_publish_cb do_publish_cb;
+ /* The callback handler is invoked at the initialization phase to obtain all the information about system events for UI generation purpose. */
+ event_get_system_info_cb get_system_info_cb;
+ /* The callback handler is invoked when the user requests to register the custom event handler. */
+ event_set_custom_info_cb set_custom_info_cb;
+};
+
+typedef struct __viewcallbacks viewcallbacks_s;
+</pre>
+
+<pre class="prettyprint">
+/* The definition of callbacks handlers declared in the viewcallbacks_s structure. */
+ typedef void (* event_do_publish_cb)(const char *event_name);
+ typedef bool (* event_get_system_info_cb)(int index, void **ev_info);
+ typedef bool (* event_set_custom_info_cb)(const char *event_name, void **ev_info);
+</pre>
+
+<pre class="prettyprint">
+/* The structure keeps all the event related information. */
+struct __system_ev_info {
+ /* The type of the event - used only for the system events specification.
+ The type is defined as an enum whose values represents all available system events. */
+ event_type_t type;
+ /* The name of the event. */
+ char *name;
+ /* The readable description of the event. */
+ char *desc;
+ /* The status of the event. */
+ char *status_1;
+ /* The status of the event. Used if the event contains up to two different status information:
+ - Incoming message type / id; */
+ char *status_2;
+ /* The status of the event. Used if the event contains up to three different status information:
+ - Bluetooth state / LE state / transferring state; */
+ char *status_3;
+ /* Event's callback handler function. */
+ event_handler_h event_h;
+};
+
+typedef struct __system_ev_info system_ev_info_s;
+typedef struct __system_ev_info custom_ev_info_s;
+</pre>
+
+ <p>
+ The Model module declares two arrays:
+ <ul>
+ <li><span style="font-family: Courier New,Courier,monospace">static system_ev_info_s __system_ev[__SYSTEM_EVENT_COUNT_MAX];</span></li>
+ <li><span style="font-family: Courier New,Courier,monospace">static custom_ev_info_s __custom_ev[__CUSTOM_EVENT_COUNT_MAX];</span></li>
+ </ul>
+ which are used to store system and custom events information, respectively. The <span style="font-family: Courier New,Courier,monospace">__SYSTEM_EVENT_COUNT_MAX</span> and
+ <span style="font-family: Courier New,Courier,monospace">__CUSTOM_EVENT_COUNT_MAX</span> values are both set to 25 as an upperbound limit.
+ </p>
<h3 id="app-init">Application initialization</h3>