Add on_check_option_window_availability() 97/40897/1
authorSungmin Kwak <sungmin.kwak@samsung.com>
Fri, 27 Mar 2015 05:09:58 +0000 (14:09 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 10 Jun 2015 07:24:10 +0000 (16:24 +0900)
Change-Id: I49d945f847f8a3a9708b5c09e741cbc18454bb36

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

index de8ce57..65b6e60 100644 (file)
@@ -486,6 +486,16 @@ static void slot_show_ise_option_window (const scim::HelperAgent *agent, int ic,
     }
 }
 
+static void slot_check_ise_option_window (const scim::HelperAgent *agent, sclu32 &avail) {
+    CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
+    if (impl) {
+        ISCLCoreEventCallback *callback = impl->get_core_event_callback();
+        if (callback) {
+            callback->on_check_option_window_availability(reinterpret_cast<sclboolean *>(&avail));
+        }
+    }
+}
+
 static void slot_process_key_event (const scim::HelperAgent *agent, scim::KeyEvent &key, scim::uint32 &ret) {
     CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
     if (impl) {
@@ -598,6 +608,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_check_option_window (scim::slot (slot_check_ise_option_window));
     m_helper_agent.signal_connect_process_key_event (scim::slot (slot_process_key_event));
 
     return ret;
index 0b46d32..73db935 100644 (file)
@@ -94,6 +94,7 @@ struct ISCLCoreEventCallback {
 
     virtual void on_create_option_window(sclwindow window, SCLOptionWindowType type) {}
     virtual void on_destroy_option_window(sclwindow window) {}
+    virtual void on_check_option_window_availability(sclboolean *avail) { if (avail) *avail = false;}
 };
 
 }
index 15fab59..085425a 100644 (file)
@@ -435,6 +435,22 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type)
         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("on_create_option_window() is not available");
+                return SCLWINDOW_INVALID;
+            }
+        }
+        else
+            return SCLWINDOW_INVALID;
+    }
+
     /* Just in case the previous option window for setting application exists */
     if (type == OPTION_WINDOW_TYPE_SETTING_APPLICATION) {
         if (m_option_window_info[type].window != SCLWINDOW_INVALID) {
@@ -463,12 +479,8 @@ sclwindow CSCLCoreUIEFL::create_option_window(SCLOptionWindowType type)
 
     elm_win_indicator_mode_set(window, ELM_WIN_INDICATOR_SHOW);
 
-    CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
-    if (impl) {
-        ISCLCoreEventCallback *callback = impl->get_core_event_callback();
-        if (callback) {
-            callback->on_create_option_window(window, type);
-        }
+    if (callback) {
+        callback->on_create_option_window(window, type);
     }
 
     Ecore_Event_Handler *handler = NULL;