From dbd35fd8c3434b4e01f305df705a87c658a2744e Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Mon, 19 Dec 2016 16:57:17 +0900 Subject: [PATCH] Implemented interface for restoring ISE option window Change-Id: I1fc7b8cbc342feec47db7bbcff787fcfeb41b0ff --- src/sclconnection-isf.cpp | 12 ++++++++++++ src/sclcoreui-efl.cpp | 34 ++++++++++++++++++++++++++++++++-- src/sclcoreui-efl.h | 1 + src/sclcoreui.cpp | 11 ++++++++++- src/sclcoreui.h | 5 +++++ 5 files changed, 60 insertions(+), 3 deletions(-) diff --git a/src/sclconnection-isf.cpp b/src/sclconnection-isf.cpp index 676f8d3..dab23d1 100644 --- a/src/sclconnection-isf.cpp +++ b/src/sclconnection-isf.cpp @@ -521,6 +521,17 @@ static void slot_show_ise_option_window(const scim::HelperAgent *agent, int ic, } } +static void slot_resume_ise_option_window(const scim::HelperAgent *agent, int ic, const scim::String &uuid) { + CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); + if (impl) { + CSCLCoreUI *core_ui = impl->get_core_ui(); + if (core_ui) { + LOGD("slot_resume_ise_option_window() called!!!\n"); + core_ui->show_option_window(OPTION_WINDOW_TYPE_SETTING_APPLICATION); + } + } +} + static void slot_check_ise_option_window(const scim::HelperAgent *agent, sclu32 &avail) { CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); if (impl) { @@ -667,6 +678,7 @@ sclboolean CSCLConnectionISF::init() m_helper_agent.signal_connect_associate_table_page_down(scim::slot(slot_associate_table_page_down)); m_helper_agent.signal_connect_update_associate_table_page_size(scim::slot(slot_update_associate_table_page_size)); m_helper_agent.signal_connect_show_option_window(scim::slot(slot_show_ise_option_window)); + m_helper_agent.signal_connect_resume_option_window(scim::slot(slot_resume_ise_option_window)); m_helper_agent.signal_connect_check_option_window(scim::slot(slot_check_ise_option_window)); m_helper_agent.signal_connect_process_key_event(scim::slot(slot_process_key_event)); m_helper_agent.signal_connect_candidate_show(scim::slot(slot_candidate_show)); diff --git a/src/sclcoreui-efl.cpp b/src/sclcoreui-efl.cpp index 99a4728..93de8c0 100644 --- a/src/sclcoreui-efl.cpp +++ b/src/sclcoreui-efl.cpp @@ -612,7 +612,7 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) sclboolean ret = false; callback->on_check_option_window_availability(&ret); if (ret == false) { - LOGW("on_create_option_window() is not available\n"); + LOGW("option_window not available\n"); return SCLWINDOW_INVALID; } } else { @@ -655,7 +655,6 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) set_transient_for_app_window(window); } else if (type == OPTION_WINDOW_TYPE_SETTING_APPLICATION) { set_transient_for_isf_setting_window(window); - evas_object_show(window); } m_option_window_info[type].window = window; @@ -663,6 +662,37 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type) return window; } +bool CSCLCoreUIEFL::show_option_window(SCLOptionWindowType type) +{ + if (type < 0 || type >= OPTION_WINDOW_TYPE_MAX) { + return SCLWINDOW_INVALID; + } + + ISCLCoreEventCallback *callback = NULL; + CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); + if (impl) { + callback = impl->get_core_event_callback(); + if (callback) { + sclboolean ret = false; + callback->on_check_option_window_availability(&ret); + if (ret == false) { + LOGW("option_window not available\n"); + return false; + } + } else { + return false; + } + } + + if (m_option_window_info[type].window != SCLWINDOW_INVALID) { + evas_object_show(static_cast(m_option_window_info[type].window)); + elm_win_raise(static_cast(m_option_window_info[type].window)); + return true; + } + + return false; +} + void CSCLCoreUIEFL::destroy_option_window(sclwindow window) { CSCLCoreImpl *impl = CSCLCoreImpl::get_instance(); diff --git a/src/sclcoreui-efl.h b/src/sclcoreui-efl.h index ee0e9f7..30d0331 100644 --- a/src/sclcoreui-efl.h +++ b/src/sclcoreui-efl.h @@ -50,6 +50,7 @@ public: virtual int get_screen_rotation_degree(); virtual sclwindow create_option_window(SCLOptionWindowType type); + virtual bool show_option_window(SCLOptionWindowType type); virtual void destroy_option_window(sclwindow window); void set_screen_rotation_degree(int degree); diff --git a/src/sclcoreui.cpp b/src/sclcoreui.cpp index e7ea1f6..500868c 100644 --- a/src/sclcoreui.cpp +++ b/src/sclcoreui.cpp @@ -101,6 +101,15 @@ sclwindow CSCLCoreUI::create_option_window(SCLOptionWindowType type) return ret; } +bool CSCLCoreUI::show_option_window(SCLOptionWindowType type) +{ + bool ret = false; + if (m_impl) { + ret = m_impl->show_option_window(type); + } + return ret; +} + void CSCLCoreUI::destroy_option_window(sclwindow window) { if (m_impl) { @@ -113,4 +122,4 @@ void CSCLCoreUI::process_keyboard_ui_state_change(KEYBOARD_UI_STATE state) if (m_impl) { m_impl->process_keyboard_ui_state_change(state); } -} \ No newline at end of file +} diff --git a/src/sclcoreui.h b/src/sclcoreui.h index ad15281..12abdf1 100644 --- a/src/sclcoreui.h +++ b/src/sclcoreui.h @@ -74,6 +74,11 @@ public: virtual sclwindow create_option_window(SCLOptionWindowType type); /** + * @brief Requests to show existing option window + */ + virtual bool show_option_window(SCLOptionWindowType type); + + /** * @brief Requests to destroy an option window */ virtual void destroy_option_window(sclwindow window); -- 2.7.4