#include "isf_demo_efl.h"
#include "isf_mime_type_efl.h"
+static Evas_Object *item_provider(void *data, Evas_Object *en, const char *item)
+{
+ Evas_Object *obj = NULL;
+
+ obj = elm_image_add(en);
+ elm_image_file_set(obj, item, NULL);
+ elm_image_animated_set(obj, EINA_TRUE);
+ elm_image_animated_play_set(obj, EINA_TRUE);
+ evas_object_show(obj);
+
+ return obj;
+}
+
+static void _imf_event_commit_content_cb(void *data, Ecore_IMF_Context *ctx, void *event_info)
+{
+ Ecore_IMF_Event_Commit_Content *commit_content = (Ecore_IMF_Event_Commit_Content *)event_info;
+ Evas_Object *obj = (Evas_Object *)data;
+
+ if (!commit_content || !obj) return;
+
+ char buf[4096];
+ const char *text = elm_object_text_get(obj);
+ if (text)
+ snprintf(buf, sizeof(buf), "%s<br><item absize=300x300 vsize=full href=%s></item>", text, commit_content->content_uri);
+ else
+ snprintf(buf, sizeof(buf), "<item absize=300x300 vsize=full href=%s></item>", commit_content->content_uri);
+
+ elm_object_text_set(obj, buf);
+ elm_entry_cursor_end_set(obj);
+ evas_object_show(obj);
+}
+
static Evas_Object *_create_ef_layout (Evas_Object *parent, const char *label, const char *guide_text, const char *mime_type)
{
Evas_Object *en;
ic = (Ecore_IMF_Context *)elm_entry_imf_context_get (en);
ecore_imf_context_mime_type_accept_set (ic, mime_type);
+ elm_entry_single_line_set (en, EINA_FALSE);
+ ecore_imf_context_event_callback_add(ic, ECORE_IMF_CALLBACK_COMMIT_CONTENT, _imf_event_commit_content_cb, (void *)en);
+ elm_entry_item_provider_append(en, item_provider, NULL);
return ef;
}