tizen 2.4 release
[framework/uifw/elementary.git] / src / lib / elm_box.eo
1 class Elm_Box (Elm_Widget)
2 {
3    eo_prefix: elm_obj_box;
4    properties {
5       homogeneous {
6          set {
7             /*@
8             @brief Set the box to arrange its children homogeneously
9
10             @if MOBILE @since_tizen 2.3
11             @elseif WEARABLE @since_tizen 2.3.1
12             @endif
13
14             @remark If enabled, homogeneous layout makes all items the same size, according
15             to the size of the largest of its children.
16
17             @remark This flag is ignored if a custom layout function is set.
18
19             @ingroup Box */
20          }
21          get {
22             /*@
23             @brief Get whether the box is using homogeneous mode or not
24
25             @if MOBILE @since_tizen 2.3
26             @elseif WEARABLE @since_tizen 2.3.1
27             @endif
28
29             @return @c EINA_TRUE if it's homogeneous, @c EINA_FALSE otherwise
30
31             @ingroup Box */
32          }
33          values {
34             bool homogeneous; /*@ The homogeneous flag */
35          }
36       }
37       align {
38          set {
39             /*@
40             @brief Set the alignment of the whole bounding box of contents.
41
42             @if MOBILE @since_tizen 2.3
43             @elseif WEARABLE @since_tizen 2.3.1
44             @endif
45
46             @remark Sets how the bounding box containing all the elements of the box, after
47             their sizes and position has been calculated, will be aligned within
48             the space given for the whole box widget.
49
50             @ingroup Box */
51          }
52          get {
53             /*@
54             @brief Get the alignment of the whole bounding box of contents.
55
56             @if MOBILE @since_tizen 2.3
57             @elseif WEARABLE @since_tizen 2.3.1
58             @endif
59
60             @see elm_box_align_set()
61
62             @ingroup Box */
63          }
64          values {
65             double horizontal; /*@ The horizontal alignment of elements */
66             double vertical; /*@ The vertical alignment of elements */
67          }
68       }
69       horizontal {
70          set {
71             /*@
72             @brief Set the horizontal orientation
73
74             @if MOBILE @since_tizen 2.3
75             @elseif WEARABLE @since_tizen 2.3.1
76             @endif
77
78             @remark By default, box object arranges their contents vertically from top to
79             bottom.
80             By calling this function with @p horizontal as @c EINA_TRUE, the box will
81             become horizontal, arranging contents from left to right.
82
83             @remark This flag is ignored if a custom layout function is set.
84
85             @ingroup Box */
86          }
87          get {
88             /*@
89             @brief Get the horizontal orientation
90
91             @if MOBILE @since_tizen 2.3
92             @elseif WEARABLE @since_tizen 2.3.1
93             @endif
94
95             @ingroup Box
96
97             @return @c EINA_TRUE if the box is set to horizontal mode, @c EINA_FALSE otherwise */
98          }
99          values {
100             bool horizontal; /*@ The horizontal flag (@c EINA_TRUE = horizontal,
101             @c EINA_FALSE = vertical) */
102          }
103       }
104       padding {
105          set {
106             /*@
107             @brief Set the space (padding) between the box's elements.
108
109             @if MOBILE @since_tizen 2.3
110             @elseif WEARABLE @since_tizen 2.3.1
111             @endif
112
113             @remark Extra space in pixels that will be added between a box child and its
114             neighbors after its containing cell has been calculated. This padding
115             is set for all elements in the box, besides any possible padding that
116             individual elements may have through their size hints.
117
118             @ingroup Box */
119          }
120          get {
121             /*@
122             @brief Get the space (padding) between the box's elements.
123
124             @if MOBILE @since_tizen 2.3
125             @elseif WEARABLE @since_tizen 2.3.1
126             @endif
127
128             @see elm_box_padding_set()
129
130             @ingroup Box */
131          }
132          values {
133             Evas_Coord horizontal; /*@ The horizontal space between elements */
134             Evas_Coord vertical; /*@ The vertical space between elements */
135          }
136       }
137       layout {
138          set {
139             /*@
140             @brief Set the layout defining function to be used by the box
141
142             @if MOBILE @since_tizen 2.3
143             @elseif WEARABLE @since_tizen 2.3.1
144             @endif
145
146             @remark Whenever anything changes that requires the box in @p obj to recalculate
147             the size and position of its elements, the function @p cb will be called
148             to determine what the layout of the children will be.
149
150             @remark Once a custom function is set, everything about the children layout
151             is defined by it. The flags set by elm_box_horizontal_set() and
152             elm_box_homogeneous_set() no longer have any meaning, and the values
153             given by elm_box_padding_set() and elm_box_align_set() are up to this
154             layout function to decide if they are used and how. These last two
155             will be found in the @c priv parameter, of type @c Evas_Object_Box_Data,
156             passed to @p cb. The @c Evas_Object the function receives is not the
157             Elementary widget, but the internal Evas Box it uses, so none of the
158             functions described here can be used on it.
159
160             @remark Any of the layout functions in @c Evas can be used here, as well as the
161             special elm_box_layout_transition().
162
163             @remark The final @p data argument received by @p cb is the same @p data passed
164             here, and the @p free_data function will be called to free it
165             whenever the box is destroyed or another layout function is set.
166
167             @remark Setting @p cb to NULL will revert back to the default layout function.
168
169             @see elm_box_layout_transition()
170
171             @ingroup Box */
172          }
173          values {
174             Evas_Object_Box_Layout cb; /*@ The callback function used for layout */
175             const(void)* data; /*@ Data that will be passed to layout function */
176             Ecore_Cb free_data; /*@ Function called to free @p data */
177          }
178       }
179       children {
180          get {
181             /*@
182             @brief Get a list of the objects packed into the box
183
184             @if MOBILE @since_tizen 2.3
185             @elseif WEARABLE @since_tizen 2.3.1
186             @endif
187
188             @remark Returns a new @c list with a pointer to @c Evas_Object in its nodes.
189             The order of the list corresponds to the packing order the box uses.
190
191             @remark You must free this list with eina_list_free() once you are done with it.
192
193             @ingroup Box */
194             return: own(list<Evas_Object*>*);
195          }
196       }
197    }
198    methods {
199       pack_end {
200          /*@
201          @brief Add an object at the end of the pack list
202
203          @if MOBILE @since_tizen 2.3
204          @elseif WEARABLE @since_tizen 2.3.1
205          @endif
206
207          @remark Pack @p subobj into the box @p obj, placing it last in the list of
208          children objects. The actual position the object will get on screen
209          depends on the layout used. If no custom layout is set, it will be at
210          the bottom or right, depending if the box is vertical or horizontal,
211          respectively.
212
213          @see elm_box_pack_start()
214          @see elm_box_pack_before()
215          @see elm_box_pack_after()
216          @see elm_box_unpack()
217          @see elm_box_unpack_all()
218          @see elm_box_clear()
219
220          @ingroup Box */
221
222          params {
223             @in Evas_Object *subobj; /*@ The object to add to the box */
224          }
225       }
226       unpack_all {
227          /*@
228          @brief Remove all items from the box, without deleting them
229
230          @if MOBILE @since_tizen 2.3
231          @elseif WEARABLE @since_tizen 2.3.1
232          @endif
233
234          @remark Clear the box from all children, but don't delete the respective objects.
235          If no other references of the box children exist, the objects will never
236          be deleted, and thus the application will leak the memory. Make sure
237          when using this function that you hold a reference to all the objects
238          in the box @p obj.
239
240          @see elm_box_clear()
241          @see elm_box_unpack()
242
243          @ingroup Box */
244
245       }
246       unpack {
247          /*@
248          @brief Unpack a box item
249
250          @if MOBILE @since_tizen 2.3
251          @elseif WEARABLE @since_tizen 2.3.1
252          @endif
253
254          @remark Remove the object given by @p subobj from the box @p obj without
255          deleting it.
256
257          @see elm_box_unpack_all()
258          @see elm_box_clear()
259
260          @ingroup Box */
261
262          params {
263             @in Evas_Object *subobj; /*@ The object to unpack */
264          }
265       }
266       pack_after {
267          /*@
268          @brief Adds an object to the box after the indicated object
269
270          @if MOBILE @since_tizen 2.3
271          @elseif WEARABLE @since_tizen 2.3.1
272          @endif
273
274          @remark This will add the @p subobj to the box indicated after the object
275          indicated with @p after. If @p after is not already in the box, results
276          are undefined. After means either to the right of the indicated object or
277          below it depending on orientation.
278
279          @see elm_box_pack_start()
280          @see elm_box_pack_end()
281          @see elm_box_pack_before()
282          @see elm_box_unpack()
283          @see elm_box_unpack_all()
284          @see elm_box_clear()
285
286          @ingroup Box */
287
288          params {
289             @in Evas_Object *subobj; /*@ The object to add to the box */
290             @in Evas_Object *after; /*@ The object after which to add it */
291          }
292       }
293       pack_start {
294          /*@
295          @brief Add an object to the beginning of the pack list
296
297          @if MOBILE @since_tizen 2.3
298          @elseif WEARABLE @since_tizen 2.3.1
299          @endif
300
301          @remark Pack @p subobj into the box @p obj, placing it first in the list of
302          children objects. The actual position the object will get on screen
303          depends on the layout used. If no custom layout is set, it will be at
304          the top or left, depending if the box is vertical or horizontal,
305          respectively.
306
307          @see elm_box_pack_end()
308          @see elm_box_pack_before()
309          @see elm_box_pack_after()
310          @see elm_box_unpack()
311          @see elm_box_unpack_all()
312          @see elm_box_clear()
313
314          @ingroup Box */
315
316          params {
317             @in Evas_Object *subobj; /*@ The object to add to the box */
318          }
319       }
320       recalculate {
321          /*@
322          @brief Force the box to recalculate its children packing.
323
324          @if MOBILE @since_tizen 2.3
325          @elseif WEARABLE @since_tizen 2.3.1
326          @endif
327
328          @remark If any children was added or removed, box will not calculate the
329          values immediately rather leaving it to the next main loop
330          iteration. While this is great as it would save lots of
331          recalculation, whenever you need to get the position of a just
332          added item you must force recalculate before doing so.
333
334          @ingroup Box */
335
336       }
337       pack_before {
338          /*@
339          @brief Adds an object to the box before the indicated object
340
341          @if MOBILE @since_tizen 2.3
342          @elseif WEARABLE @since_tizen 2.3.1
343          @endif
344
345          @remark This will add the @p subobj to the box indicated before the object
346          indicated with @p before. If @p before is not already in the box, results
347          are undefined. Before means either to the left of the indicated object or
348          above it depending on orientation.
349
350          @see elm_box_pack_start()
351          @see elm_box_pack_end()
352          @see elm_box_pack_after()
353          @see elm_box_unpack()
354          @see elm_box_unpack_all()
355          @see elm_box_clear()
356
357          @ingroup Box */
358
359          params {
360             @in Evas_Object *subobj; /*@ The object to add to the box */
361             @in Evas_Object *before; /*@ The object before which to add it */
362          }
363       }
364       clear {
365          /*@
366          @brief Clear the box of all children
367
368          @if MOBILE @since_tizen 2.3
369          @elseif WEARABLE @since_tizen 2.3.1
370          @endif
371
372          @remark Remove all the elements contained by the box, deleting the respective
373          objects.
374
375          @see elm_box_unpack()
376          @see elm_box_unpack_all()
377
378          @ingroup Box */
379
380       }
381    }
382    implements {
383       class.constructor;
384       Eo.Base.constructor;
385       Evas.Object_Smart.add;
386       Evas.Object_Smart.del;
387       Elm_Widget.focus_direction;
388       Elm_Widget.focus_next_manager_is;
389       Elm_Widget.focus_direction_manager_is;
390       Elm_Widget.focus_next;
391       Elm_Widget.theme_apply;
392       Elm_Widget.sub_object_del;
393    }
394    events {
395       child,added;
396       child,removed;
397    }
398
399 }