Add candidate show/hide interface 73/48773/1
authorHaifeng Deng <haifeng.deng@samsung.com>
Tue, 29 Sep 2015 02:08:41 +0000 (10:08 +0800)
committerJihoon Kim <jihoon48.kim@samsung.com>
Tue, 29 Sep 2015 08:27:32 +0000 (17:27 +0900)
Change-Id: I6cbc742431416e60016d7b20d6005c40368f450c
Signed-off-by: Haifeng Deng <haifeng.deng@samsung.com>
src/sclconnection-isf.cpp
src/sclcorecallback.h

index 74f7e0a..f5857d4 100644 (file)
@@ -514,6 +514,26 @@ static void slot_process_key_event (const scim::HelperAgent *agent, scim::KeyEve
     }
 }
 
+static void slot_candidate_show (const scim::HelperAgent *agent, int ic, const scim::String &ic_uuid) {
+    CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
+    if (impl) {
+        ISCLCoreEventCallback *callback = impl->get_core_event_callback();
+        if (callback) {
+            callback->on_candidate_show(ic, ic_uuid.c_str());
+        }
+    }
+}
+
+static void slot_candidate_hide (const scim::HelperAgent *agent, int ic, const scim::String &ic_uuid) {
+    CSCLCoreImpl *impl = CSCLCoreImpl::get_instance();
+    if (impl) {
+        ISCLCoreEventCallback *callback = impl->get_core_event_callback();
+        if (callback) {
+            callback->on_candidate_hide(ic, ic_uuid.c_str());
+        }
+    }
+}
+
 /* Internal input handler function */
 Eina_Bool input_handler (void *data, Ecore_Fd_Handler *fd_handler)
 {
@@ -609,6 +629,8 @@ sclboolean CSCLConnectionISF::init()
         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));
+        m_helper_agent.signal_connect_candidate_show (scim::slot (slot_candidate_show));
+        m_helper_agent.signal_connect_candidate_hide (scim::slot (slot_candidate_hide));
 
         m_initialized = TRUE;
     }
index b6e2ea6..bf5f35c 100644 (file)
@@ -82,6 +82,9 @@ 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;}
+
+    virtual void on_candidate_show(sclint ic, const sclchar *ic_uuid) {}
+    virtual void on_candidate_hide(sclint ic, const sclchar *ic_uuid) {}
 };
 
 }