* expensive reactions to the value change.
*/
- /* actionslider */
+ /**
+ * @addtogroup Actionslider Actionslider
+ *
+ * A actionslider is a switcher for 2 or 3 labels with customizable magnet
+ * properties. The indicator is the element the user drags to choose a label.
+ * When the position is set with magnet, when released the indicator will be
+ * moved to it if it's nearest the magnetized position.
+ *
+ * @note By default all positions are set as enabled.
+ *
+ * Signals that you can add callbacks for are:
+ *
+ * "selected" - when user selects an enabled position (the label is passed
+ * as event info)".
+ * @n
+ * "pos_changed" - when the indicator reaches any of the positions("left",
+ * "right" or "center").
+ *
+ * @{
+ */
typedef enum _Elm_Actionslider_Pos
{
ELM_ACTIONSLIDER_NONE = 0,
ELM_ACTIONSLIDER_ALL = (1 << 3) -1
} Elm_Actionslider_Pos;
+ /**
+ * Add a new actionslider to the parent.
+ *
+ * @param parent The parent object
+ * @return The new actionslider object or NULL if it cannot be created
+ */
EAPI Evas_Object *elm_actionslider_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
+ /**
+ * Set actionslider labels.
+ *
+ * @param obj The actionslider object
+ * @param left_label The label to be set on the left.
+ * @param center_label The label to be set on the center.
+ * @param right_label The label to be set on the right.
+ */
EAPI void elm_actionslider_labels_set(Evas_Object *obj, const char *left_label, const char *center_label, const char *right_label) EINA_ARG_NONNULL(1);
+ /**
+ * Get actionslider labels.
+ *
+ * @param obj The actionslider object
+ * @param left_label A char** to place the left_label of @p obj into.
+ * @param center_label A char** to place the center_label of @p obj into.
+ * @param right_label A char** to place the right_label of @p obj into.
+ */
EAPI void elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label) EINA_ARG_NONNULL(1);
+ /**
+ * Get actionslider selected label.
+ *
+ * @param obj The actionslider object
+ * @return The selected label
+ */
EAPI const char *elm_actionslider_selected_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ /**
+ * Set actionslider indicator position.
+ *
+ * @param obj The actionslider object.
+ * @param pos The position of the indicator.
+ */
EAPI void elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1);
+ /**
+ * Get actionslider indicator position.
+ *
+ * @param obj The actionslider object.
+ * @return The position of the indicator.
+ */
EAPI Elm_Actionslider_Pos elm_actionslider_indicator_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ /**
+ * Set actionslider magnet position. To make multiple positions magnets @c or
+ * them together(e.g.: ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT)
+ *
+ * @param obj The actionslider object.
+ * @param pos Bit mask indicating the magnet positions.
+ */
EAPI void elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1);
+ /**
+ * Get actionslider magnet position.
+ *
+ * @param obj The actionslider object.
+ * @return The positions with magnet property.
+ */
EAPI Elm_Actionslider_Pos elm_actionslider_magnet_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ /**
+ * Set actionslider enabled position. To set multiple positions as enabled @c or
+ * them together(e.g.: ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT).
+ *
+ * @note All the positions are enabled by default.
+ *
+ * @param obj The actionslider object.
+ * @param pos Bit mask indicating the enabled positions.
+ */
EAPI void elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1);
+ /**
+ * Get actionslider enabled position.
+ *
+ * @param obj The actionslider object.
+ * @return The enabled positions.
+ */
EAPI Elm_Actionslider_Pos elm_actionslider_enabled_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ /**
+ * Set the label used on the indicator.
+ *
+ * @param obj The actionslider object
+ * @param label The label to be set on the indicator.
+ */
EAPI void elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1);
+ /**
+ * Get the label used on the indicator object.
+ *
+ * @param obj The actionslider object
+ * @return The indicator label
+ */
EAPI const char *elm_actionslider_indicator_label_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
- /* smart callbacks called:
- * "selected" - when user selects a position (the label is passed as
- * event info)".
- * "pos_changed" - when a button reaches to the special position like
- * "left", "right" and "center".
+ /**
+ * @}
*/
/* genlist */
-/**
- * @addtogroup Actionslider Actionslider
- *
- * A actionslider is a switcher for 3 labels with customizable
- * magnet properties. When the position is set with magnet, the knob
- * will be moved to it if it's nearest the magnetized position.
- *
- * Signals that you can add callbacks for are:
- *
- * "selected" - when user selects a position (the label is passed as
- * event info)".
- * "pos_changed" - when a button reaches to the special position like
- * "left", "right" and "center".
- */
-
#include <Elementary.h>
#include <math.h>
#include "elm_priv.h"
#undef _FINAL_POS_BY_ORIENTATION
}
-/**
- * Add a new actionslider to the parent.
- *
- * @param parent The parent object
- * @return The new actionslider object or NULL if it cannot be created
- *
- * @ingroup Actionslider
- */
EAPI Evas_Object *
elm_actionslider_add(Evas_Object *parent)
{
return obj;
}
-/**
- * Set actionslider indicator position.
- *
- * @param obj The actionslider object.
- * @param pos The position of the indicator.
- *
- * @ingroup Actionslider
- */
EAPI void
elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
{
edje_object_part_drag_value_set(wd->as, "elm.drag_button_base", position, 0.5);
}
-/**
- * Get actionslider indicator position.
- *
- * @param obj The actionslider object.
- * @return The position of the indicator.
- *
- * @ingroup Actionslider
- */
EAPI Elm_Actionslider_Pos
elm_actionslider_indicator_pos_get(const Evas_Object *obj)
{
return _get_pos_by_orientation(obj, ELM_ACTIONSLIDER_RIGHT);
}
-/**
- * Set actionslider magnet position.
- *
- * @param obj The actionslider object.
- * @param pos Bit mask indicating the magnet positions.
- * Example: use (ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT)
- * to put magnet property on both positions
- *
- * @ingroup Actionslider
- */
EAPI void
elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
{
wd->magnet_position = pos;
}
-/**
- * Get actionslider magnet position.
- *
- * @param obj The actionslider object.
- * @return The positions with magnet property.
- *
- * @ingroup Actionslider
- */
EAPI Elm_Actionslider_Pos
elm_actionslider_magnet_pos_get(const Evas_Object *obj)
{
return wd->magnet_position;
}
-/**
- * Set actionslider enabled position.
- *
- * All the positions are enabled by default.
- *
- * @param obj The actionslider object.
- * @param pos Bit mask indicating the enabled positions.
- * Example: use (ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT)
- * to enable both positions, so the user can select it.
- *
- * @ingroup Actionslider
- */
EAPI void
elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
{
wd->enabled_position = pos;
}
-/**
- * Get actionslider enabled position.
- *
- * All the positions are enabled by default.
- *
- * @param obj The actionslider object.
- * @return The enabled positions.
- *
- * @ingroup Actionslider
- */
EAPI Elm_Actionslider_Pos
elm_actionslider_enabled_pos_get(const Evas_Object *obj)
{
return wd->enabled_position;
}
-/**
- * Set actionslider labels.
- *
- * @param obj The actionslider object
- * @param left_label The label which is going to be set.
- * @param center_label The label which is going to be set.
- * @param right_label The label which is going to be set.
- *
- * @ingroup Actionslider
- */
EAPI void
elm_actionslider_labels_set(Evas_Object *obj, const char *left_label, const char *center_label, const char *right_label)
{
edje_object_part_text_set(wd->as, "elm.text.center", center_label);
}
-/**
- * Get actionslider labels.
- *
- * @param obj The actionslider object
- * @param left_label A char** to place the left_label of @p obj into
- * @param center_label A char** to place the center_label of @p obj into
- * @param right_label A char** to place the right_label of @p obj into
- *
- * @ingroup Actionslider
- */
EAPI void
elm_actionslider_labels_get(const Evas_Object *obj, const char **left_label, const char **center_label, const char **right_label)
{
if (right_label) *right_label = wd->text_right;
}
-/**
- * Get actionslider selected label.
- *
- * @param obj The actionslider object
- * @return The selected label
- *
- * @ingroup Actionslider
- */
EAPI const char *
elm_actionslider_selected_label_get(const Evas_Object *obj)
{
return NULL;
}
-/**
- * Set the label used on the indicator object.
- *
- * @param obj The actionslider object
- * @param label The label which is going to be set.
- *
- * @ingroup Actionslider
- */
EAPI void
elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label)
{
edje_object_part_text_set(wd->as, "elm.text.indicator", wd->indicator_label);
}
-/**
- * Get the label used on the indicator object.
- *
- * @param obj The actionslider object
- * @return The indicator label
- *
- * @ingroup Actionslider
- */
EAPI const char *
elm_actionslider_indicator_label_get(Evas_Object *obj)
{