From a9fea747cc2dc04a0fded175e9a6ec8b18315cce Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 19 Dec 2016 17:45:10 +0900 Subject: [PATCH] Added interface for restoring ISE option window Change-Id: I1025105933d1c75bde828ed9a7d0d10c6a6721e8 --- .../ecore_socket_panel_agent_module.cpp | 23 +++++++++++++ ism/src/isf_control.cpp | 17 ++++++++++ ism/src/isf_control.h | 13 ++++++++ ism/src/isf_imcontrol_client.cpp | 9 +++++ ism/src/isf_imcontrol_client.h | 1 + ism/src/isf_info_manager.cpp | 39 +++++++++++++++++++++- ism/src/isf_info_manager.h | 3 ++ ism/src/isf_message_queue.h | 16 +++++++++ ism/src/isf_panel_agent_base.cpp | 5 +++ ism/src/isf_panel_agent_base.h | 9 +++++ ism/src/isf_panel_agent_manager.cpp | 8 +++++ ism/src/isf_panel_agent_manager.h | 1 + ism/src/isf_remote_control.h | 0 ism/src/scim_helper.cpp | 21 ++++++++++++ ism/src/scim_helper.h | 10 ++++++ ism/src/scim_trans_commands.h | 1 + 16 files changed, 175 insertions(+), 1 deletion(-) mode change 100755 => 100644 ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp mode change 100755 => 100644 ism/src/isf_remote_control.h diff --git a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp old mode 100755 new mode 100644 index bbb4acd..655c27b --- a/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp +++ b/ism/modules/panelagent/ecoresocket/ecore_socket_panel_agent_module.cpp @@ -756,6 +756,18 @@ private: m_send_trans.write_to_socket(client_socket); } + void resume_helper_option_window(int client, uint32 context, const String& uuid) { + LOGD ("client id:%d\n", client); + + Socket client_socket(client); + m_send_trans.clear(); + m_send_trans.put_command(SCIM_TRANS_CMD_REPLY); + m_send_trans.put_data(context); + m_send_trans.put_data(uuid); + m_send_trans.put_command(ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW); + m_send_trans.write_to_socket(client_socket); + } + bool process_key_event(int client, uint32 context, const String& uuid, KeyEvent& key, uint32 serial) { LOGD ("client id:%d\n", client); @@ -2154,6 +2166,9 @@ private: } else if (cmd == ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW) { m_info_manager->show_ise_option_window(client_id); continue; + } else if (cmd == ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW) { + m_info_manager->resume_ise_option_window(client_id); + continue; } //FIXME @@ -2954,6 +2969,14 @@ private: LOGW ("Access denied to show ise option window\n"); send_fail_reply (client_id); } + } else if (cmd == ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW) { + if (m_info_manager->check_privilege_by_sockfd(client_id, IMEMANAGER_PRIVILEGE)) { + m_info_manager->resume_ise_option_window(client_id); + } + else { + LOGW ("Access denied to resume ise option window\n"); + send_fail_reply (client_id); + } } else if (cmd == ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST) { if (m_info_manager->check_privilege_by_sockfd(client_id, IMEMANAGER_PRIVILEGE)) { Transaction trans; diff --git a/ism/src/isf_control.cpp b/ism/src/isf_control.cpp index 80d9889..d4bda76 100644 --- a/ism/src/isf_control.cpp +++ b/ism/src/isf_control.cpp @@ -324,6 +324,23 @@ EXAPI int isf_control_open_ime_option_window (void) return isf_control_show_ise_option_window (); } +EXAPI int isf_control_resume_ime_option_window (void) +{ + IMControlClient imcontrol_client; + int ret = 0; + if (!imcontrol_client.open_connection ()) + return -1; + + imcontrol_client.prepare (); + imcontrol_client.resume_ise_option_window (); + if (!imcontrol_client.send ()) + ret = -1; + + imcontrol_client.close_connection (); + + return ret; +} + EXAPI int isf_control_get_active_ime (char **appid) { if (appid == NULL) diff --git a/ism/src/isf_control.h b/ism/src/isf_control.h index 6f26b7b..b2873d1 100644 --- a/ism/src/isf_control.h +++ b/ism/src/isf_control.h @@ -218,6 +218,19 @@ EXAPI int isf_control_get_all_ime_info (ime_info_s **info); EXAPI int isf_control_open_ime_option_window (void); /** + * @brief Requests to resume the current IME's option window. + * + * @remarks IME needs to show its option window if it has an option window that was created before and not destroyed yet. + * + * @since_tizen 3.0 + * + * @return 0 on success, otherwise return -1 + * + * @pre The availibility of IME option can be found using isf_control_get_all_ime_info() and isf_control_get_active_ime() functions. + */ +EXAPI int isf_control_resume_ime_option_window (void); + +/** * @brief Gets active IME's Application ID. * * @since_tizen 2.4 diff --git a/ism/src/isf_imcontrol_client.cpp b/ism/src/isf_imcontrol_client.cpp index 467d101..fe1778d 100644 --- a/ism/src/isf_imcontrol_client.cpp +++ b/ism/src/isf_imcontrol_client.cpp @@ -392,6 +392,10 @@ public: m_trans.put_command (ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW); } + void resume_ise_option_window (void) { + m_trans.put_command (ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW); + } + bool get_all_helper_ise_info (HELPER_ISE_INFO &info) { int cmd; std::vector appid; @@ -670,6 +674,11 @@ void IMControlClient::show_ise_option_window (void) m_impl->show_ise_option_window (); } +void IMControlClient::resume_ise_option_window (void) +{ + m_impl->resume_ise_option_window (); +} + bool IMControlClient::get_all_helper_ise_info (HELPER_ISE_INFO &info) { return m_impl->get_all_helper_ise_info (info); diff --git a/ism/src/isf_imcontrol_client.h b/ism/src/isf_imcontrol_client.h index 8e26611..fb55db4 100644 --- a/ism/src/isf_imcontrol_client.h +++ b/ism/src/isf_imcontrol_client.h @@ -56,6 +56,7 @@ public: bool set_initial_ise_by_uuid (const char* uuid); void show_ise_selector (); void show_ise_option_window (); + void resume_ise_option_window (); bool get_all_helper_ise_info (HELPER_ISE_INFO &info); bool set_enable_helper_ise_info (const char *appid, bool is_enabled); diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index 14b6da7..1f8bb49 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -1260,6 +1260,24 @@ public: return false; } + + bool resume_helper_option_window (const String& uuid) { + HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid); + + if (it != m_helper_client_index.end ()) { + int client; + uint32 context; + uint32 ctx; + get_focused_context (client, context); + ctx = get_helper_ic (client, context); + LOGD ("Send ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW message"); + m_panel_agent_manager.resume_helper_option_window (it->second.id, ctx, uuid); + return true; + } + + return false; + } + //ISM_TRANS_CMD_SHOW_ISF_CONTROL void show_isf_panel (int client_id) { LOGD (""); @@ -1906,7 +1924,7 @@ public: } //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW void show_ise_option_window (int client_id) { - SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_panel ()\n"; + SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_option_window ()\n"; LOGD (""); String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String ("")); String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String ("")); @@ -1917,6 +1935,19 @@ public: } } + //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW + void resume_ise_option_window (int client_id) { + SCIM_DEBUG_MAIN (4) << "InfoManager::resume_ise_option_window ()\n"; + LOGD (""); + String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String ("")); + String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String ("")); + LOGD ("prepare to resime ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ()); + + if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) { + resume_helper_option_window (m_current_helper_uuid); + } + } + //ISM_TRANS_CMD_EXPAND_CANDIDATE void expand_candidate () { LOGD (""); @@ -4581,6 +4612,12 @@ void InfoManager::show_ise_option_window (int client_id) m_impl->show_ise_option_window (client_id); } +//ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW +void InfoManager::resume_ise_option_window (int client_id) +{ + m_impl->resume_ise_option_window (client_id); +} + //ISM_TRANS_CMD_EXPAND_CANDIDATE void InfoManager::expand_candidate () { diff --git a/ism/src/isf_info_manager.h b/ism/src/isf_info_manager.h index d709b98..6d21384 100644 --- a/ism/src/isf_info_manager.h +++ b/ism/src/isf_info_manager.h @@ -722,6 +722,9 @@ public: //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW void show_ise_option_window (int client_id); + //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW + void resume_ise_option_window (int client_id); + //ISM_TRANS_CMD_EXPAND_CANDIDATE void expand_candidate (); diff --git a/ism/src/isf_message_queue.h b/ism/src/isf_message_queue.h index 1a5873a..679465f 100644 --- a/ism/src/isf_message_queue.h +++ b/ism/src/isf_message_queue.h @@ -626,6 +626,11 @@ class MessageItemShowISEOptionWindow : public MessageItemHelper { }; +/* ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW */ +class MessageItemResumeISEOptionWindow : public MessageItemHelper +{ +}; + /* ISM_TRANS_CMD_CHECK_OPTION_WINDOW */ class MessageItemCheckOptionWindow : public MessageItemHelper { @@ -1513,6 +1518,17 @@ public: } break; } + case ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW: + { + MessageItemResumeISEOptionWindow *message = alloc_message(); + if (message) { + message->get_command_ref() = cmd; + message->get_ic_ref() = ic; + message->get_ic_uuid_ref() = ic_uuid; + m_list_messages.push_back(message); + } + break; + } case ISM_TRANS_CMD_CHECK_OPTION_WINDOW: { MessageItemCheckOptionWindow *message = alloc_message(); diff --git a/ism/src/isf_panel_agent_base.cpp b/ism/src/isf_panel_agent_base.cpp index 0d8108b..4a247c3 100644 --- a/ism/src/isf_panel_agent_base.cpp +++ b/ism/src/isf_panel_agent_base.cpp @@ -300,6 +300,11 @@ void PanelAgentBase::show_helper_option_window (int client, uint32 context, cons LOGW ("not implemented for %s", m_name.c_str ()); } +void PanelAgentBase::resume_helper_option_window (int client, uint32 context, const String& uuid) +{ + LOGW ("not implemented for %s", m_name.c_str ()); +} + bool PanelAgentBase::process_key_event (int client, uint32 context, const String& uuid, KeyEvent& key, uint32 serial) { LOGW ("not implemented for %s", m_name.c_str ()); diff --git a/ism/src/isf_panel_agent_base.h b/ism/src/isf_panel_agent_base.h index 9c3ae2b..36335e8 100644 --- a/ism/src/isf_panel_agent_base.h +++ b/ism/src/isf_panel_agent_base.h @@ -467,6 +467,15 @@ public: virtual void show_helper_option_window (int client, uint32 context, const String& uuid); /** + * @brief resume_helper_option_window. + * + * @param + * + * @return none. + */ + virtual void resume_helper_option_window (int client, uint32 context, const String& uuid); + + /** * @brief process_key_event. * * @param diff --git a/ism/src/isf_panel_agent_manager.cpp b/ism/src/isf_panel_agent_manager.cpp index 0f1e646..7ae0a51 100644 --- a/ism/src/isf_panel_agent_manager.cpp +++ b/ism/src/isf_panel_agent_manager.cpp @@ -490,6 +490,14 @@ void PanelAgentManager::show_helper_option_window (int id, uint32 context_id, co _p->show_helper_option_window (id, context_id, uuid); } +void PanelAgentManager::resume_helper_option_window (int id, uint32 context_id, const String& uuid) +{ + PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id); + + if (!_p.null ()) + _p->resume_helper_option_window (id, context_id, uuid); +} + bool PanelAgentManager::process_key_event (int id, uint32 context_id, const String& uuid, KeyEvent& key, uint32 serial) { PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id); diff --git a/ism/src/isf_panel_agent_manager.h b/ism/src/isf_panel_agent_manager.h index b1d4b20..f766a75 100644 --- a/ism/src/isf_panel_agent_manager.h +++ b/ism/src/isf_panel_agent_manager.h @@ -306,6 +306,7 @@ public: void set_helper_bidi_direction (int client, uint32 context, const String& uuid, uint32& direction); void set_helper_caps_mode (int client, uint32 context, const String& uuid, uint32& mode); void show_helper_option_window (int client, uint32 context, const String& uuid); + void resume_helper_option_window (int client, uint32 context, const String& uuid); bool process_key_event (int client, uint32 context, const String& uuid, KeyEvent& key, uint32 serial); bool get_helper_geometry (int client, uint32 context, String& uuid, _OUT_ struct rectinfo& info); void get_helper_imdata (int client, uint32 context, String& uuid, _OUT_ char** imdata, _OUT_ size_t& len); diff --git a/ism/src/isf_remote_control.h b/ism/src/isf_remote_control.h old mode 100755 new mode 100644 diff --git a/ism/src/scim_helper.cpp b/ism/src/scim_helper.cpp index c6de7de..afb6947 100644 --- a/ism/src/scim_helper.cpp +++ b/ism/src/scim_helper.cpp @@ -214,6 +214,7 @@ public: HelperAgentSignalUintVoid signal_set_input_hint; HelperAgentSignalUintVoid signal_update_bidi_direction; HelperAgentSignalVoid signal_show_option_window; + HelperAgentSignalVoid signal_resume_option_window; HelperAgentSignalUintVoid signal_check_option_window; HelperAgentSignalUintCharSizeUint signal_process_input_device_event; @@ -1328,6 +1329,12 @@ HelperAgent::handle_message (MessageItem *message) m_impl->signal_show_option_window (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref()); break; } + case ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW: + { + MessageItemResumeISEOptionWindow *subclass = static_cast(message); + m_impl->signal_resume_option_window (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref()); + break; + } case ISM_TRANS_CMD_CHECK_OPTION_WINDOW: { uint32 avail = 0; @@ -3320,6 +3327,20 @@ HelperAgent::signal_connect_show_option_window (HelperAgentSlotVoid *slot) } /** + * @brief Connect a slot to Helper resume option window. + * + * This signal is used to do request the ISE to resume option window. + * + * The prototype of the slot is: + * void resume_option_window (const HelperAgent *agent, int ic, const String &uuid); + */ +Connection +HelperAgent::signal_connect_resume_option_window (HelperAgentSlotVoid *slot) +{ + return m_impl->signal_resume_option_window.connect (slot); +} + +/** * @brief Connect a slot to Helper check if the option is available. * * This signal is used to check if the option (setting) is available from Helper ISE. diff --git a/ism/src/scim_helper.h b/ism/src/scim_helper.h index 00bd158..cdaa134 100644 --- a/ism/src/scim_helper.h +++ b/ism/src/scim_helper.h @@ -1332,6 +1332,16 @@ public: Connection signal_connect_show_option_window (HelperAgentSlotVoid *slot); /** + * @brief Connect a slot to Helper resume option window. + * + * This signal is used to do request the ISE to resume option window. + * + * The prototype of the slot is: + * void resume_option_window (const HelperAgent *agent, int ic, const String &uuid); + */ + Connection signal_connect_resume_option_window (HelperAgentSlotVoid *slot); + + /** * @brief Connect a slot to Helper check if the option is available. * * This signal is used to request ISE to reply if the option (setting) is available. diff --git a/ism/src/scim_trans_commands.h b/ism/src/scim_trans_commands.h index d3a01e1..bd5ff68 100644 --- a/ism/src/scim_trans_commands.h +++ b/ism/src/scim_trans_commands.h @@ -666,6 +666,7 @@ const int ISM_TRANS_CMD_SET_INPUT_HINT = 1123; const int ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION = 1124; const int ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW = 1125; const int ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT = 1126; +const int ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW = 1127; /* ISE/Panel to IMControl */ const int ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT = 1151; -- 2.7.4