1 #ifndef _ELM_TOOLBAR_ITEM_EO_LEGACY_H_ 2 #define _ELM_TOOLBAR_ITEM_EO_LEGACY_H_ 3 4 #ifndef _ELM_TOOLBAR_ITEM_EO_CLASS_TYPE 5 #define _ELM_TOOLBAR_ITEM_EO_CLASS_TYPE 6 7 typedef Eo Elm_Toolbar_Item; 8 9 #endif 10 11 #ifndef _ELM_TOOLBAR_ITEM_EO_TYPES 12 #define _ELM_TOOLBAR_ITEM_EO_TYPES 13 14 /** Defines where to position the item in the toolbar. 15 * 16 * @ingroup Elm 17 */ 18 typedef enum 19 { 20 ELM_TOOLBAR_ITEM_SCROLLTO_NONE = 0, /**< no scrollto */ 21 ELM_TOOLBAR_ITEM_SCROLLTO_IN = 1 /* 1 >> 0 */, /**< to the nearest viewport */ 22 ELM_TOOLBAR_ITEM_SCROLLTO_FIRST = 2 /* 1 >> 1 */, /**< to the first of 23 * viewport */ 24 ELM_TOOLBAR_ITEM_SCROLLTO_MIDDLE = 4 /* 1 >> 2 */, /**< to the middle of 25 * viewport */ 26 ELM_TOOLBAR_ITEM_SCROLLTO_LAST = 8 /* 1 >> 3 */ /**< to the last of viewport 27 */ 28 } Elm_Toolbar_Item_Scrollto_Type; 29 30 /** State of a Elm_Toolbar_Item. Can be created with 31 * elm_toolbar_item_state_add() and removed with elm_toolbar_item_state_del(). 32 * 33 * @ingroup Elm 34 */ 35 typedef struct _Elm_Toolbar_Item_State 36 { 37 const char *label; /**< Item label */ 38 const char *icon_str; /**< Item icon string */ 39 Efl_Canvas_Object *icon; /**< Item icon */ 40 Evas_Smart_Cb func; /**< Item callback function */ 41 const void *data; /**< Item data */ 42 } Elm_Toolbar_Item_State; 43 44 45 #endif 46 47 /** 48 * @brief Get the item before this one in the widget's list of items. 49 * 50 * See also @ref elm_toolbar_item_next_get. 51 * 52 * @param[in] obj The object. 53 * 54 * @return The item before the object in its parent's list. If there is no 55 * previous item or in case of error, @c null is returned. 56 * 57 * @ingroup Elm_Toolbar_Item_Group 58 */ 59 EAPI Elm_Widget_Item *elm_toolbar_item_prev_get(const Elm_Toolbar_Item *obj); 60 61 /** 62 * @brief Get the item after this one in the widget's list of items. 63 * 64 * See also @ref elm_toolbar_item_prev_get. 65 * 66 * @param[in] obj The object. 67 * 68 * @return The item after the object in its parent's list. If there is no next 69 * item or in case of error, @c null is returned. 70 * 71 * @ingroup Elm_Toolbar_Item_Group 72 */ 73 EAPI Elm_Widget_Item *elm_toolbar_item_next_get(const Elm_Toolbar_Item *obj); 74 75 /** 76 * @brief Indicates whether this item is currently selected. 77 * 78 * Set the selected state of @c item. 79 * 80 * This sets the selected state of the given item @c it. @c true for selected, 81 * @c false for not selected. 82 * 83 * If a new item is selected the previously selected will be unselected. 84 * Previously selected item can be retrieved with 85 * @ref elm_toolbar_selected_item_get. 86 * 87 * Selected items will be highlighted. 88 * 89 * @param[in] obj The object. 90 * @param[in] selected The selection state. 91 * 92 * @ingroup Elm_Toolbar_Item_Group 93 */ 94 EAPI void elm_toolbar_item_selected_set(Elm_Toolbar_Item *obj, Eina_Bool selected); 95 96 /** 97 * @brief Indicates whether this item is currently selected. 98 * 99 * Get the selected state of this item. 100 * 101 * @param[in] obj The object. 102 * 103 * @return The selection state. 104 * 105 * @ingroup Elm_Toolbar_Item_Group 106 */ 107 EAPI Eina_Bool elm_toolbar_item_selected_get(const Elm_Toolbar_Item *obj); 108 109 /** 110 * @brief Set the priority of a toolbar item. 111 * 112 * This is used only when the toolbar shrink mode is set to 113 * #ELM_TOOLBAR_SHRINK_MENU or #ELM_TOOLBAR_SHRINK_HIDE. When space is less 114 * than required, items with low priority will be removed from the toolbar and 115 * added to a dynamically-created menu, while items with higher priority will 116 * remain on the toolbar, with the same order they were added. 117 * 118 * @param[in] obj The object. 119 * @param[in] priority The @c item priority. The default is zero for set and 0 120 * is returned on failure. 121 * 122 * @ingroup Elm_Toolbar_Item_Group 123 */ 124 EAPI void elm_toolbar_item_priority_set(Elm_Toolbar_Item *obj, int priority); 125 126 /** 127 * @brief Get the priority of a toolbar item. 128 * 129 * @param[in] obj The object. 130 * 131 * @return The @c item priority. The default is zero for set and 0 is returned 132 * on failure. 133 * 134 * @ingroup Elm_Toolbar_Item_Group 135 */ 136 EAPI int elm_toolbar_item_priority_get(const Elm_Toolbar_Item *obj); 137 138 /** 139 * @brief Set the icon associated with @c item. 140 * 141 * Toolbar will load icon image from fdo or current theme. This behavior can be 142 * set by elm_toolbar_icon_order_lookup_set function. If an absolute path is 143 * provided it will load it direct from a file. 144 * 145 * @note This function does not accept relative icon path. 146 * 147 * @param[in] obj The object. 148 * @param[in] icon A string with icon name or the absolute path of an image 149 * file. 150 * 151 * @ingroup Elm_Toolbar_Item_Group 152 */ 153 EAPI void elm_toolbar_item_icon_set(Elm_Toolbar_Item *obj, const char *icon); 154 155 /** 156 * @brief Get the string used to set the icon of @c item. 157 * 158 * @param[in] obj The object. 159 * 160 * @return A string with icon name or the absolute path of an image file. 161 * 162 * @ingroup Elm_Toolbar_Item_Group 163 */ 164 EAPI const char *elm_toolbar_item_icon_get(const Elm_Toolbar_Item *obj); 165 166 /** 167 * @brief Get the real Evas(Edje) object created to implement the view of a 168 * given toolbar @c item. 169 * 170 * @param[in] obj The object. 171 * 172 * @return The base Edje object associated with @c it. 173 * 174 * @ingroup Elm_Toolbar_Item_Group 175 */ 176 EAPI Efl_Canvas_Object *elm_toolbar_item_object_get(const Elm_Toolbar_Item *obj); 177 178 /** 179 * @brief Get the icon object of @c item. 180 * 181 * See also @ref elm_toolbar_item_icon_set, 182 * @ref elm_toolbar_item_icon_file_set, @ref elm_toolbar_item_icon_memfile_set. 183 * 184 * @param[in] obj The object. 185 * 186 * @return The icon object. 187 * 188 * @ingroup Elm_Toolbar_Item_Group 189 */ 190 EAPI Efl_Canvas_Object *elm_toolbar_item_icon_object_get(const Elm_Toolbar_Item *obj); 191 192 /** 193 * @brief Set or unset item as a separator. 194 * 195 * Items aren't set as separator by default. 196 * 197 * If set as separator it will display separator theme, so won't display icons 198 * or label. 199 * 200 * @param[in] obj The object. 201 * @param[in] separator @c true if the item is a separator, @c false otherwise 202 * 203 * @ingroup Elm_Toolbar_Item_Group 204 */ 205 EAPI void elm_toolbar_item_separator_set(Elm_Toolbar_Item *obj, Eina_Bool separator); 206 207 /** 208 * @brief Get a value whether item is a separator or not. 209 * 210 * @param[in] obj The object. 211 * 212 * @return @c true if the item is a separator, @c false otherwise 213 * 214 * @ingroup Elm_Toolbar_Item_Group 215 */ 216 EAPI Eina_Bool elm_toolbar_item_separator_get(const Elm_Toolbar_Item *obj); 217 218 /** 219 * @brief Get toolbar item's menu. 220 * 221 * If @c item wasn't set as menu item with @ref elm_toolbar_item_menu_set, this 222 * function will set it. 223 * 224 * @param[in] obj The object. 225 * 226 * @return Item's menu object or @c null on failure. 227 * 228 * @ingroup Elm_Toolbar_Item_Group 229 */ 230 EAPI Efl_Canvas_Object *elm_toolbar_item_menu_get(const Elm_Toolbar_Item *obj); 231 232 /** 233 * @brief Set @c state as the current state of @c it. 234 * 235 * If @c state is @c NULL, it won't select any state and the default item's 236 * icon and label will be used. It's the behavior as @ref 237 * elm_toolbar_item_state_unset. 238 * 239 * @param[in] obj The object. 240 * @param[in] state Item state 241 * 242 * @return @c true on success, @c false otherwise 243 * 244 * @ingroup Elm_Toolbar_Item_Group 245 */ 246 EAPI Eina_Bool elm_toolbar_item_state_set(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_State *state); 247 248 /** 249 * @brief Get the current state of @c it. 250 * 251 * @param[in] obj The object. 252 * 253 * @return Item state 254 * 255 * @ingroup Elm_Toolbar_Item_Group 256 */ 257 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_get(const Elm_Toolbar_Item *obj); 258 259 /** 260 * @brief Set the icon associated with @c item to an image in a binary buffer. 261 * 262 * @note The icon image set by this function can be changed by 263 * @ref elm_toolbar_item_icon_set. 264 * 265 * @param[in] obj The object. 266 * @param[in] img The binary data that will be used as an image. 267 * @param[in] size The size of binary data @c img. 268 * @param[in] format Optional format of @c img to pass to the image loader. 269 * @param[in] key Optional key of @c img to pass to the image loader (eg. if 270 * @c img is an edje file). 271 * 272 * @return @c true on success, @c false otherwise 273 * 274 * @ingroup Elm_Toolbar_Item_Group 275 */ 276 EAPI Eina_Bool elm_toolbar_item_icon_memfile_set(Elm_Toolbar_Item *obj, const void *img, size_t size, const char *format, const char *key); 277 278 /** 279 * @brief Set the icon associated with @c item to an image in a binary buffer. 280 * 281 * @note The icon image set by this function can be changed by 282 * elm_toolbar_item_icon_set(). 283 * 284 * @param[in] obj The object. 285 * @param[in] file The file that contains the image. 286 * @param[in] key Optional key of @c img to pass to the image loader (eg. if 287 * @c img is an edje file). 288 * 289 * @return @c true on success, @c false otherwise 290 * 291 * @ingroup Elm_Toolbar_Item_Group 292 */ 293 EAPI Eina_Bool elm_toolbar_item_icon_file_set(Elm_Toolbar_Item *obj, const char *file, const char *key); 294 295 /** 296 * @brief Add a new state to @c item. 297 * 298 * Toolbar will load icon image from fdo or current theme. This behavior can be 299 * set by elm_toolbar_icon_order_lookup_set function. If an absolute path is 300 * provided it will load it direct from a file. 301 * 302 * States created with this function can be removed with 303 * @ref elm_toolbar_item_state_del. 304 * 305 * @param[in] obj The object. 306 * @param[in] icon A string with icon name or the absolute path of an image 307 * file. 308 * @param[in] label The label of the new state. 309 * @param[in] func The function to call when the item is clicked when this 310 * state is selected. 311 * @param[in] data The data to associate with the state. 312 * 313 * @return The toolbar item state, or @c null upon failure. 314 * 315 * @ingroup Elm_Toolbar_Item_Group 316 */ 317 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_add(Elm_Toolbar_Item *obj, const char *icon, const char *label, Evas_Smart_Cb func, const void *data); 318 319 /** 320 * @brief Delete a previously added state to @c item. 321 * 322 * @param[in] obj The object. 323 * @param[in] state The state to be deleted. 324 * 325 * @return @c true on success or @c false on failure. 326 * 327 * @ingroup Elm_Toolbar_Item_Group 328 */ 329 EAPI Eina_Bool elm_toolbar_item_state_del(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_State *state); 330 331 /** 332 * @brief Get the state after selected state in toolbar's @c item. 333 * 334 * If last state is selected, this function will return first state. 335 * 336 * @param[in] obj The object. 337 * 338 * @return The state after current state, or @c null on failure. 339 * 340 * @ingroup Elm_Toolbar_Item_Group 341 */ 342 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_next(Elm_Toolbar_Item *obj); 343 344 /** 345 * @brief Get the state before selected state in toolbar's @c item. 346 * 347 * If first state is selected, this function will return last state. 348 * 349 * @param[in] obj The object. 350 * 351 * @return The state before current state, or @c null on failure. 352 * 353 * @ingroup Elm_Toolbar_Item_Group 354 */ 355 EAPI Elm_Toolbar_Item_State *elm_toolbar_item_state_prev(Elm_Toolbar_Item *obj); 356 357 /** 358 * @brief Show a specific item, when the toolbar can be scrolled. 359 * 360 * @param[in] obj The object. 361 * @param[in] scrollto The position the item should appear at. 362 * 363 * @since 1.8 364 * 365 * @ingroup Elm_Toolbar_Item_Group 366 */ 367 EAPI void elm_toolbar_item_show(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_Scrollto_Type scrollto); 368 369 /** 370 * @brief Show a specific item with scroll animation, when the toolbar can be 371 * scrolled. 372 * 373 * @param[in] obj The object. 374 * @param[in] scrollto The position the item should appear at. 375 * 376 * @since 1.8 377 * 378 * @ingroup Elm_Toolbar_Item_Group 379 */ 380 EAPI void elm_toolbar_item_bring_in(Elm_Toolbar_Item *obj, Elm_Toolbar_Item_Scrollto_Type scrollto); 381 382 /** 383 * @brief Set whether the toolbar item opens a menu. 384 * 385 * A toolbar item can be set to be a menu, using this function. 386 * 387 * Once it is set to be a menu, it can be manipulated through the menu-like 388 * function @ref elm_toolbar_menu_parent_set and the other elm_menu functions, 389 * using the Evas_Object @c menu returned by @ref elm_toolbar_item_menu_get. 390 * 391 * So, items to be displayed in this item's menu should be added with @ref 392 * elm_menu_item_add. 393 * 394 * @param[in] obj The object. 395 * @param[in] menu If @c true, @c item will opens a menu when selected. 396 * 397 * @ingroup Elm_Toolbar_Item_Group 398 */ 399 EAPI void elm_toolbar_item_menu_set(Elm_Toolbar_Item *obj, Eina_Bool menu); 400 401 #endif 402