int ret = -1;
char *default_text = NULL;
char *guide_text = NULL;
- char *return_key_type = NULL;
+ char *return_key_type = _("IDS_AMEMO_BUTTON_SEND");
char *max_text_length = NULL;
+ char *cursor_position_set = NULL;
input_keyboard_deinit();
ret = app_control_get_extra_data(app_control, "max_text_length", &max_text_length);
if (ret == APP_CONTROL_ERROR_NONE) {
g_input_keyboard_data.max_text_length = atoi(max_text_length);
+ free(max_text_length);
+ }
+ ret = app_control_get_extra_data(app_control, "cursor_position_set", &cursor_position_set);
+ if (ret == APP_CONTROL_ERROR_NONE) {
+ g_input_keyboard_data.cursor_position_set = atoi(cursor_position_set);
+ free(cursor_position_set);
}
return true;
g_input_keyboard_data.default_text = NULL;
g_input_keyboard_data.guide_text = NULL;
- g_input_keyboard_data.return_key_type = NULL;
+ g_input_keyboard_data.return_key_type = _("IDS_AMEMO_BUTTON_SEND");
g_input_keyboard_data.max_text_length = KEYBOARD_EDITOR_CHAR_COUNT_MAX;
+ g_input_keyboard_data.cursor_position_set = 0;
return;
}
}
const char *getText = elm_entry_entry_get(entry);
- LOGD("button key clicked!! : getText = %s", getText);
+ SECURE_LOGD("button key clicked!! : getText = %s", getText);
+
+ char cursorPosition[512];
+ snprintf(cursorPosition, sizeof(cursorPosition), "%d", elm_entry_cursor_pos_get(entry));
char *app_id = NULL;
app_control_get_caller(app_data->source_app_control, &app_id);
app_control_set_operation(app_control, APP_CONTROL_OPERATION_DEFAULT);
set_source_caller_app_id(app_control);
free(app_id);
- reply_to_sender_by_callback(getText, "keyboard", NULL);
+ reply_to_sender_by_callback(getText, "keyboard", NULL, cursorPosition);
ui_app_exit();
-
}
void btn_clicked_cb(void *data, Evas_Object *obj, void *event_info)
{
LOGD("maxlength_cb : size = %d", KEYBOARD_EDITOR_CHAR_COUNT_MAX);
char text[512];
- snprintf(text, sizeof(text), _(MAX_TEXT_LENGTH_REACH), g_input_keyboard_data.max_text_length);
+ const char *guide = _(MAX_TEXT_LENGTH_REACH);
+ snprintf(text, sizeof(text), guide, g_input_keyboard_data.max_text_length);
show_popup_toast((const char *)text, false);
}
elm_entry_input_panel_return_key_type_set(entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
evas_object_smart_callback_add(entry, "activated", enter_keydown_cb, ad);
}
+ if (g_input_keyboard_data.cursor_position_set != 0) {
+ elm_entry_cursor_pos_set(entry, g_input_keyboard_data.cursor_position_set);
+ }
evas_object_show(entry);
elm_box_pack_end(box, entry);
Evas_Object *btn = elm_button_add(box);
- elm_object_text_set(btn, "SEND");
+ elm_object_text_set(btn, g_input_keyboard_data.return_key_type);
evas_object_size_hint_weight_set(btn, EVAS_HINT_EXPAND, 0.5);
evas_object_size_hint_align_set(btn, EVAS_HINT_FILL, EVAS_HINT_FILL);
evas_object_smart_callback_add(btn, "clicked", btn_clicked_cb, NULL);
elm_entry_input_panel_return_key_type_set(entry, ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE);
evas_object_smart_callback_add(entry, "activated", enter_keydown_cb, ad);
}
+ if (g_input_keyboard_data.cursor_position_set != 0) {
+ elm_entry_cursor_pos_set(entry, g_input_keyboard_data.cursor_position_set);
+ }
evas_object_show(entry);
elm_object_part_content_set(editfield, "elm.swallow.content", entry);