* @deprecated Use elm_object_item_text_set() instead
*/
EINA_DEPRECATED EAPI void elm_multibuttonentry_item_label_set(Elm_Object_Item *it, const char *str);
+
+/**
+ * Sets the disabled/enabled state of a list item.
+ *
+ * @param it The item.
+ * @param disabled The disabled state.
+ *
+ * A disabled item cannot be selected or unselected. It will also
+ * change its appearance (generally greyed out). This sets the
+ * disabled state (@c EINA_TRUE for disabled, @c EINA_FALSE for
+ * enabled).
+ *
+ * @deprecated Use elm_object_item_disabled_set() instead
+ *
+ * @ingroup List
+ */
+EINA_DEPRECATED EAPI void elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled);
+
+/**
+ * Get a value whether list item is disabled or not.
+ *
+ * @param it The item.
+ * @return The disabled state.
+ *
+ * @see elm_list_item_disabled_set() for more details.
+ *
+ * @deprecated Use elm_object_item_disabled_get() instead
+ *
+ * @ingroup List
+ */
+EINA_DEPRECATED EAPI Eina_Bool elm_list_item_disabled_get(const Elm_List_Item *it);
Ecore_Timer *long_timer;
Ecore_Timer *swipe_timer;
Eina_Bool deleted : 1;
- Eina_Bool disabled : 1;
Eina_Bool even : 1;
Eina_Bool is_even : 1;
Eina_Bool is_separator : 1;
if (!wd) return;
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
- if ((it->highlighted) || (it->disabled)) return;
+ if ((it->highlighted) || (it->base.disabled)) return;
evas_object_ref(obj);
_elm_list_walk(wd);
if (!wd) return;
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
- if (it->disabled) return;
+ if (it->base.disabled) return;
if (it->selected)
{
if (wd->always_select) goto call;
ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, ECORE_CALLBACK_CANCEL);
it->long_timer = NULL;
- if (it->disabled) goto end;
+ if (it->base.disabled) goto end;
wd->longpressed = EINA_TRUE;
evas_object_smart_callback_call(WIDGET(it), SIG_LONGPRESSED, it);
return;
}
- if (it->disabled)
+ if (it->base.disabled)
return;
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
evas_object_unref(obj2);
}
+static void
+_item_disable(void *data)
+{
+ Elm_List_Item *it = data;
+ if (it->base.disabled)
+ edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
+ else
+ edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
+}
+
static Elm_List_Item *
_item_new(Evas_Object *obj, const char *label, Evas_Object *icon, Evas_Object *end, Evas_Smart_Cb func, const void *data)
{
evas_object_event_callback_add(it->end, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
_changed_size_hints, obj);
}
+ _elm_widget_item_disable_set_hook_set((Elm_Widget_Item *)it, _item_disable);
return it;
}
if ((selectraise) && (!strcmp(selectraise, "on")))
evas_object_raise(VIEW(it));
}
- if (it->disabled)
+ if (it->base.disabled)
edje_object_signal_emit(VIEW(it), "elm,state,disabled",
"elm");
if (policy_v) *policy_v = (Elm_Scroller_Policy) s_policy_v;
}
-EAPI void
+EINA_DEPRECATED EAPI void
elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled)
{
- ELM_LIST_ITEM_CHECK_DELETED_RETURN(it);
-
- if (it->disabled == disabled)
- return;
-
- it->disabled = !!disabled;
-
- if (it->disabled)
- edje_object_signal_emit(VIEW(it), "elm,state,disabled", "elm");
- else
- edje_object_signal_emit(VIEW(it), "elm,state,enabled", "elm");
+ elm_object_item_disabled_set((Elm_Object_Item *)it, disabled);
}
-EAPI Eina_Bool
+EINA_DEPRECATED EAPI Eina_Bool
elm_list_item_disabled_get(const Elm_List_Item *it)
{
- ELM_LIST_ITEM_CHECK_DELETED_RETURN(it, EINA_FALSE);
-
- return it->disabled;
+ return elm_object_item_disabled_get((Elm_Object_Item *)it);
}
EAPI Elm_List_Item *elm_list_item_next(const Elm_List_Item *it);
/**
- * Sets the disabled/enabled state of a list item.
- *
- * @param it The item.
- * @param disabled The disabled state.
- *
- * A disabled item cannot be selected or unselected. It will also
- * change its appearance (generally greyed out). This sets the
- * disabled state (@c EINA_TRUE for disabled, @c EINA_FALSE for
- * enabled).
- *
- * @ingroup List
- */
-EAPI void elm_list_item_disabled_set(Elm_List_Item *it, Eina_Bool disabled);
-
-/**
- * Get a value whether list item is disabled or not.
- *
- * @param it The item.
- * @return The disabled state.
- *
- * @see elm_list_item_disabled_set() for more details.
- *
- * @ingroup List
- */
-EAPI Eina_Bool elm_list_item_disabled_get(const Elm_List_Item *it);
-
-/**
* Set the text to be shown in a given list item's tooltips.
*
* @param item Target item.
* It will instead be limited only by the size of the display.
*/
EAPI Eina_Bool elm_list_item_tooltip_window_mode_set(Elm_List_Item *item, Eina_Bool disable);
+
/**
* @brief Retrieve size restriction state of an object's tooltip
* @param obj The tooltip's anchor object