summaryrefslogtreecommitdiff
path: root/src/lib/elm_layout.eo
blob: 241fe8063114a49bf32b1da0540b9ce2979199ef (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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
class Elm_Layout (Elm_Container)
{
   eo_prefix: elm_obj_layout;
   data: Elm_Layout_Smart_Data;
   properties {
      edje_object_can_access {
         set {
            /*@
            Set accessibility to all texblock(text) parts in the layout object

            @return @c EINA_TRUE on success or @c EINA_FALSE on failure. If @p obj is not
            a proper layout object, @c EINA_FALSE is returned.

            @since 1.7

            @ingroup Layout */
            return Eina_Bool;
         }
         get {
            /*@
            Get accessibility state of texblock(text) parts in the layout object

            @return @c EINA_TRUE, if all textblock(text) parts in the layout can be accessible
            @c EINA_FALSET if those cannot be accessible. If @p obj is not a proper layout
            object, @c EINA_FALSE is returned.

            @see elm_layout_edje_object_access_set()

            @since 1.7

            @ingroup Layout */
         }
         values {
            Eina_Bool can_access; /*@ makes all textblock(text) parts in the layout @p obj possible
            to have accessibility. @c EINA_TRUE means textblock(text) parts can be accessible */
         }
      }
      file {
         set {
            /*@
            Set the file that will be used as layout

            @return (1 = success, 0 = error)

            @ingroup Layout */
            return Eina_Bool;
         }
         values {
            const char *file; /*@ The path to file (edj) that will be used as layout */
            const char *group; /*@ The group that the layout belongs in edje file */
         }
      }
      theme {
         set {
            /*@
            Set the edje group from the elementary theme that will be used as layout

            @return (1 = success, 0 = error)

            Note that @a style will be the new style of @a obj too, as in an
            elm_object_style_set() call.

            @ingroup Layout */
            return Eina_Bool;
         }
         values {
            const char *klass; /*@ the class of the group */
            const char *group; /*@ the group */
            const char *style; /*@ the style to used */
         }
      }
      text_aliases {
         get {
            /*@ No description supplied by the EAPI. */
            legacy null;
         }
         values {
            const Elm_Layout_Part_Alias_Description *aliases;
         }
      }
      content_aliases {
         get {
            /*@ No description supplied by the EAPI. */
            legacy null;
         }
         values {
            const Elm_Layout_Part_Alias_Description *aliases;
         }
      }
      edje {
         get {
            /*@
            Get the edje layout

            @return A Evas_Object with the edje layout settings loaded
            with function elm_layout_file_set

            This returns the edje object. It is not expected to be used to then
            swallow objects via edje_object_part_swallow() for example. Use
            elm_layout_content_set() instead so child object handling and sizing is
            done properly.

            @note This function should only be used if you really need to call some
            low level Edje function on this edje object. All the common stuff (setting
            text, emitting signals, hooking callbacks to signals, etc.) can be done
            with proper elementary functions.

            @see elm_layout_signal_callback_add()
            @see elm_layout_signal_emit()
            @see elm_layout_text_set()
            @see elm_layout_content_set()
            @see elm_layout_box_append()
            @see elm_layout_table_pack()
            @see elm_layout_data_get()

            @ingroup Layout */
            return Evas_Object *;
         }
      }
   }
   methods {
      box_remove_all {
         /*@
         Remove all children of the given part box.

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise

         The objects will be removed from the box part and their lifetime will
         not be handled by the layout anymore. This is equivalent to
         elm_layout_box_remove() for all box children.

         @see elm_layout_box_append()
         @see elm_layout_box_remove()

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part; /*@ The box part name to remove child. */
            @in Eina_Bool clear; /*@ If EINA_TRUE, then all objects will be deleted as
            well, otherwise they will just be removed and will be
            dangling on the canvas. */
         }
      }
      part_cursor_engine_only_set {
         /*@
         Sets if the cursor set should be searched on the theme or should use
         the provided by the engine, only.

         @note before you set if should look on theme you should define a
         cursor with elm_layout_part_cursor_set(). By default it will only
         look for cursors provided by the engine.

         @return EINA_TRUE on success or EINA_FALSE on failure, that may be
         part not exists or it did not had a cursor set.

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part_name; /*@ a part from loaded edje group. */
            @in Eina_Bool engine_only; /*@ if cursors should be just provided by the engine (EINA_TRUE)
            or should also search on widget's theme as well (EINA_FALSE) */
         }
      }
      part_cursor_engine_only_get {
         /*@
         Get a specific cursor engine_only for an edje part.

         @return whenever the cursor is just provided by engine or also from theme.

         @ingroup Layout */

         const;
         return Eina_Bool;
         params {
            @in const char *part_name; /*@ a part from loaded edje group. */
         }
      }
      table_unpack {
         /*@
         Unpack (remove) a child of the given part table.

         @return The object that was being used, or NULL if not found.

         The object will be unpacked from the table part and its lifetime
         will not be handled by the layout anymore. This is equivalent to
         elm_layout_content_unset() for table.

         @see elm_layout_table_pack()
         @see elm_layout_table_clear()

         @ingroup Layout */

         return Evas_Object *;
         params {
            @in const char *part; /*@ The table part name to remove child. */
            @in Evas_Object *child; /*@ The object to remove from table. */
         }
      }
      freeze {
         /*@
         @brief Freezes the Elementary layout object.

         @return The frozen state or 0 on Error

         This function puts all changes on hold. Successive freezes will
         nest, requiring an equal number of thaws.

         @see elm_layout_thaw() */

         return int;
      }
      theme_enable {
         /*@ No description supplied by the EAPI. */
         legacy null;
         return Eina_Bool;
      }
      sizing_eval {
         /*@
         Eval sizing

         Manually forces a sizing re-evaluation. This is useful when the minimum
         size required by the edje theme of this layout has changed. The change on
         the minimum size required by the edje theme is not immediately reported to
         the elementary layout, so one needs to call this function in order to tell
         the widget (layout) that it needs to reevaluate its own size.

         The minimum size of the theme is calculated based on minimum size of
         parts, the size of elements inside containers like box and table, etc. All
         of this can change due to state changes, and that's when this function
         should be called.

         Also note that a standard signal of "size,eval" "elm" emitted from the
         edje object will cause this to happen too.

         @ingroup Layout */

      }
      box_remove {
         /*@
         Remove a child of the given part box.

         @return The object that was being used, or NULL if not found.

         The object will be removed from the box part and its lifetime will
         not be handled by the layout anymore. This is equivalent to
         elm_layout_content_unset() for box.

         @see elm_layout_box_append()
         @see elm_layout_box_remove_all()

         @ingroup Layout */

         return Evas_Object *;
         params {
            @in const char *part; /*@ The box part name to remove child. */
            @in Evas_Object *child; /*@ The object to remove from box. */
         }
      }
      sizing_restricted_eval {
         /*@
         Request sizing reevaluation, restricted to current width and/or height

         Useful mostly when there are TEXTBLOCK parts defining the height of the
         object and nothing else restricting it to a minimum width. Calling this
         function will restrict the minimum size in the Edje calculation to whatever
         size it the layout has at the moment.

         @since 1.8

         @ingroup Layout */

         params {
            @in Eina_Bool width; /*@ Restrict minimum size to the current width */
            @in Eina_Bool height; /*@ Restrict minimum size ot the current height */
         }
      }
      part_cursor_style_set {
         /*@
         Sets a specific cursor style for an edje part.

         @return EINA_TRUE on success or EINA_FALSE on failure, that may be
         part not exists or it did not had a cursor set.

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part_name; /*@ a part from loaded edje group. */
            @in const char *style; /*@ the theme style to use (default, transparent, ...) */
         }
      }
      part_cursor_style_get {
         /*@
         Get a specific cursor style for an edje part.

         @return the theme style in use, defaults to "default". If the
         object does not have a cursor set, then NULL is returned.

         @ingroup Layout */

         const;
         return const char *;
         params {
            @in const char *part_name; /*@ a part from loaded edje group. */
         }
      }
      text_set {
         /*@
         Set the text of the given part

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part; /*@ The TEXT part where to set the text */
            @in const char *text; /*@ The text to set */
         }
      }
      text_get {
         /*@
         Get the text set in the given part

         @return The text set in @p part

         @ingroup Layout */

         const;
         return const char *;
         params {
            @in const char *part; /*@ The TEXT part to retrieve the text off */
         }
      }
      signal_callback_add {
         /*@
         Add a callback for a (Edje) signal emitted by a layout widget's
         underlying Edje object.

         This function connects a callback function to a signal emitted by
         the underlying Edje object of @a obj. Globs are accepted in either
         the emission or source strings (see @c
         edje_object_signal_callback_add()).

         @ingroup Layout */

         params {
            @in const char *emission; /*@ The signal's name string */
            @in const char *source; /*@ The signal's source string */
            @in Edje_Signal_Cb func; /*@ The callback function to be executed when the signal is
            emitted. */
            @in void *data; /*@ A pointer to data to pass in to the callback function. */
         }
      }
      part_cursor_set {
         /*@
         Sets a specific cursor for an edje part.

         @return EINA_TRUE on success or EINA_FALSE on failure, that may be
         part not exists or it has "mouse_events: 0".

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part_name; /*@ a part from loaded edje group. */
            @in const char *cursor; /*@ cursor name to use, see Elementary_Cursor.h */
         }
      }
      part_cursor_get {
         /*@
         Get the cursor to be shown when mouse is over an edje part

         @return the cursor name.

         @ingroup Layout */

         const;
         return const char *;
         params {
            @in const char *part_name; /*@ a part from loaded edje group. */
         }
      }
      box_insert_before {
         /*@
         Insert child to layout box part before a reference object.

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise

         Once the object is inserted, it will become child of the layout. Its
         lifetime will be bound to the layout, whenever the layout dies the child
         will be deleted automatically. One should use elm_layout_box_remove() to
         make this layout forget about the object.

         @see elm_layout_box_append()
         @see elm_layout_box_prepend()
         @see elm_layout_box_insert_before()
         @see elm_layout_box_remove()

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part; /*@ the box part to insert. */
            @in Evas_Object *child; /*@ the child object to insert into box. */
            @in const Evas_Object *reference; /*@ another reference object to insert before in box. */
         }
      }
      box_insert_at {
         /*@
         Insert child to layout box part at a given position.

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise

         Once the object is inserted, it will become child of the layout. Its
         lifetime will be bound to the layout, whenever the layout dies the child
         will be deleted automatically. One should use elm_layout_box_remove() to
         make this layout forget about the object.

         @see elm_layout_box_append()
         @see elm_layout_box_prepend()
         @see elm_layout_box_insert_before()
         @see elm_layout_box_remove()

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part; /*@ the box part to insert. */
            @in Evas_Object *child; /*@ the child object to insert into box. */
            @in unsigned int pos; /*@ the numeric position >=0 to insert the child. */
         }
      }
      sub_object_add_enable {
         /*@ No description supplied by the EAPI. */
         legacy null;
         return Eina_Bool;
      }
      data_get {
         /*@
         Get the edje data from the given layout

         @return The edje data string

         This function fetches data specified inside the edje theme of this layout.
         This function return NULL if data is not found.

         In EDC this comes from a data block within the group block that @p
         obj was loaded from. E.g.

         @code
         collections {
         group {
         name: "a_group";
         data {
         item: "key1" "value1";
         item: "key2" "value2";
         }
         }
         }
         @endcode

         @ingroup Layout */

         const;
         return const char *;
         params {
            @in const char *key; /*@ The data key */
         }
      }
      box_append {
         /*@
         Append child to layout box part.

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise

         Once the object is appended, it will become child of the layout. Its
         lifetime will be bound to the layout, whenever the layout dies the child
         will be deleted automatically. One should use elm_layout_box_remove() to
         make this layout forget about the object.

         @see elm_layout_box_prepend()
         @see elm_layout_box_insert_before()
         @see elm_layout_box_insert_at()
         @see elm_layout_box_remove()

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part; /*@ the box part to which the object will be appended. */
            @in Evas_Object *child; /*@ the child object to append to box. */
         }
      }
      signal_callback_del {
         /*@
         Remove a signal-triggered callback from a given layout widget.

         @return The data pointer of the signal callback (passed on
         elm_layout_signal_callback_add()) or @c NULL, on errors.

         This function removes the @b last callback attached to a signal
         emitted by the undelying Edje object of @a obj, with parameters @a
         emission, @a source and @c func matching exactly those passed to a
         previous call to elm_layout_signal_callback_add(). The data pointer
         that was passed to this call will be returned.

         @ingroup Layout */

         return void *;
         params {
            @in const char *emission; /*@ The signal's name string */
            @in const char *source; /*@ The signal's source string */
            @in Edje_Signal_Cb func; /*@ The callback function being executed when the signal
            was emitted. */
         }
      }
      thaw {
         /*@
         @brief Thaws the Elementary object.

         @return The frozen state or 0 if the object is not frozen or on error.

         This function thaws the given Edje object and the Elementary sizing calc.

         @note: If sucessives freezes were done, an equal number of
         thaws will be required.

         @see elm_layout_freeze() */

         return int;
      }
      box_prepend {
         /*@
         Prepend child to layout box part.

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise

         Once the object is prepended, it will become child of the layout. Its
         lifetime will be bound to the layout, whenever the layout dies the child
         will be deleted automatically. One should use elm_layout_box_remove() to
         make this layout forget about the object.

         @see elm_layout_box_append()
         @see elm_layout_box_insert_before()
         @see elm_layout_box_insert_at()
         @see elm_layout_box_remove()

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part; /*@ the box part to prepend. */
            @in Evas_Object *child; /*@ the child object to prepend to box. */
         }
      }
      signal_emit {
         /*@
         Send a (Edje) signal to a given layout widget's underlying Edje
         object.

         This function sends a signal to the underlying Edje object of @a
         obj. An Edje program on that Edje object's definition can respond
         to a signal by specifying matching 'signal' and 'source' fields.

         @ingroup Layout */

         params {
            @in const char *emission; /*@ The signal's name string */
            @in const char *source; /*@ The signal's source string */
         }
      }
      table_pack {
         /*@
         Insert child to layout table part.

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise

         Once the object is inserted, it will become child of the table. Its
         lifetime will be bound to the layout, and whenever the layout dies the
         child will be deleted automatically. One should use
         elm_layout_table_unpack() to make this layout forget about the object.

         If @p colspan or @p rowspan are bigger than 1, that object will occupy
         more space than a single cell. For instance, the following code:
         @code
         elm_layout_table_pack(layout, "table_part", child, 0, 1, 3, 1);
         @endcode

         Would result in an object being added like the following picture:

         @image html layout_colspan.png
         @image latex layout_colspan.eps width=\textwidth

         @see elm_layout_table_unpack()
         @see elm_layout_table_clear()

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part; /*@ the box part to pack child. */
            @in Evas_Object *child; /*@ the child object to pack into table. */
            @in unsigned short col; /*@ the column to which the child should be added. (>= 0) */
            @in unsigned short row; /*@ the row to which the child should be added. (>= 0) */
            @in unsigned short colspan; /*@ how many columns should be used to store this object. (>=
            1) */
            @in unsigned short rowspan; /*@ how many rows should be used to store this object. (>= 1) */
         }
      }
      part_cursor_unset {
         /*@
         Unsets a cursor previously set with elm_layout_part_cursor_set().

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part_name; /*@ a part from loaded edje group, that had a cursor set
            with elm_layout_part_cursor_set(). */
         }
      }
      table_clear {
         /*@
         Remove all the child objects of the given part table.

         @return @c EINA_TRUE on success, @c EINA_FALSE otherwise

         The objects will be removed from the table part and their lifetime will
         not be handled by the layout anymore. This is equivalent to
         elm_layout_table_unpack() for all table children.

         @see elm_layout_table_pack()
         @see elm_layout_table_unpack()

         @ingroup Layout */

         return Eina_Bool;
         params {
            @in const char *part; /*@ The table part name to remove child. */
            @in Eina_Bool clear; /*@ If EINA_TRUE, then all objects will be deleted as
            well, otherwise they will just be removed and will be
            dangling on the canvas. */
         }
      }
   }
   implements {
      class.constructor;
      Eo_Base.constructor;
      Eo_Base.dbg_info_get;
      Evas_Object_Smart.del;
      Evas_Object_Smart.add;
      Evas_Object_Smart.calculate;
      Elm_Widget.focus_direction;
      Elm_Widget.sub_object_add;
      Elm_Widget.theme_apply;
      Elm_Widget.focus_direction_manager_is;
      Elm_Widget.focus_next_manager_is;
      Elm_Widget.focus_next;
      Elm_Widget.disable;
      Elm_Widget.sub_object_del;
      Elm_Widget.on_focus;
      Elm_Container.content_get;
      Elm_Container.content_set;
      Elm_Container.content_unset;
      Elm_Container.content_swallow_list.get;
   }
   events {
      theme,changed;
      focused;
      unfocused;
      language,changed;
      access,changed;
   }

}