Added interface for restoring ISE option window
[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 (client_info.type == FRONTEND_CLIENT) {
3383             m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
3384         }
3385     }
3386     //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
3387     void socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len) {
3388         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3389         LOGD ("");
3390         int     focused_client;
3391         uint32  focused_context;
3392         String  focused_uuid = get_focused_context (focused_client, focused_context);
3393         ClientInfo client_info = socket_get_client_info (focused_client);
3394
3395         if (client_info.type == FRONTEND_CLIENT) {
3396             m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
3397         }
3398     }
3399     //SCIM_TRANS_CMD_GET_SELECTION
3400     void socket_helper_get_selection (int client, String uuid) {
3401         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3402         LOGD ("");
3403         int     focused_client;
3404         uint32  focused_context;
3405         String  focused_uuid = get_focused_context (focused_client, focused_context);
3406         ClientInfo client_info = socket_get_client_info (focused_client);
3407
3408         if (client_info.type == FRONTEND_CLIENT) {
3409             m_panel_agent_manager.socket_helper_get_selection (focused_client, focused_context);
3410         }
3411     }
3412     //SCIM_TRANS_CMD_SET_SELECTION
3413     void socket_helper_set_selection (int client, uint32 start, uint32 end) {
3414         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3415         LOGD ("");
3416         int     focused_client;
3417         uint32  focused_context;
3418         String  focused_uuid = get_focused_context (focused_client, focused_context);
3419         ClientInfo client_info = socket_get_client_info (focused_client);
3420
3421         if (client_info.type == FRONTEND_CLIENT) {
3422             m_panel_agent_manager.socket_helper_set_selection (focused_client, focused_context, start, end);
3423         }
3424     }
3425
3426     //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3427     void socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid) {
3428         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_show_preedit_string (" << client << ")\n";
3429         LOGD ("");
3430         int     target_client;
3431         uint32  target_context;
3432         get_imengine_client_context (target_ic, target_client, target_context);
3433         int     focused_client;
3434         uint32  focused_context;
3435         String  focused_uuid = get_focused_context (focused_client, focused_context);
3436
3437         if (target_ic == (uint32) (-1)) {
3438             target_client  = focused_client;
3439             target_context = focused_context;
3440         }
3441
3442         if (target_uuid.length () == 0)
3443             target_uuid = focused_uuid;
3444
3445         if (target_client  == focused_client &&
3446             target_context == focused_context &&
3447             target_uuid    == focused_uuid) {
3448             ClientInfo client_info = socket_get_client_info (target_client);
3449
3450             if (client_info.type == FRONTEND_CLIENT) {
3451                 m_panel_agent_manager.show_preedit_string (target_client, target_context);
3452             }
3453         }
3454     }
3455     //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3456     void socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid) {
3457         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_hide_preedit_string (" << client << ")\n";
3458         LOGD ("");
3459         int     target_client;
3460         uint32  target_context;
3461         get_imengine_client_context (target_ic, target_client, target_context);
3462         int     focused_client;
3463         uint32  focused_context;
3464         String  focused_uuid = get_focused_context (focused_client, focused_context);
3465
3466         if (target_ic == (uint32) (-1)) {
3467             target_client  = focused_client;
3468             target_context = focused_context;
3469         }
3470
3471         if (target_uuid.length () == 0)
3472             target_uuid = focused_uuid;
3473
3474         if (target_client  == focused_client &&
3475             target_context == focused_context &&
3476             target_uuid    == focused_uuid) {
3477             ClientInfo client_info = socket_get_client_info (target_client);
3478
3479             if (client_info.type == FRONTEND_CLIENT) {
3480                 m_panel_agent_manager.hide_preedit_string (target_client, target_context);
3481             }
3482         }
3483     }
3484     //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3485     void socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret) {
3486         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_preedit_string (" << client << ")\n";
3487         LOGD ("");
3488         int     target_client;
3489         uint32  target_context;
3490         get_imengine_client_context (target_ic, target_client, target_context);
3491         int     focused_client;
3492         uint32  focused_context;
3493         String  focused_uuid;
3494         focused_uuid = get_focused_context (focused_client, focused_context);
3495
3496         if (target_ic == (uint32) (-1)) {
3497             target_client  = focused_client;
3498             target_context = focused_context;
3499         }
3500
3501         if (target_uuid.length () == 0)
3502             target_uuid = focused_uuid;
3503
3504         if (target_client  == focused_client &&
3505             target_context == focused_context &&
3506             target_uuid    == focused_uuid) {
3507             ClientInfo client_info = socket_get_client_info (target_client);
3508
3509             if (client_info.type == FRONTEND_CLIENT) {
3510                 m_panel_agent_manager.update_preedit_string (target_client, target_context, preedit, commit, attrs, caret);
3511             }
3512         }
3513     }
3514     //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3515     void socket_helper_update_preedit_caret (int client, uint32 caret) {
3516         SCIM_DEBUG_MAIN (4) << __func__ << " (" << client << ")\n";
3517         LOGD ("");
3518         int     focused_client;
3519         uint32  focused_context;
3520         String  focused_uuid;
3521         focused_uuid = get_focused_context (focused_client, focused_context);
3522         ClientInfo client_info = socket_get_client_info (focused_client);
3523
3524         if (client_info.type == FRONTEND_CLIENT) {
3525             m_panel_agent_manager.update_preedit_caret (focused_client, focused_context, caret);
3526         }
3527     }
3528
3529     //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
3530     void socket_helper_register_helper (int client, HelperInfo& info) {
3531         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
3532         bool result = false;
3533         lock ();
3534         LOGD ("");
3535         String language;
3536         int type;
3537         int option;
3538         String module_name;
3539
3540         if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3541             LOGD ("This helper is not IME");
3542             return;
3543         }
3544         info.option = option;
3545
3546         if (info.uuid.length ()) {
3547             SCIM_DEBUG_MAIN (4) << "New Helper uuid=" << info.uuid << " name=" << info.name << "\n";
3548             HelperClientIndex::iterator it = m_helper_client_index.find (info.uuid);
3549
3550             if (it == m_helper_client_index.end ()) {
3551                 m_helper_info_repository [client] = info;
3552                 m_helper_client_index [info.uuid] = HelperClientStub (client, 1);
3553                 StartHelperICIndex::iterator icit = m_start_helper_ic_index.find (info.uuid);
3554
3555                 if (icit != m_start_helper_ic_index.end ()) {
3556                     m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
3557                     m_start_helper_ic_index.erase (icit);
3558                 }
3559
3560                 result = true;
3561             }
3562         }
3563
3564         unlock ();
3565
3566         if (result)
3567             m_signal_register_helper (client, info);
3568     }
3569
3570     //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
3571     void socket_helper_register_helper_passive (int client, HelperInfo& info) {
3572         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper_passive (" << client << ")\n";
3573         LOGD ("");
3574         lock ();
3575         String language;
3576         int type;
3577         int option;
3578         String module_name;
3579
3580         if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3581             LOGD ("This helper is not IME");
3582             return;
3583         }
3584         info.option = option;
3585
3586         if (info.uuid.length ()) {
3587             SCIM_DEBUG_MAIN (4) << "New Helper Passive uuid=" << info.uuid << " name=" << info.name << "\n";
3588             HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3589
3590             if (it == m_helper_active_info_repository.end ()) {
3591                 m_helper_active_info_repository[client] =  info;
3592             }
3593
3594             StringIntRepository::iterator iter = m_ise_pending_repository.find (info.uuid);
3595
3596             if (iter != m_ise_pending_repository.end ()) {
3597                 m_ise_pending_repository.erase (iter);
3598             }
3599
3600             iter = m_ise_pending_repository.find (info.name);
3601
3602             if (iter != m_ise_pending_repository.end ()) {
3603                 m_ise_pending_repository.erase (iter);
3604             }
3605         }
3606
3607         unlock ();
3608     }
3609     //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
3610     void socket_helper_update_input_context (int client, uint32 type, uint32 value) {
3611         SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_input_context (" << client << ")\n";
3612         LOGD ("");
3613         m_signal_update_input_context ((int)type, (int)value);
3614         int    focused_client;
3615         uint32 focused_context;
3616         get_focused_context (focused_client, focused_context);
3617         ClientInfo client_info = socket_get_client_info (focused_client);
3618
3619         if (client_info.type == FRONTEND_CLIENT) {
3620             m_panel_agent_manager.update_ise_input_context (focused_client, focused_context, type, value);
3621         } else {
3622             std::cerr << "focused client is not existed!!!" << "\n";
3623         }
3624     }
3625     //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
3626     void socket_helper_send_private_command (int client, String command) {
3627         SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3628         LOGD ("");
3629         int     focused_client;
3630         uint32  focused_context;
3631         String  focused_uuid = get_focused_context (focused_client, focused_context);
3632         ClientInfo client_info = socket_get_client_info (focused_client);
3633
3634         if (client_info.type == FRONTEND_CLIENT) {
3635             m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
3636         }
3637     }
3638     //ISM_TRANS_CMD_UPDATE_ISE_EXIT
3639     //void UPDATE_ISE_EXIT (int client) {
3640     //    LOGD ("");
3641     //    HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3642
3643     //    if (hiit != m_helper_active_info_repository.end ()) {
3644     //        String l_uuid = hiit->second.uuid;
3645     //        HelperClientIndex::iterator it = m_helper_client_index.find (l_uuid);
3646
3647     //        if (it != m_helper_client_index.end ()) {
3648     //            del_client (it->second.id);
3649     //        }
3650     //    }
3651
3652     //    del_client (client);
3653     //}
3654
3655     void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
3656         LOGD ("");
3657         int     focused_client;
3658         uint32  focused_context;
3659         String  focused_uuid = get_focused_context (focused_client, focused_context);
3660         ClientInfo client_info = socket_get_client_info (focused_client);
3661
3662         if (client_info.type == FRONTEND_CLIENT) {
3663             m_panel_agent_manager.process_key_event_done (focused_client, focused_context, key, ret, serial);
3664         }
3665     }
3666
3667     //ISM_TRANS_CMD_REQUEST_ISE_HIDE
3668     void request_ise_hide () {
3669         LOGD("");
3670         int     focused_client;
3671         uint32  focused_context;
3672         String  focused_uuid = get_focused_context (focused_client, focused_context);
3673         ClientInfo client_info = socket_get_client_info (focused_client);
3674
3675         if (client_info.type == FRONTEND_CLIENT) {
3676             m_panel_agent_manager.request_ise_hide (focused_client, focused_context);
3677         }
3678     }
3679
3680     void socket_reset_helper_input_context (const String& uuid, int client, uint32 context) {
3681         HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3682
3683         if (it != m_helper_client_index.end ()) {
3684             uint32 ctx = get_helper_ic (client, context);
3685             m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
3686         }
3687     }
3688
3689     bool helper_select_aux (uint32 item) {
3690         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_aux \n";
3691
3692         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3693             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3694
3695             if (it != m_helper_client_index.end ()) {
3696                 int    client;
3697                 uint32 context;
3698                 uint32 ctx;
3699                 get_focused_context (client, context);
3700                 ctx = get_helper_ic (client, context);
3701                 m_panel_agent_manager.select_aux (it->second.id, ctx, item);
3702                 return true;
3703             }
3704         }
3705
3706         return false;
3707     }
3708
3709     bool helper_select_candidate (uint32 item) {
3710         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_candidate \n";
3711
3712         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3713             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3714
3715             if (it != m_helper_client_index.end ()) {
3716                 int    client;
3717                 uint32 context;
3718                 uint32 ctx;
3719                 get_focused_context (client, context);
3720                 ctx = get_helper_ic (client, context);
3721                 m_panel_agent_manager.select_candidate (it->second.id, ctx, item);
3722                 return true;
3723             }
3724         }
3725
3726         return false;
3727     }
3728
3729     bool helper_lookup_table_page_up (void) {
3730         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_up \n";
3731
3732         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3733             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3734
3735             if (it != m_helper_client_index.end ()) {
3736                 int    client;
3737                 uint32 context;
3738                 uint32 ctx;
3739                 get_focused_context (client, context);
3740                 ctx = get_helper_ic (client, context);
3741                 m_panel_agent_manager.lookup_table_page_up (it->second.id, ctx);
3742                 return true;
3743             }
3744         }
3745
3746         return false;
3747     }
3748
3749     bool helper_lookup_table_page_down (void) {
3750         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_down \n";
3751
3752         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3753             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3754
3755             if (it != m_helper_client_index.end ()) {
3756                 int    client;
3757                 uint32 context;
3758                 uint32 ctx;
3759                 get_focused_context (client, context);
3760                 ctx = get_helper_ic (client, context);
3761                 m_panel_agent_manager.lookup_table_page_down (it->second.id, ctx);
3762                 return true;
3763             }
3764         }
3765
3766         return false;
3767     }
3768
3769     bool helper_update_lookup_table_page_size (uint32 size) {
3770         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_lookup_table_page_size \n";
3771
3772         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3773             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3774
3775             if (it != m_helper_client_index.end ()) {
3776                 int    client;
3777                 uint32 context;
3778                 uint32 ctx;
3779                 get_focused_context (client, context);
3780                 ctx = get_helper_ic (client, context);
3781                 m_panel_agent_manager.update_lookup_table_page_size (it->second.id, ctx, size);
3782                 return true;
3783             }
3784         }
3785
3786         return false;
3787     }
3788
3789     bool helper_update_candidate_item_layout (const std::vector<uint32>& row_items) {
3790         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3791
3792         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3793             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3794
3795             if (it != m_helper_client_index.end ()) {
3796                 int    client;
3797                 uint32 context;
3798                 uint32 ctx;
3799                 get_focused_context (client, context);
3800                 ctx = get_helper_ic (client, context);
3801                 m_panel_agent_manager.update_candidate_item_layout (it->second.id, ctx, row_items);
3802                 return true;
3803             }
3804         }
3805
3806         return false;
3807     }
3808
3809     bool helper_select_associate (uint32 item) {
3810         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_associate \n";
3811
3812         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3813             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3814
3815             if (it != m_helper_client_index.end ()) {
3816                 int    client;
3817                 uint32 context;
3818                 uint32 ctx;
3819                 get_focused_context (client, context);
3820                 ctx = get_helper_ic (client, context);
3821                 m_panel_agent_manager.select_associate (it->second.id, ctx, item);
3822                 return true;
3823             }
3824         }
3825
3826         return false;
3827     }
3828
3829     bool helper_associate_table_page_up (void) {
3830         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_up \n";
3831
3832         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3833             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3834
3835             if (it != m_helper_client_index.end ()) {
3836                 int    client;
3837                 uint32 context;
3838                 uint32 ctx;
3839                 get_focused_context (client, context);
3840                 ctx = get_helper_ic (client, context);
3841                 m_panel_agent_manager.associate_table_page_up (it->second.id, ctx);
3842                 return true;
3843             }
3844         }
3845
3846         return false;
3847     }
3848
3849     bool helper_associate_table_page_down (void) {
3850         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_down \n";
3851
3852         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3853             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3854
3855             if (it != m_helper_client_index.end ()) {
3856                 int    client;
3857                 uint32 context;
3858                 uint32 ctx;
3859                 get_focused_context (client, context);
3860                 ctx = get_helper_ic (client, context);
3861                 m_panel_agent_manager.associate_table_page_down (it->second.id, ctx);
3862                 return true;
3863             }
3864         }
3865
3866         return false;
3867     }
3868
3869     bool helper_update_associate_table_page_size (uint32         size) {
3870         SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_associate_table_page_size \n";
3871
3872         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3873             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3874
3875             if (it != m_helper_client_index.end ()) {
3876                 int    client;
3877                 uint32 context;
3878                 uint32 ctx;
3879                 get_focused_context (client, context);
3880                 ctx = get_helper_ic (client, context);
3881                 m_panel_agent_manager.update_associate_table_page_size (it->second.id, ctx, size);
3882                 return true;
3883             }
3884         }
3885
3886         return false;
3887     }
3888
3889     bool helper_update_displayed_candidate_number (uint32 size) {
3890         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3891
3892         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3893             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3894
3895             if (it != m_helper_client_index.end ()) {
3896                 int    client;
3897                 uint32 context;
3898                 uint32 ctx;
3899                 get_focused_context (client, context);
3900                 ctx = get_helper_ic (client, context);
3901                 m_panel_agent_manager.update_displayed_candidate_number (it->second.id, ctx, size);
3902                 return true;
3903             }
3904         }
3905
3906         return false;
3907     }
3908
3909     bool helper_longpress_candidate (uint32 index) {
3910         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3911
3912         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3913             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3914
3915             if (it != m_helper_client_index.end ()) {
3916                 int    client;
3917                 uint32 context;
3918                 uint32 ctx;
3919                 get_focused_context (client, context);
3920                 ctx = get_helper_ic (client, context);
3921                 m_panel_agent_manager.send_longpress_event (it->second.id, ctx, index);
3922                 return true;
3923             }
3924         }
3925
3926         std::cerr << __func__ << " is failed!!!\n";
3927         return false;
3928     }
3929
3930     void helper_all_update_spot_location (int x, int y) {
3931         SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_spot_location (" << x << "," << y << ")\n";
3932         HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
3933         int    client;
3934         uint32 context;
3935         String uuid = get_focused_context (client, context);
3936
3937         for (; hiit != m_helper_info_repository.end (); ++ hiit) {
3938             if (hiit->second.option & SCIM_HELPER_NEED_SPOT_LOCATION_INFO) {
3939                 m_panel_agent_manager.helper_all_update_spot_location (hiit->first, get_helper_ic (client, context), uuid, x, y);
3940             }
3941         }
3942     }
3943
3944     void helper_all_update_cursor_position (int cursor_pos) {
3945         SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_cursor_position (" << cursor_pos << ")\n";
3946         HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
3947         int    client;
3948         uint32 context;
3949         String uuid = get_focused_context (client, context);
3950
3951         for (; hiit != m_helper_info_repository.end (); ++ hiit) {
3952             m_panel_agent_manager.helper_all_update_cursor_position (hiit->first, get_helper_ic (client, context), uuid, cursor_pos);
3953         }
3954     }
3955
3956     void helper_all_update_screen (int screen) {
3957         SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_screen (" << screen << ")\n";
3958         HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
3959         int    client;
3960         uint32 context;
3961         String uuid;
3962         uuid = get_focused_context (client, context);
3963
3964         for (; hiit != m_helper_info_repository.end (); ++ hiit) {
3965             if (hiit->second.option & SCIM_HELPER_NEED_SCREEN_INFO) {
3966                 m_panel_agent_manager.helper_all_update_screen (hiit->first, get_helper_ic (client, context), uuid, screen);
3967             }
3968         }
3969     }
3970
3971     bool set_autocapital_type (int mode) {
3972         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3973
3974         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
3975             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3976
3977             if (it != m_helper_client_index.end ()) {
3978                 int    client;
3979                 uint32 context;
3980                 uint32 ctx;
3981                 get_focused_context (client, context);
3982                 ctx = get_helper_ic (client, context);
3983                 m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
3984                 return true;
3985             }
3986         }
3987
3988         std::cerr << __func__ << " is failed!!!\n";
3989         return false;
3990     }
3991
3992     bool set_prediction_allow (int client, int mode) {
3993         SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3994
3995         if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
3996             HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3997
3998             if (it != m_helper_client_index.end ()) {
3999                 int    client;
4000                 uint32 context;
4001                 uint32 ctx;
4002                 get_focused_context (client, context);
4003                 ctx = get_helper_ic (client, context);
4004                 m_panel_agent_manager.set_prediction_allow (it->second.id, ctx, m_current_helper_uuid, mode);
4005                 return true;
4006             }
4007         }
4008
4009         std::cerr << __func__ << " is failed!!!\n";
4010         return false;
4011     }
4012
4013     const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
4014         if (m_current_socket_client >= 0) {
4015             client  = m_current_socket_client;
4016             context = m_current_client_context;
4017             return m_current_context_uuid;
4018         } else {
4019             client  = m_last_socket_client;
4020             context = m_last_client_context;
4021             return m_last_context_uuid;
4022         }
4023     }
4024
4025 private:
4026     void socket_transaction_start (void) {
4027         m_signal_transaction_start ();
4028     }
4029
4030     void socket_transaction_end (void) {
4031         m_signal_transaction_end ();
4032     }
4033
4034     void lock (void) {
4035         m_signal_lock ();
4036     }
4037     void unlock (void) {
4038         m_signal_unlock ();
4039     }
4040 };
4041
4042 InfoManager::InfoManager ()
4043     : m_impl (new InfoManagerImpl ())
4044 {
4045 }
4046
4047 InfoManager::~InfoManager ()
4048 {
4049     delete m_impl;
4050 }
4051
4052 bool
4053 InfoManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
4054 {
4055     return m_impl->initialize (info_manager, config, display, resident);
4056 }
4057
4058 bool
4059 InfoManager::valid (void) const
4060 {
4061     return m_impl->valid ();
4062 }
4063
4064 void
4065 InfoManager::stop (void)
4066 {
4067     if (m_impl != NULL)
4068         m_impl->stop ();
4069 }
4070
4071 const ClientInfo&
4072 InfoManager::socket_get_client_info (int client) const
4073 {
4074     return m_impl->socket_get_client_info (client);
4075 }
4076
4077 void InfoManager::hide_helper (const String& uuid)
4078 {
4079     m_impl->hide_helper (uuid);
4080 }
4081 TOOLBAR_MODE_T
4082 InfoManager::get_current_toolbar_mode () const
4083 {
4084     return m_impl->get_current_toolbar_mode ();
4085 }
4086
4087 void
4088 InfoManager::get_current_ise_geometry (rectinfo& rect)
4089 {
4090     m_impl->get_current_ise_geometry (rect);
4091 }
4092
4093 String
4094 InfoManager::get_current_helper_uuid () const
4095 {
4096     return m_impl->get_current_helper_uuid ();
4097 }
4098
4099 String
4100 InfoManager::get_current_ise_name () const
4101 {
4102     return m_impl->get_current_ise_name ();
4103 }
4104
4105 void
4106 InfoManager::set_current_toolbar_mode (TOOLBAR_MODE_T mode)
4107 {
4108     m_impl->set_current_toolbar_mode (mode);
4109 }
4110
4111 void
4112 InfoManager::set_current_ise_name (String& name)
4113 {
4114     m_impl->set_current_ise_name (name);
4115 }
4116
4117 void
4118 InfoManager::set_current_helper_option (uint32 option)
4119 {
4120     m_impl->set_current_helper_option (option);
4121 }
4122
4123 void
4124 InfoManager::update_candidate_panel_event (uint32 nType, uint32 nValue)
4125 {
4126     m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL, nType, nValue);
4127 }
4128
4129 void
4130 InfoManager::update_input_panel_event (uint32 nType, uint32 nValue)
4131 {
4132     m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT, nType, nValue);
4133 }
4134
4135 bool
4136 InfoManager::move_preedit_caret (uint32         position)
4137 {
4138     return m_impl->move_preedit_caret (position);
4139 }
4140
4141 //useless
4142 #if 0
4143 bool
4144 InfoManager::request_help (void)
4145 {
4146     return m_impl->request_help ();
4147 }
4148
4149 bool
4150 InfoManager::request_factory_menu (void)
4151 {
4152     return m_impl->request_factory_menu ();
4153 }
4154 #endif
4155
4156 bool
4157 InfoManager::change_factory (const String&  uuid)
4158 {
4159     return m_impl->change_factory (uuid);
4160 }
4161
4162 bool
4163 InfoManager::helper_candidate_show (void)
4164 {
4165     return m_impl->helper_candidate_show ();
4166 }
4167
4168 bool
4169 InfoManager::helper_candidate_hide (void)
4170 {
4171     return m_impl->helper_candidate_hide ();
4172 }
4173
4174 bool
4175 InfoManager::candidate_more_window_show (void)
4176 {
4177     return m_impl->candidate_more_window_show ();
4178 }
4179
4180 bool
4181 InfoManager::candidate_more_window_hide (void)
4182 {
4183     return m_impl->candidate_more_window_hide ();
4184 }
4185
4186 bool
4187 InfoManager::update_helper_lookup_table (const LookupTable& table)
4188 {
4189     return m_impl->update_helper_lookup_table (table);
4190 }
4191
4192 bool
4193 InfoManager::select_aux (uint32         item)
4194 {
4195     return m_impl->select_aux (item);
4196 }
4197
4198 bool
4199 InfoManager::select_candidate (uint32         item)
4200 {
4201     return m_impl->select_candidate (item);
4202 }
4203
4204 bool
4205 InfoManager::lookup_table_page_up (void)
4206 {
4207     return m_impl->lookup_table_page_up ();
4208 }
4209
4210 bool
4211 InfoManager::lookup_table_page_down (void)
4212 {
4213     return m_impl->lookup_table_page_down ();
4214 }
4215
4216 bool
4217 InfoManager::update_lookup_table_page_size (uint32         size)
4218 {
4219     return m_impl->update_lookup_table_page_size (size);
4220 }
4221
4222 bool
4223 InfoManager::update_candidate_item_layout (const std::vector<uint32>& row_items)
4224 {
4225     return m_impl->update_candidate_item_layout (row_items);
4226 }
4227
4228 bool
4229 InfoManager::select_associate (uint32         item)
4230 {
4231     return m_impl->select_associate (item);
4232 }
4233
4234 bool
4235 InfoManager::associate_table_page_up (void)
4236 {
4237     return m_impl->associate_table_page_up ();
4238 }
4239
4240 bool
4241 InfoManager::associate_table_page_down (void)
4242 {
4243     return m_impl->associate_table_page_down ();
4244 }
4245
4246 bool
4247 InfoManager::update_associate_table_page_size (uint32         size)
4248 {
4249     return m_impl->update_associate_table_page_size (size);
4250 }
4251
4252 bool
4253 InfoManager::update_displayed_candidate_number (uint32        size)
4254 {
4255     return m_impl->update_displayed_candidate_number (size);
4256 }
4257
4258 void
4259 InfoManager::send_longpress_event (int type, int index)
4260 {
4261     m_impl->send_longpress_event (type, index);
4262 }
4263
4264 bool
4265 InfoManager::trigger_property (const String&  property)
4266 {
4267     return m_impl->trigger_property (property);
4268 }
4269
4270 bool
4271 InfoManager::start_helper (const String&  uuid)
4272 {
4273     return m_impl->start_helper (uuid, -2, 0);
4274 }
4275
4276 bool
4277 InfoManager::stop_helper (const String&  uuid)
4278 {
4279     return m_impl->stop_helper (uuid, -2, 0);
4280 }
4281
4282 void
4283 InfoManager::set_default_ise (const DEFAULT_ISE_T&  ise)
4284 {
4285     m_impl->set_default_ise (ise);
4286 }
4287
4288 void
4289 InfoManager::set_should_shared_ise (const bool should_shared_ise)
4290 {
4291     m_impl->set_should_shared_ise (should_shared_ise);
4292 }
4293
4294 //void
4295 //InfoManager::reload_config                  (void)
4296 //{
4297 //    m_impl->reload_config ();
4298 //}
4299
4300 bool
4301 InfoManager::exit (void)
4302 {
4303     return m_impl->exit ();
4304 }
4305 void
4306 InfoManager::update_ise_list (std::vector<String>& strList)
4307 {
4308     m_impl->update_ise_list (strList);
4309 }
4310
4311 bool
4312 InfoManager::remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
4313 {
4314     return m_impl->remoteinput_update_preedit_string (str, attrs, caret);
4315 }
4316
4317 bool
4318 InfoManager::remoteinput_commit_string (const WideString &str)
4319 {
4320     return m_impl->remoteinput_commit_string (str);
4321 }
4322
4323 bool
4324 InfoManager::remoteinput_send_key_event (const KeyEvent &key)
4325 {
4326     return m_impl->remoteinput_send_key_event (key);
4327 }
4328
4329 bool
4330 InfoManager::remoteinput_forward_key_event (const KeyEvent &key)
4331 {
4332     return m_impl->remoteinput_forward_key_event (key);
4333 }
4334
4335 bool
4336 InfoManager::remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
4337 {
4338     return m_impl->remoteinput_delete_surrounding_text (offset, len);
4339 }
4340
4341 /////////////////////////////////Message function begin/////////////////////////////////////////
4342
4343 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
4344 bool InfoManager:: reset_keyboard_ise (void)
4345 {
4346     return m_impl->reset_keyboard_ise ();
4347 }
4348
4349 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
4350 void InfoManager::show_isf_panel (int client_id)
4351 {
4352     m_impl->show_isf_panel (client_id);
4353 }
4354
4355 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
4356 void InfoManager::hide_isf_panel (int client_id)
4357 {
4358     m_impl->hide_isf_panel (client_id);
4359 }
4360
4361 //ISM_TRANS_CMD_SHOW_ISE_PANEL
4362 void InfoManager::show_ise_panel (int client_id, uint32 client, uint32 context, char*   data, size_t  len)
4363 {
4364     m_impl->show_ise_panel (client_id, client, context, data, len);
4365 }
4366
4367 //ISM_TRANS_CMD_HIDE_ISE_PANEL
4368 void InfoManager::hide_ise_panel (int client_id, uint32 client, uint32 context)
4369 {
4370     m_impl->hide_ise_panel (client_id, client, context);
4371 }
4372
4373 //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control
4374 void InfoManager::hide_helper_ise (void)
4375 {
4376     m_impl->hide_helper_ise ();
4377 }
4378
4379 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4380 bool InfoManager::process_key_event (KeyEvent& key, uint32 serial)
4381 {
4382     return m_impl->process_key_event (key, serial);
4383 }
4384
4385 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
4386 void InfoManager::get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info)
4387 {
4388     m_impl->get_input_panel_geometry (client_id, info);
4389 }
4390
4391 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4392 void InfoManager::get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info)
4393 {
4394     m_impl->get_candidate_window_geometry (client_id, info);
4395 }
4396
4397
4398 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
4399 void InfoManager::get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len)
4400 {
4401     m_impl->get_ise_language_locale (client_id, data, len);
4402 }
4403
4404 //ISM_TRANS_CMD_SET_LAYOUT
4405 void InfoManager::set_ise_layout (int client_id, uint32 layout)
4406 {
4407     m_impl->set_ise_layout (client_id, layout);
4408 }
4409
4410 //ISM_TRANS_CMD_SET_INPUT_MODE
4411 void InfoManager::set_ise_input_mode (int client_id, uint32 input_mode)
4412 {
4413     m_impl->set_ise_input_mode (client_id, input_mode);
4414 }
4415
4416 //ISM_TRANS_CMD_SET_INPUT_HINT
4417 void InfoManager::set_ise_input_hint (int client_id, uint32 input_hint)
4418 {
4419     m_impl->set_ise_input_hint (client_id, input_hint);
4420 }
4421
4422 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
4423 void InfoManager::update_ise_bidi_direction (int client_id, uint32 bidi_direction)
4424 {
4425     m_impl->update_ise_bidi_direction (client_id, bidi_direction);
4426 }
4427
4428
4429 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
4430 void InfoManager::set_ise_language (int client_id, uint32 language)
4431 {
4432     m_impl->set_ise_language (client_id, language);
4433 }
4434
4435 //ISM_TRANS_CMD_SET_ISE_IMDATA
4436 void InfoManager::set_ise_imdata (int client_id, const char*   imdata, size_t  len)
4437 {
4438     m_impl->set_ise_imdata (client_id, imdata, len);
4439 }
4440
4441 //ISM_TRANS_CMD_GET_ISE_IMDATA
4442 bool InfoManager:: get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len)
4443 {
4444     return m_impl->get_ise_imdata (client_id, imdata, len);
4445 }
4446
4447 //ISM_TRANS_CMD_GET_LAYOUT
4448 bool InfoManager:: get_ise_layout (int client_id, _OUT_ uint32& layout)
4449 {
4450     return m_impl->get_ise_layout (client_id, layout);
4451 }
4452
4453 //ISM_TRANS_CMD_GET_ISE_STATE
4454 void InfoManager::get_ise_state (int client_id, _OUT_ int& state)
4455 {
4456     m_impl->get_ise_state (client_id, state);
4457 }
4458
4459 //ISM_TRANS_CMD_GET_ACTIVE_ISE
4460 void InfoManager::get_active_ise (int client_id, _OUT_ String& default_uuid)
4461 {
4462     m_impl->get_active_ise (client_id, default_uuid);
4463 }
4464
4465 //ISM_TRANS_CMD_GET_ISE_LIST
4466 void InfoManager::get_ise_list (int client_id, _OUT_ std::vector<String>& strlist)
4467 {
4468     m_impl->get_ise_list (client_id, strlist);
4469 }
4470
4471
4472 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
4473 void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
4474 {
4475     m_impl->get_all_helper_ise_info (client_id, info);
4476 }
4477
4478 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
4479 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4480 void InfoManager::set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled)
4481 {
4482     m_impl->set_enable_helper_ise_info (client_id, appid, is_enabled);
4483 }
4484
4485 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
4486 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4487 void InfoManager::show_helper_ise_list (int client_id)
4488 {
4489     m_impl->show_helper_ise_list (client_id);
4490 }
4491
4492
4493 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
4494 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4495 void InfoManager::show_helper_ise_selector (int client_id)
4496 {
4497     m_impl->show_helper_ise_selector (client_id);
4498 }
4499
4500 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
4501 //reply
4502 void InfoManager::is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled)
4503 {
4504     m_impl->is_helper_ise_enabled (client_id, strAppid, nEnabled);
4505 }
4506
4507 //ISM_TRANS_CMD_GET_ISE_INFORMATION
4508 void InfoManager::get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
4509                                        _OUT_ int& nType,   _OUT_ int& nOption, _OUT_ String& strModuleName)
4510 {
4511     m_impl->get_ise_information (client_id, strUuid, strName, strLanguage, nType, nOption, strModuleName);
4512 }
4513
4514 //ISM_TRANS_CMD_RESET_ISE_OPTION
4515 //reply SCIM_TRANS_CMD_OK
4516 bool InfoManager:: reset_ise_option (int client_id)
4517 {
4518     return m_impl->reset_ise_option (client_id);
4519 }
4520
4521 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
4522 //reply
4523 bool InfoManager:: set_active_ise_by_uuid (int client_id, char*  buf, size_t  len)
4524 {
4525     return m_impl->set_active_ise_by_uuid (client_id, buf, len);
4526 }
4527
4528 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
4529 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4530 void InfoManager::set_initial_ise_by_uuid (int client_id, char*  buf, size_t  len)
4531 {
4532     m_impl->set_initial_ise_by_uuid (client_id, buf, len);
4533 }
4534
4535 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
4536 void InfoManager::set_ise_return_key_type (int client_id, uint32 type)
4537 {
4538     m_impl->set_ise_return_key_type (client_id, type);
4539 }
4540
4541 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
4542 //reply
4543 bool InfoManager:: get_ise_return_key_type (int client_id, _OUT_ uint32& type)
4544 {
4545     return m_impl->get_ise_return_key_type (client_id, type);
4546 }
4547
4548
4549 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
4550 void InfoManager::set_ise_return_key_disable (int client_id, uint32 disabled)
4551 {
4552     m_impl->set_ise_return_key_disable (client_id, disabled);
4553 }
4554
4555 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
4556 void InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
4557 {
4558     m_impl->get_ise_return_key_disable (client_id, disabled);
4559 }
4560
4561 //ISM_TRANS_CMD_SET_CAPS_MODE
4562 void InfoManager::set_ise_caps_mode (int client_id, uint32 mode)
4563 {
4564     m_impl->set_ise_caps_mode (client_id, mode);
4565 }
4566
4567 //SCIM_TRANS_CMD_RELOAD_CONFIG
4568 void InfoManager::reload_config (void)
4569 {
4570     m_impl->reload_config ();
4571 }
4572
4573 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
4574 void InfoManager::will_show_ack (int client_id)
4575 {
4576     m_impl->will_show_ack (client_id);
4577 }
4578
4579 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
4580 void InfoManager::will_hide_ack (int client_id)
4581 {
4582     m_impl->will_hide_ack (client_id);
4583 }
4584
4585 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
4586 void InfoManager::reset_default_ise (int client_id)
4587 {
4588     m_impl->reset_default_ise (client_id);
4589 }
4590
4591 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
4592 void InfoManager::set_keyboard_mode (int client_id, uint32 mode)
4593 {
4594     m_impl->set_keyboard_mode (client_id, mode);
4595 }
4596
4597 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
4598 void InfoManager::candidate_will_hide_ack (int client_id)
4599 {
4600     m_impl->candidate_will_hide_ack (client_id);
4601 }
4602
4603 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
4604 void InfoManager::get_active_helper_option (int client_id, _OUT_ uint32& option)
4605 {
4606     m_impl->get_active_helper_option (client_id, option);
4607 }
4608
4609 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
4610 void InfoManager::show_ise_option_window (int client_id)
4611 {
4612     m_impl->show_ise_option_window (client_id);
4613 }
4614
4615 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
4616 void InfoManager::resume_ise_option_window (int client_id)
4617 {
4618     m_impl->resume_ise_option_window (client_id);
4619 }
4620
4621 //ISM_TRANS_CMD_EXPAND_CANDIDATE
4622 void InfoManager::expand_candidate ()
4623 {
4624     m_impl->expand_candidate ();
4625 }
4626
4627 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
4628 void InfoManager::contract_candidate ()
4629 {
4630     m_impl->contract_candidate ();
4631 }
4632
4633 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
4634 void InfoManager::get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info)
4635 {
4636     m_impl->get_recent_ise_geometry (client_id, angle, info);
4637 }
4638
4639 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
4640 bool InfoManager::remoteinput_send_input_message (int client_id, char* buf, size_t len)
4641 {
4642     return m_impl->send_remote_input_message (client_id, buf, len);
4643 }
4644
4645 void InfoManager::remoteinput_send_surrounding_text (const char* text, uint32 cursor)
4646 {
4647     return m_impl->send_remote_surrounding_text (text, cursor);
4648 }
4649
4650 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
4651 void InfoManager::register_panel_client (uint32 client_id, uint32 id)
4652 {
4653     m_impl->register_panel_client (client_id, id);
4654 }
4655
4656 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
4657 void InfoManager::register_input_context (uint32 client_id, uint32 context, String  uuid)
4658 {
4659     m_impl->register_input_context (client_id, context, uuid);
4660 }
4661
4662 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
4663 void InfoManager::remove_input_context (uint32 client_id, uint32 context)
4664 {
4665     m_impl->remove_input_context (client_id, context);
4666 }
4667
4668 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
4669 void InfoManager::socket_reset_input_context (int client_id, uint32 context)
4670 {
4671     m_impl->socket_reset_input_context (client_id, context);
4672 }
4673
4674 //SCIM_TRANS_CMD_FOCUS_IN
4675 void InfoManager::focus_in (int client_id, uint32 context,  String  uuid)
4676 {
4677     m_impl->focus_in (client_id, context, uuid);
4678 }
4679
4680 //SCIM_TRANS_CMD_FOCUS_OUT
4681 void InfoManager::focus_out (int client_id, uint32 context)
4682 {
4683     m_impl->focus_out (client_id, context);
4684 }
4685
4686 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
4687 bool InfoManager::process_input_device_event(int client, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
4688 {
4689     return m_impl->process_input_device_event(client, type, data, len, result);
4690 }
4691
4692 //ISM_TRANS_CMD_TURN_ON_LOG
4693 void InfoManager::socket_turn_on_log (uint32 isOn)
4694 {
4695     m_impl->socket_turn_on_log (isOn);
4696 }
4697
4698 //SCIM_TRANS_CMD_PANEL_TURN_ON
4699 void InfoManager::socket_turn_on (void)
4700 {
4701     m_impl->socket_turn_on ();
4702 }
4703
4704 //SCIM_TRANS_CMD_PANEL_TURN_OFF
4705 void InfoManager::socket_turn_off (void)
4706 {
4707     m_impl->socket_turn_off ();
4708 }
4709
4710 //SCIM_TRANS_CMD_UPDATE_SCREEN
4711 void InfoManager::socket_update_screen (int client_id, uint32 num)
4712 {
4713     m_impl->socket_update_screen (client_id, num);
4714 }
4715
4716 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
4717 void InfoManager::socket_update_spot_location (uint32 x, uint32 y, uint32 top_y)
4718 {
4719     m_impl->socket_update_spot_location (x, y, top_y);
4720 }
4721
4722 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
4723 void InfoManager::socket_update_cursor_position (uint32 cursor_pos)
4724 {
4725     m_impl->socket_update_cursor_position (cursor_pos);
4726 }
4727
4728 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
4729 void InfoManager::socket_update_surrounding_text (String text, uint32 cursor)
4730 {
4731     m_impl->socket_update_surrounding_text (text, cursor);
4732 }
4733
4734 void InfoManager::remoteinput_callback_focus_in (void)
4735 {
4736     m_impl->remoteinput_callback_focus_in ();
4737 }
4738
4739 void InfoManager::remoteinput_callback_focus_out (void)
4740 {
4741     m_impl->remoteinput_callback_focus_out ();
4742 }
4743
4744 void InfoManager::remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled)
4745 {
4746     m_impl->remoteinput_callback_entry_metadata (hint, layout, variation, autocapital_type, return_key_disabled);
4747 }
4748
4749 void InfoManager::remoteinput_callback_surrounding_text (String text, uint32 cursor)
4750 {
4751     m_impl->remoteinput_callback_surrounding_text (text, cursor);
4752 }
4753
4754 void InfoManager::remoteinput_callback_input_resource (uint32 input_resource)
4755 {
4756     m_impl->remoteinput_callback_input_resource (input_resource);
4757 }
4758
4759 //ISM_TRANS_CMD_UPDATE_SELECTION
4760 void InfoManager::socket_update_selection (String text)
4761 {
4762     m_impl->socket_update_selection (text);
4763 }
4764
4765 //FIXME: useless anymore
4766 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
4767 void InfoManager::socket_update_factory_info (PanelFactoryInfo& info)
4768 {
4769     m_impl->socket_update_factory_info (info);
4770 }
4771
4772 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
4773 void InfoManager::socket_show_help (String help)
4774 {
4775     m_impl->socket_show_help (help);
4776 }
4777
4778 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
4779 void InfoManager::socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec)
4780 {
4781     m_impl->socket_show_factory_menu (vec);
4782 }
4783
4784 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
4785 void InfoManager::socket_show_preedit_string (void)
4786 {
4787     m_impl->socket_show_preedit_string ();
4788 }
4789
4790 //SCIM_TRANS_CMD_SHOW_AUX_STRING
4791 void InfoManager::socket_show_aux_string (void)
4792 {
4793     m_impl->socket_show_aux_string ();
4794 }
4795
4796 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
4797 void InfoManager::socket_show_lookup_table (void)
4798 {
4799     m_impl->socket_show_lookup_table ();
4800 }
4801
4802 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
4803 void InfoManager::socket_show_associate_table (void)
4804 {
4805     m_impl->socket_show_associate_table ();
4806 }
4807
4808 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
4809 void InfoManager::socket_hide_preedit_string (void)
4810 {
4811     m_impl->socket_hide_preedit_string ();
4812 }
4813
4814 //SCIM_TRANS_CMD_HIDE_AUX_STRING
4815 void InfoManager::socket_hide_aux_string (void)
4816 {
4817     m_impl->socket_hide_aux_string ();
4818 }
4819
4820 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
4821 void InfoManager::socket_hide_lookup_table (void)
4822 {
4823     m_impl->socket_hide_lookup_table ();
4824 }
4825
4826 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
4827 void InfoManager::socket_hide_associate_table (void)
4828 {
4829     m_impl->socket_hide_associate_table ();
4830 }
4831
4832 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
4833 void InfoManager::socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret)
4834 {
4835     m_impl->socket_update_preedit_string (str, attrs, caret);
4836 }
4837
4838 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
4839 void InfoManager::socket_update_preedit_caret (uint32 caret)
4840 {
4841     m_impl->socket_update_preedit_caret (caret);
4842 }
4843
4844 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
4845 void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
4846 {
4847     m_impl->socket_update_aux_string (str, attrs);
4848 }
4849
4850 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
4851 void InfoManager::socket_update_lookup_table (const LookupTable& table)
4852 {
4853     m_impl->socket_update_lookup_table (table);
4854 }
4855
4856 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
4857 void InfoManager::socket_update_associate_table (const LookupTable& table)
4858 {
4859     m_impl->socket_update_associate_table (table);
4860 }
4861
4862 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
4863 void InfoManager::socket_register_properties (const PropertyList& properties)
4864 {
4865     m_impl->socket_register_properties (properties);
4866 }
4867
4868 //SCIM_TRANS_CMD_UPDATE_PROPERTY
4869 void InfoManager::socket_update_property (const Property& property)
4870 {
4871     m_impl->socket_update_property (property);
4872 }
4873
4874 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
4875 void InfoManager::socket_get_keyboard_ise_list (String& uuid)
4876 {
4877     m_impl->socket_get_keyboard_ise_list (uuid);
4878 }
4879
4880 //ISM_TRANS_CMD_SET_CANDIDATE_UI
4881 void InfoManager::socket_set_candidate_ui (uint32 portrait_line, uint32 mode)
4882 {
4883     m_impl->socket_set_candidate_ui (portrait_line, mode);
4884 }
4885
4886 //ISM_TRANS_CMD_GET_CANDIDATE_UI
4887 void InfoManager::socket_get_candidate_ui (String uuid)
4888 {
4889     m_impl->socket_get_candidate_ui (uuid);
4890 }
4891
4892 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
4893 void InfoManager::socket_set_candidate_position (uint32 left, uint32 top)
4894 {
4895     m_impl->socket_set_candidate_position (left, top);
4896 }
4897
4898 //ISM_TRANS_CMD_HIDE_CANDIDATE
4899 void InfoManager::socket_hide_candidate (void)
4900 {
4901     m_impl->socket_hide_candidate ();
4902 }
4903
4904 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4905 void InfoManager::socket_get_candidate_geometry (String& uuid)
4906 {
4907     m_impl->socket_get_candidate_geometry (uuid);
4908 }
4909
4910 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
4911 void InfoManager::socket_set_keyboard_ise (String uuid)
4912 {
4913     m_impl->socket_set_keyboard_ise (uuid);
4914 }
4915
4916 //ISM_TRANS_CMD_SELECT_CANDIDATE
4917 void InfoManager::socket_helper_select_candidate (uint32 index)
4918 {
4919     m_impl->socket_helper_select_candidate (index);
4920 }
4921
4922 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
4923 void InfoManager::socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height)
4924 {
4925     m_impl->socket_helper_update_ise_geometry (client, x, y, width, height);
4926 }
4927
4928 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
4929 void InfoManager::socket_get_keyboard_ise (String uuid)
4930 {
4931     m_impl->socket_get_keyboard_ise (uuid);
4932 }
4933
4934 //SCIM_TRANS_CMD_START_HELPER
4935 void InfoManager::socket_start_helper (int client_id, uint32 context, String uuid)
4936 {
4937     m_impl->socket_start_helper (client_id, context, uuid);
4938 }
4939
4940 //SCIM_TRANS_CMD_STOP_HELPER
4941 void InfoManager::socket_stop_helper (int client_id, uint32 context, String uuid)
4942 {
4943     m_impl->socket_stop_helper (client_id, context, uuid);
4944 }
4945
4946 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
4947 void InfoManager::socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans)
4948 {
4949     m_impl->socket_send_helper_event (client_id, context, uuid, _nest_trans);
4950 }
4951
4952 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
4953 void InfoManager::socket_helper_register_properties (int client, PropertyList& properties)
4954 {
4955     m_impl->socket_helper_register_properties (client, properties);
4956 }
4957
4958 //SCIM_TRANS_CMD_UPDATE_PROPERTY
4959 void InfoManager::socket_helper_update_property (int client, Property& property)
4960 {
4961     m_impl->socket_helper_update_property (client, property);
4962 }
4963
4964 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
4965 void InfoManager::socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans)
4966 {
4967     m_impl->socket_helper_send_imengine_event (client, target_ic, target_uuid, nest_trans);
4968 }
4969
4970 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4971 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
4972 void InfoManager::socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
4973 {
4974     m_impl->socket_helper_send_key_event (client, target_ic, target_uuid, key);
4975 }
4976
4977 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
4978 void InfoManager::socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
4979 {
4980     m_impl->socket_helper_forward_key_event (client, target_ic, target_uuid, key);
4981 }
4982
4983 //SCIM_TRANS_CMD_COMMIT_STRING
4984 void InfoManager::socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr)
4985 {
4986     m_impl->socket_helper_commit_string (client, target_ic, target_uuid, wstr);
4987 }
4988
4989 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
4990 void InfoManager::socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after)
4991 {
4992     m_impl->socket_helper_get_surrounding_text (client, uuid, maxlen_before, maxlen_after);
4993 }
4994
4995 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
4996 void InfoManager::socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len)
4997 {
4998     m_impl->socket_helper_delete_surrounding_text (client, offset, len);
4999 }
5000
5001 //SCIM_TRANS_CMD_GET_SELECTION
5002 void InfoManager::socket_helper_get_selection (int client, String uuid)
5003 {
5004     m_impl->socket_helper_get_selection (client, uuid);
5005 }
5006
5007 //SCIM_TRANS_CMD_SET_SELECTION
5008 void InfoManager::socket_helper_set_selection (int client, uint32 start, uint32 end)
5009 {
5010     m_impl->socket_helper_set_selection (client, start, end);
5011 }
5012
5013 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5014 void InfoManager::socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid)
5015 {
5016     m_impl->socket_helper_show_preedit_string (client, target_ic, target_uuid);
5017 }
5018
5019 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5020 void InfoManager::socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid)
5021 {
5022     m_impl->socket_helper_hide_preedit_string (client, target_ic, target_uuid);
5023 }
5024
5025 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5026 void InfoManager::socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit,
5027         WideString commit, AttributeList& attrs, uint32 caret)
5028 {
5029     m_impl->socket_helper_update_preedit_string (client, target_ic, target_uuid, preedit, commit, attrs, caret);
5030 }
5031
5032 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5033 void InfoManager::socket_helper_update_preedit_caret (int client, uint32 caret)
5034 {
5035     m_impl->socket_helper_update_preedit_caret (client, caret);
5036 }
5037
5038 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
5039 void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
5040 {
5041     m_impl->socket_helper_register_helper (client, info);
5042 }
5043
5044 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
5045 void InfoManager::socket_helper_register_helper_passive (int client, HelperInfo& info)
5046 {
5047     m_impl->socket_helper_register_helper_passive (client, info);
5048 }
5049
5050 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
5051 void InfoManager::socket_helper_update_input_context (int client, uint32 type, uint32 value)
5052 {
5053     m_impl->socket_helper_update_input_context (client, type, value);
5054 }
5055
5056 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
5057 void InfoManager::socket_helper_send_private_command (int client, String command)
5058 {
5059     m_impl->socket_helper_send_private_command (client, command);
5060 }
5061
5062 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
5063 //void InfoManager::UPDATE_ISE_EXIT (int client)
5064 //{
5065 //    m_impl->UPDATE_ISE_EXIT (client);
5066 //}
5067
5068 //ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE
5069 void InfoManager::process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial)
5070 {
5071     m_impl->process_key_event_done (key, ret, serial);
5072 }
5073
5074 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
5075 void InfoManager::request_ise_hide ()
5076 {
5077     m_impl->request_ise_hide ();
5078 }
5079
5080 bool InfoManager::check_privilege_by_sockfd (int client_id, const String& privilege) {
5081     return m_impl->check_privilege_by_sockfd (client_id, privilege);
5082 }
5083
5084 void InfoManager::add_client (int client_id, uint32 key, ClientType type)
5085 {
5086     m_impl->add_client (client_id, key, type);
5087 }
5088
5089 void InfoManager::del_client (int client_id)
5090 {
5091     m_impl->del_client (client_id);
5092 }
5093
5094 bool InfoManager::set_autocapital_type (int mode)
5095 {
5096     return m_impl->set_autocapital_type (mode);
5097 }
5098
5099 void InfoManager::set_prediction_allow (int client, bool mode)
5100 {
5101     m_impl->set_prediction_allow (client, mode);
5102 }
5103
5104
5105 //////////////////////////////////Message function end/////////////////////////////////////////
5106
5107 Connection
5108 InfoManager::signal_connect_turn_on (InfoManagerSlotVoid*                slot)
5109 {
5110     return m_impl->signal_connect_turn_on (slot);
5111 }
5112
5113 Connection
5114 InfoManager::signal_connect_turn_off (InfoManagerSlotVoid*                slot)
5115 {
5116     return m_impl->signal_connect_turn_off (slot);
5117 }
5118
5119 Connection
5120 InfoManager::signal_connect_show_panel (InfoManagerSlotVoid*                slot)
5121 {
5122     return m_impl->signal_connect_show_panel (slot);
5123 }
5124
5125 Connection
5126 InfoManager::signal_connect_hide_panel (InfoManagerSlotVoid*                slot)
5127 {
5128     return m_impl->signal_connect_hide_panel (slot);
5129 }
5130
5131 Connection
5132 InfoManager::signal_connect_update_screen (InfoManagerSlotInt*                 slot)
5133 {
5134     return m_impl->signal_connect_update_screen (slot);
5135 }
5136
5137 Connection
5138 InfoManager::signal_connect_update_spot_location (InfoManagerSlotIntIntInt*           slot)
5139 {
5140     return m_impl->signal_connect_update_spot_location (slot);
5141 }
5142
5143 Connection
5144 InfoManager::signal_connect_update_factory_info (InfoManagerSlotFactoryInfo*         slot)
5145 {
5146     return m_impl->signal_connect_update_factory_info (slot);
5147 }
5148
5149 Connection
5150 InfoManager::signal_connect_start_default_ise (InfoManagerSlotVoid*                slot)
5151 {
5152     return m_impl->signal_connect_start_default_ise (slot);
5153 }
5154
5155 Connection
5156 InfoManager::signal_connect_stop_default_ise (InfoManagerSlotVoid*                slot)
5157 {
5158     return m_impl->signal_connect_stop_default_ise (slot);
5159 }
5160
5161 Connection
5162 InfoManager::signal_connect_set_candidate_ui (InfoManagerSlotIntInt*              slot)
5163 {
5164     return m_impl->signal_connect_set_candidate_ui (slot);
5165 }
5166
5167 Connection
5168 InfoManager::signal_connect_get_candidate_ui (InfoManagerSlotIntInt2*             slot)
5169 {
5170     return m_impl->signal_connect_get_candidate_ui (slot);
5171 }
5172
5173 Connection
5174 InfoManager::signal_connect_set_candidate_position (InfoManagerSlotIntInt*              slot)
5175 {
5176     return m_impl->signal_connect_set_candidate_position (slot);
5177 }
5178
5179 Connection
5180 InfoManager::signal_connect_get_candidate_geometry (InfoManagerSlotRect*                slot)
5181 {
5182     return m_impl->signal_connect_get_candidate_geometry (slot);
5183 }
5184
5185 Connection
5186 InfoManager::signal_connect_get_input_panel_geometry (InfoManagerSlotRect*                slot)
5187 {
5188     return m_impl->signal_connect_get_input_panel_geometry (slot);
5189 }
5190
5191 Connection
5192 InfoManager::signal_connect_set_keyboard_ise (InfoManagerSlotString*              slot)
5193 {
5194     return m_impl->signal_connect_set_keyboard_ise (slot);
5195 }
5196
5197 Connection
5198 InfoManager::signal_connect_get_keyboard_ise (InfoManagerSlotString2*             slot)
5199 {
5200     return m_impl->signal_connect_get_keyboard_ise (slot);
5201 }
5202
5203 Connection
5204 InfoManager::signal_connect_show_help (InfoManagerSlotString*              slot)
5205 {
5206     return m_impl->signal_connect_show_help (slot);
5207 }
5208
5209 Connection
5210 InfoManager::signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector*   slot)
5211 {
5212     return m_impl->signal_connect_show_factory_menu (slot);
5213 }
5214
5215 Connection
5216 InfoManager::signal_connect_show_preedit_string (InfoManagerSlotVoid*                slot)
5217 {
5218     return m_impl->signal_connect_show_preedit_string (slot);
5219 }
5220
5221 Connection
5222 InfoManager::signal_connect_show_aux_string (InfoManagerSlotVoid*                slot)
5223 {
5224     return m_impl->signal_connect_show_aux_string (slot);
5225 }
5226
5227 Connection
5228 InfoManager::signal_connect_show_lookup_table (InfoManagerSlotVoid*                slot)
5229 {
5230     return m_impl->signal_connect_show_lookup_table (slot);
5231 }
5232
5233 Connection
5234 InfoManager::signal_connect_show_associate_table (InfoManagerSlotVoid*                slot)
5235 {
5236     return m_impl->signal_connect_show_associate_table (slot);
5237 }
5238
5239 Connection
5240 InfoManager::signal_connect_hide_preedit_string (InfoManagerSlotVoid*                slot)
5241 {
5242     return m_impl->signal_connect_hide_preedit_string (slot);
5243 }
5244
5245 Connection
5246 InfoManager::signal_connect_hide_aux_string (InfoManagerSlotVoid*                slot)
5247 {
5248     return m_impl->signal_connect_hide_aux_string (slot);
5249 }
5250
5251 Connection
5252 InfoManager::signal_connect_hide_lookup_table (InfoManagerSlotVoid*                slot)
5253 {
5254     return m_impl->signal_connect_hide_lookup_table (slot);
5255 }
5256
5257 Connection
5258 InfoManager::signal_connect_hide_associate_table (InfoManagerSlotVoid*                slot)
5259 {
5260     return m_impl->signal_connect_hide_associate_table (slot);
5261 }
5262
5263 Connection
5264 InfoManager::signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt*  slot)
5265 {
5266     return m_impl->signal_connect_update_preedit_string (slot);
5267 }
5268
5269 Connection
5270 InfoManager::signal_connect_update_preedit_caret (InfoManagerSlotInt*                 slot)
5271 {
5272     return m_impl->signal_connect_update_preedit_caret (slot);
5273 }
5274
5275 Connection
5276 InfoManager::signal_connect_update_aux_string (InfoManagerSlotAttributeString*     slot)
5277 {
5278     return m_impl->signal_connect_update_aux_string (slot);
5279 }
5280
5281 Connection
5282 InfoManager::signal_connect_update_lookup_table (InfoManagerSlotLookupTable*         slot)
5283 {
5284     return m_impl->signal_connect_update_lookup_table (slot);
5285 }
5286
5287 Connection
5288 InfoManager::signal_connect_update_associate_table (InfoManagerSlotLookupTable*         slot)
5289 {
5290     return m_impl->signal_connect_update_associate_table (slot);
5291 }
5292
5293 Connection
5294 InfoManager::signal_connect_register_properties (InfoManagerSlotPropertyList*        slot)
5295 {
5296     return m_impl->signal_connect_register_properties (slot);
5297 }
5298
5299 Connection
5300 InfoManager::signal_connect_update_property (InfoManagerSlotProperty*            slot)
5301 {
5302     return m_impl->signal_connect_update_property (slot);
5303 }
5304
5305 Connection
5306 InfoManager::signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList*     slot)
5307 {
5308     return m_impl->signal_connect_register_helper_properties (slot);
5309 }
5310
5311 Connection
5312 InfoManager::signal_connect_update_helper_property (InfoManagerSlotIntProperty*         slot)
5313 {
5314     return m_impl->signal_connect_update_helper_property (slot);
5315 }
5316
5317 Connection
5318 InfoManager::signal_connect_register_helper (InfoManagerSlotIntHelperInfo*       slot)
5319 {
5320     return m_impl->signal_connect_register_helper (slot);
5321 }
5322
5323 Connection
5324 InfoManager::signal_connect_remove_helper (InfoManagerSlotInt*                 slot)
5325 {
5326     return m_impl->signal_connect_remove_helper (slot);
5327 }
5328
5329 Connection
5330 InfoManager::signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool*          slot)
5331 {
5332     return m_impl->signal_connect_set_active_ise_by_uuid (slot);
5333 }
5334
5335 Connection
5336 InfoManager::signal_connect_focus_in (InfoManagerSlotVoid*                slot)
5337 {
5338     return m_impl->signal_connect_focus_in (slot);
5339 }
5340
5341 Connection
5342 InfoManager::signal_connect_focus_out (InfoManagerSlotVoid*                slot)
5343 {
5344     return m_impl->signal_connect_focus_out (slot);
5345 }
5346
5347 Connection
5348 InfoManager::signal_connect_expand_candidate (InfoManagerSlotVoid*                slot)
5349 {
5350     return m_impl->signal_connect_expand_candidate (slot);
5351 }
5352
5353 Connection
5354 InfoManager::signal_connect_contract_candidate (InfoManagerSlotVoid*                slot)
5355 {
5356     return m_impl->signal_connect_contract_candidate (slot);
5357 }
5358
5359 Connection
5360 InfoManager::signal_connect_select_candidate (InfoManagerSlotInt*                 slot)
5361 {
5362     return m_impl->signal_connect_select_candidate (slot);
5363 }
5364
5365 Connection
5366 InfoManager::signal_connect_get_ise_list (InfoManagerSlotBoolStringVector*    slot)
5367 {
5368     return m_impl->signal_connect_get_ise_list (slot);
5369 }
5370
5371 Connection
5372 InfoManager::signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo*      slot)
5373 {
5374     return m_impl->signal_connect_get_all_helper_ise_info (slot);
5375 }
5376
5377 Connection
5378 InfoManager::signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool*      slot)
5379 {
5380     return m_impl->signal_connect_set_has_option_helper_ise_info (slot);
5381 }
5382
5383 Connection
5384 InfoManager::signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool*     slot)
5385 {
5386     return m_impl->signal_connect_set_enable_helper_ise_info (slot);
5387 }
5388
5389 Connection
5390 InfoManager::signal_connect_show_helper_ise_list (InfoManagerSlotVoid*                slot)
5391 {
5392     return m_impl->signal_connect_show_helper_ise_list (slot);
5393 }
5394
5395 Connection
5396 InfoManager::signal_connect_show_helper_ise_selector (InfoManagerSlotVoid*                slot)
5397 {
5398     return m_impl->signal_connect_show_helper_ise_selector (slot);
5399 }
5400
5401 Connection
5402 InfoManager::signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt*           slot)
5403 {
5404     return m_impl->signal_connect_is_helper_ise_enabled (slot);
5405 }
5406
5407 Connection
5408 InfoManager::signal_connect_get_ise_information (InfoManagerSlotBoolString4int2*     slot)
5409 {
5410     return m_impl->signal_connect_get_ise_information (slot);
5411 }
5412
5413 Connection
5414 InfoManager::signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector*    slot)
5415 {
5416     return m_impl->signal_connect_get_keyboard_ise_list (slot);
5417 }
5418
5419 Connection
5420 InfoManager::signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt*        slot)
5421 {
5422     return m_impl->signal_connect_update_ise_geometry (slot);
5423 }
5424
5425 Connection
5426 InfoManager::signal_connect_get_language_list (InfoManagerSlotStringVector*        slot)
5427 {
5428     return m_impl->signal_connect_get_language_list (slot);
5429 }
5430
5431 Connection
5432 InfoManager::signal_connect_get_all_language (InfoManagerSlotStringVector*        slot)
5433 {
5434     return m_impl->signal_connect_get_all_language (slot);
5435 }
5436
5437 Connection
5438 InfoManager::signal_connect_get_ise_language (InfoManagerSlotStrStringVector*     slot)
5439 {
5440     return m_impl->signal_connect_get_ise_language (slot);
5441 }
5442
5443 Connection
5444 InfoManager::signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO*       slot)
5445 {
5446     return m_impl->signal_connect_get_ise_info_by_uuid (slot);
5447 }
5448
5449 Connection
5450 InfoManager::signal_connect_send_key_event (InfoManagerSlotKeyEvent*            slot)
5451 {
5452     return m_impl->signal_connect_send_key_event (slot);
5453 }
5454
5455 Connection
5456 InfoManager::signal_connect_accept_connection (InfoManagerSlotInt*                 slot)
5457 {
5458     return m_impl->signal_connect_accept_connection (slot);
5459 }
5460
5461 Connection
5462 InfoManager::signal_connect_close_connection (InfoManagerSlotInt*                 slot)
5463 {
5464     return m_impl->signal_connect_close_connection (slot);
5465 }
5466
5467 Connection
5468 InfoManager::signal_connect_exit (InfoManagerSlotVoid*                slot)
5469 {
5470     return m_impl->signal_connect_exit (slot);
5471 }
5472
5473 Connection
5474 InfoManager::signal_connect_transaction_start (InfoManagerSlotVoid*                slot)
5475 {
5476     return m_impl->signal_connect_transaction_start (slot);
5477 }
5478
5479 Connection
5480 InfoManager::signal_connect_transaction_end (InfoManagerSlotVoid*                slot)
5481 {
5482     return m_impl->signal_connect_transaction_end (slot);
5483 }
5484
5485 Connection
5486 InfoManager::signal_connect_lock (InfoManagerSlotVoid*                slot)
5487 {
5488     return m_impl->signal_connect_lock (slot);
5489 }
5490
5491 Connection
5492 InfoManager::signal_connect_unlock (InfoManagerSlotVoid*                slot)
5493 {
5494     return m_impl->signal_connect_unlock (slot);
5495 }
5496
5497 Connection
5498 InfoManager::signal_connect_update_input_context (InfoManagerSlotIntInt*              slot)
5499 {
5500     return m_impl->signal_connect_update_input_context (slot);
5501 }
5502
5503 Connection
5504 InfoManager::signal_connect_show_ise (InfoManagerSlotVoid*                slot)
5505 {
5506     return m_impl->signal_connect_show_ise (slot);
5507 }
5508
5509 Connection
5510 InfoManager::signal_connect_hide_ise (InfoManagerSlotVoid*                slot)
5511 {
5512     return m_impl->signal_connect_hide_ise (slot);
5513 }
5514
5515 Connection
5516 InfoManager::signal_connect_will_show_ack (InfoManagerSlotVoid*                slot)
5517 {
5518     return m_impl->signal_connect_will_show_ack (slot);
5519 }
5520
5521 Connection
5522 InfoManager::signal_connect_will_hide_ack (InfoManagerSlotVoid*                slot)
5523 {
5524     return m_impl->signal_connect_will_hide_ack (slot);
5525 }
5526
5527 Connection
5528 InfoManager::signal_connect_set_keyboard_mode (InfoManagerSlotInt*                 slot)
5529 {
5530     return m_impl->signal_connect_set_keyboard_mode (slot);
5531 }
5532
5533 Connection
5534 InfoManager::signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid*                slot)
5535 {
5536     return m_impl->signal_connect_candidate_will_hide_ack (slot);
5537 }
5538
5539 Connection
5540 InfoManager::signal_connect_get_ise_state (InfoManagerSlotInt2*                slot)
5541 {
5542     return m_impl->signal_connect_get_ise_state (slot);
5543 }
5544
5545 Connection
5546 InfoManager::signal_connect_run_helper (InfoManagerSlotString3*                slot)
5547 {
5548     return m_impl->signal_connect_run_helper (slot);
5549 }
5550
5551 Connection
5552 InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect*             slot)
5553 {
5554     return m_impl->signal_connect_get_recent_ise_geometry (slot);
5555 }
5556
5557 Connection
5558 InfoManager::signal_connect_check_privilege_by_sockfd  (InfoManagerSlotIntString2* slot)
5559 {
5560     return m_impl->signal_connect_check_privilege_by_sockfd (slot);
5561 }
5562
5563 Connection
5564 InfoManager::signal_connect_remoteinput_send_input_message  (InfoManagerSlotStringBool*          slot)
5565 {
5566     return m_impl->signal_connect_remoteinput_send_input_message (slot);
5567 }
5568
5569 Connection
5570 InfoManager::signal_connect_remoteinput_send_surrounding_text  (InfoManagerSlotIntString*                slot)
5571 {
5572     return m_impl->signal_connect_remoteinput_send_surrounding_text (slot);
5573 }
5574
5575 } /* namespace scim */
5576
5577 /*
5578 vi:ts=4:nowrap:ai:expandtab
5579 */