4887551e9c45a58bf43f4d9456092c10e9516a95
[platform/core/uifw/isf.git] / ism / src / isf_info_manager.cpp
1 /** @file isf_info_manager.cpp
2  *  @brief Implementation of class InfoManager.
3  */
4
5 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
6
7 /*
8  * Smart Common Input Method
9  *
10  * Copyright (c) 2005 James Su <suzhe@tsinghua.org.cn>
11  * Copyright (c) 2012-2016 Samsung Electronics Co., Ltd.
12  *
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this program; if not, write to the
26  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
27  * Boston, MA  02111-1307  USA
28  *
29  * Modifications by Samsung Electronics Co., Ltd.
30  * 1. Add new signals
31  *    a. m_signal_set_keyboard_ise and m_signal_get_keyboard_ise
32  *    b. m_signal_focus_in and m_signal_focus_out
33  *    c. m_signal_expand_candidate, m_signal_contract_candidate and m_signal_set_candidate_ui
34  *    d. m_signal_get_ise_list, m_signal_get_keyboard_ise_list, m_signal_update_ise_geometry and m_signal_get_ise_information
35  *    e. m_signal_set_active_ise_by_uuid and m_signal_get_ise_info_by_uuid
36  *    f. m_signal_accept_connection, m_signal_close_connection and m_signal_exit
37  * 2. Add new interface APIs in PanelClient class
38  *    a. get_helper_manager_id (), has_helper_manager_pending_event () and filter_helper_manager_event ()
39  *    b. update_candidate_panel_event (), update_input_panel_event () and select_aux ()
40  *    c. candidate_more_window_show () and candidate_more_window_hide ()
41  *    d. update_displayed_candidate_number () and update_candidate_item_layout ()
42  *    e. stop_helper (), send_longpress_event () and update_ise_list ()
43  *    f. filter_event (), filter_exception_event () and get_server_id ()
44  * 3. Donot use thread to receive message
45  * 4. Monitor socket frontend for self-recovery function
46  *
47  * $Id: scim_panel_agent.cpp,v 1.8.2.1 2006/01/09 14:32:18 suzhe Exp $
48  *
49  */
50
51
52 #define Uses_SCIM_PANEL_AGENT
53 #define Uses_SCIM_HELPER
54 #define Uses_SCIM_EVENT
55 #define Uses_SCIM_CONFIG
56 #define Uses_SCIM_CONFIG_MODULE
57 #define Uses_SCIM_CONFIG_PATH
58 #define Uses_SCIM_UTILITY
59
60 #include <string.h>
61 #include <sys/types.h>
62 #include <sys/times.h>
63 #include <dlog.h>
64 #include <unistd.h>
65 #include "scim_private.h"
66 #include "scim.h"
67 #include "scim_stl_map.h"
68 #include "isf_panel_agent_manager.h"
69 #include "isf_debug.h"
70 #include "isf_pkg.h"
71 #include "ise_context.h"
72
73 #ifdef LOG_TAG
74 # undef LOG_TAG
75 #endif
76 #define LOG_TAG             "ISF_PANEL_EFL"
77
78 #define MIN_REPEAT_TIME     2.0
79
80 namespace scim
81 {
82
83 typedef Signal0<void>
84 InfoManagerSignalVoid;
85
86 typedef Signal1<void, int>
87 InfoManagerSignalInt;
88
89 typedef Signal1<void, int&>
90 InfoManagerSignalInt2;
91
92 typedef Signal1<void, const String&>
93 InfoManagerSignalString;
94
95 typedef Signal2<void, const String&, bool>
96 InfoManagerSignalStringBool;
97
98 typedef Signal2<void, String&, String&>
99 InfoManagerSignalString2;
100
101 typedef Signal2<void, int, const String&>
102 InfoManagerSignalIntString;
103
104 typedef Signal1<void, const PanelFactoryInfo&>
105 InfoManagerSignalFactoryInfo;
106
107 typedef Signal1<void, const std::vector <PanelFactoryInfo> &>
108 InfoManagerSignalFactoryInfoVector;
109
110 typedef Signal1<void, const LookupTable&>
111 InfoManagerSignalLookupTable;
112
113 typedef Signal1<void, const Property&>
114 InfoManagerSignalProperty;
115
116 typedef Signal1<void, const PropertyList&>
117 InfoManagerSignalPropertyList;
118
119 typedef Signal2<void, int, int>
120 InfoManagerSignalIntInt;
121
122 typedef Signal2<void, int&, int&>
123 InfoManagerSignalIntInt2;
124
125 typedef Signal3<void, int, int, int>
126 InfoManagerSignalIntIntInt;
127
128 typedef Signal3<void, const String &, const String &, const String &>
129 InfoManagerSignalString3;
130
131 typedef Signal4<void, int, int, int, int>
132 InfoManagerSignalIntIntIntInt;
133
134 typedef Signal2<void, int, const Property&>
135 InfoManagerSignalIntProperty;
136
137 typedef Signal2<void, int, const PropertyList&>
138 InfoManagerSignalIntPropertyList;
139
140 typedef Signal2<void, int, const HelperInfo&>
141 InfoManagerSignalIntHelperInfo;
142
143 typedef Signal3<void, const String&, const AttributeList&, int>
144 InfoManagerSignalAttributeStringInt;
145
146 typedef Signal5<void, int, int, const String&, const String&, const AttributeList&>
147 InfoManagerSignalAttributeInt2String2;
148
149 typedef Signal2<void, const String&, const AttributeList&>
150 InfoManagerSignalAttributeString;
151
152 typedef Signal1<void, std::vector <String> &>
153 InfoManagerSignalStringVector;
154
155 typedef Signal1<bool, HELPER_ISE_INFO&>
156 InfoManagerSignalBoolHelperInfo;
157
158 typedef Signal1<bool, std::vector <String> &>
159 InfoManagerSignalBoolStringVector;
160
161 typedef Signal2<void, char*, std::vector <String> &>
162 InfoManagerSignalStrStringVector;
163
164 typedef Signal2<bool, const String&, ISE_INFO&>
165 InfoManagerSignalStringISEINFO;
166
167 typedef Signal2<bool, String, int&>
168 InfoManagerSignalStringInt;
169
170 typedef Signal1<void, const KeyEvent&>
171 InfoManagerSignalKeyEvent;
172
173 typedef Signal1<void, struct rectinfo&>
174 InfoManagerSignalRect;
175
176 typedef Signal6<bool, String, String&, String&, int&, int&, String&>
177 InfoManagerSignalBoolString4int2;
178
179 typedef Signal2<void, int, struct rectinfo&>
180 InfoManagerSignalIntRect;
181
182 typedef Signal2<bool, int, String>
183 InfoManagerSignalIntString2;
184
185 typedef Signal1<bool, String>
186 InfoManagerSignalBoolString;
187
188 struct HelperClientStub {
189     int id;
190     int ref;
191
192     HelperClientStub (int i = 0, int r = 0) : id (i), ref (r) { }
193 };
194
195 struct IMControlStub {
196     std::vector<ISE_INFO> info;
197     std::vector<int> count;
198 };
199
200 #define DEFAULT_CONTEXT_VALUE 0xfff
201
202 #if SCIM_USE_STL_EXT_HASH_MAP
203 typedef __gnu_cxx::hash_map <int, ClientInfo, __gnu_cxx::hash <int> >       ClientRepository;
204 typedef __gnu_cxx::hash_map <int, HelperInfo, __gnu_cxx::hash <int> >       HelperInfoRepository;
205 typedef __gnu_cxx::hash_map <uint32, String, __gnu_cxx::hash <unsigned int> > ClientContextUUIDRepository;
206 typedef __gnu_cxx::hash_map <String, HelperClientStub, scim_hash_string>    HelperClientIndex;
207 typedef __gnu_cxx::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string>    StartHelperICIndex;
208 #elif SCIM_USE_STL_HASH_MAP
209 typedef std::hash_map <int, ClientInfo, std::hash <int> >                   ClientRepository;
210 typedef std::hash_map <int, HelperInfo, std::hash <int> >                   HelperInfoRepository;
211 typedef std::hash_map <uint32, String, std::hash <unsigned int> >           ClientContextUUIDRepository;
212 typedef std::hash_map <String, HelperClientStub, scim_hash_string>          HelperClientIndex;
213 typedef std::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string>          StartHelperICIndex;
214 #else
215 typedef std::map <int, ClientInfo>                                          ClientRepository;
216 typedef std::map <int, HelperInfo>                                          HelperInfoRepository;
217 typedef std::map <uint32, String>                                           ClientContextUUIDRepository;
218 typedef std::map <String, HelperClientStub>                                 HelperClientIndex;
219 typedef std::map <String, std::vector < std::pair <uint32, String> > >                                StartHelperICIndex;
220 #endif
221
222 typedef std::map <String, uint32>              UUIDCountRepository;
223 typedef std::map <String, enum HelperState>    UUIDStateRepository;
224 typedef std::map <String, int>                 StringIntRepository;
225 typedef std::map <int, struct IMControlStub>   IMControlRepository;
226 typedef std::map <int, int>                    IntIntRepository;
227
228 static uint32
229 get_helper_ic (int client, uint32 context)
230 {
231     return (uint32) (client & 0xFFFF) | ((context & 0x7FFF) << 16);
232 }
233
234 static void
235 get_imengine_client_context (uint32 helper_ic, int& client, uint32& context)
236 {
237     client   = (int) (helper_ic & 0xFFFF);
238     context  = ((helper_ic >> 16) & 0x7FFF);
239 }
240
241 static bool
242 clients_equal (int first, int second)
243 {
244     return ((first & 0xFFFF) == (second & 0xFFFF));
245 }
246
247 static bool
248 contexts_equal (uint32 first, uint32 second)
249 {
250     return ((first & 0x7FFF) == (second & 0x7FFF));
251 }
252
253 //==================================== InfoManager ===========================
254 class InfoManager::InfoManagerImpl
255 {
256     int                                 m_current_screen;
257
258     String                              m_config_name;
259     String                              m_display_name;
260
261     int                                 m_current_socket_client;
262     uint32                              m_current_client_context;
263     String                              m_current_context_uuid;
264     TOOLBAR_MODE_T                      m_current_toolbar_mode;
265     uint32                              m_current_helper_option;
266     String                              m_current_helper_uuid;
267     String                              m_last_helper_uuid;
268     String                              m_current_ise_name;
269     int                                 m_pending_active_imcontrol_id;
270     int                                 m_show_request_client_id;
271     int                                 m_active_client_id;
272     IntIntRepository                    m_panel_client_map;
273     IntIntRepository                    m_imcontrol_map;
274     bool                                m_should_shared_ise;
275     bool                                m_ise_exiting;
276     bool                                m_is_imengine_aux;
277     bool                                m_is_imengine_candidate;
278     bool                                m_refocus_needed;
279     bool                                m_reshow_needed;
280     bool                                m_restart_needed;
281
282     std::vector<int>                    m_current_send_remoteinput_id;
283     std::vector<int>                    m_current_recv_remoteinput_id;
284
285     int                                 m_last_socket_client;
286     uint32                              m_last_client_context;
287     String                              m_last_context_uuid;
288
289     char*                               m_ise_context_buffer;
290     size_t                              m_ise_context_length;
291     char*                               m_imdata_buffer;
292     size_t                              m_imdata_length;
293
294     ClientRepository                    m_client_repository;
295     /*
296     * Each Helper ISE has two socket connect between InfoManager and HelperAgent.
297     * m_helper_info_repository records the active connection.
298     * m_helper_active_info_repository records the passive connection.
299     */
300     HelperInfoRepository                m_helper_info_repository;
301     HelperInfoRepository                m_helper_active_info_repository;
302     HelperClientIndex                   m_helper_client_index;
303
304     /* when helper register, notify imcontrol client */
305     StringIntRepository                 m_ise_pending_repository;
306     IMControlRepository                 m_imcontrol_repository;
307
308     StartHelperICIndex                  m_start_helper_ic_index;
309
310     /* Keyboard ISE */
311     ClientContextUUIDRepository         m_client_context_uuids;
312
313     /* Helper ISE */
314     ClientContextUUIDRepository         m_client_context_helper;
315     UUIDCountRepository                 m_helper_uuid_count;
316
317     InfoManagerSignalVoid                m_signal_turn_on;
318     InfoManagerSignalVoid                m_signal_turn_off;
319     InfoManagerSignalVoid                m_signal_show_panel;
320     InfoManagerSignalVoid                m_signal_hide_panel;
321     InfoManagerSignalInt                 m_signal_update_screen;
322     InfoManagerSignalIntIntInt           m_signal_update_spot_location;
323     InfoManagerSignalFactoryInfo         m_signal_update_factory_info;
324     InfoManagerSignalVoid                m_signal_start_default_ise;
325     InfoManagerSignalVoid                m_signal_stop_default_ise;
326     InfoManagerSignalIntInt              m_signal_update_input_context;
327     InfoManagerSignalString              m_signal_update_language_locale;
328     InfoManagerSignalIntInt              m_signal_set_candidate_ui;
329     InfoManagerSignalIntInt2             m_signal_get_candidate_ui;
330     InfoManagerSignalIntInt              m_signal_set_candidate_position;
331     InfoManagerSignalRect                m_signal_get_candidate_geometry;
332     InfoManagerSignalRect                m_signal_get_input_panel_geometry;
333     InfoManagerSignalString              m_signal_set_keyboard_ise;
334     InfoManagerSignalString2             m_signal_get_keyboard_ise;
335     InfoManagerSignalString              m_signal_show_help;
336     InfoManagerSignalFactoryInfoVector   m_signal_show_factory_menu;
337     InfoManagerSignalVoid                m_signal_show_preedit_string;
338     InfoManagerSignalVoid                m_signal_show_aux_string;
339     InfoManagerSignalVoid                m_signal_show_lookup_table;
340     InfoManagerSignalVoid                m_signal_show_associate_table;
341     InfoManagerSignalVoid                m_signal_hide_preedit_string;
342     InfoManagerSignalVoid                m_signal_hide_aux_string;
343     InfoManagerSignalVoid                m_signal_hide_lookup_table;
344     InfoManagerSignalVoid                m_signal_hide_associate_table;
345     InfoManagerSignalAttributeStringInt  m_signal_update_preedit_string;
346     InfoManagerSignalAttributeInt2String2 m_signal_recapture_string;
347     InfoManagerSignalInt                 m_signal_update_preedit_caret;
348     InfoManagerSignalAttributeString     m_signal_update_aux_string;
349     InfoManagerSignalLookupTable         m_signal_update_lookup_table;
350     InfoManagerSignalLookupTable         m_signal_update_associate_table;
351     InfoManagerSignalPropertyList        m_signal_register_properties;
352     InfoManagerSignalProperty            m_signal_update_property;
353     InfoManagerSignalIntPropertyList     m_signal_register_helper_properties;
354     InfoManagerSignalIntProperty         m_signal_update_helper_property;
355     InfoManagerSignalIntHelperInfo       m_signal_register_helper;
356     InfoManagerSignalInt                 m_signal_remove_helper;
357     InfoManagerSignalStringBool          m_signal_set_active_ise_by_uuid;
358     InfoManagerSignalVoid                m_signal_focus_in;
359     InfoManagerSignalVoid                m_signal_focus_out;
360     InfoManagerSignalVoid                m_signal_expand_candidate;
361     InfoManagerSignalVoid                m_signal_contract_candidate;
362     InfoManagerSignalInt                 m_signal_select_candidate;
363     InfoManagerSignalBoolStringVector    m_signal_get_ise_list;
364     InfoManagerSignalBoolHelperInfo      m_signal_get_all_helper_ise_info;
365     InfoManagerSignalStringBool          m_signal_set_has_option_helper_ise_info;
366     InfoManagerSignalStringBool          m_signal_set_enable_helper_ise_info;
367     InfoManagerSignalVoid                m_signal_show_helper_ise_list;
368     InfoManagerSignalVoid                m_signal_show_helper_ise_selector;
369     InfoManagerSignalStringInt           m_signal_is_helper_ise_enabled;
370     InfoManagerSignalBoolString4int2     m_signal_get_ise_information;
371     InfoManagerSignalBoolStringVector    m_signal_get_keyboard_ise_list;
372     InfoManagerSignalIntIntIntInt        m_signal_update_ise_geometry;
373     InfoManagerSignalStringVector        m_signal_get_language_list;
374     InfoManagerSignalStringVector        m_signal_get_all_language;
375     InfoManagerSignalStrStringVector     m_signal_get_ise_language;
376     InfoManagerSignalStringISEINFO       m_signal_get_ise_info_by_uuid;
377     InfoManagerSignalKeyEvent            m_signal_send_key_event;
378
379     InfoManagerSignalInt                 m_signal_accept_connection;
380     InfoManagerSignalInt                 m_signal_close_connection;
381     InfoManagerSignalVoid                m_signal_exit;
382
383     InfoManagerSignalVoid                m_signal_transaction_start;
384     InfoManagerSignalVoid                m_signal_transaction_end;
385
386     InfoManagerSignalVoid                m_signal_lock;
387     InfoManagerSignalVoid                m_signal_unlock;
388
389     InfoManagerSignalVoid                m_signal_show_ise;
390     InfoManagerSignalVoid                m_signal_hide_ise;
391
392     InfoManagerSignalVoid                m_signal_will_show_ack;
393     InfoManagerSignalVoid                m_signal_will_hide_ack;
394
395     InfoManagerSignalInt                 m_signal_set_keyboard_mode;
396
397     InfoManagerSignalVoid                m_signal_candidate_will_hide_ack;
398     InfoManagerSignalInt2                m_signal_get_ise_state;
399     InfoManagerSignalString3             m_signal_run_helper;
400
401     InfoManagerSignalIntRect             m_signal_get_recent_ise_geometry;
402
403     InfoManagerSignalStringBool          m_signal_remoteinput_send_input_message;
404     InfoManagerSignalIntString           m_signal_remoteinput_send_surrounding_text;
405
406     InfoManagerSignalIntString2          m_signal_check_privilege_by_sockfd;
407
408     InfoManagerSignalBoolString          m_signal_launch_option_application;
409
410     PanelAgentManager                    m_panel_agent_manager;
411
412     void delete_ise_context_buffer (void) {
413         if (m_ise_context_buffer != NULL) {
414             delete[] m_ise_context_buffer;
415             m_ise_context_buffer = NULL;
416             m_ise_context_length = 0;
417         }
418     }
419
420     void delete_imdata_buffer (void) {
421         if (m_imdata_buffer != NULL) {
422             delete[] m_imdata_buffer;
423             m_imdata_buffer = NULL;
424             m_imdata_length = 0;
425         }
426     }
427
428 public:
429     InfoManagerImpl ()
430         : m_current_screen (0),
431           m_current_socket_client (-1), m_current_client_context (0),
432           m_current_toolbar_mode (TOOLBAR_KEYBOARD_MODE),
433           m_current_helper_option (0),
434           m_pending_active_imcontrol_id (-1),
435           m_show_request_client_id (-1),
436           m_active_client_id (-1),
437           m_should_shared_ise (false),
438           m_ise_exiting (false), m_is_imengine_aux (false), m_is_imengine_candidate (false),
439           m_refocus_needed (false),
440           m_reshow_needed (false),
441           m_restart_needed (true),
442           m_last_socket_client (-1), m_last_client_context (0),
443           m_ise_context_buffer (NULL), m_ise_context_length (0),
444           m_imdata_buffer (NULL), m_imdata_length (0) {
445         m_current_ise_name = String (_ ("English Keyboard"));
446         m_imcontrol_repository.clear ();
447         m_imcontrol_map.clear ();
448         m_current_send_remoteinput_id.clear ();
449         m_current_recv_remoteinput_id.clear ();
450         m_panel_client_map.clear ();
451     }
452
453     ~InfoManagerImpl () {
454         delete_ise_context_buffer ();
455         delete_imdata_buffer ();
456     }
457
458     bool initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident) {
459
460         m_config_name = "socket";
461         m_display_name = display;
462
463         return m_panel_agent_manager.initialize (info_manager, config, display, resident);
464     }
465
466     bool valid (void) const {
467         return m_panel_agent_manager.valid ();
468     }
469
470 public:
471
472     void stop (void) {
473         SCIM_DEBUG_MAIN (1) << "InfoManager::stop ()\n";
474
475         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
476             String helper_uuid = get_current_helper_uuid ();
477             hide_helper (helper_uuid);
478             stop_helper (helper_uuid, -2, 0);
479         }
480
481         m_panel_agent_manager.stop ();
482     }
483
484     TOOLBAR_MODE_T get_current_toolbar_mode () const {
485         return m_current_toolbar_mode;
486     }
487
488     String get_current_ise_name () const {
489         return m_current_ise_name;
490     }
491
492     String get_current_helper_uuid () const {
493         return m_current_helper_uuid;
494     }
495
496     uint32 get_current_helper_option () const {
497         return m_current_helper_option;
498     }
499
500     void set_current_ise_name (String& name) {
501         m_current_ise_name = name;
502     }
503
504     void set_current_toolbar_mode (TOOLBAR_MODE_T mode) {
505         m_current_toolbar_mode = mode;
506     }
507
508     void set_current_helper_option (uint32 option) {
509         m_current_helper_option = option;
510     }
511
512     void update_panel_event (int cmd, uint32 nType, uint32 nValue) {
513         int    focused_client;
514         uint32 focused_context;
515         get_focused_context (focused_client, focused_context);
516
517         if (focused_client == -1 && m_active_client_id != -1) {
518             focused_client  = m_panel_client_map[m_active_client_id];
519             focused_context = 0;
520         }
521
522         SCIM_DEBUG_MAIN (1) << __func__ << " (" << nType << ", " << nValue << "), client=" << focused_client << "\n";
523         ClientInfo client_info = socket_get_client_info (focused_client);
524
525         if (client_info.type == FRONTEND_CLIENT) {
526             m_panel_agent_manager.update_panel_event (focused_client, focused_context, cmd, nType, nValue);
527         } else {
528             std::cerr << __func__ << " focused client is not existed!!!" << "\n";
529         }
530
531         if (m_panel_client_map[m_show_request_client_id] != focused_client) {
532             client_info = socket_get_client_info (m_panel_client_map[m_show_request_client_id]);
533
534             if (client_info.type == FRONTEND_CLIENT) {
535                 m_panel_agent_manager.update_panel_event (m_panel_client_map[m_show_request_client_id], 0, cmd, nType, nValue);
536                 std::cerr << __func__ << " show request client=" << m_panel_client_map[m_show_request_client_id] << "\n";
537             } else {
538                 std::cerr << __func__ << " show request client is not existed!!!" << "\n";
539             }
540         }
541     }
542
543     bool move_preedit_caret (uint32 position) {
544         SCIM_DEBUG_MAIN (1) << "InfoManager::move_preedit_caret (" << position << ")\n";
545         int client;
546         uint32 context;
547         lock ();
548         get_focused_context (client, context);
549
550         if (client >= 0) {
551             m_panel_agent_manager.update_preedit_caret (client, context, position);
552         }
553
554         unlock ();
555         return client >= 0;
556     }
557 //useless
558 #if 0
559     bool request_help (void) {
560         SCIM_DEBUG_MAIN (1) << "InfoManager::request_help ()\n";
561         int client;
562         uint32 context;
563         lock ();
564         get_focused_context (client, context);
565
566         if (client >= 0) {
567             m_panel_agent_manager.request_help (client, context);
568         }
569
570         unlock ();
571         return client >= 0;
572     }
573
574     bool request_factory_menu (void) {
575         SCIM_DEBUG_MAIN (1) << "InfoManager::request_factory_menu ()\n";
576         int client;
577         uint32 context;
578         lock ();
579         get_focused_context (client, context);
580
581         if (client >= 0) {
582             m_panel_agent_manager.request_factory_menu (client, context);
583         }
584
585         unlock ();
586         return client >= 0;
587     }
588 #endif
589
590     //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
591     bool reset_keyboard_ise (void) {
592         SCIM_DEBUG_MAIN (1) << "InfoManager::reset_keyboard_ise ()\n";
593         int    client = -1;
594         uint32 context = 0;
595         lock ();
596         get_focused_context (client, context);
597
598         if (client >= 0) {
599             m_panel_agent_manager.reset_keyboard_ise (client, context);
600         }
601
602         unlock ();
603         return client >= 0;
604     }
605
606     bool update_keyboard_ise_list (void) {
607         SCIM_DEBUG_MAIN (1) << "InfoManager::update_keyboard_ise_list ()\n";
608         int    client = -1;
609         uint32 context = 0;
610         lock ();
611         get_focused_context (client, context);
612
613         if (client >= 0) {
614             m_panel_agent_manager.update_keyboard_ise_list (client, context);
615         }
616
617         unlock ();
618         return client >= 0;
619     }
620
621     bool change_factory (const String&  uuid) {
622         SCIM_DEBUG_MAIN (1) << "InfoManager::change_factory (" << uuid << ")\n";
623         int client;
624         uint32 context;
625 #if 0
626         if (scim_global_config_read (SCIM_GLOBAL_CONFIG_PRELOAD_KEYBOARD_ISE, false))
627             m_helper_manager.preload_keyboard_ise (uuid);
628 #endif
629         lock ();
630         get_focused_context (client, context);
631
632         if (client >= 0) {
633             m_panel_agent_manager.change_factory (client, context, uuid);
634         }
635
636         unlock ();
637         return client >= 0;
638     }
639
640     bool helper_candidate_show (void) {
641         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
642         bool ret = false;
643
644         int    client;
645         uint32 context;
646         get_focused_context (client, context);
647
648         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
649             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
650
651             if (it != m_helper_client_index.end ()) {
652                 uint32 ctx = get_helper_ic (client, context);
653                 m_panel_agent_manager.helper_candidate_show (it->second.id, ctx, m_current_helper_uuid);
654                 ret = true;
655             }
656         }
657
658         /* Inform wayland module that we are showing candidate window */
659         int     focused_client;
660         uint32  focused_context;
661         String  focused_uuid = get_focused_context(focused_client, focused_context);
662         m_panel_agent_manager.helper_candidate_show(focused_client, focused_context, focused_uuid);
663
664         return ret;
665     }
666
667     bool helper_candidate_hide (void) {
668         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
669         bool ret = false;
670
671         int    client;
672         uint32 context;
673         get_focused_context (client, context);
674
675         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
676             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
677
678             if (it != m_helper_client_index.end ()) {
679                 uint32 ctx = get_helper_ic (client, context);
680                 m_panel_agent_manager.helper_candidate_hide (it->second.id, ctx, m_current_helper_uuid);
681                 ret = true;
682             }
683         }
684
685         /* Inform wayland module that we are hiding candidate window */
686         int     focused_client;
687         uint32  focused_context;
688         String  focused_uuid = get_focused_context(focused_client, focused_context);
689         m_panel_agent_manager.helper_candidate_hide(focused_client, focused_context, focused_uuid);
690
691         return ret;
692     }
693
694     bool candidate_more_window_show (void) {
695         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
696         int    client;
697         uint32 context;
698         get_focused_context (client, context);
699
700         if (m_is_imengine_candidate) {
701             if (client >= 0) {
702                 m_panel_agent_manager.candidate_more_window_show (client, context);
703                 return true;
704             }
705         } else {
706             if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
707                 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
708
709                 if (it != m_helper_client_index.end ()) {
710                     uint32 ctx = get_helper_ic (client, context);
711                     m_panel_agent_manager.candidate_more_window_show (it->second.id, ctx);
712                     return true;
713                 }
714             }
715         }
716
717         return false;
718     }
719
720     bool candidate_more_window_hide (void) {
721         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
722         int    client;
723         uint32 context;
724         get_focused_context (client, context);
725
726         if (m_is_imengine_candidate) {
727             if (client >= 0) {
728                 m_panel_agent_manager.candidate_more_window_hide (client, context);
729                 return true;
730             }
731         } else {
732             if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
733                 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
734
735                 if (it != m_helper_client_index.end ()) {
736                     uint32 ctx = get_helper_ic (client, context);
737                     m_panel_agent_manager.candidate_more_window_hide (it->second.id, ctx);
738                     return true;
739                 }
740             }
741         }
742
743         return false;
744     }
745
746     bool update_helper_lookup_table (const LookupTable& table) {
747         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
748         int    client;
749         uint32 context;
750
751         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
752             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
753
754             if (it != m_helper_client_index.end ()) {
755                 uint32 ctx;
756                 get_focused_context (client, context);
757                 ctx = get_helper_ic (client, context);
758                 m_panel_agent_manager.update_helper_lookup_table (it->second.id, ctx, m_current_helper_uuid, table);
759                 return true;
760             }
761         }
762
763         return false;
764     }
765
766     bool select_aux (uint32 item) {
767         SCIM_DEBUG_MAIN (1) << "InfoManager::select_aux (" << item << ")\n";
768         int client;
769         uint32 context;
770         lock ();
771         get_focused_context (client, context);
772
773         if (m_is_imengine_aux) {
774             if (client >= 0) {
775                 m_panel_agent_manager.select_aux (client, context, item);
776             }
777         } else {
778             helper_select_aux (item);
779         }
780
781         unlock ();
782         return client >= 0;
783     }
784
785     bool select_candidate (uint32 item) {
786         SCIM_DEBUG_MAIN (1) << "InfoManager::select_candidate (" << item << ")\n";
787         int client;
788         uint32 context;
789         lock ();
790         get_focused_context (client, context);
791
792         if (m_is_imengine_candidate) {
793             if (client >= 0) {
794                 m_panel_agent_manager.select_candidate (client, context, item);
795             }
796         } else {
797             helper_select_candidate (item);
798         }
799
800         unlock ();
801         return client >= 0;
802     }
803
804     bool lookup_table_page_up (void) {
805         SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_up ()\n";
806         int client;
807         uint32 context;
808         lock ();
809         get_focused_context (client, context);
810
811         if (m_is_imengine_candidate) {
812             if (client >= 0) {
813                 m_panel_agent_manager.lookup_table_page_up (client, context);
814             }
815         } else {
816             helper_lookup_table_page_up ();
817         }
818
819         unlock ();
820         return client >= 0;
821     }
822
823     bool lookup_table_page_down (void) {
824         SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_down ()\n";
825         int client;
826         uint32 context;
827         lock ();
828         get_focused_context (client, context);
829
830         if (m_is_imengine_candidate) {
831             if (client >= 0) {
832                 m_panel_agent_manager.lookup_table_page_down (client, context);
833             }
834         } else {
835             helper_lookup_table_page_down ();
836         }
837
838         unlock ();
839         return client >= 0;
840     }
841
842     bool update_lookup_table_page_size (uint32 size) {
843         SCIM_DEBUG_MAIN (1) << "InfoManager::update_lookup_table_page_size (" << size << ")\n";
844         int client;
845         uint32 context;
846         lock ();
847         get_focused_context (client, context);
848
849         if (m_is_imengine_candidate) {
850             if (client >= 0) {
851                 m_panel_agent_manager.update_lookup_table_page_size (client, context, size);
852             }
853         } else {
854             helper_update_lookup_table_page_size (size);
855         }
856
857         unlock ();
858         return client >= 0;
859     }
860
861     bool update_candidate_item_layout (const std::vector<uint32>& row_items) {
862         SCIM_DEBUG_MAIN (1) << __func__ << " (" << row_items.size () << ")\n";
863         int client;
864         uint32 context;
865         lock ();
866         get_focused_context (client, context);
867
868         if (m_is_imengine_candidate) {
869             if (client >= 0) {
870                 m_panel_agent_manager.update_candidate_item_layout (client, context, row_items);
871             }
872         } else {
873             helper_update_candidate_item_layout (row_items);
874         }
875
876         unlock ();
877         return client >= 0;
878     }
879
880     bool select_associate (uint32 item) {
881         SCIM_DEBUG_MAIN (1) << "InfoManager::select_associate (" << item << ")\n";
882         int client;
883         uint32 context;
884         lock ();
885         get_focused_context (client, context);
886
887         if (client >= 0) {
888             m_panel_agent_manager.select_associate (client, context, item);
889         }
890
891         unlock ();
892         helper_select_associate (item);
893         return client >= 0;
894     }
895
896     bool associate_table_page_up (void) {
897         SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_up ()\n";
898         int client;
899         uint32 context;
900         lock ();
901         get_focused_context (client, context);
902
903         if (client >= 0) {
904             m_panel_agent_manager.associate_table_page_up (client, context);
905         }
906
907         unlock ();
908         helper_associate_table_page_up ();
909         return client >= 0;
910     }
911
912     bool associate_table_page_down (void) {
913         SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_down ()\n";
914         int client;
915         uint32 context;
916         lock ();
917         get_focused_context (client, context);
918
919         if (client >= 0) {
920             m_panel_agent_manager.associate_table_page_down (client, context);
921         }
922
923         unlock ();
924         helper_associate_table_page_down ();
925         return client >= 0;
926     }
927
928     bool update_associate_table_page_size (uint32 size) {
929         SCIM_DEBUG_MAIN (1) << "InfoManager::update_associate_table_page_size (" << size << ")\n";
930         int client;
931         uint32 context;
932         lock ();
933         get_focused_context (client, context);
934
935         if (client >= 0) {
936             m_panel_agent_manager.update_associate_table_page_size (client, context, size);
937         }
938
939         unlock ();
940         helper_update_associate_table_page_size (size);
941         return client >= 0;
942     }
943
944     bool update_displayed_candidate_number (uint32 size) {
945         SCIM_DEBUG_MAIN (1) << __func__ << " (" << size << ")\n";
946         int client;
947         uint32 context;
948         lock ();
949         get_focused_context (client, context);
950
951         if (m_is_imengine_candidate) {
952             if (client >= 0) {
953                 m_panel_agent_manager.update_displayed_candidate_number (client, context, size);
954             }
955         } else {
956             helper_update_displayed_candidate_number (size);
957         }
958
959         unlock ();
960         return client >= 0;
961     }
962
963     void send_longpress_event (int type, int index) {
964         SCIM_DEBUG_MAIN (1) << __func__ << " (" << type << ", " << index << ")\n";
965         int    client;
966         uint32 context;
967         get_focused_context (client, context);
968
969         if (m_is_imengine_candidate) {
970             if (client >= 0) {
971                 m_panel_agent_manager.send_longpress_event (client, context, index);
972             }
973         } else {
974             helper_longpress_candidate (index);
975         }
976     }
977
978     bool trigger_property (const String&  property) {
979         SCIM_DEBUG_MAIN (1) << "InfoManager::trigger_property (" << property << ")\n";
980         int client;
981         uint32 context;
982         lock ();
983         get_focused_context (client, context);
984
985         if (client >= 0) {
986             m_panel_agent_manager.trigger_property (client, context, property);
987         }
988
989         unlock ();
990         return client >= 0;
991     }
992
993     bool start_helper (const String&  uuid, int client, uint32 context) {
994         SCIM_DEBUG_MAIN (1) << "InfoManager::start_helper (" << uuid << ")\n";
995         LOGD ("start ISE(%s)", uuid.c_str ());
996
997         if (uuid.length () <= 0)
998             return false;
999
1000         lock ();
1001         /*if (m_current_toolbar_mode != TOOLBAR_HELPER_MODE || m_current_helper_uuid.compare (uuid) != 0)*/ {
1002             SCIM_DEBUG_MAIN (1) << "Run_helper\n";
1003
1004             uint32 ic = get_helper_ic (m_panel_client_map[client], context);
1005             String ic_uuid;
1006             /* Get the context uuid from the client context registration table. */
1007             {
1008                 ClientContextUUIDRepository::iterator it =
1009                     m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
1010
1011                 if (it != m_client_context_uuids.end ())
1012                     ic_uuid = it->second;
1013             }
1014             m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
1015             m_signal_run_helper (uuid, m_config_name, m_display_name);
1016         }
1017         m_current_helper_uuid = uuid;
1018         unlock ();
1019         return true;
1020     }
1021
1022     bool stop_helper (const String& uuid, int client, uint32 context) {
1023         char buf[256] = {0};
1024         snprintf (buf, sizeof (buf), "time:%ld  pid:%d  %s  %s  prepare to stop ISE(%s)\n",
1025                   time (0), getpid (), __FILE__, __func__, uuid.c_str ());
1026         LOGD ("prepare to stop ISE(%s)", uuid.c_str ());
1027         SCIM_DEBUG_MAIN (1) << "InfoManager::stop_helper (" << uuid << ")\n";
1028
1029         if (uuid.length () <= 0)
1030             return false;
1031
1032         lock ();
1033         uint32 ctx = get_helper_ic (client, context);
1034         HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
1035
1036         if (it != m_helper_client_index.end ()) {
1037             m_ise_exiting = true;
1038             m_current_helper_uuid = String ("");
1039             m_panel_agent_manager.exit (it->second.id, ctx);
1040             SCIM_DEBUG_MAIN (1) << "Stop helper\n";
1041             ISF_SAVE_LOG ("send SCIM_TRANS_CMD_EXIT message to %s", uuid.c_str ());
1042         }
1043
1044         /* Since we are stopping this helper, erase information from start_helper_ic_index too */
1045         m_start_helper_ic_index.erase (uuid);
1046
1047         unlock ();
1048         return true;
1049     }
1050
1051     void focus_out_helper (const String& uuid, int client, uint32 context) {
1052         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1053
1054         if (it != m_helper_client_index.end ()) {
1055             uint32 ctx = get_helper_ic (client, context);
1056             m_panel_agent_manager.focus_out_helper (it->second.id, ctx, uuid);
1057         }
1058     }
1059
1060     void focus_in_helper (const String& uuid, int client, uint32 context) {
1061         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1062
1063         if (it != m_helper_client_index.end ()) {
1064             uint32 ctx = get_helper_ic (client, context);
1065             m_panel_agent_manager.focus_in_helper (it->second.id, ctx, uuid);
1066         }
1067     }
1068
1069     bool show_helper (const String& uuid, char* data, size_t& len, uint32 ctx) {
1070         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1071
1072         if (it != m_helper_client_index.end ()) {
1073             Socket client_socket (it->second.id);
1074             m_panel_agent_manager.show_helper (it->second.id, ctx, uuid, data, len);
1075             return true;
1076         }
1077
1078         LOGW ("Can't find %s", m_current_helper_uuid.c_str ());
1079
1080         return false;
1081     }
1082
1083     void hide_helper (const String& uuid, uint32 ctx = 0) {
1084         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1085
1086         if (it != m_helper_client_index.end ()) {
1087             int client;
1088             uint32 context;
1089
1090             if (ctx == 0) {
1091                 get_focused_context (client, context);
1092                 ctx = get_helper_ic (client, context);
1093             }
1094
1095             m_panel_agent_manager.hide_helper (it->second.id, ctx, uuid);
1096         }
1097     }
1098
1099     bool set_helper_mode (const String& uuid, uint32& mode) {
1100         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1101
1102         if (it != m_helper_client_index.end ()) {
1103             int client;
1104             uint32 context;
1105             uint32 ctx;
1106             get_focused_context (client, context);
1107             ctx = get_helper_ic (client, context);
1108             m_panel_agent_manager.set_helper_mode (it->second.id, ctx, uuid, mode);
1109             return true;
1110         }
1111
1112         return false;
1113     }
1114
1115     bool set_helper_language (const String& uuid, uint32& language) {
1116         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1117
1118         if (it != m_helper_client_index.end ()) {
1119             int client     = -1;
1120             uint32 context = 0;
1121             uint32 ctx;
1122             get_focused_context (client, context);
1123             ctx = get_helper_ic (client, context);
1124             m_panel_agent_manager.set_helper_language (it->second.id, ctx, uuid, language);
1125             return true;
1126         }
1127
1128         return false;
1129     }
1130
1131     bool set_helper_imdata (const String& uuid, const char* imdata, size_t& len) {
1132         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1133
1134         if (it != m_helper_client_index.end ()) {
1135             int client     = -1;
1136             uint32 context = 0;
1137             uint32 ctx;
1138             get_focused_context (client, context);
1139             ctx = get_helper_ic (client, context);
1140             m_panel_agent_manager.set_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1141             return true;
1142         }
1143
1144         return false;
1145     }
1146
1147     bool set_helper_return_key_type (const String& uuid, int type) {
1148         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1149
1150         if (it != m_helper_client_index.end ()) {
1151             int client     = -1;
1152             uint32 context = 0;
1153             uint32 ctx;
1154             get_focused_context (client, context);
1155             ctx = get_helper_ic (client, context);
1156             m_panel_agent_manager.set_helper_return_key_type (it->second.id, ctx, uuid, type);
1157             return true;
1158         }
1159
1160         return false;
1161     }
1162
1163     bool get_helper_return_key_type (const String& uuid, uint32& type) {
1164         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1165
1166         if (it != m_helper_client_index.end ()) {
1167             int    client;
1168             uint32 context;
1169             uint32 ctx;
1170             get_focused_context (client, context);
1171             ctx = get_helper_ic (client, context);
1172             m_panel_agent_manager.get_helper_return_key_type (it->second.id, ctx, uuid, type);
1173             return true;
1174         }
1175
1176         return false;
1177     }
1178
1179     bool set_helper_return_key_disable (const String& uuid, bool disabled) {
1180         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1181
1182         if (it != m_helper_client_index.end ()) {
1183             int client     = -1;
1184             uint32 context = 0;
1185             uint32 ctx;
1186             get_focused_context (client, context);
1187             ctx = get_helper_ic (client, context);
1188             m_panel_agent_manager.set_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1189             return true;
1190         }
1191
1192         return false;
1193     }
1194
1195     bool get_helper_return_key_disable (const String& uuid, uint32& disabled) {
1196         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1197
1198         if (it != m_helper_client_index.end ()) {
1199             int    client;
1200             uint32 context;
1201             uint32 ctx;
1202             get_focused_context (client, context);
1203             ctx = get_helper_ic (client, context);
1204             m_panel_agent_manager.get_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1205             return true;
1206         }
1207
1208         return false;
1209     }
1210
1211     bool set_helper_layout (const String& uuid, uint32& layout) {
1212         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1213
1214         if (it != m_helper_client_index.end ()) {
1215             int client;
1216             uint32 context;
1217             uint32 ctx;
1218             get_focused_context (client, context);
1219             ctx = get_helper_ic (client, context);
1220             m_panel_agent_manager.set_helper_layout (it->second.id, ctx, uuid, layout);
1221             return true;
1222         }
1223
1224         return false;
1225     }
1226
1227     bool set_helper_input_mode (const String& uuid, uint32& mode) {
1228         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1229
1230         if (it != m_helper_client_index.end ()) {
1231             int client;
1232             uint32 context;
1233             uint32 ctx;
1234             get_focused_context (client, context);
1235             ctx = get_helper_ic (client, context);
1236             m_panel_agent_manager.set_helper_input_mode (it->second.id, ctx, uuid, mode);
1237             return true;
1238         }
1239
1240         return false;
1241     }
1242
1243     bool set_helper_input_hint (const String& uuid, uint32& hint) {
1244         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1245
1246         if (it != m_helper_client_index.end ()) {
1247             int client;
1248             uint32 context;
1249             uint32 ctx;
1250             get_focused_context (client, context);
1251             ctx = get_helper_ic (client, context);
1252             m_panel_agent_manager.set_helper_input_hint (it->second.id, ctx, uuid, hint);
1253             return true;
1254         }
1255
1256         return false;
1257     }
1258
1259     bool set_helper_bidi_direction (const String& uuid, uint32& direction) {
1260         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1261
1262         if (it != m_helper_client_index.end ()) {
1263             int client;
1264             uint32 context;
1265             uint32 ctx;
1266             get_focused_context (client, context);
1267             ctx = get_helper_ic (client, context);
1268             m_panel_agent_manager.set_helper_bidi_direction (it->second.id, ctx, uuid, direction);
1269             return true;
1270         }
1271
1272         return false;
1273     }
1274
1275     bool set_helper_caps_mode (const String& uuid, uint32& mode) {
1276         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1277
1278         if (it != m_helper_client_index.end ()) {
1279             int client;
1280             uint32 context;
1281             uint32 ctx;
1282             get_focused_context (client, context);
1283             ctx = get_helper_ic (client, context);
1284             m_panel_agent_manager.set_helper_caps_mode (it->second.id, ctx, uuid, mode);
1285             return true;
1286         }
1287
1288         return false;
1289     }
1290
1291     bool show_helper_option_window (const String& uuid) {
1292         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1293
1294         if (it != m_helper_client_index.end ()) {
1295             int client;
1296             uint32 context;
1297             uint32 ctx;
1298             get_focused_context (client, context);
1299             ctx = get_helper_ic (client, context);
1300
1301             if (!m_signal_launch_option_application (uuid)) {
1302                 LOGD ("call show helper option");
1303                 m_panel_agent_manager.show_helper_option_window (it->second.id, ctx, uuid);
1304             }
1305
1306             return true;
1307         }
1308
1309         return false;
1310     }
1311
1312     bool resume_helper_option_window (const String& uuid) {
1313         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1314
1315         if (it != m_helper_client_index.end ()) {
1316             int client;
1317             uint32 context;
1318             uint32 ctx;
1319             get_focused_context (client, context);
1320             ctx = get_helper_ic (client, context);
1321             m_panel_agent_manager.resume_helper_option_window (it->second.id, ctx, uuid);
1322             return true;
1323         }
1324
1325         return false;
1326     }
1327
1328     bool set_helper_keyboard_mode (const String& uuid, uint32& mode) {
1329         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1330
1331         if (it != m_helper_client_index.end ()) {
1332             int client;
1333             uint32 context;
1334             uint32 ctx;
1335             get_focused_context (client, context);
1336             ctx = get_helper_ic (client, context);
1337             m_panel_agent_manager.set_helper_keyboard_mode (it->second.id, ctx, uuid, mode);
1338             return true;
1339         }
1340
1341         return false;
1342     }
1343
1344     bool set_helper_prediction_hint (const String& uuid, String prediction_hint) {
1345         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1346
1347         if (it != m_helper_client_index.end ()) {
1348             int client;
1349             uint32 context;
1350             uint32 ctx;
1351             get_focused_context (client, context);
1352             ctx = get_helper_ic (client, context);
1353             m_panel_agent_manager.set_helper_prediction_hint (it->second.id, ctx, uuid, prediction_hint);
1354             return true;
1355         }
1356
1357         return false;
1358     }
1359
1360     bool set_helper_mime_type (const String& uuid, String mime_type) {
1361         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1362
1363         if (it != m_helper_client_index.end ()) {
1364             int client;
1365             uint32 context;
1366             uint32 ctx;
1367             get_focused_context (client, context);
1368             ctx = get_helper_ic (client, context);
1369             m_panel_agent_manager.set_helper_mime_type (it->second.id, ctx, uuid, mime_type);
1370             return true;
1371         }
1372
1373         return false;
1374     }
1375
1376     bool finalize_content_helper (const String& uuid, String text, uint32 cursor_pos) {
1377         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1378
1379         if (it != m_helper_client_index.end ()) {
1380             int client;
1381             uint32 context;
1382             uint32 ctx;
1383             get_focused_context (client, context);
1384             ctx = get_helper_ic (client, context);
1385             m_panel_agent_manager.finalize_content_helper (it->second.id, ctx, uuid, text, cursor_pos);
1386             return true;
1387         }
1388
1389         return false;
1390     }
1391
1392     bool set_helper_prediction_hint_data (const String& uuid, String key, String value) {
1393         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1394
1395         if (it != m_helper_client_index.end ()) {
1396             int client;
1397             uint32 context;
1398             uint32 ctx;
1399             get_focused_context (client, context);
1400             ctx = get_helper_ic (client, context);
1401             m_panel_agent_manager.set_helper_prediction_hint_data (it->second.id, ctx, uuid, key, value);
1402             return true;
1403         }
1404
1405         return false;
1406     }
1407
1408     bool set_helper_optimization_hint(const String& uuid, uint32& hint) {
1409         HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1410
1411         if (it != m_helper_client_index.end()) {
1412             int client;
1413             uint32 context;
1414             uint32 ctx;
1415             get_focused_context(client, context);
1416             ctx = get_helper_ic(client, context);
1417             m_panel_agent_manager.set_helper_optimization_hint(it->second.id, ctx, uuid, hint);
1418             return true;
1419         }
1420
1421         return false;
1422     }
1423
1424     //ISM_TRANS_CMD_SHOW_ISF_CONTROL
1425     void show_isf_panel (int client_id) {
1426         SCIM_DEBUG_MAIN (4) << "InfoManager::show_isf_panel ()\n";
1427         m_signal_show_panel ();
1428     }
1429
1430     //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
1431     bool send_remote_input_message (int client_id, char* buf, size_t len) {
1432         SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_input_message ()\n";
1433
1434         if (buf && len > 0) {
1435             String msg (buf);
1436             m_signal_remoteinput_send_input_message (msg, true);
1437             return true;
1438         }
1439
1440         return false;
1441     }
1442
1443     void send_remote_surrounding_text (const char* text, uint32 cursor) {
1444         SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_surrounding_text ()\n";
1445
1446         m_signal_remoteinput_send_surrounding_text (cursor, text);
1447     }
1448
1449     //ISM_TRANS_CMD_HIDE_ISF_CONTROL
1450     void hide_isf_panel (int client_id) {
1451         SCIM_DEBUG_MAIN (4) << "InfoManager::hide_isf_panel ()\n";
1452         m_signal_hide_panel ();
1453     }
1454
1455     //ISM_TRANS_CMD_SHOW_ISE_PANEL
1456     void show_ise_panel (int client_id, uint32 client, uint32 context, char*   data, size_t  len) {
1457         SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_panel ()\n";
1458         m_reshow_needed = true;
1459         String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1460         String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1461         LOGD ("prepare to show ISE %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
1462         bool ret = false;
1463         m_show_request_client_id = client_id;
1464         m_active_client_id = client_id;
1465         SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1466
1467         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
1468             uint32 ctx = get_helper_ic (client, context);
1469             ret = show_helper (m_current_helper_uuid, data, len, ctx);
1470         }
1471
1472         /* Save ISE context for ISE panel re-showing */
1473         /* The size of data can be bigger than Ise_Context size if there is IMDATA. */
1474         if (data && len > 0) {
1475             delete_imdata_buffer ();
1476             delete_ise_context_buffer ();
1477             m_ise_context_buffer = new char [len];
1478             if (m_ise_context_buffer) {
1479                 m_ise_context_length = len;
1480                 memcpy (m_ise_context_buffer, data, m_ise_context_length);
1481             }
1482         }
1483
1484         if (ret) {
1485             m_signal_show_ise ();
1486         } else {
1487             bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
1488             if (launch_ise_on_request)
1489                 m_signal_start_default_ise ();
1490         }
1491     }
1492
1493     //ISM_TRANS_CMD_HIDE_ISE_PANEL
1494     void hide_ise_panel (int client_id, uint32 client, uint32 context) {
1495         SCIM_DEBUG_MAIN (4) << "InfoManager::hide_ise_panel ()\n";
1496         LOGD ("prepare to hide ISE, %d %d", client_id, m_show_request_client_id);
1497         SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1498
1499         m_reshow_needed = false;
1500         if (m_panel_client_map[client_id] == m_current_socket_client || client_id == m_show_request_client_id) {
1501 //            && (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
1502             int    focused_client;
1503             uint32 focused_context;
1504             get_focused_context (focused_client, focused_context);
1505
1506             if (focused_client == -1 && m_active_client_id != -1) {
1507                 focused_client  = m_panel_client_map[m_active_client_id];
1508                 focused_context = 0;
1509             }
1510
1511             m_signal_hide_ise ();
1512         }
1513
1514         /* Release ISE context & IMDATA buffer */
1515         delete_imdata_buffer ();
1516         delete_ise_context_buffer ();
1517     }
1518
1519     void hide_helper_ise (void) {
1520 #ifdef WAYLAND
1521         int    focused_client;
1522         uint32 focused_context;
1523         get_focused_context (focused_client, focused_context);
1524         m_panel_agent_manager.hide_helper_ise (focused_client, focused_context);
1525 #else
1526         m_signal_hide_ise ();
1527 #endif
1528     }
1529
1530     void prelaunch_helper_ise (void) {
1531         SCIM_DEBUG_MAIN (4) << "InfoManager::prelaunch_helper_ise ()\n";
1532
1533         /* NOTE :
1534          * Currenlty the SHOW_PREPARE hint is delivered only to the already-running ISEs.
1535          * If the newly launched ise also has to be notified of given optimization hint,
1536          * we'll need to mark the hint somewhere and send the message when a newly launched
1537          * ise connects to the panel.
1538          */
1539         HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1540         if (it != m_helper_client_index.end()) {
1541             int    client;
1542             uint32 context;
1543             uint32 ctx;
1544             get_focused_context(client, context);
1545             ctx = get_helper_ic(client, context);
1546             m_panel_agent_manager.set_helper_optimization_hint(it->second.id, ctx, m_current_helper_uuid, ISE_OPTIMIZATION_HINT_SHOW_PREPARE);
1547         }
1548
1549         m_signal_start_default_ise();
1550     }
1551
1552     void set_default_ise (const DEFAULT_ISE_T& ise) {
1553         LOGD ("set default ise : %s", ise.uuid.c_str());
1554         scim_global_config_write (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), ise.uuid);
1555         scim_global_config_flush ();
1556     }
1557
1558     void set_should_shared_ise (const bool should_shared_ise) {
1559         m_should_shared_ise = should_shared_ise;
1560     }
1561     //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
1562     bool process_key_event (KeyEvent& key, uint32 serial) {
1563         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1564
1565         if (it != m_helper_client_index.end ()) {
1566             int    client;
1567             uint32 context;
1568             uint32 ctx;
1569             get_focused_context (client, context);
1570             ctx = get_helper_ic (client, context);
1571             return m_panel_agent_manager.process_key_event (it->second.id, ctx, m_current_helper_uuid, key, serial);
1572         }
1573
1574         return false;
1575     }
1576
1577     //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
1578     bool process_input_device_event(int client_id, uint32 type, const char *data, size_t len, _OUT_ uint32& result) {
1579         SCIM_DEBUG_MAIN(4) << "InfoManager::process_input_device_event ()\n";
1580         HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1581
1582         if (it != m_helper_client_index.end()) {
1583             int    client;
1584             uint32 context;
1585             uint32 ctx;
1586             get_focused_context(client, context);
1587             ctx = get_helper_ic(client, context);
1588             return m_panel_agent_manager.process_input_device_event(it->second.id, ctx, m_current_helper_uuid, type, data, len, result);
1589         }
1590
1591         return false;
1592     }
1593
1594     bool get_helper_geometry (String& uuid, struct rectinfo& info) {
1595         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1596
1597         if (it != m_helper_client_index.end ()) {
1598             int    client;
1599             uint32 context;
1600             uint32 ctx;
1601             get_focused_context (client, context);
1602             ctx = get_helper_ic (client, context);
1603             return m_panel_agent_manager.get_helper_geometry (it->second.id, ctx, uuid, info);
1604         }
1605
1606         return false;
1607     }
1608
1609     bool get_helper_imdata (String& uuid, char** imdata, size_t& len) {
1610         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1611
1612         if (it != m_helper_client_index.end ()) {
1613             int    client;
1614             uint32 context;
1615             uint32 ctx;
1616             get_focused_context (client, context);
1617             ctx = get_helper_ic (client, context);
1618             m_panel_agent_manager.get_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1619             return true;
1620         }
1621
1622         return false;
1623     }
1624
1625     bool get_helper_layout (String& uuid, uint32& layout) {
1626         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1627
1628         if (it != m_helper_client_index.end ()) {
1629             int    client;
1630             uint32 context;
1631             uint32 ctx;
1632             get_focused_context (client, context);
1633             ctx = get_helper_ic (client, context);
1634             m_panel_agent_manager.get_helper_layout (it->second.id, ctx, uuid, layout);
1635             return true;
1636         }
1637
1638         return false;
1639     }
1640     //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
1641     void get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info) {
1642         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1643         m_signal_get_input_panel_geometry (info);
1644     }
1645     //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
1646     void get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info) {
1647         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1648         m_signal_get_candidate_geometry (info);
1649     }
1650     //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
1651     void get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len) {
1652         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1653         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
1654             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1655
1656             if (it != m_helper_client_index.end ()) {
1657                 int    client;
1658                 uint32 context;
1659                 get_focused_context (client, context);
1660                 uint32 ctx = get_helper_ic (client, context);
1661                 m_panel_agent_manager.get_ise_language_locale (it->second.id, ctx, m_current_helper_uuid, data, len);
1662             }
1663         }
1664     }
1665
1666     void get_current_ise_geometry (rectinfo& rect) {
1667         SCIM_DEBUG_MAIN (4) << __func__ << " \n";
1668         bool           ret  = false;
1669
1670         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1671             ret = get_helper_geometry (m_current_helper_uuid, rect);
1672
1673         if (!ret) {
1674             rect.pos_x  = 0;
1675             rect.pos_y  = 0;
1676             rect.width  = 0;
1677             rect.height = 0;
1678         }
1679     }
1680
1681     void set_ise_mode (int client_id, uint32 mode) {
1682         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_mode ()\n";
1683
1684         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1685             set_helper_mode (m_current_helper_uuid, mode);
1686     }
1687     //ISM_TRANS_CMD_SET_LAYOUT
1688     void set_ise_layout (int client_id, uint32 layout) {
1689         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_layout ()\n";
1690         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1691             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1692             iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
1693         }
1694         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1695             set_helper_layout (m_current_helper_uuid, layout);
1696     }
1697     //ISM_TRANS_CMD_SET_INPUT_MODE
1698     void set_ise_input_mode (int client_id, uint32 input_mode) {
1699         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_mode ()\n";
1700
1701         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1702             set_helper_input_mode (m_current_helper_uuid, input_mode);
1703     }
1704     //ISM_TRANS_CMD_SET_INPUT_HINT
1705     void set_ise_input_hint (int client_id, uint32 input_hint) {
1706         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_hint ()\n";
1707         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1708             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1709             iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(input_hint);
1710         }
1711         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1712             set_helper_input_hint (m_current_helper_uuid, input_hint);
1713     }
1714     //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
1715     void update_ise_bidi_direction (int client_id, uint32 bidi_direction) {
1716         SCIM_DEBUG_MAIN (4) << "InfoManager::update_ise_bidi_direction ()\n";
1717         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1718             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1719             iseContext->bidi_direction = static_cast<Ecore_IMF_BiDi_Direction>(bidi_direction);
1720         }
1721         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1722             set_helper_bidi_direction (m_current_helper_uuid, bidi_direction);
1723     }
1724     //ISM_TRANS_CMD_SET_ISE_LANGUAGE
1725     void set_ise_language (int client_id, uint32 language) {
1726         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_language ()\n";
1727         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1728             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1729             iseContext->language = static_cast<Ecore_IMF_Input_Panel_Lang>(language);
1730         }
1731         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1732             set_helper_language (m_current_helper_uuid, language);
1733     }
1734     //ISM_TRANS_CMD_SET_ISE_IMDATA
1735     void set_ise_imdata (int client_id, const char*   imdata, size_t  len) {
1736         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_imdata ()\n";
1737
1738         delete_imdata_buffer ();
1739         m_imdata_buffer = new char [len];
1740         if (m_imdata_buffer) {
1741             m_imdata_length = len;
1742             memcpy (m_imdata_buffer, imdata, m_imdata_length);
1743         }
1744         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1745             set_helper_imdata (m_current_helper_uuid, imdata, len);
1746     }
1747     //ISM_TRANS_CMD_GET_ISE_IMDATA
1748     bool get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len) {
1749         SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_imdata ()\n";
1750         bool    ret    = false;
1751
1752         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1753             ret = get_helper_imdata (m_current_helper_uuid, imdata, len);
1754
1755         return ret;
1756     }
1757     //ISM_TRANS_CMD_GET_LAYOUT
1758     bool get_ise_layout (int client_id, _OUT_ uint32& layout) {
1759         SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_layout ()\n";
1760         bool   ret = false;
1761
1762         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1763             ret = get_helper_layout (m_current_helper_uuid, layout);
1764
1765         return ret;
1766     }
1767     //ISM_TRANS_CMD_GET_ISE_STATE
1768     void get_ise_state (int client_id, _OUT_ int& state) {
1769         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1770         m_signal_get_ise_state (state);
1771     }
1772     //ISM_TRANS_CMD_GET_ACTIVE_ISE
1773     void get_active_ise (int client_id, _OUT_ String& default_uuid) {
1774         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1775         default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1776     }
1777     //ISM_TRANS_CMD_GET_ISE_LIST
1778     void get_ise_list (int client_id, _OUT_ std::vector<String>& strlist) {
1779         SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_list ()\n";
1780         m_signal_get_ise_list (strlist);
1781     }
1782     //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
1783     void get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info) {
1784         SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_helper_ise_info ()\n";
1785         m_signal_get_all_helper_ise_info (info);
1786
1787         //1 Check if the current IME's option (setting) is available or not.
1788         for (uint32 i = 0; i < info.appid.size (); i++) {
1789             if (m_current_helper_uuid.compare (info.appid [i]) == 0) {  // Find the current IME
1790                 // If the current IME's "has_option" is unknown (-1), get it through ISM_TRANS_CMD_CHECK_OPTION_WINDOW command.
1791                 // And it's saved to ime_info DB. Then next time this will be skipped.
1792                 if (info.has_option [i] >= 2) {
1793                     HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1794
1795                     if (it != m_helper_client_index.end ()) {
1796                         int    client;
1797                         uint32 context;
1798                         get_focused_context (client, context);
1799                         uint32 ctx = get_helper_ic (client, context);
1800                         uint32 avail = static_cast<uint32> (-1);
1801                         m_panel_agent_manager.check_option_window (it->second.id, ctx, m_current_helper_uuid, avail);
1802
1803                         if (!avail) {
1804                             String setting_app = isf_pkg_get_setting_app (m_current_helper_uuid);
1805                             if (setting_app.length () > 0)
1806                                 avail = 1;
1807                         }
1808
1809                         if (avail < 2) {
1810                             info.has_option [i] = avail;
1811                             // Update "has_option" column of ime_info DB and global variable.
1812                             m_signal_set_has_option_helper_ise_info (info.appid [i], static_cast<bool> (avail));
1813                         }
1814                     }
1815                 }
1816             }
1817         }
1818     }
1819     //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
1820     //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1821     void set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled) {
1822         SCIM_DEBUG_MAIN (4) << "InfoManager::set_enable_helper_ise_info ()\n";
1823         m_signal_set_enable_helper_ise_info (appid, static_cast<bool> (is_enabled));
1824     }
1825     //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
1826     //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1827     void show_helper_ise_list (int client_id) {
1828         SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_list ()\n";
1829         m_signal_show_helper_ise_list ();
1830     }
1831     //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
1832     //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1833     void show_helper_ise_selector (int client_id) {
1834         SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_selector ()\n";
1835         m_signal_show_helper_ise_selector ();
1836     }
1837     //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
1838     //reply
1839     void is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled) {
1840         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1841         int _nEnabled = 0;
1842         m_signal_is_helper_ise_enabled (strAppid, _nEnabled);
1843         nEnabled = (uint32)_nEnabled;
1844     }
1845     //ISM_TRANS_CMD_GET_ISE_INFORMATION
1846     void get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
1847                               _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName) {
1848         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1849         m_signal_get_ise_information (strUuid, strName, strLanguage, nType, nOption, strModuleName);
1850     }
1851     /*
1852      * useless
1853      */
1854     void get_language_list (int client_id, _OUT_ std::vector<String>& strlist) {
1855         SCIM_DEBUG_MAIN (4) << "InfoManager::get_language_list ()\n";
1856         m_signal_get_language_list (strlist);
1857     }
1858
1859     void get_all_language (int client_id, _OUT_ std::vector<String>& strlist) {
1860         SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_language ()\n";
1861         m_signal_get_all_language (strlist);
1862     }
1863     /*
1864      * useless
1865      */
1866     void get_ise_language (int client_id, char* buf, size_t len, _OUT_ std::vector<String>& strlist) {
1867         SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_language ()\n";
1868         m_signal_get_ise_language (buf, strlist);
1869     }
1870     //ISM_TRANS_CMD_RESET_ISE_OPTION
1871     //reply SCIM_TRANS_CMD_OK
1872     bool reset_ise_option (int client_id) {
1873         SCIM_DEBUG_MAIN (1) << "InfoManager::resect_ise_option ()\n";
1874         int    client = -1;
1875         uint32 context;
1876         lock ();
1877         ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
1878
1879         if (it != m_client_context_uuids.end ()) {
1880             get_imengine_client_context (it->first, client, context);
1881         }
1882
1883         if (client >= 0) {
1884             m_panel_agent_manager.reset_ise_option (client, context);
1885         }
1886
1887         unlock ();
1888         return client >= 0;
1889     }
1890
1891     bool find_active_ise_by_uuid (String uuid) {
1892         HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
1893
1894         for (; iter != m_helper_info_repository.end (); iter++) {
1895             if (!uuid.compare (iter->second.uuid))
1896                 return true;
1897         }
1898
1899         return false;
1900     }
1901     //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
1902     //reply
1903     bool set_active_ise_by_uuid (int client_id, char*  buf, size_t  len) {
1904         SCIM_DEBUG_MAIN (4) << "InfoManager::set_active_ise_by_uuid ()\n";
1905
1906         if (buf == NULL) {
1907             return false;
1908         }
1909
1910         String uuid (buf);
1911         ISE_INFO info;
1912
1913         if (!m_signal_get_ise_info_by_uuid (uuid, info)) {
1914             return false;
1915         }
1916
1917         if (info.type == TOOLBAR_KEYBOARD_MODE) {
1918             m_signal_set_active_ise_by_uuid (uuid, 1);
1919             return true;
1920         } else {
1921             m_signal_set_active_ise_by_uuid (uuid, 1);
1922         }
1923
1924         sync ();
1925
1926         if (find_active_ise_by_uuid (uuid)) {
1927             return true;
1928         } else {
1929             m_ise_pending_repository[uuid] = client_id;
1930             return false;
1931         }
1932     }
1933     //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
1934     //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1935     void set_initial_ise_by_uuid (int client_id, char*  buf, size_t  len) {
1936         SCIM_DEBUG_MAIN (4) << "InfoManager::set_initial_ise_by_uuid ()\n";
1937
1938         if (buf == NULL) {
1939             return;
1940         }
1941
1942         String uuid (buf);
1943         scim_global_config_write (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (uuid));
1944         scim_global_config_flush ();
1945     }
1946     //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
1947     void set_ise_return_key_type (int client_id, uint32 type) {
1948         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1949         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1950             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1951             iseContext->return_key_type = static_cast<Ecore_IMF_Input_Panel_Return_Key_Type>(type);
1952         }
1953         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1954             set_helper_return_key_type (m_current_helper_uuid, type);
1955     }
1956     //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
1957     //reply
1958     bool get_ise_return_key_type (int client_id, _OUT_ uint32& type) {
1959         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1960         bool   ret  = false;
1961
1962         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1963             ret = get_helper_return_key_type (m_current_helper_uuid, type);
1964
1965         return ret;
1966     }
1967     //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
1968     void set_ise_return_key_disable (int client_id, uint32 disabled) {
1969         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1970         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
1971             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
1972             iseContext->return_key_disabled = static_cast<Eina_Bool>(disabled);
1973         }
1974         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1975             set_helper_return_key_disable (m_current_helper_uuid, disabled);
1976     }
1977     //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
1978     bool get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled) {
1979         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1980         bool   ret  = false;
1981
1982         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1983             ret = get_helper_return_key_disable (m_current_helper_uuid, disabled);
1984
1985         return ret;
1986     }
1987
1988     void reset_helper_context (const String& uuid) {
1989         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1990
1991         if (it != m_helper_client_index.end ()) {
1992             int client;
1993             uint32 context;
1994             uint32 ctx;
1995             get_focused_context (client, context);
1996             ctx = get_helper_ic (client, context);
1997             m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
1998         }
1999     }
2000     /*
2001      * useless
2002      */
2003     void reset_ise_context (int client_id) {
2004         SCIM_DEBUG_MAIN (4) << "InfoManager::reset_ise_context ()\n";
2005
2006         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2007             reset_helper_context (m_current_helper_uuid);
2008     }
2009     //ISM_TRANS_CMD_SET_CAPS_MODE
2010     void set_ise_caps_mode (int client_id, uint32 mode) {
2011         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_caps_mode ()\n";
2012         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
2013             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
2014             iseContext->caps_mode = static_cast<Eina_Bool>(mode);
2015         }
2016         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2017             set_helper_caps_mode (m_current_helper_uuid, mode);
2018     }
2019
2020     //SCIM_TRANS_CMD_RELOAD_CONFIG
2021     void reload_config (void) {
2022         SCIM_DEBUG_MAIN (1) << "InfoManager::reload_config ()\n";
2023         lock ();
2024
2025         for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
2026             if (it->second.type == FRONTEND_CLIENT || it->second.type == HELPER_CLIENT) {
2027                 m_panel_agent_manager.reload_config (it->first);
2028             }
2029         }
2030
2031         unlock ();
2032     }
2033
2034     bool exit (void) {
2035         SCIM_DEBUG_MAIN (1) << "InfoManager::exit ()\n";
2036         lock ();
2037
2038         for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
2039             m_panel_agent_manager.exit (it->first, 0);
2040         }
2041
2042         unlock ();
2043         stop ();
2044         return true;
2045     }
2046
2047     void update_ise_list (std::vector<String>& strList) {
2048         /* request PanelClient to update keyboard ise list */
2049         update_keyboard_ise_list ();
2050     }
2051     //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
2052     void will_show_ack (int client_id) {
2053         SCIM_DEBUG_MAIN (4) << "InfoManager::will_show_ack ()\n";
2054         m_signal_will_show_ack ();
2055     }
2056     //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
2057     void will_hide_ack (int client_id) {
2058         SCIM_DEBUG_MAIN (4) << "InfoManager::will_hide_ack ()\n";
2059         m_signal_will_hide_ack ();
2060     }
2061     //ISM_TRANS_CMD_RESET_DEFAULT_ISE
2062     void reset_default_ise (int client_id) {
2063         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2064         String initial_ise = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2065
2066         if (initial_ise.length () > 0)
2067             m_signal_set_active_ise_by_uuid (initial_ise, 1);
2068         else
2069             std::cerr << "Read SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID is failed!!!\n";
2070     }
2071     //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
2072     void set_keyboard_mode (int client_id, uint32 mode) {
2073         SCIM_DEBUG_MAIN (4) << "InfoManager::set_keyboard_mode ()\n";
2074         m_signal_set_keyboard_mode (mode);
2075         set_ise_keyboard_mode (client_id, mode);
2076     }
2077     //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
2078     void candidate_will_hide_ack (int client_id) {
2079         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "\n";
2080         m_signal_candidate_will_hide_ack ();
2081     }
2082
2083     //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
2084     void get_active_helper_option (int client_id, _OUT_ uint32& option) {
2085         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2086         option = get_current_helper_option ();
2087     }
2088     //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
2089     void show_ise_option_window (int client_id) {
2090         SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_option_window ()\n";
2091         String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2092         String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2093         LOGD ("prepare to show ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2094
2095         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2096             show_helper_option_window (m_current_helper_uuid);
2097         }
2098     }
2099
2100     //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
2101     void resume_ise_option_window (int client_id) {
2102         SCIM_DEBUG_MAIN (4) << "InfoManager::resume_ise_option_window ()\n";
2103         String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
2104         String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2105         LOGD ("prepare to resume ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
2106
2107         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
2108             resume_helper_option_window (m_current_helper_uuid);
2109         }
2110     }
2111
2112     //ISM_TRANS_CMD_SET_KEYBOARD_MODE
2113     void set_ise_keyboard_mode (int client_id, uint32 mode) {
2114         SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_keyboard_mode ()\n";
2115         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2116             set_helper_keyboard_mode (m_current_helper_uuid, mode);
2117     }
2118
2119     //ISM_TRANS_CMD_SET_PREDICTION_HINT
2120     void set_prediction_hint (int client_id, String prediction_hint) {
2121         SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint ()\n";
2122         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2123             set_helper_prediction_hint (m_current_helper_uuid, prediction_hint);
2124     }
2125
2126     //ISM_TRANS_CMD_SET_MIME_TYPE
2127     void set_ise_mime_type (int client_id, String mime_type) {
2128         SCIM_DEBUG_MAIN (4) << "InfoManager::set_mime_type ()\n";
2129         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2130             set_helper_mime_type (m_current_helper_uuid, mime_type);
2131     }
2132
2133     //ISM_TRANS_CMD_FINALIZE_CONTENT
2134     void finalize_content (int client_id, String text, uint32 cursor_pos) {
2135         SCIM_DEBUG_MAIN (4) << "InfoManager::finalize_content ()\n";
2136         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2137             finalize_content_helper (m_current_helper_uuid, text, cursor_pos);
2138     }
2139
2140     //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
2141     void set_prediction_hint_data (int client_id, String key, String value) {
2142         SCIM_DEBUG_MAIN (4) << "InfoManager::set_prediction_hint_data ()\n";
2143         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2144             set_helper_prediction_hint_data (m_current_helper_uuid, key, value);
2145     }
2146
2147     //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
2148     void set_optimization_hint(int client_id, uint32 hint) {
2149         SCIM_DEBUG_MAIN(4) << "InfoManager::set_optimization_hint ()\n";
2150         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2151             set_helper_optimization_hint(m_current_helper_uuid, hint);
2152     }
2153
2154     //ISM_TRANS_CMD_EXPAND_CANDIDATE
2155     void expand_candidate () {
2156         LOGD ("");
2157         m_signal_expand_candidate ();
2158     }
2159
2160     //ISM_TRANS_CMD_CONTRACT_CANDIDATE
2161     void contract_candidate () {
2162         LOGD ("");
2163         m_signal_contract_candidate ();
2164     }
2165     //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
2166     void get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info) {
2167         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
2168         LOGD ("");
2169         m_signal_get_recent_ise_geometry (angle, info);
2170     }
2171
2172     bool check_privilege_by_sockfd (int client_id, const String& privilege) {
2173         return m_signal_check_privilege_by_sockfd (client_id, privilege);
2174     }
2175
2176     bool remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
2177     {
2178         SCIM_DEBUG_MAIN(1) << "PanelAgent::update_preedit_string ()\n";
2179         int    client = -1;
2180         uint32 context = 0;
2181
2182         lock ();
2183
2184         get_focused_context (client, context);
2185         if (client >= 0) {
2186             m_panel_agent_manager.remote_update_preedit_string (client, context, str, str, attrs, caret);
2187         }
2188
2189         unlock ();
2190
2191         return client >= 0;
2192     }
2193
2194     bool remoteinput_commit_string (const WideString &str)
2195     {
2196         SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_commit_string ()\n";
2197         int    client = -1;
2198         uint32 context = 0;
2199
2200         lock ();
2201
2202         get_focused_context (client, context);
2203         if (client >= 0) {
2204             m_panel_agent_manager.remote_commit_string (client, context, str);
2205         }
2206
2207         unlock ();
2208
2209         return client >= 0;
2210     }
2211
2212     bool remoteinput_send_key_event (const KeyEvent &key)
2213     {
2214         SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_send_key_event ()\n";
2215         int    client = -1;
2216         uint32 context = 0;
2217
2218         get_focused_context (client, context);
2219         if (client >= 0) {
2220             m_panel_agent_manager.remote_send_key_event (client, context, key);
2221         }
2222
2223         return client >= 0;
2224     }
2225
2226     bool remoteinput_forward_key_event (const KeyEvent &key)
2227     {
2228         SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_forward_key_event ()\n";
2229         int    client = -1;
2230         uint32 context = 0;
2231
2232         get_focused_context (client, context);
2233         if (client >= 0) {
2234             m_panel_agent_manager.remote_forward_key_event (client, context, key);
2235         }
2236
2237         return client >= 0;
2238     }
2239
2240     bool remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
2241     {
2242         SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_delete_surrounding_text ()\n";
2243         int    client = -1;
2244         uint32 context = 0;
2245
2246         get_focused_context (client, context);
2247         if (client >= 0) {
2248             m_panel_agent_manager.remote_delete_surrounding_text (client, context, offset, len);
2249         }
2250
2251         return client >= 0;
2252     }
2253
2254     void reshow_input_panel () {
2255         /* Check whether application is already focus_in */
2256         if (m_refocus_needed) {
2257             LOGD ("Re-focus in");
2258             SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
2259
2260             focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
2261             reset_keyboard_ise ();
2262         }
2263
2264         /* Check whether ISE panel is already shown */
2265         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0 && m_reshow_needed) {
2266             LOGD ("Re-show input_panel");
2267             SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
2268
2269             int    focused_client;
2270             uint32 focused_context;
2271
2272             get_focused_context (focused_client, focused_context);
2273             if (focused_client == -1 && m_active_client_id != -1) {
2274                 focused_client  = m_panel_client_map[m_active_client_id];
2275                 focused_context = 0;
2276             }
2277
2278             m_panel_agent_manager.update_entry_metadata (focused_client, focused_context);
2279             uint32 ctx = get_helper_ic (focused_client, focused_context);
2280             bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
2281             if (ret) {
2282                 m_signal_show_ise ();
2283
2284                 if (m_imdata_buffer && m_imdata_length > 0 && m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2285                     set_helper_imdata (m_current_helper_uuid, m_imdata_buffer, m_imdata_length);
2286             }
2287         }
2288     }
2289
2290     Connection signal_connect_turn_on (InfoManagerSlotVoid*                slot) {
2291         return m_signal_turn_on.connect (slot);
2292     }
2293
2294     Connection signal_connect_turn_off (InfoManagerSlotVoid*                slot) {
2295         return m_signal_turn_off.connect (slot);
2296     }
2297
2298     Connection signal_connect_show_panel (InfoManagerSlotVoid*                slot) {
2299         return m_signal_show_panel.connect (slot);
2300     }
2301
2302     Connection signal_connect_hide_panel (InfoManagerSlotVoid*                slot) {
2303         return m_signal_hide_panel.connect (slot);
2304     }
2305
2306     Connection signal_connect_update_screen (InfoManagerSlotInt*                 slot) {
2307         return m_signal_update_screen.connect (slot);
2308     }
2309
2310     Connection signal_connect_update_spot_location (InfoManagerSlotIntIntInt*           slot) {
2311         return m_signal_update_spot_location.connect (slot);
2312     }
2313
2314     Connection signal_connect_update_factory_info (InfoManagerSlotFactoryInfo*         slot) {
2315         return m_signal_update_factory_info.connect (slot);
2316     }
2317
2318     Connection signal_connect_start_default_ise (InfoManagerSlotVoid*                slot) {
2319         return m_signal_start_default_ise.connect (slot);
2320     }
2321
2322     Connection signal_connect_stop_default_ise (InfoManagerSlotVoid*                slot) {
2323         return m_signal_stop_default_ise.connect (slot);
2324     }
2325
2326     Connection signal_connect_set_candidate_ui (InfoManagerSlotIntInt*              slot) {
2327         return m_signal_set_candidate_ui.connect (slot);
2328     }
2329
2330     Connection signal_connect_get_candidate_ui (InfoManagerSlotIntInt2*             slot) {
2331         return m_signal_get_candidate_ui.connect (slot);
2332     }
2333
2334     Connection signal_connect_set_candidate_position (InfoManagerSlotIntInt*              slot) {
2335         return m_signal_set_candidate_position.connect (slot);
2336     }
2337
2338     Connection signal_connect_get_candidate_geometry (InfoManagerSlotRect*                slot) {
2339         return m_signal_get_candidate_geometry.connect (slot);
2340     }
2341
2342     Connection signal_connect_get_input_panel_geometry (InfoManagerSlotRect*                slot) {
2343         return m_signal_get_input_panel_geometry.connect (slot);
2344     }
2345
2346     Connection signal_connect_set_keyboard_ise (InfoManagerSlotString*              slot) {
2347         return m_signal_set_keyboard_ise.connect (slot);
2348     }
2349
2350     Connection signal_connect_get_keyboard_ise (InfoManagerSlotString2*             slot) {
2351         return m_signal_get_keyboard_ise.connect (slot);
2352     }
2353
2354     Connection signal_connect_show_help (InfoManagerSlotString*              slot) {
2355         return m_signal_show_help.connect (slot);
2356     }
2357
2358     Connection signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector*   slot) {
2359         return m_signal_show_factory_menu.connect (slot);
2360     }
2361
2362     Connection signal_connect_show_preedit_string (InfoManagerSlotVoid*                slot) {
2363         return m_signal_show_preedit_string.connect (slot);
2364     }
2365
2366     Connection signal_connect_show_aux_string (InfoManagerSlotVoid*                slot) {
2367         return m_signal_show_aux_string.connect (slot);
2368     }
2369
2370     Connection signal_connect_show_lookup_table (InfoManagerSlotVoid*                slot) {
2371         return m_signal_show_lookup_table.connect (slot);
2372     }
2373
2374     Connection signal_connect_show_associate_table (InfoManagerSlotVoid*                slot) {
2375         return m_signal_show_associate_table.connect (slot);
2376     }
2377
2378     Connection signal_connect_hide_preedit_string (InfoManagerSlotVoid*                slot) {
2379         return m_signal_hide_preedit_string.connect (slot);
2380     }
2381
2382     Connection signal_connect_hide_aux_string (InfoManagerSlotVoid*                slot) {
2383         return m_signal_hide_aux_string.connect (slot);
2384     }
2385
2386     Connection signal_connect_hide_lookup_table (InfoManagerSlotVoid*                slot) {
2387         return m_signal_hide_lookup_table.connect (slot);
2388     }
2389
2390     Connection signal_connect_hide_associate_table (InfoManagerSlotVoid*                slot) {
2391         return m_signal_hide_associate_table.connect (slot);
2392     }
2393
2394     Connection signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt*  slot) {
2395         return m_signal_update_preedit_string.connect (slot);
2396     }
2397
2398     Connection signal_connect_update_preedit_caret (InfoManagerSlotInt*                 slot) {
2399         return m_signal_update_preedit_caret.connect (slot);
2400     }
2401
2402     Connection signal_connect_recapture_string (InfoManagerSlotAttributeInt2String2*    slot) {
2403         return m_signal_recapture_string.connect (slot);
2404     }
2405
2406     Connection signal_connect_update_aux_string (InfoManagerSlotAttributeString*     slot) {
2407         return m_signal_update_aux_string.connect (slot);
2408     }
2409
2410     Connection signal_connect_update_lookup_table (InfoManagerSlotLookupTable*         slot) {
2411         return m_signal_update_lookup_table.connect (slot);
2412     }
2413
2414     Connection signal_connect_update_associate_table (InfoManagerSlotLookupTable*         slot) {
2415         return m_signal_update_associate_table.connect (slot);
2416     }
2417
2418     Connection signal_connect_register_properties (InfoManagerSlotPropertyList*        slot) {
2419         return m_signal_register_properties.connect (slot);
2420     }
2421
2422     Connection signal_connect_update_property (InfoManagerSlotProperty*            slot) {
2423         return m_signal_update_property.connect (slot);
2424     }
2425
2426     Connection signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList*     slot) {
2427         return m_signal_register_helper_properties.connect (slot);
2428     }
2429
2430     Connection signal_connect_update_helper_property (InfoManagerSlotIntProperty*         slot) {
2431         return m_signal_update_helper_property.connect (slot);
2432     }
2433
2434     Connection signal_connect_register_helper (InfoManagerSlotIntHelperInfo*       slot) {
2435         return m_signal_register_helper.connect (slot);
2436     }
2437
2438     Connection signal_connect_remove_helper (InfoManagerSlotInt*                 slot) {
2439         return m_signal_remove_helper.connect (slot);
2440     }
2441
2442     Connection signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool*          slot) {
2443         return m_signal_set_active_ise_by_uuid.connect (slot);
2444     }
2445
2446     Connection signal_connect_focus_in (InfoManagerSlotVoid*                   slot) {
2447         return m_signal_focus_in.connect (slot);
2448     }
2449
2450     Connection signal_connect_focus_out (InfoManagerSlotVoid*                   slot) {
2451         return m_signal_focus_out.connect (slot);
2452     }
2453
2454     Connection signal_connect_expand_candidate (InfoManagerSlotVoid*                   slot) {
2455         return m_signal_expand_candidate.connect (slot);
2456     }
2457
2458     Connection signal_connect_contract_candidate (InfoManagerSlotVoid*                   slot) {
2459         return m_signal_contract_candidate.connect (slot);
2460     }
2461
2462     Connection signal_connect_select_candidate (InfoManagerSlotInt*                    slot) {
2463         return m_signal_select_candidate.connect (slot);
2464     }
2465
2466     Connection signal_connect_get_ise_list (InfoManagerSlotBoolStringVector*       slot) {
2467         return m_signal_get_ise_list.connect (slot);
2468     }
2469
2470     Connection signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo*       slot) {
2471         return m_signal_get_all_helper_ise_info.connect (slot);
2472     }
2473
2474     Connection signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool*          slot) {
2475         return m_signal_set_has_option_helper_ise_info.connect (slot);
2476     }
2477
2478     Connection signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool*          slot) {
2479         return m_signal_set_enable_helper_ise_info.connect (slot);
2480     }
2481
2482     Connection signal_connect_show_helper_ise_list (InfoManagerSlotVoid*                slot) {
2483         return m_signal_show_helper_ise_list.connect (slot);
2484     }
2485
2486     Connection signal_connect_show_helper_ise_selector (InfoManagerSlotVoid*                slot) {
2487         return m_signal_show_helper_ise_selector.connect (slot);
2488     }
2489
2490     Connection signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt*                slot) {
2491         return m_signal_is_helper_ise_enabled.connect (slot);
2492     }
2493
2494     Connection signal_connect_get_ise_information (InfoManagerSlotBoolString4int2*        slot) {
2495         return m_signal_get_ise_information.connect (slot);
2496     }
2497
2498     Connection signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector*       slot) {
2499         return m_signal_get_keyboard_ise_list.connect (slot);
2500     }
2501
2502     Connection signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt*           slot) {
2503         return m_signal_update_ise_geometry.connect (slot);
2504     }
2505
2506     Connection signal_connect_get_language_list (InfoManagerSlotStringVector*           slot) {
2507         return m_signal_get_language_list.connect (slot);
2508     }
2509
2510     Connection signal_connect_get_all_language (InfoManagerSlotStringVector*           slot) {
2511         return m_signal_get_all_language.connect (slot);
2512     }
2513
2514     Connection signal_connect_get_ise_language (InfoManagerSlotStrStringVector*        slot) {
2515         return m_signal_get_ise_language.connect (slot);
2516     }
2517
2518     Connection signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO*          slot) {
2519         return m_signal_get_ise_info_by_uuid.connect (slot);
2520     }
2521
2522     Connection signal_connect_send_key_event (InfoManagerSlotKeyEvent*               slot) {
2523         return m_signal_send_key_event.connect (slot);
2524     }
2525
2526     Connection signal_connect_accept_connection (InfoManagerSlotInt*                    slot) {
2527         return m_signal_accept_connection.connect (slot);
2528     }
2529
2530     Connection signal_connect_close_connection (InfoManagerSlotInt*                    slot) {
2531         return m_signal_close_connection.connect (slot);
2532     }
2533
2534     Connection signal_connect_exit (InfoManagerSlotVoid*                   slot) {
2535         return m_signal_exit.connect (slot);
2536     }
2537
2538     Connection signal_connect_transaction_start (InfoManagerSlotVoid*                   slot) {
2539         return m_signal_transaction_start.connect (slot);
2540     }
2541
2542     Connection signal_connect_transaction_end (InfoManagerSlotVoid*                   slot) {
2543         return m_signal_transaction_end.connect (slot);
2544     }
2545
2546     Connection signal_connect_lock (InfoManagerSlotVoid*                   slot) {
2547         return m_signal_lock.connect (slot);
2548     }
2549
2550     Connection signal_connect_unlock (InfoManagerSlotVoid*                   slot) {
2551         return m_signal_unlock.connect (slot);
2552     }
2553
2554     Connection signal_connect_update_input_context (InfoManagerSlotIntInt*                 slot) {
2555         return m_signal_update_input_context.connect (slot);
2556     }
2557
2558     Connection signal_connect_update_language_locale(InfoManagerSlotString*                 slot) {
2559         return m_signal_update_language_locale.connect(slot);
2560     }
2561
2562     Connection signal_connect_show_ise (InfoManagerSlotVoid*                slot) {
2563         return m_signal_show_ise.connect (slot);
2564     }
2565
2566     Connection signal_connect_hide_ise (InfoManagerSlotVoid*                slot) {
2567         return m_signal_hide_ise.connect (slot);
2568     }
2569
2570     Connection signal_connect_will_show_ack (InfoManagerSlotVoid*                slot) {
2571         return m_signal_will_show_ack.connect (slot);
2572     }
2573
2574     Connection signal_connect_will_hide_ack (InfoManagerSlotVoid*                slot) {
2575         return m_signal_will_hide_ack.connect (slot);
2576     }
2577
2578     Connection signal_connect_set_keyboard_mode (InfoManagerSlotInt*                slot) {
2579         return m_signal_set_keyboard_mode.connect (slot);
2580     }
2581
2582     Connection signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid*                slot) {
2583         return m_signal_candidate_will_hide_ack.connect (slot);
2584     }
2585
2586     Connection signal_connect_get_ise_state (InfoManagerSlotInt2*                slot) {
2587         return m_signal_get_ise_state.connect (slot);
2588     }
2589
2590     Connection signal_connect_run_helper (InfoManagerSlotString3*                slot)
2591     {
2592         return m_signal_run_helper.connect (slot);
2593     }
2594
2595     Connection signal_connect_launch_option_application (InfoManagerSlotBoolString*                slot)
2596     {
2597         return m_signal_launch_option_application.connect (slot);
2598     }
2599
2600     Connection signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect*                slot) {
2601         return m_signal_get_recent_ise_geometry.connect (slot);
2602     }
2603
2604     Connection signal_connect_check_privilege_by_sockfd  (InfoManagerSlotIntString2* slot)
2605     {
2606         return m_signal_check_privilege_by_sockfd.connect (slot);
2607     }
2608
2609     Connection signal_connect_remoteinput_send_input_message   (InfoManagerSlotStringBool*                slot)
2610     {
2611         return m_signal_remoteinput_send_input_message.connect (slot);
2612     }
2613
2614     Connection signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString*                slot)
2615     {
2616         return m_signal_remoteinput_send_surrounding_text.connect (slot);
2617     }
2618
2619     //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
2620     void register_panel_client (uint32 client_id, uint32 id) {
2621         m_panel_client_map [client_id] = (int)id;
2622     }
2623     //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
2624     void register_input_context (uint32 client_id, uint32 context, String  uuid) {
2625         uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2626         m_client_context_uuids [ctx] = uuid;
2627     }
2628     //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
2629     void remove_input_context (uint32 client_id, uint32 context) {
2630         uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2631         m_client_context_uuids.erase (ctx);
2632
2633         if (ctx == get_helper_ic (m_current_socket_client, m_current_client_context)) {
2634             lock ();
2635             m_current_socket_client  = m_last_socket_client;
2636             m_current_client_context = m_last_client_context;
2637             m_current_context_uuid   = m_last_context_uuid;
2638             m_last_socket_client     = -1;
2639             m_last_client_context    = 0;
2640             m_last_context_uuid      = String ("");
2641
2642             if (m_current_socket_client == -1) {
2643                 unlock ();
2644                 socket_update_control_panel ();
2645             } else {
2646                 unlock ();
2647             }
2648         } else if (ctx == get_helper_ic (m_last_socket_client, m_last_client_context)) {
2649             lock ();
2650             m_last_socket_client  = -1;
2651             m_last_client_context = 0;
2652             m_last_context_uuid   = String ("");
2653             unlock ();
2654         }
2655
2656         if (m_client_context_uuids.size () == 0)
2657             m_signal_stop_default_ise ();
2658     }
2659
2660     //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
2661     void socket_reset_input_context (int client_id, uint32 context) {
2662         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_reset_input_context \n";
2663
2664         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2665             socket_reset_helper_input_context (m_current_helper_uuid, m_panel_client_map[client_id], context);
2666     }
2667
2668     //SCIM_TRANS_CMD_FOCUS_IN
2669     void focus_in (int client_id, uint32 context,  String  uuid) {
2670         m_refocus_needed = true;
2671         bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
2672         if (launch_ise_on_request)
2673             m_signal_start_default_ise ();
2674
2675         m_signal_focus_in ();
2676         focus_in_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2677         SCIM_DEBUG_MAIN (2) << "PanelAgent::focus_in (" << client_id << "," << context << "," << uuid << ")\n";
2678         m_active_client_id = client_id;
2679         lock ();
2680
2681         if (m_current_socket_client >= 0) {
2682             m_last_socket_client  = m_current_socket_client;
2683             m_last_client_context = m_current_client_context;
2684             m_last_context_uuid   = m_current_context_uuid;
2685         }
2686
2687         m_current_socket_client  = m_panel_client_map[client_id];
2688         m_current_client_context = context;
2689         m_current_context_uuid   = uuid;
2690         unlock ();
2691     }
2692
2693     //SCIM_TRANS_CMD_FOCUS_OUT
2694     void focus_out (int client_id, uint32 context) {
2695         m_refocus_needed = false;
2696         m_signal_focus_out ();
2697         lock ();
2698         focus_out_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2699
2700         if (m_current_socket_client >= 0) {
2701             m_last_socket_client  = m_current_socket_client;
2702             m_last_client_context = m_current_client_context;
2703             m_last_context_uuid   = m_current_context_uuid;
2704         }
2705
2706         m_current_socket_client  = -1;
2707         m_current_client_context = 0;
2708         m_current_context_uuid   = String ("");
2709         unlock ();
2710     }
2711
2712     //ISM_TRANS_CMD_TURN_ON_LOG
2713     void socket_turn_on_log (uint32 isOn) {
2714         if (isOn) {
2715             DebugOutput::enable_debug (SCIM_DEBUG_AllMask);
2716             DebugOutput::set_verbose_level (7);
2717             SCIM_DEBUG_MAIN (4) << __func__ << " on\n";
2718         } else {
2719             SCIM_DEBUG_MAIN (4) << __func__ << " off\n";
2720             DebugOutput::disable_debug (SCIM_DEBUG_AllMask);
2721             DebugOutput::set_verbose_level (0);
2722         }
2723
2724         int     focused_client;
2725         uint32  focused_context;
2726         get_focused_context (focused_client, focused_context);
2727
2728         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
2729             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2730
2731             if (it != m_helper_client_index.end ()) {
2732                 //uint32 ctx = get_helper_ic (focused_client, focused_context);
2733                 //FIXME
2734                 //m_panel_agent_manager.socket_turn_on_log (it->second.id, ctx, m_current_helper_uuid, isOn);
2735             }
2736         }
2737
2738         if (focused_client == -1) {
2739             std::cerr << __func__ << " get_focused_context is failed!!!\n";
2740             return;
2741         }
2742
2743         ClientInfo client_info = socket_get_client_info (focused_client);
2744
2745         if (client_info.type == FRONTEND_CLIENT) {
2746             //FIXME
2747             //m_panel_agent_manager.socket_turn_on_log (focused_client, focused_context, isOn);
2748         }
2749     }
2750
2751
2752     void add_client (int client_id, uint32 key, ClientType type) {
2753         LOGD ("id:%d, key:%d, type:%d", client_id, key, type);
2754         ClientInfo info;
2755         info.key = key;
2756         info.type = type;
2757         SCIM_DEBUG_MAIN (4) << "Add client to repository. Type=" << type << " key=" << key << "\n";
2758         lock ();
2759         m_client_repository [client_id] = info;
2760
2761         if (info.type == IMCONTROL_ACT_CLIENT) {
2762             m_pending_active_imcontrol_id = client_id;
2763         } else if (info.type == IMCONTROL_CLIENT) {
2764             m_imcontrol_map [m_pending_active_imcontrol_id] = client_id;
2765             m_pending_active_imcontrol_id = -1;
2766         } else if (info.type == REMOTEINPUT_ACT_CLIENT) {
2767             m_current_send_remoteinput_id.push_back (client_id);
2768         } else if (info.type == REMOTEINPUT_CLIENT) {
2769             m_current_recv_remoteinput_id.push_back (client_id);
2770         }
2771
2772         LOGD ("%d clients connecting", m_client_repository.size());
2773
2774         unlock ();
2775     }
2776
2777     void del_client (int client_id) {
2778         ClientRepository::iterator iter = m_client_repository.find(client_id);
2779         if (iter == m_client_repository.end()) {
2780             LOGW("The client with id %d does not exist in our client repository, returning", client_id);
2781             return;
2782         }
2783         lock ();
2784         m_signal_close_connection (client_id);
2785         ClientInfo client_info = socket_get_client_info (client_id);
2786         m_client_repository.erase (client_id);
2787         LOGD ("id:%d, type:%d", client_id, client_info.type);
2788 #ifdef PANEL_SERVER_AUTO_EXIT
2789         /* Exit panel if there is no connected client anymore. */
2790         if (client_info.type != UNKNOWN_CLIENT && m_client_repository.size () == 0 && !m_should_resident) {
2791             SCIM_DEBUG_MAIN (4) << "Exit Socket Server Thread.\n";
2792             server->shutdown ();
2793             m_signal_exit.emit ();
2794         }
2795 #endif
2796         unlock ();
2797
2798         if (client_info.type == FRONTEND_CLIENT) {
2799             SCIM_DEBUG_MAIN (4) << "It's a FrontEnd client.\n";
2800
2801             /* The focused client is closed. */
2802             if (m_current_socket_client == client_id) {
2803                 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2804                     hide_helper (m_current_helper_uuid);
2805
2806                 lock ();
2807                 m_current_socket_client = -1;
2808                 m_current_client_context = 0;
2809                 m_current_context_uuid = String ("");
2810                 unlock ();
2811                 socket_transaction_start ();
2812                 socket_turn_off ();
2813                 socket_transaction_end ();
2814             }
2815
2816             if (m_last_socket_client == client_id) {
2817                 lock ();
2818                 m_last_socket_client = -1;
2819                 m_last_client_context = 0;
2820                 m_last_context_uuid = String ("");
2821                 unlock ();
2822             }
2823
2824             /* Erase all associated Client Context UUIDs. */
2825             std::vector <uint32> ctx_list;
2826             ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
2827
2828             for (; it != m_client_context_uuids.end (); ++it) {
2829                 if ((it->first & 0xFFFF) == (client_id & 0xFFFF))
2830                     ctx_list.push_back (it->first);
2831             }
2832
2833             for (size_t i = 0; i < ctx_list.size (); ++i)
2834                 m_client_context_uuids.erase (ctx_list [i]);
2835
2836             /* Erase all helperise info associated with the client */
2837             ctx_list.clear ();
2838             it = m_client_context_helper.begin ();
2839
2840             for (; it != m_client_context_helper.end (); ++it) {
2841                 if ((it->first & 0xFFFF) == (client_id & 0xFFFF)) {
2842                     ctx_list.push_back (it->first);
2843                     /* similar to stop_helper except that it will not call get_focused_context() */
2844                     String uuid = it->second;
2845
2846                     if (m_helper_uuid_count.find (uuid) != m_helper_uuid_count.end ()) {
2847                         uint32 count = m_helper_uuid_count[uuid];
2848
2849                         if (1 == count) {
2850                             m_helper_uuid_count.erase (uuid);
2851                             HelperClientIndex::iterator pise = m_helper_client_index.find (uuid);
2852
2853                             if (pise != m_helper_client_index.end ()) {
2854                                 stop_helper (uuid, pise->second.id, it->first);
2855                             }
2856
2857                             SCIM_DEBUG_MAIN (1) << "Stop HelperISE " << uuid << " ...\n";
2858                         } else {
2859                             m_helper_uuid_count[uuid] = count - 1;
2860                             focus_out_helper (uuid, (it->first & 0xFFFF), ((it->first >> 16) & 0x7FFF));
2861                             SCIM_DEBUG_MAIN (1) << "Decrement usage count of HelperISE " << uuid
2862                                                 << " to " << m_helper_uuid_count[uuid] << "\n";
2863                         }
2864                     }
2865                 }
2866             }
2867
2868             for (size_t i = 0; i < ctx_list.size (); ++i)
2869                 m_client_context_helper.erase (ctx_list [i]);
2870
2871             HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
2872
2873             for (; iter != m_helper_info_repository.end (); iter++) {
2874                 if (!m_current_helper_uuid.compare (iter->second.uuid))
2875                     if (! (iter->second.option & ISM_ISE_HIDE_IN_CONTROL_PANEL))
2876                         socket_update_control_panel ();
2877             }
2878         } else if (client_info.type == FRONTEND_ACT_CLIENT) {
2879             SCIM_DEBUG_MAIN (4) << "It's a FRONTEND_ACT_CLIENT client.\n";
2880             IntIntRepository::iterator iter2 = m_panel_client_map.find (client_id);
2881
2882             if (iter2 != m_panel_client_map.end ())
2883                 m_panel_client_map.erase (iter2);
2884         } else if (client_info.type == HELPER_CLIENT) {
2885             SCIM_DEBUG_MAIN (4) << "It's a Helper client.\n";
2886             lock ();
2887             HelperInfoRepository::iterator hiit = m_helper_info_repository.find (client_id);
2888
2889             if (hiit != m_helper_info_repository.end ()) {
2890                 bool restart = false;
2891                 String uuid = hiit->second.uuid;
2892                 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
2893
2894                 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
2895                 if ((hiit->second.option & SCIM_HELPER_AUTO_RESTART) &&
2896                     (default_uuid.compare (uuid) == 0 || default_uuid.compare ("") == 0) &&
2897                     (it != m_helper_client_index.end () && it->second.ref > 0)) {
2898                     restart = true;
2899                 }
2900
2901                 m_helper_client_index.erase (uuid);
2902                 m_helper_info_repository.erase (hiit);
2903
2904                 m_signal_stop_default_ise ();
2905
2906                 if (m_refocus_needed || m_reshow_needed)
2907                     m_restart_needed = true;
2908
2909                 if (restart && !m_ise_exiting && m_restart_needed) {
2910                     struct tms     tiks_buf;
2911                     static clock_t start_tiks = times (&tiks_buf);
2912                     static double  clock_tiks = (double)sysconf (_SC_CLK_TCK);
2913                     clock_t curr_tiks = times (&tiks_buf);
2914                     double  secs = (double) (curr_tiks - start_tiks) / clock_tiks;
2915                     //LOGE ("time second:%f", secs);
2916                     static String  restart_uuid;
2917
2918                     if (restart_uuid != uuid || secs > MIN_REPEAT_TIME) {
2919                         scim_usleep (100000);
2920
2921                         int    client;
2922                         uint32 context;
2923                         get_focused_context(client, context);
2924
2925                         uint32 ic = get_helper_ic (client, context);
2926                         String ic_uuid;
2927                         /* Get the context uuid from the client context registration table. */
2928                         {
2929                             ClientContextUUIDRepository::iterator it =
2930                                 m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client], context));
2931
2932                             if (it != m_client_context_uuids.end ())
2933                                 ic_uuid = it->second;
2934                         }
2935
2936                         m_start_helper_ic_index[uuid].push_back(std::make_pair(ic, ic_uuid));
2937                         m_signal_run_helper (uuid, m_config_name, m_display_name);
2938                         restart_uuid = uuid;
2939                         LOGE ("Auto restart soft ISE:%s", uuid.c_str ());
2940                     } else {
2941                         reset_default_ise (0);
2942                         ISF_SAVE_LOG ("Auto restart is abnormal, reset default ISE");
2943                     }
2944
2945                     start_tiks = curr_tiks;
2946                 }
2947             }
2948
2949             m_ise_exiting = false;
2950             m_restart_needed = true;
2951             unlock ();
2952             socket_transaction_start ();
2953             m_signal_remove_helper (client_id);
2954             socket_transaction_end ();
2955         } else if (client_info.type == HELPER_ACT_CLIENT) {
2956             SCIM_DEBUG_MAIN (4) << "It's a Helper passive client.\n";
2957             lock ();
2958             HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client_id);
2959
2960             if (hiit != m_helper_active_info_repository.end ())
2961                 m_helper_active_info_repository.erase (hiit);
2962
2963             unlock ();
2964         } else if (client_info.type == IMCONTROL_ACT_CLIENT) {
2965             SCIM_DEBUG_MAIN (4) << "It's a IMCONTROL_ACT_CLIENT client.\n";
2966             IMControlRepository::iterator iter = m_imcontrol_repository.find (client_id);
2967
2968             if (iter != m_imcontrol_repository.end ()) {
2969                 int size = iter->second.info.size ();
2970                 int i = 0;
2971
2972                 while (i < size) {
2973                     stop_helper ((iter->second.info)[i].uuid, (iter->second.count)[i], DEFAULT_CONTEXT_VALUE);
2974
2975                     if ((iter->second.info)[i].option & ISM_ISE_HIDE_IN_CONTROL_PANEL)
2976                         m_current_helper_uuid = m_last_helper_uuid;
2977
2978                     i++;
2979                 }
2980
2981                 m_imcontrol_repository.erase (iter);
2982             }
2983
2984             IntIntRepository::iterator iter2 = m_imcontrol_map.find (client_id);
2985
2986             if (iter2 != m_imcontrol_map.end ())
2987                 m_imcontrol_map.erase (iter2);
2988         } else if (client_info.type == REMOTEINPUT_ACT_CLIENT) {
2989             SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_ACT_CLIENT client.\n";
2990
2991             for (unsigned int i = 0; i < m_current_send_remoteinput_id.size (); i++) {
2992                 if (m_current_send_remoteinput_id.at (i) == client_id) {
2993                     m_current_send_remoteinput_id.erase (m_current_send_remoteinput_id.begin () + i);
2994                     break;
2995                 }
2996             }
2997         } else if (client_info.type == REMOTEINPUT_CLIENT) {
2998             SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_CLIENT client.\n";
2999
3000             for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3001                 if (m_current_recv_remoteinput_id.at (i) == client_id) {
3002                     m_current_recv_remoteinput_id.erase (m_current_recv_remoteinput_id.begin () + i);
3003                     break;
3004                 }
3005             }
3006         } else if (client_info.type == CONFIG_CLIENT) {
3007             SCIM_DEBUG_MAIN(4) << "It's a CONFIG_CLIENT client.\n";
3008         }
3009         LOGI ("clients: %d, panel clients: %d, imcontrols size: %d, helper infos: %d, \
3010 helper active infos: %d, helper client indexs: %d, ises pending: %d, \
3011 imcontrols: %d, start helper ic indexs: %d, client context uuids: %d, \
3012 client context helpers: %d, helpers uuid count: %d",
3013                m_client_repository.size(),
3014                m_panel_client_map.size(),
3015                m_imcontrol_map.size(),
3016                m_helper_info_repository.size(),
3017                m_helper_active_info_repository.size(),
3018                m_helper_client_index.size(),
3019                m_ise_pending_repository.size(),
3020                m_imcontrol_repository.size(),
3021                m_start_helper_ic_index.size(),
3022                m_client_context_uuids.size(),
3023                m_client_context_helper.size(),
3024                m_helper_uuid_count.size());
3025     }
3026
3027     const ClientInfo& socket_get_client_info (int client) {
3028         static ClientInfo null_client = { 0, UNKNOWN_CLIENT };
3029         ClientRepository::iterator it = m_client_repository.find (client);
3030
3031         if (it != m_client_repository.end ())
3032             return it->second;
3033
3034         return null_client;
3035     }
3036
3037     //SCIM_TRANS_CMD_PANEL_TURN_ON
3038     void socket_turn_on (void) {
3039         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_on ()\n";
3040         m_signal_turn_on ();
3041     }
3042     //SCIM_TRANS_CMD_PANEL_TURN_OFF
3043     void socket_turn_off (void) {
3044         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_off ()\n";
3045         m_signal_turn_off ();
3046     }
3047     //SCIM_TRANS_CMD_UPDATE_SCREEN
3048     void socket_update_screen (int client_id, uint32 num) {
3049         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_screen ()\n";
3050
3051         if (((int) num) != m_current_screen) {
3052             SCIM_DEBUG_MAIN (4) << "New Screen number = " << num << "\n";
3053             m_signal_update_screen ((int) num);
3054             helper_all_update_screen ((int) num);
3055             m_current_screen = (num);
3056         }
3057     }
3058     //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
3059     void socket_update_spot_location (uint32 x, uint32 y, uint32 top_y) {
3060         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_spot_location ()\n";
3061         SCIM_DEBUG_MAIN (4) << "New Spot location x=" << x << " y=" << y << "\n";
3062         m_signal_update_spot_location ((int)x, (int)y, (int)top_y);
3063         helper_all_update_spot_location ((int)x, (int)y);
3064     }
3065     //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
3066     void socket_update_cursor_position (uint32 cursor_pos) {
3067         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_cursor_position ()\n";
3068         SCIM_DEBUG_MAIN (4) << "New cursor position pos=" << cursor_pos << "\n";
3069         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3070             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3071             iseContext->cursor_pos = static_cast<int>(cursor_pos);
3072         }
3073         helper_all_update_cursor_position ((int)cursor_pos);
3074     }
3075     //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
3076     void socket_update_surrounding_text (String text, uint32 cursor) {
3077         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3078         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3079
3080         if (it != m_helper_client_index.end ()) {
3081             int    client;
3082             uint32 context;
3083             uint32 ctx;
3084             lock ();
3085             get_focused_context (client, context);
3086             ctx = get_helper_ic (client, context);
3087             m_panel_agent_manager.socket_update_surrounding_text (it->second.id, ctx, m_current_helper_uuid, text, cursor);
3088             unlock ();
3089         }
3090     }
3091
3092     void remoteinput_callback_focus_in () {
3093         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3094
3095         for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3096             lock();
3097             m_panel_agent_manager.socket_remoteinput_focus_in (m_current_recv_remoteinput_id.at (i));
3098             unlock ();
3099         }
3100     }
3101
3102     void remoteinput_callback_focus_out () {
3103         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3104
3105         for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3106             lock();
3107             m_panel_agent_manager.socket_remoteinput_focus_out (m_current_recv_remoteinput_id.at (i));
3108             unlock ();
3109         }
3110     }
3111
3112     void remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled) {
3113         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3114         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
3115             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
3116             iseContext->layout = static_cast<Ecore_IMF_Input_Panel_Layout>(layout);
3117             iseContext->return_key_disabled = static_cast<Eina_Bool>(return_key_disabled);
3118             iseContext->layout_variation = static_cast<int>(variation);
3119             iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(autocapital_type);
3120             iseContext->input_hint = static_cast<Ecore_IMF_Input_Hints>(hint);
3121         }
3122         for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3123             lock();
3124             m_panel_agent_manager.socket_remoteinput_entry_metadata (m_current_recv_remoteinput_id.at (i), hint, layout, variation, autocapital_type, return_key_disabled);
3125             unlock ();
3126         }
3127     }
3128
3129     void remoteinput_callback_surrounding_text (String text, uint32 cursor) {
3130         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3131
3132         for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3133             lock();
3134             m_panel_agent_manager.socket_remoteinput_surrounding_text (m_current_recv_remoteinput_id.at (i), text, cursor);
3135             unlock ();
3136         }
3137     }
3138
3139     void remoteinput_callback_input_resource (uint32 input_resource) {
3140         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3141
3142         for (unsigned int i = 0; i < m_current_recv_remoteinput_id.size (); i++) {
3143             lock();
3144             m_panel_agent_manager.socket_remoteinput_input_resource (m_current_recv_remoteinput_id.at (i), input_resource);
3145             unlock ();
3146         }
3147     }
3148
3149     //ISM_TRANS_CMD_UPDATE_SELECTION
3150     void socket_update_selection (String text) {
3151         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
3152         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3153
3154         if (it != m_helper_client_index.end ()) {
3155             int    client;
3156             uint32 context;
3157             uint32 ctx;
3158             lock ();
3159             get_focused_context (client, context);
3160             ctx = get_helper_ic (client, context);
3161             m_panel_agent_manager.socket_update_selection (it->second.id, ctx, m_current_helper_uuid, text);
3162             unlock ();
3163         }
3164     }
3165     //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
3166     void socket_update_factory_info (PanelFactoryInfo& info) {
3167         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_factory_info ()\n";
3168         SCIM_DEBUG_MAIN (4) << "New Factory info uuid=" << info.uuid << " name=" << info.name << "\n";
3169         info.lang = scim_get_normalized_language (info.lang);
3170         m_signal_update_factory_info (info);
3171     }
3172     //SCIM_TRANS_CMD_PANEL_SHOW_HELP
3173     void socket_show_help (String help) {
3174         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_help ()\n";
3175         m_signal_show_help (help);
3176     }
3177     //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
3178     void socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec) {
3179         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_factory_menu ()\n";
3180
3181         if (vec.size ())
3182             m_signal_show_factory_menu (vec);
3183     }
3184
3185     //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3186     void socket_show_preedit_string (void) {
3187         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_preedit_string ()\n";
3188         m_signal_show_preedit_string ();
3189     }
3190     //SCIM_TRANS_CMD_SHOW_AUX_STRING
3191     void socket_show_aux_string (void) {
3192         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_aux_string ()\n";
3193         m_signal_show_aux_string ();
3194     }
3195     //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
3196     void socket_show_lookup_table (void) {
3197         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_lookup_table ()\n";
3198         m_signal_show_lookup_table ();
3199     }
3200     //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
3201     void socket_show_associate_table (void) {
3202         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_associate_table ()\n";
3203         m_signal_show_associate_table ();
3204     }
3205     //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3206     void socket_hide_preedit_string (void) {
3207         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_preedit_string ()\n";
3208         m_signal_hide_preedit_string ();
3209     }
3210     //SCIM_TRANS_CMD_HIDE_AUX_STRING
3211     void socket_hide_aux_string (void) {
3212         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_aux_string ()\n";
3213         m_signal_hide_aux_string ();
3214     }
3215     //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
3216     void socket_hide_lookup_table (void) {
3217         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_lookup_table ()\n";
3218         m_signal_hide_lookup_table ();
3219     }
3220     //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
3221     void socket_hide_associate_table (void) {
3222         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_associate_table ()\n";
3223         m_signal_hide_associate_table ();
3224     }
3225     //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3226     void socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret) {
3227         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_string ()\n";
3228         m_signal_update_preedit_string (str, attrs, (int) caret);
3229     }
3230     //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3231     void socket_update_preedit_caret (uint32 caret) {
3232         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3233         m_signal_update_preedit_caret ((int) caret);
3234     }
3235     //ISM_TRANS_CMD_RECAPTURE_STRING
3236     void socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs) {
3237         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
3238         m_signal_recapture_string (offset, len, preedit, commit, attrs);
3239     }
3240     //SCIM_TRANS_CMD_UPDATE_AUX_STRING
3241     void socket_update_aux_string (String& str, const AttributeList& attrs) {
3242         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_aux_string ()\n";
3243         m_signal_update_aux_string (str, attrs);
3244         m_is_imengine_aux = true;
3245     }
3246     //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
3247     void socket_update_lookup_table (const LookupTable& table) {
3248         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_lookup_table ()\n";
3249         //FIXME:
3250         //g_isf_candidate_table = _isf_candidate_table;
3251         m_signal_update_lookup_table (table);
3252         m_is_imengine_candidate = true;
3253     }
3254     //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
3255     void socket_update_associate_table (const LookupTable& table) {
3256         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_associate_table ()\n";
3257         m_signal_update_associate_table (table);
3258     }
3259
3260     void socket_update_control_panel (void) {
3261         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_control_panel ()\n";
3262         String name, uuid;
3263         m_signal_get_keyboard_ise (name, uuid);
3264         PanelFactoryInfo info;
3265
3266         if (name.length () > 0)
3267             info = PanelFactoryInfo (uuid, name, String (""), String (""));
3268         else
3269             info = PanelFactoryInfo (String (""), String (_ ("English Keyboard")), String ("C"), String (SCIM_KEYBOARD_ICON_FILE));
3270
3271         m_signal_update_factory_info (info);
3272     }
3273     //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3274     void socket_register_properties (const PropertyList& properties) {
3275         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_register_properties ()\n";
3276         m_signal_register_properties (properties);
3277     }
3278     //SCIM_TRANS_CMD_UPDATE_PROPERTY
3279     void socket_update_property (const Property& property) {
3280         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_property ()\n";
3281         m_signal_update_property (property);
3282     }
3283     //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
3284     void socket_get_keyboard_ise_list (String& uuid) {
3285         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise_list ()\n";
3286         std::vector<String> list;
3287         list.clear ();
3288         m_signal_get_keyboard_ise_list (list);
3289         HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3290
3291         if (it != m_helper_client_index.end ()) {
3292             int    client;
3293             uint32 context;
3294             get_focused_context (client, context);
3295             uint32 ctx = get_helper_ic (client, context);
3296             m_panel_agent_manager.socket_get_keyboard_ise_list (it->second.id, ctx, uuid, list);
3297         }
3298     }
3299     //ISM_TRANS_CMD_SET_CANDIDATE_UI
3300     void socket_set_candidate_ui (uint32 portrait_line, uint32 mode) {
3301         SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3302         m_signal_set_candidate_ui (portrait_line, mode);
3303     }
3304     //ISM_TRANS_CMD_GET_CANDIDATE_UI
3305     void socket_get_candidate_ui (String uuid) {
3306         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_candidate_ui ()\n";
3307         int style = 0, mode = 0;
3308         m_signal_get_candidate_ui (style, mode);
3309         HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3310
3311         if (it != m_helper_client_index.end ()) {
3312             int    client;
3313             uint32 context;
3314             get_focused_context (client, context);
3315             uint32 ctx = get_helper_ic (client, context);
3316             m_panel_agent_manager.socket_get_candidate_ui (it->second.id, ctx, uuid, style, mode);
3317         }
3318     }
3319     //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
3320     void socket_set_candidate_position (uint32 left, uint32 top) {
3321         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_candidate_position ()\n";
3322         m_signal_set_candidate_position (left, top);
3323     }
3324     //ISM_TRANS_CMD_HIDE_CANDIDATE
3325     void socket_hide_candidate (void) {
3326         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_candidate ()\n";
3327         m_signal_hide_preedit_string ();
3328         m_signal_hide_aux_string ();
3329         m_signal_hide_lookup_table ();
3330         m_signal_hide_associate_table ();
3331     }
3332     //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
3333     void socket_get_candidate_geometry (String& uuid) {
3334         SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3335         HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3336
3337         if (it != m_helper_client_index.end ()) {
3338             struct rectinfo info = {0, 0, 0, 0};
3339             m_signal_get_candidate_geometry (info);
3340             int    client;
3341             uint32 context;
3342             get_focused_context (client, context);
3343             uint32 ctx = get_helper_ic (client, context);
3344             m_panel_agent_manager.socket_get_candidate_geometry (it->second.id, ctx, uuid, info);
3345         }
3346     }
3347     //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
3348     void socket_set_keyboard_ise (String uuid) {
3349         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3350         LOGD ("");
3351         m_signal_set_keyboard_ise (uuid);
3352     }
3353     //ISM_TRANS_CMD_SELECT_CANDIDATE
3354     void socket_helper_select_candidate (uint32 index) {
3355         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3356         LOGD ("");
3357         m_signal_select_candidate (index);
3358     }
3359     //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
3360     void socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height) {
3361         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3362         LOGD ("");
3363         int    focused_client;
3364         uint32 focused_context;
3365         HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3366
3367         if (it != m_helper_active_info_repository.end ()) {
3368             if (it->second.uuid == m_current_helper_uuid) {
3369                 m_signal_update_ise_geometry (x, y, width, height);
3370
3371                 get_focused_context (focused_client, focused_context);
3372                 ClientInfo client_info = socket_get_client_info (focused_client);
3373                 if (client_info.type == FRONTEND_CLIENT) {
3374                     m_panel_agent_manager.update_ise_geometry (focused_client, focused_context, x, y, width, height);
3375                 }
3376             }
3377         }
3378     }
3379     //ISM_TRANS_CMD_GET_KEYBOARD_ISE
3380     void socket_get_keyboard_ise (String uuid) {
3381         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise ()\n";
3382         String ise_name, ise_uuid;
3383         int    client  = -1;
3384         uint32 context = 0;
3385         uint32 ctx     = 0;
3386         get_focused_context (client, context);
3387         ctx = get_helper_ic (client, context);
3388
3389         if (m_client_context_uuids.find (ctx) != m_client_context_uuids.end ())
3390             ise_uuid = m_client_context_uuids[ctx];
3391
3392         m_signal_get_keyboard_ise (ise_name, ise_uuid);
3393         HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3394
3395         if (it != m_helper_client_index.end ()) {
3396             get_focused_context (client, context);
3397             ctx = get_helper_ic (client, context);
3398             m_panel_agent_manager.socket_get_keyboard_ise (it->second.id, ctx, uuid, ise_name, ise_uuid);
3399         }
3400     }
3401
3402     //SCIM_TRANS_CMD_START_HELPER
3403     void socket_start_helper (int client_id, uint32 context, String uuid) {
3404         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_start_helper ()\n";
3405         HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3406         lock ();
3407         uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3408         String ic_uuid;
3409         /* Get the context uuid from the client context registration table. */
3410         {
3411             ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3412
3413             if (it != m_client_context_uuids.end ())
3414                 ic_uuid = it->second;
3415         }
3416
3417         if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3418             if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3419         } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3420             if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3421         }
3422
3423         if (it == m_helper_client_index.end ()) {
3424             SCIM_DEBUG_MAIN (5) << "Run this Helper.\n";
3425             m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
3426             m_signal_run_helper (uuid, m_config_name, m_display_name);
3427         } else {
3428             SCIM_DEBUG_MAIN (5) << "Increase the Reference count.\n";
3429             m_panel_agent_manager.socket_start_helper (it->second.id, ic, ic_uuid);
3430             ++ it->second.ref;
3431         }
3432
3433         unlock ();
3434     }
3435     //SCIM_TRANS_CMD_STOP_HELPER
3436     void socket_stop_helper (int client_id, uint32 context, String uuid) {
3437         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_stop_helper ()\n";
3438         HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3439         lock ();
3440         uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3441
3442         if (it != m_helper_client_index.end ()) {
3443             SCIM_DEBUG_MAIN (5) << "Decrase the Reference count.\n";
3444             -- it->second.ref;
3445             String ic_uuid;
3446             /* Get the context uuid from the client context registration table. */
3447             {
3448                 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3449
3450                 if (it != m_client_context_uuids.end ())
3451                     ic_uuid = it->second;
3452             }
3453
3454             if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3455                 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3456             } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3457                 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3458             }
3459
3460             m_panel_agent_manager.helper_detach_input_context (it->second.id, ic, ic_uuid);
3461
3462             if (it->second.ref <= 0)
3463                 m_panel_agent_manager.exit (it->second.id, ic);
3464         }
3465
3466         unlock ();
3467     }
3468     //SCIM_TRANS_CMD_SEND_HELPER_EVENT
3469     void socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans) {
3470         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_send_helper_event ()\n";
3471         HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3472
3473         if (it != m_helper_client_index.end ()) {
3474             String ic_uuid;
3475             /* Get the context uuid from the client context registration table. */
3476             {
3477                 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3478
3479                 if (it != m_client_context_uuids.end ())
3480                     ic_uuid = it->second;
3481             }
3482
3483             if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3484                 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3485             } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3486                 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3487             }
3488
3489             m_panel_agent_manager.helper_process_imengine_event (it->second.id, get_helper_ic (m_panel_client_map[client_id], context), ic_uuid, _nest_trans);
3490         }
3491     }
3492
3493     //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3494     void socket_helper_register_properties (int client, PropertyList& properties) {
3495         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_properties (" << client << ")\n";
3496         m_signal_register_helper_properties (client, properties);
3497
3498 #if 0 //why? remove if useless, infinite loop
3499         /* Check whether application is already focus_in */
3500         if (m_current_socket_client != -1) {
3501             SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
3502             focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
3503             reset_keyboard_ise ();
3504         }
3505
3506         /* Check whether ISE panel is already shown */
3507         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0) {
3508             SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
3509             int    focused_client;
3510             uint32 focused_context;
3511             get_focused_context (focused_client, focused_context);
3512
3513             if (focused_client == -1 && m_active_client_id != -1) {
3514                 focused_client  = m_panel_client_map[m_active_client_id];
3515                 focused_context = 0;
3516             }
3517
3518             uint32 ctx = get_helper_ic (focused_client, focused_context);
3519             bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
3520
3521             if (ret)
3522                 m_signal_show_ise ();
3523         }
3524 #endif
3525     }
3526     //SCIM_TRANS_CMD_UPDATE_PROPERTY
3527     void socket_helper_update_property (int client, Property& property) {
3528         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_property (" << client << ")\n";
3529         m_signal_update_helper_property (client, property);
3530     }
3531     //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
3532     void socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans) {
3533         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_imengine_event (" << client << ")\n";
3534         HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3535
3536         if (hiit != m_helper_active_info_repository.end ()) {
3537             int     target_client;
3538             uint32  target_context;
3539             get_imengine_client_context (target_ic, target_client, target_context);
3540             int     focused_client;
3541             uint32  focused_context;
3542             String  focused_uuid;
3543             focused_uuid = get_focused_context (focused_client, focused_context);
3544
3545             if (target_ic == (uint32) (-1)) {
3546                 target_client  = focused_client;
3547                 target_context = focused_context;
3548             }
3549
3550             if (target_uuid.length () == 0)
3551                 target_uuid = focused_uuid;
3552
3553             ClientInfo  client_info = socket_get_client_info (target_client);
3554             SCIM_DEBUG_MAIN (5) << "Target UUID = " << target_uuid << "  Focused UUId = " << focused_uuid << "\nTarget Client = " << target_client << "\n";
3555
3556             if (client_info.type == FRONTEND_CLIENT) {
3557                 /* If the original context value is greater than 0x7FFF, the line below would not work properly
3558                    since the target_context acquired by get_imengnie_client_context() is always smaller than 0x7FFF.
3559                    But since the send_imengine_event() of scim_helper module will call IMEngine's
3560                    process_helper_event() function directly, instead of sending SEND_IMENGINE_EVENT message.
3561                    So we are not going to handle this kind of exceptional case for now. */
3562                 m_panel_agent_manager.process_helper_event (target_client, target_context, target_uuid, hiit->second.uuid, nest_trans);
3563             }
3564         }
3565     }
3566
3567     void socket_helper_key_event_op (int client, int cmd, uint32 target_ic, String& target_uuid, KeyEvent& key) {
3568         if (!key.empty ()) {
3569             int     target_client;
3570             uint32  target_context;
3571             get_imengine_client_context (target_ic, target_client, target_context);
3572             int     focused_client;
3573             uint32  focused_context;
3574             String  focused_uuid;
3575             focused_uuid = get_focused_context (focused_client, focused_context);
3576
3577             if (target_ic == (uint32) (-1)) {
3578                 target_client  = focused_client;
3579                 target_context = focused_context;
3580             }
3581
3582             if (target_uuid.length () == 0)
3583                 target_uuid = focused_uuid;
3584
3585             if (target_client == -1) {
3586                 /* FIXUP: monitor 'Invalid Window' error */
3587                 LOGW ("focused target client is NULL");
3588             } else if (target_uuid == focused_uuid &&
3589                 clients_equal (target_client, focused_client) &&
3590                 contexts_equal (target_context, focused_context)) {
3591                 ClientInfo client_info = socket_get_client_info (focused_client);
3592
3593                 if (client_info.type == FRONTEND_CLIENT) {
3594                     m_panel_agent_manager.socket_helper_key_event (focused_client, focused_context, cmd, key);
3595                 }
3596             } else {
3597                 LOGD ("[target_client : %d, focused_client : %d] => %d, [target_context : %u, focused_context : %u] => %d",
3598                     target_client, focused_client, clients_equal (target_client, focused_client),
3599                     target_context, focused_context, contexts_equal (target_context, focused_context));
3600             }
3601         }
3602     }
3603     //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
3604     //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
3605     void socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3606         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_key_event (" << client << ")\n";
3607         ISF_PROF_DEBUG ("first message")
3608         socket_helper_key_event_op (client, SCIM_TRANS_CMD_PROCESS_KEY_EVENT, target_ic, target_uuid, key);
3609     }
3610     //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
3611     void socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3612         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_forward_key_event (" << client << ")\n";
3613         socket_helper_key_event_op (client, SCIM_TRANS_CMD_FORWARD_KEY_EVENT, target_ic, target_uuid, key);
3614     }
3615
3616     //SCIM_TRANS_CMD_COMMIT_STRING
3617     void socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr) {
3618         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_commit_string (" << client << ")\n";
3619
3620         if (wstr.length ()) {
3621             int     target_client;
3622             uint32  target_context;
3623             get_imengine_client_context (target_ic, target_client, target_context);
3624             int     focused_client;
3625             uint32  focused_context;
3626             String  focused_uuid;
3627             focused_uuid = get_focused_context (focused_client, focused_context);
3628
3629             if (target_ic == (uint32) (-1)) {
3630                 target_client  = focused_client;
3631                 target_context = focused_context;
3632             }
3633
3634             if (target_uuid.length () == 0)
3635                 target_uuid = focused_uuid;
3636
3637             if (target_uuid == focused_uuid &&
3638                 clients_equal (target_client, focused_client) &&
3639                 contexts_equal (target_context, focused_context)) {
3640                 ClientInfo client_info = socket_get_client_info (focused_client);
3641
3642                 if (client_info.type == FRONTEND_CLIENT) {
3643                     m_panel_agent_manager.commit_string (focused_client, focused_context, wstr);
3644                 } else {
3645                     std::cerr << "target client is not existed!!!" << "\n";
3646                 }
3647             }
3648         }
3649     }
3650     //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
3651     void socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after) {
3652         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3653         int     focused_client;
3654         uint32  focused_context;
3655         get_focused_context (focused_client, focused_context);
3656         ClientInfo client_info = socket_get_client_info (focused_client);
3657
3658         /* If the get_surrounding_text was received when there is no client available,
3659          * return empty surrounding text since the sender would be waiting for reply */
3660         if (focused_client == -1) {
3661             socket_update_surrounding_text("", 0);
3662         } else {
3663             if (client_info.type == FRONTEND_CLIENT) {
3664                 m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
3665             }
3666         }
3667     }
3668     //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
3669     void socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len) {
3670         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3671         int     focused_client;
3672         uint32  focused_context;
3673         get_focused_context (focused_client, focused_context);
3674         ClientInfo client_info = socket_get_client_info (focused_client);
3675
3676         if (client_info.type == FRONTEND_CLIENT) {
3677             m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
3678         }
3679     }
3680     //SCIM_TRANS_CMD_GET_SELECTION
3681     void socket_helper_get_selection (int client, String uuid) {
3682         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3683         int     focused_client;
3684         uint32  focused_context;
3685         get_focused_context (focused_client, focused_context);
3686         ClientInfo client_info = socket_get_client_info (focused_client);
3687
3688         if (client_info.type == FRONTEND_CLIENT) {
3689             m_panel_agent_manager.socket_helper_get_selection (focused_client, focused_context);
3690         }
3691     }
3692     //SCIM_TRANS_CMD_SET_SELECTION
3693     void socket_helper_set_selection (int client, uint32 start, uint32 end) {
3694         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3695         int     focused_client;
3696         uint32  focused_context;
3697         get_focused_context (focused_client, focused_context);
3698         ClientInfo client_info = socket_get_client_info (focused_client);
3699
3700         if (client_info.type == FRONTEND_CLIENT) {
3701             m_panel_agent_manager.socket_helper_set_selection (focused_client, focused_context, start, end);
3702         }
3703     }
3704
3705     //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3706     void socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid) {
3707         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_show_preedit_string (" << client << ")\n";
3708         int     target_client;
3709         uint32  target_context;
3710         get_imengine_client_context (target_ic, target_client, target_context);
3711         int     focused_client;
3712         uint32  focused_context;
3713         String  focused_uuid = get_focused_context (focused_client, focused_context);
3714
3715         if (target_ic == (uint32) (-1)) {
3716             target_client  = focused_client;
3717             target_context = focused_context;
3718         }
3719
3720         if (target_uuid.length () == 0)
3721             target_uuid = focused_uuid;
3722
3723         if (target_uuid == focused_uuid &&
3724             clients_equal (target_client, focused_client) &&
3725             contexts_equal (target_context, focused_context)) {
3726             ClientInfo client_info = socket_get_client_info (focused_client);
3727
3728             if (client_info.type == FRONTEND_CLIENT) {
3729                 m_panel_agent_manager.show_preedit_string (focused_client, focused_context);
3730             }
3731         }
3732     }
3733     //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3734     void socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid) {
3735         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_hide_preedit_string (" << client << ")\n";
3736         int     target_client;
3737         uint32  target_context;
3738         get_imengine_client_context (target_ic, target_client, target_context);
3739         int     focused_client;
3740         uint32  focused_context;
3741         String  focused_uuid = get_focused_context (focused_client, focused_context);
3742
3743         if (target_ic == (uint32) (-1)) {
3744             target_client  = focused_client;
3745             target_context = focused_context;
3746         }
3747
3748         if (target_uuid.length () == 0)
3749             target_uuid = focused_uuid;
3750
3751         if (target_uuid == focused_uuid &&
3752             clients_equal (target_client, focused_client) &&
3753             contexts_equal (target_context, focused_context)) {
3754             ClientInfo client_info = socket_get_client_info (focused_client);
3755
3756             if (client_info.type == FRONTEND_CLIENT) {
3757                 m_panel_agent_manager.hide_preedit_string (focused_client, focused_context);
3758             }
3759         }
3760     }
3761     //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3762     void socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret) {
3763         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_preedit_string (" << client << ")\n";
3764         int     target_client;
3765         uint32  target_context;
3766         get_imengine_client_context (target_ic, target_client, target_context);
3767         int     focused_client;
3768         uint32  focused_context;
3769         String  focused_uuid;
3770         focused_uuid = get_focused_context (focused_client, focused_context);
3771
3772         if (target_ic == (uint32) (-1)) {
3773             target_client  = focused_client;
3774             target_context = focused_context;
3775         }
3776
3777         if (target_uuid.length () == 0)
3778             target_uuid = focused_uuid;
3779
3780         if (target_uuid == focused_uuid &&
3781             clients_equal (target_client, focused_client) &&
3782             contexts_equal (target_context, focused_context)) {
3783             ClientInfo client_info = socket_get_client_info (focused_client);
3784
3785             if (client_info.type == FRONTEND_CLIENT) {
3786                 m_panel_agent_manager.update_preedit_string (focused_client, focused_context, preedit, commit, attrs, caret);
3787             }
3788         }
3789     }
3790     //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3791     void socket_helper_update_preedit_caret (int client, uint32 caret) {
3792         SCIM_DEBUG_MAIN (4) << __func__ << " (" << client << ")\n";
3793         int     focused_client;
3794         uint32  focused_context;
3795         String  focused_uuid;
3796         focused_uuid = get_focused_context (focused_client, focused_context);
3797         ClientInfo client_info = socket_get_client_info (focused_client);
3798
3799         if (client_info.type == FRONTEND_CLIENT) {
3800             m_panel_agent_manager.update_preedit_caret (focused_client, focused_context, caret);
3801         }
3802     }
3803
3804     //ISM_TRANS_CMD_RECAPTURE_STRING
3805     void socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
3806             WideString commit, AttributeList& attrs) {
3807         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_recapture_string (" << client << ")\n";
3808         int     target_client;
3809         uint32  target_context;
3810         get_imengine_client_context (target_ic, target_client, target_context);
3811         int     focused_client;
3812         uint32  focused_context;
3813         String  focused_uuid;
3814         focused_uuid = get_focused_context (focused_client, focused_context);
3815
3816         if (target_ic == (uint32) (-1)) {
3817             target_client  = focused_client;
3818             target_context = focused_context;
3819         }
3820
3821         if (target_uuid.length () == 0)
3822             target_uuid = focused_uuid;
3823
3824         if (target_uuid == focused_uuid &&
3825             clients_equal (target_client, focused_client) &&
3826             contexts_equal (target_context, focused_context)) {
3827             ClientInfo client_info = socket_get_client_info (focused_client);
3828
3829             if (client_info.type == FRONTEND_CLIENT) {
3830                 m_panel_agent_manager.recapture_string (focused_client, focused_context, offset, len, preedit, commit, attrs);
3831             }
3832         }
3833     }
3834
3835     //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
3836     void socket_helper_register_helper (int client, HelperInfo& info) {
3837         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
3838         bool result = false;
3839         lock ();
3840         String language;
3841         int type;
3842         int option;
3843         String module_name;
3844
3845         if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3846             LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3847             unlock ();
3848             return;
3849         }
3850         info.option = option;
3851
3852         if (info.uuid.length ()) {
3853             SCIM_DEBUG_MAIN (4) << "New Helper uuid=" << info.uuid << " name=" << info.name << "\n";
3854             HelperClientIndex::iterator it = m_helper_client_index.find (info.uuid);
3855
3856             if (it == m_helper_client_index.end ()) {
3857                 m_helper_info_repository [client] = info;
3858                 m_helper_client_index [info.uuid] = HelperClientStub (client, 1);
3859                 StartHelperICIndex::iterator icit = m_start_helper_ic_index.find (info.uuid);
3860
3861                 if (icit != m_start_helper_ic_index.end ()) {
3862                     m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
3863                     m_start_helper_ic_index.erase (icit);
3864                     result = true;
3865                 } else {
3866                     LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3867                     m_panel_agent_manager.send_fail_reply(client);
3868                 }
3869             } else {
3870                 LOGW ("Failed to register IME : %s", info.uuid.c_str ());
3871                 m_panel_agent_manager.send_fail_reply(client);
3872             }
3873         }
3874
3875         unlock ();
3876
3877         if (result) {
3878             LOGD ("Succeed to regster IME : %s", info.uuid.c_str ());
3879             m_signal_register_helper (client, info);
3880         }
3881     }
3882
3883     //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
3884     void socket_helper_register_helper_passive (int client, HelperInfo& info) {
3885         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper_passive (" << client << ")\n";
3886         lock ();
3887         String language;
3888         int type;
3889         int option;
3890         String module_name;
3891
3892         if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3893             LOGW ("This helper (%s) is not IME", info.uuid.c_str ());
3894             unlock ();
3895             return;
3896         }
3897         info.option = option;
3898
3899         if (info.uuid.length ()) {
3900             SCIM_DEBUG_MAIN (4) << "New Helper Passive uuid=" << info.uuid << " name=" << info.name << "\n";
3901             HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3902
3903             if (it == m_helper_active_info_repository.end ()) {
3904                 m_helper_active_info_repository[client] =  info;
3905             }
3906
3907             StringIntRepository::iterator iter = m_ise_pending_repository.find (info.uuid);
3908
3909             if (iter != m_ise_pending_repository.end ()) {
3910                 m_ise_pending_repository.erase (iter);
3911             }
3912
3913             iter = m_ise_pending_repository.find (info.name);
3914
3915             if (iter != m_ise_pending_repository.end ()) {
3916                 m_ise_pending_repository.erase (iter);
3917             }
3918         }
3919
3920         unlock ();
3921     }
3922     //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
3923     void socket_helper_update_input_context (int client, uint32 type, uint32 value) {
3924         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_input_context (" << client << ")\n";
3925         m_signal_update_input_context ((int)type, (int)value);
3926         int    focused_client;
3927         uint32 focused_context;
3928         get_focused_context (focused_client, focused_context);
3929         ClientInfo client_info = socket_get_client_info (focused_client);
3930
3931         if (client_info.type == FRONTEND_CLIENT) {
3932             m_panel_agent_manager.update_ise_input_context (focused_client, focused_context, type, value);
3933         } else {
3934             std::cerr << "focused client is not existed!!!" << "\n";
3935         }
3936     }
3937     //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
3938     void socket_helper_update_language_locale(int client, String locale) {
3939         SCIM_DEBUG_MAIN(4) << "InfoManager::socket_helper_update_language_locale (" << client << ")\n";
3940         m_signal_update_language_locale(locale);
3941
3942         int    focused_client;
3943         uint32 focused_context;
3944         get_focused_context(focused_client, focused_context);
3945         ClientInfo client_info = socket_get_client_info(focused_client);
3946
3947         if (client_info.type == FRONTEND_CLIENT) {
3948             m_panel_agent_manager.update_ise_language_locale(focused_client, focused_context, locale);
3949         } else {
3950             std::cerr << "focused client is not existed!!!" << "\n";
3951         }
3952     }
3953     //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
3954     void socket_helper_send_private_command (int client, String command) {
3955         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3956         int     focused_client;
3957         uint32  focused_context;
3958         get_focused_context (focused_client, focused_context);
3959         ClientInfo client_info = socket_get_client_info (focused_client);
3960
3961         if (client_info.type == FRONTEND_CLIENT) {
3962             m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
3963         }
3964     }
3965     //SCIM_TRANS_CMD_COMMIT_CONTENT
3966     void socket_helper_commit_content (int client, String content, String description, String mime_types) {
3967         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3968         int     focused_client;
3969         uint32  focused_context;
3970         get_focused_context (focused_client, focused_context);
3971         ClientInfo client_info = socket_get_client_info (focused_client);
3972
3973         if (client_info.type == FRONTEND_CLIENT) {
3974             m_panel_agent_manager.commit_content (focused_client, focused_context, content, description, mime_types);
3975         }
3976     }
3977     //ISM_TRANS_CMD_UPDATE_ISE_EXIT
3978     void UPDATE_ISE_EXIT (int client) {
3979         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3980         bool launch_ise_on_request = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_LAUNCH_ISE_ON_REQUEST), false);
3981         if (launch_ise_on_request && !m_refocus_needed && !m_reshow_needed)
3982             m_restart_needed = false;
3983     }
3984
3985     void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
3986         int     focused_client;
3987         uint32  focused_context;
3988         get_focused_context (focused_client, focused_context);
3989         ClientInfo client_info = socket_get_client_info (focused_client);
3990
3991         if (client_info.type == FRONTEND_CLIENT) {
3992             m_panel_agent_manager.process_key_event_done (focused_client, focused_context, key, ret, serial);
3993         }
3994     }
3995
3996     //ISM_TRANS_CMD_REQUEST_ISE_HIDE
3997     void request_ise_hide () {
3998         int     focused_client;
3999         uint32  focused_context;
4000         get_focused_context (focused_client, focused_context);
4001         ClientInfo client_info = socket_get_client_info (focused_client);
4002
4003         if (client_info.type == FRONTEND_CLIENT) {
4004             m_panel_agent_manager.request_ise_hide (focused_client, focused_context);
4005         }
4006     }
4007
4008     void socket_reset_helper_input_context (const String& uuid, int client, uint32 context) {
4009         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4010
4011         if (it != m_helper_client_index.end ()) {
4012             uint32 ctx = get_helper_ic (client, context);
4013             m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
4014         }
4015     }
4016
4017     bool helper_select_aux (uint32 item) {
4018         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_aux \n";
4019
4020         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4021             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4022
4023             if (it != m_helper_client_index.end ()) {
4024                 int    client;
4025                 uint32 context;
4026                 uint32 ctx;
4027                 get_focused_context (client, context);
4028                 ctx = get_helper_ic (client, context);
4029                 m_panel_agent_manager.select_aux (it->second.id, ctx, item);
4030                 return true;
4031             }
4032         }
4033
4034         return false;
4035     }
4036
4037     bool helper_select_candidate (uint32 item) {
4038         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_candidate \n";
4039
4040         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4041             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4042
4043             if (it != m_helper_client_index.end ()) {
4044                 int    client;
4045                 uint32 context;
4046                 uint32 ctx;
4047                 get_focused_context (client, context);
4048                 ctx = get_helper_ic (client, context);
4049                 m_panel_agent_manager.select_candidate (it->second.id, ctx, item);
4050                 return true;
4051             }
4052         }
4053
4054         return false;
4055     }
4056
4057     bool helper_lookup_table_page_up (void) {
4058         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_up \n";
4059
4060         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4061             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4062
4063             if (it != m_helper_client_index.end ()) {
4064                 int    client;
4065                 uint32 context;
4066                 uint32 ctx;
4067                 get_focused_context (client, context);
4068                 ctx = get_helper_ic (client, context);
4069                 m_panel_agent_manager.lookup_table_page_up (it->second.id, ctx);
4070                 return true;
4071             }
4072         }
4073
4074         return false;
4075     }
4076
4077     bool helper_lookup_table_page_down (void) {
4078         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_down \n";
4079
4080         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4081             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4082
4083             if (it != m_helper_client_index.end ()) {
4084                 int    client;
4085                 uint32 context;
4086                 uint32 ctx;
4087                 get_focused_context (client, context);
4088                 ctx = get_helper_ic (client, context);
4089                 m_panel_agent_manager.lookup_table_page_down (it->second.id, ctx);
4090                 return true;
4091             }
4092         }
4093
4094         return false;
4095     }
4096
4097     bool helper_update_lookup_table_page_size (uint32 size) {
4098         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_lookup_table_page_size \n";
4099
4100         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4101             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4102
4103             if (it != m_helper_client_index.end ()) {
4104                 int    client;
4105                 uint32 context;
4106                 uint32 ctx;
4107                 get_focused_context (client, context);
4108                 ctx = get_helper_ic (client, context);
4109                 m_panel_agent_manager.update_lookup_table_page_size (it->second.id, ctx, size);
4110                 return true;
4111             }
4112         }
4113
4114         return false;
4115     }
4116
4117     bool helper_update_candidate_item_layout (const std::vector<uint32>& row_items) {
4118         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4119
4120         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4121             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4122
4123             if (it != m_helper_client_index.end ()) {
4124                 int    client;
4125                 uint32 context;
4126                 uint32 ctx;
4127                 get_focused_context (client, context);
4128                 ctx = get_helper_ic (client, context);
4129                 m_panel_agent_manager.update_candidate_item_layout (it->second.id, ctx, row_items);
4130                 return true;
4131             }
4132         }
4133
4134         return false;
4135     }
4136
4137     bool helper_select_associate (uint32 item) {
4138         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_associate \n";
4139
4140         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4141             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4142
4143             if (it != m_helper_client_index.end ()) {
4144                 int    client;
4145                 uint32 context;
4146                 uint32 ctx;
4147                 get_focused_context (client, context);
4148                 ctx = get_helper_ic (client, context);
4149                 m_panel_agent_manager.select_associate (it->second.id, ctx, item);
4150                 return true;
4151             }
4152         }
4153
4154         return false;
4155     }
4156
4157     bool helper_associate_table_page_up (void) {
4158         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_up \n";
4159
4160         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4161             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4162
4163             if (it != m_helper_client_index.end ()) {
4164                 int    client;
4165                 uint32 context;
4166                 uint32 ctx;
4167                 get_focused_context (client, context);
4168                 ctx = get_helper_ic (client, context);
4169                 m_panel_agent_manager.associate_table_page_up (it->second.id, ctx);
4170                 return true;
4171             }
4172         }
4173
4174         return false;
4175     }
4176
4177     bool helper_associate_table_page_down (void) {
4178         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_down \n";
4179
4180         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4181             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4182
4183             if (it != m_helper_client_index.end ()) {
4184                 int    client;
4185                 uint32 context;
4186                 uint32 ctx;
4187                 get_focused_context (client, context);
4188                 ctx = get_helper_ic (client, context);
4189                 m_panel_agent_manager.associate_table_page_down (it->second.id, ctx);
4190                 return true;
4191             }
4192         }
4193
4194         return false;
4195     }
4196
4197     bool helper_update_associate_table_page_size (uint32         size) {
4198         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_associate_table_page_size \n";
4199
4200         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4201             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4202
4203             if (it != m_helper_client_index.end ()) {
4204                 int    client;
4205                 uint32 context;
4206                 uint32 ctx;
4207                 get_focused_context (client, context);
4208                 ctx = get_helper_ic (client, context);
4209                 m_panel_agent_manager.update_associate_table_page_size (it->second.id, ctx, size);
4210                 return true;
4211             }
4212         }
4213
4214         return false;
4215     }
4216
4217     bool helper_update_displayed_candidate_number (uint32 size) {
4218         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4219
4220         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4221             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4222
4223             if (it != m_helper_client_index.end ()) {
4224                 int    client;
4225                 uint32 context;
4226                 uint32 ctx;
4227                 get_focused_context (client, context);
4228                 ctx = get_helper_ic (client, context);
4229                 m_panel_agent_manager.update_displayed_candidate_number (it->second.id, ctx, size);
4230                 return true;
4231             }
4232         }
4233
4234         return false;
4235     }
4236
4237     bool helper_longpress_candidate (uint32 index) {
4238         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4239
4240         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
4241             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4242
4243             if (it != m_helper_client_index.end ()) {
4244                 int    client;
4245                 uint32 context;
4246                 uint32 ctx;
4247                 get_focused_context (client, context);
4248                 ctx = get_helper_ic (client, context);
4249                 m_panel_agent_manager.send_longpress_event (it->second.id, ctx, index);
4250                 return true;
4251             }
4252         }
4253
4254         std::cerr << __func__ << " is failed!!!\n";
4255         return false;
4256     }
4257
4258     void helper_all_update_spot_location (int x, int y) {
4259         SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_spot_location (" << x << "," << y << ")\n";
4260         HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4261         int    client;
4262         uint32 context;
4263         String uuid = get_focused_context (client, context);
4264
4265         for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4266             if (hiit->second.option & SCIM_HELPER_NEED_SPOT_LOCATION_INFO) {
4267                 m_panel_agent_manager.helper_all_update_spot_location (hiit->first, get_helper_ic (client, context), uuid, x, y);
4268             }
4269         }
4270     }
4271
4272     void helper_all_update_cursor_position (int cursor_pos) {
4273         SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_cursor_position (" << cursor_pos << ")\n";
4274         HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4275         int    client;
4276         uint32 context;
4277         String uuid = get_focused_context (client, context);
4278
4279         for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4280             m_panel_agent_manager.helper_all_update_cursor_position (hiit->first, get_helper_ic (client, context), uuid, cursor_pos);
4281         }
4282     }
4283
4284     void helper_all_update_screen (int screen) {
4285         SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_screen (" << screen << ")\n";
4286         HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
4287         int    client;
4288         uint32 context;
4289         String uuid;
4290         uuid = get_focused_context (client, context);
4291
4292         for (; hiit != m_helper_info_repository.end (); ++ hiit) {
4293             if (hiit->second.option & SCIM_HELPER_NEED_SCREEN_INFO) {
4294                 m_panel_agent_manager.helper_all_update_screen (hiit->first, get_helper_ic (client, context), uuid, screen);
4295             }
4296         }
4297     }
4298
4299     bool set_autocapital_type (int mode) {
4300         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4301         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4302             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4303             iseContext->autocapital_type = static_cast<Ecore_IMF_Autocapital_Type>(mode);
4304         }
4305         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4306             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4307
4308             if (it != m_helper_client_index.end ()) {
4309                 int    client;
4310                 uint32 context;
4311                 uint32 ctx;
4312                 get_focused_context (client, context);
4313                 ctx = get_helper_ic (client, context);
4314                 m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
4315                 return true;
4316             }
4317         }
4318
4319         std::cerr << __func__ << " is failed!!!\n";
4320         return false;
4321     }
4322
4323     bool set_prediction_allow (int client, int mode) {
4324         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
4325         if (m_ise_context_buffer != NULL && m_ise_context_length > 0) {
4326             Ise_Context *iseContext = reinterpret_cast<Ise_Context *>(m_ise_context_buffer);
4327             iseContext->prediction_allow = static_cast<Eina_Bool>(mode);
4328         }
4329         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
4330             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
4331
4332             if (it != m_helper_client_index.end ()) {
4333                 int    focused_client;
4334                 uint32 focused_context;
4335                 uint32 ctx;
4336                 get_focused_context (focused_client, focused_context);
4337                 ctx = get_helper_ic (focused_client, focused_context);
4338                 m_panel_agent_manager.set_prediction_allow (it->second.id, ctx, m_current_helper_uuid, mode);
4339                 return true;
4340             }
4341         }
4342
4343         std::cerr << __func__ << " is failed!!!\n";
4344         return false;
4345     }
4346
4347     const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
4348         if (m_current_socket_client >= 0) {
4349             client  = m_current_socket_client;
4350             context = m_current_client_context;
4351             return m_current_context_uuid;
4352         } else {
4353             client  = m_last_socket_client;
4354             context = m_last_client_context;
4355             return m_last_context_uuid;
4356         }
4357     }
4358
4359 private:
4360     void socket_transaction_start (void) {
4361         m_signal_transaction_start ();
4362     }
4363
4364     void socket_transaction_end (void) {
4365         m_signal_transaction_end ();
4366     }
4367
4368     void lock (void) {
4369         m_signal_lock ();
4370     }
4371     void unlock (void) {
4372         m_signal_unlock ();
4373     }
4374 };
4375
4376 InfoManager::InfoManager ()
4377     : m_impl (new InfoManagerImpl ())
4378 {
4379 }
4380
4381 InfoManager::~InfoManager ()
4382 {
4383     delete m_impl;
4384 }
4385
4386 bool
4387 InfoManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
4388 {
4389     return m_impl->initialize (info_manager, config, display, resident);
4390 }
4391
4392 bool
4393 InfoManager::valid (void) const
4394 {
4395     return m_impl->valid ();
4396 }
4397
4398 void
4399 InfoManager::stop (void)
4400 {
4401     if (m_impl != NULL)
4402         m_impl->stop ();
4403 }
4404
4405 const ClientInfo&
4406 InfoManager::socket_get_client_info (int client) const
4407 {
4408     return m_impl->socket_get_client_info (client);
4409 }
4410
4411 void InfoManager::hide_helper (const String& uuid)
4412 {
4413     m_impl->hide_helper (uuid);
4414 }
4415 TOOLBAR_MODE_T
4416 InfoManager::get_current_toolbar_mode () const
4417 {
4418     return m_impl->get_current_toolbar_mode ();
4419 }
4420
4421 void
4422 InfoManager::get_current_ise_geometry (rectinfo& rect)
4423 {
4424     m_impl->get_current_ise_geometry (rect);
4425 }
4426
4427 String
4428 InfoManager::get_current_helper_uuid () const
4429 {
4430     return m_impl->get_current_helper_uuid ();
4431 }
4432
4433 String
4434 InfoManager::get_current_ise_name () const
4435 {
4436     return m_impl->get_current_ise_name ();
4437 }
4438
4439 void
4440 InfoManager::set_current_toolbar_mode (TOOLBAR_MODE_T mode)
4441 {
4442     m_impl->set_current_toolbar_mode (mode);
4443 }
4444
4445 void
4446 InfoManager::set_current_ise_name (String& name)
4447 {
4448     m_impl->set_current_ise_name (name);
4449 }
4450
4451 void
4452 InfoManager::set_current_helper_option (uint32 option)
4453 {
4454     m_impl->set_current_helper_option (option);
4455 }
4456
4457 void
4458 InfoManager::update_candidate_panel_event (uint32 nType, uint32 nValue)
4459 {
4460     m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL, nType, nValue);
4461 }
4462
4463 void
4464 InfoManager::update_input_panel_event (uint32 nType, uint32 nValue)
4465 {
4466     m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT, nType, nValue);
4467 }
4468
4469 bool
4470 InfoManager::move_preedit_caret (uint32         position)
4471 {
4472     return m_impl->move_preedit_caret (position);
4473 }
4474
4475 //useless
4476 #if 0
4477 bool
4478 InfoManager::request_help (void)
4479 {
4480     return m_impl->request_help ();
4481 }
4482
4483 bool
4484 InfoManager::request_factory_menu (void)
4485 {
4486     return m_impl->request_factory_menu ();
4487 }
4488 #endif
4489
4490 bool
4491 InfoManager::change_factory (const String&  uuid)
4492 {
4493     return m_impl->change_factory (uuid);
4494 }
4495
4496 bool
4497 InfoManager::helper_candidate_show (void)
4498 {
4499     return m_impl->helper_candidate_show ();
4500 }
4501
4502 bool
4503 InfoManager::helper_candidate_hide (void)
4504 {
4505     return m_impl->helper_candidate_hide ();
4506 }
4507
4508 bool
4509 InfoManager::candidate_more_window_show (void)
4510 {
4511     return m_impl->candidate_more_window_show ();
4512 }
4513
4514 bool
4515 InfoManager::candidate_more_window_hide (void)
4516 {
4517     return m_impl->candidate_more_window_hide ();
4518 }
4519
4520 bool
4521 InfoManager::update_helper_lookup_table (const LookupTable& table)
4522 {
4523     return m_impl->update_helper_lookup_table (table);
4524 }
4525
4526 bool
4527 InfoManager::select_aux (uint32         item)
4528 {
4529     return m_impl->select_aux (item);
4530 }
4531
4532 bool
4533 InfoManager::select_candidate (uint32         item)
4534 {
4535     return m_impl->select_candidate (item);
4536 }
4537
4538 bool
4539 InfoManager::lookup_table_page_up (void)
4540 {
4541     return m_impl->lookup_table_page_up ();
4542 }
4543
4544 bool
4545 InfoManager::lookup_table_page_down (void)
4546 {
4547     return m_impl->lookup_table_page_down ();
4548 }
4549
4550 bool
4551 InfoManager::update_lookup_table_page_size (uint32         size)
4552 {
4553     return m_impl->update_lookup_table_page_size (size);
4554 }
4555
4556 bool
4557 InfoManager::update_candidate_item_layout (const std::vector<uint32>& row_items)
4558 {
4559     return m_impl->update_candidate_item_layout (row_items);
4560 }
4561
4562 bool
4563 InfoManager::select_associate (uint32         item)
4564 {
4565     return m_impl->select_associate (item);
4566 }
4567
4568 bool
4569 InfoManager::associate_table_page_up (void)
4570 {
4571     return m_impl->associate_table_page_up ();
4572 }
4573
4574 bool
4575 InfoManager::associate_table_page_down (void)
4576 {
4577     return m_impl->associate_table_page_down ();
4578 }
4579
4580 bool
4581 InfoManager::update_associate_table_page_size (uint32         size)
4582 {
4583     return m_impl->update_associate_table_page_size (size);
4584 }
4585
4586 bool
4587 InfoManager::update_displayed_candidate_number (uint32        size)
4588 {
4589     return m_impl->update_displayed_candidate_number (size);
4590 }
4591
4592 void
4593 InfoManager::send_longpress_event (int type, int index)
4594 {
4595     m_impl->send_longpress_event (type, index);
4596 }
4597
4598 bool
4599 InfoManager::trigger_property (const String&  property)
4600 {
4601     return m_impl->trigger_property (property);
4602 }
4603
4604 bool
4605 InfoManager::start_helper (const String&  uuid)
4606 {
4607     return m_impl->start_helper (uuid, -2, 0);
4608 }
4609
4610 bool
4611 InfoManager::stop_helper (const String&  uuid)
4612 {
4613     return m_impl->stop_helper (uuid, -2, 0);
4614 }
4615
4616 void
4617 InfoManager::set_default_ise (const DEFAULT_ISE_T&  ise)
4618 {
4619     m_impl->set_default_ise (ise);
4620 }
4621
4622 void
4623 InfoManager::set_should_shared_ise (const bool should_shared_ise)
4624 {
4625     m_impl->set_should_shared_ise (should_shared_ise);
4626 }
4627
4628 //void
4629 //InfoManager::reload_config                  (void)
4630 //{
4631 //    m_impl->reload_config ();
4632 //}
4633
4634 bool
4635 InfoManager::exit (void)
4636 {
4637     return m_impl->exit ();
4638 }
4639 void
4640 InfoManager::update_ise_list (std::vector<String>& strList)
4641 {
4642     m_impl->update_ise_list (strList);
4643 }
4644
4645 bool
4646 InfoManager::remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
4647 {
4648     return m_impl->remoteinput_update_preedit_string (str, attrs, caret);
4649 }
4650
4651 bool
4652 InfoManager::remoteinput_commit_string (const WideString &str)
4653 {
4654     return m_impl->remoteinput_commit_string (str);
4655 }
4656
4657 bool
4658 InfoManager::remoteinput_send_key_event (const KeyEvent &key)
4659 {
4660     return m_impl->remoteinput_send_key_event (key);
4661 }
4662
4663 bool
4664 InfoManager::remoteinput_forward_key_event (const KeyEvent &key)
4665 {
4666     return m_impl->remoteinput_forward_key_event (key);
4667 }
4668
4669 bool
4670 InfoManager::remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
4671 {
4672     return m_impl->remoteinput_delete_surrounding_text (offset, len);
4673 }
4674
4675 /////////////////////////////////Message function begin/////////////////////////////////////////
4676
4677 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
4678 bool InfoManager:: reset_keyboard_ise (void)
4679 {
4680     return m_impl->reset_keyboard_ise ();
4681 }
4682
4683 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
4684 void InfoManager::show_isf_panel (int client_id)
4685 {
4686     m_impl->show_isf_panel (client_id);
4687 }
4688
4689 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
4690 void InfoManager::hide_isf_panel (int client_id)
4691 {
4692     m_impl->hide_isf_panel (client_id);
4693 }
4694
4695 //ISM_TRANS_CMD_SHOW_ISE_PANEL
4696 void InfoManager::show_ise_panel (int client_id, uint32 client, uint32 context, char*   data, size_t  len)
4697 {
4698     m_impl->show_ise_panel (client_id, client, context, data, len);
4699 }
4700
4701 //ISM_TRANS_CMD_HIDE_ISE_PANEL
4702 void InfoManager::hide_ise_panel (int client_id, uint32 client, uint32 context)
4703 {
4704     m_impl->hide_ise_panel (client_id, client, context);
4705 }
4706
4707 //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control
4708 void InfoManager::hide_helper_ise (void)
4709 {
4710     m_impl->hide_helper_ise ();
4711 }
4712
4713 //ISM_TRANS_CMD_LAUNCH_ISE from ISF control
4714 void InfoManager::prelaunch_helper_ise (void)
4715 {
4716     m_impl->prelaunch_helper_ise ();
4717 }
4718
4719 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4720 bool InfoManager::process_key_event (KeyEvent& key, uint32 serial)
4721 {
4722     return m_impl->process_key_event (key, serial);
4723 }
4724
4725 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
4726 void InfoManager::get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info)
4727 {
4728     m_impl->get_input_panel_geometry (client_id, info);
4729 }
4730
4731 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4732 void InfoManager::get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info)
4733 {
4734     m_impl->get_candidate_window_geometry (client_id, info);
4735 }
4736
4737 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
4738 void InfoManager::get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len)
4739 {
4740     m_impl->get_ise_language_locale (client_id, data, len);
4741 }
4742
4743 //ISM_TRANS_CMD_SET_LAYOUT
4744 void InfoManager::set_ise_layout (int client_id, uint32 layout)
4745 {
4746     m_impl->set_ise_layout (client_id, layout);
4747 }
4748
4749 //ISM_TRANS_CMD_SET_INPUT_MODE
4750 void InfoManager::set_ise_input_mode (int client_id, uint32 input_mode)
4751 {
4752     m_impl->set_ise_input_mode (client_id, input_mode);
4753 }
4754
4755 //ISM_TRANS_CMD_SET_INPUT_HINT
4756 void InfoManager::set_ise_input_hint (int client_id, uint32 input_hint)
4757 {
4758     m_impl->set_ise_input_hint (client_id, input_hint);
4759 }
4760
4761 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
4762 void InfoManager::update_ise_bidi_direction (int client_id, uint32 bidi_direction)
4763 {
4764     m_impl->update_ise_bidi_direction (client_id, bidi_direction);
4765 }
4766
4767
4768 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
4769 void InfoManager::set_ise_language (int client_id, uint32 language)
4770 {
4771     m_impl->set_ise_language (client_id, language);
4772 }
4773
4774 //ISM_TRANS_CMD_SET_ISE_IMDATA
4775 void InfoManager::set_ise_imdata (int client_id, const char*   imdata, size_t  len)
4776 {
4777     m_impl->set_ise_imdata (client_id, imdata, len);
4778 }
4779
4780 //ISM_TRANS_CMD_GET_ISE_IMDATA
4781 bool InfoManager:: get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len)
4782 {
4783     return m_impl->get_ise_imdata (client_id, imdata, len);
4784 }
4785
4786 //ISM_TRANS_CMD_GET_LAYOUT
4787 bool InfoManager:: get_ise_layout (int client_id, _OUT_ uint32& layout)
4788 {
4789     return m_impl->get_ise_layout (client_id, layout);
4790 }
4791
4792 //ISM_TRANS_CMD_GET_ISE_STATE
4793 void InfoManager::get_ise_state (int client_id, _OUT_ int& state)
4794 {
4795     m_impl->get_ise_state (client_id, state);
4796 }
4797
4798 //ISM_TRANS_CMD_GET_ACTIVE_ISE
4799 void InfoManager::get_active_ise (int client_id, _OUT_ String& default_uuid)
4800 {
4801     m_impl->get_active_ise (client_id, default_uuid);
4802 }
4803
4804 //ISM_TRANS_CMD_GET_ISE_LIST
4805 void InfoManager::get_ise_list (int client_id, _OUT_ std::vector<String>& strlist)
4806 {
4807     m_impl->get_ise_list (client_id, strlist);
4808 }
4809
4810
4811 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
4812 void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
4813 {
4814     m_impl->get_all_helper_ise_info (client_id, info);
4815 }
4816
4817 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
4818 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4819 void InfoManager::set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled)
4820 {
4821     m_impl->set_enable_helper_ise_info (client_id, appid, is_enabled);
4822 }
4823
4824 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
4825 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4826 void InfoManager::show_helper_ise_list (int client_id)
4827 {
4828     m_impl->show_helper_ise_list (client_id);
4829 }
4830
4831
4832 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
4833 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4834 void InfoManager::show_helper_ise_selector (int client_id)
4835 {
4836     m_impl->show_helper_ise_selector (client_id);
4837 }
4838
4839 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
4840 //reply
4841 void InfoManager::is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled)
4842 {
4843     m_impl->is_helper_ise_enabled (client_id, strAppid, nEnabled);
4844 }
4845
4846 //ISM_TRANS_CMD_GET_ISE_INFORMATION
4847 void InfoManager::get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
4848                                        _OUT_ int& nType,   _OUT_ int& nOption, _OUT_ String& strModuleName)
4849 {
4850     m_impl->get_ise_information (client_id, strUuid, strName, strLanguage, nType, nOption, strModuleName);
4851 }
4852
4853 //ISM_TRANS_CMD_RESET_ISE_OPTION
4854 //reply SCIM_TRANS_CMD_OK
4855 bool InfoManager:: reset_ise_option (int client_id)
4856 {
4857     return m_impl->reset_ise_option (client_id);
4858 }
4859
4860 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
4861 //reply
4862 bool InfoManager:: set_active_ise_by_uuid (int client_id, char*  buf, size_t  len)
4863 {
4864     return m_impl->set_active_ise_by_uuid (client_id, buf, len);
4865 }
4866
4867 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
4868 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4869 void InfoManager::set_initial_ise_by_uuid (int client_id, char*  buf, size_t  len)
4870 {
4871     m_impl->set_initial_ise_by_uuid (client_id, buf, len);
4872 }
4873
4874 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
4875 void InfoManager::set_ise_return_key_type (int client_id, uint32 type)
4876 {
4877     m_impl->set_ise_return_key_type (client_id, type);
4878 }
4879
4880 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
4881 //reply
4882 bool InfoManager:: get_ise_return_key_type (int client_id, _OUT_ uint32& type)
4883 {
4884     return m_impl->get_ise_return_key_type (client_id, type);
4885 }
4886
4887
4888 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
4889 void InfoManager::set_ise_return_key_disable (int client_id, uint32 disabled)
4890 {
4891     m_impl->set_ise_return_key_disable (client_id, disabled);
4892 }
4893
4894 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
4895 bool InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
4896 {
4897     return m_impl->get_ise_return_key_disable (client_id, disabled);
4898 }
4899
4900 //ISM_TRANS_CMD_SET_CAPS_MODE
4901 void InfoManager::set_ise_caps_mode (int client_id, uint32 mode)
4902 {
4903     m_impl->set_ise_caps_mode (client_id, mode);
4904 }
4905
4906 //SCIM_TRANS_CMD_RELOAD_CONFIG
4907 void InfoManager::reload_config (void)
4908 {
4909     m_impl->reload_config ();
4910 }
4911
4912 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
4913 void InfoManager::will_show_ack (int client_id)
4914 {
4915     m_impl->will_show_ack (client_id);
4916 }
4917
4918 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
4919 void InfoManager::will_hide_ack (int client_id)
4920 {
4921     m_impl->will_hide_ack (client_id);
4922 }
4923
4924 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
4925 void InfoManager::reset_default_ise (int client_id)
4926 {
4927     m_impl->reset_default_ise (client_id);
4928 }
4929
4930 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
4931 void InfoManager::set_keyboard_mode (int client_id, uint32 mode)
4932 {
4933     m_impl->set_keyboard_mode (client_id, mode);
4934 }
4935
4936 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
4937 void InfoManager::candidate_will_hide_ack (int client_id)
4938 {
4939     m_impl->candidate_will_hide_ack (client_id);
4940 }
4941
4942 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
4943 void InfoManager::get_active_helper_option (int client_id, _OUT_ uint32& option)
4944 {
4945     m_impl->get_active_helper_option (client_id, option);
4946 }
4947
4948 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
4949 void InfoManager::show_ise_option_window (int client_id)
4950 {
4951     m_impl->show_ise_option_window (client_id);
4952 }
4953
4954 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
4955 void InfoManager::resume_ise_option_window (int client_id)
4956 {
4957     m_impl->resume_ise_option_window (client_id);
4958 }
4959
4960 //ISM_TRANS_CMD_SET_KEYBOARD_MODE
4961 void InfoManager::set_ise_keyboard_mode (int client_id, uint32 mode)
4962 {
4963     m_impl->set_ise_keyboard_mode (client_id, mode);
4964 }
4965
4966 //ISM_TRANS_CMD_SET_PREDICTION_HINT
4967 void InfoManager::set_prediction_hint (int client_id, String prediction_hint)
4968 {
4969     m_impl->set_prediction_hint (client_id, prediction_hint);
4970 }
4971
4972 //ISM_TRANS_CMD_SET_MIME_TYPE
4973 void InfoManager::set_ise_mime_type (int client_id, String mime_type)
4974 {
4975     m_impl->set_ise_mime_type (client_id, mime_type);
4976 }
4977
4978 //ISM_TRANS_CMD_FINALIZE_CONTENT
4979 void InfoManager::finalize_content (int client_id, String text, uint32 cursor_pos)
4980 {
4981     m_impl->finalize_content (client_id, text, cursor_pos);
4982 }
4983
4984 //ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA
4985 void InfoManager::set_prediction_hint_data (int client_id, String key, String value)
4986 {
4987     m_impl->set_prediction_hint_data (client_id, key, value);
4988 }
4989
4990 //ISM_TRANS_CMD_SET_OPTIMIZATION_HINT
4991 void InfoManager::set_optimization_hint(int client_id, uint32 hint)
4992 {
4993     m_impl->set_optimization_hint(client_id, hint);
4994 }
4995
4996 //ISM_TRANS_CMD_EXPAND_CANDIDATE
4997 void InfoManager::expand_candidate ()
4998 {
4999     m_impl->expand_candidate ();
5000 }
5001
5002 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
5003 void InfoManager::contract_candidate ()
5004 {
5005     m_impl->contract_candidate ();
5006 }
5007
5008 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
5009 void InfoManager::get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info)
5010 {
5011     m_impl->get_recent_ise_geometry (client_id, angle, info);
5012 }
5013
5014 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
5015 bool InfoManager::remoteinput_send_input_message (int client_id, char* buf, size_t len)
5016 {
5017     return m_impl->send_remote_input_message (client_id, buf, len);
5018 }
5019
5020 void InfoManager::remoteinput_send_surrounding_text (const char* text, uint32 cursor)
5021 {
5022     return m_impl->send_remote_surrounding_text (text, cursor);
5023 }
5024
5025 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
5026 void InfoManager::register_panel_client (uint32 client_id, uint32 id)
5027 {
5028     m_impl->register_panel_client (client_id, id);
5029 }
5030
5031 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
5032 void InfoManager::register_input_context (uint32 client_id, uint32 context, String  uuid)
5033 {
5034     m_impl->register_input_context (client_id, context, uuid);
5035 }
5036
5037 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
5038 void InfoManager::remove_input_context (uint32 client_id, uint32 context)
5039 {
5040     m_impl->remove_input_context (client_id, context);
5041 }
5042
5043 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
5044 void InfoManager::socket_reset_input_context (int client_id, uint32 context)
5045 {
5046     m_impl->socket_reset_input_context (client_id, context);
5047 }
5048
5049 //SCIM_TRANS_CMD_FOCUS_IN
5050 void InfoManager::focus_in (int client_id, uint32 context,  String  uuid)
5051 {
5052     m_impl->focus_in (client_id, context, uuid);
5053 }
5054
5055 //SCIM_TRANS_CMD_FOCUS_OUT
5056 void InfoManager::focus_out (int client_id, uint32 context)
5057 {
5058     m_impl->focus_out (client_id, context);
5059 }
5060
5061 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
5062 bool InfoManager::process_input_device_event(int client, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
5063 {
5064     return m_impl->process_input_device_event(client, type, data, len, result);
5065 }
5066
5067 //ISM_TRANS_CMD_TURN_ON_LOG
5068 void InfoManager::socket_turn_on_log (uint32 isOn)
5069 {
5070     m_impl->socket_turn_on_log (isOn);
5071 }
5072
5073 //SCIM_TRANS_CMD_PANEL_TURN_ON
5074 void InfoManager::socket_turn_on (void)
5075 {
5076     m_impl->socket_turn_on ();
5077 }
5078
5079 //SCIM_TRANS_CMD_PANEL_TURN_OFF
5080 void InfoManager::socket_turn_off (void)
5081 {
5082     m_impl->socket_turn_off ();
5083 }
5084
5085 //SCIM_TRANS_CMD_UPDATE_SCREEN
5086 void InfoManager::socket_update_screen (int client_id, uint32 num)
5087 {
5088     m_impl->socket_update_screen (client_id, num);
5089 }
5090
5091 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
5092 void InfoManager::socket_update_spot_location (uint32 x, uint32 y, uint32 top_y)
5093 {
5094     m_impl->socket_update_spot_location (x, y, top_y);
5095 }
5096
5097 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
5098 void InfoManager::socket_update_cursor_position (uint32 cursor_pos)
5099 {
5100     m_impl->socket_update_cursor_position (cursor_pos);
5101 }
5102
5103 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
5104 void InfoManager::socket_update_surrounding_text (String text, uint32 cursor)
5105 {
5106     m_impl->socket_update_surrounding_text (text, cursor);
5107 }
5108
5109 void InfoManager::remoteinput_callback_focus_in (void)
5110 {
5111     m_impl->remoteinput_callback_focus_in ();
5112 }
5113
5114 void InfoManager::remoteinput_callback_focus_out (void)
5115 {
5116     m_impl->remoteinput_callback_focus_out ();
5117 }
5118
5119 void InfoManager::remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled)
5120 {
5121     m_impl->remoteinput_callback_entry_metadata (hint, layout, variation, autocapital_type, return_key_disabled);
5122 }
5123
5124 void InfoManager::remoteinput_callback_surrounding_text (String text, uint32 cursor)
5125 {
5126     m_impl->remoteinput_callback_surrounding_text (text, cursor);
5127 }
5128
5129 void InfoManager::remoteinput_callback_input_resource (uint32 input_resource)
5130 {
5131     m_impl->remoteinput_callback_input_resource (input_resource);
5132 }
5133
5134 //ISM_TRANS_CMD_UPDATE_SELECTION
5135 void InfoManager::socket_update_selection (String text)
5136 {
5137     m_impl->socket_update_selection (text);
5138 }
5139
5140 //FIXME: useless anymore
5141 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
5142 void InfoManager::socket_update_factory_info (PanelFactoryInfo& info)
5143 {
5144     m_impl->socket_update_factory_info (info);
5145 }
5146
5147 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
5148 void InfoManager::socket_show_help (String help)
5149 {
5150     m_impl->socket_show_help (help);
5151 }
5152
5153 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
5154 void InfoManager::socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec)
5155 {
5156     m_impl->socket_show_factory_menu (vec);
5157 }
5158
5159 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5160 void InfoManager::socket_show_preedit_string (void)
5161 {
5162     m_impl->socket_show_preedit_string ();
5163 }
5164
5165 //SCIM_TRANS_CMD_SHOW_AUX_STRING
5166 void InfoManager::socket_show_aux_string (void)
5167 {
5168     m_impl->socket_show_aux_string ();
5169 }
5170
5171 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
5172 void InfoManager::socket_show_lookup_table (void)
5173 {
5174     m_impl->socket_show_lookup_table ();
5175 }
5176
5177 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
5178 void InfoManager::socket_show_associate_table (void)
5179 {
5180     m_impl->socket_show_associate_table ();
5181 }
5182
5183 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5184 void InfoManager::socket_hide_preedit_string (void)
5185 {
5186     m_impl->socket_hide_preedit_string ();
5187 }
5188
5189 //SCIM_TRANS_CMD_HIDE_AUX_STRING
5190 void InfoManager::socket_hide_aux_string (void)
5191 {
5192     m_impl->socket_hide_aux_string ();
5193 }
5194
5195 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
5196 void InfoManager::socket_hide_lookup_table (void)
5197 {
5198     m_impl->socket_hide_lookup_table ();
5199 }
5200
5201 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
5202 void InfoManager::socket_hide_associate_table (void)
5203 {
5204     m_impl->socket_hide_associate_table ();
5205 }
5206
5207 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5208 void InfoManager::socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret)
5209 {
5210     m_impl->socket_update_preedit_string (str, attrs, caret);
5211 }
5212
5213 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5214 void InfoManager::socket_update_preedit_caret (uint32 caret)
5215 {
5216     m_impl->socket_update_preedit_caret (caret);
5217 }
5218
5219 //ISM_TRANS_CMD_RECAPTURE_STRING
5220 void InfoManager::socket_recapture_string (int offset, int len, String& preedit, String& commit, const AttributeList& attrs)
5221 {
5222     m_impl->socket_recapture_string (offset, len, preedit, commit, attrs);
5223 }
5224
5225 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
5226 void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
5227 {
5228     m_impl->socket_update_aux_string (str, attrs);
5229 }
5230
5231 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
5232 void InfoManager::socket_update_lookup_table (const LookupTable& table)
5233 {
5234     m_impl->socket_update_lookup_table (table);
5235 }
5236
5237 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
5238 void InfoManager::socket_update_associate_table (const LookupTable& table)
5239 {
5240     m_impl->socket_update_associate_table (table);
5241 }
5242
5243 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5244 void InfoManager::socket_register_properties (const PropertyList& properties)
5245 {
5246     m_impl->socket_register_properties (properties);
5247 }
5248
5249 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5250 void InfoManager::socket_update_property (const Property& property)
5251 {
5252     m_impl->socket_update_property (property);
5253 }
5254
5255 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
5256 void InfoManager::socket_get_keyboard_ise_list (String& uuid)
5257 {
5258     m_impl->socket_get_keyboard_ise_list (uuid);
5259 }
5260
5261 //ISM_TRANS_CMD_SET_CANDIDATE_UI
5262 void InfoManager::socket_set_candidate_ui (uint32 portrait_line, uint32 mode)
5263 {
5264     m_impl->socket_set_candidate_ui (portrait_line, mode);
5265 }
5266
5267 //ISM_TRANS_CMD_GET_CANDIDATE_UI
5268 void InfoManager::socket_get_candidate_ui (String uuid)
5269 {
5270     m_impl->socket_get_candidate_ui (uuid);
5271 }
5272
5273 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
5274 void InfoManager::socket_set_candidate_position (uint32 left, uint32 top)
5275 {
5276     m_impl->socket_set_candidate_position (left, top);
5277 }
5278
5279 //ISM_TRANS_CMD_HIDE_CANDIDATE
5280 void InfoManager::socket_hide_candidate (void)
5281 {
5282     m_impl->socket_hide_candidate ();
5283 }
5284
5285 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
5286 void InfoManager::socket_get_candidate_geometry (String& uuid)
5287 {
5288     m_impl->socket_get_candidate_geometry (uuid);
5289 }
5290
5291 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
5292 void InfoManager::socket_set_keyboard_ise (String uuid)
5293 {
5294     m_impl->socket_set_keyboard_ise (uuid);
5295 }
5296
5297 //ISM_TRANS_CMD_SELECT_CANDIDATE
5298 void InfoManager::socket_helper_select_candidate (uint32 index)
5299 {
5300     m_impl->socket_helper_select_candidate (index);
5301 }
5302
5303 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
5304 void InfoManager::socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height)
5305 {
5306     m_impl->socket_helper_update_ise_geometry (client, x, y, width, height);
5307 }
5308
5309 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
5310 void InfoManager::socket_get_keyboard_ise (String uuid)
5311 {
5312     m_impl->socket_get_keyboard_ise (uuid);
5313 }
5314
5315 //SCIM_TRANS_CMD_START_HELPER
5316 void InfoManager::socket_start_helper (int client_id, uint32 context, String uuid)
5317 {
5318     m_impl->socket_start_helper (client_id, context, uuid);
5319 }
5320
5321 //SCIM_TRANS_CMD_STOP_HELPER
5322 void InfoManager::socket_stop_helper (int client_id, uint32 context, String uuid)
5323 {
5324     m_impl->socket_stop_helper (client_id, context, uuid);
5325 }
5326
5327 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
5328 void InfoManager::socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans)
5329 {
5330     m_impl->socket_send_helper_event (client_id, context, uuid, _nest_trans);
5331 }
5332
5333 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
5334 void InfoManager::socket_helper_register_properties (int client, PropertyList& properties)
5335 {
5336     m_impl->socket_helper_register_properties (client, properties);
5337 }
5338
5339 //SCIM_TRANS_CMD_UPDATE_PROPERTY
5340 void InfoManager::socket_helper_update_property (int client, Property& property)
5341 {
5342     m_impl->socket_helper_update_property (client, property);
5343 }
5344
5345 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
5346 void InfoManager::socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans)
5347 {
5348     m_impl->socket_helper_send_imengine_event (client, target_ic, target_uuid, nest_trans);
5349 }
5350
5351 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
5352 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
5353 void InfoManager::socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5354 {
5355     m_impl->socket_helper_send_key_event (client, target_ic, target_uuid, key);
5356 }
5357
5358 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
5359 void InfoManager::socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
5360 {
5361     m_impl->socket_helper_forward_key_event (client, target_ic, target_uuid, key);
5362 }
5363
5364 //SCIM_TRANS_CMD_COMMIT_STRING
5365 void InfoManager::socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr)
5366 {
5367     m_impl->socket_helper_commit_string (client, target_ic, target_uuid, wstr);
5368 }
5369
5370 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
5371 void InfoManager::socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after)
5372 {
5373     m_impl->socket_helper_get_surrounding_text (client, uuid, maxlen_before, maxlen_after);
5374 }
5375
5376 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
5377 void InfoManager::socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len)
5378 {
5379     m_impl->socket_helper_delete_surrounding_text (client, offset, len);
5380 }
5381
5382 //SCIM_TRANS_CMD_GET_SELECTION
5383 void InfoManager::socket_helper_get_selection (int client, String uuid)
5384 {
5385     m_impl->socket_helper_get_selection (client, uuid);
5386 }
5387
5388 //SCIM_TRANS_CMD_SET_SELECTION
5389 void InfoManager::socket_helper_set_selection (int client, uint32 start, uint32 end)
5390 {
5391     m_impl->socket_helper_set_selection (client, start, end);
5392 }
5393
5394 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5395 void InfoManager::socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid)
5396 {
5397     m_impl->socket_helper_show_preedit_string (client, target_ic, target_uuid);
5398 }
5399
5400 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5401 void InfoManager::socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid)
5402 {
5403     m_impl->socket_helper_hide_preedit_string (client, target_ic, target_uuid);
5404 }
5405
5406 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5407 void InfoManager::socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit,
5408         WideString commit, AttributeList& attrs, uint32 caret)
5409 {
5410     m_impl->socket_helper_update_preedit_string (client, target_ic, target_uuid, preedit, commit, attrs, caret);
5411 }
5412
5413 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5414 void InfoManager::socket_helper_update_preedit_caret (int client, uint32 caret)
5415 {
5416     m_impl->socket_helper_update_preedit_caret (client, caret);
5417 }
5418
5419 //ISM_TRANS_CMD_RECAPTURE_STRING
5420 void InfoManager::socket_helper_recapture_string (int client, uint32 target_ic, String target_uuid, int offset, int len, WideString preedit,
5421         WideString commit, AttributeList& attrs)
5422 {
5423     m_impl->socket_helper_recapture_string (client, target_ic, target_uuid, offset, len, preedit, commit, attrs);
5424 }
5425
5426 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
5427 void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
5428 {
5429     m_impl->socket_helper_register_helper (client, info);
5430 }
5431
5432 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
5433 void InfoManager::socket_helper_register_helper_passive (int client, HelperInfo& info)
5434 {
5435     m_impl->socket_helper_register_helper_passive (client, info);
5436 }
5437
5438 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
5439 void InfoManager::socket_helper_update_input_context (int client, uint32 type, uint32 value)
5440 {
5441     m_impl->socket_helper_update_input_context (client, type, value);
5442 }
5443
5444 //ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE
5445 void InfoManager::socket_helper_update_language_locale(int client, String locale)
5446 {
5447     m_impl->socket_helper_update_language_locale(client, locale);
5448 }
5449
5450 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
5451 void InfoManager::socket_helper_send_private_command (int client, String command)
5452 {
5453     m_impl->socket_helper_send_private_command (client, command);
5454 }
5455
5456 //SCIM_TRANS_CMD_COMMIT_CONTENT
5457 void InfoManager::socket_helper_commit_content (int client, String content, String description, String mime_types)
5458 {
5459     m_impl->socket_helper_commit_content (client, content, description, mime_types);
5460 }
5461
5462 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
5463 void InfoManager::UPDATE_ISE_EXIT (int client)
5464 {
5465     m_impl->UPDATE_ISE_EXIT (client);
5466 }
5467
5468 //ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE
5469 void InfoManager::process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial)
5470 {
5471     m_impl->process_key_event_done (key, ret, serial);
5472 }
5473
5474 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
5475 void InfoManager::request_ise_hide ()
5476 {
5477     m_impl->request_ise_hide ();
5478 }
5479
5480 bool InfoManager::check_privilege_by_sockfd (int client_id, const String& privilege) {
5481     return m_impl->check_privilege_by_sockfd (client_id, privilege);
5482 }
5483
5484 void InfoManager::add_client (int client_id, uint32 key, ClientType type)
5485 {
5486     m_impl->add_client (client_id, key, type);
5487 }
5488
5489 void InfoManager::del_client (int client_id)
5490 {
5491     m_impl->del_client (client_id);
5492 }
5493
5494 bool InfoManager::set_autocapital_type (int mode)
5495 {
5496     return m_impl->set_autocapital_type (mode);
5497 }
5498
5499 void InfoManager::set_prediction_allow (int client, bool mode)
5500 {
5501     m_impl->set_prediction_allow (client, mode);
5502 }
5503
5504 void InfoManager::reshow_input_panel ()
5505 {
5506     m_impl->reshow_input_panel ();
5507 }
5508
5509 //////////////////////////////////Message function end/////////////////////////////////////////
5510
5511 Connection
5512 InfoManager::signal_connect_turn_on (InfoManagerSlotVoid*                slot)
5513 {
5514     return m_impl->signal_connect_turn_on (slot);
5515 }
5516
5517 Connection
5518 InfoManager::signal_connect_turn_off (InfoManagerSlotVoid*                slot)
5519 {
5520     return m_impl->signal_connect_turn_off (slot);
5521 }
5522
5523 Connection
5524 InfoManager::signal_connect_show_panel (InfoManagerSlotVoid*                slot)
5525 {
5526     return m_impl->signal_connect_show_panel (slot);
5527 }
5528
5529 Connection
5530 InfoManager::signal_connect_hide_panel (InfoManagerSlotVoid*                slot)
5531 {
5532     return m_impl->signal_connect_hide_panel (slot);
5533 }
5534
5535 Connection
5536 InfoManager::signal_connect_update_screen (InfoManagerSlotInt*                 slot)
5537 {
5538     return m_impl->signal_connect_update_screen (slot);
5539 }
5540
5541 Connection
5542 InfoManager::signal_connect_update_spot_location (InfoManagerSlotIntIntInt*           slot)
5543 {
5544     return m_impl->signal_connect_update_spot_location (slot);
5545 }
5546
5547 Connection
5548 InfoManager::signal_connect_update_factory_info (InfoManagerSlotFactoryInfo*         slot)
5549 {
5550     return m_impl->signal_connect_update_factory_info (slot);
5551 }
5552
5553 Connection
5554 InfoManager::signal_connect_start_default_ise (InfoManagerSlotVoid*                slot)
5555 {
5556     return m_impl->signal_connect_start_default_ise (slot);
5557 }
5558
5559 Connection
5560 InfoManager::signal_connect_stop_default_ise (InfoManagerSlotVoid*                slot)
5561 {
5562     return m_impl->signal_connect_stop_default_ise (slot);
5563 }
5564
5565 Connection
5566 InfoManager::signal_connect_set_candidate_ui (InfoManagerSlotIntInt*              slot)
5567 {
5568     return m_impl->signal_connect_set_candidate_ui (slot);
5569 }
5570
5571 Connection
5572 InfoManager::signal_connect_get_candidate_ui (InfoManagerSlotIntInt2*             slot)
5573 {
5574     return m_impl->signal_connect_get_candidate_ui (slot);
5575 }
5576
5577 Connection
5578 InfoManager::signal_connect_set_candidate_position (InfoManagerSlotIntInt*              slot)
5579 {
5580     return m_impl->signal_connect_set_candidate_position (slot);
5581 }
5582
5583 Connection
5584 InfoManager::signal_connect_get_candidate_geometry (InfoManagerSlotRect*                slot)
5585 {
5586     return m_impl->signal_connect_get_candidate_geometry (slot);
5587 }
5588
5589 Connection
5590 InfoManager::signal_connect_get_input_panel_geometry (InfoManagerSlotRect*                slot)
5591 {
5592     return m_impl->signal_connect_get_input_panel_geometry (slot);
5593 }
5594
5595 Connection
5596 InfoManager::signal_connect_set_keyboard_ise (InfoManagerSlotString*              slot)
5597 {
5598     return m_impl->signal_connect_set_keyboard_ise (slot);
5599 }
5600
5601 Connection
5602 InfoManager::signal_connect_get_keyboard_ise (InfoManagerSlotString2*             slot)
5603 {
5604     return m_impl->signal_connect_get_keyboard_ise (slot);
5605 }
5606
5607 Connection
5608 InfoManager::signal_connect_show_help (InfoManagerSlotString*              slot)
5609 {
5610     return m_impl->signal_connect_show_help (slot);
5611 }
5612
5613 Connection
5614 InfoManager::signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector*   slot)
5615 {
5616     return m_impl->signal_connect_show_factory_menu (slot);
5617 }
5618
5619 Connection
5620 InfoManager::signal_connect_show_preedit_string (InfoManagerSlotVoid*                slot)
5621 {
5622     return m_impl->signal_connect_show_preedit_string (slot);
5623 }
5624
5625 Connection
5626 InfoManager::signal_connect_show_aux_string (InfoManagerSlotVoid*                slot)
5627 {
5628     return m_impl->signal_connect_show_aux_string (slot);
5629 }
5630
5631 Connection
5632 InfoManager::signal_connect_show_lookup_table (InfoManagerSlotVoid*                slot)
5633 {
5634     return m_impl->signal_connect_show_lookup_table (slot);
5635 }
5636
5637 Connection
5638 InfoManager::signal_connect_show_associate_table (InfoManagerSlotVoid*                slot)
5639 {
5640     return m_impl->signal_connect_show_associate_table (slot);
5641 }
5642
5643 Connection
5644 InfoManager::signal_connect_hide_preedit_string (InfoManagerSlotVoid*                slot)
5645 {
5646     return m_impl->signal_connect_hide_preedit_string (slot);
5647 }
5648
5649 Connection
5650 InfoManager::signal_connect_hide_aux_string (InfoManagerSlotVoid*                slot)
5651 {
5652     return m_impl->signal_connect_hide_aux_string (slot);
5653 }
5654
5655 Connection
5656 InfoManager::signal_connect_hide_lookup_table (InfoManagerSlotVoid*                slot)
5657 {
5658     return m_impl->signal_connect_hide_lookup_table (slot);
5659 }
5660
5661 Connection
5662 InfoManager::signal_connect_hide_associate_table (InfoManagerSlotVoid*                slot)
5663 {
5664     return m_impl->signal_connect_hide_associate_table (slot);
5665 }
5666
5667 Connection
5668 InfoManager::signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt*  slot)
5669 {
5670     return m_impl->signal_connect_update_preedit_string (slot);
5671 }
5672
5673 Connection
5674 InfoManager::signal_connect_update_preedit_caret (InfoManagerSlotInt*                 slot)
5675 {
5676     return m_impl->signal_connect_update_preedit_caret (slot);
5677 }
5678
5679 Connection
5680 InfoManager::signal_connect_update_aux_string (InfoManagerSlotAttributeString*     slot)
5681 {
5682     return m_impl->signal_connect_update_aux_string (slot);
5683 }
5684
5685 Connection
5686 InfoManager::signal_connect_update_lookup_table (InfoManagerSlotLookupTable*         slot)
5687 {
5688     return m_impl->signal_connect_update_lookup_table (slot);
5689 }
5690
5691 Connection
5692 InfoManager::signal_connect_update_associate_table (InfoManagerSlotLookupTable*         slot)
5693 {
5694     return m_impl->signal_connect_update_associate_table (slot);
5695 }
5696
5697 Connection
5698 InfoManager::signal_connect_register_properties (InfoManagerSlotPropertyList*        slot)
5699 {
5700     return m_impl->signal_connect_register_properties (slot);
5701 }
5702
5703 Connection
5704 InfoManager::signal_connect_update_property (InfoManagerSlotProperty*            slot)
5705 {
5706     return m_impl->signal_connect_update_property (slot);
5707 }
5708
5709 Connection
5710 InfoManager::signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList*     slot)
5711 {
5712     return m_impl->signal_connect_register_helper_properties (slot);
5713 }
5714
5715 Connection
5716 InfoManager::signal_connect_update_helper_property (InfoManagerSlotIntProperty*         slot)
5717 {
5718     return m_impl->signal_connect_update_helper_property (slot);
5719 }
5720
5721 Connection
5722 InfoManager::signal_connect_register_helper (InfoManagerSlotIntHelperInfo*       slot)
5723 {
5724     return m_impl->signal_connect_register_helper (slot);
5725 }
5726
5727 Connection
5728 InfoManager::signal_connect_remove_helper (InfoManagerSlotInt*                 slot)
5729 {
5730     return m_impl->signal_connect_remove_helper (slot);
5731 }
5732
5733 Connection
5734 InfoManager::signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool*          slot)
5735 {
5736     return m_impl->signal_connect_set_active_ise_by_uuid (slot);
5737 }
5738
5739 Connection
5740 InfoManager::signal_connect_focus_in (InfoManagerSlotVoid*                slot)
5741 {
5742     return m_impl->signal_connect_focus_in (slot);
5743 }
5744
5745 Connection
5746 InfoManager::signal_connect_focus_out (InfoManagerSlotVoid*                slot)
5747 {
5748     return m_impl->signal_connect_focus_out (slot);
5749 }
5750
5751 Connection
5752 InfoManager::signal_connect_expand_candidate (InfoManagerSlotVoid*                slot)
5753 {
5754     return m_impl->signal_connect_expand_candidate (slot);
5755 }
5756
5757 Connection
5758 InfoManager::signal_connect_contract_candidate (InfoManagerSlotVoid*                slot)
5759 {
5760     return m_impl->signal_connect_contract_candidate (slot);
5761 }
5762
5763 Connection
5764 InfoManager::signal_connect_select_candidate (InfoManagerSlotInt*                 slot)
5765 {
5766     return m_impl->signal_connect_select_candidate (slot);
5767 }
5768
5769 Connection
5770 InfoManager::signal_connect_get_ise_list (InfoManagerSlotBoolStringVector*    slot)
5771 {
5772     return m_impl->signal_connect_get_ise_list (slot);
5773 }
5774
5775 Connection
5776 InfoManager::signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo*      slot)
5777 {
5778     return m_impl->signal_connect_get_all_helper_ise_info (slot);
5779 }
5780
5781 Connection
5782 InfoManager::signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool*      slot)
5783 {
5784     return m_impl->signal_connect_set_has_option_helper_ise_info (slot);
5785 }
5786
5787 Connection
5788 InfoManager::signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool*     slot)
5789 {
5790     return m_impl->signal_connect_set_enable_helper_ise_info (slot);
5791 }
5792
5793 Connection
5794 InfoManager::signal_connect_show_helper_ise_list (InfoManagerSlotVoid*                slot)
5795 {
5796     return m_impl->signal_connect_show_helper_ise_list (slot);
5797 }
5798
5799 Connection
5800 InfoManager::signal_connect_show_helper_ise_selector (InfoManagerSlotVoid*                slot)
5801 {
5802     return m_impl->signal_connect_show_helper_ise_selector (slot);
5803 }
5804
5805 Connection
5806 InfoManager::signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt*           slot)
5807 {
5808     return m_impl->signal_connect_is_helper_ise_enabled (slot);
5809 }
5810
5811 Connection
5812 InfoManager::signal_connect_get_ise_information (InfoManagerSlotBoolString4int2*     slot)
5813 {
5814     return m_impl->signal_connect_get_ise_information (slot);
5815 }
5816
5817 Connection
5818 InfoManager::signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector*    slot)
5819 {
5820     return m_impl->signal_connect_get_keyboard_ise_list (slot);
5821 }
5822
5823 Connection
5824 InfoManager::signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt*        slot)
5825 {
5826     return m_impl->signal_connect_update_ise_geometry (slot);
5827 }
5828
5829 Connection
5830 InfoManager::signal_connect_get_language_list (InfoManagerSlotStringVector*        slot)
5831 {
5832     return m_impl->signal_connect_get_language_list (slot);
5833 }
5834
5835 Connection
5836 InfoManager::signal_connect_get_all_language (InfoManagerSlotStringVector*        slot)
5837 {
5838     return m_impl->signal_connect_get_all_language (slot);
5839 }
5840
5841 Connection
5842 InfoManager::signal_connect_get_ise_language (InfoManagerSlotStrStringVector*     slot)
5843 {
5844     return m_impl->signal_connect_get_ise_language (slot);
5845 }
5846
5847 Connection
5848 InfoManager::signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO*       slot)
5849 {
5850     return m_impl->signal_connect_get_ise_info_by_uuid (slot);
5851 }
5852
5853 Connection
5854 InfoManager::signal_connect_send_key_event (InfoManagerSlotKeyEvent*            slot)
5855 {
5856     return m_impl->signal_connect_send_key_event (slot);
5857 }
5858
5859 Connection
5860 InfoManager::signal_connect_accept_connection (InfoManagerSlotInt*                 slot)
5861 {
5862     return m_impl->signal_connect_accept_connection (slot);
5863 }
5864
5865 Connection
5866 InfoManager::signal_connect_close_connection (InfoManagerSlotInt*                 slot)
5867 {
5868     return m_impl->signal_connect_close_connection (slot);
5869 }
5870
5871 Connection
5872 InfoManager::signal_connect_exit (InfoManagerSlotVoid*                slot)
5873 {
5874     return m_impl->signal_connect_exit (slot);
5875 }
5876
5877 Connection
5878 InfoManager::signal_connect_transaction_start (InfoManagerSlotVoid*                slot)
5879 {
5880     return m_impl->signal_connect_transaction_start (slot);
5881 }
5882
5883 Connection
5884 InfoManager::signal_connect_transaction_end (InfoManagerSlotVoid*                slot)
5885 {
5886     return m_impl->signal_connect_transaction_end (slot);
5887 }
5888
5889 Connection
5890 InfoManager::signal_connect_lock (InfoManagerSlotVoid*                slot)
5891 {
5892     return m_impl->signal_connect_lock (slot);
5893 }
5894
5895 Connection
5896 InfoManager::signal_connect_unlock (InfoManagerSlotVoid*                slot)
5897 {
5898     return m_impl->signal_connect_unlock (slot);
5899 }
5900
5901 Connection
5902 InfoManager::signal_connect_update_input_context (InfoManagerSlotIntInt*              slot)
5903 {
5904     return m_impl->signal_connect_update_input_context (slot);
5905 }
5906
5907 Connection
5908 InfoManager::signal_connect_show_ise (InfoManagerSlotVoid*                slot)
5909 {
5910     return m_impl->signal_connect_show_ise (slot);
5911 }
5912
5913 Connection
5914 InfoManager::signal_connect_hide_ise (InfoManagerSlotVoid*                slot)
5915 {
5916     return m_impl->signal_connect_hide_ise (slot);
5917 }
5918
5919 Connection
5920 InfoManager::signal_connect_will_show_ack (InfoManagerSlotVoid*                slot)
5921 {
5922     return m_impl->signal_connect_will_show_ack (slot);
5923 }
5924
5925 Connection
5926 InfoManager::signal_connect_will_hide_ack (InfoManagerSlotVoid*                slot)
5927 {
5928     return m_impl->signal_connect_will_hide_ack (slot);
5929 }
5930
5931 Connection
5932 InfoManager::signal_connect_set_keyboard_mode (InfoManagerSlotInt*                 slot)
5933 {
5934     return m_impl->signal_connect_set_keyboard_mode (slot);
5935 }
5936
5937 Connection
5938 InfoManager::signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid*                slot)
5939 {
5940     return m_impl->signal_connect_candidate_will_hide_ack (slot);
5941 }
5942
5943 Connection
5944 InfoManager::signal_connect_get_ise_state (InfoManagerSlotInt2*                slot)
5945 {
5946     return m_impl->signal_connect_get_ise_state (slot);
5947 }
5948
5949 Connection
5950 InfoManager::signal_connect_run_helper (InfoManagerSlotString3*                slot)
5951 {
5952     return m_impl->signal_connect_run_helper (slot);
5953 }
5954
5955 Connection
5956 InfoManager::signal_connect_launch_option_application (InfoManagerSlotBoolString*                slot)
5957 {
5958     return m_impl->signal_connect_launch_option_application (slot);
5959 }
5960
5961 Connection
5962 InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect*             slot)
5963 {
5964     return m_impl->signal_connect_get_recent_ise_geometry (slot);
5965 }
5966
5967 Connection
5968 InfoManager::signal_connect_check_privilege_by_sockfd  (InfoManagerSlotIntString2* slot)
5969 {
5970     return m_impl->signal_connect_check_privilege_by_sockfd (slot);
5971 }
5972
5973 Connection
5974 InfoManager::signal_connect_remoteinput_send_input_message  (InfoManagerSlotStringBool*          slot)
5975 {
5976     return m_impl->signal_connect_remoteinput_send_input_message (slot);
5977 }
5978
5979 Connection
5980 InfoManager::signal_connect_remoteinput_send_surrounding_text  (InfoManagerSlotIntString*                slot)
5981 {
5982     return m_impl->signal_connect_remoteinput_send_surrounding_text (slot);
5983 }
5984
5985 } /* namespace scim */
5986
5987 /*
5988 vi:ts=4:nowrap:ai:expandtab
5989 */