1 /* Type definitions for elementary generic items (genlist, gengrid, ...). 2 * Only for legacy. 3 */ 4 5 #ifndef EFL_NOLEGACY_API_SUPPORT 6 7 typedef struct Elm_Gen_Item Elm_Gen_Item; 8 9 /** Glob matching bitfiled flags. 10 * 11 * @since 1.11 12 * 13 * @ingroup Elm_Glob 14 */ 15 typedef enum 16 { 17 ELM_GLOB_MATCH_NO_ESCAPE = 1 /* 1 >> 0 */, /**< Treat backslash as an ordinary 18 * character instead of escape */ 19 ELM_GLOB_MATCH_PATH = 2 /* 1 >> 1 */, /**< Match a slash in string only with a 20 * slash in pattern and not by an 21 * asterisk (*) or a question mark (?) 22 * metacharacter, nor by a bracket 23 * expression ([]) containing a slash. 24 */ 25 ELM_GLOB_MATCH_PERIOD = 4 /* 1 >> 2 */, /**< Leading period in string has to 26 * be matched exactly by a period in 27 * pattern. A period is considered to 28 * be leading if it is the first 29 * character in string, or if both 30 * ELM_GLOB_MATCH_PATH is set and the 31 * period immediately follows a 32 * slash. */ 33 ELM_GLOB_MATCH_NOCASE = 8 /* 1 >> 3 */ /**< The pattern is matched 34 * case-insensitively. */ 35 } Elm_Glob_Match_Flags; 36 37 /** 38 * Text fetching class function for Elm_Gen_Item_Class. 39 * @param data The data passed in the item creation function 40 * @param obj The base widget object 41 * @param part The part name of the swallow 42 * @return The allocated (NOT stringshared) string to set as the text 43 */ 44 typedef char *(*Elm_Gen_Item_Text_Get_Cb)(void *data, Evas_Object *obj, const char *part); /**< Label fetching class function for gen item classes. */ 45 46 /** 47 * Content (swallowed object) fetching class function for Elm_Gen_Item_Class. 48 * @param data The data passed in the item creation function 49 * @param obj The base widget object 50 * @param part The part name of the swallow 51 * @return The content object to swallow 52 */ 53 typedef Evas_Object *(*Elm_Gen_Item_Content_Get_Cb)(void *data, Evas_Object *obj, const char *part); /**< Content(swallowed object) fetching class function for gen item classes. */ 54 55 /** 56 * State fetching class function for Elm_Gen_Item_Class. 57 * @param data The data passed in the item creation function 58 * @param obj The base widget object 59 * @param part The part name of the swallow 60 * @return The boolean state of this element (resulting in the edje object being emitted a signal of "elm,state,partname,active" or "elm.state,partname,passve" 61 */ 62 typedef Eina_Bool (*Elm_Gen_Item_State_Get_Cb)(void *data, Evas_Object *obj, const char *part); /**< State fetching class function for gen item classes. */ 63 64 /** 65 * Deletion class function for Elm_Gen_Item_Class. 66 * @param data The data passed in the item creation function 67 * @param obj The base widget object 68 */ 69 typedef void (*Elm_Gen_Item_Del_Cb)(void *data, Evas_Object *obj); /**< Deletion class function for gen item classes. */ 70 71 /** 72 * Filter class function for Elm_Gen_Item_Class. 73 * @param data The data passed in the item creation function 74 * @param obj The base widget object 75 * @param key The key needed for item filter to be decided on 76 * @return The boolean state of filter for this element 77 */ 78 typedef Eina_Bool (*Elm_Gen_Item_Filter_Get_Cb)(void *data, Evas_Object *obj, void *key); /**< Filter seeking class function for gen item classes. */ 79 80 /** 81 * Reusable content get class function for Elm_Gen_Item_Class. 82 * @param data The data passed in the item creation function 83 * @param obj The base widget object 84 * @param part The part name of the swallow 85 * @param old The old content object for reusing 86 * @return The content object to swallow 87 * 88 * @since 1.18 89 */ 90 typedef Evas_Object *(*Elm_Gen_Item_Reusable_Content_Get_Cb)(void *data, Evas_Object *obj, const char *part, Evas_Object *old); /**< Cache Pop class function for gen item classes. */ 91 92 #define ELM_GEN_ITEM_CLASS_VERSION 4 93 #define ELM_GEN_ITEM_CLASS_HEADER ELM_GEN_ITEM_CLASS_VERSION, 0, 0 94 95 96 /** Elementary genlist/gengrid callback functions data structure */ 97 typedef struct _Elm_Gen_Item_Class_Functions 98 { 99 Elm_Gen_Item_Text_Get_Cb text_get; /**< Text fetching class function for genlist/gengrid item classes. */ 100 Elm_Gen_Item_Content_Get_Cb content_get; /**< Content fetching class function for genlist/gengrid item classes. */ 101 Elm_Gen_Item_State_Get_Cb state_get; /**< State fetching class function for genlist/gengrid item classes. */ 102 Elm_Gen_Item_Del_Cb del; /**< Deletion class function for genlist/gengrid item classes. */ 103 Elm_Gen_Item_Filter_Get_Cb filter_get; /**< Filter seeking class function for genlist/gengrid item classes. */ 104 Elm_Gen_Item_Reusable_Content_Get_Cb reusable_content_get; /**< Reusable content get class function for gen item classes. */ 105 } Elm_Gen_Item_Class_Functions; 106 107 /** Gengrid or Genlist item class definition. */ 108 typedef struct _Elm_Gen_Item_Class 109 { 110 int version; /**< Set by elementary if you alloc an item class using 111 * elm_genlist/gengrid_item_class_new(), or if you set your own 112 * class (must be const) then set it to 113 * ELM_GENLIST/GENGRID_ITEM_CLASS_VERSION. */ 114 unsigned int refcount; /**< Set it to 0 if you use your own const class, or 115 * its managed for you by class ref/unref calls. */ 116 Eina_Bool delete_me; /**< Leave this alone - set it to 0 if you have a const 117 * class of your own. */ 118 const char *item_style; /**< Name of the visual style to use for this item. If 119 * you don't know use "default". */ 120 const char *decorate_item_style; /**< Style used if item is set to a decorate 121 * mode. see elm_genlist_item_decorate_mode_set() or 122 * NULL if you don't care. currently it's used only in genlist. */ 123 const char *decorate_all_item_style; /**< Style to use when in edit mode, or 124 * NULL if you don't care. Currently 125 * it's used only in genlist. */ 126 Elm_Gen_Item_Class_Functions func; /**< Set of callbacks */ 127 } Elm_Gen_Item_Class; 128 129 /** See @ref Elm_Gen_Item_Class. */ 130 typedef Elm_Gen_Item_Class Elm_Gengrid_Item_Class; 131 132 /** See @ref Elm_Gen_Item_Class. */ 133 typedef Elm_Gen_Item_Class Elm_Genlist_Item_Class; 134 135 #endif 136