Tizen Native API  4.0
Icon

icon_inheritance_tree.png

An icon object is used to display standard icon images ("delete", "edit", "arrows", etc.) or images coming from a custom file (PNG, JPG, EDJE, etc.), on icon contexts.

The icon image requested can be in the Elementary theme in use, or in the freedesktop.org theme paths. It's possible to set the order of preference from where an image will be fetched.

This widget inherits from the Image one, so that all the functions acting on it also work for icon objects.

You should be using an icon, instead of an image, whenever one of the following apply:

Various calls on the icon's API are marked as deprecated, as they just wrap the image counterpart functions. Use the ones we point you to, for each case of deprecation here, instead -- eventually the deprecated ones will be discarded (next major release).

Default images provided by Elementary's default theme are described below.

These are names that follow (more or less) the Freedesktop icon naming specification. Use of these names are preferred, at least if you want to give your user the ability to use other themes. All these icons can be seen in the elementary_test application, the test is called "Icon Standard".

These are names for icons that were first intended to be used in toolbars, but can be used in many other places too:

These are names for icons that were designed to be used in menus (but again, you can use them anywhere else):

And these are names for some media player specific icons:

This widget emits the following signals, besides the ones sent from Elm_Image:

Elementary icon objects support the following API calls:

An example of usage for this API follows:

Functions

void elm_icon_order_lookup_set (Elm_Icon *obj, Elm_Icon_Lookup_Order order)
 Sets the icon lookup order used by elm_icon_standard_set().
Elm_Icon_Lookup_Order elm_icon_order_lookup_get (const Elm_Icon *obj)
 Get the icon lookup order.
Eina_Bool elm_icon_standard_set (Elm_Icon *obj, const char *name)
 Set the icon by icon standards names.
const char * elm_icon_standard_get (const Elm_Icon *obj)
 Get the icon name set by icon standard names.
void elm_icon_thumb_set (Elm_Icon *obj, const char *file, const char *group)
 Set the file that will be used, but use a generated thumbnail.
Evas_Objectelm_icon_add (Evas_Object *parent)

Enumeration Type Documentation

Lookup order used by elm_icon_standard_set(). Should look for icons in the theme, FDO paths, or both?

Enumerator:
ELM_ICON_LOOKUP_FDO_THEME 

Icon look up order: freedesktop, theme.

ELM_ICON_LOOKUP_THEME_FDO 

Icon look up order: theme, freedesktop.

ELM_ICON_LOOKUP_FDO 

Icon look up order: freedesktop.

ELM_ICON_LOOKUP_THEME 

Icon look up order: theme.


Function Documentation

Add a new icon object to the parent.

Parameters:
parentThe parent object
Returns:
The new object or NULL if it cannot be created
See also:
elm_image_file_set()
Since :
2.3

Get the icon lookup order.

See also elm_icon_order_lookup_set, Elm_Icon_Lookup_Order.

Since :
2.3
Parameters:
[in]objThe object.
Returns:
The icon lookup order (can be one of ELM_ICON_LOOKUP_FDO_THEME, ELM_ICON_LOOKUP_THEME_FDO, ELM_ICON_LOOKUP_FDO or ELM_ICON_LOOKUP_THEME)
void elm_icon_order_lookup_set ( Elm_Icon *  obj,
Elm_Icon_Lookup_Order  order 
)

Sets the icon lookup order used by elm_icon_standard_set().

See also elm_icon_order_lookup_get, Elm_Icon_Lookup_Order.

Since :
2.3
Parameters:
[in]objThe object.
[in]orderThe icon lookup order (can be one of ELM_ICON_LOOKUP_FDO_THEME, ELM_ICON_LOOKUP_THEME_FDO, ELM_ICON_LOOKUP_FDO or ELM_ICON_LOOKUP_THEME)
const char* elm_icon_standard_get ( const Elm_Icon *  obj)

Get the icon name set by icon standard names.

If the icon image was set using elm_image_file_set() instead of elm_icon_standard_set, then this function will return null.

Since :
2.3
Parameters:
[in]objThe object.
Returns:
The icon name
Eina_Bool elm_icon_standard_set ( Elm_Icon *  obj,
const char *  name 
)

Set the icon by icon standards names.

For example, freedesktop.org defines standard icon names such as "home", "network", etc. There can be different icon sets to match those icon keys. The "name" given as parameter is one of these "keys", and will be used to look in the freedesktop.org paths and elementary theme. One can change the lookup order with elm_icon_order_lookup_set.

If name is not found in any of the expected locations and it is the absolute path of an image file, this image will be used.

Note:
The icon image set by this function can be changed by Efl::File::file::set.
This function does not accept relative icon path.

See also elm_icon_standard_get.

Since :
2.3
Parameters:
[in]objThe object.
[in]nameThe icon name
Returns:
true on success, false on error
void elm_icon_thumb_set ( Elm_Icon *  obj,
const char *  file,
const char *  group 
)

Set the file that will be used, but use a generated thumbnail.

This functions like elm_image_file_set() but requires the Ethumb library support to be enabled successfully with elm_need_ethumb. When set the file indicated has a thumbnail generated and cached on disk for future use or will directly use an existing cached thumbnail if it is valid.

Since :
2.3
Parameters:
[in]objThe object.
[in]fileThe path to file that will be used as icon image
[in]groupThe group that the icon belongs to an edje file