char *default_text;
char *return_key_type;
int max_text_length;
+ int cursor_position_set;
};
typedef struct _InputKeyboardData InputKeyboardData;
void _app_terminate(void* user_data);
void reply_to_sender_by_callback_for_back();
-void reply_to_sender_by_callback(const char *value, const char *type, const char *path[]);
+void reply_to_sender_by_callback(const char *value, const char *type, const char *path[], const char *cursor_pos);
char* get_resource_path();
char* get_shared_resource_path();
void show_gl_focus(Eina_Bool bVisible);
if(path){
PRINTFUNC(DLOG_DEBUG, "path=%s", path);
char *pathes[] = {path, };
- reply_to_sender_by_callback(NULL, "image", (const char **)pathes);
+ reply_to_sender_by_callback(NULL, "image", (const char **)pathes, NULL);
free(path);
}
ui_app_exit();
const Eina_Unicode unicode_event[2] = { (Eina_Unicode)emoticon_info[index].code, 0 };
char* utf_8 = eina_unicode_unicode_to_utf8(unicode_event, &length);
- reply_to_sender_by_callback((const char*)utf_8, "emoticon", NULL);
+ reply_to_sender_by_callback((const char*)utf_8, "emoticon", NULL, NULL);
PRINTFUNC(SECURE_DEBUG, "[%d]%s", index, utf_8);
if (utf_8)
char *guide_text = NULL;
char *return_key_type = "SEND";
char *max_text_length = NULL;
+ char *cursor_position_set = "0";
input_keyboard_deinit();
if (ret == APP_CONTROL_ERROR_NONE) {
g_input_keyboard_data.max_text_length = atoi(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);
+ }
return true;
}
g_input_keyboard_data.guide_text = NULL;
g_input_keyboard_data.return_key_type = "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);
+ 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);
if (app_id != NULL)
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)
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);
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);
char *reply = input_smartreply_get_nth_item(index, &type);
if (reply) {
input_smartreply_send_feedback(reply);
- reply_to_sender_by_callback(reply, "smartreply", NULL);
+ reply_to_sender_by_callback(reply, "smartreply", NULL, NULL);
free(reply);
elm_exit();
}
const std::vector<TemplateData> template_list = input_template_get_list();
if (index < (int)template_list.size()) {
- reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template", NULL);
+ reply_to_sender_by_callback(gettext(template_list[index].text.c_str()), "template", NULL, NULL);
ui_app_exit();
}
}
}
}
-void reply_to_sender_by_callback(const char *value, const char *type, const char *path[])
+void reply_to_sender_by_callback(const char *value, const char *type, const char *path[], const char *cursor_position)
{
PRINTFUNC(DLOG_DEBUG, "");
app_control_add_extra_data_array(app_control, APP_CONTROL_DATA_PATH, path, 1);
}
+ if (cursor_position != NULL)
+ app_control_add_extra_data(app_control, "cursor_position_get", cursor_position);
+
set_source_caller_app_id(app_control);
ret = app_control_reply_to_launch_request(app_control, app_data->source_app_control, APP_CONTROL_RESULT_SUCCEEDED);
}
if (app_data->app_type == APP_TYPE_STT || app_data->app_type == APP_TYPE_EMOTICON || app_data->app_type == APP_TYPE_KEYBOARD){
PRINTFUNC(DLOG_DEBUG, "launched as STT/EMOTICON/KEYBOARD mode, So exit here.");
- reply_to_sender_by_callback(NULL, NULL, NULL);
+ reply_to_sender_by_callback(NULL, NULL, NULL, NULL);
ui_app_exit();
}
}
if (!vr)
filePath = vr->file_path;
char *path[] = {filePath, };
- reply_to_sender_by_callback(result_text.c_str(), "voice", (const char **)path);
+ reply_to_sender_by_callback(result_text.c_str(), "voice", (const char **)path, NULL);
destroy_voice();
powerUnlock();
ui_app_exit();