initial upload for tizen 2.0 beta
[apps/home/gallery.git] / ug / ug-gallery-efl / src / ge-ui-util.c
1 /*
2   * Copyright 2012  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://www.tizenopensource.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 #include "ge-ui-util.h"
18 #include "ge-util.h"
19 #include "ge-button.h"
20 #include "ge-gridview.h"
21 #include "ge-albums.h"
22 #include "ge-debug.h"
23 #include "ge-data.h"
24 #include "ge-strings.h"
25
26
27 #define HOME_ALBUM_COVER_NUM 1
28 #define VIDEO_SHARE_NUM 1
29 #define GE_NOBUT_EXIT_POPUP_HIDE_TIME_DELAY 3.0
30 #define GE_SELINFO_HIDE_TIME_DELAY 3.0
31 #define GE_CTRLBAR_STYLE_NAVIFRAME "naviframe"
32 #define GE_BUTTON_STYLE_NAVIBAR_PRE "naviframe/back_btn/default"
33 #define GE_NAVIFRAME_PREB_BTN "prev_btn"
34 #define GE_NAVIFRAME_CONTROLBAR "controlbar"
35 #define GE_TRANS_FINISHED "transition,finished"
36 ///This variable is used only for emulator.
37 static int g_angle = 0;
38
39 static void _ge_ui_response_cb(void *data, Evas_Object *obj, void *event_info)
40 {
41         ge_dbg("event_info: %d", (int)event_info);
42         GE_CHECK(data);
43         ge_ugdata *ugd = (ge_ugdata *)data;
44         ge_dbg("popup mode: %d", ugd->popup_mode);
45
46         if(ugd->popup_mode == GE_Popup_UgExit)
47         {
48                 ug_destroy_me(ugd->ug);
49         }
50
51         evas_object_del(obj);
52         ugd->popup = NULL;
53 }
54
55 static Eina_Bool __ge_popup_timeout_cb(void *data)
56 {
57         GE_CHECK_FALSE(data);
58         ge_ugdata *ugd = (ge_ugdata *)data;
59         if (ugd->del_timer) {
60                 ecore_timer_del(ugd->del_timer);
61                 ugd->del_timer = NULL;
62         }
63
64         if (ugd->popup) {
65                 evas_object_del(ugd->popup);
66                 ugd->popup = NULL;
67         }
68         return ECORE_CALLBACK_CANCEL;
69 }
70
71 static int __ge_popup_add_timer(void *data, double to_inc)
72 {
73         GE_CHECK_VAL(data, -1);
74         ge_ugdata *ugd = (ge_ugdata *)data;
75         if (ugd->del_timer) {
76                 ecore_timer_del(ugd->del_timer);
77                 ugd->del_timer = NULL;
78         }
79
80         ugd->del_timer = ecore_timer_add(to_inc, __ge_popup_timeout_cb, data);
81         return 0;
82 }
83
84 static void __ge_ui_done_cb(void *data, Evas_Object *obj, void *event_info)
85 {
86         ge_dbg("");
87         GE_CHECK(data);
88         ge_ugdata *ugd = (ge_ugdata *)data;
89         int i = 0;
90
91         elm_object_item_disabled_set((Elm_Object_Item *)event_info, EINA_TRUE);
92
93         if(ugd->file_select_mode) //file selection mode
94         {
95                 ge_item* sel_item = NULL;
96                 char* filepath_arg = NULL;
97                 int sel_cnt = _ge_data_selected_list_count();
98
99                 if(sel_cnt == 0)
100                 {
101                         ge_dbg("No thumbs selected, return!");
102                         ge_ui_create_popup(ugd, GE_Popup_NoButton, GE_POPUP_NO_FILES_SELECTED);
103                         return;
104                 }
105
106                 if(ugd->file_select_mode == GE_File_Select_Multiple) {
107                         GString* selected_path = g_string_new(NULL);
108
109                         for(i = 1; i <= sel_cnt; i++ ) {
110                                 _ge_data_get_selected_item_by_index(&sel_item, i);
111                                 if(sel_item && sel_item->item) {
112                                         ge_dbg("Selected [%s]", sel_item->item->file_url);
113                                         g_string_append(selected_path, sel_item->item->file_url);
114                                         g_string_append_c(selected_path, ';');
115                                 }
116                         }
117                         int str_len = strlen(selected_path->str);
118                         ge_dbg("path string length = %d", str_len);
119                         g_string_truncate(selected_path, str_len - 1);
120
121                         filepath_arg = g_string_free(selected_path, false);
122
123                         char t_str[32] = { 0, };
124                         eina_convert_itoa(sel_cnt, t_str);
125
126                         service_add_extra_data(ugd->service,
127                                                GE_FILE_SELECT_RETURN_COUNT,
128                                                t_str);
129                         service_add_extra_data(ugd->service,
130                                                GE_FILE_SELECT_RETURN_PATH,
131                                                filepath_arg);
132                         ug_send_result(ugd->ug, ugd->service);
133
134                         if(filepath_arg) {
135                                 g_free(filepath_arg);
136                                 filepath_arg = NULL;
137                         }
138                 }
139
140                 _ge_data_selected_list_finalize();
141
142                 ug_destroy_me(ugd->ug);
143         }
144 }
145
146 static void _ge_ui_selinfo_destroy_cb(void *data, Evas_Object *obj, void *event_info)
147 {
148         GE_CHECK(data);
149         ge_ugdata *ad = (ge_ugdata *)data;
150
151         ge_ui_destroy_selinfo(ad);
152 }
153
154 static int __ge_ui_disable_done_item(ge_ugdata *ugd, bool disabled)
155 {
156         ge_dbg("Disable Done item(%d)?", disabled);
157         GE_CHECK_VAL(ugd, -1);
158         GE_CHECK_VAL(ugd->thumbs_nf_it, -1);
159
160         Evas_Object *cbar = NULL;
161         cbar = elm_object_item_part_content_get(ugd->thumbs_nf_it, "controlbar");
162         GE_CHECK_VAL(cbar, -1);
163         Elm_Object_Item *cbar_it = NULL;
164         cbar_it = elm_toolbar_first_item_get(cbar);
165         GE_CHECK_VAL(cbar_it, -1);
166         elm_object_item_disabled_set(cbar_it, disabled);
167         return 0;
168 }
169
170 static int __ge_ui_append_object_item(Evas_Object *cbar, Evas_Object *object)
171 {
172         Elm_Object_Item *item = elm_toolbar_item_append(cbar, NULL, NULL, NULL, NULL);
173         if (object)
174                 elm_object_item_part_content_set(item, "object", object);
175         else
176                 elm_object_item_disabled_set(item, EINA_TRUE);
177         return 0;
178 }
179
180 static void __ge_ui_trans_finished_cb(void *data, Evas_Object *obj, void *event_info)
181 {
182         GE_CHECK(data);
183         ge_ugdata *ugd = (ge_ugdata *)data;
184         ge_dbgW("");
185         evas_object_smart_callback_del(obj, GE_TRANS_FINISHED,
186                                        __ge_ui_trans_finished_cb);
187
188         /* Clear previous view after animation finished */
189         elm_gengrid_clear(ugd->albums_view);
190 }
191
192 static void _ge_ui_destroy_me_cb(void *data, Evas_Object *obj, void *event_info)
193 {
194         ge_dbg("");
195         GE_CHECK(data);
196         ge_ugdata *ugd = (ge_ugdata *)data;
197         /* Delete callback when it is clicked to prevent it is called for many times */
198         evas_object_smart_callback_del(obj, "clicked", _ge_ui_destroy_me_cb);
199
200         if (_ge_get_view_mode() != GE_AlbumsView_Mode) {
201                 if(ugd->file_select_mode == GE_File_Select_Multiple) {
202                         ge_ui_destroy_selinfo(ugd);
203                         _ge_data_selected_list_finalize();
204                 }
205                 ge_grid_clear_view(ugd);
206         }
207
208         service_add_extra_data(ugd->service, GE_FILE_SELECT_RETURN_QUIT,
209                                GE_FILE_SELECT_QUIT_STATE);
210         ug_send_result(ugd->ug, ugd->service);
211
212         ug_destroy_me(ugd->ug);
213         ge_dbg("ug_destroy_me");
214 }
215
216 static void _ge_ui_back_to_albums_cb(void *data, Evas_Object *obj, void *event_info)
217 {
218         ge_dbg("");
219         GE_CHECK(data);
220         ge_ugdata *ugd = (ge_ugdata *)data;
221         /* Delete callback when it is clicked to prevent it is called for many times */
222         evas_object_smart_callback_del(obj, "clicked",
223                                        _ge_ui_back_to_albums_cb);
224
225         ge_albums_back_to_view(ugd);
226 }
227
228 int _ge_ui_get_rotate_angle(void)
229 {
230         return g_angle;
231 }
232
233 int ge_ui_create_title_and_push(ge_ugdata *ugd, Evas_Object* parent,
234                                 Evas_Object* obj, NaviTitleMode mode,
235                                 char* title)
236 {
237         ge_dbg("");
238         GE_CHECK_VAL(ugd, -1);
239         GE_CHECK_VAL(parent, -1);
240         GE_CHECK_VAL(obj, -1);
241         GE_CHECK_VAL(title, -1);
242         Elm_Object_Item *nf_it = NULL;
243
244         if (mode == AlbumsView_Title) {
245                 ge_dbg("AlbumsView_Title");
246                 /* Add cancel button */
247                 Evas_Object *cancel_btn = NULL;
248                 cancel_btn = elm_button_add(obj);
249                 GE_CHECK_VAL(cancel_btn, -1);
250                 if(ugd->th)
251                         elm_object_theme_set(cancel_btn, ugd->th);
252                 elm_object_style_set(cancel_btn, GE_BUTTON_STYLE_NAVIBAR_PRE);
253                 evas_object_smart_callback_add(cancel_btn, "clicked",
254                                                _ge_ui_destroy_me_cb, ugd);
255                 nf_it = elm_naviframe_item_push(parent, title, cancel_btn, NULL,
256                                                 obj, NULL);
257         } else if(mode == ThumbnailView_Title) {
258                 if(ugd->file_select_mode == GE_File_Select_None) {
259                         ge_dbgE("file_select_mode == GE_File_Select_None!");
260                         return -1;
261                 }
262
263                 ge_dbg("ThumbnailView_Title");
264                 /* Add transition finished callback */
265                 evas_object_smart_callback_add(parent, GE_TRANS_FINISHED,
266                                                __ge_ui_trans_finished_cb, ugd);
267                 nf_it = elm_naviframe_item_push(parent, title, NULL, NULL, obj,
268                                                 NULL);
269                 /* Set pre_btn style to back button */
270                 Evas_Object *back_btn = NULL;
271                 back_btn = elm_object_item_part_content_get(nf_it,
272                                                             GE_NAVIFRAME_PREB_BTN);
273                 if(ugd->th)
274                         elm_object_theme_set(back_btn, ugd->th);
275                 elm_object_style_set(back_btn, GE_BUTTON_STYLE_NAVIBAR_PRE);
276                 evas_object_smart_callback_add(back_btn, "clicked",
277                                                _ge_ui_back_to_albums_cb, ugd);
278
279                 /**
280                  * Add  'Done' item.
281                  */
282                 if ((ugd->file_select_mode != GE_File_Select_One) &&
283                     (_ge_get_view_mode() == GE_ThumbnailEdit_Mode)) {
284                         ge_dbg("Multiple selection, show Done");
285                         /* create tool controlbar downside */
286                         Evas_Object *bot_bar = NULL;
287                         bot_bar = elm_toolbar_add(obj);
288                         GE_CHECK_VAL(bot_bar, -1);
289                         elm_toolbar_shrink_mode_set(bot_bar, ELM_TOOLBAR_SHRINK_EXPAND);
290                         /* add 'Done' item */
291                         Elm_Object_Item *done_it = NULL;
292                         done_it = elm_toolbar_item_append(bot_bar,
293                                                           GE_CBAR_ICON_DONE,
294                                                           NULL,
295                                                           __ge_ui_done_cb,
296                                                           ugd);
297                         elm_object_item_disabled_set(done_it, EINA_TRUE);
298                         /* add empty item */
299                         __ge_ui_append_object_item(bot_bar, NULL);
300                         __ge_ui_append_object_item(bot_bar, NULL);
301                         __ge_ui_append_object_item(bot_bar, NULL);
302                         /* Set tool bar to bottom */
303                         elm_object_item_part_content_set(nf_it, GE_NAVIFRAME_CONTROLBAR,
304                                                          bot_bar);
305                 }
306                 ugd->thumbs_nf_it = nf_it;
307         }
308
309         return 0;
310 }
311
312 Evas_Object* ge_ui_load_edj(Evas_Object *parent, const char *file, const char *group)
313 {
314         GE_CHECK_NULL(parent);
315         GE_CHECK_NULL(file);
316         GE_CHECK_NULL(group);
317         Evas_Object *eo;
318         int r;
319
320         eo = elm_layout_add(parent);
321         if (eo)
322         {
323                 r = elm_layout_file_set(eo, file, group);
324                 if (!r)
325                 {
326                         evas_object_del(eo);
327                         return NULL;
328                 }
329
330                 evas_object_size_hint_weight_set(eo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
331                 evas_object_size_hint_align_set(eo, EVAS_HINT_FILL, EVAS_HINT_FILL);
332         }
333
334         return eo;
335 }
336
337 void ge_ui_set_rotate_angle(int rotate_mode)
338 {
339         g_angle = rotate_mode;
340 }
341
342 Evas_Object* ge_ui_create_nocontents(ge_ugdata* ugd)
343 {
344         GE_CHECK_NULL(ugd);
345         Evas_Object *layout = NULL;
346         char label_str[GE_NOCONTENTS_LABEL_LEN_MAX] ={0,};
347
348         if(_ge_get_view_mode() == GE_ThumbnailView_Mode ||
349            _ge_get_view_mode() == GE_ThumbnailEdit_Mode) {
350                 if(ugd->file_type_mode) {
351                         if (ugd->file_type_mode == GE_File_Select_Type_Image)
352                                 snprintf(label_str, sizeof(label_str),
353                                          "%s",
354                                          (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_IMAGES")));
355                         else if (ugd->file_type_mode == GE_File_Select_Type_Video)
356                                 snprintf(label_str, sizeof(label_str),
357                                          "%s",
358                                          (char*)GE_LABEL_NO_VIDEOS);
359                         else
360                                 snprintf(label_str, sizeof(label_str),
361                                          "%s",
362                                          (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_ITEMS")));
363                 } else {
364                         snprintf(label_str, sizeof(label_str), "%s",
365                                  (char*)(_GE_GETSYSTEMSTR("IDS_COM_BODY_NO_ITEMS")));
366                 }
367         } else if(_ge_get_view_mode() == GE_AlbumsView_Mode) {
368                 snprintf(label_str, sizeof(label_str), "%s",
369                          (char*)GE_LABEL_NO_ALBUMS);
370         } else {
371                 ge_dbgE("view mode is error.");
372         }
373
374         ge_dbg("\nNocontents label: %s", label_str);
375         /* Full nocontents view layout */
376         layout = elm_layout_add(ugd->navi_bar);
377         GE_CHECK_NULL(layout);
378         elm_object_part_text_set(layout, "elm.text", label_str);
379         elm_layout_theme_set(layout, "layout", "nocontents", "gallery_efl");
380
381         return layout;
382 }
383
384 Evas_Object* ge_ui_create_main_ly(ge_ugdata* ugd, Evas_Object* parent)
385 {
386         GE_CHECK_NULL(ugd);
387         GE_CHECK_NULL(parent);
388         Evas_Object *layout = NULL;
389
390         layout = elm_layout_add(parent);
391         GE_CHECK_NULL(layout);
392
393         /* Apply the layout style */
394         const char *profile = elm_config_profile_get();
395         if (!g_strcmp0(profile, "mobile"))      {
396                 elm_layout_theme_set(layout, "layout", "application", "default");
397         } else if (!g_strcmp0(profile,"extension")) {
398                 elm_layout_theme_set(layout, "layout", "application", "noindicator");
399         }
400
401         evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND,
402                                          EVAS_HINT_EXPAND);
403         elm_win_resize_object_add(parent, layout);
404         evas_object_show(layout);
405
406         return layout;
407 }
408
409 Evas_Object* ge_ui_create_navibar(ge_ugdata* ugd, Evas_Object* parent)
410 {
411         GE_CHECK_NULL(ugd);
412         GE_CHECK_NULL(parent);
413         Evas_Object *navi_bar = NULL;
414
415         navi_bar = elm_naviframe_add(parent);
416         GE_CHECK_NULL(navi_bar);
417
418         if(ugd->th)
419         {
420                 elm_object_theme_set(navi_bar, ugd->th);
421         }
422         elm_object_part_content_set(parent, "elm.swallow.content", navi_bar);
423
424         evas_object_show(navi_bar);
425
426         return navi_bar;
427 }
428
429 Evas_Object *ge_ui_create_popup(ge_ugdata* ugd, GE_PopupMode mode, char* desc)
430 {
431         ge_dbg("");
432         GE_CHECK_NULL(ugd);
433         GE_CHECK_NULL(desc);
434
435         if(ugd->popup)
436         {
437                 ge_dbg("The existed popup is deleted");
438                 evas_object_del(ugd->popup);
439                 ugd->popup = NULL;
440         }
441
442         Evas_Object *popup = NULL;
443
444         popup = elm_popup_add(ugd->ly_main);
445         GE_CHECK_NULL(popup);
446         evas_object_size_hint_weight_set(popup, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
447         elm_object_text_set(popup, desc);
448
449         switch (mode) {
450         case GE_Popup_NoButton:
451         case GE_Popup_UgExit:
452                 __ge_popup_add_timer(ugd, GE_NOBUT_EXIT_POPUP_HIDE_TIME_DELAY);
453                 break;
454         case GE_Popup_OneButton:
455         {
456                 Evas_Object *btn = NULL;
457                 btn = _ge_but_create_but(popup, GE_BUT_OK, _ge_ui_response_cb,
458                                          ugd);
459                 elm_object_part_content_set(popup, "button1", btn);
460                 break;
461         }
462         case GE_Popup_TwoButton:
463         {
464                 Evas_Object *btn1 = NULL;
465                 btn1 = _ge_but_create_but(popup, GE_BUT_OK, _ge_ui_response_cb,
466                                           ugd);
467                 elm_object_part_content_set(popup, "button1", btn1);
468                 Evas_Object *btn2 = NULL;
469                 btn2 = _ge_but_create_but(popup, GE_BUT_CANCEL,
470                                            _ge_ui_response_cb, ugd);
471                 elm_object_part_content_set(popup, "button2", btn2);
472                 break;
473         }
474         default:
475                 ge_dbgE("mode is not supported...");
476                 break;
477         }
478
479         evas_object_show(popup);
480
481         ugd->popup = popup;
482         ugd->popup_mode = mode;
483
484         return popup;
485 }
486
487 int ge_ui_rotate_selinfo(ge_ugdata* ugd)
488 {
489         GE_CHECK_VAL(ugd, -1);
490         if (ugd->selectioninfo && ugd->selectioninfo_ly)
491         {
492                 ge_dbg("selectioninfo rotation.");
493                 int rotate_angle  = _ge_ui_get_rotate_angle();
494                 if ((rotate_angle == GE_ROTATE_LANDSCAPE) ||
495                         (rotate_angle == GE_ROTATE_LANDSCAPE_UPSIDEDOWN))
496                 {
497                         edje_object_signal_emit(_EDJ(ugd->selectioninfo_ly), "elm,selectioninfo,ug_landscape", "elm");
498                 }
499                 else
500                 {
501                         edje_object_signal_emit(_EDJ(ugd->selectioninfo_ly), "elm,selectioninfo,ug_portrait", "elm");
502                 }
503         }
504
505         return 0;
506 }
507
508 int ge_ui_create_selinfo(ge_ugdata* ugd, Evas_Object* parent)
509 {
510         ge_dbg("");
511         GE_CHECK_VAL(ugd, -1);
512         GE_CHECK_VAL(parent, -1);
513         int count = 1;
514         int all_count = 0;
515         char text[GE_SELINFO_TEXT_LEN_MAX] = {0,};
516
517         count = _ge_data_selected_list_count();
518         if(count <= 0)
519         {
520                 __ge_ui_disable_done_item(ugd, true);
521                 if(ugd->file_select_mode == GE_File_Select_Multiple)
522                 {
523                         ge_ui_destroy_selinfo(ugd);
524                 }
525                 ge_dbg("@@@[Warning] no item selected@@@");
526                 return -1;
527         }
528
529         __ge_ui_disable_done_item(ugd, false);
530
531         if(ugd->file_select_mode == GE_File_Select_One)
532         {
533                 return -1;
534         }
535
536         all_count = _ge_data_get_count_all();
537         ge_dbg("New count , all count : %d,%d", count, all_count);
538
539         ge_ui_destroy_selinfo(ugd);
540         ugd->selectioninfo = elm_notify_add(parent);
541         GE_CHECK_VAL(ugd->selectioninfo, -1);
542         elm_notify_orient_set(ugd->selectioninfo, ELM_NOTIFY_ORIENT_BOTTOM);
543         evas_object_size_hint_weight_set(ugd->selectioninfo, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
544         evas_object_size_hint_align_set(ugd->selectioninfo, EVAS_HINT_FILL, EVAS_HINT_FILL);
545
546         evas_object_smart_callback_add(ugd->selectioninfo, "timeout", _ge_ui_selinfo_destroy_cb, ugd);
547         elm_notify_timeout_set(ugd->selectioninfo, GE_SELINFO_HIDE_TIME_DELAY);
548
549         ugd->selectioninfo_ly = elm_layout_add(parent);
550         GE_CHECK_VAL(ugd->selectioninfo_ly, -1);
551         if(ugd->th)
552         {
553                 elm_object_theme_set(ugd->selectioninfo_ly, ugd->th);
554         }
555         elm_layout_theme_set(ugd->selectioninfo_ly, "standard", "selectioninfo", "ug_selectioninfo_viewer");
556
557         int rotate_angle  = _ge_ui_get_rotate_angle();
558         if ((rotate_angle == GE_ROTATE_LANDSCAPE) ||
559                 (rotate_angle == GE_ROTATE_LANDSCAPE_UPSIDEDOWN))
560         {
561                 edje_object_signal_emit(_EDJ(ugd->selectioninfo_ly), "elm,selectioninfo,ug_landscape", "elm");
562         }
563
564         evas_object_size_hint_weight_set(ugd->selectioninfo_ly, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
565         evas_object_size_hint_align_set(ugd->selectioninfo_ly, EVAS_HINT_FILL, EVAS_HINT_FILL);
566         elm_object_content_set(ugd->selectioninfo,ugd->selectioninfo_ly);
567
568         /* Add Space to fix H0100131538  */
569         snprintf(text, sizeof(text), "%s (%d)", GE_SELINFO_SELECTED, count);
570         text[strlen(text)] = '\0';
571
572         edje_object_signal_emit(_EDJ(ugd->thumbs_view_ly), "elm,thumb_view,state,moveup", "elm");/* move view up while selection view shown.*/
573         edje_object_part_text_set(_EDJ(ugd->selectioninfo_ly), "elm.text", text);
574         evas_object_show(ugd->selectioninfo);
575
576         return 0;
577 }
578
579 int ge_ui_destroy_selinfo(ge_ugdata* ugd)
580 {
581         ge_dbg("");
582         GE_CHECK_VAL(ugd, -1);
583         GE_CHECK_VAL(ugd->thumbs_view_ly, -1);
584
585         edje_object_signal_emit(_EDJ(ugd->thumbs_view_ly), "elm,thumb_view,state,default", "elm");/* reset view to default status.*/
586         if(ugd->file_select_mode != GE_File_Select_One && ugd->selectioninfo)
587         {
588                 evas_object_smart_callback_del(ugd->selectioninfo, "timeout", _ge_ui_selinfo_destroy_cb);
589         }
590
591         if(ugd->selectioninfo_ly)
592         {
593                 evas_object_del(ugd->selectioninfo_ly);
594                 ugd->selectioninfo_ly = NULL;
595         }
596
597         if(ugd->selectioninfo)
598         {
599                 evas_object_del(ugd->selectioninfo);
600                 ugd->selectioninfo = NULL;
601         }
602
603         return 0;
604 }
605