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