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