*
* Other markup can be used to style the text in different ways, but it's
* up to the style defined in the theme which tags do what.
+ * @deprecated use elm_object_text_set() instead.
*/
- EAPI void elm_anchorview_text_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI void elm_anchorview_text_set(Evas_Object *obj, const char *text) EINA_ARG_NONNULL(1);
/**
* Get the markup text set for the anchorview
*
* @param obj The anchorview object
* @return The markup text set or @c NULL if nothing was set or an error
* occurred
+ * @deprecated use elm_object_text_set() instead.
*/
- EAPI const char *elm_anchorview_text_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
+ EINA_DEPRECATED EAPI const char *elm_anchorview_text_get(const Evas_Object *obj) EINA_ARG_NONNULL(1);
/**
* Set the parent of the hover popup
*
return NULL;
}
+static void
+_elm_anchorview_text_set(Evas_Object *obj, const char *item, const char *text)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype);
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (item) return;
+ if (!wd) return;
+ elm_entry_entry_set(wd->entry, text);
+ if (wd->hover) evas_object_del(wd->hover);
+ if (wd->pop) evas_object_del(wd->pop);
+ wd->hover = NULL;
+ wd->pop = NULL;
+ _sizing_eval(obj);
+}
+
+static const char*
+_elm_anchorview_text_get(const Evas_Object *obj, const char *item)
+{
+ ELM_CHECK_WIDTYPE(obj, widtype) NULL;
+ Widget_Data *wd = elm_widget_data_get(obj);
+ if (item) return NULL;
+ if (!wd) return NULL;
+ return elm_entry_entry_get(wd->entry);
+}
+
EAPI Evas_Object *
elm_anchorview_add(Evas_Object *parent)
{
elm_widget_del_hook_set(obj, _del_hook);
elm_widget_theme_hook_set(obj, _theme_hook);
elm_widget_can_focus_set(obj, EINA_TRUE);
+ elm_widget_text_set_hook_set(obj, _elm_anchorview_text_set);
+ elm_widget_text_get_hook_set(obj, _elm_anchorview_text_get);
wd->scroller = elm_scroller_add(parent);
elm_widget_resize_object_set(obj, wd->scroller);
EAPI void
elm_anchorview_text_set(Evas_Object *obj, const char *text)
{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
- elm_entry_entry_set(wd->entry, text);
- if (wd->hover) evas_object_del(wd->hover);
- if (wd->pop) evas_object_del(wd->pop);
- wd->hover = NULL;
- wd->pop = NULL;
- _sizing_eval(obj);
+ _elm_anchorview_text_set(obj, NULL, text);
}
EAPI const char*
elm_anchorview_text_get(const Evas_Object *obj)
{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return NULL;
- return elm_entry_entry_get(wd->entry);
+ return _elm_anchorview_text_get(obj, NULL);
}
EAPI void