Index

Functions

Evas_Object * elm_index_add (Evas_Object *parent)
 Add a new index widget to the given parent Elementary (container) object.
void elm_index_autohide_disabled_set (Evas_Object *obj, Eina_Bool disabled)
 Enable or disable auto hiding feature for a given index widget.
Eina_Bool elm_index_autohide_disabled_get (const Evas_Object *obj)
 Get whether auto hiding feature is enabled or not for a given index widget.
void elm_index_item_level_set (Evas_Object *obj, int level)
 Set the items level for a given index widget.
int elm_index_item_level_get (const Evas_Object *obj)
 Get the items level set for a given index widget.
void elm_index_item_selected_set (Elm_Object_Item *it, Eina_Bool selected)
 Set the selected state of an item.
Elm_Object_Itemelm_index_selected_item_get (const Evas_Object *obj, int level)
 Returns the last selected item, for a given index widget.
Elm_Object_Itemelm_index_item_append (Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data)
 Append a new item on a given index widget.
Elm_Object_Itemelm_index_item_prepend (Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data)
 Prepend a new item on a given index widget.
Elm_Object_Itemelm_index_item_insert_after (Evas_Object *obj, Elm_Object_Item *after, const char *letter, Evas_Smart_Cb func, const void *data)
 Insert a new item into the index object after item after.
Elm_Object_Itemelm_index_item_insert_before (Evas_Object *obj, Elm_Object_Item *before, const char *letter, Evas_Smart_Cb func, const void *data)
 Insert a new item into the index object before item before.
Elm_Object_Itemelm_index_item_sorted_insert (Evas_Object *obj, const char *letter, Evas_Smart_Cb func, const void *data, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func)
 Insert a new item into the given index widget, using cmp_func function to sort items (by item handles).
Elm_Object_Itemelm_index_item_find (Evas_Object *obj, const void *data)
 Find a given index widget's item, using item data.
void elm_index_item_clear (Evas_Object *obj)
 Removes all items from a given index widget.
void elm_index_level_go (Evas_Object *obj, int level)
 Go to a given items level on a index widget.
const char * elm_index_item_letter_get (const Elm_Object_Item *item)
 Get the letter (string) set on a given index widget item.
void elm_index_indicator_disabled_set (Evas_Object *obj, Eina_Bool disabled)
 Set the indicator as to be disabled.
Eina_Bool elm_index_indicator_disabled_get (const Evas_Object *obj)
 Get the value of indicator's disabled status.
void elm_index_horizontal_set (Evas_Object *obj, Eina_Bool horizontal)
 Enable or disable horizontal mode on the index object.
Eina_Bool elm_index_horizontal_get (const Evas_Object *obj)
 Get a value whether horizontal mode is enabled or not.

Detailed Description

index_inheritance_tree.png
preview-00.png

An index widget gives you an index for fast access to whichever group of other UI items one might have. It's a list of text items (usually letters, for alphabetically ordered access).

Index widgets are by default hidden and just appear when the user clicks over it's reserved area in the canvas. In its default theme, it's an area one finger wide on the right side of the index widget's container.

When items on the index are selected, smart callbacks get called, so that its user can make other container objects to show a given area or child object depending on the index item selected. You'd probably be using an index together with lists, generic lists or general grids.

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

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

  • "changed" - When the selected index item changes. event_info is the selected item's data pointer.
  • "delay,changed" - When the selected index item changes, but after a small idling period. event_info is the selected item's data pointer.
  • "selected" - When the user releases a mouse button and selects an item. event_info is the selected item's data pointer.
  • "level,up" - when the user moves a finger from the first level to the second level
  • "level,down" - when the user moves a finger from the second level to the first level

The "delay,changed" event is so that it'll wait a small time before actually reporting those events and, moreover, just the last event happening on those time frames will actually be reported.

Here are some examples on its usage:


Function Documentation

Evas_Object* elm_index_add ( Evas_Object *  parent)

Add a new index widget to the given parent Elementary (container) object.

Parameters:
parentThe parent object
Returns:
a new index widget handle or NULL, on errors

This function inserts a new index widget on the canvas.

Eina_Bool elm_index_autohide_disabled_get ( const Evas_Object *  obj)

Get whether auto hiding feature is enabled or not for a given index widget.

Parameters:
objThe index object
Returns:
EINA_TRUE, if auto hiding is disabled, EINA_FALSE otherwise
See also:
elm_index_autohide_disabled_set() for more details
void elm_index_autohide_disabled_set ( Evas_Object *  obj,
Eina_Bool  disabled 
)

Enable or disable auto hiding feature for a given index widget.

Parameters:
objThe index object
disabledEINA_TRUE to disable auto hiding, EINA_FALSE to enable
See also:
elm_index_autohide_disabled_get()

References elm_layout_signal_emit().

Eina_Bool elm_index_horizontal_get ( const Evas_Object *  obj)

Get a value whether horizontal mode is enabled or not.

Parameters:
objThe index object.
Returns:
EINA_TRUE means horizontal mode selection is enabled. EINA_FALSE indicates it's disabled. If obj is NULL, EINA_FALSE is returned.
See also:
elm_index_horizontal_set() for details.
void elm_index_horizontal_set ( Evas_Object *  obj,
Eina_Bool  horizontal 
)

Enable or disable horizontal mode on the index object.

Parameters:
objThe index object.
horizontalEINA_TRUE to enable horizontal or EINA_FALSE to disable it, i.e., to enable vertical mode. it's an area one finger wide on the bottom side of the index widget's container.
Note:
Vertical mode is set by default.

On horizontal mode items are displayed on index from left to right, instead of from top to bottom. Also, the index will scroll horizontally.

See also:
elm_index_horizontal_get()
Eina_Bool elm_index_indicator_disabled_get ( const Evas_Object *  obj)

Get the value of indicator's disabled status.

Parameters:
objThe index object
Returns:
EINA_TRUE if the indicator is disabled.
See also:
elm_index_indicator_disabled_set()
void elm_index_indicator_disabled_set ( Evas_Object *  obj,
Eina_Bool  disabled 
)

Set the indicator as to be disabled.

Parameters:
objThe index object
disabledEINA_TRUE to disable it, EINA_FALSE to enable it

In Index widget, Indicator notes popup text, which shows a letter has been selecting.

See also:
elm_index_indicator_disabled_get()

References elm_layout_signal_emit().

Elm_Object_Item* elm_index_item_append ( Evas_Object *  obj,
const char *  letter,
Evas_Smart_Cb  func,
const void *  data 
)

Append a new item on a given index widget.

Parameters:
objThe index object.
letterLetter under which the item should be indexed
funcThe function to call when the item is selected.
dataThe item data to set for the index's item
Returns:
A handle to the item added or NULL, on errors

Despite the most common usage of the letter argument is for single char strings, one could use arbitrary strings as index entries.

item will be the pointer returned back on "changed", "delay,changed" and "selected" smart events.

Referenced by elm_index_item_insert_after(), and elm_index_item_sorted_insert().

void elm_index_item_clear ( Evas_Object *  obj)

Removes all items from a given index widget.

Parameters:
objThe index object.

If deletion callbacks are set, via elm_object_item_del_cb_set(), that callback function will be called for each item in obj.

Elm_Object_Item* elm_index_item_find ( Evas_Object *  obj,
const void *  data 
)

Find a given index widget's item, using item data.

Parameters:
objThe index object
dataThe item data pointed to by the desired index item
Returns:
The index item handle, if found, or NULL otherwise
Elm_Object_Item* elm_index_item_insert_after ( Evas_Object *  obj,
Elm_Object_Item after,
const char *  letter,
Evas_Smart_Cb  func,
const void *  data 
)

Insert a new item into the index object after item after.

Parameters:
objThe index object.
afterThe index item to insert after.
letterLetter under which the item should be indexed
funcThe function to call when the item is clicked.
dataThe item data to set for the index's item
Returns:
A handle to the item added or NULL, on errors

Despite the most common usage of the letter argument is for single char strings, one could use arbitrary strings as index entries.

item will be the pointer returned back on "changed", "delay,changed" and "selected" smart events.

Note:
If relative is NULL this function will behave as elm_index_item_append().

References elm_index_item_append().

Elm_Object_Item* elm_index_item_insert_before ( Evas_Object *  obj,
Elm_Object_Item before,
const char *  letter,
Evas_Smart_Cb  func,
const void *  data 
)

Insert a new item into the index object before item before.

Parameters:
objThe index object.
beforeThe index item to insert after.
letterLetter under which the item should be indexed
funcThe function to call when the item is clicked.
dataThe item data to set for the index's item
Returns:
A handle to the item added or NULL, on errors

Despite the most common usage of the letter argument is for single char strings, one could use arbitrary strings as index entries.

item will be the pointer returned back on "changed", "delay,changed" and "selected" smart events.

Note:
If relative is NULL this function will behave as elm_index_item_prepend().

References elm_index_item_prepend().

const char* elm_index_item_letter_get ( const Elm_Object_Item item)

Get the letter (string) set on a given index widget item.

Parameters:
itemThe index item handle
Returns:
The letter string set on it
int elm_index_item_level_get ( const Evas_Object *  obj)

Get the items level set for a given index widget.

Parameters:
objThe index object.
Returns:
0 or 1, which are the levels obj might be at.
See also:
elm_index_item_level_set() for more information
void elm_index_item_level_set ( Evas_Object *  obj,
int  level 
)

Set the items level for a given index widget.

Parameters:
objThe index object.
level0 or 1, the currently implemented levels.
See also:
elm_index_item_level_get()
Elm_Object_Item* elm_index_item_prepend ( Evas_Object *  obj,
const char *  letter,
Evas_Smart_Cb  func,
const void *  data 
)

Prepend a new item on a given index widget.

Parameters:
objThe index object.
letterLetter under which the item should be indexed
funcThe function to call when the item is selected.
dataThe item data to set for the index's item
Returns:
A handle to the item added or NULL, on errors

Despite the most common usage of the letter argument is for single char strings, one could use arbitrary strings as index entries.

item will be the pointer returned back on "changed", "delay,changed" and "selected" smart events.

Referenced by elm_index_item_insert_before().

void elm_index_item_selected_set ( Elm_Object_Item it,
Eina_Bool  selected 
)

Set the selected state of an item.

Parameters:
itThe index item
selectedThe selected state

This sets the selected state of the given item it. EINA_TRUE for selected, EINA_FALSE for not selected.

If a new item is selected the previously selected will be unselected. Previously selected item can be get with function elm_index_selected_item_get().

Selected items will be highlighted.

See also:
elm_index_selected_item_get()
Elm_Object_Item* elm_index_item_sorted_insert ( Evas_Object *  obj,
const char *  letter,
Evas_Smart_Cb  func,
const void *  data,
Eina_Compare_Cb  cmp_func,
Eina_Compare_Cb  cmp_data_func 
)

Insert a new item into the given index widget, using cmp_func function to sort items (by item handles).

Parameters:
objThe index object.
letterLetter under which the item should be indexed
funcThe function to call when the item is clicked.
dataThe item data to set for the index's item
cmp_funcThe comparing function to be used to sort index items by index item handles
cmp_data_funcA fallback function to be called for the sorting of index items by item data). It will be used when cmp_func returns 0 (equality), which means an index item with provided item data already exists. To decide which data item should be pointed to by the index item in question, cmp_data_func will be used. If cmp_data_func returns a non-negative value, the previous index item data will be replaced by the given item pointer. If the previous data need to be freed, it should be done by the cmp_data_func function, because all references to it will be lost. If this function is not provided (NULL is given), index items will be duplicated, if cmp_func returns 0.
Returns:
A handle to the item added or NULL, on errors

Despite the most common usage of the letter argument is for single char strings, one could use arbitrary strings as index entries.

item will be the pointer returned back on "changed", "delay,changed" and "selected" smart events.

References elm_index_item_append().

void elm_index_level_go ( Evas_Object *  obj,
int  level 
)

Go to a given items level on a index widget.

Parameters:
objThe index object
levelThe index level (one of 0 or 1)
Elm_Object_Item* elm_index_selected_item_get ( const Evas_Object *  obj,
int  level 
)

Returns the last selected item, for a given index widget.

Parameters:
objThe index object.
level0 or 1, the currently implemented levels.
Returns:
The last item selected on obj (or NULL, on errors).