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