ELM_GENLIST_ITEM_GROUP,
gl_sel/* func */,
(void *)(long)(i * 10)/* func data */);
- elm_genlist_item_display_only_set(git, EINA_TRUE);
+ elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
}
else if (git)
{
git = elm_genlist_item_append(gl, &itc_group,
(void *)0/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */,
NULL/* func data */);
- elm_genlist_item_display_only_set(git, EINA_TRUE);
+ elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
elm_genlist_item_append(gl, itc1,
(void *)1/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
NULL/* func data */);
git = elm_genlist_item_append(gl, &itc_group,
(void *)4/* item data */, NULL/* parent */, ELM_GENLIST_ITEM_GROUP, gl4_sel/* func */,
NULL/* func data */);
- elm_genlist_item_display_only_set(git, EINA_TRUE);
+ elm_genlist_item_select_mode_set(git, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+
elm_genlist_item_append(gl, itc1,
(void *)5/* item data */, git/* parent */, ELM_GENLIST_ITEM_TREE, gl4_sel/* func */,
NULL/* func data */);
(void *)(long)nitems++, NULL,
ELM_GENLIST_ITEM_GROUP,
_item_sel_cb, NULL);
- elm_genlist_item_display_only_set(glg, EINA_TRUE);
+ elm_genlist_item_select_mode_set(git, ELM_OBJECT_DISPLAY_ONLY_SELECT);
}
else
{
EINA_DEPRECATED EAPI void elm_genlist_compress_mode_set(Evas_Object *obj, Eina_Bool compress);
/**
+ * Sets the display only state of an item.
+ *
+ * @param it The item
+ * @param display_only @c EINA_TRUE if the item is display only, @c
+ * EINA_FALSE otherwise.
+ *
+ * A display only item cannot be selected or unselected. It is for
+ * display only and not selecting or otherwise clicking, dragging
+ * etc. by the user, thus finger size rules will not be applied to
+ * this item.
+ *
+ * It's good to set group index items to display only state.
+ *
+ * @see elm_genlist_item_display_only_get()
+ *
+ * @deprecated elm_genlist_item_display_only_set()
+ */
+EINA_DEPRECATED EAPI void elm_genlist_item_display_only_set(Elm_Object_Item *it, Eina_Bool display_only);
+
+/**
+ * Get the display only state of an item
+ *
+ * @param it The item
+ * @return @c EINA_TRUE if the item is display only, @c
+ * EINA_FALSE otherwise.
+ *
+ * @see elm_genlist_item_display_only_set()
+ *
+ * @deprecated elm_genlist_item_display_only_get()
+ */
+EINA_DEPRECATED EAPI Eina_Bool elm_genlist_item_display_only_get(const Elm_Object_Item *it);
+
+/**
* Get whether the compress mode is enabled.
*
* @param obj The genlist object
Ecore_Cb unsel_cb, unhighlight_cb, unrealize_cb;
int position;
+ Elm_Object_Select_Mode select_mode;
Eina_Bool position_update : 1;
Eina_Bool want_unrealize : 1;
ELM_OBJECT_SELECT_MODE_DEFAULT = 0, /**< default select mode */
ELM_OBJECT_SELECT_MODE_ALWAYS, /**< always select mode */
ELM_OBJECT_SELECT_MODE_NONE, /**< no select mode */
-
+ ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY, /**< no select mode with no finger size rule*/
ELM_OBJECT_SELECT_MODE_MAX
} Elm_Object_Select_Mode;
* Grid cells will only have their selection smart callbacks called
* when firstly getting selected. Any further clicks will do
* nothing, unless you enable the "always select mode", with
- * elm_gengrid_always_select_mode_set(), thus making every click to
- * issue selection callbacks. elm_gengrid_no_select_mode_set() will
+ * elm_gengrid_select_mode_set() as ELM_OBJECT_ALWAYS_SELECT,
+ * thus making every click to issue selection callbacks.
+ * elm_gengrid_select_mode_set() as ELM_OBJECT_NO_SELECT will
* turn off the ability to select items entirely in the widget and
* they will neither appear selected nor call the selection smart
* callbacks.
(it->wd->no_highlight) ||
(it->generation < it->wd->generation) ||
(it->highlighted) || elm_widget_item_disabled_get(it) ||
- (it->display_only) || (it->item->mode_view))
+ (it->select_mode == ELM_OBJECT_SELECT_MODE_NONE) || (it->item->mode_view) ||
+ (it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
return;
edje_object_signal_emit(VIEW(it), "elm,state,selected", "elm");
if (it->edit_obj) edje_object_signal_emit(it->edit_obj, "elm,state,selected", "elm");
}
return;
}
- if (!it->display_only)
+ if (it->select_mode != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
elm_coords_finger_size_adjust(1, &minw, 1, &minh);
evas_object_geometry_get(obj, &x, &y, NULL, NULL);
x = ev->cur.canvas.x - x;
Eina_List *list, *l;
it->long_timer = NULL;
- if (elm_widget_item_disabled_get(it) || (it->dragging) || (it->display_only))
+ if (elm_widget_item_disabled_get(it) || (it->dragging) ||
+ (it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
return ECORE_CALLBACK_CANCEL;
it->wd->longpressed = EINA_TRUE;
evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
int i, sum = 0;
if (!it) return;
- if ((it->display_only) || elm_widget_item_disabled_get(it)) return;
+ if ((it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY) ||
+ elm_widget_item_disabled_get(it)) return;
it->wd->swipe = EINA_FALSE;
for (i = 0; i < it->wd->movements; i++)
{
it->wd->wasselected = it->selected;
_item_highlight(it);
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
- if ((!elm_widget_item_disabled_get(it)) && (!it->display_only))
+ if ((!elm_widget_item_disabled_get(it)) &&
+ (it->select_mode != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
{
evas_object_smart_callback_call(WIDGET(it), SIG_CLICKED_DOUBLE, it);
evas_object_smart_callback_call(WIDGET(it), SIG_ACTIVATED, it);
_item_block_unrealize(it->item->block);
}
}
- if (elm_widget_item_disabled_get(it) || (dragged) || (it->display_only))
+ if (elm_widget_item_disabled_get(it) || (dragged) ||
+ (it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY))
return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
if (it->wd->multi)
{
Evas_Coord mw = -1, mh = -1;
- if (!it->display_only)
+ if (it->select_mode != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
if (it->wd->mode == ELM_LIST_COMPRESS) mw = it->wd->prev_viewport_w;
edje_object_size_min_restricted_calc(VIEW(it), &mw, &mh, mw,
mh);
- if (!it->display_only)
+ if (it->select_mode != ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
elm_coords_finger_size_adjust(1, &mw, 1, &mh);
it->item->w = it->item->minw = mw;
it->item->h = it->item->minh = mh;
return ((Elm_Gen_Item *)it)->item->expanded_depth;
}
-EAPI void
+EINA_DEPRECATED EAPI void
elm_genlist_item_display_only_set(Elm_Object_Item *it,
Eina_Bool display_only)
{
ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
- Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
display_only = !!display_only;
- if (_it->display_only == display_only) return;
- if (_it->generation < _it->wd->generation) return;
- _it->display_only = display_only;
- _it->item->mincalcd = EINA_FALSE;
- _it->item->updateme = EINA_TRUE;
- if (_it->item->block) _it->item->block->updateme = EINA_TRUE;
- if (_it->wd->update_job) ecore_job_del(_it->wd->update_job);
- _it->wd->update_job = ecore_job_add(_update_job, _it->wd);
+
+ if (display_only)
+ elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY);
+ else
+ {
+ Elm_Object_Select_Mode oldmode = elm_genlist_item_select_mode_get(it);
+ if (oldmode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
+ elm_genlist_item_select_mode_set(it, ELM_OBJECT_SELECT_MODE_DEFAULT);
+ }
}
-EAPI Eina_Bool
+EINA_DEPRECATED EAPI Eina_Bool
elm_genlist_item_display_only_get(const Elm_Object_Item *it)
{
ELM_OBJ_ITEM_CHECK_OR_RETURN(it, EINA_FALSE);
Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
if (_it->generation < _it->wd->generation) return EINA_FALSE;
- return _it->display_only;
+ Elm_Object_Select_Mode oldmode = elm_genlist_item_select_mode_get(it);
+ if (oldmode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
+ return EINA_TRUE;
+ return EINA_FALSE;
}
static Eina_Bool _elm_genlist_item_compute_coordinates(
return !wd->no_highlight;
}
+EAPI void
+elm_genlist_item_select_mode_set(Elm_Object_Item *it,
+ Elm_Object_Select_Mode mode)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it);
+ Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
+ if (!_it) return;
+ if (_it->generation < _it->wd->generation) return;
+ if (mode >= ELM_OBJECT_SELECT_MODE_MAX)
+ return;
+ if (_it->select_mode != mode)
+ _it->select_mode = mode;
+
+ if (_it->select_mode == ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY)
+ {
+ _it->item->mincalcd = EINA_FALSE;
+ _it->item->updateme = EINA_TRUE;
+ if (_it->item->block) _it->item->block->updateme = EINA_TRUE;
+ if (_it->wd->update_job) ecore_job_del(_it->wd->update_job);
+ _it->wd->update_job = ecore_job_add(_update_job, _it->wd);
+ }
+}
+
+EAPI Elm_Object_Select_Mode
+elm_genlist_item_select_mode_get(const Elm_Object_Item *it)
+{
+ ELM_OBJ_ITEM_CHECK_OR_RETURN(it, ELM_OBJECT_SELECT_MODE_MAX);
+ Elm_Gen_Item *_it = (Elm_Gen_Item *)it;
+ if (!_it) return ELM_OBJECT_SELECT_MODE_MAX;
+ return _it->select_mode;
+}
+
/* for gengrid as of now */
void
_elm_genlist_page_relative_set(Evas_Object *obj,
*
* Items will only call their selection func and callback when first becoming
* selected. Any further clicks will do nothing, unless you enable always
- * select with elm_genlist_always_select_mode_set(). This means even if
- * selected, every click will make the selected callbacks be called.
- * elm_genlist_no_select_mode_set() will turn off the ability to select
- * items entirely and they will neither appear selected nor call selected
- * callback functions.
+ * select with elm_genlist_select_mode_set() as ELM_OBJECT_ALWAYS_SELECT.
+ * This means even if selected, every click will make the selected callbacks
+ * be called. elm_genlist_select_mode_set() as ELM_OBJECT_NO_SELECT will
+ * turn off the ability to select items entirely and they will neither
+ * appear selected nor call selected callback functions.
*
* Remember that you can create new styles and add your own theme augmentation
* per application with elm_theme_extension_add(). If you absolutely must
EAPI int elm_genlist_item_expanded_depth_get(const Elm_Object_Item *it);
/**
- * Sets the display only state of an item.
- *
- * @param it The item
- * @param display_only @c EINA_TRUE if the item is display only, @c
- * EINA_FALSE otherwise.
- *
- * A display only item cannot be selected or unselected. It is for
- * display only and not selecting or otherwise clicking, dragging
- * etc. by the user, thus finger size rules will not be applied to
- * this item.
- *
- * It's good to set group index items to display only state.
- *
- * @see elm_genlist_item_display_only_get()
- *
- * @ingroup Genlist
- */
-//XXX: elm_genlist_item_no_select_mode_set()?
-EAPI void elm_genlist_item_display_only_set(Elm_Object_Item *it, Eina_Bool display_only);
-
-/**
- * Get the display only state of an item
- *
- * @param it The item
- * @return @c EINA_TRUE if the item is display only, @c
- * EINA_FALSE otherwise.
- *
- * @see elm_genlist_item_display_only_set()
- *
- * @ingroup Genlist
- */
-//XXX: elm_genlist_item_no_select_mode_get()?
-EAPI Eina_Bool elm_genlist_item_display_only_get(const Elm_Object_Item *it);
-
-/**
* Unset all contents fetched by the item class
*
* @param it The item
EAPI Eina_Bool elm_genlist_highlight_mode_get(const Evas_Object *obj);
/**
+ * Set the genlist item's select mode.
+ *
+ * @param it The genlist item object
+ * @param mode The select mode
+ *
+ * elm_genlist_select_mode_set() changes item's select mode.
+ * - ELM_OBJECT_NORMAL_SELECT : The item will only call their selection func and
+ * callback when first becoming selected. Any further clicks will
+ * do nothing, unless you set always select mode.
+ * - ELM_OBJECT_ALWAYS_SELECT : This means that, even if selected,
+ * every click will make the selected callbacks be called.
+ * - ELM_OBJECT_NO_SELECT : This will turn off the ability to select the item
+ * entirely and they will neither appear selected nor call selected
+ * callback functions.
+ * - ELM_OBJECT_DISPLAY_ONLY_SELECT : This will apply no-finger-size rule with
+ * with ELM_OBJECT_NO_SELECT. No-finger-size rule makes an item can be
+ * smaller than lower limit. In some touch or small screen devices,
+ * clickable objects should be bigger than human touch point device
+ * (your finger). So it is enabled, the item can be smaller than
+ * predefined finger-size value. And the item will be updated.
+ *
+ * @see elm_genlist_item_select_mode_get()
+ *
+ * @ingroup Genlist
+ */
+EAPI void
+elm_genlist_item_select_mode_set(Elm_Object_Item *it,
+ Elm_Object_Select_Mode mode);
+
+/**
+ * Get the genlist item's select mode.
+ *
+ * @param it The genlist item object
+ * @return The select mode
+ * (If getting mode is failed, it returns ELM_OBJECT_SELECT_MODE_MAX)
+ *
+ * @see elm_genlist_item_select_mode_set()
+ *
+ * @ingroup Genlist
+ */
+EAPI Elm_Object_Select_Mode
+elm_genlist_item_select_mode_get(const Elm_Object_Item *it);
+
+/**
* @}
*/