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