2e11dc030aa2b98adf7a99231fb1262bbc85305e
[framework/uifw/elementary.git] / src / lib / elm_gen_common.h
1 #ifndef ELM_GEN_H_
2 #define ELM_GEN_H_
3
4 #include <Elementary.h>
5 #include <Elementary_Cursor.h>
6
7 #define ELM_GEN_ITEM_FROM_INLIST(it) \
8   ((it) ? EINA_INLIST_CONTAINER_GET(it, Elm_Gen_Item) : NULL)
9
10 #define SWIPE_MOVES 12
11
12 /* common item handles for genlist/gengrid */
13
14 typedef struct Elm_Gen_Item_Type    Elm_Gen_Item_Type;
15 typedef struct Elm_Gen_Item_Tooltip Elm_Gen_Item_Tooltip;
16
17 struct Elm_Gen_Item_Tooltip
18 {
19    const void                 *data;
20    Elm_Tooltip_Item_Content_Cb content_cb;
21    Evas_Smart_Cb               del_cb;
22    const char                 *style;
23    Eina_Bool                   free_size : 1;
24 };
25
26 struct Elm_Gen_Item
27 {
28    Elm_Widget_Item_Data     *base;
29    EINA_INLIST;
30
31    Elm_Gen_Item_Type        *item;
32    const Elm_Gen_Item_Class *itc;
33    Evas_Coord                x, y, dx, dy;
34    Evas_Object              *spacer, *deco_all_view;
35    Elm_Gen_Item             *parent;
36    Eina_List                *texts, *contents, *states, *content_objs;
37    Ecore_Timer              *long_timer;
38    int                       walking;
39    int                       generation; /**< a generation of an item. when the item is created, this value is set to the value of genlist generation. this value will be decreased when the item is going to be deleted */
40    const char               *mouse_cursor;
41    Eina_List                *item_focus_chain;
42
43    struct
44    {
45       Evas_Smart_Cb func;
46       const void   *data;
47    } func;
48
49    Elm_Gen_Item_Tooltip      tooltip;
50    Ecore_Cb                  del_cb, unrealize_cb;
51    Ecore_Cb                  sel_cb, unsel_cb;
52    Ecore_Cb                  highlight_cb, unhighlight_cb;
53
54    int                       position;
55    Elm_Object_Select_Mode    select_mode;
56
57    Eina_Bool                 position_update : 1;
58    Eina_Bool                 want_unrealize : 1;
59    Eina_Bool                 realized : 1;
60    Eina_Bool                 selected : 1;
61    Eina_Bool                 highlighted : 1;
62    Eina_Bool                 dragging : 1; /**< this is set true when an item is being dragged. this is set false on multidown/mouseup/mousedown. when this is true, the item should not be unrealized. or evas mouse down/up event will be corrupted. */
63    Eina_Bool                 down : 1;
64    Eina_Bool                 group : 1;
65    Eina_Bool                 reorder : 1;
66    Eina_Bool                 decorate_it_set : 1; /**< item uses style mode for highlight/select */
67    Eina_Bool                 flipped : 1; /**< a flag that shows the flip status of the item. */
68    Eina_Bool                 hide : 1;
69    Eina_Bool                 has_contents : 1; /**< content objs have or previously did exist (size calcs) */
70    Eina_Bool                 cursor_engine_only : 1;
71 };
72
73 #endif