2 * Copyright 2012 Samsung Electronics Co., Ltd
\r
4 * Licensed under the Flora License, Version 1.0 (the "License");
\r
5 * you may not use this file except in compliance with the License.
\r
6 * You may obtain a copy of the License at
\r
8 * http://floralicense.org/license/
\r
10 * Unless required by applicable law or agreed to in writing, software
\r
11 * distributed under the License is distributed on an "AS IS" BASIS,
\r
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 * See the License for the specific language governing permissions and
\r
14 * limitations under the License.
\r
20 #include "mf-ug-winset.h"
\r
21 #include "mf-ug-util.h"
\r
22 #include "mf-ug-fs-util.h"
\r
23 #include "mf-ug-fm-svc-wrapper.h"
\r
24 #include "mf-ug-cb.h"
\r
25 #include "mf-ug-resource.h"
\r
27 /******************************
\r
28 ** Prototype : mf_ug_tab_bar_create
\r
29 ** Description : Samsung
\r
30 ** Input : Evas_Object *parent
\r
37 ** 1.Date : 2010/12/10
\r
39 ** Modification : Created function
\r
41 ******************************/
\r
42 Evas_Object *mf_ug_tab_bar_create(Evas_Object *parent)
\r
45 ug_mf_retv_if(parent == NULL, NULL);
\r
46 Evas_Object *toolbar = elm_toolbar_add(parent);
\r
47 elm_toolbar_shrink_mode_set(toolbar, ELM_TOOLBAR_SHRINK_EXPAND);
\r
48 elm_object_style_set(toolbar, "tabbar/item_horizontal");
\r
49 elm_toolbar_select_mode_set(toolbar, ELM_OBJECT_SELECT_MODE_ALWAYS);
\r
50 elm_toolbar_homogeneous_set(toolbar, EINA_FALSE);
\r
51 elm_toolbar_transverse_expanded_set(toolbar, EINA_TRUE);
\r
58 /******************************
\r
59 ** Prototype : mf_ug_tab_bar_append_item
\r
60 ** Description : Samsung
\r
61 ** Input : Evas_Object *pTabBar
\r
62 ** char *pTabIconPath
\r
63 ** char *pTabBarLabel
\r
64 ** Evas_Object *pTabView
\r
71 ** 1.Date : 2010/12/10
\r
73 ** Modification : Created function
\r
75 ******************************/
\r
76 Elm_Object_Item *mf_ug_tab_bar_append_item(Evas_Object *pTabBar, char *pTabIconPath, char *pTabBarLabel, void *user_data)
\r
79 ug_mf_retv_if(pTabBar == NULL, NULL);
\r
81 Elm_Object_Item *pItem = NULL;
\r
82 pItem = elm_toolbar_item_append(pTabBar, pTabIconPath, pTabBarLabel, mf_ug_cb_tab_bar_cb, user_data);
\r
88 /******************************
\r
89 ** Prototype : mf_ug_tab_bar_set_item_view
\r
90 ** Description : Samsung
\r
91 ** Input : Elm_Object_Item *it
\r
92 ** Evas_Object * view
\r
99 ** 1.Date : 2010/12/10
\r
100 ** Author : Samsung
\r
101 ** Modification : Created function
\r
103 ******************************/
\r
104 void mf_ug_tab_bar_set_item_view(Evas_Object *tab_layout, Evas_Object *view)
\r
107 ug_mf_retm_if(tab_layout == NULL, "tab_layout is NULL");
\r
108 ug_mf_retm_if(view == NULL, "view is NULL");
\r
109 Evas_Object *layout = tab_layout;
\r
110 Evas_Object *unset = elm_object_part_content_get(layout, "elm.swallow.content");
\r
112 elm_object_part_content_unset(layout, "elm.swallow.content");
\r
113 evas_object_hide(unset);
\r
116 elm_object_part_content_set(layout, "elm.swallow.content", view);
\r
121 /******************************
\r
122 ** Prototype : mf_ug_tab_bar_remove_item_by_label
\r
123 ** Description : Samsung
\r
124 ** Input : Evas_Object *pTabBar
\r
132 ** 1.Date : 2010/12/10
\r
133 ** Author : Samsung
\r
134 ** Modification : Created function
\r
136 ******************************/
\r
137 void mf_ug_tab_bar_remove_item_by_label(Evas_Object *pTabBar, char *pTabLabel)
\r
140 Elm_Object_Item *pItem = NULL;
\r
141 pItem = elm_toolbar_first_item_get(pTabBar);
\r
144 if (g_strcmp0(pTabLabel, elm_object_item_text_get(pItem)) == 0) {
\r
145 elm_object_item_del(pItem);
\r
148 pItem = elm_toolbar_item_next_get(pItem);
\r
153 /******************************
\r
154 ** Prototype : mf_ug_tab_bar_remove_all_items
\r
155 ** Description : Samsung
\r
156 ** Input : Evas_Object *pTabBar
\r
163 ** 1.Date : 2010/12/10
\r
164 ** Author : Samsung
\r
165 ** Modification : Created function
\r
167 ******************************/
\r
168 void mf_ug_tab_bar_remove_all_items(Evas_Object *pTabBar)
\r
172 Elm_Object_Item *it = NULL;
\r
173 Elm_Object_Item *pNext = NULL;
\r
175 it = elm_toolbar_first_item_get(pTabBar);
\r
177 pNext = elm_toolbar_item_next_get(it);
\r
178 elm_object_item_del(it);
\r
185 /******************************
\r
186 ** Prototype : mf_ug_tab_bar_set_selected_item
\r
187 ** Description : Samsung
\r
188 ** Input : Elm_Object_Item* pItem
\r
195 ** 1.Date : 2010/12/10
\r
196 ** Author : Samsung
\r
197 ** Modification : Created function
\r
199 ******************************/
\r
200 void mf_ug_tab_bar_set_selected_item(Elm_Object_Item *pItem)
\r
203 elm_toolbar_item_selected_set(pItem, EINA_TRUE);
\r
208 /******************************
\r
209 ** Prototype : mf_ug_tab_bar_set_item_disable
\r
210 ** Description : Samsung
\r
211 ** Input : Evas_Object *pTabBar
\r
212 ** Eina_Bool disable
\r
219 ** 1.Date : 2010/12/10
\r
220 ** Author : Samsung
\r
221 ** Modification : Created function
\r
223 ******************************/
\r
224 void mf_ug_tab_bar_set_item_disable(Evas_Object *pTabBar, Eina_Bool disable)
\r
226 Elm_Object_Item *pCurrentItem = NULL;
\r
228 if (pTabBar != NULL) {
\r
230 pCurrentItem = elm_toolbar_first_item_get(pTabBar);
\r
231 while(pCurrentItem) {
\r
232 elm_object_item_disabled_set(pCurrentItem, disable);
\r
233 pCurrentItem = elm_toolbar_item_next_get(pCurrentItem);
\r
238 int mf_ug_tab_bar_items_count_get(Evas_Object *pTabBar)
\r
240 ug_mf_retvm_if(pTabBar == NULL, 0, "pTabBar is NULL");
\r
242 Elm_Object_Item *pCurrentItem = NULL;
\r
245 pCurrentItem = elm_toolbar_first_item_get(pTabBar);
\r
246 while(pCurrentItem) {
\r
248 pCurrentItem = elm_toolbar_item_next_get(pCurrentItem);
\r
254 Elm_Object_Item *mf_ug_tab_bar_get_item_by_label(Evas_Object *pTabBar, char *pTabLabel)
\r
256 ug_mf_retvm_if(pTabBar == NULL, NULL, "pTabBar is NULL");
\r
257 ug_mf_retvm_if(pTabLabel == NULL, NULL, "pTabLabel is NULL");
\r
258 Elm_Object_Item *pItem = NULL;
\r
260 pItem = elm_toolbar_first_item_get(pTabBar);
\r
262 if (g_strcmp0(pTabLabel, elm_object_item_text_get(pItem)) == 0) {
\r
265 pItem = elm_toolbar_item_next_get(pItem);
\r