summaryrefslogtreecommitdiff
path: root/src/lib/elementary/elm_segment_control_eo.legacy.h
blob: 02ce531ad8a505a181d0d3355be56ed09c91635f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
#ifndef _ELM_SEGMENT_CONTROL_EO_LEGACY_H_
#define _ELM_SEGMENT_CONTROL_EO_LEGACY_H_

#ifndef _ELM_SEGMENT_CONTROL_EO_CLASS_TYPE
#define _ELM_SEGMENT_CONTROL_EO_CLASS_TYPE

typedef Eo Elm_Segment_Control;

#endif

#ifndef _ELM_SEGMENT_CONTROL_EO_TYPES
#define _ELM_SEGMENT_CONTROL_EO_TYPES


#endif

/**
 * @brief Get the Segment items count from segment control.
 *
 * It will just return the number of items added to segment control @c obj.
 *
 * @param[in] obj The object.
 *
 * @return Segment items count.
 *
 * @ingroup Elm_Segment_Control_Group
 */
EAPI int elm_segment_control_item_count_get(const Elm_Segment_Control *obj);

/**
 * @brief Get the selected item.
 *
 * The selected item can be unselected with function
 * elm_segment_control_item_selected_set().
 *
 * The selected item always will be highlighted on segment control.
 *
 * @param[in] obj The object.
 *
 * @return The selected item or @c NULL if none of segment items is selected.
 *
 * @ingroup Elm_Segment_Control_Group
 */
EAPI Elm_Widget_Item *elm_segment_control_item_selected_get(const Elm_Segment_Control *obj);

/**
 * @brief Get the label of item.
 *
 * The return value is a pointer to the label associated to the item when it
 * was created, with function elm_segment_control_item_add(), or later with
 * function elm_object_item_text_set. If no label was passed as argument, it
 * will return @c NULL.
 *
 * @param[in] obj The object.
 * @param[in] idx The index of the segment item.
 *
 * @return The label of the item at @c index.
 *
 * @ingroup Elm_Segment_Control_Group
 */
EAPI const char *elm_segment_control_item_label_get(const Elm_Segment_Control *obj, int idx);

/**
 * @brief Insert a new item to the segment control object at specified
 * position.
 *
 * Index values must be between $0, when item will be prepended to segment
 * control, and items count, that can be get with
 * elm_segment_control_item_count_get(), case when item will be appended to
 * segment control, just like elm_segment_control_item_add().
 *
 * Items created with this function can be deleted with function
 * elm_object_item_del() or elm_segment_control_item_del_at().
 *
 * @note @c label set to @c NULL is different from empty string "". If an item
 * only has icon, it will be displayed bigger and centered. If it has icon and
 * label, even that an empty string, icon will be smaller and positioned at
 * left.
 *
 * @param[in] obj The object.
 * @param[in] icon The icon object to use for the left side of the item. An
 * icon can be any Evas object, but usually it is an icon created with
 * elm_icon_add().
 * @param[in] label The label of the item.
 * @param[in] idx Item position. Value should be between 0 and items count.
 *
 * @return The created item or @c NULL upon failure.
 *
 * @ingroup Elm_Segment_Control_Group
 */
EAPI Elm_Widget_Item *elm_segment_control_item_insert_at(Elm_Segment_Control *obj, Efl_Canvas_Object *icon, const char *label, int idx);

/**
 * @brief Get the item placed at specified index.
 *
 * Index is the position of an item in segment control widget. Its range is
 * from $0 to <tt> count - 1 </tt>. Count is the number of items, that can be
 * get with elm_segment_control_item_count_get().
 *
 * @param[in] obj The object.
 * @param[in] idx The index of the segment item.
 *
 * @return The segment control item or @c NULL on failure.
 *
 * @ingroup Elm_Segment_Control_Group
 */
EAPI Elm_Widget_Item *elm_segment_control_item_get(const Elm_Segment_Control *obj, int idx);

/**
 * @brief Remove a segment control item at given index from its parent,
 * deleting it.
 *
 * Items can be added with elm_segment_control_item_add() or
 * elm_segment_control_item_insert_at().
 *
 * @param[in] obj The object.
 * @param[in] idx The position of the segment control item to be deleted.
 *
 * @ingroup Elm_Segment_Control_Group
 */
EAPI void elm_segment_control_item_del_at(Elm_Segment_Control *obj, int idx);

/**
 * @brief Append a new item to the segment control object.
 *
 * A new item will be created and appended to the segment control, i.e., will
 * be set as last item.
 *
 * If it should be inserted at another position,
 * elm_segment_control_item_insert_at() should be used instead.
 *
 * Items created with this function can be deleted with function
 * elm_object_item_del() or elm_object_item_del_at().
 *
 * @note @c label set to @c NULL is different from empty string "". If an item
 * only has icon, it will be displayed bigger and centered. If it has icon and
 * label, even that an empty string, icon will be smaller and positioned at
 * left.
 *
 * @param[in] obj The object.
 * @param[in] icon The icon object to use for the left side of the item. An
 * icon can be any Evas object, but usually it is an icon created with
 * elm_icon_add().
 * @param[in] label The label of the item.  Note that, NULL is different from
 * empty string "".
 *
 * @return The created item or @c NULL upon failure.
 *
 * @ingroup Elm_Segment_Control_Group
 */
EAPI Elm_Widget_Item *elm_segment_control_item_add(Elm_Segment_Control *obj, Efl_Canvas_Object *icon, const char *label);

/**
 * @brief Get the icon associated to the item.
 *
 * The return value is a pointer to the icon associated to the item when it was
 * created, with function elm_segment_control_item_add(), or later with
 * function elm_object_item_part_content_set(). If no icon was passed as
 * argument, it will return @c NULL.
 *
 * @param[in] obj The object.
 * @param[in] idx The index of the segment item.
 *
 * @return The left side icon associated to the item at @c index.
 *
 * @ingroup Elm_Segment_Control_Group
 */
EAPI Efl_Canvas_Object *elm_segment_control_item_icon_get(const Elm_Segment_Control *obj, int idx);

#endif