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