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