summaryrefslogtreecommitdiff
path: root/src/lib/elm_genlist_item.eo
blob: a3cb674d71d7ec9ba15bea8632616b3a08a790fd (plain) (blame)
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
import elm_general;

enum Elm.Genlist.Item.Type
{
   [[Defines if the item is of any special type (has subitems or it's the
     index of a group), or is just a simple item.
   ]]
   legacy: elm_genlist_item;
   none = 0, [[Simple item.]]
   tree = (1 << 0), [[This may be expanded and have child items.]]
   group = (1 << 1), [[An index item of a group of items. this item can have child items.]]
   max = (1 << 2)
}

enum Elm.Genlist.Item.Field_Type
{
   [[Defines the type of the item part
     Used while updating item's parts
     It can be used at updating multi fields.
   ]]
   legacy: elm_genlist_item_field;
   all = 0,
   text = (1 << 0),
   content = (1 << 1),
   state = (1 << 2)
}

enum Elm.Genlist.Item.Scrollto_Type
{
   [[Defines where to position the item in the genlist.]]
   legacy: elm_genlist_item_scrollto;
   none = 0,   [[No scrollto.]]
   in = (1 << 0),   [[To the nearest viewport.]]
   top = (1 << 1),   [[To the top of viewport.]]
   middle = (1 << 2)   [[To the middle of viewport.]]
}

class Elm.Genlist_Item(Elm.Widget_Item)
{
      eo_prefix: elm_obj_genlist_item;
      data: Elm_Gen_Item;
      methods {
           @property prev {
                get {
                     /*@
                      Get the @b previous item in a genlist widget's internal list of items,
                      given a handle to one of those items.

                      This returns the item placed before the @p item, on the container
                      genlist.

                      @see elm_genlist_item_next_get()

                      @ingroup Genlist
                      */
                }
                values {
                     item: Elm_Object_Item *; /*@ @return The item before @p item, or @c NULL if there's none (and on errors) */
                }
           }
           @property next {
                get {
                     /*@
                      Get the @b next item in a genlist widget's internal list of items,
                      given a handle to one of those items.

                      This returns the item placed after the @p item, on the container
                      genlist.

                      @see elm_genlist_item_prev_get()

                      @ingroup Genlist
                      */
                }
                values {
                     item: Elm_Object_Item *; /*@ @return The item after @p item, or @c NULL if there's none (and on errors) */
                }
           }
           @property parent {
                get {
                     /*@
                      Get the parent item of the given item

                      This returns the item that was specified as parent of the item @p it on
                      elm_genlist_item_append() and insertion related functions.

                      @ingroup Genlist
                      */
                }
                values {
                     item: Elm_Object_Item *; /*@ @return The parent of the item or @c NULL if it has no parent. */
                }
           }
           @property subitems {
                get {
                     /*@
                      Get the list of subitems of a given item

                      This returns the list of subitems that an item possesses. It cannot be changed.

                      @since 1.9
                      @ingroup Genlist
                      */
                }
                values {
                     subitems: const (list<Elm_Object_Item *>) *; /*@ @return The list of subitems, @c NULL on error */
                }
           }
           @property selected {
                get {
                     /*@
                      Get whether a given genlist item is selected or not

                      @return @c EINA_TRUE, if it's selected, @c EINA_FALSE otherwise

                      @see elm_genlist_item_selected_set() for more details

                      @ingroup Genlist
                      */
                }
                set {
                     /*@
                      Set whether a given genlist item is selected or not

                      Use @c EINA_TRUE, to make it selected, @c EINA_FALSE to make it unselected

                      This sets the selected state of an item. If multi selection is
                      not enabled on the containing genlist and @p selected is @c
                      EINA_TRUE, any other previously selected items will get
                      unselected in favor of this new one.

                      @see elm_genlist_item_selected_get()

                      @ingroup Genlist
                      */
                }
                values {
                     selected: bool; /*@ the selected state (@c EINA_TRUE selected, @c EINA_FALSE not selected) */
                }
           }
           @property expanded {
                get {
                     /*@
                      Get the expanded state of an item

                      This gets the expanded state of an item.

                      @see elm_genlist_item_expanded_set()

                      @ingroup Genlist
                      */
                }
                set {
                     /*@
                      Sets the expanded state of an item.

                      This function flags the item of type #ELM_GENLIST_ITEM_TREE as
                      expanded or not.

                      The theme will respond to this change visually, and a signal "expanded" or
                      "contracted" will be sent from the genlist with a pointer to the item that
                      has been expanded/contracted.

                      Calling this function won't show or hide any child of this item (if it is
                      a parent). You must manually delete and create them on the callbacks of
                      the "expanded" or "contracted" signals.

                      @see elm_genlist_item_expanded_get()

                      @ingroup Genlist
                      */
                }
                values {
                     expanded: bool; /*@ The expanded state (@c EINA_TRUE expanded, @c EINA_FALSE not expanded). */
                }
           }
           @property expanded_depth {
                get {
                     /*@
                      Get the depth of expanded item

                      @ingroup Genlist
                      */
                }
                values {
                     depth: int; /*@ @return The depth of expanded item */
                }
           }
           @property item_class {
                get {
                     /*@
                      Get the Genlist Item class for the given Genlist Item.

                      This returns the Genlist_Item_Class for the given item. It can be used to
                      examine the function pointers and item_style.

                      @ingroup Genlist
                      */
                }
                values {
                     itc: const (Elm_Genlist_Item_Class) *; /*@ Genlist Item class for the given item */
                }
           }
           @property index {
                get {
                     /*@
                      Get the index of the item. It is only valid once displayed.

                      The index start from 0.

                      @ingroup Genlist
                      */
                }
                values {
                     index: int(-1); /*@ @return the position inside the list of item. */
                }
           }
           @property decorate_mode {
                get {
                     /*@
                      Get the item's decorate mode.

                      This function just returns the name of the item's decorate mode.

                      @see elm_genlist_item_decorate_mode_set()
                      @see elm_genlist_decorated_item_get()

                      @ingroup Genlist
                      */
                }
                values {
                     decorate_it_type: const(char)*; /*@ name of the item's decorate mode. */
                }
           }
           @property flip {
                get {
                     /*@
                      Get the flip state of a given genlist item.

                      This function returns the flip state of a given genlist item.
                      If the parameter is invalid, it returns @c EINA_FALSE.

                      @see elm_genlist_item_flip_set()

                      @ingroup Genlist
                      */
                }
                set {
                     /*@
                      Set the flip state of a given genlist item.

                      (@c EINA_TRUE = on, @c EINA_FALSE = off)

                      This function sets the flip state of a given genlist item.
                      Flip mode overrides current item object.
                      It can be used for on-the-fly item replace.
                      Flip mode can be used with/without decorate mode.

                      @see elm_genlist_item_flip_get()

                      @ingroup Genlist
                      */
                }
                values {
                     flip: bool; /*@ The flip mode */
                }
           }
           @property select_mode {
                get {
                     /*@
                      Get the genlist item's select mode.

                      @return The select mode
                      (If getting mode fails, it returns ELM_OBJECT_SELECT_MODE_MAX)

                      @see elm_genlist_item_select_mode_set()

                      @ingroup Genlist
                      */
                }
                set {
                     /*@
                      Set the genlist item's select mode.

                      elm_genlist_select_mode_set() changes item's select mode.
                      - ELM_OBJECT_SELECT_MODE_DEFAULT : The item will only call their selection func and
                           callback when first becoming selected. Any further clicks will
                           do nothing, unless you set always select mode.
                      - ELM_OBJECT_SELECT_MODE_ALWAYS : This means that, even if selected,
                           every click will make the selected callbacks be called.
                      - ELM_OBJECT_SELECT_MODE_NONE : This will turn off the ability to select the item
                           entirely and they will neither appear selected nor call selected
                           callback functions.
                      - ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY : This will apply no-finger-size rule
                           with ELM_OBJECT_SELECT_MODE_NONE. No-finger-size rule makes an item can be
                           smaller than lower limit. Clickable objects should be bigger than
                           human touch point device (your finger) for some touch or
                           small screen devices. So it is enabled, the item can be shrink than
                           predefined finger-size value. And the item will be updated.

                      @see elm_genlist_item_select_mode_get()

                      @ingroup Genlist
                      */
                }
                values {
                     mode: Elm.Object.Select_Mode(Elm.Object.Select_Mode.max); /*@ The selected mode */
                }
           }
           @property type {
                get {
                     /*@
                      Get the Item's Type

                      @return The item type.

                      This function returns the item's type. Normally the item's type.
                      If it failed, return value is ELM_GENLIST_ITEM_MAX

                      @ingroup Genlist
                      */
                }
                values {
                     type: Elm.Genlist.Item.Type(Elm.Genlist.Item.Type.max); /*@ Item type */
                }
           }
           /*      init { FIXME
                   params {
                   Evas_Smart_Cb func;
                   const(void)* data;
                   }
                   }*/
           subitems_count {
                /*@
                 Get the number of subitems of a given item

                 This returns the number of subitems that an item possesses.

                 @since 1.9
                 @ingroup Genlist
                 */
                return: uint; /*@ The number of subitems, 0 on error */
           }
           subitems_clear{
                /*@
                 Remove all sub-items (children) of the given item

                 @param it The item

                 This removes all items that are children (and their descendants) of the
                 given item @p it.

                 @see elm_genlist_clear()
                 @see elm_object_item_del()

                 @ingroup Genlist
                 */
           }
           promote {
                /*@
                 Promote an item to the top of the list

                 @param it The item

                 @ingroup Genlist
                 */
           }
           demote {
                /*@
                 Demote an item to the end of the list

                 @param it The item

                 @ingroup Genlist
                 */
           }
           show {
                /*@
                 Show the portion of a genlist's internal list containing a given
                 item, immediately.

                 This causes genlist to jump to the given item @p it and show it (by
                 jumping to that position), if it is not fully visible.

                 @see elm_genlist_item_bring_in()

                 @ingroup Genlist
                 */
                params {
                     @in type: Elm.Genlist.Item.Scrollto_Type; /*@ The position to bring in, the given item to.
                                                                @ref Elm_Genlist_Item_Scrollto_Type */
                }
           }
           bring_in {
                /*@
                 Animatedly bring in, to the visible area of a genlist, a given
                 item on it.

                 This causes genlist to jump to the given item @p it and show it (by
                 animatedly scrolling), if it is not fully visible.
                 This may use animation and take a some time to do so.

                 @see elm_genlist_item_show()

                 @ingroup Genlist
                 */
                params {
                     @in type: Elm.Genlist.Item.Scrollto_Type; /*@ The position to bring in, the given item to.
                                                                @ref Elm_Genlist_Item_Scrollto_Type */
                }
           }
           all_contents_unset{
                /*@
                 Unset all contents fetched by the item class

                 This instructs genlist to release references to contents in the item,
                 meaning that they will no longer be managed by genlist and are
                 floating "orphans" that can be re-used elsewhere if the user wants
                 to.

                 @ingroup Genlist
                 */
                params {
                     @out l: own(list<own(Evas.Object *)> *); /*@ The contents list to return */
                }
           }
           update {
                /*@
                 Update all the contents of an item

                 This updates an item by calling all the item class functions again
                 to get the contents, texts and states. Use this when the original
                 item data has changed and the changes are desired to be reflected.

                 Use elm_genlist_realized_items_update() to update all already realized
                 items.

                 @note This also updates internal genlist item object(edje_object as of now).
                 So when this is called between mouse down and mouse up, mouse up event will
                 be ignored because edje_object is deleted and created again by this API. If
                 you want to avoid this, please use @ref elm_genlist_item_fields_update.

                 @see elm_genlist_realized_items_update()

                 @ingroup Genlist
                 */
           }
           fields_update {
                /*@
                 Update the part of an item

                 This updates an item's part by calling item's fetching functions again
                 to get the contents, texts and states. Use this when the original
                 item data has changed and the changes are desired to be reflected.
                 Second parts argument is used for globbing to match '*', '?', and '.'
                 It can be used at updating multi fields.

                 Use elm_genlist_realized_items_update() to update an item's all
                 property.

                 @see elm_genlist_item_update()

                 @ingroup Genlist
                 */
                params {
                     @in parts: const (char) *; /*@ The name of item's part */
                     @in itf: Elm.Genlist.Item.Field_Type; /*@ The type of item's part type */
                }
           }
           item_class_update {
                /*@
                 Update the item class of an item

                 This sets another class of the item, changing the way that it is
                 displayed. After changing the item class, elm_genlist_item_update() is
                 called on the item @p it.

                 @ingroup Genlist
                 */
                params {
                     @in itc: const (Elm_Genlist_Item_Class) *; /*@ The item class for the item */
                }
           }
           decorate_mode_set {
                /*@
                 Activate a genlist mode on an item

                 A genlist mode is a different way of selecting an item. Once a mode is
                 activated on an item, any other selected item is immediately unselected.
                 This feature provides an easy way of implementing a new kind of animation
                 for selecting an item, without having to entirely rewrite the item style
                 theme. However, the elm_genlist_selected_* API can't be used to get what
                 item is activate for a mode.

                 The current item style will still be used, but applying a genlist mode to
                 an item will select it using a different kind of animation.

                 The current active item for a mode can be found by
                 elm_genlist_decorated_item_get().

                 The characteristics of genlist mode are:
                 - Only one mode can be active at any time, and for only one item.
                 - Genlist handles deactivating other items when one item is activated.
                 - A mode is defined in the genlist theme (edc), and more modes can easily
                   be added.
                 - A mode style and the genlist item style are different things. They
                   can be combined to provide a default style to the item, with some kind
                   of animation for that item when the mode is activated.

                 When a mode is activated on an item, a new view for that item is created.
                 The theme of this mode defines the animation that will be used to transit
                 the item from the old view to the new view. This second (new) view will be
                 active for that item while the mode is active on the item, and will be
                 destroyed after the mode is totally deactivated from that item.

                 @see elm_genlist_mode_get()
                 @see elm_genlist_decorated_item_get()

                 @ingroup Genlist
                 */
                params {
                     @in decorate_it_type: const(char)*; /*@ Mode name */
                     @in decorate_it_set: bool; /*@ Boolean to define set or unset mode. */
                }
           }
      }
      implements {
           Eo.Base.constructor;
           Elm.Widget_Item.del_pre;
           Elm.Widget_Item.disable;
           Elm.Widget_Item.signal_emit;
           Elm.Widget_Item.focus.set;
           Elm.Widget_Item.focus.get;
           Elm.Widget_Item.part_text.get;
           Elm.Widget_Item.part_content.get;
           Elm.Widget_Item.tooltip_text_set;
           Elm.Widget_Item.tooltip_style.set;
           Elm.Widget_Item.tooltip_style.get;
           Elm.Widget_Item.tooltip_window_mode.set;
           Elm.Widget_Item.tooltip_window_mode.get;
           Elm.Widget_Item.tooltip_content_cb_set;
           Elm.Widget_Item.tooltip_unset;
           Elm.Widget_Item.cursor.set;
           Elm.Widget_Item.cursor_unset;
           Elm_Interface_Atspi_Accessible.name.get;
           Elm_Interface_Atspi_Accessible.state_set.get;
           Elm_Interface_Atspi_Accessible.children.get;
      }
}