prediction hint can be used to provide an intelligent reply suggestion.
@feature
#endif
}
+void
+_edje_entry_prediction_hint_set(Edje_Real_Part *rp, const char *prediction_hint)
+{
+ Entry *en;
+
+ if ((rp->type != EDJE_RP_TYPE_TEXT) ||
+ (!rp->typedata.text)) return;
+ en = rp->typedata.text->entry_data;
+ if (!en) return;
+#ifdef HAVE_ECORE_IMF
+ if (en->imf_context)
+ ecore_imf_context_prediction_hint_set(en->imf_context, prediction_hint);
+#else
+ (void)prediction_hint;
+#endif
+}
+
#ifdef HAVE_ECORE_IMF
static Edje_Real_Part *
ondemand: bool; [[If $true, the input panel will be shown in case of only Mouse up event. (Focus event will be ignored.)]]
}
}
+ @property part_text_prediction_hint {
+ set {
+ [[Sets the prediction hint to use an intelligent reply suggestion service.
+
+ @since 1.20.0]]
+ }
+ keys {
+ part: string; [[The part name]]
+ }
+ values {
+ prediction_hint: string; [[Prediction hint]]
+ }
+ }
/* TEXT PART APIS END ------------------------------------------------ */
@property seat {
Eina_Bool _edje_entry_input_panel_return_key_disabled_get(Edje_Real_Part *rp);
void _edje_entry_input_panel_show_on_demand_set(Edje_Real_Part *rp, Eina_Bool ondemand);
Eina_Bool _edje_entry_input_panel_show_on_demand_get(Edje_Real_Part *rp);
+void _edje_entry_prediction_hint_set(Edje_Real_Part *rp, const char *prediction_hint);
Eina_Bool _edje_entry_hide_visible_password(Edje *edje, Edje_Real_Part *rp);
void _edje_external_init(void);
return ret;
}
+EOLIAN void
+_edje_object_part_text_prediction_hint_set(Eo *obj EINA_UNUSED, Edje *ed, const char *part, const char *prediction_hint)
+{
+ Edje_Real_Part *rp;
+
+ if ((!ed) || (!part)) return;
+ rp = _edje_real_part_recursive_get(&ed, part);
+ if (!rp) return;
+ if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+ {
+ _edje_entry_prediction_hint_set(rp, prediction_hint);
+ }
+}
+
Eina_Bool
_edje_efl_container_content_set(Edje *ed, const char *part, Efl_Gfx *obj_swallow)
{
(sd->entry_edje, "elm.text", sd->input_panel_return_key_disabled);
edje_object_part_text_input_panel_show_on_demand_set
(sd->entry_edje, "elm.text", sd->input_panel_show_on_demand);
+ edje_object_part_text_prediction_hint_set
+ (sd->entry_edje, "elm.text", sd->prediction_hint);
// elm_entry_cursor_pos_set -> cursor,changed -> widget_show_region_set
// -> smart_objects_calculate will call all smart calculate functions,
}
ELM_SAFE_FREE(sd->delay_write, ecore_timer_del);
free(sd->input_panel_imdata);
+
+ if (sd->prediction_hint)
+ {
+ ELM_SAFE_FREE(sd->prediction_hint, free);
+ }
+
eina_stringshare_del(sd->anchor_hover.hover_style);
evas_event_thaw(evas_object_evas_get(obj));
}
EOLIAN static void
+_elm_entry_prediction_hint_set(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd, const char *prediction_hint)
+{
+ if (sd->prediction_hint)
+ free(sd->prediction_hint);
+
+ sd->prediction_hint = strdup(prediction_hint);
+
+ edje_object_part_text_prediction_hint_set
+ (sd->entry_edje, "elm.text", prediction_hint);
+}
+
+EOLIAN static void
_elm_entry_imf_context_reset(Eo *obj EINA_UNUSED, Elm_Entry_Data *sd)
{
edje_object_part_text_imf_context_reset(sd->entry_edje, "elm.text");
@in data: void_ptr @optional; [[User data to pass to $func.]]
}
}
+ prediction_hint_set {
+ [[Sets the prediction hint to use an intelligent reply suggestion service.]]
+ params {
+ prediction_hint: string; [[The prediction hint text.]]
+ }
+ }
}
implements {
class.constructor;
/* for deferred appending */
Ecore_Idler *append_text_idler;
char *append_text_left;
+ char *prediction_hint;
int append_text_position;
int append_text_len;
/* Only for clipboard */