1 #include <Elementary.h>
5 elm_toggle_add(Evas_Object *parent)
9 obj = elm_check_add(parent);
10 elm_object_style_set(obj, "toggle");
11 elm_object_part_text_set(obj, "on", E_("ON"));
12 elm_object_part_text_set(obj, "off", E_("OFF"));
17 elm_toggle_label_set(Evas_Object *obj, const char *label)
19 elm_object_text_set(obj, label);
23 elm_toggle_label_get(const Evas_Object *obj)
25 return elm_object_text_get(obj);
29 elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon)
31 elm_object_part_content_set(obj, "icon", icon);
35 elm_toggle_icon_get(const Evas_Object *obj)
37 return elm_object_part_content_get(obj, "icon");
41 elm_toggle_icon_unset(Evas_Object *obj)
43 return elm_object_part_content_unset(obj, "icon");
47 elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel)
49 elm_object_part_text_set(obj, "on", onlabel);
50 elm_object_part_text_set(obj, "off", offlabel);
54 elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel)
56 if (onlabel) *onlabel = elm_object_part_text_get(obj, "on");
57 if (offlabel) *offlabel = elm_object_part_text_get(obj, "off");
61 elm_toggle_state_set(Evas_Object *obj, Eina_Bool state)
63 elm_check_state_set(obj, state);
67 elm_toggle_state_get(const Evas_Object *obj)
69 return elm_check_state_get(obj);
73 elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep)
75 elm_check_state_pointer_set(obj, statep);