Implemented interface for restoring ISE option window 96/105696/1
authorJi-hoon Lee <dalton.lee@samsung.com>
Mon, 19 Dec 2016 07:57:17 +0000 (16:57 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Mon, 19 Dec 2016 07:57:17 +0000 (16:57 +0900)
Change-Id: I1fc7b8cbc342feec47db7bbcff787fcfeb41b0ff

src/sclconnection-isf.cpp
src/sclcoreui-efl.cpp
src/sclcoreui-efl.h
src/sclcoreui.cpp
src/sclcoreui.h

index 676f8d3..dab23d1 100644 (file)
@@ -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));
index 99a4728..93de8c0 100644 (file)
@@ -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<Evas_Object*>(m_option_window_info[type].window));
+        elm_win_raise(static_cast<Evas_Object*>(m_option_window_info[type].window));
+        return true;
+    }
+
+    return false;
+}
+
 void CSCLCoreUIEFL::destroy_option_window(sclwindow window)
 {
     CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
index ee0e9f7..30d0331 100644 (file)
@@ -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);
index e7ea1f6..500868c 100644 (file)
@@ -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
+}
index ad15281..12abdf1 100644 (file)
@@ -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);