From c2f3732f00a44c167d8d7babc0af33d14f95abce Mon Sep 17 00:00:00 2001
From: Michal Pawluk
+ The Model module declares two arrays:
+ Implementation
-Type definitions
+Type definitions
+
+
+/* The general structure for application's data storage. */
+struct __appdata {
+ viewdata_s view;
+};
+
+
+
+/* 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;
+
+
+
+/* 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;
+
+
+
+/* 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);
+
+
+
+/* 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;
+
+
+
+
+ which are used to store system and custom events information, respectively. The __SYSTEM_EVENT_COUNT_MAX and
+ __CUSTOM_EVENT_COUNT_MAX values are both set to 25 as an upperbound limit.
+