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