Changeset View
Changeset View
Standalone View
Standalone View
src/lib/elementary/elm_diskselector_eo.h
- This file was added.
1 | #ifndef _ELM_DISKSELECTOR_EO_H_ | ||||
---|---|---|---|---|---|
2 | #define _ELM_DISKSELECTOR_EO_H_ | ||||
3 | | ||||
4 | #ifndef _ELM_DISKSELECTOR_EO_CLASS_TYPE | ||||
5 | #define _ELM_DISKSELECTOR_EO_CLASS_TYPE | ||||
6 | | ||||
7 | typedef Eo Elm_Diskselector; | ||||
8 | | ||||
9 | #endif | ||||
10 | | ||||
11 | #ifndef _ELM_DISKSELECTOR_EO_TYPES | ||||
12 | #define _ELM_DISKSELECTOR_EO_TYPES | ||||
13 | | ||||
14 | | ||||
15 | #endif | ||||
16 | /** Elementary diskselector class | ||||
17 | * | ||||
18 | * @ingroup Elm_Diskselector | ||||
19 | */ | ||||
20 | #define ELM_DISKSELECTOR_CLASS elm_diskselector_class_get() | ||||
21 | | ||||
22 | EWAPI const Efl_Class *elm_diskselector_class_get(void); | ||||
23 | | ||||
24 | /** | ||||
25 | * @brief Set the side labels max length. | ||||
26 | * | ||||
27 | * Length is the number of characters of items' label that will be visible when | ||||
28 | * it's set on side positions. It will just crop the string after defined size. | ||||
29 | * E.g.: | ||||
30 | * | ||||
31 | * An item with label "January" would be displayed on side position as "Jan" if | ||||
32 | * max length is set to 3, or "Janu", if this property is set to 4. | ||||
33 | * | ||||
34 | * When it's selected, the entire label will be displayed, except for width | ||||
35 | * restrictions. In this case label will be cropped and "..." will be | ||||
36 | * concatenated. | ||||
37 | * | ||||
38 | * Default side label max length is 3. | ||||
39 | * | ||||
40 | * This property will be applied over all items, included before or later this | ||||
41 | * function call. | ||||
42 | * | ||||
43 | * @param[in] obj The object. | ||||
44 | * @param[in] len The max length defined for side labels. | ||||
45 | * | ||||
46 | * @ingroup Elm_Diskselector | ||||
47 | */ | ||||
48 | EOAPI void elm_obj_diskselector_side_text_max_length_set(Eo *obj, int len); | ||||
49 | | ||||
50 | /** | ||||
51 | * @brief Get the side labels max length. | ||||
52 | * | ||||
53 | * See also @ref elm_obj_diskselector_side_text_max_length_set for details. | ||||
54 | * | ||||
55 | * @param[in] obj The object. | ||||
56 | * | ||||
57 | * @return The max length defined for side labels. | ||||
58 | * | ||||
59 | * @ingroup Elm_Diskselector | ||||
60 | */ | ||||
61 | EOAPI int elm_obj_diskselector_side_text_max_length_get(const Eo *obj); | ||||
62 | | ||||
63 | /** | ||||
64 | * @brief Enable or disable round mode. | ||||
65 | * | ||||
66 | * Disabled by default. If round mode is enabled the items list will work like | ||||
67 | * a circular list, so when the user reaches the last item, the first one will | ||||
68 | * popup. | ||||
69 | * | ||||
70 | * See also @ref elm_obj_diskselector_round_enabled_get. | ||||
71 | * | ||||
72 | * @param[in] obj The object. | ||||
73 | * @param[in] enabled @c true to enable round mode or @c false to disable it. | ||||
74 | * | ||||
75 | * @ingroup Elm_Diskselector | ||||
76 | */ | ||||
77 | EOAPI void elm_obj_diskselector_round_enabled_set(Eo *obj, Eina_Bool enabled); | ||||
78 | | ||||
79 | /** | ||||
80 | * @brief Get a value whether round mode is enabled or not. | ||||
81 | * | ||||
82 | * See also @ref elm_obj_diskselector_round_enabled_set for details. | ||||
83 | * | ||||
84 | * @param[in] obj The object. | ||||
85 | * | ||||
86 | * @return @c true to enable round mode or @c false to disable it. | ||||
87 | * | ||||
88 | * @ingroup Elm_Diskselector | ||||
89 | */ | ||||
90 | EOAPI Eina_Bool elm_obj_diskselector_round_enabled_get(const Eo *obj); | ||||
91 | | ||||
92 | /** | ||||
93 | * @brief Set the number of items to be displayed. | ||||
94 | * | ||||
95 | * Default value is 3, and also it's the minimum. If @c num is less than 3, it | ||||
96 | * will be set to 3. | ||||
97 | * | ||||
98 | * Also, it can be set on theme, using data item @c display_item_num on group | ||||
99 | * "elm/diskselector/item/X", where X is style set. | ||||
100 | * | ||||
101 | * @param[in] obj The object. | ||||
102 | * @param[in] num The number of items the diskselector will display. | ||||
103 | * | ||||
104 | * @ingroup Elm_Diskselector | ||||
105 | */ | ||||
106 | EOAPI void elm_obj_diskselector_display_item_num_set(Eo *obj, int num); | ||||
107 | | ||||
108 | /** | ||||
109 | * @brief Get the number of items in the diskselector object. | ||||
110 | * | ||||
111 | * @param[in] obj The object. | ||||
112 | * | ||||
113 | * @return The number of items the diskselector will display. | ||||
114 | * | ||||
115 | * @ingroup Elm_Diskselector | ||||
116 | */ | ||||
117 | EOAPI int elm_obj_diskselector_display_item_num_get(const Eo *obj); | ||||
118 | | ||||
119 | /** | ||||
120 | * @brief Get the first item of the diskselector. | ||||
121 | * | ||||
122 | * The list of items follows append order. So it will return the first item | ||||
123 | * appended to the widget that wasn't deleted. | ||||
124 | * | ||||
125 | * See also @ref elm_obj_diskselector_item_append, | ||||
126 | * @ref elm_obj_diskselector_items_get. | ||||
127 | * | ||||
128 | * @param[in] obj The object. | ||||
129 | * | ||||
130 | * @return The first item, or @c null if none. | ||||
131 | * | ||||
132 | * @ingroup Elm_Diskselector | ||||
133 | */ | ||||
134 | EOAPI Elm_Widget_Item *elm_obj_diskselector_first_item_get(const Eo *obj); | ||||
135 | | ||||
136 | /** | ||||
137 | * @brief Get a list of all the diskselector items. | ||||
138 | * | ||||
139 | * See also @ref elm_obj_diskselector_item_append, @ref elm_object_item_del, | ||||
140 | * @ref elm_obj_diskselector_clear. | ||||
141 | * | ||||
142 | * @param[in] obj The object. | ||||
143 | * | ||||
144 | * @return A @c list of diskselector items, or @c ull on failure. | ||||
145 | * | ||||
146 | * @ingroup Elm_Diskselector | ||||
147 | */ | ||||
148 | EOAPI const Eina_List *elm_obj_diskselector_items_get(const Eo *obj); | ||||
149 | | ||||
150 | /** | ||||
151 | * @brief Get the last item of the diskselector. | ||||
152 | * | ||||
153 | * The list of items follows append order. So it will return last first item | ||||
154 | * appended to the widget that wasn't deleted. | ||||
155 | * | ||||
156 | * See also @ref elm_obj_diskselector_item_append, | ||||
157 | * @ref elm_obj_diskselector_items_get. | ||||
158 | * | ||||
159 | * @param[in] obj The object. | ||||
160 | * | ||||
161 | * @return The last item, or @c null if none. | ||||
162 | * | ||||
163 | * @ingroup Elm_Diskselector | ||||
164 | */ | ||||
165 | EOAPI Elm_Widget_Item *elm_obj_diskselector_last_item_get(const Eo *obj); | ||||
166 | | ||||
167 | /** | ||||
168 | * @brief Get the selected item. | ||||
169 | * | ||||
170 | * The selected item can be unselected with | ||||
171 | * @ref elm_obj_diskselector_item_selected_set, and the first item of | ||||
172 | * diskselector will be selected. | ||||
173 | * | ||||
174 | * The selected item always will be centered on diskselector, with full label | ||||
175 | * displayed, i.e., max length set to side labels won't apply on the selected | ||||
176 | * item. More details on @ref elm_obj_diskselector_side_text_max_length_set. | ||||
177 | * | ||||
178 | * @param[in] obj The object. | ||||
179 | * | ||||
180 | * @return The selected diskselector item. | ||||
181 | * | ||||
182 | * @ingroup Elm_Diskselector | ||||
183 | */ | ||||
184 | EOAPI Elm_Widget_Item *elm_obj_diskselector_selected_item_get(const Eo *obj); | ||||
185 | | ||||
186 | /** | ||||
187 | * @brief Appends a new item to the diskselector object. | ||||
188 | * | ||||
189 | * A new item will be created and appended to the diskselector, i.e., will be | ||||
190 | * set as last item. Also, if there is no selected item, it will be selected. | ||||
191 | * This will always happens for the first appended item. | ||||
192 | * | ||||
193 | * If no icon is set, label will be centered on item position, otherwise the | ||||
194 | * icon will be placed at left of the label, that will be shifted to the right. | ||||
195 | * | ||||
196 | * Items created with this method can be deleted with @ref elm_object_item_del. | ||||
197 | * | ||||
198 | * Associated @c data can be properly freed when item is deleted if a callback | ||||
199 | * function is set with @ref elm_object_item_del_cb_set. | ||||
200 | * | ||||
201 | * If a function is passed as argument, it will be called every time this item | ||||
202 | * is selected, i.e., the user stops the diskselector with this item on center | ||||
203 | * position. If such function isn't needed, just passing @c null as @c func is | ||||
204 | * enough. The same should be done for @c data. | ||||
205 | * | ||||
206 | * See also @ref elm_object_item_del, @ref elm_obj_diskselector_clear, @ref | ||||
207 | * elm_icon_add. | ||||
208 | * | ||||
209 | * @param[in] obj The object. | ||||
210 | * @param[in] label The label of the diskselector item. | ||||
211 | * @param[in] icon The icon object to use at left side of the item. An icon can | ||||
212 | * be any Evas object, but usually it is an icon created with elm_icon_add(). | ||||
213 | * @param[in] func The function to call when the item is selected. | ||||
214 | * @param[in] data The data to associate with the item for related callbacks. | ||||
215 | * | ||||
216 | * @return New item | ||||
217 | * | ||||
218 | * @ingroup Elm_Diskselector | ||||
219 | */ | ||||
220 | EOAPI Elm_Widget_Item *elm_obj_diskselector_item_append(Eo *obj, const char *label, Efl_Canvas_Object *icon, Evas_Smart_Cb func, const void *data); | ||||
221 | | ||||
222 | /** | ||||
223 | * @brief Remove all diskselector's items. | ||||
224 | * | ||||
225 | * See also @ref elm_object_item_del, @ref elm_obj_diskselector_item_append. | ||||
226 | * @param[in] obj The object. | ||||
227 | * | ||||
228 | * @ingroup Elm_Diskselector | ||||
229 | */ | ||||
230 | EOAPI void elm_obj_diskselector_clear(Eo *obj); | ||||
231 | | ||||
232 | #endif |