1 #ifndef _ELM_BOX_EO_H_ 2 #define _ELM_BOX_EO_H_ 3 4 #ifndef _ELM_BOX_EO_CLASS_TYPE 5 #define _ELM_BOX_EO_CLASS_TYPE 6 7 typedef Eo Elm_Box; 8 9 #endif 10 11 #ifndef _ELM_BOX_EO_TYPES 12 #define _ELM_BOX_EO_TYPES 13 14 15 #endif 16 /** Elementary box class 17 * 18 * @ingroup Elm_Box_Group 19 */ 20 #define ELM_BOX_CLASS elm_box_class_get() 21 22 EWAPI const Efl_Class *elm_box_class_get(void) EINA_CONST; 23 24 /** 25 * @brief Set the box to arrange its children homogeneously 26 * 27 * If enabled, homogeneous layout makes all items the same size, according to 28 * the size of the largest of its children. 29 * 30 * @note This flag is ignored if a custom layout function is set. 31 * 32 * @param[in] obj The object. 33 * @param[in] homogeneous The homogeneous flag 34 * 35 * @ingroup Elm_Box_Group 36 */ 37 EOAPI void elm_obj_box_homogeneous_set(Eo *obj, Eina_Bool homogeneous); 38 39 /** 40 * @brief Get whether the box is using homogeneous mode or not ($true if it's 41 * homogeneous, @c false otherwise) 42 * 43 * @param[in] obj The object. 44 * 45 * @return The homogeneous flag 46 * 47 * @ingroup Elm_Box_Group 48 */ 49 EOAPI Eina_Bool elm_obj_box_homogeneous_get(const Eo *obj); 50 51 /** 52 * @brief Set the alignment of the whole bounding box of contents. 53 * 54 * Sets how the bounding box containing all the elements of the box, after 55 * their sizes and position has been calculated, will be aligned within the 56 * space given for the whole box widget. 57 * 58 * @param[in] obj The object. 59 * @param[in] horizontal The horizontal alignment of elements 60 * @param[in] vertical The vertical alignment of elements 61 * 62 * @ingroup Elm_Box_Group 63 */ 64 EOAPI void elm_obj_box_align_set(Eo *obj, double horizontal, double vertical); 65 66 /** 67 * @brief Get the alignment of the whole bounding box of contents. 68 * 69 * See also @ref elm_obj_box_align_set. 70 * 71 * @param[in] obj The object. 72 * @param[out] horizontal The horizontal alignment of elements 73 * @param[out] vertical The vertical alignment of elements 74 * 75 * @ingroup Elm_Box_Group 76 */ 77 EOAPI void elm_obj_box_align_get(const Eo *obj, double *horizontal, double *vertical); 78 79 /** 80 * @brief Set the horizontal orientation 81 * 82 * By default, box object arranges their contents vertically from top to 83 * bottom. By calling this function with @c horizontal as @c true, the box will 84 * become horizontal, arranging contents from left to right. 85 * 86 * @note This flag is ignored if a custom layout function is set. 87 * 88 * @param[in] obj The object. 89 * @param[in] horizontal The horizontal flag 90 * 91 * @ingroup Elm_Box_Group 92 */ 93 EOAPI void elm_obj_box_horizontal_set(Eo *obj, Eina_Bool horizontal); 94 95 /** 96 * @brief Get the horizontal orientation ($true if the box is set to horizontal 97 * mode, @c false otherwise) 98 * 99 * @param[in] obj The object. 100 * 101 * @return The horizontal flag 102 * 103 * @ingroup Elm_Box_Group 104 */ 105 EOAPI Eina_Bool elm_obj_box_horizontal_get(const Eo *obj); 106 107 /** 108 * @brief Set the space (padding) between the box's elements. 109 * 110 * Extra space in pixels that will be added between a box child and its 111 * neighbors after its containing cell has been calculated. This padding is set 112 * for all elements in the box, besides any possible padding that individual 113 * elements may have through their size hints. 114 * 115 * @param[in] obj The object. 116 * @param[in] horizontal The horizontal space between elements 117 * @param[in] vertical The vertical space between elements 118 * 119 * @ingroup Elm_Box_Group 120 */ 121 EOAPI void elm_obj_box_padding_set(Eo *obj, int horizontal, int vertical); 122 123 /** 124 * @brief Get the space (padding) between the box's elements. 125 * 126 * See also @ref elm_obj_box_padding_set. 127 * 128 * @param[in] obj The object. 129 * @param[out] horizontal The horizontal space between elements 130 * @param[out] vertical The vertical space between elements 131 * 132 * @ingroup Elm_Box_Group 133 */ 134 EOAPI void elm_obj_box_padding_get(const Eo *obj, int *horizontal, int *vertical); 135 136 /** 137 * @brief Get a list of the objects packed into the box 138 * 139 * Returns a new @c list with a pointer to @c Evas_Object in its nodes. The 140 * order of the list corresponds to the packing order the box uses. 141 * 142 * You must free this list with eina_list_free() once you are done with it. 143 * 144 * @param[in] obj The object. 145 * 146 * @return List of children 147 * 148 * @ingroup Elm_Box_Group 149 */ 150 EOAPI Eina_List *elm_obj_box_children_get(const Eo *obj) EINA_WARN_UNUSED_RESULT; 151 152 /** 153 * @brief Add an object at the end of the pack list 154 * 155 * Pack @c subobj into the box @c obj, placing it last in the list of children 156 * objects. The actual position the object will get on screen depends on the 157 * layout used. If no custom layout is set, it will be at the bottom or right, 158 * depending if the box is vertical or horizontal, respectively. 159 * 160 * See also @ref elm_obj_box_pack_start, @ref elm_obj_box_pack_before, 161 * @ref elm_obj_box_pack_after, @ref elm_obj_box_unpack, 162 * @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. 163 * 164 * @param[in] obj The object. 165 * @param[in] subobj The object to add to the box 166 * 167 * @ingroup Elm_Box_Group 168 */ 169 EOAPI void elm_obj_box_pack_end(Eo *obj, Efl_Canvas_Object *subobj); 170 171 /** 172 * @brief Remove all items from the box, without deleting them 173 * 174 * Clear the box from all children, but don't delete the respective objects. If 175 * no other references of the box children exist, the objects will never be 176 * deleted, and thus the application will leak the memory. Make sure when using 177 * this function that you hold a reference to all the objects in the box 178 * @c obj. 179 * 180 * See also @ref elm_obj_box_clear, @ref elm_obj_box_unpack. 181 * @param[in] obj The object. 182 * 183 * @ingroup Elm_Box_Group 184 */ 185 EOAPI void elm_obj_box_unpack_all(Eo *obj); 186 187 /** 188 * @brief Unpack a box item 189 * 190 * Remove the object given by @c subobj from the box @c obj without deleting 191 * it. 192 * 193 * See also @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. 194 * 195 * @param[in] obj The object. 196 * @param[in] subobj The object to unpack 197 * 198 * @ingroup Elm_Box_Group 199 */ 200 EOAPI void elm_obj_box_unpack(Eo *obj, Efl_Canvas_Object *subobj); 201 202 /** 203 * @brief Adds an object to the box after the indicated object 204 * 205 * This will add the @c subobj to the box indicated after the object indicated 206 * with @c after. If @c after is not already in the box, results are undefined. 207 * After means either to the right of the indicated object or below it 208 * depending on orientation. 209 * 210 * See also @ref elm_obj_box_pack_start, @ref elm_obj_box_pack_end, 211 * @ref elm_obj_box_pack_before, @ref elm_obj_box_unpack, 212 * @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. 213 * 214 * @param[in] obj The object. 215 * @param[in] subobj The object to add to the box 216 * @param[in] after The object after which to add it 217 * 218 * @ingroup Elm_Box_Group 219 */ 220 EOAPI void elm_obj_box_pack_after(Eo *obj, Efl_Canvas_Object *subobj, Efl_Canvas_Object *after); 221 222 /** 223 * @brief Add an object to the beginning of the pack list 224 * 225 * Pack @c subobj into the box @c obj, placing it first in the list of children 226 * objects. The actual position the object will get on screen depends on the 227 * layout used. If no custom layout is set, it will be at the top or left, 228 * depending if the box is vertical or horizontal, respectively. 229 * 230 * See also @ref elm_obj_box_pack_end, @ref elm_obj_box_pack_before, 231 * @ref elm_obj_box_pack_after, @ref elm_obj_box_unpack, 232 * @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. 233 * 234 * @param[in] obj The object. 235 * @param[in] subobj The object to add to the box 236 * 237 * @ingroup Elm_Box_Group 238 */ 239 EOAPI void elm_obj_box_pack_start(Eo *obj, Efl_Canvas_Object *subobj); 240 241 /** 242 * @brief Force the box to recalculate its children packing. 243 * 244 * If any children was added or removed, box will not calculate the values 245 * immediately rather leaving it to the next main loop iteration. While this is 246 * great as it would save lots of recalculation, whenever you need to get the 247 * position of a just added item you must force recalculate before doing so. 248 * @param[in] obj The object. 249 * 250 * @ingroup Elm_Box_Group 251 */ 252 EOAPI void elm_obj_box_recalculate(Eo *obj); 253 254 /** 255 * @brief Adds an object to the box before the indicated object 256 * 257 * This will add the @c subobj to the box indicated before the object indicated 258 * with @c before. If @c before is not already in the box, results are 259 * undefined. Before means either to the left of the indicated object or above 260 * it depending on orientation. 261 * 262 * See also @ref elm_obj_box_pack_start, @ref elm_obj_box_pack_end, 263 * @ref elm_obj_box_pack_after, @ref elm_obj_box_unpack, 264 * @ref elm_obj_box_unpack_all, @ref elm_obj_box_clear. 265 * 266 * @param[in] obj The object. 267 * @param[in] subobj The object to add to the box 268 * @param[in] before The object before which to add it 269 * 270 * @ingroup Elm_Box_Group 271 */ 272 EOAPI void elm_obj_box_pack_before(Eo *obj, Efl_Canvas_Object *subobj, Efl_Canvas_Object *before); 273 274 /** 275 * @brief Clear the box of all children 276 * 277 * Remove all the elements contained by the box, deleting the respective 278 * objects. 279 * 280 * See also @ref elm_obj_box_unpack, @ref elm_obj_box_unpack_all. 281 * @param[in] obj The object. 282 * 283 * @ingroup Elm_Box_Group 284 */ 285 EOAPI void elm_obj_box_clear(Eo *obj); 286 287 EWAPI extern const Efl_Event_Description _ELM_BOX_EVENT_CHILD_ADDED; 288 289 /** Called when child was added 290 * @return Efl_Object * 291 * 292 * @ingroup Elm_Box_Group 293 */ 294 #define ELM_BOX_EVENT_CHILD_ADDED (&(_ELM_BOX_EVENT_CHILD_ADDED)) 295 296 EWAPI extern const Efl_Event_Description _ELM_BOX_EVENT_CHILD_REMOVED; 297 298 /** Called when child was removed 299 * @return Efl_Object * 300 * 301 * @ingroup Elm_Box_Group 302 */ 303 #define ELM_BOX_EVENT_CHILD_REMOVED (&(_ELM_BOX_EVENT_CHILD_REMOVED)) 304 305 #endif 306