[elm_softkey.c] Added code to make sure that the signal for clicked is called only...
[framework/uifw/elementary.git] / src / lib / elm_softkey.c
1 #include <Elementary.h>
2 #include "elm_priv.h"
3
4 /**
5  * @defgroup Softkey Softkey
6  * @ingroup Elementary
7  *
8  * This is a softkey
9  */
10
11 /**
12  * internal data structure of softkey object
13  */
14 #define BTN_ANIMATOR_MAX        4
15 #define PANEL_ANIMATOR_MAX      1
16 typedef struct _Widget_Data Widget_Data;
17
18 struct _Widget_Data
19 {
20    Evas_Object *lay;
21    Evas_Object *button[2];
22    Evas_Object *bg_rect;
23    Evas_Object *panel;
24    Evas_Object *glow_obj;
25
26    Evas_Coord x, y, w, h;
27    Evas_Coord glow_w, glow_h;
28    Evas_Coord win_h;
29    Evas_Coord panel_height;
30    Ecore_Animator *animator;
31    Eina_List *items;
32    unsigned int panel_btn_idx;
33    Eina_Bool button_show[2];
34    Eina_Bool show_panel :1;
35    Eina_Bool animating :1;
36    Eina_Bool is_horizontal;
37    double scale_factor;
38    int max_button;
39    Eina_Bool panel_suppported;
40 };
41
42 struct _Elm_Softkey_Item
43 {
44    Evas_Object *obj;
45    Evas_Object *base;
46    Evas_Object *icon;
47    const char *label;
48    void
49    (*func)(void *data, Evas_Object *obj, void *event_info);
50    const void *data;
51    Eina_Bool disabled :1;
52 };
53
54 static void
55 _item_disable(Elm_Softkey_Item *it, Eina_Bool disabled);
56 static void
57 _del_hook(Evas_Object *obj);
58 static void
59 _theme_hook(Evas_Object *obj);
60 static void
61 _sizing_eval(Evas_Object *obj);
62 static void
63 _sub_del(void *data, Evas_Object *obj, void *event_info);
64
65 /*
66  * callback functions
67  */
68 static void
69 _softkey_down_cb(void *data, Evas_Object *obj, const char *emission,
70                  const char *source);
71 static void
72 _softkey_up_cb(void *data, Evas_Object *obj, const char *emission,
73                const char *source);
74
75 static void
76 _panel_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
77 static void
78 _panel_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
79
80 static void
81 _more_btn_click_cb(void *data, Evas_Object *obj, const char *emission,
82                    const char *source);
83 static void
84 _close_btn_click_cb(void *data, Evas_Object *obj, const char *emission,
85                     const char *source);
86 static void
87 _bg_click_cb(void *data, Evas *e, Evas_Object *obj, void *event_info);
88
89 static int
90 _show_button_animator_cb(void *data);
91 static int
92 _hide_button_animator_cb(void *data);
93 static int
94 _panel_up_animator_cb(void *data);
95 static int
96 _panel_down_animator_cb(void *data);
97
98 /*
99  * internal function
100  */
101 static int
102 _show_button(Evas_Object *obj, Elm_Softkey_Type type, Eina_Bool show);
103 static int
104 _delete_button(Evas_Object *obj);
105
106 static void
107 _softkey_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
108 static void
109 _softkey_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info);
110 static void
111 _softkey_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info);
112 static void
113 _softkey_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info);
114 static void
115 _softkey_horizontal_set(Evas_Object *obj, Eina_Bool horizontal_mode);
116 static void
117 _icon_disable(Evas_Object *icon, Eina_Bool disabled)
118 {
119    Evas_Object *edj;
120
121    if (!icon) return;
122    edj = elm_layout_edje_get(icon);
123
124    if (disabled)
125    {
126       if (!edj)
127       {
128          edje_object_signal_emit(icon, "elm,state,disabled", "elm");
129       }
130       else
131       {
132          edje_object_signal_emit(edj, "elm,state,disabled", "elm");
133       }
134    }
135    else
136    {
137       if (!edj)
138       {
139          edje_object_signal_emit(icon, "elm,state,enabled", "elm");
140       }
141       else
142       {
143          edje_object_signal_emit(edj, "elm,state,enabled", "elm");
144       }
145    }
146 }
147
148 static void
149 _item_disable(Elm_Softkey_Item *it, Eina_Bool disabled)
150 {
151    Widget_Data *wd = elm_widget_data_get(it->obj);
152    if (!wd) return;
153    if (it->disabled == disabled) return;
154    it->disabled = disabled;
155    if (it->disabled)
156    {
157       edje_object_signal_emit(it->base, "elm,state,disabled", "elm");
158    }
159    else
160    {
161       edje_object_signal_emit(it->base, "elm,state,enabled", "elm");
162    }
163
164    _icon_disable(it->icon, disabled);
165 }
166
167 static void
168 _del_hook(Evas_Object *obj)
169 {
170    int i;
171    Evas_Object *btn;
172    Widget_Data *wd = elm_widget_data_get(obj);
173
174    if (!wd) return;
175    evas_object_event_callback_del(obj, EVAS_CALLBACK_RESIZE,
176                                   _softkey_object_resize);
177    evas_object_event_callback_del(obj, EVAS_CALLBACK_MOVE, _softkey_object_move);
178    evas_object_event_callback_del(obj, EVAS_CALLBACK_SHOW, _softkey_object_show);
179    evas_object_event_callback_del(obj, EVAS_CALLBACK_HIDE, _softkey_object_hide);
180
181    /* delete button */
182    for (i = 0; i < 2; i++)
183    {
184       btn = wd->button[i];
185       if (btn != NULL)
186       {
187          //_delete_button(btn);
188          evas_object_del(wd->button[i]);
189          wd->button[i] = NULL;
190       }
191    }
192
193    //evas_object_smart_callback_del(obj, "sub-object-del", _sub_del);
194
195
196    /* delete panel */
197    if (wd->panel)
198    {
199       elm_softkey_panel_del(obj);
200    }
201
202    /* delete glow effect image */
203    if (wd->glow_obj)
204    {
205       evas_object_del(wd->glow_obj);
206       wd->glow_obj = NULL;
207    }
208    if (wd->lay)
209    {
210       evas_object_del(wd->lay);
211       wd->lay = NULL;
212    }
213
214    free(wd);
215 }
216
217 static void
218 _theme_hook(Evas_Object *obj)
219 {
220    Elm_Softkey_Item* item;
221    Widget_Data *wd = elm_widget_data_get(obj);
222    Elm_Softkey_Item *it;
223    const Eina_List *l;
224
225    if (!wd)
226    {
227       return;
228    }
229    _elm_theme_object_set(obj, wd->lay, "softkey", "bg",
230                          elm_widget_style_get(obj));
231    _elm_theme_object_set(obj, wd->glow_obj, "softkey", "glow", "default");
232
233    if (wd->button[ELM_SK_LEFT_BTN])
234    {
235
236       item = evas_object_data_get(wd->button[ELM_SK_LEFT_BTN], "item_data");
237       _elm_theme_object_set(obj, wd->button[ELM_SK_LEFT_BTN], "softkey",
238                             "button_left", elm_widget_style_get(obj));
239
240       elm_softkey_item_label_set(item, item->label);
241
242    }
243
244    if (wd->button[ELM_SK_RIGHT_BTN])
245    {
246
247       item = evas_object_data_get(wd->button[ELM_SK_RIGHT_BTN], "item_data");
248
249       _elm_theme_object_set(obj, wd->button[ELM_SK_RIGHT_BTN], "softkey",
250                             "button_right", elm_widget_style_get(obj));
251
252       elm_softkey_item_label_set(item, item->label);
253
254    }
255
256    if (wd->panel)
257    {
258       _elm_theme_object_set(obj, wd->panel, "softkey", "panel",
259                             elm_widget_style_get(obj));
260       if (wd->panel_btn_idx > 0)
261       {
262          //show more button
263          edje_object_signal_emit(wd->lay, "more_btn_show", "");
264          EINA_LIST_FOREACH (wd->items, l, it)
265          {
266             _elm_theme_object_set(obj, it->base, "softkey", "panel_button",
267                                   elm_widget_style_get(obj));
268             if (it->label)
269             {
270                edje_object_part_text_set(it->base, "elm.text", it->label); // set text
271             }
272          }
273       }
274    }
275
276    _sizing_eval(obj);
277 }
278
279 static void
280 _sub_del(void *data, Evas_Object *obj, void *event_info)
281 {
282    Widget_Data *wd = elm_widget_data_get(obj);
283    Evas_Object *sub = event_info;
284    const Eina_List *l;
285    Elm_Softkey_Item *it;
286    if (!wd) return;
287
288    EINA_LIST_FOREACH(wd->items, l, it)
289    {
290       if (sub == it->icon)
291       {
292          it->icon = NULL;
293       }
294       break;
295    }
296 }
297
298 static void
299 _sizing_eval(Evas_Object *obj)
300 {
301    Widget_Data *wd = elm_widget_data_get(obj);
302
303    if (!wd) return;
304
305    _softkey_object_move(obj, NULL, obj, NULL);
306    _softkey_object_resize(obj, NULL, obj, NULL);
307 }
308
309 static int
310 _panel_up_animator_cb(void *data)
311 {
312    int max = PANEL_ANIMATOR_MAX;
313    static int progress = 0;
314    Widget_Data *wd;
315    Evas_Coord ypos;
316
317    wd = elm_widget_data_get(data);
318    if (!wd) return 0;
319
320    progress++;
321    wd->animating = EINA_TRUE;
322
323    if (progress > max)
324    {
325       if (!wd->animator) return 0;
326       ecore_animator_del(wd->animator);
327       wd->animator = NULL;
328       wd->animating = EINA_FALSE;
329       wd->show_panel = EINA_TRUE;
330       progress = 0;
331       return 0;
332    }
333
334    /* move up panel */
335    if (wd->panel)
336    {
337       ypos = wd->win_h - (wd->panel_height * progress / max);
338       evas_object_move(wd->panel, wd->x, ypos);
339    }
340
341    return 1;
342 }
343
344 static int
345 _panel_down_animator_cb(void *data)
346 {
347    int max = PANEL_ANIMATOR_MAX;
348    static int progress = 0;
349    Widget_Data *wd;
350    Evas_Coord ypos;
351
352    wd = elm_widget_data_get(data);
353    if (!wd) return 0;
354
355    progress++;
356    wd->animating = EINA_TRUE;
357
358    if (progress > max)
359    {
360       if (!wd->animator) return 0;
361       ecore_animator_del(wd->animator);
362       wd->animator = NULL;
363       wd->animating = EINA_FALSE;
364       //wd->animator = ecore_animator_add(_show_button_animator_cb, data);
365       wd->show_panel = EINA_FALSE;
366       progress = 0;
367
368       evas_object_smart_callback_call(data, "panel,hide", NULL);
369
370       return 0;
371    }
372
373    /* move down panel */
374    if (wd->panel)
375    {
376       ypos = wd->win_h - wd->panel_height + (wd->panel_height * progress / max);
377       evas_object_move(wd->panel, wd->x, ypos);
378    }
379
380    return 1;
381 }
382
383 static int
384 _hide_button_animator_cb(void *data)
385 {
386    int max = BTN_ANIMATOR_MAX;
387    static int progress = 0;
388    Widget_Data *wd;
389    Evas_Coord btn_w, xpos;
390
391    wd = elm_widget_data_get(data);
392    if (!wd) return 0;
393
394    progress++;
395    wd->animating = EINA_TRUE;
396
397    if (progress > max)
398    {
399       if (!wd->animator) return 0;
400       ecore_animator_del(wd->animator);
401       wd->animating = EINA_FALSE;
402       wd->animator = ecore_animator_add(_panel_up_animator_cb, data);
403       progress = 0;
404       return 0;
405    }
406
407    /* move left button */
408    if (wd->button[ELM_SK_LEFT_BTN])
409    {
410       edje_object_part_geometry_get(wd->button[ELM_SK_LEFT_BTN], "button_rect",
411                                     NULL, NULL, &btn_w, NULL);
412       //evas_object_geometry_get(wd->button[ELM_SK_LEFT_BTN], NULL, NULL, &btn_w, NULL);
413       xpos = wd->x + -1 * btn_w * progress / max;
414       evas_object_move(wd->button[ELM_SK_LEFT_BTN], xpos, wd->y);
415    }
416
417    /* move right button */
418    if (wd->button[ELM_SK_RIGHT_BTN])
419    {
420       edje_object_part_geometry_get(wd->button[ELM_SK_RIGHT_BTN],
421                                     "button_rect", NULL, NULL, &btn_w, NULL);
422       //evas_object_geometry_get(wd->button[ELM_SK_RIGHT_BTN], NULL, NULL, &btn_w, NULL);
423       xpos = (wd->x + wd->w - btn_w) + (btn_w * progress / max);
424       evas_object_move(wd->button[ELM_SK_RIGHT_BTN], xpos, wd->y);
425    }
426
427    return 1;
428 }
429
430 static int
431 _show_button_animator_cb(void *data)
432 {
433    int max = BTN_ANIMATOR_MAX;
434    static int progress = 0;
435    Widget_Data *wd;
436    Evas_Coord btn_w, xpos;
437
438    wd = elm_widget_data_get(data);
439    if (!wd) return 0;
440
441    progress++;
442
443    wd->animating = EINA_TRUE;
444
445    if (progress > max)
446    {
447       if (!wd->animator) return 0;
448       ecore_animator_del(wd->animator);
449       wd->animating = EINA_FALSE;
450       progress = 0;
451       return 0;
452    }
453
454    /* move left button */
455    if (wd->button[ELM_SK_LEFT_BTN])
456    {
457       edje_object_part_geometry_get(wd->button[ELM_SK_LEFT_BTN], "button_rect",
458                                     NULL, NULL, &btn_w, NULL);
459       //evas_object_geometry_get(wd->button[ELM_SK_LEFT_BTN], NULL, NULL, &btn_w, NULL);
460       xpos = wd->x + (-1 * btn_w) + (btn_w * progress / max);
461       evas_object_move(wd->button[ELM_SK_LEFT_BTN], xpos, wd->y);
462    }
463
464    /* move right button */
465    if (wd->button[ELM_SK_RIGHT_BTN])
466    {
467       edje_object_part_geometry_get(wd->button[ELM_SK_RIGHT_BTN],
468                                     "button_rect", NULL, NULL, &btn_w, NULL);
469       //evas_object_geometry_get(wd->button[ELM_SK_RIGHT_BTN], NULL, NULL, &btn_w, NULL);
470       xpos = wd->x + wd->w - (btn_w * progress / max);
471       evas_object_move(wd->button[ELM_SK_RIGHT_BTN], xpos, wd->y);
472    }
473
474    return 1;
475 }
476
477 static void
478 _more_btn_click_cb(void *data, Evas_Object *obj, const char *emission,
479                    const char *source)
480 {
481    Widget_Data *wd;
482    wd = elm_widget_data_get(data);
483    if (!wd) return;
484
485    evas_object_smart_callback_call(data, "panel,show", NULL);
486
487    if (!wd->panel) return;
488    evas_object_show(wd->panel);
489
490    if (wd->bg_rect)
491    {
492       evas_object_show(wd->bg_rect);
493    }
494
495    /*if (wd->animating == EINA_FALSE) {
496     wd->animator = ecore_animator_add(_hide_button_animator_cb, data);
497     }*/
498    if (wd->animating == EINA_FALSE)
499    {
500       wd->animator = ecore_animator_add(_panel_up_animator_cb, data);
501    }
502 }
503
504 static void
505 _close_panel(Evas_Object *obj)
506 {
507    Widget_Data *wd;
508    wd = elm_widget_data_get(obj);
509    if (!wd) return;
510
511    if (wd->bg_rect)
512    {
513       evas_object_hide(wd->bg_rect);
514    }
515
516    if (!wd->panel) return;
517
518    if (wd->animating == EINA_FALSE)
519    {
520       wd->animator = ecore_animator_add(_panel_down_animator_cb, obj);
521    }
522 }
523
524 static void
525 _bg_click_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
526 {
527    _close_panel(data);
528 }
529
530 static void
531 _close_btn_click_cb(void *data, Evas_Object *obj, const char *emission,
532                     const char *source)
533 {
534    _close_panel(data);
535 }
536
537 static int
538 _show_button(Evas_Object *obj, Elm_Softkey_Type type, Eina_Bool show)
539 {
540    if (!obj) return -1;
541
542    Widget_Data *wd = elm_widget_data_get(obj);
543    Evas_Object *btn = wd->button[type];
544    if (!btn) return -1;
545
546    /* Make visible button */
547    if (show)
548    {
549       wd->button_show[type] = EINA_TRUE;
550       evas_object_show(btn);
551    }
552    else
553    {
554       wd->button_show[type] = EINA_FALSE;
555       evas_object_hide(btn);
556    }
557
558    return 0;
559 }
560
561 static int
562 _arrange_button(Evas_Object *obj, Elm_Softkey_Type type)
563 {
564    Widget_Data *wd;
565    Evas_Coord btn_w = 0;
566    Evas_Object *btn;
567
568    if (!obj) return -1;
569    wd = elm_widget_data_get(obj);
570    if (!wd) return -1;
571
572    btn = wd->button[type];
573    if (!btn) return -1;
574
575    switch (type)
576    {
577    case ELM_SK_LEFT_BTN:
578       evas_object_move(btn, wd->x, wd->y);
579       break;
580    case ELM_SK_RIGHT_BTN:
581       edje_object_part_geometry_get(btn, "button_rect", NULL, NULL, &btn_w,
582                                     NULL);
583       //evas_object_geometry_get(btn, NULL, NULL, &btn_w, NULL);
584       evas_object_move(btn, wd->x + wd->w - btn_w, wd->y);
585       break;
586    default:
587       break;
588    }
589
590    return 0;
591 }
592
593 static void
594 _softkey_up_cb(void *data, Evas_Object *obj, const char *emission,
595                const char *source)
596 {
597    Evas_Object *edj;
598
599    Elm_Softkey_Item *it = (Elm_Softkey_Item *) data;
600    elm_softkey_panel_close(it->obj);
601    if (it->icon)
602    {
603       edj = elm_layout_edje_get(it->icon);
604       if (!edj) return;
605       edje_object_signal_emit(edj, "elm,state,unselected", "elm");
606    }
607    if (it->func)
608       it->func((void *) (it->data), it->obj, it);
609    else
610       evas_object_smart_callback_call(it->obj, "clicked", it);
611 }
612
613 static void
614 _softkey_down_cb(void *data, Evas_Object *obj, const char *emission,
615                  const char *source)
616 {
617    Evas_Object *edj;
618
619    Elm_Softkey_Item *it = (Elm_Softkey_Item *) data;
620    evas_object_smart_callback_call(it->obj, "press", it);
621
622    if (!it->icon) return;
623    edj = elm_layout_edje_get(it->icon);
624    if (!edj) return;
625
626    edje_object_signal_emit(edj, "elm,state,selected", "elm");
627 }
628
629 static void
630 _panel_up_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
631 {
632    Elm_Softkey_Item *it = (Elm_Softkey_Item *) data;
633
634    Widget_Data *wd;
635    wd = elm_widget_data_get(it->obj);
636    if (wd == NULL) return;
637
638    /* hide glow effect */
639    if (wd->glow_obj)
640    {
641       evas_object_hide(wd->glow_obj);
642    }
643
644    elm_softkey_panel_close(it->obj);
645    if (it->func)
646       it->func((void *) (it->data), it->obj, it);
647    else
648       evas_object_smart_callback_call(it->obj, "clicked", it);
649 }
650
651 static void
652 _panel_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
653 {
654    Evas_Coord glow_x, glow_y;
655    Widget_Data *wd;
656
657    Elm_Softkey_Item *it = (Elm_Softkey_Item *) data;
658    wd = elm_widget_data_get(it->obj);
659    if (wd == NULL) return;
660
661    /* show glow effect */
662    if (wd->glow_obj)
663    {
664       Evas_Event_Mouse_Down *ev = (Evas_Event_Mouse_Down *) event_info;
665       glow_x = ev->canvas.x - (wd->glow_w / 2);
666       glow_y = ev->canvas.y - (wd->glow_h / 2);
667
668       evas_object_move(wd->glow_obj, glow_x, glow_y);
669       evas_object_show(wd->glow_obj);
670    }
671
672    evas_object_smart_callback_call(it->obj, "press", it);
673 }
674
675 static int
676 _delete_button(Evas_Object *obj)
677 {
678    if (!obj) return -1;
679
680    if (obj)
681    {
682       evas_object_del(obj);
683       obj = NULL;
684    }
685
686    return 0;
687 }
688
689 static void
690 _calc_win_height(Widget_Data *wd)
691 {
692    wd->win_h = wd->y + wd->h;
693
694    if (wd->bg_rect)
695    {
696       evas_object_resize(wd->bg_rect, wd->w, wd->win_h);
697       evas_object_move(wd->bg_rect, wd->x, 0);
698    }
699
700    if (wd->panel)
701    {
702       if (wd->show_panel)
703       {
704          evas_object_move(wd->panel, wd->x, (wd->win_h - wd->panel_height));
705       }
706       else
707       {
708          evas_object_move(wd->panel, wd->x, wd->win_h);
709       }
710    }
711 }
712
713 static void
714 _softkey_object_move(void *data, Evas *e, Evas_Object *obj, void *event_info)
715 {
716    Widget_Data *wd;
717    int i;
718    Evas_Coord x, y;
719
720    if (!data) return;
721    wd = elm_widget_data_get((Evas_Object *) data);
722    if (!wd) return;
723
724    evas_object_geometry_get(wd->lay, &x, &y, NULL, NULL);
725
726    wd->x = x;
727    wd->y = y;
728
729    evas_object_move(wd->lay, x, y);
730
731    for (i = 0; i < 2; i++)
732    {
733       _arrange_button((Evas_Object *) data, i);
734    }
735
736    _calc_win_height(wd);
737 }
738
739 static void
740 _softkey_object_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
741 {
742    Widget_Data *wd;
743    Evas_Object *btn;
744    int i;
745    Evas_Coord btn_w;
746    Evas_Coord w, h;
747
748    if (!data) return;
749    wd = elm_widget_data_get((Evas_Object *) data);
750    if (!wd) return;
751
752    evas_object_geometry_get(wd->lay, NULL, NULL, &w, &h);
753
754    wd->w = w;
755    wd->h = h;
756
757    if (!wd->lay) return;
758    evas_object_resize(wd->lay, w, h);
759
760    /* resize button */
761    for (i = 0; i < 2; i++)
762    {
763       btn = wd->button[i];
764       if (btn != NULL)
765       {
766          edje_object_part_geometry_get(btn, "button_rect", NULL, NULL, &btn_w,
767                                        NULL);
768          evas_object_resize(btn, btn_w, h);
769          _arrange_button((Evas_Object *) data, i);
770       }
771    }
772
773    if (wd->w >= wd->win_h)
774    {
775       _softkey_horizontal_set(data, EINA_TRUE);
776    }
777    else
778    {
779       _softkey_horizontal_set(data, EINA_FALSE);
780    }
781    _calc_win_height(wd);
782 }
783
784 static void
785 _softkey_object_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
786 {
787    Widget_Data *wd = NULL;
788    Evas_Object *btn;
789    int i;
790    if (data == NULL) return;
791    wd = elm_widget_data_get((Evas_Object *) data);
792    if (wd == NULL) return;
793
794    if (wd->lay)
795    {
796       evas_object_show(wd->lay);
797    }
798
799    /* show button */
800    for (i = 0; i < 2; i++)
801    {
802       btn = wd->button[i];
803       if (btn != NULL && wd->button_show[i] == EINA_TRUE)
804       {
805          evas_object_show(btn);
806          //evas_object_clip_set(btn, evas_object_clip_get((Evas_Object *)data));
807       }
808    }
809    if (wd->panel_btn_idx > 0)
810    {
811       /* show more button */
812       edje_object_signal_emit(wd->lay, "more_btn_show", "");
813    }
814 }
815
816 static void
817 _softkey_object_hide(void *data, Evas *e, Evas_Object *obj, void *event_info)
818 {
819    Widget_Data *wd = NULL;
820    Evas_Object *btn;
821    int i;
822
823    if (data == NULL) return;
824    wd = elm_widget_data_get((Evas_Object *) data);
825    if (wd == NULL) return;
826
827    if (wd->lay)
828    {
829       evas_object_hide(wd->lay);
830    }
831
832    /* hide button */
833    for (i = 0; i < 2; i++)
834    {
835       btn = wd->button[i];
836       if (btn != NULL)
837       {
838          evas_object_hide(btn);
839       }
840    }
841
842    if (wd->panel_btn_idx > 0)
843    {
844       /* hide more button */
845       edje_object_signal_emit(wd->lay, "more_btn_hide", "");
846    }
847 }
848
849 /**
850  * Add a new softkey to the parent
851
852  * @param parent the parent of the smart object
853  * @return              Evas_Object* pointer of softkey(evas object) or NULL
854  * @ingroup             Softkey 
855  */
856 EAPI Evas_Object *
857 elm_softkey_add(Evas_Object *parent)
858 {
859    Evas_Object *obj = NULL;
860    Widget_Data *wd = NULL;
861    Evas *e;
862
863    wd = ELM_NEW(Widget_Data);
864    e = evas_object_evas_get(parent);
865    if (e == NULL) return NULL;
866    obj = elm_widget_add(e);
867    elm_widget_type_set(obj, "softkey");
868    elm_widget_sub_object_add(parent, obj);
869    elm_widget_data_set(obj, wd);
870    elm_widget_del_hook_set(obj, _del_hook);
871    elm_widget_theme_hook_set(obj, _theme_hook);
872
873    /* load background edj */
874    wd->lay = edje_object_add(e);
875    _elm_theme_object_set(obj, wd->lay, "softkey", "bg", "default");
876    if (wd->lay == NULL)
877    {
878       printf("Cannot load bg edj\n");
879       return NULL;
880    }
881    elm_widget_resize_object_set(obj, wd->lay);
882    edje_object_signal_callback_add(wd->lay, "clicked", "more_btn",
883                                    _more_btn_click_cb, obj);
884
885    evas_object_event_callback_add(obj, EVAS_CALLBACK_RESIZE,
886                                   _softkey_object_resize, obj);
887    evas_object_event_callback_add(obj, EVAS_CALLBACK_MOVE,
888                                   _softkey_object_move, obj);
889    evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW,
890                                   _softkey_object_show, obj);
891    evas_object_event_callback_add(obj, EVAS_CALLBACK_HIDE,
892                                   _softkey_object_hide, obj);
893    wd->is_horizontal = EINA_FALSE;
894    wd->panel_suppported = EINA_TRUE;
895    wd->scale_factor = elm_scale_get();
896    if (wd->scale_factor == 0.0)
897    {
898       wd->scale_factor = 1.0;
899    }
900
901    /* load glow effect */
902    wd->glow_obj = edje_object_add(e);
903    _elm_theme_object_set(obj, wd->glow_obj, "softkey", "glow", "default");
904    evas_object_geometry_get(wd->glow_obj, NULL, NULL, &wd->glow_w, &wd->glow_h);
905    evas_object_resize(wd->glow_obj, wd->glow_w, wd->glow_h);
906
907    // FIXME
908    //evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
909
910    wd->button[ELM_SK_LEFT_BTN] = wd->button[ELM_SK_RIGHT_BTN] = NULL;
911    wd->panel = NULL;
912    //_sizing_eval(obj);
913    wd->show_panel = EINA_FALSE;
914    wd->bg_rect = NULL;
915
916    return obj;
917 }
918
919 static void
920 _softkey_horizontal_set(Evas_Object *obj, Eina_Bool horizontal_mode)
921 {
922    Widget_Data *wd;
923    char buff[32];
924    if (!obj) return;
925    wd = elm_widget_data_get(obj);
926    if (!wd) return;
927    wd->is_horizontal = horizontal_mode;
928    if (wd->panel)
929    {
930       if ((edje_object_data_get(wd->panel, "max_item_count") == NULL)
931                || (edje_object_data_get(wd->panel, "panel_height") == NULL)
932                || (edje_object_data_get(wd->panel, "panel_height_horizontal")
933                         == NULL))
934       {
935          wd->panel_suppported = EINA_FALSE;
936       }
937       else
938          wd->panel_suppported = EINA_TRUE;
939       if (wd->panel_suppported == EINA_TRUE)
940       {
941          if (wd->is_horizontal == EINA_TRUE)
942          {
943             snprintf(buff, sizeof(buff), "button_%d", (wd->panel_btn_idx
944                      + wd->max_button));
945             edje_object_signal_emit(wd->panel, buff, "panel_rect");
946             wd->panel_height
947                      = (int) (atoi(edje_object_data_get(wd->panel, buff))
948                               * wd->scale_factor);
949             evas_object_resize(
950                                wd->panel,
951                                wd->w,
952                                ((int) (atoi(
953                                             edje_object_data_get(wd->panel,
954                                                                  "panel_height_horizontal"))
955                                         * wd->scale_factor)));
956          }
957          else
958          {
959             snprintf(buff, sizeof(buff), "button_%d", (wd->panel_btn_idx));
960             edje_object_signal_emit(wd->panel, buff, "panel_rect");
961             wd->panel_height
962                      = (int) (atoi(edje_object_data_get(wd->panel, buff))
963                               * wd->scale_factor);
964             evas_object_resize(
965                                wd->panel,
966                                wd->w,
967                                ((int) (atoi(
968                                             edje_object_data_get(wd->panel,
969                                                                  "panel_height"))
970                                         * wd->scale_factor)));
971          }
972       }
973       _calc_win_height(wd);
974    }
975
976 }
977
978 /**
979  * add side button of softkey
980  * @param       obj     softkey object 
981  * @param       type softkey button type
982  * @param       icon The icon object to use for the item
983  * @param       label The text label to use for the item
984  * @param       func Convenience function to call when this item is selected
985  * @param       data Data to pass to convenience function
986  * @return      A handle to the item added
987  * 
988  * @ingroup     Softkey  
989  */
990 EAPI Elm_Softkey_Item *
991 elm_softkey_button_add(Evas_Object *obj, Elm_Softkey_Type type,
992                        Evas_Object *icon, const char *label, void
993                        (*func)(void *data, Evas_Object *obj, void *event_info),
994                        const void *data)
995 {
996    Widget_Data *wd;
997    Evas* evas;
998    char button_type[64];
999    Elm_Softkey_Item *it;
1000
1001    if (!obj) return NULL;
1002    wd = elm_widget_data_get(obj);
1003    if (!wd) return NULL;
1004
1005    if (wd->button[type])
1006    {
1007       printf("already created.\n");
1008       return NULL;
1009    }
1010
1011    /* get evas */
1012    evas = evas_object_evas_get(obj);
1013    if (!evas) return NULL;
1014
1015    /* set item data */
1016    it = ELM_NEW(Elm_Softkey_Item);
1017    it->obj = obj;
1018    it->func = func;
1019    it->data = data;
1020    it->label = NULL;
1021    it->icon = NULL;
1022    /* load button edj */
1023    if (wd->button[type] == NULL)
1024    {
1025       if (type == ELM_SK_LEFT_BTN)
1026       {
1027          strcpy(button_type, "button_left");
1028       }
1029       else
1030       {
1031          strcpy(button_type, "button_right");
1032       }
1033
1034       it->base = wd->button[type] = edje_object_add(evas);
1035       if (!wd->button[type])
1036       {
1037          free(it);
1038          return NULL;
1039       }
1040       _elm_theme_object_set(obj, wd->button[type], "softkey", button_type,
1041                             elm_widget_style_get(obj));
1042
1043       wd->button_show[type] = EINA_TRUE;
1044       if (evas_object_visible_get(obj))
1045       {
1046          evas_object_show(wd->button[type]);
1047       }
1048       evas_object_smart_member_add(wd->button[type], obj);
1049
1050       edje_object_signal_callback_add(wd->button[type], "elm,action,down", "",
1051                                       _softkey_down_cb, it);
1052       edje_object_signal_callback_add(wd->button[type], "elm,action,click", "",
1053                                       _softkey_up_cb, it);
1054
1055       evas_object_clip_set(wd->button[type], evas_object_clip_get(obj));
1056       if (wd->panel) evas_object_raise(wd->panel);
1057    }
1058
1059    _sizing_eval(obj);
1060
1061    elm_softkey_item_label_set(it, label);
1062    elm_softkey_item_icon_set(it, icon);
1063    if (wd->button[type])
1064       evas_object_data_set(wd->button[type], "item_data", it);
1065    else
1066    {
1067       if (it->label) eina_stringshare_del(it->label);
1068       it->label = NULL;
1069       free(it);
1070       return NULL;
1071    }
1072
1073    return it;
1074 }
1075
1076 /**
1077  * delete side button of softkey
1078  * @param       obj     softkey object 
1079  * @param       type softkey button type
1080  * 
1081  * @ingroup     Softkey  
1082  */
1083 EAPI void
1084 elm_softkey_button_del(Evas_Object *obj, Elm_Softkey_Type type)
1085 {
1086    Widget_Data *wd;
1087    Elm_Softkey_Item *it;
1088    Evas_Object *btn;
1089
1090    if (!obj)
1091    {
1092       printf("Invalid argument: softkey object is NULL\n");
1093       return;
1094    }
1095
1096    wd = elm_widget_data_get(obj);
1097    if (!wd) return;
1098
1099    btn = wd->button[type];
1100    if (!btn) return;
1101
1102    it = evas_object_data_get(btn, "item_data");
1103    //_delete_button(btn);
1104    edje_object_signal_callback_del(wd->button[type], "elm,action,down", "",
1105                                    _softkey_down_cb);
1106    edje_object_signal_callback_del(wd->button[type], "elm,action,click", "",
1107                                    _softkey_up_cb);
1108    evas_object_del(wd->button[type]);
1109    if (it->label) eina_stringshare_del(it->label);
1110    if (it->icon) evas_object_del(it->icon);
1111    free(it);
1112    wd->button[type] = NULL;
1113 }
1114
1115 /**
1116  * show button of softkey
1117  * @param       obj     softkey object 
1118  * @param       type    softkey button type
1119  *
1120  * @ingroup     Softkey  
1121  */
1122 EAPI void
1123 elm_softkey_button_show(Evas_Object *obj, Elm_Softkey_Type type)
1124 {
1125    _show_button(obj, type, EINA_TRUE);
1126 }
1127
1128 /**
1129  * hide button of softkey
1130  * @param       obj     softkey object 
1131  * @param       type    softkey button type
1132  *
1133  * @ingroup     Softkey  
1134  */
1135 EAPI void
1136 elm_softkey_button_hide(Evas_Object *obj, Elm_Softkey_Type type)
1137 {
1138    _show_button(obj, type, EINA_FALSE);
1139 }
1140
1141 /**
1142  * add item in panel
1143  * @param       obj     softkey object 
1144  * @param       icon The icon object
1145  * @param       label The text label to use for the item
1146  * @param       func Convenience function to call when this item is selected
1147  * @param       data Data to pass to convenience function
1148  * @return      A handle to the item added
1149  * 
1150  * @ingroup     Softkey  
1151  */
1152 EAPI Elm_Softkey_Item *
1153 elm_softkey_panel_item_add(Evas_Object *obj, Evas_Object *icon,
1154                            const char *label, void
1155                            (*func)(void *data, Evas_Object *obj,
1156                                    void *event_info), const void *data)
1157 {
1158    Widget_Data *wd;
1159    Evas *evas;
1160    char button_name[32];
1161    Evas_Object *btn;
1162    Elm_Softkey_Item *it;
1163    char buff[PATH_MAX];
1164
1165    wd = elm_widget_data_get(obj);
1166    if (!wd)
1167    {
1168       printf("Cannot get smart data\n");
1169       return NULL;
1170    }
1171
1172    /* get evas */
1173    evas = evas_object_evas_get(obj);
1174    if (!evas) return NULL;
1175
1176    if (wd->panel == NULL)
1177    {
1178       /* create panel */
1179       wd->bg_rect = evas_object_rectangle_add(evas);
1180       if (!wd->bg_rect) return NULL;
1181       evas_object_color_set(wd->bg_rect, 10, 10, 10, 150);
1182       evas_object_pass_events_set(wd->bg_rect, 0);
1183
1184       if (wd->bg_rect)
1185       {
1186          evas_object_resize(wd->bg_rect, wd->w, wd->win_h);
1187          evas_object_event_callback_add(wd->bg_rect, EVAS_CALLBACK_MOUSE_UP,
1188                                         _bg_click_cb, obj);
1189          evas_object_smart_member_add(wd->bg_rect, obj);
1190       }
1191
1192       wd->panel = edje_object_add(evas);
1193       if (!wd->panel) return NULL;
1194       _elm_theme_object_set(obj, wd->panel, "softkey", "panel",
1195                             elm_widget_style_get(obj));
1196
1197       evas_object_move(wd->panel, 0, wd->win_h);
1198       edje_object_signal_callback_add(wd->panel, "clicked", "close_btn",
1199                                       _close_btn_click_cb, obj);
1200       evas_object_smart_member_add(wd->panel, obj);
1201       if (evas_object_visible_get(obj))
1202       {
1203          evas_object_show(wd->panel);
1204       }
1205       wd->panel_height = 0;
1206       if ((edje_object_data_get(wd->panel, "max_item_count") == NULL)
1207                || (edje_object_data_get(wd->panel, "panel_height") == NULL)
1208                || (edje_object_data_get(wd->panel, "panel_height_horizontal")
1209                         == NULL))
1210       {
1211          //If this key is not found in data section, then it means the panel won't come.
1212          wd->max_button = 0;
1213          // delete panel
1214          if (wd->panel)
1215          {
1216             elm_softkey_panel_del(obj);
1217          }
1218          wd->panel_suppported = EINA_FALSE;
1219          return NULL;
1220       }
1221       else
1222       {
1223          wd->max_button = (int) (atoi(edje_object_data_get(wd->panel,
1224                                                            "max_item_count")));
1225          if (wd->is_horizontal)
1226          {
1227             evas_object_resize(
1228                                wd->panel,
1229                                wd->w,
1230                                ((int) (atoi(
1231                                             edje_object_data_get(wd->panel,
1232                                                                  "panel_height_horizontal"))
1233                                         * wd->scale_factor)));
1234          }
1235          else
1236          {
1237             evas_object_resize(
1238                                wd->panel,
1239                                wd->w,
1240                                ((int) (atoi(
1241                                             edje_object_data_get(wd->panel,
1242                                                                  "panel_height"))
1243                                         * wd->scale_factor)));
1244          }
1245       }
1246
1247       evas_object_clip_set(wd->panel, evas_object_clip_get(obj));
1248    }
1249
1250    wd->panel_btn_idx++;
1251    if (wd->panel_btn_idx >= wd->max_button) return NULL;
1252
1253    /* set item data */
1254    it = ELM_NEW(Elm_Softkey_Item);
1255    it->obj = obj;
1256    if (label) it->label = eina_stringshare_add(label);
1257    it->icon = icon;
1258    it->func = func;
1259    it->data = data;
1260    /* load panel button */
1261    it->base = btn = edje_object_add(evas);
1262    if (!btn)
1263    {
1264       if (it->label) eina_stringshare_del(it->label);
1265       free(it);
1266       wd->panel_btn_idx--;
1267       return NULL;
1268    }
1269    _elm_theme_object_set(obj, btn, "softkey", "panel_button",
1270                          elm_widget_style_get(obj));
1271
1272    edje_object_part_text_set(btn, "elm.text", label); /* set text */
1273    //edje_object_message_signal_process(btn);
1274
1275    if (wd->panel)
1276    {
1277       /* swallow button */
1278       snprintf(button_name, sizeof(button_name), "panel_button_area_%d",
1279                wd->panel_btn_idx);
1280       edje_object_part_swallow(wd->panel, button_name, btn);
1281
1282       if (wd->is_horizontal)
1283       {
1284          snprintf(buff, sizeof(buff), "button_%d", wd->max_button
1285                   + wd->panel_btn_idx);
1286          edje_object_signal_emit(wd->panel, buff, "panel_rect");
1287          const char* val = edje_object_data_get(wd->panel, buff);
1288          if (val)
1289             wd->panel_height = (int) (atoi(val) * wd->scale_factor);
1290          else
1291          {
1292             if (it->label) eina_stringshare_del(it->label);
1293             evas_object_del(it->base);
1294             free(it);
1295             wd->panel_btn_idx--;
1296             return NULL;
1297          }
1298       }
1299       else
1300       {
1301          snprintf(buff, sizeof(buff), "button_%d", wd->panel_btn_idx);
1302          edje_object_signal_emit(wd->panel, buff, "panel_rect");
1303          const char* val = edje_object_data_get(wd->panel, buff);
1304          if (val)
1305             wd->panel_height = (int) (atoi(val) * wd->scale_factor);
1306          else
1307          {
1308             if (it->label) eina_stringshare_del(it->label);
1309             evas_object_del(it->base);
1310             free(it);
1311             wd->panel_btn_idx--;
1312             return NULL;
1313          }
1314       }
1315    }
1316    else
1317    {
1318       wd->panel_btn_idx--;
1319       return NULL;
1320    }
1321    evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_DOWN,
1322                                   _panel_down_cb, it);
1323    evas_object_event_callback_add(btn, EVAS_CALLBACK_MOUSE_UP, _panel_up_cb, it);
1324    wd->items = eina_list_append(wd->items, it);
1325    if (evas_object_visible_get(obj))
1326    {
1327       /* show more button */
1328       edje_object_signal_emit(wd->lay, "more_btn_show", "");
1329    }
1330    return it;
1331 }
1332
1333 /**
1334  * delete panel
1335
1336  * @param obj softkey object
1337  * @return int 0 (SUCCESS) or -1 (FAIL)
1338  *
1339  * @ingroup Softkey
1340  */
1341 EAPI int
1342 elm_softkey_panel_del(Evas_Object *obj)
1343 {
1344    Widget_Data *wd;
1345    char button_name[32];
1346    Evas_Object *btn;
1347    int i;
1348    Elm_Softkey_Item *it;
1349
1350    wd = elm_widget_data_get(obj);
1351    if (!wd) return -1;
1352    if (wd->panel == NULL) return -1;
1353    if (wd->animator)
1354    {
1355       ecore_animator_del(wd->animator);
1356       wd->animator = NULL;
1357       wd->animating = EINA_FALSE;
1358    }
1359    /* delete background */
1360    if (wd->bg_rect)
1361    {
1362       //evas_object_event_callback_del(wd->bg_rect, EVAS_CALLBACK_MOUSE_UP, _bg_click_cb);
1363       evas_object_del(wd->bg_rect);
1364       wd->bg_rect = NULL;
1365    }
1366
1367    for (i = 1; i <= wd->panel_btn_idx; i++)
1368    {
1369       snprintf(button_name, sizeof(button_name), "panel_button_area_%d", i);
1370       btn = edje_object_part_swallow_get(wd->panel, button_name);
1371       //_delete_button(btn);
1372       if (btn)
1373       {
1374          //edje_object_part_unswallow(wd->panel, btn);
1375          //evas_object_event_callback_del(btn, EVAS_CALLBACK_MOUSE_DOWN, _panel_down_cb);
1376          //evas_object_event_callback_del(btn, EVAS_CALLBACK_MOUSE_UP, _panel_up_cb);
1377          evas_object_del(btn);
1378       }
1379    }
1380
1381    EINA_LIST_FREE(wd->items, it)
1382    {
1383       if (it->label) eina_stringshare_del(it->label);
1384       it->base = NULL;
1385       if (it->icon) it->icon = NULL;
1386       free(it);
1387    }
1388
1389    wd->panel_btn_idx = 0;
1390    wd->panel_height = 0;
1391
1392    //hide more button
1393    edje_object_signal_emit(wd->lay, "more_btn_hide", "");
1394
1395    if (wd->panel)
1396    {
1397       //evas_object_move(wd->panel, 0, wd->win_h);
1398       evas_object_clip_unset(wd->panel);
1399       evas_object_del(wd->panel);
1400       wd->show_panel = EINA_FALSE;
1401       wd->panel = NULL;
1402    }
1403
1404    return 0;
1405 }
1406
1407 /**
1408  * sliding up panel if it is closed
1409
1410  * @param obj softkey object
1411  * @return int 0 (SUCCESS) or -1 (FAIL)
1412  *
1413  * @ingroup Softkey
1414  */
1415 EAPI int
1416 elm_softkey_panel_open(Evas_Object *obj)
1417 {
1418    Widget_Data *wd;
1419    wd = elm_widget_data_get(obj);
1420
1421    if (!wd) return -1;
1422    if (!wd->panel) return -1;
1423
1424    if (wd->show_panel == EINA_FALSE)
1425    {
1426       _more_btn_click_cb(obj, NULL, NULL, NULL);
1427    }
1428
1429    return 0;
1430 }
1431
1432 /**
1433  * sliding down panel if it is opened
1434
1435  * @param obj softkey object
1436  * @return int 0 (SUCCESS) or -1 (FAIL)
1437  *
1438  * @ingroup Softkey
1439  */
1440 EAPI int
1441 elm_softkey_panel_close(Evas_Object *obj)
1442 {
1443    Widget_Data *wd;
1444    wd = elm_widget_data_get(obj);
1445    if (!wd) return -1;
1446
1447    if (wd->panel == NULL) return -1;
1448
1449    if (wd->show_panel == EINA_TRUE)
1450    {
1451       _close_btn_click_cb(obj, obj, NULL, NULL);
1452    }
1453
1454    return 0;
1455 }
1456
1457 /**
1458  * Set the icon of an softkey item
1459  *
1460  * @param it The item to set the icon
1461  * @param icon The icon object
1462  *
1463  * @ingroup Softkey
1464  */
1465 EAPI void
1466 elm_softkey_item_icon_set(Elm_Softkey_Item *it, Evas_Object *icon)
1467 {
1468    if (!it) return;
1469
1470    if ((it->icon != icon) && (it->icon))
1471    {
1472       //elm_widget_sub_object_del(it->obj, it->icon);
1473       evas_object_del(it->icon);
1474       it->icon = NULL;
1475    }
1476
1477    if ((icon) && (it->icon != icon))
1478    {
1479       it->icon = icon;
1480       //elm_widget_sub_object_add(it->obj, icon);
1481       edje_object_part_swallow(it->base, "elm.swallow.icon", icon);
1482       edje_object_signal_emit(it->base, "elm,state,icon,visible", "elm");
1483       //edje_object_message_signal_process(it->base);
1484       _sizing_eval(it->obj);
1485    }
1486    else
1487       it->icon = icon;
1488 }
1489
1490 /**
1491  * Get the icon of an softkey item
1492  *
1493  * @param it The item to get the icon
1494  * @return The icon object
1495  *
1496  * @ingroup Softkey
1497  */
1498 EAPI Evas_Object *
1499 elm_softkey_item_icon_get(Elm_Softkey_Item *it)
1500 {
1501    if (!it) return NULL;
1502    return it->icon;
1503 }
1504
1505 /**
1506  * Get the text label of an softkey item
1507  *
1508  * @param it The item to set the label
1509  * @param label label
1510  *
1511  * @ingroup Softkey
1512  */
1513 EAPI void
1514 elm_softkey_item_label_set(Elm_Softkey_Item *it, const char *label)
1515 {
1516    if (!it) return;
1517    if (it->label) eina_stringshare_del(it->label);
1518
1519    if (label)
1520    {
1521       it->label = eina_stringshare_add(label);
1522       edje_object_signal_emit(it->base, "elm,state,text,visible", "elm");
1523
1524       /* set text */
1525       edje_object_part_text_set(it->base, "elm.text", label == NULL ? ""
1526                                                                     : label);
1527    }
1528    else
1529    {
1530       it->label = NULL;
1531       edje_object_signal_emit(it->base, "elm,state,text,hidden", "elm");
1532    }
1533    //edje_object_message_signal_process(it->base);
1534 }
1535
1536 /**
1537  * Set the item callback function 
1538  *
1539  * @param it Item to set callback function.
1540  * @param func callback function pointer.
1541  * @param data callback function argument data.
1542  *
1543  * @ingroup Softkey
1544  */
1545 EAPI void
1546 elm_softkey_item_callback_set(Elm_Softkey_Item* item, void
1547 (*func)(void *data, Evas_Object *obj, void *event_info), const void *data)
1548 {
1549    if (!item) return;
1550
1551    item->func = func;
1552    item->data = data;
1553
1554 }
1555
1556 /**
1557  * Get the text label of an softkey item
1558  *
1559  * @param it The item to get the label
1560  * @return The text label of the softkey item
1561  *
1562  * @ingroup Softkey
1563  */
1564 EAPI const char *
1565 elm_softkey_item_label_get(Elm_Softkey_Item *it)
1566 {
1567    if (!it) return NULL;
1568    return it->label;
1569 }
1570
1571 EAPI Eina_Bool
1572 elm_softkey_item_disabled_get(Elm_Softkey_Item *it)
1573 {
1574    if (!it) return EINA_FALSE;
1575    return it->disabled;
1576 }
1577
1578 EAPI void
1579 elm_softkey_item_disabled_set(Elm_Softkey_Item *it, Eina_Bool disabled)
1580 {
1581    if (!it) return;
1582    _item_disable(it, disabled);
1583 }