Modify the genlist item style for IOT profile
[apps/native/bluetooth-share-ui.git] / src / bt-share-ui-widget.c
1 /*
2 * bluetooth-share-ui
3 *
4 * Copyright 2012 Samsung Electronics Co., Ltd
5 *
6 * Contact: Hocheol Seo <hocheol.seo@samsung.com>
7 *           GirishAshok Joshi <girish.joshi@samsung.com>
8 *           DoHyun Pyun <dh79.pyun@samsung.com>
9 *
10 * Licensed under the Flora License, Version 1.1 (the "License");
11 * you may not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.tizenopensource.org/license
15 *
16 * Unless required by applicable law or agreed to in writing,
17 * software distributed under the License is distributed on an "AS IS" BASIS,
18 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 */
23
24 #include <app_extension.h>
25
26 #include "applog.h"
27 #include "bt-share-ui-widget.h"
28 #include "bt-share-ui-main.h"
29 #include <app_extension.h>
30
31 Evas_Object *_bt_create_bg(Evas_Object *parent, char *style)
32 {
33         retvm_if(parent == NULL, NULL, "Invalid argument: parent is NULL\n");
34
35         Evas_Object *bg = elm_bg_add(parent);
36
37         evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
38                                 EVAS_HINT_EXPAND);
39
40         if (style)
41                 elm_object_style_set(bg, style);
42
43         evas_object_size_hint_weight_set(bg, EVAS_HINT_EXPAND,
44                                          EVAS_HINT_EXPAND);
45         elm_win_resize_object_add(parent, bg);
46         evas_object_show(bg);
47
48         return bg;
49 }
50
51 Evas_Object *_bt_create_layout(Evas_Object *parent, char *edj, char *content)
52 {
53         Evas_Object *layout;
54
55         retvm_if(parent == NULL, NULL, "Invalid argument: parent is NULL\n");
56
57         layout = elm_layout_add(parent);
58
59         if (edj != NULL && content != NULL)
60                 elm_layout_file_set(layout, edj, content);
61         else {
62                 elm_layout_theme_set(layout, "layout", "application",
63                                      "default");
64                 evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
65                                                  EVAS_HINT_EXPAND);
66         }
67
68         evas_object_show(layout);
69
70         return layout;
71 }
72
73 Evas_Object *_bt_create_conformant(Evas_Object *parent, Evas_Object *content)
74 {
75         Evas_Object *conform = NULL;
76
77         elm_win_conformant_set(parent, 1);
78         conform = elm_conformant_add(parent);
79
80         evas_object_size_hint_weight_set(conform, EVAS_HINT_EXPAND,
81                                          EVAS_HINT_EXPAND);
82         elm_win_resize_object_add(parent, conform);
83         /* elm_object_style_set(conform, "internal_layout"); */
84         evas_object_show(conform);
85
86         if (content)
87                 elm_object_content_set(conform, content);
88
89         return conform;
90 }
91
92 void _bt_share_genlist_item_text_update(Elm_Object_Item *git,
93                                                                 const char *part) {
94         ret_if(git == NULL || part == NULL);
95         elm_genlist_item_fields_update(git, part, ELM_GENLIST_ITEM_FIELD_TEXT);
96 }
97
98 void _bt_share_genlist_item_content_update(Elm_Object_Item *git,
99                                                                 const char *part) {
100         ret_if(git == NULL || part == NULL);
101         elm_genlist_item_fields_update(git, part, ELM_GENLIST_ITEM_FIELD_CONTENT);
102 }