From: InHong Han Date: Mon, 22 May 2017 02:03:59 +0000 (+0900) Subject: Added mime_type_accept_set interface X-Git-Tag: accepted/tizen/unified/20170613.194644~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=82224ef8834a4c6418846bfd11d36498cfd4c28d;p=platform%2Fcore%2Fuifw%2Flibscl-core.git Added mime_type_accept_set interface Change-Id: I1a3dcf9c6ffb5d44e5e3bc2fb46b893d56d39faa --- diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index ae769cd..ae5ef80 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -163,8 +163,13 @@ static void slot_ise_show(const scim::HelperAgent *agent, int ic, char *buf, siz memcpy(&ise_context, buf, sizeof(ise_context)); if (ise_context.imdata_size > 0) { - callback->on_set_imdata(buf + sizeof(ise_context), ise_context.imdata_size); + char imdata[1024] = {0}; + memcpy((void *)imdata, buf + sizeof(ise_context), ise_context.imdata_size); + callback->on_set_imdata(imdata, ise_context.imdata_size); } + + if (len >= (sizeof(Ise_Context) + ise_context.imdata_size)) + callback->on_set_mime_type(buf + sizeof(ise_context) + ise_context.imdata_size); } else { LOGD("\n-=-= WARNING - buf %p len %d size %d \n", buf, len, sizeof(ise_context)); } @@ -597,6 +602,16 @@ static void slot_set_prediction_hint(const scim::HelperAgent *agent, const scim: } } +static void slot_set_mime_type(const scim::HelperAgent *agent, const scim::String &mime_type) { + CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); + if (impl) { + ISCLCoreEventCallback *callback = impl->get_core_event_callback(); + if (callback) { + callback->on_set_mime_type(mime_type.c_str()); + } + } +} + /* Internal input handler function */ Eina_Bool input_handler(void *data, Ecore_Fd_Handler *fd_handler) { @@ -689,6 +704,7 @@ sclboolean CSCLConnectionISF::init() m_helper_agent.signal_connect_candidate_hide(scim::slot(slot_candidate_hide)); m_helper_agent.signal_connect_process_input_device_event(scim::slot(slot_process_input_device_event)); m_helper_agent.signal_connect_set_prediction_hint(scim::slot(slot_set_prediction_hint)); + m_helper_agent.signal_connect_set_mime_type(scim::slot(slot_set_mime_type)); m_initialized = TRUE; } diff --git a/src/sclcorecallback.h b/src/sclcorecallback.h index 054049a..5a44f99 100644 --- a/src/sclcorecallback.h +++ b/src/sclcorecallback.h @@ -90,6 +90,7 @@ struct ISCLCoreEventCallback { virtual void on_process_input_device_event(sclu32 &type, sclchar *data, size_t &len, sclu32 *ret) {} virtual void on_set_prediction_hint(const sclchar *prediction_hint) {} + virtual void on_set_mime_type(const sclchar *mime_type) {} ISCLCoreEventCallback() { /* Current callback interface version is 1.1 */