2 typedef struct _Elm_Store Elm_Store;
3 typedef struct _Elm_Store_Filesystem Elm_Store_Filesystem;
4 typedef struct _Elm_Store_Item Elm_Store_Item;
5 typedef struct _Elm_Store_Item_Filesystem Elm_Store_Item_Filesystem;
6 typedef struct _Elm_Store_Item_Info Elm_Store_Item_Info;
7 typedef struct _Elm_Store_Item_Info_Filesystem Elm_Store_Item_Info_Filesystem;
8 typedef struct _Elm_Store_Item_Mapping Elm_Store_Item_Mapping;
9 typedef struct _Elm_Store_Item_Mapping_Empty Elm_Store_Item_Mapping_Empty;
10 typedef struct _Elm_Store_Item_Mapping_Icon Elm_Store_Item_Mapping_Icon;
11 typedef struct _Elm_Store_Item_Mapping_Photo Elm_Store_Item_Mapping_Photo;
12 typedef struct _Elm_Store_Item_Mapping_Custom Elm_Store_Item_Mapping_Custom;
14 typedef Eina_Bool (*Elm_Store_Item_List_Cb)(void *data, Elm_Store_Item_Info *info);
15 typedef void (*Elm_Store_Item_Fetch_Cb)(void *data, Elm_Store_Item *sti);
16 typedef void (*Elm_Store_Item_Unfetch_Cb)(void *data, Elm_Store_Item *sti);
17 typedef void *(*Elm_Store_Item_Mapping_Cb)(void *data, Elm_Store_Item *sti, const char *part);
21 ELM_STORE_ITEM_MAPPING_NONE = 0,
22 ELM_STORE_ITEM_MAPPING_LABEL, // const char * -> label
23 ELM_STORE_ITEM_MAPPING_STATE, // Eina_Bool -> state
24 ELM_STORE_ITEM_MAPPING_ICON, // char * -> icon path
25 ELM_STORE_ITEM_MAPPING_PHOTO, // char * -> photo path
26 ELM_STORE_ITEM_MAPPING_CUSTOM, // item->custom(it->data, it, part) -> void * (-> any)
27 // can add more here as needed by common apps
28 ELM_STORE_ITEM_MAPPING_LAST
29 } Elm_Store_Item_Mapping_Type;
31 struct _Elm_Store_Item_Mapping_Icon
33 // FIXME: allow edje file icons
35 Elm_Icon_Lookup_Order lookup_order;
36 Eina_Bool standard_name : 1;
37 Eina_Bool no_scale : 1;
39 Eina_Bool scale_up : 1;
40 Eina_Bool scale_down : 1;
43 struct _Elm_Store_Item_Mapping_Empty
48 struct _Elm_Store_Item_Mapping_Photo
53 struct _Elm_Store_Item_Mapping_Custom
55 Elm_Store_Item_Mapping_Cb func;
58 struct _Elm_Store_Item_Mapping
60 Elm_Store_Item_Mapping_Type type;
65 Elm_Store_Item_Mapping_Empty empty;
66 Elm_Store_Item_Mapping_Icon icon;
67 Elm_Store_Item_Mapping_Photo photo;
68 Elm_Store_Item_Mapping_Custom custom;
69 // add more types here
73 struct _Elm_Store_Item_Info
75 Elm_Genlist_Item_Class *item_class;
76 const Elm_Store_Item_Mapping *mapping;
81 struct _Elm_Store_Item_Info_Filesystem
83 Elm_Store_Item_Info base;
87 #define ELM_STORE_ITEM_MAPPING_END { ELM_STORE_ITEM_MAPPING_NONE, NULL, 0, { .empty = { EINA_TRUE } } }
88 #define ELM_STORE_ITEM_MAPPING_OFFSET(st, it) offsetof(st, it)
90 EAPI void elm_store_free(Elm_Store *st);
92 EAPI Elm_Store *elm_store_filesystem_new(void);
93 EAPI void elm_store_filesystem_directory_set(Elm_Store *st, const char *dir);
94 EAPI const char *elm_store_filesystem_directory_get(const Elm_Store *st);
95 EAPI const char *elm_store_item_filesystem_path_get(const Elm_Store_Item *sti);
97 EAPI void elm_store_target_genlist_set(Elm_Store *st, Evas_Object *obj);
99 EAPI void elm_store_cache_set(Elm_Store *st, int max);
100 EAPI int elm_store_cache_get(const Elm_Store *st);
101 EAPI void elm_store_list_func_set(Elm_Store *st, Elm_Store_Item_List_Cb func, const void *data);
102 EAPI void elm_store_fetch_func_set(Elm_Store *st, Elm_Store_Item_Fetch_Cb func, const void *data);
103 EAPI void elm_store_fetch_thread_set(Elm_Store *st, Eina_Bool use_thread);
104 EAPI Eina_Bool elm_store_fetch_thread_get(const Elm_Store *st);
106 EAPI void elm_store_unfetch_func_set(Elm_Store *st, Elm_Store_Item_Unfetch_Cb func, const void *data);
107 EAPI void elm_store_sorted_set(Elm_Store *st, Eina_Bool sorted);
108 EAPI Eina_Bool elm_store_sorted_get(const Elm_Store *st);
109 EAPI void elm_store_item_data_set(Elm_Store_Item *sti, void *data);
110 EAPI void *elm_store_item_data_get(Elm_Store_Item *sti);
111 EAPI const Elm_Store *elm_store_item_store_get(const Elm_Store_Item *sti);
112 EAPI const Elm_Object_Item *elm_store_item_genlist_item_get(const Elm_Store_Item *sti);