51b39eef4acc4c52ca4f13530e04e468f26a8552
[framework/uifw/elementary.git] / src / lib / elm_actionslider.h
1    /**
2     * @addtogroup Actionslider Actionslider
3     *
4     * @image html img/widget/actionslider/preview-00.png
5     * @image latex img/widget/actionslider/preview-00.eps
6     *
7     * An actionslider is a switcher for 2 or 3 labels with customizable magnet
8     * properties. The user drags and releases the indicator, to choose a label.
9     *
10     * Labels occupy the following positions.
11     * a. Left
12     * b. Right
13     * c. Center
14     *
15     * Positions can be enabled or disabled.
16     *
17     * Magnets can be set on the above positions.
18     *
19     * When the indicator is released, it will move to its nearest "enabled and magnetized" position.
20     *
21     * @note By default all positions are set as enabled.
22     *
23     * Signals that you can add callbacks for are:
24     *
25     * "selected" - when user selects an enabled position (the label is passed
26     *              as event info)".
27     * @n
28     * "pos_changed" - when the indicator reaches any of the positions("left",
29     *                 "right" or "center").
30     *
31     * See an example of actionslider usage @ref actionslider_example_page "here"
32     * @{
33     */
34    typedef enum _Elm_Actionslider_Pos
35      {
36         ELM_ACTIONSLIDER_NONE = 0,
37         ELM_ACTIONSLIDER_LEFT = 1 << 0,
38         ELM_ACTIONSLIDER_CENTER = 1 << 1,
39         ELM_ACTIONSLIDER_RIGHT = 1 << 2,
40         ELM_ACTIONSLIDER_ALL = (1 << 3) -1
41      } Elm_Actionslider_Pos;
42
43    /**
44     * Add a new actionslider to the parent.
45     *
46     * @param parent The parent object
47     * @return The new actionslider object or NULL if it cannot be created
48     */
49    EAPI Evas_Object          *elm_actionslider_add(Evas_Object *parent) EINA_ARG_NONNULL(1);
50
51    /**
52     * Set actionslider labels.
53     *
54     * @param obj The actionslider object
55     * @param left_label The label to be set on the left.
56     * @param center_label The label to be set on the center.
57     * @param right_label The label to be set on the right.
58     * @deprecated use elm_object_text_set() instead.
59     */
60    EINA_DEPRECATED 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);
61
62    /**
63     * Get actionslider labels.
64     *
65     * @param obj The actionslider object
66     * @param left_label A char** to place the left_label of @p obj into.
67     * @param center_label A char** to place the center_label of @p obj into.
68     * @param right_label A char** to place the right_label of @p obj into.
69     * @deprecated use elm_object_text_set() instead.
70     */
71    EINA_DEPRECATED 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);
72
73    /**
74     * Get actionslider selected label.
75     *
76     * @param obj The actionslider object
77     * @return The selected label
78     */
79    EAPI const char           *elm_actionslider_selected_label_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
80
81    /**
82     * Set actionslider indicator position.
83     *
84     * @param obj The actionslider object.
85     * @param pos The position of the indicator.
86     */
87    EAPI void                  elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1);
88
89    /**
90     * Get actionslider indicator position.
91     *
92     * @param obj The actionslider object.
93     * @return The position of the indicator.
94     */
95    EAPI Elm_Actionslider_Pos  elm_actionslider_indicator_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
96
97    /**
98     * Set actionslider magnet position. To make multiple positions magnets @c or
99     * them together(e.g.: ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT)
100     *
101     * @param obj The actionslider object.
102     * @param pos Bit mask indicating the magnet positions.
103     */
104    EAPI void                  elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1);
105
106    /**
107     * Get actionslider magnet position.
108     *
109     * @param obj The actionslider object.
110     * @return The positions with magnet property.
111     */
112    EAPI Elm_Actionslider_Pos  elm_actionslider_magnet_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
113
114    /**
115     * Set actionslider enabled position. To set multiple positions as enabled @c or
116     * them together(e.g.: ELM_ACTIONSLIDER_LEFT | ELM_ACTIONSLIDER_RIGHT).
117     *
118     * @note All the positions are enabled by default.
119     *
120     * @param obj The actionslider object.
121     * @param pos Bit mask indicating the enabled positions.
122     */
123    EAPI void                  elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos) EINA_ARG_NONNULL(1);
124
125    /**
126     * Get actionslider enabled position.
127     *
128     * @param obj The actionslider object.
129     * @return The enabled positions.
130     */
131    EAPI Elm_Actionslider_Pos  elm_actionslider_enabled_pos_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
132
133    /**
134     * Set the label used on the indicator.
135     *
136     * @param obj The actionslider object
137     * @param label The label to be set on the indicator.
138     * @deprecated use elm_object_text_set() instead.
139     */
140    EINA_DEPRECATED EAPI void                  elm_actionslider_indicator_label_set(Evas_Object *obj, const char *label) EINA_ARG_NONNULL(1);
141
142    /**
143     * Get the label used on the indicator object.
144     *
145     * @param obj The actionslider object
146     * @return The indicator label
147     * @deprecated use elm_object_text_get() instead.
148     */
149    EINA_DEPRECATED EAPI const char           *elm_actionslider_indicator_label_get(Evas_Object *obj) EINA_ARG_NONNULL(1);
150
151    /**
152     * @}
153     */
154