- * Get the input method context in the entry widget
- *
- * @param obj The entry object
- * @return The input method context
- *
- * @ingroup Entry
- */
-EAPI Ecore_IMF_Context *elm_entry_imf_context_get(Evas_Object *obj)
-{
- ELM_CHECK_WIDTYPE(obj, widtype) NULL;
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd || !wd->ent) return NULL;
-
- return edje_object_part_text_imf_context_get(wd->ent, "elm.text");
-}
-
-/**
- * Set whether entry should enable the return key on soft keyboard automatically
- *
- * @param obj The entry object
- * @param on If true, entry enables the return key on soft keyboard automatically.
- *
- * @ingroup Entry
- */
-EAPI void
-elm_entry_autoenable_returnkey_set(Evas_Object *obj, Eina_Bool on)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
-
- wd->autoreturnkey = on;
- _check_enable_returnkey(obj);
-}
-
-/**
- * Set whether entry should support auto capitalization
- *
- * @param obj The entry object
- * @param on If true, entry suports auto capitalization.
- *
- * @ingroup Entry
- */
-EAPI void
-elm_entry_autocapitalization_set(Evas_Object *obj, Eina_Bool autocap)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
-
- if (wd->password)
- wd->autocapital = EINA_FALSE;
- else
- wd->autocapital = autocap;
-
- if (wd->input_panel_layout == ELM_INPUT_PANEL_LAYOUT_URL ||
- wd->input_panel_layout == ELM_INPUT_PANEL_LAYOUT_EMAIL)
- wd->autocapital = EINA_FALSE;
-
- edje_object_part_text_autocapitalization_set(wd->ent, "elm.text", wd->autocapital);
-}
-
-/**
- * Set whether entry should support auto period
- *
- * @param obj The entry object
- * @param on If true, entry suports auto period.
- *
- * @ingroup Entry
- */
-EAPI void
-elm_entry_autoperiod_set(Evas_Object *obj, Eina_Bool autoperiod)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- if (!wd) return;
-
- if (wd->password)
- wd->autoperiod = EINA_FALSE;
- else
- wd->autoperiod = autoperiod;
-
- if (wd->input_panel_layout == ELM_INPUT_PANEL_LAYOUT_URL ||
- wd->input_panel_layout == ELM_INPUT_PANEL_LAYOUT_EMAIL)
- wd->autoperiod = EINA_FALSE;
-
- edje_object_part_text_autoperiod_set(wd->ent, "elm.text", wd->autoperiod);
-}
-
-/**
- * Set the font size on the entry object
- *
- * @param obj The entry object
- * @param size font size
- *
- * @ingroup Entry
- */
-EAPI void
-elm_entry_fontsize_set(Evas_Object *obj, int fontsize)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- Eina_Strbuf *fontbuf = NULL;
- int removeflag = 0;
- const char *t;
-
- if (!wd) return;
- t = eina_stringshare_add(elm_entry_entry_get(obj));
- fontbuf = eina_strbuf_new();
- eina_strbuf_append_printf(fontbuf, "%d", fontsize);
-
- if (fontsize == 0) removeflag = 1; // remove fontsize tag
-
- if (_stringshare_key_value_replace(&t, "font_size", eina_strbuf_string_get(fontbuf), removeflag) == 0)
- {
- elm_entry_entry_set(obj, t);
- wd->changed = 1;
- _sizing_eval(obj);
- }
- eina_strbuf_free(fontbuf);
- eina_stringshare_del(t);
-}
-
-/**
- * Set the text align on the entry object
- *
- * @param obj The entry object
- * @param align align mode
- *
- * @ingroup Entry
- */
-EAPI void
-elm_entry_text_align_set(Evas_Object *obj, const char *alignmode)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- int len;
- const char *t;
-
- if (!wd) return;
- t = eina_stringshare_add(elm_entry_entry_get(obj));
- len = strlen(t);
- if (len <= 0) return;
-
- if (_stringshare_key_value_replace(&t, "align", alignmode, 0) == 0)
- elm_entry_entry_set(obj, t);
-
- wd->changed = 1;
- _sizing_eval(obj);
- eina_stringshare_del(t);
-}
-
-/**
- * Set the text color on the entry object
- *
- * @param obj The entry object
- * @param r Red property background color of The entry object
- * @param g Green property background color of The entry object
- * @param b Blue property background color of The entry object
- * @param a Alpha property background alpha of The entry object
- *
- * @ingroup Entry
- */
-EAPI void
-elm_entry_text_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- Eina_Strbuf *colorbuf = NULL;
- const char *t;
- int len;
-
- if (!wd) return;
- t = eina_stringshare_add(elm_entry_entry_get(obj));
- len = strlen(t);
- if (len <= 0) return;
- colorbuf = eina_strbuf_new();
- eina_strbuf_append_printf(colorbuf, "#%02X%02X%02X%02X", r, g, b, a);
-
- if (_stringshare_key_value_replace(&t, "color", eina_strbuf_string_get(colorbuf), 0) == 0)
- {
- elm_entry_entry_set(obj, t);
- wd->changed = 1;
- _sizing_eval(obj);
- }
- eina_strbuf_free(colorbuf);
- eina_stringshare_del(t);
-}
-
-/**
- * Set background color of the entry
- *
- * @param obj The entry object
- * @param r Red property background color of The entry object
- * @param g Green property background color of The entry object
- * @param b Blue property background color of The entry object
- * @param a Alpha property background alpha of The entry object
- * @ingroup Entry
- */
-EAPI void
-elm_entry_background_color_set(Evas_Object *obj, unsigned int r, unsigned int g, unsigned int b, unsigned int a)
-{
- ELM_CHECK_WIDTYPE(obj, widtype);
- Widget_Data *wd = elm_widget_data_get(obj);
- evas_object_color_set(wd->bg, r, g, b, a);
-
- if (wd->bgcolor == EINA_FALSE)
- {
- wd->bgcolor = 1;
- edje_object_part_swallow(wd->ent, "entry.swallow.background", wd->bg);
- }
-}
-
-/**
- * Filter inserted text based on user defined character and byte limits