Tizen 2.0 Release
[apps/core/preloaded/myfiles.git] / src / widget / mf-navi-bar.c
1 /*
2  * Copyright 2013         Samsung Electronics Co., Ltd
3  *
4  * Licensed under the Flora License, Version 1.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  *  http://floralicense.org/license/
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16
17
18 #include "mf-widget.h"
19 #include "mf-callback.h"
20 #include "mf-fm-svc-wrapper.h"
21 #include "mf-gengrid.h"
22 #include "mf-util.h"
23 #include "mf-ta.h"
24 #include "mf-resource.h"
25 #include "mf-language-mgr.h"
26 #include "mf-tray-item.h"
27
28 void __mf_navi_bar_reset_navi_obj(void *data)
29 {
30         struct appdata *ap = (struct appdata *)data;
31         mf_retm_if(ap == NULL, "ap is NULL");
32
33         ap->mf_MainWindow.pNaviBox = NULL;
34         ap->mf_MainWindow.pNaviInfoBox = NULL;
35         ap->mf_MainWindow.pTrayBox = NULL;
36
37 }
38 Evas_Object *__mf_navi_bar_get_upper_genlist(Evas_Object *parent)
39 {
40         MF_TRACE_BEGIN;
41         mf_retvm_if(parent == NULL, NULL, "parent is NULL");
42         Evas_Object *upper_layout = NULL;
43         Evas_Object *upper_genlist = NULL;
44
45         upper_layout = mf_navi_bar_get_box_end(parent);
46         mf_retvm_if(upper_layout == NULL, NULL, "upper_layout is NULL");
47
48         upper_genlist = elm_object_part_content_get(upper_layout, "upper");
49         mf_retvm_if(upper_genlist == NULL, NULL, "upper_genlist is NULL");
50         MF_TRACE_END;
51         return upper_genlist;
52 }
53
54 Evas_Object *mf_navi_bar_create_navi_bar(Evas_Object * parent)
55 {
56         Evas_Object *navi_bar;
57         assert(parent);
58         navi_bar = elm_naviframe_add(parent);
59         elm_naviframe_prev_btn_auto_pushed_set(navi_bar, EINA_FALSE);
60         evas_object_show(navi_bar);
61         return navi_bar;
62 }
63
64 /*      external functions      */
65 /******************************
66 ** Prototype    : mfNaviBarCreateView
67 ** Description  :
68 ** Input        : struct appdata* data
69 ** Output       : None
70 ** Return Value :
71 ** Calls        :
72 ** Called By    :
73 **
74 **  History        :
75 **  1.Date         : 2010/12/10
76 **    Author       : Samsung
77 **    Modification : Created function
78 **
79 ******************************/
80 Evas_Object *mf_navi_bar_create_search_bar(Evas_Object * parent, void *data)
81 {
82         struct appdata *ap = (struct appdata *)data;
83         mf_retv_if(ap == NULL, NULL);
84         mf_retv_if(parent == NULL, NULL);
85
86         Evas_Object *sb = NULL;
87         Evas_Object *en = NULL;
88
89         sb = elm_layout_add(parent);
90
91         elm_layout_theme_set(sb, "layout", "searchbar", "cancel_button");
92
93         Evas_Object *cancel_btn = elm_button_add(sb);
94         elm_object_style_set(cancel_btn, "searchbar/default");
95         elm_object_text_set(cancel_btn, GET_SYS_STR(LABEL_CANCEL));
96         mf_language_mgr_register_object(cancel_btn, OBJ_TYPE_ELM_OBJECT, NULL, LABEL_CANCEL);
97         evas_object_smart_callback_add(cancel_btn, "clicked", mf_callback_cancel_cb, ap);
98
99         elm_object_part_content_set(sb, "button_cancel", cancel_btn);
100         elm_object_signal_emit(sb, "cancel,show", "");
101         elm_object_signal_emit(sb, "elm,state,eraser,show", "elm");
102
103         en = elm_entry_add(sb);
104         elm_entry_scrollable_set(en, EINA_TRUE);
105         elm_entry_single_line_set(en, EINA_TRUE);
106         elm_entry_cnp_mode_set(en, ELM_CNP_MODE_PLAINTEXT);
107         elm_object_part_content_set(sb, "elm.swallow.content", en);
108         evas_object_data_set(sb, "entry", en);
109
110         elm_entry_input_panel_layout_set(en, ELM_INPUT_PANEL_LAYOUT_NORMAL);
111
112         evas_object_size_hint_weight_set(sb, EVAS_HINT_EXPAND, 0);
113         evas_object_size_hint_align_set(sb, EVAS_HINT_FILL, 0.0);
114
115         evas_object_smart_callback_add(en, "maxlength,reached", mf_callback_max_len_reached_cb, ap);
116         evas_object_smart_callback_add(en, "changed", mf_callback_imf_changed_cb, ap);
117         evas_object_smart_callback_add(en, "activated", mf_search_bar_search_started_callback, ap);
118
119         elm_object_signal_callback_add(sb, "elm,eraser,clicked", "elm", mf_callback_eraser_clicked_cb, en);
120
121         static Elm_Entry_Filter_Limit_Size limit_filter_data;
122         limit_filter_data.max_char_count = 0;
123         limit_filter_data.max_byte_count = MYFILE_FILE_NAME_LEN_MAX;
124         elm_entry_markup_filter_append(en, elm_entry_filter_limit_size, &limit_filter_data);
125
126         evas_object_show(sb);
127         elm_object_focus_set(en, EINA_TRUE);
128         ap->mf_MainWindow.pSearchEntry = en;
129         return sb;
130
131
132 }
133
134
135
136 Evas_Object *mf_navi_bar_get_edit_genlist(void *data)
137 {
138         struct appdata *ap = (struct appdata *)data;
139         mf_retv_if(ap == NULL, NULL);
140         return ap->mf_MainWindow.pEditView.pGenlist;
141 }
142
143 Evas_Object *mfNaviBarConformGet(void *data)
144 {
145         mf_retv_if(data == NULL, NULL);
146         struct appdata *ap = (struct appdata *)data;
147         return ap->mf_MainWindow.pNaviLayout;
148 }
149
150 Evas_Object *mf_navi_bar_get_box_end(Evas_Object * pBox)
151 {
152         MF_TRACE_BEGIN;
153         mf_retvm_if(pBox == NULL, NULL, "pBox is NULL");
154         Eina_List *pBoxChildren = NULL;
155         pBoxChildren = elm_box_children_get(pBox);
156         mf_retvm_if(pBoxChildren == NULL, NULL, "pBoxChildren is NULL");
157
158         int len = eina_list_count(pBoxChildren);
159         if (len > 0) {
160                 MF_TRACE_END;
161                 return eina_list_nth(pBoxChildren, len - 1);
162         }
163         MF_TRACE_END;
164         return NULL;
165 }
166
167 /******************************
168 ** Prototype    : mfNaviBarSetSegment
169 ** Description  :
170 ** Input        : struct appdata* data
171 ** Output       : None
172 ** Return Value :
173 ** Calls        :
174 ** Called By    :
175 **
176 **  History        :
177 **  1.Date         : 2010/12/10
178 **    Author       : Samsung
179 **    Modification : Created function
180 **
181 ******************************/
182 void mf_navi_bar_set_ctrl_bar(struct appdata *data)
183 {
184         MF_TRACE_BEGIN;
185         struct appdata *ap = (struct appdata *)data;
186         mf_retm_if(ap == NULL, "ap is NULL");
187         Evas_Object *NaviBar = ap->mf_MainWindow.pNaviBar;
188         mf_retm_if(NaviBar == NULL, "Navi bar is NULL");
189         Evas_Object *pCtrlBar = NULL;
190
191         pCtrlBar = mf_ctrl_bar_create(ap, NaviBar);
192         mf_retm_if(pCtrlBar == NULL, "mf_ctrl_bar_create failed");
193
194         ap->mf_MainWindow.pNaviCtrlBar = pCtrlBar;
195         elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, CTRL_STYLE_TYPE, pCtrlBar);
196
197         evas_object_show(pCtrlBar);
198         MF_TRACE_END;
199 }
200
201
202 Evas_Object *mf_navi_bar_content_create(void *data)
203 {
204         MF_TRACE_BEGIN;
205         mf_retvm_if(data == NULL, NULL, "data is NULL");
206
207         struct appdata *ap = (struct appdata *)data;
208         myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
209         mf_retvm_if(pNavi_s == NULL, NULL, "pNavi_s is NULL");
210         mf_retvm_if(ap->mf_Status.path == NULL, NULL, "ap->mf_Status.path is NULL");
211         mf_retvm_if(ap->mf_Status.path->str == NULL, NULL, "ap->mf_Status.path->str is NULL");
212
213         Evas_Object *pContent = NULL;
214         Eina_List *file_list = NULL;
215         Eina_List *dir_list = NULL;
216         int dir_list_len = 0;
217         int file_list_len = 0;
218         int error_code = 0;
219
220         if (ap->mf_Status.view_type == mf_view_root) {
221                 if (ap->mf_FileOperation.folder_list) {
222                         mf_util_free_eina_list_with_data(&(ap->mf_FileOperation.folder_list), MYFILE_TYPE_FSNODE);
223                 }
224                 if (ap->mf_FileOperation.file_list) {
225                         mf_util_free_eina_list_with_data(&(ap->mf_FileOperation.file_list), MYFILE_TYPE_FSNODE);
226                 }
227
228                 mf_util_generate_root_view_file_list(&(ap->mf_FileOperation.folder_list), ap->mf_Status.iStorageState);
229                 ap->mf_Status.flagNoContent = EINA_FALSE;
230                 mf_debug("count is [%d]", eina_list_count(ap->mf_FileOperation.folder_list));
231         } else if (ap->mf_Status.view_type == mf_view_root_category) {
232                 if (eina_list_count(ap->mf_FileOperation.category_list) > 0) {
233                         ap->mf_Status.flagNoContent = EINA_FALSE;
234                         mf_util_sort_the_file_list(ap);
235                 } else {
236                         ap->mf_Status.flagNoContent = EINA_TRUE;
237                 }
238         } else {
239                 MF_TA_ACUM_ITEM_BEGIN("      mf_util_generate_file_list", 0);
240                 error_code = mf_util_generate_file_list(ap);
241                 MF_TA_ACUM_ITEM_END("      mf_util_generate_file_list", 0);
242                 if (error_code != MYFILE_ERR_NONE) {
243                         /*Todo: we need to free all the Eina_List*/
244                         return NULL;
245                 }
246                 MF_TA_ACUM_ITEM_BEGIN("      mf_util_sort_the_file_list", 0);
247
248                 /*      sort the list by sort_type*/
249                 mf_util_sort_the_file_list(ap);
250                 MF_TA_ACUM_ITEM_END("      mf_util_sort_the_file_list", 0);
251
252                 MF_TA_ACUM_ITEM_BEGIN("      No content check", 0);
253                 file_list = ap->mf_FileOperation.file_list;
254                 dir_list = ap->mf_FileOperation.folder_list;
255
256                 dir_list_len = eina_list_count(dir_list);
257                 file_list_len = eina_list_count(file_list);
258
259                 if ((dir_list_len + file_list_len) > 0) {
260                         ap->mf_Status.flagNoContent = EINA_FALSE;
261                 } else {
262                         ap->mf_Status.flagNoContent = EINA_TRUE;
263                 }
264                 MF_TA_ACUM_ITEM_END("      No content check", 0);
265         }
266         ap->mf_MainWindow.pNaviGenlist = NULL;
267         ap->mf_MainWindow.pNaviGengrid = NULL;
268
269         if (ap->mf_Status.flagNoContent) {
270                 MF_TA_ACUM_ITEM_BEGIN("      No content create", 0);
271                 pContent = mf_widget_create_no_content(ap->mf_MainWindow.pNaviBar);
272                 MF_TA_ACUM_ITEM_END("      No content create", 0);
273         } else {
274                 if (ap->mf_Status.flagViewType == MF_VIEW_STYLE_THUMBNAIL) {
275                         pContent = mf_gengrid_create_list(ap, ap->mf_MainWindow.pNaviBar);
276                         ap->mf_MainWindow.pNaviGengrid = pContent;
277                 } else {
278                         MF_TA_ACUM_ITEM_BEGIN("      genlist view create", 0);
279                         pContent = mf_genlist_create_list(ap, ap->mf_MainWindow.pNaviBar);
280                         MF_TA_ACUM_ITEM_END("      genlist view create", 0);
281                         ap->mf_MainWindow.pNaviGenlist = pContent;
282                 }
283         }
284         if (ap->mf_Status.more == MORE_DEFAULT) {
285                 MF_TA_ACUM_ITEM_BEGIN("      Add dir monitor", 0);
286                 mf_callback_add_dir_watch(ap->mf_Status.path->str, ap);
287                 MF_TA_ACUM_ITEM_END("      Add dir monitor", 0);
288         }
289
290         MF_TRACE_END;
291         return pContent;
292
293 }
294 /******************************
295 ** Prototype    : mfNaviBarSetContent
296 ** Description  :
297 ** Input        : Evas_Object *pLayout
298 **                Evas_Object *NaviContent
299 ** Output       : None
300 ** Return Value :
301 ** Calls        :
302 ** Called By    :
303 **
304 **  History        :
305 **  1.Date         : 2010/12/10
306 **    Author       : Samsung
307 **    Modification : Created function
308 **
309 ******************************/
310 static int __mf_navi_bar_reset_content_idler(void *data)
311 {
312         MF_TRACE_BEGIN;
313
314         struct appdata *ap = (struct appdata *)data;
315         if (ap) {
316                 SAFE_FREE_OBJ(ap->mf_Status.old_content);
317                 ap->mf_Status.navi_content_idler = NULL;
318         }
319         MF_TRACE_END;
320
321         return ECORE_CALLBACK_CANCEL;
322 }
323
324 void mfNaviBarSetContent(void *data, Evas_Object *pLayout, Evas_Object *NaviContent)
325 {
326         mf_retm_if(data == NULL, "data is NULL");
327         mf_retm_if(pLayout == NULL, "pConform is NULL");
328         mf_retm_if(NaviContent == NULL, "NaviContent is NULL");
329
330         struct appdata *ap = (struct appdata *)data;
331         Evas_Object *unUsed = mf_widget_unset_part_content(pLayout, "content");
332         evas_object_hide(unUsed);
333         ap->mf_Status.old_content = unUsed;
334         mf_ecore_idler_del(ap->mf_Status.navi_content_idler);
335         ap->mf_Status.navi_content_idler = ecore_idler_add((Ecore_Task_Cb)__mf_navi_bar_reset_content_idler, ap);
336         /*if bs, use idler here*/
337         elm_object_part_content_set(pLayout, "content", NaviContent);
338 }
339
340 Evas_Object *mf_navi_bar_get_content(Evas_Object *pConform)
341 {
342         return elm_object_content_get(pConform);
343 }
344
345 /******************************
346 ** Prototype    : mf_navi_bar_set_style
347 ** Description  :
348 ** Input        : struct appdata* data
349 **                eNaviBarStyle navi_style
350 **                Evas_Object *NaviContent
351 ** Output       : None
352 ** Return Value :
353 ** Calls        :
354 ** Called By    :
355 **
356 **  History        :
357 **  1.Date         : 2010/12/10
358 **    Author       : Samsung
359 **    Modification : Created function
360 **
361 ******************************/
362 void mf_navi_bar_title_set(void *data)
363 {
364         MF_TRACE_BEGIN;
365         mf_retm_if(data == NULL, "data is NULL");
366         struct appdata *ap = (struct appdata *)data;
367         int more = ap->mf_Status.more;
368         char *path = ap->mf_Status.path->str;
369         Elm_Object_Item *navi_it = ap->mf_MainWindow.pNaviItem;
370         Evas_Object *pNavi = ap->mf_MainWindow.pNaviBar;
371
372         if (more == MORE_RENAME || more == MORE_CREATE_FOLDER ||  more == MORE_THUMBNAIL_RENAME) {
373                 // do nothing
374         } else {
375                 myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
376                 if (more != MORE_EDIT && more != MORE_SEARCH) {
377                         if (ap->mf_Status.view_type != mf_view_root) {
378                                 Evas_Object *home_btn = elm_button_add(pNavi);
379                                 //elm_object_style_set(home_btn, TITLE_BTN_STYLE);
380                                 elm_object_style_set(home_btn, "naviframe/title_icon");
381                                 Evas_Object *home_ic = elm_image_add(pNavi);
382                                 elm_image_file_set(home_ic, MF_TITLE_ICON_HOME, NULL);
383                                 elm_image_resizable_set(home_ic, EINA_TRUE, EINA_TRUE);
384                                 elm_object_content_set(home_btn, home_ic);
385                                 mf_language_mgr_register_object(home_btn, OBJ_TYPE_ELM_OBJECT, NULL, MF_LABEL_HOME);
386                                 evas_object_smart_callback_add(home_btn, "clicked", mf_callback_home_button_cb, ap);
387                                 evas_object_smart_callback_add(home_btn, "pressed", mf_callback_home_button_pressed_cb, home_ic);
388                                 evas_object_smart_callback_add(home_btn, "unpressed", mf_callback_home_button_unpressed_cb, home_ic);
389                                 evas_object_show(home_btn);
390                                 elm_object_item_part_content_set(navi_it, TITLE_LEFT_BTN, home_btn);
391
392                                 Evas_Object *up_btn = elm_button_add(pNavi);
393                                 //elm_object_style_set(up_btn, TITLE_BTN_STYLE);
394                                 elm_object_style_set(up_btn, "naviframe/title_icon");
395                                 Evas_Object *up_ic = elm_image_add(pNavi);
396                                 elm_image_file_set(up_ic, MF_TITLE_ICON_UPPER, NULL);
397                                 elm_image_resizable_set(up_ic, EINA_TRUE, EINA_TRUE);
398                                 elm_object_content_set(up_btn, up_ic);
399                                 mf_language_mgr_register_object(up_btn, OBJ_TYPE_ELM_OBJECT, NULL, MF_LABEL_UPPER);
400                                 evas_object_smart_callback_add(up_btn, "clicked", mf_callback_upper_click_cb, ap);
401                                 evas_object_smart_callback_add(up_btn, "pressed", mf_callback_upper_button_pressed_cb, up_ic);
402                                 evas_object_smart_callback_add(up_btn, "unpressed", mf_callback_upper_button_unpressed_cb, up_ic);
403                                 evas_object_show(up_btn);
404                                 elm_object_item_part_content_set(navi_it, TITLE_RIGHT_BTN, up_btn);
405
406                                 elm_naviframe_item_title_visible_set(navi_it, EINA_TRUE);
407                         }
408
409                 } else {
410                         elm_naviframe_item_title_visible_set(navi_it, EINA_TRUE);
411                 }
412
413                 Evas_Object *label = elm_label_add(pNavi);
414                 // set the label style
415                 elm_object_style_set(label, "naviframe_title");
416                 // set the label for the title slide mode
417                 elm_label_slide_mode_set(label, ELM_LABEL_SLIDE_MODE_AUTO);
418                 elm_label_wrap_width_set(label, 1);
419                 elm_label_ellipsis_set(label, EINA_TRUE);
420                 // set the label text
421                 if (more == MORE_EDIT) {
422                         elm_object_text_set(label, GET_SYS_STR(MF_LABEL_EDIT));
423                 } else {
424                         elm_object_text_set(label, pNavi_s->pNaviTitle);
425                 }
426                 evas_object_show(label);
427                 elm_object_item_part_content_set(navi_it, "elm.swallow.title", label);
428         }
429         MF_TRACE_END;
430
431 }
432 void mf_navi_bar_set_style(void *data, eNaviBarStyle navi_style, Evas_Object *NaviContent)
433 {
434         mf_retm_if(data == NULL, "data is NULL");
435         struct appdata *ap = (struct appdata *)data;
436
437         myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
438         Evas_Object *NaviBar = ap->mf_MainWindow.pNaviBar;
439         mf_retm_if(NaviBar == NULL, "Navi bar is NULL");
440         Evas_Object *pConform = ap->mf_MainWindow.pNaviLayout;
441         mf_retm_if(pConform == NULL, "Conformant is NULL");
442         Evas_Object *l_button = ap->mf_MainWindow.pNaviLeftBtn;
443         Elm_Object_Item *navi_it = NULL;
444
445         char *title = pNavi_s->pNaviTitle;
446         mfNaviBarSetContent(ap, pConform, NaviContent);
447
448         switch (navi_style) {
449         case NAVI_BAR_DEFAULT:  /*when MMC is off, show "myfile" only*/
450                 ap->mf_Status.pPreNaviItem = ap->mf_MainWindow.pNaviItem;
451                 mf_language_mgr_unregister_object_item_by_type(ITEM_TYPE_CTRL);
452                 navi_it = elm_naviframe_item_push(NaviBar, NULL, NULL, NULL, pConform, MF_NAVI_STYLE_ENABLE);
453
454                 ap->mf_MainWindow.pNaviItem = navi_it;
455                 break;
456         case NAVI_BAR_PATH_WITH_ONE_ACTION:
457                 ap->mf_Status.pPreNaviItem = ap->mf_MainWindow.pNaviItem;
458                 mf_language_mgr_unregister_object_item_by_type(ITEM_TYPE_CTRL);
459                 navi_it = elm_naviframe_item_push(NaviBar, NULL, l_button, NULL, pConform, MF_NAVI_STYLE_ENABLE);
460                 ap->mf_MainWindow.pNaviItem = navi_it;
461                 break;
462         default:
463                 break;
464         }
465 }
466
467
468 /******************************
469 ** Prototype    : __mf_navi_bar_select_count_label_timeout_cb
470 ** Description  :
471 ** Input        : void *data
472 **                Evas_Object *obj
473 **                void *event_info
474 ** Output       : None
475 ** Return Value :
476 ** Calls        :
477 ** Called By    :
478 **
479 **  History        :
480 **  1.Date         : 2010/12/10
481 **    Author       : Samsung
482 **    Modification : Created function
483 **
484 ******************************/
485
486
487
488 void mf_navi_bar_set_upper_item_disable(void *data, bool bFlag)
489 {
490         struct appdata *ap = (struct appdata *)data;
491         mf_retm_if(ap == NULL, "ap is NULL");
492         myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
493         mf_retm_if(pNavi_s == NULL, "get navigation bar in use failed");
494
495         if (!mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str)) {
496                 Elm_Object_Item *pUpperItem = NULL;
497                 Evas_Object *upper_genlist = NULL;
498
499                 upper_genlist = __mf_navi_bar_get_upper_genlist(ap->mf_MainWindow.pNaviInfoBox);
500                 pUpperItem = elm_genlist_first_item_get(upper_genlist);
501                 if (pUpperItem) {
502                         mfItemData_s *itemData = elm_object_item_data_get(pUpperItem);
503
504                         if (itemData && itemData->m_ItemName && itemData->m_ItemName->str
505                             && g_strcmp0(itemData->m_ItemName->str, ap->mf_Status.upper_folder) == 0) {
506                                 elm_object_item_disabled_set(pUpperItem, bFlag);
507                         }
508                 }
509         }
510 }
511
512 Evas_Object *__mf_navi_bar_backbutton_create(Evas_Object *parent, Evas_Object *win)
513 {
514         MF_TRACE_BEGIN;
515         mf_retvm_if(parent == NULL, NULL, "parent is NULL");
516         mf_retvm_if(win == NULL, NULL, "win is NULL");
517
518         Evas_Object *btn = NULL;
519         btn = elm_button_add(parent);
520         elm_object_style_set(btn, "naviframe/end_btn/default");
521         evas_object_show(btn);
522         return btn;
523
524 }
525 Evas_Object *mf_navi_bar_pathinfo_label_create(Evas_Object *parent, char *pathinfo)
526 {
527         MF_TRACE_BEGIN;
528         mf_retvm_if(parent == NULL, NULL, "parent is NULL");
529         mf_retvm_if(pathinfo == NULL, NULL, "pathinfo is NULL");
530         Evas_Object *label = NULL;
531
532         label = elm_label_add(parent);
533         elm_object_focus_set(label, EINA_FALSE);
534         evas_object_size_hint_weight_set(label, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
535         evas_object_size_hint_align_set(label, EVAS_HINT_FILL, EVAS_HINT_FILL);
536         elm_object_text_set(label, pathinfo);
537         evas_object_show(label);
538         SAFE_FREE_CHAR(pathinfo);
539         MF_TRACE_END;
540         return label;
541 }
542
543 Evas_Object *__mf_navi_bar_pathinfo_create(Evas_Object *parent, const char  *content)
544 {
545         MF_TRACE_BEGIN;
546         mf_retvm_if(parent == NULL, NULL, "parent is NULL");
547         mf_retvm_if(content == NULL, NULL, "content is NULL");
548
549         Evas_Object *layout = NULL;
550
551         layout = elm_layout_add(parent);
552         elm_object_focus_set(layout, EINA_FALSE);
553         elm_layout_file_set(layout, EDJ_NAME, GRP_PATH_INFO);
554         evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
555         evas_object_size_hint_align_set(layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
556
557         //elm_object_part_content_set(layout, "info", content);
558         elm_object_part_text_set(layout, "info", content);
559         evas_object_show(layout);
560         MF_TRACE_END;
561         return layout;
562 }
563
564 void mf_navi_add_back_button(void *data)
565 {
566         MF_TRACE_BEGIN;
567         mf_retm_if(data == NULL, "data is NULL");
568
569         struct appdata *ap = (struct appdata *)data;
570
571         Evas_Object *pBackButton = NULL;
572
573         pBackButton = __mf_navi_bar_backbutton_create(ap->mf_MainWindow.pNaviBar, ap->mf_MainWindow.pWindow);
574         if (pBackButton) {
575                 elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, "prev_btn", pBackButton);
576                 evas_object_smart_callback_add(pBackButton, "clicked", mf_callback_backbutton_clicked_cb, ap);
577         }
578 }
579
580 void mf_navi_remove_home_upper_button(void *data)
581 {
582         MF_TRACE_BEGIN;
583         mf_retm_if(data == NULL, "data is NULL");
584
585         struct appdata *ap = (struct appdata *)data;
586
587         if (ap->mf_Status.view_type != mf_view_root) {
588                 Evas_Object *btn = NULL;
589                 btn = elm_object_item_part_content_unset(ap->mf_MainWindow.pNaviItem, TITLE_LEFT_BTN);
590                 SAFE_FREE_OBJ(btn);
591                 btn = elm_object_item_part_content_unset(ap->mf_MainWindow.pNaviItem, TITLE_RIGHT_BTN);
592                 SAFE_FREE_OBJ(btn);
593         }
594 }
595
596 Evas_Object *mf_navi_bar_upper_create(Evas_Object *parent)
597 {
598         MF_TRACE_BEGIN;
599         mf_retvm_if(parent == NULL, NULL, "parent is NULL");
600
601         Evas_Object *upper_genlist = NULL;
602         upper_genlist = elm_genlist_add(parent);
603         mf_retvm_if(upper_genlist == NULL, NULL, "upper_genlist is NULL");
604         elm_object_focus_set(upper_genlist, EINA_FALSE);
605         evas_object_size_hint_weight_set(upper_genlist, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
606         evas_object_size_hint_align_set(upper_genlist, EVAS_HINT_FILL, EVAS_HINT_FILL);
607         elm_scroller_bounce_set(upper_genlist, EINA_FALSE, EINA_FALSE);
608         evas_object_show(upper_genlist);
609         MF_TRACE_END;
610         return upper_genlist;
611
612 }
613
614 void mf_navi_bar_remove_back_button(Elm_Object_Item *pNaviItem)
615 {
616         MF_TRACE_BEGIN;
617         mf_retm_if(pNaviItem == NULL, "pNaviItem is NULL");
618         Evas_Object *back_btn = NULL;
619
620         back_btn = elm_object_item_part_content_get(pNaviItem, "prev_btn");
621         if (back_btn != NULL) {
622                 elm_object_item_part_content_unset(pNaviItem, "prev_btn");
623                 evas_object_hide(back_btn);
624                 evas_object_del(back_btn);
625         }
626         MF_TRACE_END;
627 }
628
629 Evas_Object *mf_navi_bar_create_header_box(void *data)
630 {
631         MF_TRACE_BEGIN;
632         mf_retvm_if(data == NULL, NULL, "data is NULL");
633
634         struct appdata *ap = (struct appdata *)data;
635         Evas_Object *box = NULL;
636         Evas_Object *pathinfo_layout = NULL;
637         char *pathinfo = NULL;
638         char *info = NULL;
639         if (!mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str)) {
640                 myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
641                 mf_retvm_if(pNavi_s == NULL, NULL, "pNavi_s is NULL");
642
643                 //box = mf_widget_create_box(ap->mf_MainWindow.pNaviBox);
644                 //evas_object_size_hint_weight_set(box, EVAS_HINT_EXPAND, EVAS_HINT_FILL);
645                 //evas_object_size_hint_align_set(box, EVAS_HINT_FILL, EVAS_HINT_FILL);
646                 //elm_box_clear(box);
647
648
649
650
651                 pathinfo = mf_fm_svc_path_info_get(ap->mf_Status.path->str);
652                 info = mf_fm_svc_path_info_translate(pathinfo, MF_PATH_INFO_MAX_LENGTH_PORTRAIT);
653
654
655                 //Evas_Object *genlist = mf_genlist_create_path_info(box, info);
656                 pathinfo_layout = __mf_navi_bar_pathinfo_create(ap->mf_MainWindow.pNaviBox, info);
657                 evas_object_size_hint_weight_set(pathinfo_layout, EVAS_HINT_EXPAND, 0);
658                 evas_object_size_hint_align_set(pathinfo_layout, EVAS_HINT_FILL, 0.0);
659                 //evas_object_show(genlist);
660
661 #if 0
662                 upper_layout = elm_layout_add(box);
663                 elm_object_focus_set(upper_layout, EINA_FALSE);
664                 ret = elm_layout_file_set(upper_layout, EDJ_NAME, "upper_folder");
665                 evas_object_size_hint_weight_set(upper_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);//(upper_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
666                 evas_object_size_hint_align_set(upper_layout, EVAS_HINT_FILL, EVAS_HINT_FILL);
667                 evas_object_show(upper_layout);
668                 elm_box_pack_end(box, upper_layout);
669
670 #endif
671                 //elm_box_pack_start(box, pathinfo_layout);
672                 evas_object_show(pathinfo_layout);
673         }
674         MF_TRACE_END;
675         return pathinfo_layout;
676 }
677
678 void mf_navi_bar_set_ctrl_button(void *data)
679 {
680         MF_TRACE_BEGIN;
681         mf_retm_if(data == NULL, "data is NULL");
682         struct appdata *ap = (struct appdata *)data;
683         Elm_Object_Item *navi_it = ap->mf_MainWindow.pNaviItem;
684         Evas_Object *more_bt = NULL;
685         Evas_Object *bt_1 = NULL;
686         Evas_Object *bt_2 = NULL;
687         switch(ap->mf_Status.more) {
688         case MORE_DEFAULT:
689                 more_bt = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_EDIT, MF_LABEL_MORE, NULL, mf_callback_more_button_cb, ap);
690                 if (ap->mf_Status.view_type == mf_view_root) {
691                         bt_1 = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_STYLE, MF_LABEL_SEARCH, NULL, mf_search_bar_enter_search_routine, ap);
692                 } else {
693                         bt_1 = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_STYLE, MF_LABEL_EDIT, NULL, mf_callback_edit_cb, ap);
694                 }
695                 break;
696         case MORE_EDIT:
697                 more_bt = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_EDIT, MF_LABEL_MORE, NULL, mf_callback_more_button_cb, ap);
698                 bt_1 = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_STYLE, LABEL_DELETE, NULL, mf_callback_delete_cb, ap);
699                 bt_2 = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_STYLE, LABEL_SHARE, NULL, mf_callback_share_cb, ap);
700                 break;
701         case MORE_INTERNAL_COPY:
702         case MORE_DATA_COPYING:
703                 if (ap->mf_Status.view_type != mf_view_root) {
704                         more_bt = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_EDIT, MF_LABEL_MORE, NULL, mf_callback_more_button_cb, ap);
705                 }
706                 bt_1 = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_STYLE, LABEL_COPY_HERE, NULL, mf_callback_paste_here_cb, ap);
707                 break;
708         case MORE_INTERNAL_MOVE:
709         case MORE_DATA_MOVING:
710                 if (ap->mf_Status.view_type != mf_view_root) {
711                         more_bt = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_EDIT, MF_LABEL_MORE, NULL, mf_callback_more_button_cb, ap);
712                 }
713                 bt_1 = mf_widget_util_create_button(ap->mf_MainWindow.pNaviBar, NAVI_BUTTON_STYLE, LABEL_MOVE_HERE, NULL, mf_callback_move_here_cb, ap);
714                 break;
715         default:
716                 break;
717         }
718         if (more_bt) {
719                 elm_object_item_part_content_set(navi_it, NAVI_MORE_BUTTON_PART, more_bt);
720         }
721         if (bt_1) {
722                 elm_object_item_part_content_set(navi_it, NAVI_BOTTOM_BUTTON_1_PART, bt_1);
723         }
724         if (bt_2) {
725                 elm_object_item_part_content_set(navi_it, NAVI_BOTTOM_BUTTON_2_PART, bt_2);
726         }
727
728 }
729 void mf_navi_bar_reset_ctrl_button(void *data)
730 {
731         MF_TRACE_BEGIN;
732         mf_retm_if(data == NULL, "data is NULL");
733         struct appdata *ap = (struct appdata *)data;
734         Elm_Object_Item *navi_it = ap->mf_MainWindow.pNaviItem;
735         mf_retm_if(navi_it == NULL, "navi_it is NULL");
736
737         Evas_Object *more_bt = NULL;
738         Evas_Object *bt_1 = NULL;
739         Evas_Object *bt_2 = NULL;
740         more_bt = elm_object_item_part_content_unset(navi_it, NAVI_MORE_BUTTON_PART);
741         SAFE_FREE_OBJ(more_bt);
742         bt_1 = elm_object_item_part_content_unset(navi_it, NAVI_BOTTOM_BUTTON_1_PART);
743         SAFE_FREE_OBJ(bt_1);
744         bt_2 = elm_object_item_part_content_unset(navi_it, NAVI_BOTTOM_BUTTON_2_PART);
745         SAFE_FREE_OBJ(bt_2);
746         mf_navi_bar_set_ctrl_button(ap);
747 }
748 void mf_navi_bar_create_default_view(void *data)
749 {
750         MF_TRACE_BEGIN;
751         struct appdata *ap = (struct appdata *)data;
752
753         GString *title = NULL;
754         Evas_Object *newContent = NULL;
755         Evas_Object *box = NULL;
756         myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
757         mf_retm_if(pNavi_s == NULL, "get navigation bar in use failed");
758         mf_retm_if(ap->mf_MainWindow.pNaviBar == NULL, "ap->mf_MainWindow.pNaviBar is NULL");
759
760         __mf_navi_bar_reset_navi_obj(ap);
761
762         MF_TA_ACUM_ITEM_BEGIN("      create view box", 0);
763         ap->mf_MainWindow.pNaviBox = mf_widget_create_box(ap->mf_MainWindow.pNaviBar);
764         MF_TA_ACUM_ITEM_END("      create view box", 0);
765
766         ap->mf_MainWindow.pNaviLayout = mf_widget_create_layout(ap->mf_MainWindow.pNaviBox, EDJ_NAME, "selectinfo_layout");
767         /*set content*/
768         MF_TA_ACUM_ITEM_BEGIN("      create genlist", 0);
769         newContent = mf_navi_bar_content_create(ap);
770         MF_TA_ACUM_ITEM_END("      create genlist", 0);
771         /*set title     segment or title*/
772         evas_object_show(newContent);
773         MF_TA_ACUM_ITEM_BEGIN("      set title", 0);
774         if (ap->mf_Status.view_type == mf_view_root) {
775                 title = g_string_new(GET_SYS_STR(LABEL_MYFILE));
776         } else if (mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str)) {
777                 title = g_string_new(GET_SYS_STR(LABEL_MYFILE));
778         } else {
779                 title = mf_fm_svc_wrapper_get_file_name(ap->mf_Status.path);
780         }
781         MF_TA_ACUM_ITEM_END("      set title", 0);
782
783         MF_TA_ACUM_ITEM_BEGIN("      set content of conform", 0);
784
785         if (title != NULL) {
786                 pNavi_s->pNaviTitle = g_strdup(title->str);
787                 g_string_free(title, TRUE);
788                 title = NULL;
789         }
790
791         /*navigation view integration*/
792         mfNaviBarSetContent(ap, ap->mf_MainWindow.pNaviLayout, newContent);
793         MF_TA_ACUM_ITEM_END("      set content of conform", 0);
794
795         MF_TA_ACUM_ITEM_BEGIN("      set conform to box", 0);
796         elm_box_pack_end(ap->mf_MainWindow.pNaviBox, ap->mf_MainWindow.pNaviLayout);
797         MF_TA_ACUM_ITEM_END("      set conform to box", 0);
798
799         MF_TA_ACUM_ITEM_BEGIN("      create header box", 0);
800         if (ap->mf_Status.view_type == mf_view_normal) {
801                 box = mf_navi_bar_create_header_box(ap);
802                 if (box) {
803                         ap->mf_MainWindow.pNaviInfoBox = box;
804                         elm_box_pack_start(ap->mf_MainWindow.pNaviBox, box);
805                 }
806         }
807         MF_TA_ACUM_ITEM_END("      create header box", 0);
808
809         MF_TA_ACUM_ITEM_BEGIN("      push view to navibar", 0);
810
811         ap->mf_Status.pPreNaviItem = ap->mf_MainWindow.pNaviItem;
812
813         mf_language_mgr_unregister_object_item_by_type(ITEM_TYPE_CTRL);
814         ap->mf_MainWindow.pNaviItem = elm_naviframe_item_push(ap->mf_MainWindow.pNaviBar, NULL, NULL, NULL, ap->mf_MainWindow.pNaviBox, MF_NAVI_STYLE_ENABLE);
815
816         MF_TA_ACUM_ITEM_END("      push view to navibar", 0);
817
818         MF_TA_ACUM_ITEM_BEGIN("      add backbutton", 0);
819         if (ap->mf_Status.more != MORE_INTERNAL_COPY && ap->mf_Status.more != MORE_INTERNAL_MOVE) {
820                 mf_navi_add_back_button(ap);
821         }
822         MF_TA_ACUM_ITEM_END("      add backbutton", 0);
823
824         /*add control bar for navigation bar*/
825         MF_TA_ACUM_ITEM_BEGIN("      add control bar", 0);
826         //mf_navi_bar_set_ctrl_bar(ap);
827
828         mf_navi_bar_set_ctrl_button(data);
829         MF_TA_ACUM_ITEM_END("      add control bar", 0);
830
831         MF_TA_ACUM_ITEM_BEGIN("      set control bar", 0);
832         if (ap->mf_Status.flagNoContent == 1) {
833                 mf_navi_bar_button_set_disable(ap->mf_MainWindow.pNaviItem, CTRL_DISABLE_NOCONTENT_VIEW, true);
834                 //mf_ctrl_bar_item_set_disable(ap->mf_MainWindow.pNaviCtrlBar, CTRL_DISABLE_NOCONTENT_VIEW, TRUE);
835         } else {
836                 mf_navi_bar_button_set_disable(ap->mf_MainWindow.pNaviItem, CTRL_DISABLE_NOCONTENT_VIEW, FALSE);
837                 //mf_ctrl_bar_item_set_disable(ap->mf_MainWindow.pNaviCtrlBar, CTRL_DISABLE_NOCONTENT_VIEW, FALSE);
838         }
839 #ifdef MYFILE_USB_OTG
840         if(mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str) == MYFILE_OTG) {
841                 ap->mf_Otg.rootpath_box = ap->mf_MainWindow.pNaviBox;
842                 ap->mf_Otg.rootpath_layout = ap->mf_MainWindow.pNaviLayout;
843                 ap->mf_Otg.rootpath_navi_item = ap->mf_MainWindow.pNaviItem;
844                 mf_navi_bar_button_set_disable(ap->mf_MainWindow.pNaviItem, CTRL_DISABLE_OTG_ROOT, TRUE);
845                 //mf_ctrl_bar_item_set_disable(ap->mf_MainWindow.pNaviCtrlBar, CTRL_DISABLE_OTG_ROOT, TRUE);
846         }
847 #endif
848         MF_TA_ACUM_ITEM_END("      set control bar", 0);
849         mf_navi_bar_title_set(ap);
850         /*temp data free*/
851         MF_TRACE_END;
852 }
853
854 /******************************
855 ** Prototype    : mf_navi_bar_create_edit_view
856 ** Description  :
857 ** Input        : void *data
858 ** Output       : None
859 ** Return Value :
860 ** Calls        :
861 ** Called By    :
862 **
863 **  History        :
864 **  1.Date         : 2010/12/10
865 **    Author       : Samsung
866 **    Modification : Created function
867 **
868 ******************************/
869 void mf_navi_bar_remove_path_info(void *data)
870 {
871         MF_TRACE_BEGIN;
872         struct appdata *ap = (struct appdata *)data;
873         mf_retm_if(ap == NULL, "ap is NULL");
874
875         if (!mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str)) {
876                 elm_box_unpack(ap->mf_MainWindow.pNaviBox, ap->mf_MainWindow.pNaviPathInfo);
877                 evas_object_hide(ap->mf_MainWindow.pNaviPathInfo);
878                 //evas_object_del(pNavi_s->pNaviPathInfo);
879                 ap->mf_MainWindow.pEditView.pPathInfo = ap->mf_MainWindow.pNaviPathInfo;
880         } else {
881                 ap->mf_MainWindow.pEditView.pPathInfo = NULL;
882         }
883         MF_TRACE_END;
884 }
885
886 void mf_navi_bar_recover_path_info(void *data, myfileNaviBar *pNavi_s)
887 {
888         MF_TRACE_BEGIN;
889         struct appdata *ap = (struct appdata *)data;
890         mf_retm_if(ap == NULL, "ap is NULL");
891
892         if (ap->mf_MainWindow.pEditView.pPathInfo) {
893                 ap->mf_MainWindow.pNaviPathInfo = ap->mf_MainWindow.pEditView.pPathInfo;
894                 elm_box_pack_start(ap->mf_MainWindow.pNaviBox, ap->mf_MainWindow.pNaviPathInfo);
895                 evas_object_show(ap->mf_MainWindow.pEditView.pPathInfo);
896         }
897
898         MF_TRACE_END;
899         return;
900 }
901
902 void mf_navi_bar_remove_info_box(void *data)
903 {
904         MF_TRACE_BEGIN;
905         struct appdata *ap = (struct appdata *)data;
906         mf_retm_if(ap == NULL, "ap is NULL");
907
908         if (!mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str)) {
909                 elm_box_unpack(ap->mf_MainWindow.pNaviBox, ap->mf_MainWindow.pNaviInfoBox);
910                 evas_object_hide(ap->mf_MainWindow.pNaviInfoBox);
911                 ap->mf_MainWindow.pEditView.pInfoBox = ap->mf_MainWindow.pNaviInfoBox;
912         } else {
913                 ap->mf_MainWindow.pEditView.pInfoBox = NULL;
914         }
915         MF_TRACE_END;
916 }
917
918 void mf_navi_bar_recover_info_box(void *data, myfileNaviBar *pNavi_s)
919 {
920         MF_TRACE_BEGIN;
921         struct appdata *ap = (struct appdata *)data;
922         mf_retm_if(ap == NULL, "ap is NULL");
923
924         if (ap->mf_MainWindow.pEditView.pInfoBox) {
925                 ap->mf_MainWindow.pNaviInfoBox = ap->mf_MainWindow.pEditView.pInfoBox;
926                 elm_box_pack_start(ap->mf_MainWindow.pNaviBox, ap->mf_MainWindow.pNaviInfoBox);
927                 evas_object_show(ap->mf_MainWindow.pEditView.pInfoBox);
928         }
929
930         MF_TRACE_END;
931         return;
932 }
933
934 void mf_navi_bar_edit_list_update(void *data)
935 {
936         MF_TRACE_BEGIN;
937         mf_retm_if(data == NULL, "data is NULL");
938
939         struct appdata *ap = (struct appdata *)data;
940
941         if (ap->mf_Status.flagViewType == MF_VIEW_STYLE_LIST || ap->mf_Status.flagViewType == MF_VIEW_SYTLE_LIST_DETAIL) {
942                 if (ap->mf_MainWindow.pNaviGenlist) {
943                         mf_genlist_sweep_item_recover(ap->mf_MainWindow.pNaviGenlist);
944                         mf_genlist_update_edit_view_item_style(ap);
945                         ap->mf_MainWindow.pEditView.pGenlist = ap->mf_MainWindow.pNaviGenlist;
946                         elm_genlist_decorate_mode_set(ap->mf_MainWindow.pNaviGenlist, EINA_TRUE);
947                 }
948         } else {
949                 Eina_List *file_list = NULL;
950                 Eina_List *dir_list = NULL;
951
952                 if (ap->mf_Status.view_type == mf_view_root_category) {
953                         file_list = ap->mf_FileOperation.category_list;
954                 } else {
955                         file_list = ap->mf_FileOperation.file_list;
956                         dir_list = ap->mf_FileOperation.folder_list;
957                 }
958
959                 if (ap->mf_MainWindow.pNaviGengrid) {
960                         elm_gengrid_clear(ap->mf_MainWindow.pNaviGengrid);
961                         mf_gengrid_create_list_default_style(ap->mf_MainWindow.pNaviGengrid, ap, dir_list, file_list);
962                         ap->mf_MainWindow.pEditView.pGengrid = ap->mf_MainWindow.pNaviGengrid;
963                 }
964         }
965
966 }
967
968 void mf_navi_bar_create_edit_view(void *data)
969 {
970         MF_TRACE_BEGIN;
971         struct appdata *ap = (struct appdata *)data;
972         mf_retm_if(ap == NULL, "ap is NULL");
973
974         //Evas_Object *pSelectAllLayout = NULL;
975         /*get navigation bar to create view*/
976         myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
977         mf_retm_if(pNavi_s == NULL, "get navigation bar in use failed");
978
979         ap->mf_MainWindow.pEditView.pBox = ap->mf_MainWindow.pNaviBox;
980
981         mf_navi_bar_remove_info_box(ap);
982                 /*create conformant*/
983         mf_navi_remove_home_upper_button(ap);
984
985         Evas_Object *select_all_btn = elm_button_add(ap->mf_MainWindow.pNaviBar);
986         elm_object_style_set(select_all_btn, "naviframe/title_icon");
987         Evas_Object *select_all_ic = elm_image_add(ap->mf_MainWindow.pNaviBar);
988         elm_image_file_set(select_all_ic, MF_TITLE_ICON_SELECT_ALL, NULL);
989         elm_image_resizable_set(select_all_ic, EINA_TRUE, EINA_TRUE);
990         elm_object_content_set(select_all_btn, select_all_ic);
991         evas_object_smart_callback_add(select_all_btn, "clicked", (Evas_Smart_Cb)__mf_genlist_select_all_layout_mouse_down_cb, ap);
992         evas_object_smart_callback_add(select_all_btn, "pressed", (Evas_Smart_Cb)mf_callback_select_all_button_pressed_cb, select_all_ic);
993         evas_object_smart_callback_add(select_all_btn, "unpressed", (Evas_Smart_Cb)mf_callback_select_all_button_unpressed_cb, select_all_ic);
994         evas_object_show(select_all_btn);
995         elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, TITLE_RIGHT_BTN, select_all_btn);
996
997         mf_navi_bar_title_set(ap);
998         mf_navi_bar_reset_ctrl_button(ap);
999
1000
1001         if (ap->mf_Status.flagViewType != MF_VIEW_STYLE_THUMBNAIL) {
1002                 Elm_Object_Item *it;
1003                 it = elm_genlist_first_item_get(ap->mf_MainWindow.pNaviGenlist);
1004                 while (it) {
1005                         elm_genlist_item_fields_update(it, "elm.icon.2", ELM_GENLIST_ITEM_FIELD_CONTENT);
1006                         it = elm_genlist_item_next_get(it);
1007                 }
1008         }
1009
1010
1011         //mf_ctrl_bar_reset(ap);
1012         mf_navi_bar_button_set_disable(ap->mf_MainWindow.pNaviItem, CTRL_DISABLE_EDIT_ALL, TRUE);
1013         //mf_ctrl_bar_item_set_disable(ap->mf_MainWindow.pNaviCtrlBar, CTRL_DISABLE_EDIT_ALL, true);
1014         /**    Todo:   should we add segment status set here?*/
1015         /*temp data free*/
1016         MF_TRACE_END;
1017 }
1018
1019 /******************************
1020 ** Prototype    : mf_navi_bar_create_path_select_view
1021 ** Description  :
1022 ** Input        : void *data
1023 ** Output       : None
1024 ** Return Value :
1025 ** Calls        :
1026 ** Called By    :
1027 **
1028 **  History        :
1029 **  1.Date         : 2010/12/10
1030 **    Author       : Samsung
1031 **    Modification : Created function
1032 **
1033 ******************************/
1034 void mf_navi_bar_create_path_select_view(void *data)
1035 {
1036         MF_TRACE_BEGIN;
1037         struct appdata *ap = (struct appdata *)data;
1038         GString *title = NULL;
1039         Evas_Object *newContent = NULL;
1040         Evas_Object *box = NULL;
1041         /*get navigation bar to create view*/
1042         myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
1043         mf_retm_if(pNavi_s == NULL, "get navigation bar in use failed");
1044
1045         /*set pre_status*/
1046         pNavi_s->pre_more = ap->mf_Status.more;
1047         /*create conformant*/
1048
1049         __mf_navi_bar_reset_navi_obj(ap);
1050
1051         ap->mf_MainWindow.pNaviBox = mf_widget_create_box(ap->mf_MainWindow.pNaviBar);
1052         ap->mf_MainWindow.pNaviLayout = mf_widget_create_layout(ap->mf_MainWindow.pNaviBox, EDJ_NAME, "selectinfo_layout");
1053         /*set content*/
1054         newContent = mf_navi_bar_content_create(ap);
1055
1056         /*set title     segment or title*/
1057         if (ap->mf_Status.view_type == mf_view_root) {
1058                 title = g_string_new(GET_SYS_STR(LABEL_MYFILE));
1059         } else if (mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str)) {
1060                 title = g_string_new(GET_SYS_STR(LABEL_MYFILE));
1061         } else {
1062                 title = mf_fm_svc_wrapper_get_file_name(ap->mf_Status.path);
1063         }
1064
1065         if (title != NULL) {
1066
1067                 pNavi_s->pNaviTitle = g_strdup(title->str);
1068                 g_string_free(title, TRUE);
1069                 title = NULL;
1070         }
1071         mfNaviBarSetContent(ap, ap->mf_MainWindow.pNaviLayout, newContent);
1072         elm_box_pack_end(ap->mf_MainWindow.pNaviBox, ap->mf_MainWindow.pNaviLayout);
1073         if (ap->mf_Status.view_type == mf_view_normal) {
1074                 box = mf_navi_bar_create_header_box(ap);
1075                 if (box) {
1076                         ap->mf_MainWindow.pNaviInfoBox = box;
1077                         elm_box_pack_start(ap->mf_MainWindow.pNaviBox, box);
1078                 }
1079         }
1080         /*Navigation bar Path Select view integration*/
1081
1082         MF_TA_ACUM_ITEM_BEGIN("      push view to navibar", 0);
1083         ap->mf_Status.pPreNaviItem = ap->mf_MainWindow.pNaviItem;
1084
1085         mf_language_mgr_unregister_object_item_by_type(ITEM_TYPE_CTRL);
1086         ap->mf_MainWindow.pNaviItem = elm_naviframe_item_push(ap->mf_MainWindow.pNaviBar, NULL, NULL, NULL, ap->mf_MainWindow.pNaviBox, MF_NAVI_STYLE_ENABLE);
1087         MF_TA_ACUM_ITEM_END("      push view to navibar", 0);
1088
1089         mf_navi_add_back_button(ap);
1090
1091         /*add control bar for navigation bar*/
1092         //mf_navi_bar_set_ctrl_bar(ap);
1093         mf_navi_bar_set_ctrl_button(data);
1094 #ifdef MYFILE_USB_OTG
1095         /*control bar disable set if in otg root path*/
1096         if (mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str) == MYFILE_OTG) {
1097                 mf_navi_bar_button_set_disable(ap->mf_MainWindow.pNaviItem, CTRL_DISABLE_OTG_OPT_ROOT, TRUE);
1098         }
1099 #endif
1100         if (ap->mf_Status.view_type == mf_view_root || ap->mf_Status.view_type == mf_view_root_category) {
1101                 mf_navi_bar_button_set_disable(ap->mf_MainWindow.pNaviItem, CTRL_DISABLE_OTG_ROOT, TRUE);
1102         }
1103         mf_navi_bar_title_set(ap);
1104         MF_TRACE_END;
1105
1106         /**    Todo:   should we add segment status set here?*/
1107         /*temp data free*/
1108 }
1109
1110 void mf_navi_bar_create_path_select_view_otg_root(void *data)
1111 {
1112
1113         struct appdata *ap = (struct appdata *)data;
1114         GString *title = NULL;
1115         Evas_Object *newContent = NULL;
1116
1117         /*get navigation bar to create view*/
1118         myfileNaviBar *pNavi_s = mf_navi_bar_get_struct_by_label(ap, GET_STR(MF_LABEL_OTG));
1119         mf_retm_if(pNavi_s == NULL, "get navigation bar in use failed");
1120
1121         /*set pre_status*/
1122         pNavi_s->pre_more = ap->mf_Status.more;
1123         /*create conformant*/
1124         __mf_navi_bar_reset_navi_obj(ap);
1125
1126         ap->mf_MainWindow.pNaviLayout = mf_widget_create_layout(ap->mf_MainWindow.pNaviBar, EDJ_NAME, "selectinfo_layout");
1127
1128         ap->mf_MainWindow.pNaviBox = ap->mf_MainWindow.pNaviLayout;
1129         /*set content*/
1130         newContent = mf_navi_bar_content_create(ap);
1131
1132         /*set title     segment or title*/
1133         if (ap->mf_Status.view_type == mf_view_root) {
1134                 title = g_string_new(GET_SYS_STR(LABEL_MYFILE));
1135         } else if (mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str)) {
1136                 title = g_string_new(GET_SYS_STR(LABEL_MYFILE));
1137         } else {
1138                 title = mf_fm_svc_wrapper_get_file_name(ap->mf_Status.path);
1139         }
1140
1141         if (title != NULL) {
1142
1143                 pNavi_s->pNaviTitle = g_strdup(title->str);
1144                 g_string_free(title, TRUE);
1145                 title = NULL;
1146         }
1147         /*Navigation bar Path Select view integration*/
1148         mf_navi_bar_set_style(ap, NAVI_BAR_PATH_WITH_ONE_ACTION, newContent);
1149         /*add control bar for navigation bar*/
1150         //mf_navi_bar_set_ctrl_bar(ap);
1151         mf_navi_add_back_button(ap);
1152         mf_navi_bar_set_ctrl_button(data);
1153         mf_navi_bar_title_set(ap);
1154 #ifdef MYFILE_USB_OTG
1155         /*control bar disable set if in otg root path*/
1156         if(mf_fm_svc_wrapper_is_root_path(ap->mf_Status.path->str) == MYFILE_OTG) {
1157                 mf_navi_bar_button_set_disable(ap->mf_MainWindow.pNaviItem, CTRL_DISABLE_OTG_ROOT, TRUE);
1158                 //mf_ctrl_bar_item_set_disable(ap->mf_MainWindow.pNaviCtrlBar, CTRL_DISABLE_OTG_ROOT, TRUE);
1159         }
1160
1161 #endif
1162         /**    Todo:   should we add segment status set here?*/
1163         /*temp data free*/
1164 }
1165
1166
1167 /******************************
1168 ** Prototype    : mf_navi_bar_create_search_view
1169 ** Description  :
1170 ** Input        : void *data
1171 ** Output       : None
1172 ** Return Value :
1173 ** Calls        :
1174 ** Called By    :
1175 **
1176 **  History        :
1177 **  1.Date         : 2010/12/10
1178 **    Author       : Samsung
1179 **    Modification : Created function
1180 **
1181 ******************************/
1182 #ifdef MYFILE_SPLIT_VIEW
1183 void mf_navi_bar_set_panes_navi_to_main(void *data)
1184 {
1185         MF_TRACE_BEGIN;
1186         mf_retm_if(data == NULL, "data is NULL");
1187         struct appdata *ap = (struct appdata*)data;
1188         if (ap->mf_Status.rotation_type == MF_ROTATE_LANDSCAPE) {
1189
1190                 mf_widget_unset_main_layout_content(ap->mf_MainWindow.sSplitData.pMainLayout);
1191                 /***1. unset naviframe from panes/right layout **/
1192                 mf_split_view_unset_right_content(ap);
1193                 /***2. unset panes from main layout **/
1194                 mf_widget_unset_main_layout_content(ap->mf_MainWindow.pMainLayout);
1195
1196
1197                 /***3. set naviframe to main layout **/
1198                 elm_object_part_content_set(ap->mf_MainWindow.pMainLayout, "elm.swallow.content", ap->mf_MainWindow.pNaviBar);
1199         }
1200         MF_TRACE_END;
1201 }
1202
1203 void mf_navi_bar_reset_panes_main(void *data)
1204 {
1205         MF_TRACE_BEGIN;
1206         mf_retm_if(data == NULL, "data is NULL");
1207         struct appdata *ap = (struct appdata*)data;
1208
1209
1210         mf_widget_unset_main_layout_content(ap->mf_MainWindow.pMainLayout);
1211         elm_object_part_content_set(ap->mf_MainWindow.sSplitData.pMainLayout, "elm.swallow.content", ap->mf_MainWindow.pNaviBar);
1212
1213         mf_widget_panes_right_set(ap->mf_MainWindow.sSplitData.pPanes, ap->mf_MainWindow.sSplitData.pMainLayout);
1214         /**** 3. set panes to main layout **/
1215         elm_object_part_content_set(ap->mf_MainWindow.pMainLayout, "elm.swallow.content", ap->mf_MainWindow.sSplitData.pPanes);
1216         mf_split_view_show(ap);
1217         MF_TRACE_END;
1218 }
1219 #endif
1220 void mf_navi_bar_create_search_view(void *data)
1221 {
1222         MF_TRACE_BEGIN;
1223         struct appdata *ap = (struct appdata *)data;
1224
1225         GString *title = NULL;
1226         Evas_Object *path_label = NULL;
1227 #ifdef MYFILE_SPLIT_VIEW
1228         if (ap->mf_Status.rotation_type == MF_ROTATE_LANDSCAPE) {
1229                 mf_navi_bar_set_panes_navi_to_main(ap);
1230         }
1231 #endif
1232
1233         __mf_navi_bar_reset_navi_obj(ap);
1234
1235         myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
1236         mf_retm_if(pNavi_s == NULL, "get navigation bar in use failed");
1237         Evas_Object *pSearchViewLayout = NULL;
1238         //ap->mf_MainWindow.pNaviLayout = mf_widget_create_layout(ap->mf_MainWindow.pNaviBox, EDJ_NAME, "selectinfo_layout");
1239         pSearchViewLayout = mf_widget_create_layout(ap->mf_MainWindow.pNaviBar, EDJ_NAME, "selectinfo_layout");
1240         ap->mf_MainWindow.pNaviLayout = pSearchViewLayout;
1241
1242         ap->mf_MainWindow.pNaviSearchBar = mf_navi_bar_create_search_bar(pSearchViewLayout, ap);
1243         ap->mf_MainWindow.pNaviBox = mf_widget_create_box(ap->mf_MainWindow.pNaviBar);
1244
1245         /*set content*/
1246         /*2. create path label for the start of search view*/
1247         /*2.1 create path label*/
1248
1249         path_label = elm_entry_add(pSearchViewLayout);
1250
1251         elm_object_style_set(path_label, "default");
1252         elm_entry_single_line_set(path_label, EINA_FALSE);
1253         elm_object_focus_set(path_label, EINA_FALSE);
1254
1255         evas_object_show(path_label);
1256         /*2.2 contribute label content*/
1257         char *path_in_label = mf_fm_svc_wrapper_translate_path(ap->mf_Status.path->str, MF_TRANS_OPTION_LABEL);
1258         char *label_content = g_strconcat(GET_SYS_STR(MF_LABEL_SEARCH), ":", "<br>", path_in_label, NULL);
1259         /*2.3 set style for path_label*/
1260         elm_entry_editable_set(path_label, EINA_FALSE);
1261         elm_entry_entry_set(path_label, label_content);
1262
1263         /*set title segment or title*/
1264         title = g_string_new(GET_SYS_STR(MF_LABEL_SEARCH));
1265         if (title != NULL) {
1266                 pNavi_s->pNaviTitle = g_strdup(title->str);
1267                 g_string_free(title, TRUE);
1268                 title = NULL;
1269         }
1270         /*navigation view integration*/
1271         elm_object_part_content_set(pSearchViewLayout, "content", path_label);
1272         elm_box_pack_end(ap->mf_MainWindow.pNaviBox, pSearchViewLayout);
1273         elm_box_pack_start(ap->mf_MainWindow.pNaviBox, ap->mf_MainWindow.pNaviSearchBar);
1274
1275
1276         ap->mf_Status.pPreNaviItem = ap->mf_MainWindow.pNaviItem;
1277
1278         mf_language_mgr_unregister_object_item_by_type(ITEM_TYPE_CTRL);
1279         ap->mf_MainWindow.pNaviItem = elm_naviframe_item_push(ap->mf_MainWindow.pNaviBar, NULL, NULL, NULL, ap->mf_MainWindow.pNaviBox, MF_NAVI_STYLE_ENABLE);
1280
1281
1282         /*hide Tab Bar in search view*/
1283
1284         /*add control bar for navigation bar*/
1285         /*temp data free*/
1286         if (path_in_label != NULL) {
1287                 free(path_in_label);
1288                 path_in_label = NULL;
1289         }
1290         if (label_content != NULL) {
1291                 free(label_content);
1292                 label_content = NULL;
1293         }
1294         mf_navi_bar_title_set(ap);
1295         evas_object_show(ap->mf_MainWindow.pSearchEntry);
1296         elm_object_focus_set(ap->mf_MainWindow.pSearchEntry, EINA_TRUE);
1297         mf_navi_bar_remove_previous_contents(ap, ap->mf_MainWindow.pNaviBar);
1298
1299         MF_TRACE_END;
1300 }
1301
1302 static void __new_folder_entryfield_create(Evas_Object *parent, void *data)
1303 {
1304         MF_TRACE_BEGIN;
1305         struct appdata *ap = (struct appdata *)data;
1306         mf_retm_if(ap == NULL, "ap is NULL");
1307         mf_retm_if(parent == NULL, "parent is NULL");
1308         int error_code = 0;
1309         char *fileName = NULL;
1310         GString *dest_fullpath;
1311         static Elm_Entry_Filter_Limit_Size limit_filter;
1312         Evas_Object *entry = NULL;
1313         Evas_Object *edit_field = NULL;
1314         char *fullpath = (char *)malloc(sizeof(char) * MYFILE_FILE_PATH_LEN_MAX);
1315         if (fullpath == NULL) {
1316                 MF_TRACE_END;
1317                 return;
1318         }
1319         mf_widget_create_entryfield(ap, parent, mf_callback_new_folder_changed_cb, NULL);
1320         entry = ap->mf_MainWindow.pEntry;
1321
1322         edit_field = ap->mf_MainWindow.pEditField;
1323
1324         limit_filter.max_char_count = MYFILE_FILE_NAME_LEN_MAX;
1325         limit_filter.max_byte_count = 0;
1326
1327         memset(fullpath, 0, MYFILE_FILE_PATH_LEN_MAX);
1328         fileName = elm_entry_markup_to_utf8(GET_SYS_STR(MF_LABEL_FOLDER));
1329         snprintf(fullpath, (MYFILE_FILE_PATH_LEN_MAX), "%s/%s", (char *)ap->mf_Status.path->str, fileName);
1330
1331         dest_fullpath = g_string_new(fullpath);
1332
1333         elm_entry_markup_filter_append(ap->mf_MainWindow.pEntry, elm_entry_filter_limit_size, &limit_filter);
1334         evas_object_smart_callback_add(ap->mf_MainWindow.pEntry, "maxlength,reached", mf_callback_max_len_reached_cb, ap);
1335         evas_object_smart_callback_add(ap->mf_MainWindow.pEntry, "preedit,changed",
1336                                        mf_callback_imf_preedit_change_cb, ap);
1337
1338         if (mf_fm_svc_wrapper_detect_duplication(dest_fullpath)) {
1339                 mf_debug("dectetion result is TRUE\ndest_fullpath is %s\n", dest_fullpath->str);
1340                 error_code = mf_fm_svc_wrapper_file_auto_rename(ap, dest_fullpath, FILE_NAME_WITH_BRACKETS, &dest_fullpath);
1341                 mf_debug("rename result is %s\n", dest_fullpath->str);
1342                 memset(fullpath, 0, strlen(fullpath));
1343                 int len = strlen(ap->mf_Status.path->str) + 1;
1344                 strncpy(fullpath, dest_fullpath->str + len, MYFILE_FILE_PATH_LEN_MAX);
1345                 /*memset(fileName,0,strlen(fileName));*/
1346
1347                 SAFE_FREE_CHAR(fileName);
1348                 fileName = elm_entry_markup_to_utf8(fullpath);
1349         }
1350
1351         /*elm_entry_entry_set(entry, ecore_file_file_get(params->m_ItemName->str));*/
1352         mf_widget_imf_hide_callback_register(ap->mf_MainWindow.pConformant, entry);
1353
1354         elm_entry_entry_set(entry, fileName);
1355         elm_entry_cursor_end_set(entry);
1356
1357         SAFE_FREE_CHAR(fullpath);
1358         SAFE_FREE_GSTRING(dest_fullpath);
1359         SAFE_FREE_CHAR(fileName);
1360         MF_TRACE_END;
1361
1362 }
1363 void mf_navi_bar_create_new_folder_view(void *data)
1364 {
1365
1366         struct appdata *ap = (struct appdata *)data;
1367         mf_retm_if(ap == NULL, "ap is NULL");
1368
1369         Evas_Object *newContent = NULL;
1370
1371         Evas_Object *pNaviBar = NULL;
1372         GString *title = NULL;
1373 #ifdef MYFILE_SPLIT_VIEW
1374         if (ap->mf_Status.rotation_type == MF_ROTATE_LANDSCAPE) {
1375                 mf_navi_bar_set_panes_navi_to_main(ap);
1376         }
1377 #endif
1378
1379         myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
1380         mf_retm_if(pNavi_s == NULL, "pNavi_s is NULL");
1381
1382         __mf_navi_bar_reset_navi_obj(ap);
1383
1384         pNaviBar = ap->mf_MainWindow.pNaviBar;
1385         ap->mf_MainWindow.pNaviBox = NULL;
1386         ap->mf_MainWindow.pNaviLayout= NULL;
1387
1388         ap->mf_MainWindow.pNaviBox = mf_widget_create_box(ap->mf_MainWindow.pNaviBar);
1389         newContent = mf_widget_create_layout(ap->mf_MainWindow.pNaviBox, EDJ_NAME, GRP_NEW_FOLDER);
1390         __new_folder_entryfield_create(newContent, ap);
1391         evas_object_size_hint_weight_set(newContent, EVAS_HINT_EXPAND, 0);
1392         evas_object_size_hint_align_set(newContent, EVAS_HINT_FILL, 0.0);
1393         Evas_Object *pad = mf_widget_create_layout(ap->mf_MainWindow.pNaviBox, EDJ_NAME, "PAD");
1394         elm_object_part_content_set(newContent, "content", ap->mf_MainWindow.pEditField);
1395         elm_box_pack_start(ap->mf_MainWindow.pNaviBox, newContent);
1396         elm_box_pack_end(ap->mf_MainWindow.pNaviBox, pad);
1397         //newContent = mf_genlist_create_list_new_folder_style(ap);
1398         /*set title segment or title*/
1399         /*navigation view integration*/
1400
1401         Elm_Object_Item *navi_it = NULL;
1402         //mf_navi_bar_set_style(ap, NAVI_BAR_DEFAULT, newContent);
1403         ap->mf_Status.pPreNaviItem = ap->mf_MainWindow.pNaviItem;
1404         mf_language_mgr_unregister_object_item_by_type(ITEM_TYPE_CTRL);
1405         navi_it = elm_naviframe_item_push(pNaviBar, NULL, NULL, NULL, ap->mf_MainWindow.pNaviBox, NULL);
1406
1407         ap->mf_MainWindow.pNaviItem = navi_it;
1408
1409         //mf_navi_add_back_button(ap);
1410
1411         Evas_Object *l_bt = NULL;
1412         Evas_Object *r_bt = NULL;
1413
1414         l_bt = elm_button_add(ap->mf_MainWindow.pNaviBar);
1415         elm_object_focus_set(l_bt, EINA_FALSE);
1416         elm_object_style_set(l_bt, "naviframe/title/default");
1417         elm_object_text_set(l_bt, GET_SYS_STR(LABEL_SAVE));
1418         mf_language_mgr_register_object(l_bt, OBJ_TYPE_ELM_OBJECT, NULL, LABEL_SAVE);
1419         evas_object_smart_callback_add(l_bt, "clicked", mf_callback_save_cb, ap);
1420         evas_object_show(l_bt);
1421         elm_object_item_part_content_set(navi_it, "title_toolbar_button1", l_bt);
1422         //elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, TITLE_LEFT_BTN, l_bt);
1423
1424 #if 1
1425         r_bt = elm_button_add(ap->mf_MainWindow.pNaviBar);
1426         elm_object_focus_set(r_bt, EINA_FALSE);
1427         elm_object_style_set(r_bt, "naviframe/end_btn/default");
1428         //elm_object_style_set(r_bt, TITLE_BTN_STYLE);
1429         //elm_object_text_set(r_bt, GET_SYS_STR(LABEL_CANCEL));
1430         //mf_language_mgr_register_object(r_bt, OBJ_TYPE_ELM_OBJECT, NULL, LABEL_CANCEL);
1431         evas_object_smart_callback_add(r_bt, "clicked", mf_callback_cancel_cb, ap);
1432         evas_object_show(r_bt);
1433         elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, "title_prev_btn", r_bt);
1434 #endif
1435         elm_object_item_signal_emit(navi_it, "elm,state,sip,shown", "");
1436
1437         elm_object_focus_set(ap->mf_MainWindow.pEntry, EINA_TRUE);
1438
1439
1440 }
1441
1442 static void __rename_entryfield_create(Evas_Object *parent, void *data)
1443 {
1444         MF_TRACE_BEGIN;
1445         MF_TRACE_BEGIN;
1446         mfItemData_s *params = (mfItemData_s *) data;
1447         mf_retvm_if(params == NULL, NULL, "param is NULL");
1448         mf_retvm_if(params->m_ItemName == NULL, NULL, "m_ItemName is NULL");
1449
1450         struct appdata *ap = (struct appdata *)params->ap;
1451         mf_retvm_if(ap == NULL, NULL, "input parameter data error");
1452
1453         static Elm_Entry_Filter_Limit_Size limit_filter_data;
1454         Evas_Object *edit_field = NULL;
1455         Evas_Object *entry = NULL;
1456         GString *filename = NULL;
1457
1458         mf_widget_create_entryfield(ap, parent, mf_callback_imf_changed_cb, NULL);
1459
1460         entry = ap->mf_MainWindow.pEntry;
1461
1462         edit_field = ap->mf_MainWindow.pEditField;
1463
1464         evas_object_size_hint_weight_set(edit_field, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
1465         evas_object_size_hint_align_set(edit_field, EVAS_HINT_FILL, EVAS_HINT_FILL);
1466
1467
1468         elm_entry_single_line_set(entry, EINA_TRUE);
1469         elm_entry_scrollable_set(entry, EINA_TRUE);
1470         elm_object_signal_emit(edit_field, "elm,state,eraser,show", "elm");
1471         //elm_editfield_eraser_set(edit_field, EINA_TRUE);
1472
1473         elm_entry_autocapital_type_set(entry, ELM_AUTOCAPITAL_TYPE_NONE);
1474         elm_entry_input_panel_layout_set(entry, ELM_INPUT_PANEL_LAYOUT_NORMAL);
1475
1476         if (params->ap->mf_FileOperation.to_rename != NULL) {
1477                 g_string_free(params->ap->mf_FileOperation.to_rename, TRUE);
1478                 params->ap->mf_FileOperation.to_rename = NULL;
1479         }
1480         params->ap->mf_FileOperation.to_rename = g_string_new((char *)params->m_ItemName->str);
1481
1482
1483         /* the below is sample code for control entry. It is not mandatory.*/
1484
1485         /* set guide text */
1486         filename = mf_fm_svc_wrapper_get_file_name(ap->mf_FileOperation.to_rename);
1487         char *guide_text = NULL;
1488         SAFE_FREE_CHAR(ap->mf_FileOperation.file_name_suffix);
1489         if (!mf_file_attr_is_dir(ap->mf_FileOperation.to_rename->str)) {
1490                 mf_debug();
1491                 char *ext = NULL;
1492                 char *name_without_ext = NULL;
1493                 name_without_ext = g_strdup(ap->mf_FileOperation.to_rename->str);
1494                 mf_file_attr_get_file_ext(ap->mf_FileOperation.to_rename->str, &ext);
1495                 mf_debug("ext is %s", ext);
1496                 if (ext && strlen(ext) != 0) {
1497                         mf_debug();
1498                         name_without_ext[strlen(name_without_ext) - strlen(ext) - 1] = '\0';
1499                         ap->mf_FileOperation.file_name_suffix = strdup(ext);
1500                         mf_debug("name_without_ext is [%s]\n", name_without_ext);
1501                         if (strlen(name_without_ext)) {
1502                                 guide_text = elm_entry_utf8_to_markup(ecore_file_file_get(name_without_ext));
1503                         } else {
1504                                 guide_text = elm_entry_utf8_to_markup(filename->str);
1505                         }
1506                 } else {
1507                         guide_text = elm_entry_utf8_to_markup(filename->str);
1508                 }
1509
1510                 SAFE_FREE_CHAR(ext);
1511                 SAFE_FREE_CHAR(name_without_ext);
1512         } else {
1513                 guide_text = elm_entry_utf8_to_markup(filename->str);
1514         }
1515
1516         if (ap->mf_FileOperation.file_name_suffix) {
1517                 limit_filter_data.max_char_count = (MYFILE_FILE_NAME_LEN_MAX - mf_util_character_count_get(ap->mf_FileOperation.file_name_suffix) - 1);
1518         } else {
1519                 limit_filter_data.max_char_count = MYFILE_FILE_NAME_LEN_MAX;
1520         }
1521
1522         limit_filter_data.max_byte_count = 0;
1523         elm_entry_markup_filter_append(ap->mf_MainWindow.pEntry, elm_entry_filter_limit_size, &limit_filter_data);
1524         elm_entry_input_panel_return_key_type_set(ap->mf_MainWindow.pEntry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
1525
1526         elm_entry_entry_set(ap->mf_MainWindow.pEntry, guide_text);
1527         /*elm_entry_entry_set(entry, ecore_file_file_get(params->m_ItemName->str));*/
1528         elm_entry_cursor_end_set(entry);
1529
1530         SAFE_FREE_CHAR(guide_text);
1531         SAFE_FREE_GSTRING(filename);
1532
1533         evas_object_smart_callback_add(entry, "activated", mf_genlist_rename_done, params->ap);
1534         evas_object_smart_callback_add(entry, "maxlength,reached", mf_callback_max_len_reached_cb, params->ap);
1535         evas_object_smart_callback_add(entry, "preedit,changed",
1536                                        mf_callback_imf_preedit_change_cb, ap);
1537         mf_widget_imf_hide_callback_register(ap->mf_MainWindow.pConformant, entry);
1538
1539         evas_object_show(entry);
1540         elm_object_focus_set(entry, EINA_TRUE);
1541
1542         MF_TRACE_END;
1543
1544 }
1545
1546 void mf_navi_bar_create_rename_view(void *data)
1547 {
1548
1549         MF_TRACE_BEGIN;
1550         mfItemData_s *params = (mfItemData_s *) data;
1551
1552         struct appdata *ap = (struct appdata *)params->ap;
1553         mf_retm_if(ap == NULL, "ap is NULL");
1554
1555         Evas_Object *newContent = NULL;
1556
1557         Evas_Object *pNaviBar = NULL;
1558         GString *title = NULL;
1559 #ifdef MYFILE_SPLIT_VIEW
1560         if (ap->mf_Status.rotation_type == MF_ROTATE_LANDSCAPE) {
1561                 mf_navi_bar_set_panes_navi_to_main(ap);
1562         }
1563 #endif
1564
1565         myfileNaviBar *pNavi_s = mf_navi_bar_get_in_use(ap);
1566         mf_retm_if(pNavi_s == NULL, "pNavi_s is NULL");
1567
1568         pNaviBar = ap->mf_MainWindow.pNaviBar;
1569         SAFE_FREE_GSTRING(ap->mf_FileOperation.to_rename);
1570
1571         ap->mf_FileOperation.to_rename = g_string_new((char *)params->m_ItemName->str);
1572
1573         ap->mf_MainWindow.pNaviBox = NULL;
1574         ap->mf_MainWindow.pNaviLayout= NULL;
1575
1576         ap->mf_MainWindow.pNaviBox = mf_widget_create_box(ap->mf_MainWindow.pNaviBar);
1577         newContent = mf_widget_create_layout(ap->mf_MainWindow.pNaviBox, EDJ_NAME, GRP_NEW_FOLDER);
1578         __rename_entryfield_create(newContent, params);
1579         evas_object_size_hint_weight_set(newContent, EVAS_HINT_EXPAND, 0);
1580         evas_object_size_hint_align_set(newContent, EVAS_HINT_FILL, 0.0);
1581         Evas_Object *pad = mf_widget_create_layout(ap->mf_MainWindow.pNaviBox, EDJ_NAME, "PAD");
1582         elm_object_part_content_set(newContent, "content", ap->mf_MainWindow.pEditField);
1583         elm_box_pack_start(ap->mf_MainWindow.pNaviBox, newContent);
1584         elm_box_pack_end(ap->mf_MainWindow.pNaviBox, pad);
1585
1586         title = g_string_new(GET_SYS_STR(LABEL_RENAME));
1587
1588         if (title != NULL) {
1589                 pNavi_s->pNaviTitle = g_strdup(title->str);
1590                 g_string_free(title, TRUE);
1591                 title = NULL;
1592         }
1593         /*navigation view integration*/
1594         ap->mf_Status.pPreNaviItem = ap->mf_MainWindow.pNaviItem;
1595         mf_language_mgr_unregister_object_item_by_type(ITEM_TYPE_CTRL);
1596         ap->mf_MainWindow.pNaviItem = elm_naviframe_item_push(pNaviBar, NULL, NULL, NULL, ap->mf_MainWindow.pNaviBox, NULL);
1597
1598
1599         Evas_Object *l_bt = NULL;
1600         Evas_Object *r_bt = NULL;
1601
1602         l_bt = elm_button_add(ap->mf_MainWindow.pNaviBar);
1603         elm_object_focus_set(l_bt, EINA_FALSE);
1604         elm_object_style_set(l_bt, "naviframe/title/default");
1605         elm_object_text_set(l_bt, GET_SYS_STR(LABEL_SAVE));
1606         mf_language_mgr_register_object(l_bt, OBJ_TYPE_ELM_OBJECT, NULL, LABEL_SAVE);
1607         evas_object_smart_callback_add(l_bt, "clicked", mf_callback_save_cb, ap);
1608         evas_object_show(l_bt);
1609         elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, "title_toolbar_button1", l_bt);
1610
1611         r_bt = elm_button_add(ap->mf_MainWindow.pNaviBar);
1612         elm_object_focus_set(r_bt, EINA_FALSE);
1613         elm_object_style_set(r_bt, "naviframe/end_btn/default");
1614         evas_object_smart_callback_add(r_bt, "clicked", mf_callback_cancel_cb, ap);
1615         evas_object_show(r_bt);
1616         elm_object_item_part_content_set(ap->mf_MainWindow.pNaviItem, "title_prev_btn", r_bt);
1617         elm_object_item_signal_emit(ap->mf_MainWindow.pNaviItem, "elm,state,sip,shown", "");
1618         MF_TRACE_END;
1619 }
1620
1621
1622 myfileNaviBar *mf_navi_bar_get_in_use(void *data)
1623 {
1624
1625         struct appdata *ap = (struct appdata *)data;
1626         mf_retvm_if(ap == NULL, NULL, "ap is NULL");
1627         Eina_List *plistNavi_s = ap->mf_MainWindow.plistNaviBar;
1628         mf_retvm_if(plistNavi_s == NULL, NULL, "plistNavi_s is NULL");
1629
1630         myfileNaviBar *ret = NULL;
1631         Eina_List *l = NULL;
1632         void *item;
1633
1634         EINA_LIST_FOREACH(plistNavi_s, l, item) {
1635                 ret = (myfileNaviBar *) item;
1636
1637                 mf_retvm_if(ret == NULL, NULL, "item is NULL");
1638
1639                 if (ret->naviFlagInUse == TRUE) {
1640                         break;
1641                 } else {
1642                         ret = NULL;
1643                 }
1644         }
1645
1646         return ret;
1647 }
1648
1649 myfileNaviBar *mf_navi_bar_get_edit_start(void *data)
1650 {
1651         struct appdata *ap = (struct appdata *)data;
1652         assert(ap);
1653         Eina_List *plistNavi_s = ap->mf_MainWindow.plistNaviBar;
1654         assert(plistNavi_s);
1655
1656         myfileNaviBar *ret = NULL;
1657         Eina_List *l = NULL;
1658         void *item;
1659
1660         EINA_LIST_FOREACH(plistNavi_s, l, item) {
1661                 ret = (myfileNaviBar *) item;
1662                 if (ret->naviFlagEditStart == TRUE) {
1663                         break;
1664                 } else {
1665                         ret = NULL;
1666                 }
1667         }
1668         return ret;
1669 }
1670
1671 void mf_navi_bar_object_reset(myfileNaviBar *pNavi_s)
1672 {
1673         mf_retm_if(pNavi_s == NULL, "Navi structure is NULL");
1674         pNavi_s->pNaviTitle = NULL;
1675
1676         if (pNavi_s->pCurrentPath != NULL)
1677                 free(pNavi_s->pCurrentPath);
1678         pNavi_s->pCurrentPath = NULL;
1679
1680         if (pNavi_s->pNaviLabel != NULL)
1681                 free(pNavi_s->pNaviLabel);
1682         pNavi_s->pNaviLabel = NULL;
1683 }
1684
1685 /******************************
1686 ** Prototype    : mfNaviBarListItemRemove
1687 ** Description  : remove the navi bar item from the list by label
1688 ** Input        : void *data
1689 **                const char* pNaviLabel
1690 ** Output       : None
1691 ** Return Value :
1692 ** Calls        :
1693 ** Called By    :
1694 **
1695 **  History        :
1696 **  1.Date         : 2010/12/10
1697 **    Author       : Samsung
1698 **    Modification : Created function
1699 **
1700 ******************************/
1701 bool mf_navi_bar_remove_list_item_by_label(void *data, const char *pNaviLabel)
1702 {
1703         struct appdata *ap = (struct appdata *)data;
1704         mf_retvm_if(ap == NULL, false, "ap is NULL");
1705         mf_retvm_if(pNaviLabel == NULL, false, "Navi Bar Label is NULL");
1706
1707         bool bEditStartFlag = FALSE;
1708         bool bInUseFlag = FALSE;
1709         mf_debug();
1710         myfileNaviBar *pNavi_s = mf_navi_bar_get_struct_by_label(ap, pNaviLabel);
1711
1712         if (pNavi_s == NULL) {
1713                 mf_debug();
1714                 return bEditStartFlag;
1715         }
1716         Eina_List *plistNavi = eina_list_data_find_list(ap->mf_MainWindow.plistNaviBar, pNavi_s);
1717         ap->mf_MainWindow.plistNaviBar = eina_list_remove_list(ap->mf_MainWindow.plistNaviBar, plistNavi);
1718
1719         mf_debug();
1720         if (pNavi_s->naviFlagEditStart == TRUE) {
1721                 bEditStartFlag = TRUE;
1722         }
1723         if (pNavi_s->naviFlagInUse == TRUE) {
1724                 bInUseFlag = TRUE;
1725         }
1726         mf_debug();
1727         mf_navi_bar_object_reset(pNavi_s);
1728
1729         if (bInUseFlag == TRUE) {
1730                 pNavi_s = (myfileNaviBar *) eina_list_nth(ap->mf_MainWindow.plistNaviBar, 0);
1731                 pNavi_s->naviFlagInUse = TRUE;
1732         }
1733         mf_debug();
1734         return bEditStartFlag;
1735 }
1736
1737 myfileNaviBar *mf_navi_bar_get_struct_by_label(void *data, const char *pNaviLabel)
1738 {
1739         struct appdata *ap = (struct appdata *)data;
1740         mf_retvm_if(ap == NULL, NULL, "ap is NULL");
1741         mf_retvm_if(pNaviLabel == NULL, NULL, "Navi Bar Label is NULL");
1742
1743         Eina_List *l = NULL;
1744         void *item = NULL;
1745
1746         myfileNaviBar *ret = NULL;
1747         EINA_LIST_FOREACH(ap->mf_MainWindow.plistNaviBar, l, item) {
1748                 if (g_strcmp0(((myfileNaviBar *) item)->pNaviLabel, pNaviLabel) == 0) {
1749                         ret = (myfileNaviBar *) item;
1750                         break;
1751                 }
1752         }
1753         return ret;
1754 }
1755
1756 myfileNaviBar *mf_navi_bar_recover_list(void *data)
1757 {
1758         mf_debug();
1759         struct appdata *ap = (struct appdata *)data;
1760         assert(ap);
1761
1762         /*0     set state to be Default*/
1763         ap->mf_Status.more = MORE_DEFAULT;
1764         /*1     recover all the navigation bar*/
1765         Eina_List *l = NULL;
1766         void *item = NULL;
1767         myfileNaviBar *pNavi_s = NULL;
1768         myfileNaviBar *pNavi_toshow = NULL;
1769         bool flag_pop_todo = FALSE;
1770         EINA_LIST_FOREACH(ap->mf_MainWindow.plistNaviBar, l, item) {
1771                 flag_pop_todo = TRUE;
1772                 pNavi_s = (myfileNaviBar *) item;
1773                 /*2.0   recover the pre_status*/
1774                 pNavi_s->pre_more = ap->mf_Status.more;
1775                 /*2.1   recover the path just before when edit click*/
1776                 pNavi_s->pCurrentPath = g_strdup(pNavi_s->pre_operation.path->str);
1777                 /*2.2   free the backup data structure*/
1778                 g_string_free(pNavi_s->pre_operation.path, TRUE);
1779                 pNavi_s->pre_operation.path = NULL;
1780                 memset(&(pNavi_s->pre_operation), 0, sizeof(oper_record));
1781                 /*2.3   set navi related status*/
1782                 if (pNavi_s->naviFlagInUse == TRUE) {
1783                         /*2.1-1 set pNavi_toshow for refreshing*/
1784                         pNavi_toshow = pNavi_s;
1785                 }
1786         }
1787         return pNavi_toshow;
1788 }
1789
1790 void mf_navi_bar_refresh_recovered_view(void *data, myfileNaviBar * pNaviStruct)
1791 {
1792         MF_TRACE_BEGIN;
1793         struct appdata *ap = (struct appdata *)data;
1794         mf_retm_if(ap == NULL, "ap is NULL");
1795         mf_retm_if(pNaviStruct == NULL, "Navi Bar Struct is NULL");
1796
1797         if (ap->mf_Status.path != NULL) {
1798                 g_string_free(ap->mf_Status.path, TRUE);
1799                 ap->mf_Status.path = NULL;
1800         }
1801         ap->mf_Status.path = g_string_new(pNaviStruct->pCurrentPath);
1802         mf_debug("ap->mf_Status.path is [%s]", ap->mf_Status.path->str);
1803
1804         /*insert new view*/
1805         mf_widget_refresh_view(ap);
1806
1807         MF_TRACE_END;
1808 }
1809
1810 bool mf_navi_bar_is_navi_empty(void *data, char *label)
1811 {
1812         struct appdata *ap = (struct appdata *)data;
1813         assert(ap);
1814         assert(label);
1815
1816
1817         Elm_Object_Item *top_it= elm_naviframe_top_item_get(ap->mf_MainWindow.pNaviBar);
1818         Evas_Object *top_view = elm_object_item_content_get(top_it);
1819
1820         if (top_view == NULL)
1821                 return TRUE;
1822         else
1823                 return FALSE;
1824 }
1825
1826 void mf_navi_bar_transition_finished_cb(void *data, Evas_Object *obj, void *event_info)
1827 {
1828         MF_TRACE_BEGIN;
1829         mf_retm_if(data == NULL, "data is NULL");
1830         mf_retm_if(obj == NULL, "obj is NULL");
1831         struct appdata *ap = (struct appdata *)data;
1832         Elm_Object_Item *it = ap->mf_Status.pPreNaviItem;
1833
1834         SAFE_DEL_NAVI_ITEM(it);
1835         ap->mf_Status.pPreNaviItem = NULL;
1836         mf_widget_set_navi_blocking(ap, EINA_FALSE);
1837         evas_object_smart_callback_del(obj, "transition,finished", mf_navi_bar_transition_finished_cb);
1838         MF_TRACE_END;
1839 }
1840
1841 void mf_navi_bar_remove_previous_contents(void *data, Evas_Object *pNaviBar)
1842 {
1843         MF_TRACE_BEGIN;
1844         mf_retm_if(data == NULL, "data is NULL");
1845         mf_retm_if(pNaviBar == NULL, "pNaviBar is NULL");
1846         struct appdata *ap = (struct appdata *)data;
1847
1848         if (ap->mf_Status.pPreNaviItem != NULL) {
1849                 mf_widget_set_navi_blocking(data, EINA_TRUE);
1850                 evas_object_smart_callback_add(pNaviBar, "transition,finished", mf_navi_bar_transition_finished_cb, data);
1851         }
1852         MF_TRACE_END;
1853 }
1854
1855 void mf_navi_bottom_item_del(Elm_Object_Item **pPreNaviItem)
1856 {
1857         MF_TRACE_BEGIN;
1858         mf_retm_if(*pPreNaviItem == NULL, "pPreNaviItem is NULL");
1859         SAFE_DEL_NAVI_ITEM(*pPreNaviItem);
1860         *pPreNaviItem = NULL;
1861         MF_TRACE_END;
1862 }
1863
1864 myfileNaviBar *mf_navi_bar_get_navi_from_navilist(Eina_List *navilist, const char *label)
1865 {
1866
1867         MF_TRACE_BEGIN;
1868         mf_retvm_if(navilist == NULL, NULL, "navilist is NULL");
1869         mf_retvm_if(label == NULL, NULL, "label is NULL");
1870
1871         void *data = NULL;
1872         myfileNaviBar *pNavi = NULL;
1873         Eina_List *l = NULL;
1874         EINA_LIST_FOREACH(navilist, l, data) {
1875                 if (data) {
1876                         pNavi = (myfileNaviBar *)data;
1877                         if (pNavi && pNavi->pNaviLabel && g_strcmp0(label, pNavi->pNaviLabel) == 0)
1878                                 return pNavi;
1879                         else
1880                                 continue;
1881                 }
1882         }
1883         return NULL;
1884 }
1885
1886
1887 void mf_navi_bar_del_item_directly(void *data)
1888 {
1889         MF_TRACE_BEGIN;
1890         mf_retm_if(data == NULL, "data is NULL");
1891         struct appdata *ap = (struct appdata *)data;
1892
1893         if (ap->mf_Status.flagNaviPush) {
1894                 if(ap->mf_Status.pPreNaviItem)
1895                 {
1896                         SAFE_DEL_NAVI_ITEM(ap->mf_Status.pPreNaviItem);
1897                         mf_widget_set_navi_blocking(ap, EINA_FALSE);
1898                         evas_object_smart_callback_del(ap->mf_MainWindow.pNaviBar, "transition,finished", mf_navi_bar_transition_finished_cb);
1899                }
1900         }
1901 }
1902
1903 void mf_navi_bar_button_set_disable(Elm_Object_Item *navi_it, int disable_item, bool disable)
1904 {
1905         mf_retm_if(navi_it == NULL, "navi_it is NULL");
1906         Evas_Object *btn = NULL;
1907         if (disable_item & CTRL_DISABLE_EDIT) {
1908                 btn = elm_object_item_part_content_get(navi_it, NAVI_BOTTOM_BUTTON_1_PART);
1909                 const char *button_label = elm_object_text_get(btn);
1910                 if (g_strcmp0(button_label, GET_SYS_STR(MF_LABEL_EDIT)) == 0)
1911                         elm_object_disabled_set(btn, disable);
1912
1913         }
1914         if (disable_item & CTRL_DISABLE_DELETE) {
1915                 btn = elm_object_item_part_content_get(navi_it, NAVI_BOTTOM_BUTTON_1_PART);
1916                 const char *button_label = elm_object_text_get(btn);
1917                 if (g_strcmp0(button_label, GET_SYS_STR(LABEL_DELETE)) == 0)
1918                         elm_object_disabled_set(btn, disable);
1919
1920         }
1921         if (disable_item & CTRL_DISABLE_SEND) {
1922                 btn = elm_object_item_part_content_get(navi_it, NAVI_BOTTOM_BUTTON_2_PART);
1923                 const char *button_label = elm_object_text_get(btn);
1924                 if (g_strcmp0(button_label, GET_SYS_STR(LABEL_SHARE)) == 0)
1925                         elm_object_disabled_set(btn, disable);
1926
1927         }
1928         if (disable_item & CTRL_DISABLE_COPY_HERE) {
1929                 btn = elm_object_item_part_content_get(navi_it, NAVI_BOTTOM_BUTTON_1_PART);
1930                 const char *button_label = elm_object_text_get(btn);
1931                 if (g_strcmp0(button_label, GET_STR(LABEL_COPY_HERE)) == 0)
1932                         elm_object_disabled_set(btn, disable);
1933
1934         }
1935         if (disable_item & CTRL_DISABLE_MOVE_HERE) {
1936                 btn = elm_object_item_part_content_get(navi_it, NAVI_BOTTOM_BUTTON_1_PART);
1937                 const char *button_label = elm_object_text_get(btn);
1938                 if (g_strcmp0(button_label, GET_STR(LABEL_MOVE_HERE)) == 0)
1939                         elm_object_disabled_set(btn, disable);
1940
1941         }
1942         if (disable_item & CTRL_DISABLE_CREATE) {
1943                 btn = elm_object_item_part_content_get(navi_it, NAVI_BOTTOM_BUTTON_2_PART);
1944                 const char *button_label = elm_object_text_get(btn);
1945                 if (g_strcmp0(button_label, GET_SYS_STR(MF_LABEL_CREATE_FOLDER)) == 0)
1946                         elm_object_disabled_set(btn, disable);
1947
1948         }
1949         if (disable_item & CTRL_DISABLE_MORE) {
1950                 btn = elm_object_item_part_content_get(navi_it, NAVI_MORE_BUTTON_PART);
1951                 elm_object_disabled_set(btn, disable);
1952         }
1953
1954 }
1955
1956 int mf_navi_bar_button_get_disable(Elm_Object_Item *navi_it)
1957 {
1958         mf_retvm_if(navi_it == NULL, 0, "navi_it is NULL");
1959         int disable_item = 0;
1960         const char *button_label = NULL;
1961
1962         Evas_Object *btn = NULL;
1963         btn = elm_object_item_part_content_get(navi_it, NAVI_BOTTOM_BUTTON_1_PART);
1964         button_label = elm_object_text_get(btn);
1965         if(elm_object_disabled_get(btn)) {
1966                 if (g_strcmp0(button_label, GET_SYS_STR(LABEL_DELETE)) == 0) {
1967                         disable_item |= CTRL_DISABLE_DELETE;
1968                 }
1969         }
1970
1971         btn = elm_object_item_part_content_get(navi_it, NAVI_BOTTOM_BUTTON_2_PART);
1972         button_label = elm_object_text_get(btn);
1973         if(elm_object_disabled_get(btn)) {
1974                 if (g_strcmp0(button_label, GET_SYS_STR(LABEL_SHARE)) == 0) {
1975                         disable_item |= CTRL_DISABLE_SEND;
1976                 }
1977         }
1978
1979         return disable_item;
1980 }
1981
1982 void mf_navi_bar_set_toolbar_visible(Elm_Object_Item *navi_item, bool visible)
1983 {
1984         mf_retm_if(navi_item == NULL, "navi_item is NULL");
1985
1986         mf_debug("visible: %d", visible);
1987         if(visible) {
1988                 elm_object_item_signal_emit(navi_item, "elm,state,toolbar,open", "");
1989         } else {
1990                 elm_object_item_signal_emit(navi_item, "elm,state,toolbar,close", "");
1991         }
1992 }
1993
1994