[dialoguegroup] disabled_set function added
[framework/uifw/elementary.git] / src / lib / elm_dialoguegroup.c
1 #include <Elementary.h>
2 #include "elm_priv.h"
3 #include <Ecore.h>
4
5 /**
6  * @defgroup DialogueGroup DialogueGroup 
7  * @ingroup Elementary
8  *
9  * Using dialoguegroup, you can make a dialogue group.
10  */
11
12 struct _Dialogue_Item
13 {
14    Evas_Object *parent;
15    Evas_Object *bg_layout;
16    Evas_Object *content;
17    Elm_Dialoguegroup_Item_Style style;
18    const char *location;
19    Eina_Bool press;
20    Eina_Bool disabled;
21    //   Eina_Bool line_show;
22 };
23
24
25 typedef struct _Widget_Data Widget_Data;
26 struct _Widget_Data
27 {
28    Evas_Object *parent;
29    Evas_Object *box;
30    Evas_Object *title_layout;
31    const char *title;
32    unsigned int num;
33    Eina_List *items;
34 };
35
36 static const char*widtype = NULL;
37
38 static void _del_hook(Evas_Object *obj);
39 static void _theme_hook(Evas_Object *obj);
40 static void _sizing_eval(Evas_Object *obj);
41 static void _disable_hook(Evas_Object *obj);
42
43 static void _remove_all(Evas_Object *obj);
44 static void _set_item_theme(Dialogue_Item *item, const char *location);
45 static void _change_item_bg(Dialogue_Item *item, const char *location);
46 static Dialogue_Item* _create_item(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegroup_Item_Style style, const char *location);
47
48
49 static void
50 _del_hook(Evas_Object *obj)
51 {
52    Widget_Data *wd = elm_widget_data_get(obj);
53
54    if (!wd) return;
55    if (wd->title) eina_stringshare_del(wd->title);
56
57    _remove_all(obj);
58
59    if (wd->box){
60         evas_object_del(wd->box);
61         wd->box = NULL;
62    }
63
64    free(wd);
65 }
66
67
68 static void
69 _theme_hook(Evas_Object *obj)
70 {
71    Widget_Data *wd = elm_widget_data_get(obj);
72    Eina_List *l;
73    Dialogue_Item *item; 
74
75    if (!wd) return;     
76    if (wd->title) {
77         elm_layout_theme_set(wd->title_layout, "dialoguegroup", "title", elm_widget_style_get(obj));
78         edje_object_part_text_set(elm_layout_edje_get(wd->title_layout), "text", wd->title);
79    }
80    EINA_LIST_FOREACH(wd->items, l, item) 
81       _change_item_bg( item, item->location );  
82    _sizing_eval(obj);
83 }
84
85 static void
86 _disable_hook(Evas_Object *obj)
87 {
88
89 }
90
91 static void
92 _sizing_eval(Evas_Object *obj)
93 {
94    Widget_Data *wd = elm_widget_data_get(obj);
95    Evas_Coord minw, minh, maxw, maxh;
96
97    if (!wd) return;
98    evas_object_size_hint_min_get(wd->box, &minw, &minh);
99    evas_object_size_hint_max_get(wd->box, &maxw, &maxh);
100    evas_object_size_hint_min_set(obj, minw, minh);
101    evas_object_size_hint_max_set(obj, maxw, maxh);
102 }
103
104 static void _remove_all(Evas_Object *obj)
105 {
106    Widget_Data *wd = elm_widget_data_get(obj);
107    Dialogue_Item *item; 
108
109    if (!wd) return;
110
111    wd->num = 0;
112
113    if (wd->items) {
114         EINA_LIST_FREE(wd->items, item) {
115              if (item->content){
116                   evas_object_del(item->content);
117                   item->content = NULL;
118              }
119              if (item->bg_layout){
120                   evas_object_del(item->bg_layout);
121                   item->bg_layout = NULL;
122              }
123              if (item->location)
124                 eina_stringshare_del(item->location);
125              free(item);
126         }
127    }
128 }
129
130 static void _set_item_theme(Dialogue_Item *item, const char *location)
131 {
132    if (!item) return;
133    char buf[30];
134
135    if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DEFAULT) 
136       snprintf(buf, sizeof(buf), "bg_%s", location);
137    else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD) 
138       snprintf(buf, sizeof(buf), "editfield_%s", location);
139    else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD_WITH_TITLE) 
140       snprintf(buf, sizeof(buf), "editfield_with_title_%s", location);
141    else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDIT_TITLE) 
142       snprintf(buf, sizeof(buf), "edit_title_%s", location);
143    else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_HIDDEN) 
144       snprintf(buf, sizeof(buf), "hidden_%s", location);
145    else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DATAVIEW) 
146       snprintf(buf, sizeof(buf), "dataview_%s", location);
147    else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_NO_BG) 
148       snprintf(buf, sizeof(buf), "no_bg_%s", location);
149    else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_SUB) 
150       snprintf(buf, sizeof(buf), "sub_%s", location);
151    elm_layout_theme_set(item->bg_layout, "dialoguegroup", buf, elm_widget_style_get(item->parent));
152 }
153
154 /*
155    static void _set_line_show(Dialogue_Item *item, Dialogue_Item *after)
156    {
157    if(!item || !after) return;
158
159    if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DEFAULT) {
160    if (after->style == ELM_DIALOGUEGROUP_ITEM_STYLE_DEFAULT) {
161    item->line_show = EINA_TRUE;
162    edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,show", "elm"); 
163    }
164    else if (after->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD) {
165    item->line_show = EINA_FALSE;
166    edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm"); 
167    }    
168    }
169    else if (item->style == ELM_DIALOGUEGROUP_ITEM_STYLE_EDITFIELD) 
170    item->line_show = EINA_TRUE; 
171    }
172 */
173
174 static void _change_item_bg(Dialogue_Item *item, const char *location)
175 {
176    if (!item) return;
177
178    eina_stringshare_replace(&item->location, location);
179    _set_item_theme(item, location);
180    elm_layout_content_set(item->bg_layout, "swallow", item->content);
181    if((item->press == EINA_TRUE) && (item->disabled == EINA_FALSE))
182       edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
183    else
184       edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");   
185    if(item->disabled == EINA_TRUE)
186       edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,disabled", "elm");
187    else
188       edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,enabled", "elm");
189
190    /*   if(item->line_show == EINA_FALSE)
191         edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,line,hide", "elm");*/
192
193 }
194
195 static Dialogue_Item* _create_item(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegroup_Item_Style style, const char *location)
196 {
197    Widget_Data *wd = elm_widget_data_get(obj);
198    Dialogue_Item *item;
199
200    if (!wd) return NULL;
201
202    item = ELM_NEW(Dialogue_Item);
203    item->parent = obj;
204    item->content = subobj;
205    item->press = EINA_TRUE;
206    item->disabled = EINA_FALSE;
207    item->style = style;
208    //   item->line_show = EINA_TRUE;
209    eina_stringshare_replace(&item->location, location);
210
211    item->bg_layout = elm_layout_add(wd->box);
212    _set_item_theme(item, location);
213    evas_object_size_hint_weight_set(item->bg_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
214    evas_object_size_hint_align_set(item->bg_layout, EVAS_HINT_FILL, 0.0);
215    evas_object_show(item->bg_layout);   
216
217    elm_layout_content_set(item->bg_layout, "swallow", item->content);
218
219    return item;
220 }
221
222 static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
223 {
224    _sizing_eval(data);
225 }
226
227 /**
228  * Add a new dialoguegroup to the parent.
229  *
230  * @param parent The parent object
231  * @return The new object or NULL if it cannot be created
232  *
233  * @ingroup DialogueGroup
234  */
235 EAPI Evas_Object *elm_dialoguegroup_add(Evas_Object *parent)
236 {
237    Evas_Object *obj = NULL;
238    Widget_Data *wd = NULL;
239    Evas *e = NULL;
240
241    e = evas_object_evas_get(parent);
242    if (e == NULL) return NULL;
243    wd = ELM_NEW(Widget_Data);
244    obj = elm_widget_add(e);
245    ELM_SET_WIDTYPE(widtype, "dialoguegroup");
246    elm_widget_type_set(obj, "dialoguegroup");
247    elm_widget_sub_object_add(parent, obj);
248    elm_widget_data_set(obj, wd);
249    elm_widget_del_hook_set(obj, _del_hook);
250    elm_widget_theme_hook_set(obj, _theme_hook);
251
252    wd->parent = parent;
253    wd->num = 0;
254
255    wd->box = elm_box_add(obj);
256    evas_object_event_callback_add(wd->box, EVAS_CALLBACK_CHANGED_SIZE_HINTS, _changed_size_hints, obj);
257    evas_object_show(wd->box);
258    elm_widget_resize_object_set(obj, wd->box);
259
260    _sizing_eval(obj);
261    return obj;
262 }
263
264 /**
265  * Append an item to the dialogue group.
266  *
267  * @param obj dialoguegroup object 
268  * @param subobj item
269  * @param style sytle of the item
270  * @return Dialogue_Item pointer, just made by this function
271  * 
272  * @ingroup DialogueGroup
273  */
274 EAPI Dialogue_Item *
275 elm_dialoguegroup_append(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegroup_Item_Style style)
276 {
277    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
278    Widget_Data *wd = elm_widget_data_get(obj);
279    Dialogue_Item *item = NULL, *new_item = NULL;        
280
281    if (!wd || !subobj) return NULL;
282
283    if (!wd->items) 
284       new_item = _create_item(obj, subobj, style, "default");
285    else {
286         if (wd->num == 1) {     
287              item = eina_list_data_get(wd->items);
288              _change_item_bg(item, "top");              
289         }               
290         else {
291              item = eina_list_data_get( eina_list_last(wd->items) );
292              _change_item_bg(item, "middle");           
293         }
294         new_item = _create_item(obj, subobj, style, "bottom");
295         //              _set_line_show(item, new_item);
296    }
297    elm_box_pack_end(wd->box, new_item->bg_layout);
298    wd->items = eina_list_append(wd->items, new_item);                   
299    wd->num++;
300    _sizing_eval(obj);
301    return new_item;
302 }
303
304
305 /**
306  * Prepend an item to the dialogue group.
307  *
308  * @param obj dialoguegroup object 
309  * @param subobj item
310  * @param style sytle of the item
311  * @return Dialogue_Item pointer, just made by this function
312  *
313  * @ingroup DialogueGroup
314  */
315 EAPI Dialogue_Item *
316 elm_dialoguegroup_prepend(Evas_Object *obj, Evas_Object *subobj, Elm_Dialoguegroup_Item_Style style)
317 {
318    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
319    Widget_Data *wd = elm_widget_data_get(obj);
320    Dialogue_Item *item = NULL, *new_item = NULL;
321
322    if (!wd || !subobj) return NULL;
323
324    if (!wd->items)
325       new_item = _create_item(obj, subobj, style, "default");   
326    else {
327         if (wd->num == 1) {     
328              item = eina_list_data_get(wd->items);
329              _change_item_bg(item, "bottom");
330         }               
331         else {
332              item = eina_list_data_get(wd->items);
333              _change_item_bg(item, "middle");           
334         }
335         new_item = _create_item(obj, subobj, style, "top");
336         //              _set_line_show(new_item, item);
337    }
338    if(wd->title_layout)
339       elm_box_pack_after(wd->box, new_item->bg_layout, wd->title_layout);       
340    else                 
341       elm_box_pack_start(wd->box, new_item->bg_layout);         
342    wd->items = eina_list_prepend(wd->items, new_item);          
343    wd->num++;
344    _sizing_eval(obj);
345    return new_item;
346 }
347
348 /**
349  * Insert an item to the dialogue group just after the specified item.
350  *
351  * @param obj dialoguegroup object 
352  * @param subobj item
353  * @param after specified item existing in the dialogue group
354  * @param style sytle of the item
355  * @return Dialogue_Item pointer, just made by this function
356  *
357  * @ingroup DialogueGroup
358  */
359 EAPI Dialogue_Item * 
360 elm_dialoguegroup_insert_after(Evas_Object *obj, Evas_Object *subobj, Dialogue_Item *after, Elm_Dialoguegroup_Item_Style style)
361 {
362    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
363    Widget_Data *wd = elm_widget_data_get(obj);
364    Dialogue_Item *after_item = NULL, *item = NULL;
365    Eina_List *l;
366
367    if (!wd || !subobj || !after || !wd->items) return NULL;
368
369    EINA_LIST_FOREACH(wd->items, l, after_item) {
370         if(after == after_item) {
371              if( !strcmp(after_item->location, "default") ) {
372                   _change_item_bg(after_item, "top");
373                   item = _create_item(obj, subobj, style, "bottom");
374              }                  
375              else if( !strcmp(after_item->location, "top") || !strcmp(after_item->location, "middle") ) 
376                 item = _create_item(obj, subobj, style, "middle");              
377              else if( !strcmp(after_item->location, "bottom") ) {
378                   _change_item_bg(after_item, "middle");
379                   item = _create_item(obj, subobj, style, "bottom");            
380              }
381
382              elm_box_pack_after(wd->box, item->bg_layout, after_item->bg_layout);
383              wd->items = eina_list_append_relative(wd->items, item, after_item);
384              // _set_line_show(after, item);
385         }               
386    }
387
388    wd->num++;
389    _sizing_eval(obj);
390    return item;
391 }
392
393 /**
394  * Insert an item to the dialogue group just before the specified item.
395  *
396  * @param obj dialoguegroup object 
397  * @param subobj item
398  * @param before specified item existing in the dialogue group
399  * @param style sytle of the item
400  * @return Dialogue_Item pointer, just made by this function
401  *
402  * @ingroup DialogueGroup
403  */
404 EAPI Dialogue_Item *
405 elm_dialoguegroup_insert_before(Evas_Object *obj, Evas_Object *subobj, Dialogue_Item *before, Elm_Dialoguegroup_Item_Style style)
406 {
407    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
408    Widget_Data *wd = elm_widget_data_get(obj);
409    Dialogue_Item *before_item = NULL, *item = NULL;
410    Eina_List *l;
411    Eina_List *prev;
412
413    if (!wd || !subobj || !before || !wd->items) return NULL;
414
415    EINA_LIST_FOREACH(wd->items, l, before_item) {
416         if(before == before_item) {
417              if( !strcmp(before_item->location, "default") ) {
418                   _change_item_bg(before_item, "bottom");
419                   item = _create_item(obj, subobj, style, "top");
420              }
421
422              else if( !strcmp(before_item->location, "top") ) {
423                   _change_item_bg(before_item, "middle");
424                   item = _create_item(obj, subobj, style, "top");                       
425              }
426
427              else if( !strcmp(before_item->location, "middle") || !strcmp(before_item->location, "bottom") ) {
428                   item = _create_item(obj, subobj, style, "middle");
429                   prev = eina_list_prev(l);
430                   //    _set_line_show(prev->data, item);
431              }
432              elm_box_pack_before(wd->box, item->bg_layout, before_item->bg_layout);
433              wd->items = eina_list_prepend_relative(wd->items, item, before_item);
434         }               
435    }
436
437    wd->num++;
438    _sizing_eval(obj);   
439    return item;
440 }
441
442 /**
443  * Remove an item from the dialogue group.
444  *
445  * @param obj dialoguegroup object 
446  * @param subobj item
447  *
448  * @ingroup DialogueGroup
449  */
450 EAPI void
451 elm_dialoguegroup_remove(Dialogue_Item *item)
452 {
453    if (!item) return;
454    ELM_CHECK_WIDTYPE(item->parent, widtype) ;
455    Dialogue_Item *current_item;
456    Widget_Data *wd = elm_widget_data_get(item->parent);
457    Eina_List *l;
458
459    if (!wd || !wd->items || !item) return ;
460
461    EINA_LIST_FOREACH(wd->items, l, current_item) {
462         if (current_item == item) {
463              if (current_item->content){
464                   evas_object_del(current_item->content);
465                   current_item->content = NULL;
466              }
467              if (current_item->bg_layout){
468                   evas_object_del(current_item->bg_layout);
469                   current_item->bg_layout = NULL;
470              }
471              elm_box_unpack(wd->box, current_item->bg_layout);                  
472              wd->items = eina_list_remove(wd->items, current_item);
473         }
474    }
475
476    wd->num--;
477
478    if (wd->num == 0) return;
479
480    if (wd->num == 1) {
481         current_item = eina_list_data_get(wd->items);
482         _change_item_bg(current_item, "default");
483    }
484
485    else {               
486         current_item = eina_list_data_get(wd->items);
487         _change_item_bg(current_item, "top");
488         current_item = eina_list_data_get( eina_list_last(wd->items) );
489         _change_item_bg(current_item, "bottom");                
490    }
491
492    _sizing_eval(item->parent);  
493 }
494
495 /**
496  * Remove all items from the dialogue group.
497  *
498  * @param obj dialoguegroup object 
499  *
500  * @ingroup DialogueGroup
501  */
502 EAPI void
503 elm_dialoguegroup_remove_all(Evas_Object *obj)
504 {
505    ELM_CHECK_WIDTYPE(obj, widtype);
506    _remove_all(obj);    
507    _sizing_eval(obj);   
508 }
509
510
511 /**
512  * Set the title text of the  dialogue group.
513  *
514  * @param obj dialoguegroup object 
515  * @param title title text, if NULL title space will be disappeared 
516  * 
517  * @ingroup DialogueGroup
518  */
519 EAPI void 
520 elm_dialoguegroup_title_set(Evas_Object *obj, const char *title)
521 {
522    ELM_CHECK_WIDTYPE(obj, widtype);
523    Widget_Data *wd = elm_widget_data_get(obj);
524
525    if (!wd) return ;
526    eina_stringshare_replace(&wd->title, title);
527    if (!title) {
528         wd->title = NULL;       
529         elm_box_unpack(wd->box, wd->title_layout);              
530    }    
531    if (!wd->title_layout) {
532         wd->title_layout = elm_layout_add(wd->box);
533         elm_layout_theme_set(wd->title_layout, "dialoguegroup", "title", elm_widget_style_get(obj));
534         evas_object_size_hint_weight_set(wd->title_layout, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
535         evas_object_size_hint_align_set(wd->title_layout, EVAS_HINT_FILL, 0.0);
536         evas_object_show(wd->title_layout);     
537         edje_object_part_text_set(elm_layout_edje_get(wd->title_layout), "text", title);
538         elm_box_pack_start(wd->box, wd->title_layout);
539    }
540    edje_object_part_text_set(elm_layout_edje_get(wd->title_layout), "text", title);
541 }
542
543 /**
544  * Get the title text of the dialogue group
545  *
546  * @param obj The dialoguegroup object
547  * @return The text title string in UTF-8
548  *
549  * @ingroup DialogueGroup
550  */
551 EAPI const char *
552 elm_dialoguegroup_title_get(Evas_Object *obj)
553 {
554    ELM_CHECK_WIDTYPE(obj, widtype) NULL;
555    Widget_Data *wd = elm_widget_data_get(obj);
556    if (!wd) return NULL;
557    return wd->title;
558 }
559
560 /**
561  * Set whether the press effect will be shown or not
562  *
563  * @param obj The dialoguegroup object
564  * @param item Dialogue_Item pointer
565  * @param press If set as 1, press effect will be shown 
566  *
567  * @ingroup DialogueGroup 
568  */
569 EAPI void 
570 elm_dialoguegroup_press_effect_set(Dialogue_Item *item, Eina_Bool press)
571 {
572    if(!item) return;
573    ELM_CHECK_WIDTYPE(item->parent, widtype) ;
574
575    item->press = press;
576    if((press == EINA_TRUE) && (item->disabled == EINA_FALSE))
577       edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
578    else
579       edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");      
580 }
581
582 /**
583  * Get the press effect state
584  *
585  * @param obj The dialoguegroup object
586  * @param item Dialogue_Item pointer
587  * @return 1 if press effect on, 0 if press effect off 
588  *
589  * @ingroup DialogueGroup 
590  */
591 EAPI Eina_Bool
592 elm_dialoguegroup_press_effect_get(Dialogue_Item *item)
593 {
594    if(!item) return EINA_FALSE;
595    ELM_CHECK_WIDTYPE(item->parent, widtype) EINA_FALSE;
596
597    return item->press;
598 }
599
600 /**
601  * Get the conetent object from the specified dialogue item
602  *
603  * @param obj The dialoguegroup object
604  * @param item Dialogue_Item pointer
605  * @return content object 
606  *
607  * @ingroup DialogueGroup 
608  */
609 EAPI Evas_Object *
610 elm_dialoguegroup_item_content_get(Dialogue_Item *item)
611 {
612    if(!item) return NULL;
613    ELM_CHECK_WIDTYPE(item->parent, widtype) EINA_FALSE;
614
615    return item->content;
616 }
617
618 /**
619  * Set the style of the item.
620  *
621  * @param item dialoguegroup item
622  * @param style sytle of the item
623  * 
624  * @ingroup DialogueGroup
625  */
626 EAPI void 
627 elm_dialoguegroup_item_style_set(Dialogue_Item *item, Elm_Dialoguegroup_Item_Style style)
628 {
629    if(!item) return;
630    ELM_CHECK_WIDTYPE(item->parent, widtype);
631    Widget_Data *wd = elm_widget_data_get(item->parent);
632
633    item->style = style;
634    _change_item_bg(item, item->location);
635
636    if (!wd) return ;
637 }
638
639 /**
640  * Get the style of the item.
641  *
642  * @param item dialoguegroup item
643  * @return dialoguegroup item style
644  * 
645  * @ingroup DialogueGroup
646  */
647
648 EAPI Elm_Dialoguegroup_Item_Style
649 elm_dialoguegroup_item_style_get(Dialogue_Item *item)
650 {
651    if(!item) return ELM_DIALOGUEGROUP_ITEM_STYLE_LAST;
652    ELM_CHECK_WIDTYPE(item->parent, widtype) ELM_DIALOGUEGROUP_ITEM_STYLE_LAST;
653    Widget_Data *wd = elm_widget_data_get(item->parent);
654
655    if (!wd) return ELM_DIALOGUEGROUP_ITEM_STYLE_LAST;
656
657    return item->style;
658 }
659
660 /**
661  * Set item state as disable or not.
662  *
663  * @param item dialoguegroup item.
664  * @param disabled if EINA_TRUE disabled, else abled. 
665  * 
666  * @ingroup DialogueGroup
667  */
668 EAPI void 
669 elm_dialoguegroup_item_disabled_set(Dialogue_Item *item, Eina_Bool disabled)
670 {
671    if(!item) return;
672    ELM_CHECK_WIDTYPE(item->parent, widtype);
673    
674    item->disabled = disabled;
675    
676    if(disabled == EINA_TRUE)
677      {
678       edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,disabled", "elm");
679       edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,off", "elm");      
680      }
681    else
682      {
683       edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,enabled", "elm");
684       if(item->press == EINA_TRUE)
685          edje_object_signal_emit(elm_layout_edje_get(item->bg_layout), "elm,state,press,on", "elm");
686      }
687 }
688
689 /**
690  * Get item state whether disabled or not.
691  *
692  * @param item dialoguegroup item.
693  * @return if EINA_TRUE, then disabled else abled.
694  * 
695  * @ingroup DialogueGroup
696  */
697
698 EAPI Eina_Bool
699 elm_dialoguegroup_item_disabled_get(Dialogue_Item *item)
700 {
701    if(!item) return EINA_FALSE;
702    ELM_CHECK_WIDTYPE(item->parent, widtype) EINA_FALSE;
703
704    return item->disabled;
705 }
706
707 /* vim:set ts=8 sw=3 sts=3 expandtab cino=>5n-2f0^-2{2(0W1st0 :*/
708