From cddbc4ed2b5fdc34bd89a60a15ad2f2c7101b257 Mon Sep 17 00:00:00 2001 From: Michal Skorupinski Date: Fri, 9 Oct 2015 12:00:46 +0200 Subject: [PATCH] [SAMPLE APP][DATA-CONTROL-CONSUMER] Implementation - data types Change-Id: I4e4116c5ad218fa435f2707b6fc7872135b3bb6a Signed-off-by: Michal Skorupinski --- .../html/mobile_n/data_control_consumer_sd_mn.htm | 144 +++++++++++++++++++-- 1 file changed, 136 insertions(+), 8 deletions(-) diff --git a/org.tizen.sampledescriptions/html/mobile_n/data_control_consumer_sd_mn.htm b/org.tizen.sampledescriptions/html/mobile_n/data_control_consumer_sd_mn.htm index 5e6569d..bdb9847 100644 --- a/org.tizen.sampledescriptions/html/mobile_n/data_control_consumer_sd_mn.htm +++ b/org.tizen.sampledescriptions/html/mobile_n/data_control_consumer_sd_mn.htm @@ -94,16 +94,16 @@

Layout editor

-

The user can create the UI using the WYSWIG editor. Widgets can be added and modified using drag&drop. The parameters of the selected widget can be adjusted using the panel on the right (check the ui-builder documentation for details). There are two project templates for ui-builder applications: single-view and navigation. The data-control-consumer app is created using the navigation template. The UI uses an elm_conformant widget as root. This is created by default for an ui-builder application and cannot be changed. An elm_naviframe is used as the conformant's layout. The naviframe can switch between two views: 'Map' and 'Sql'.

+

The user can create the UI using the WYSWIG editor. Widgets can be added and modified using drag&drop. The parameters of the selected widget can be adjusted using the panel on the right (check the UI-Builder documentation for details). There are two project templates for UI-Builder applications: single-view and navigation. The data-control-consumer app is created using the navigation template. The UI uses an elm_conformant widget as root. This is created by default for an UI-Builder application and cannot be changed. An elm_naviframe is used as the conformant's layout. The naviframe can switch between two views: 'Map' and 'Sql'.

Figure: UI-Builder View display

- UI-Builder View display + UI-Builder View display

Note that there are three views available. The first one is the naviframe while the second and third contain the displayed pages. The first view doesn't allow the user to add any widgets using drag&drop. In this view you can select one of the remaining views to be used as the default content pushed to the naviframe.

@@ -114,11 +114,11 @@

Connections

-

In order to design the application's view switching, the connections are used. You can access them via the 'Storyboard' tab of the UI-builder (check Tizen SDK help for details).

+

In order to design the application's view switching, the connections are used. You can access them via the 'Storyboard' tab of the UI-Builder (check Tizen SDK help for details).

Figure: UI-Builder connections view

-

- UI-Builder connections view +

+ UI-Builder connections view

The view1 (the Naviframe view) is connected with the view2. This indicates that the view2 is used as the naviframe's default view. When the user adds a connection between other views it will be displayed here. Note that a new callback code will be created (file will be created if required) in src/managed/connection folder. Also a 'pre' and 'post' functions will be added to one of the files in src/event_handler folder.

@@ -146,11 +146,139 @@ void view2_connection_to_sql_button_onclicked(uib_view2_view_context *vc, Evas_O Final name of the callback function

-

Note that the callback's name is followed by the view's name. This is a standard behaviour of the ui-builder and cannot be changed. After the function stub creation is completed, the user can modify the callback's source code.

+

Note that the callback's name is followed by the view's name. This is a standard behaviour of the UI-Builder and cannot be changed. After the function stub creation is completed, the user can modify the callback's source code.

+

Implementation

+

Type definitions

+

Managed content

+

Managed content is the part of the source code that is automatically created by the UI-Builder. This code should not be modified by the user as it is altered by the tool each time the project is built.

+ +
+/*Base application structure*/
+typedef struct
+{
+   Evas_Object *win;
+   Evas_Object *bg;
+   Evas_Object *conformant;
+   Evas_Object *layout;
+} window_obj;
+
+ +
+/*Base view's layout structure*/
+typedef struct _uib_view_context
+{
+   Evas_Object* 	parent;
+   Evas_Object* 	root_container;
+   const char*  	view_name;
+} uib_view_context;
+
+ + + + +
+/*Structure used to store the view1's content*/
+typedef struct _uib_view1_view_context {
+
+   /* view's parent object - the Naviframe widget */
+   Evas_Object *parent;
+   /* root container UI Component of this view */
+   Evas_Object* root_container;
+   /* view class name */
+   const char *view_name;
+   /* control context to control this view */
+   struct _uib_view1_control_context *cc;
+
+   /* UI Components in this view */
+   Evas_Object *naviframe1;
+} uib_view1_view_context;
+
+ +
+/*Structure used to store the view2's content*/
+typedef struct _uib_view2_view_context {
+
+   /* view's parent object - the Naviframe widget */
+   Evas_Object *parent;
+   /* root container UI Component of this view */
+   Evas_Object* root_container;
+   /* view class name */
+   const char *view_name;
+   /* control context to control this view */
+   struct _uib_view2_control_context *cc;
+
+   /* UI Components in this view */
+   Evas_Object *grid1;
+   Evas_Object *to_sql_button;
+   Evas_Object *key_label;
+   Evas_Object *key_entry;
+   Evas_Object *old_value_entry;
+   Evas_Object *data_list;
+   Evas_Object *data_list_label;
+   Evas_Object *old_value_label;
+   Evas_Object *new_value_entry;
+   Evas_Object *new_value_label;
+   Evas_Object *box1;
+   Evas_Object *get_data_button;
+   Evas_Object *set_data_button;
+   Evas_Object *add_data_button;
+   Evas_Object *remove_data_button;
+   Evas_Object *get_keys_button;
+} uib_view2_view_context;
+
+ +
+/*Structure used to store the view2's content*/
+typedef struct _uib_view3_view_context {
+
+   /* view's parent object - the Naviframe widget */
+   Evas_Object *parent;
+   /* root container UI Component of this view */
+   Evas_Object* root_container;
+   /* view class name */
+   const char *view_name;
+   /* control context to control this view */
+   struct _uib_view3_control_context *cc;
+
+   /* UI Components in this view */
+   Evas_Object *grid1;
+   Evas_Object *to_map_button;
+   Evas_Object *where_label;
+   Evas_Object *where_entry;
+   Evas_Object *column_value_entry;
+   Evas_Object *data_list;
+   Evas_Object *data_label;
+   Evas_Object *column_value_label;
+   Evas_Object *select_button;
+   Evas_Object *insert_button;
+   Evas_Object *set_button;
+   Evas_Object *delete_button;
+   Evas_Object *column_name_label;
+   Evas_Object *column_name_entry;
+   Evas_Object *order_none_radio;
+   Evas_Object *order_asc_radio;
+   Evas_Object *order_dsc_radio;
+   Evas_Object *sort_column_entry;
+   Evas_Object *title_label;
+} uib_view3_view_context;
+
+ +
+/*Structure that stores the view layout structures*/
+typedef struct _uib_view_data {
+   Evas_Object* win;
+
+   uib_view_context* view1;
+   uib_view_context* view2;
+   uib_view_context* view3;
+} uib_view_data;
+
+ +

Note that the uib_view_context is used here while the view's content uses the uib_view1_view_context, uib_view2_view_context, uib_view3_view_context structures. A type-cast between uib_view_context and view structures is often used in UI-Builder code.

-- 2.7.4