#include "elm_priv.h"
#include "els_box.h"
-/**
- * @defgroup Index Index
- * @ingroup Elementary
- *
- * An index object is a type of list that categorizes items in it
- * by letter.
- *
- * Signals that you can add callbacks for are:
- *
- * "changed" - when the selected index item changes
- * "delay,changed" - when the selected index item changes, but after some small i
- * dle period
- * "selected" - when the user releases a finger and selects an item
- * "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
- */
-
#define MIN_GRP_SIZE 2 //for symmetry it is 2, otherwise it can be 1 and zero have no meaning.
#define MIN_PIXEL_VALUE 1 //Min pixel value is highly dependent on touch sensitivity support.
#define MIN_OBJ_HEIGHT 24 //should be taken from .edc file.
ecore_job_add(_index_box_refill_job, (Evas_Object *)data);
}
-/**
- * Add a new index to the parent
- *
- * @param parent The parent object
- * @return The new object or NULL if it cannot be created
- *
- * @ingroup Index
- */
EAPI Evas_Object *
elm_index_add(Evas_Object *parent)
{
}
}
-/**
- * Set the active state of the index programatically
- *
- * @param obj The index object
- * @param active The active state
- *
- * @ingroup Index
- */
EAPI void
elm_index_active_set(Evas_Object *obj, Eina_Bool active)
{
edje_object_signal_emit(wd->base, "elm,state,inactive", "elm");
}
-/**
- * Get the active state of the index programatically
- *
- * @param obj The index object
- * @return The active state
- *
- * @ingroup Index
- */
EAPI Eina_Bool
elm_index_active_get(const Evas_Object *obj)
{
return wd->active;
}
-/**
- * Sets the level of the item.
- *
- * @param obj The index object.
- * @param level To be documented.
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_level_set(Evas_Object *obj, int level)
{
wd->level = level;
}
-/**
- * Gets the level of the item.
- *
- * @param obj The index object
- *
- * @ingroup Index
- */
EAPI int
elm_index_item_level_get(const Evas_Object *obj)
{
return wd->level;
}
-/**
- * Returns the selected item.
- *
- * @param obj The index object.
- * @param level to be documented.
- *
- * @ingroup Index
- */
EAPI void *
elm_index_item_selected_get(const Evas_Object *obj, int level)
{
Elm_Index_Item *it;
if (!wd) return NULL;
EINA_LIST_FOREACH(wd->items, l, it)
- if ((it->selected) && (it->level == level))
- return elm_widget_item_data_get(it);
+ if ((it->selected) && (it->level == level))
+ return elm_widget_item_data_get(it);
return NULL;
}
-/**
- * Appends a new item.
- *
- * @param obj The index object.
- * @param letter Letter under which the item should be indexed
- * @param item The item to put in the index
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_append(Evas_Object *obj, const char *letter, const void *item)
{
_index_box_clear(obj, wd->bx[wd->level], wd->level);
}
-/**
- * Prepends a new item.
- *
- * @param obj The index object.
- * @param letter Letter under which the item should be indexed
- * @param item The item to put in the index
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_prepend(Evas_Object *obj, const char *letter, const void *item)
{
_index_box_clear(obj, wd->bx[wd->level], wd->level);
}
-/**
- * Append an item after @p relative in letter @p letter.
- *
- * @param obj The index object
- * @param letter Letter under which the item should be indexed
- * @param item The item to put in the index
- * @param relative The item to put @p item after
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_append_relative(Evas_Object *obj, const char *letter, const void *item, const void *relative)
{
_index_box_clear(obj, wd->bx[wd->level], wd->level);
}
-/**
- * Prepend an item before @p relative in letter @p letter.
- *
- * @param obj The index object
- * @param letter Letter under which the item should be indexed
- * @param item The item to put in the index
- * @param relative The item to put @p item before
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_prepend_relative(Evas_Object *obj, const char *letter, const void *item, const void *relative)
{
_index_box_clear(obj, wd->bx[wd->level], wd->level);
}
-/**
- * Insert a new @p item into the sorted index @p obj in @p letter.
- *
- * @param obj The index object
- * @param letter Letter under which the item should be indexed
- * @param item The item to put in the index
- * @param cmp_func The function called for the sort of index items.
- * @param cmp_data_func The function called for the sort of the data. It will
- * be used when cmp_func return 0. It means the index item already exists.
- * So, to decide which data item should be pointed by the index item, a function
- * to compare them is needed. If this function is not provided, index items
- * will be duplicated. If cmp_data_func returns a non-negative value, the
- * previous index item data will be replaced by the inserted @p item. So
- * if the previous data need to be free, it should be done in this function,
- * because the reference will be lost.
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_sorted_insert(Evas_Object *obj, const char *letter, const void *item, Eina_Compare_Cb cmp_func, Eina_Compare_Cb cmp_data_func)
{
_index_box_clear(obj, wd->bx[wd->level], wd->level);
}
-/**
- * Remove an item from the index.
- *
- * @param obj The index object
- * @param item The item to remove from the index
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_del(Evas_Object *obj, const void *item)
{
_index_box_clear(obj, wd->bx[wd->level], wd->level);
}
-/**
- * Find an index item using item data.
- *
- * @param obj The index object
- * @param item The item pointed by index item
- * @return The index item pointing to @p item
- *
- * @ingroup Index
- */
EAPI Elm_Index_Item *
elm_index_item_find(Evas_Object *obj, const void *item)
{
return _item_find(obj, item);
}
-/**
- * Clears an index of its items.
- *
- * @param obj The index object.
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_clear(Evas_Object *obj)
{
}
}
-/**
- * Go to item at @p level
- *
- * @param obj The index object
- * @param level The index level
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_go(Evas_Object *obj, int level)
{
if (wd->level == 1) _index_box_auto_fill(obj, wd->bx[1], 1);
}
-/**
- * Returns the data associated with the item.
- *
- * @param it The list item
- * @return The data associated with @p it
- *
- * @ingroup Index
- */
EAPI void *
elm_index_item_data_get(const Elm_Index_Item *it)
{
return elm_widget_item_data_get(it);
}
-/**
- * Set the data item from the index item
- *
- * This set a new data value.
- *
- * @param it The item
- * @param data The new data pointer to set
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_data_set(Elm_Index_Item *it, const void *data)
{
elm_widget_item_data_set(it, data);
}
-/**
- * Make the Central Button Image invisible.
- *
- * @param obj The Index.
- * @param invisible Whether button visible or not.
- * @return void.
- *
- * @ingroup Index
- */
EAPI void
elm_index_button_image_invisible_set(Evas_Object *obj, Eina_Bool invisible)
{
return;
}
-/**
- * Set the function called when a index item is freed.
- *
- * @param it The item to set the callback on
- * @param func The function called
- *
- * @ingroup Index
- */
EAPI void
elm_index_item_del_cb_set(Elm_Index_Item *it, Evas_Smart_Cb func)
{
elm_widget_item_del_cb_set(it, func);
}
-/**
- * Gets the letter of the item.
- *
- * @param it The list item
- * @return The letter of @p it
- *
- * @ingroup Index
- */
EAPI const char *
elm_index_item_letter_get(const Elm_Index_Item *it)
{