2 * ISF(Input Service Framework)
4 * ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable.
5 * Copyright (c) 2000 - 2011 Samsung Electronics Co., Ltd. All rights reserved.
7 * Contact: Shuo Liu <shuo0805.liu@samsung.com>, Jihoon Kim <jihoon48.kim@samsung.com>
9 * This library is free software; you can redistribute it and/or modify it under
10 * the terms of the GNU Lesser General Public License as published by the
11 * Free Software Foundation; either version 2.1 of the License, or (at your option)
14 * This library is distributed in the hope that it will be useful, but WITHOUT ANY
15 * WARRANTY; without even the implied warranty of MERCHANTABILITY or
16 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
17 * License for more details.
19 * You should have received a copy of the GNU Lesser General Public License
20 * along with this library; if not, write to the Free Software Foundation, Inc., 51
21 * Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
25 #include "isf_demo_efl.h"
26 #include "isf_return_key_disable_efl.h"
29 _cursor_changed_cb(void *data, Evas_Object *obj, void *event_info)
31 Evas_Object *en = obj;
33 int pos = elm_entry_cursor_pos_get (en);
36 elm_entry_input_panel_return_key_disabled_set (en, EINA_TRUE);
39 elm_entry_input_panel_return_key_disabled_set (en, EINA_FALSE);
43 static Evas_Object *_create_ef_layout (Evas_Object *parent, const char *label, const char *guide_text)
45 Evas_Object *ef = NULL;
46 ef = _create_ef(parent,label,guide_text);
47 Evas_Object *en = elm_object_part_content_get(ef,"elm.swallow.content");
48 evas_object_smart_callback_add (en, "cursor,changed", _cursor_changed_cb, NULL);
53 static void add_layout_to_conformant (void *data, Evas_Object *lay_in, const char *title)
55 Evas_Object *scroller = NULL;
56 Evas_Object *win = NULL;
57 Evas_Object *conform = NULL;
58 struct appdata *ad = NULL;
60 ad = (struct appdata *) data;
63 // Enabling illume notification property for window
64 elm_win_conformant_set (win, EINA_TRUE);
66 // Creating conformant widget
67 conform = elm_conformant_add (win);
68 evas_object_size_hint_weight_set (conform, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
69 evas_object_show (conform);
71 scroller = elm_scroller_add (ad->naviframe);
73 elm_scroller_bounce_set (scroller, EINA_FALSE, EINA_TRUE);
74 evas_object_show (scroller);
76 elm_object_content_set (scroller, lay_in);
77 elm_object_content_set (conform, scroller);
78 elm_naviframe_item_push (ad->naviframe, title, NULL, NULL, conform, NULL);
81 static Evas_Object * create_inner_layout (void *data)
83 struct appdata *ad = (struct appdata *)data;
84 Evas_Object *bx = NULL ;
85 Evas_Object *ef = NULL ;
87 Evas_Object *parent = ad->naviframe;
89 bx = elm_box_add (parent);
90 evas_object_size_hint_weight_set (bx, EVAS_HINT_EXPAND, 0.0);
91 evas_object_size_hint_align_set (bx, EVAS_HINT_FILL, 0.0);
92 evas_object_show (bx);
94 /* Prediction allow : TRUE */
95 ef = _create_ef_layout (parent, _("Return Key Disable"), _("Return Key will be activated when any key is pressed"));
96 elm_box_pack_end (bx, ef);
101 void ise_return_key_disable_bt (void *data, Evas_Object *obj, void *event_info)
103 Evas_Object *lay_inner = create_inner_layout (data);
104 add_layout_to_conformant (data, lay_inner, _("Return Key Disable"));
108 vi:ts=4:ai:nowrap:expandtab