2008-09-29 23:58:56 -07:00
|
|
|
#include <Elementary.h>
|
|
|
|
#include "elm_priv.h"
|
|
|
|
|
2008-10-06 18:23:49 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_toggle_add(Evas_Object *parent)
|
|
|
|
{
|
|
|
|
Evas_Object *obj;
|
2011-10-20 17:24:15 -07:00
|
|
|
|
2011-10-20 05:30:04 -07:00
|
|
|
obj = elm_check_add(parent);
|
|
|
|
elm_object_style_set(obj, "toggle");
|
2011-11-16 12:17:25 -08:00
|
|
|
elm_object_part_text_set(obj, "on", E_("ON"));
|
|
|
|
elm_object_part_text_set(obj, "off", E_("OFF"));
|
2008-10-06 18:23:49 -07:00
|
|
|
return obj;
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2008-10-06 18:23:49 -07:00
|
|
|
EAPI void
|
|
|
|
elm_toggle_label_set(Evas_Object *obj, const char *label)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2011-10-20 14:15:06 -07:00
|
|
|
elm_object_text_set(obj, label);
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2010-03-08 23:30:48 -08:00
|
|
|
EAPI const char *
|
2010-03-23 20:06:00 -07:00
|
|
|
elm_toggle_label_get(const Evas_Object *obj)
|
2009-08-11 03:44:49 -07:00
|
|
|
{
|
2011-10-20 14:15:06 -07:00
|
|
|
return elm_object_text_get(obj);
|
2009-08-11 03:44:49 -07:00
|
|
|
}
|
|
|
|
|
2008-10-06 18:23:49 -07:00
|
|
|
EAPI void
|
|
|
|
elm_toggle_icon_set(Evas_Object *obj, Evas_Object *icon)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2011-11-17 13:02:31 -08:00
|
|
|
elm_object_part_content_set(obj, "icon", icon);
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2009-08-12 15:37:48 -07:00
|
|
|
EAPI Evas_Object *
|
2010-03-23 20:06:00 -07:00
|
|
|
elm_toggle_icon_get(const Evas_Object *obj)
|
2009-08-12 15:37:48 -07:00
|
|
|
{
|
2011-11-17 13:02:31 -08:00
|
|
|
return elm_object_part_content_get(obj, "icon");
|
2009-08-12 15:37:48 -07:00
|
|
|
}
|
|
|
|
|
2010-10-14 11:54:42 -07:00
|
|
|
EAPI Evas_Object *
|
|
|
|
elm_toggle_icon_unset(Evas_Object *obj)
|
|
|
|
{
|
2011-11-17 13:02:31 -08:00
|
|
|
return elm_object_part_content_unset(obj, "icon");
|
2010-10-14 11:54:42 -07:00
|
|
|
}
|
|
|
|
|
2008-10-06 18:23:49 -07:00
|
|
|
EAPI void
|
|
|
|
elm_toggle_states_labels_set(Evas_Object *obj, const char *onlabel, const char *offlabel)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2011-11-16 12:17:25 -08:00
|
|
|
elm_object_part_text_set(obj, "on", onlabel);
|
|
|
|
elm_object_part_text_set(obj, "off", offlabel);
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2010-03-25 10:27:00 -07:00
|
|
|
EAPI void
|
|
|
|
elm_toggle_states_labels_get(const Evas_Object *obj, const char **onlabel, const char **offlabel)
|
|
|
|
{
|
2011-11-16 12:17:25 -08:00
|
|
|
if (onlabel) *onlabel = elm_object_part_text_get(obj, "on");
|
|
|
|
if (offlabel) *offlabel = elm_object_part_text_get(obj, "off");
|
2010-03-25 10:27:00 -07:00
|
|
|
}
|
|
|
|
|
2008-10-06 18:23:49 -07:00
|
|
|
EAPI void
|
2009-06-17 08:35:19 -07:00
|
|
|
elm_toggle_state_set(Evas_Object *obj, Eina_Bool state)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2011-10-20 05:30:04 -07:00
|
|
|
elm_check_state_set(obj, state);
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|
|
|
|
|
2009-06-17 08:35:19 -07:00
|
|
|
EAPI Eina_Bool
|
2009-02-25 07:54:26 -08:00
|
|
|
elm_toggle_state_get(const Evas_Object *obj)
|
2009-02-23 17:23:18 -08:00
|
|
|
{
|
2011-10-20 05:30:04 -07:00
|
|
|
return elm_check_state_get(obj);
|
2009-02-23 17:23:18 -08:00
|
|
|
}
|
|
|
|
|
2008-10-06 18:23:49 -07:00
|
|
|
EAPI void
|
2009-06-17 08:35:19 -07:00
|
|
|
elm_toggle_state_pointer_set(Evas_Object *obj, Eina_Bool *statep)
|
2008-09-29 23:58:56 -07:00
|
|
|
{
|
2011-10-20 05:30:04 -07:00
|
|
|
elm_check_state_pointer_set(obj, statep);
|
2008-09-29 23:58:56 -07:00
|
|
|
}
|