Subject: [E-devel] [PATCH] add elm_entry_input_panel_layout_set API
elm_entry_input_panel_layout_set API is high level API to call
ecore_imf_context_input_panel_layout_set (through edje).
This API will be used to set layout of input panel (such as URL, Email,
Number layout...) by application programmer.
Would you please review this patch?
Please let me know if I have to do more.
git-svn-id: http://svn.enlightenment.org/svn/e/trunk/edje@62782
7cbeb6ba-43b4-40fd-8cce-
4c39aea84d33
EDJE_EXTERNAL_PARAM_FLAGS_STATE) /**< Convenience flag that sets property as GET, SET and STATE. */
} Edje_External_Param_Flags;
+typedef enum
+{
+ EDJE_INPUT_PANEL_LAYOUT_NORMAL, /**< Default layout */
+ EDJE_INPUT_PANEL_LAYOUT_NUMBER, /**< Number layout */
+ EDJE_INPUT_PANEL_LAYOUT_EMAIL, /**< Email layout */
+ EDJE_INPUT_PANEL_LAYOUT_URL, /**< URL layout */
+ EDJE_INPUT_PANEL_LAYOUT_PHONENUMBER, /**< Phone Number layout */
+ EDJE_INPUT_PANEL_LAYOUT_IP, /**< IP layout */
+ EDJE_INPUT_PANEL_LAYOUT_MONTH, /**< Month layout */
+ EDJE_INPUT_PANEL_LAYOUT_NUMBERONLY, /**< Number Only layout */
+ EDJE_INPUT_PANEL_LAYOUT_INVALID
+} Edje_Input_Panel_Layout;
/**
* @brief Converts type identifier to string nicer representation.
EAPI int edje_object_part_text_cursor_pos_get (const Evas_Object *obj, const char *part, Edje_Cursor cur);
/**
+ * @brief Set the layout of the input panel.
+ *
+ * The layout of the inptu panel or virtual keyboard can make it easier or
+ * harder to enter content. This allows you to hint what kind of input you
+ * are expecting to enter and thus have the input panel automatically
+ * come up with the right mode.
+ *
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ * @param layout layout type
+ * @since 1.1
+ */
+EAPI void edje_object_part_text_input_panel_layout_set (const Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout);
+
+/**
+ * @brief Get the layout of the input panel.
+ *
+ * @param obj A valid Evas_Object handle
+ * @param part The part name
+ *
+ * @return Layout type of the input panel
+ *
+ * @see edje_object_part_text_input_panel_layout_set
+ * @since 1.1
+ */
+EAPI Edje_Input_Panel_Layout edje_object_part_text_input_panel_layout_get (const Evas_Object *obj, const char *part);
+
+/**
* Add a filter function for newly inserted text.
*
* Whenever text is inserted (not the same as set) into the given @p part,
return evas_textblock_cursor_pos_get(c);
}
+void
+_edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout)
+{
+ Entry *en = rp->entry_data;
+ if (!en) return;
+#ifdef HAVE_ECORE_IMF
+ if (en->imf_context)
+ ecore_imf_context_input_panel_layout_set(en->imf_context, layout);
+#endif
+}
+
+Edje_Input_Panel_Layout
+_edje_entry_input_panel_layout_get(Edje_Real_Part *rp)
+{
+ Entry *en = rp->entry_data;
+ if ((!en) || (!en->imf_context)) return EDJE_INPUT_PANEL_LAYOUT_INVALID;
+#ifdef HAVE_ECORE_IMF
+ if (en->imf_context)
+ return ecore_imf_context_input_panel_layout_get(en->imf_context);
+#endif
+
+ return EDJE_INPUT_PANEL_LAYOUT_INVALID;
+}
+
static void
_edje_entry_imf_context_reset(Entry *en)
{
const char *_edje_entry_cursor_content_get(Edje_Real_Part *rp, Edje_Cursor cur);
void _edje_entry_cursor_pos_set(Edje_Real_Part *rp, Edje_Cursor cur, int pos);
int _edje_entry_cursor_pos_get(Edje_Real_Part *rp, Edje_Cursor cur);
-
+void _edje_entry_input_panel_layout_set(Edje_Real_Part *rp, Edje_Input_Panel_Layout layout);
+Edje_Input_Panel_Layout _edje_entry_input_panel_layout_get(Edje_Real_Part *rp);
+
void _edje_external_init();
void _edje_external_shutdown();
Evas_Object *_edje_external_type_add(const char *type_name, Evas *evas, Evas_Object *parent, const Eina_List *params, const char *part_name);
}
EAPI void
+edje_object_part_text_input_panel_layout_set(const Evas_Object *obj, const char *part, Edje_Input_Panel_Layout layout)
+{
+ Edje *ed;
+ Edje_Real_Part *rp;
+
+ ed = _edje_fetch(obj);
+ 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)
+ {
+ return _edje_entry_input_panel_layout_set(rp, layout);
+ }
+}
+
+EAPI Edje_Input_Panel_Layout
+edje_object_part_text_input_panel_layout_get(const Evas_Object *obj, const char *part)
+{
+ Edje *ed;
+ Edje_Real_Part *rp;
+
+ ed = _edje_fetch(obj);
+ if ((!ed) || (!part)) return EDJE_INPUT_PANEL_LAYOUT_INVALID;
+ rp = _edje_real_part_recursive_get(ed, part);
+ if (!rp) return EINA_FALSE;
+ if (rp->part->entry_mode > EDJE_ENTRY_EDIT_MODE_NONE)
+ {
+ return _edje_entry_input_panel_layout_get(rp);
+ }
+ return EDJE_INPUT_PANEL_LAYOUT_INVALID;
+}
+
+EAPI void
edje_object_text_insert_filter_callback_add(Evas_Object *obj, const char *part, Edje_Text_Filter_Cb func, void *data)
{
Edje *ed;