1 /** @file isf_info_manager.cpp
2 * @brief Implementation of class InfoManager.
5 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
8 * Smart Common Input Method
10 * Copyright (c) 2005 James Su <suzhe@tsinghua.org.cn>
11 * Copyright (c) 2012-2016 Samsung Electronics Co., Ltd.
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.
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.
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
29 * Modifications by Samsung Electronics Co., Ltd.
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
47 * $Id: scim_panel_agent.cpp,v 1.8.2.1 2006/01/09 14:32:18 suzhe Exp $
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
61 #include <sys/types.h>
62 #include <sys/times.h>
65 #include "scim_private.h"
67 #include "scim_stl_map.h"
68 #include "isf_panel_agent_manager.h"
69 #include "isf_debug.h"
74 #define LOG_TAG "ISF_PANEL_EFL"
76 #define MIN_REPEAT_TIME 2.0
83 InfoManagerSignalVoid;
85 typedef Signal1<void, int>
88 typedef Signal1<void, int&>
89 InfoManagerSignalInt2;
91 typedef Signal1<void, const String&>
92 InfoManagerSignalString;
94 typedef Signal2<void, const String&, bool>
95 InfoManagerSignalStringBool;
97 typedef Signal2<void, String&, String&>
98 InfoManagerSignalString2;
100 typedef Signal2<void, int, const String&>
101 InfoManagerSignalIntString;
103 typedef Signal1<void, const PanelFactoryInfo&>
104 InfoManagerSignalFactoryInfo;
106 typedef Signal1<void, const std::vector <PanelFactoryInfo> &>
107 InfoManagerSignalFactoryInfoVector;
109 typedef Signal1<void, const LookupTable&>
110 InfoManagerSignalLookupTable;
112 typedef Signal1<void, const Property&>
113 InfoManagerSignalProperty;
115 typedef Signal1<void, const PropertyList&>
116 InfoManagerSignalPropertyList;
118 typedef Signal2<void, int, int>
119 InfoManagerSignalIntInt;
121 typedef Signal2<void, int&, int&>
122 InfoManagerSignalIntInt2;
124 typedef Signal3<void, int, int, int>
125 InfoManagerSignalIntIntInt;
127 typedef Signal3<void, const String &, const String &, const String &>
128 InfoManagerSignalString3;
130 typedef Signal4<void, int, int, int, int>
131 InfoManagerSignalIntIntIntInt;
133 typedef Signal2<void, int, const Property&>
134 InfoManagerSignalIntProperty;
136 typedef Signal2<void, int, const PropertyList&>
137 InfoManagerSignalIntPropertyList;
139 typedef Signal2<void, int, const HelperInfo&>
140 InfoManagerSignalIntHelperInfo;
142 typedef Signal3<void, const String&, const AttributeList&, int>
143 InfoManagerSignalAttributeStringInt;
145 typedef Signal2<void, const String&, const AttributeList&>
146 InfoManagerSignalAttributeString;
148 typedef Signal1<void, std::vector <String> &>
149 InfoManagerSignalStringVector;
151 typedef Signal1<bool, HELPER_ISE_INFO&>
152 InfoManagerSignalBoolHelperInfo;
154 typedef Signal1<bool, std::vector <String> &>
155 InfoManagerSignalBoolStringVector;
157 typedef Signal2<void, char*, std::vector <String> &>
158 InfoManagerSignalStrStringVector;
160 typedef Signal2<bool, const String&, ISE_INFO&>
161 InfoManagerSignalStringISEINFO;
163 typedef Signal2<bool, String, int&>
164 InfoManagerSignalStringInt;
166 typedef Signal1<void, const KeyEvent&>
167 InfoManagerSignalKeyEvent;
169 typedef Signal1<void, struct rectinfo&>
170 InfoManagerSignalRect;
172 typedef Signal6<bool, String, String&, String&, int&, int&, String&>
173 InfoManagerSignalBoolString4int2;
175 typedef Signal2<void, int, struct rectinfo&>
176 InfoManagerSignalIntRect;
178 typedef Signal2<bool, int, String>
179 InfoManagerSignalIntString2;
181 struct HelperClientStub {
185 HelperClientStub (int i = 0, int r = 0) : id (i), ref (r) { }
188 struct IMControlStub {
189 std::vector<ISE_INFO> info;
190 std::vector<int> count;
193 #define DEFAULT_CONTEXT_VALUE 0xfff
195 #if SCIM_USE_STL_EXT_HASH_MAP
196 typedef __gnu_cxx::hash_map <int, ClientInfo, __gnu_cxx::hash <int> > ClientRepository;
197 typedef __gnu_cxx::hash_map <int, HelperInfo, __gnu_cxx::hash <int> > HelperInfoRepository;
198 typedef __gnu_cxx::hash_map <uint32, String, __gnu_cxx::hash <unsigned int> > ClientContextUUIDRepository;
199 typedef __gnu_cxx::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
200 typedef __gnu_cxx::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
201 #elif SCIM_USE_STL_HASH_MAP
202 typedef std::hash_map <int, ClientInfo, std::hash <int> > ClientRepository;
203 typedef std::hash_map <int, HelperInfo, std::hash <int> > HelperInfoRepository;
204 typedef std::hash_map <uint32, String, std::hash <unsigned int> > ClientContextUUIDRepository;
205 typedef std::hash_map <String, HelperClientStub, scim_hash_string> HelperClientIndex;
206 typedef std::hash_map <String, std::vector < std::pair <uint32, String> >, scim_hash_string> StartHelperICIndex;
208 typedef std::map <int, ClientInfo> ClientRepository;
209 typedef std::map <int, HelperInfo> HelperInfoRepository;
210 typedef std::map <uint32, String> ClientContextUUIDRepository;
211 typedef std::map <String, HelperClientStub> HelperClientIndex;
212 typedef std::map <String, std::vector < std::pair <uint32, String> > > StartHelperICIndex;
215 typedef std::map <String, uint32> UUIDCountRepository;
216 typedef std::map <String, enum HelperState> UUIDStateRepository;
217 typedef std::map <String, int> StringIntRepository;
218 typedef std::map <int, struct IMControlStub> IMControlRepository;
219 typedef std::map <int, int> IntIntRepository;
222 get_helper_ic (int client, uint32 context)
224 return (uint32) (client & 0xFFFF) | ((context & 0x7FFF) << 16);
228 get_imengine_client_context (uint32 helper_ic, int& client, uint32& context)
230 client = (int) (helper_ic & 0xFFFF);
231 context = ((helper_ic >> 16) & 0x7FFF);
234 //==================================== InfoManager ===========================
235 class InfoManager::InfoManagerImpl
237 int m_current_screen;
239 String m_config_name;
240 String m_display_name;
242 int m_current_socket_client;
243 uint32 m_current_client_context;
244 String m_current_context_uuid;
245 TOOLBAR_MODE_T m_current_toolbar_mode;
246 uint32 m_current_helper_option;
247 String m_current_helper_uuid;
248 String m_last_helper_uuid;
249 String m_current_ise_name;
250 int m_pending_active_imcontrol_id;
251 int m_show_request_client_id;
252 int m_active_client_id;
253 IntIntRepository m_panel_client_map;
254 IntIntRepository m_imcontrol_map;
255 bool m_should_shared_ise;
257 bool m_is_imengine_aux;
258 bool m_is_imengine_candidate;
260 int m_current_send_remoteinput_id;
261 int m_current_recv_remoteinput_id;
262 IntIntRepository m_send_remoteinput_map;
263 IntIntRepository m_recv_remoteinput_map;
265 int m_last_socket_client;
266 uint32 m_last_client_context;
267 String m_last_context_uuid;
269 char* m_ise_context_buffer;
270 size_t m_ise_context_length;
272 ClientRepository m_client_repository;
274 * Each Helper ISE has two socket connect between InfoManager and HelperAgent.
275 * m_helper_info_repository records the active connection.
276 * m_helper_active_info_repository records the passive connection.
278 HelperInfoRepository m_helper_info_repository;
279 HelperInfoRepository m_helper_active_info_repository;
280 HelperClientIndex m_helper_client_index;
282 /* when helper register, notify imcontrol client */
283 StringIntRepository m_ise_pending_repository;
284 IMControlRepository m_imcontrol_repository;
286 StartHelperICIndex m_start_helper_ic_index;
289 ClientContextUUIDRepository m_client_context_uuids;
292 ClientContextUUIDRepository m_client_context_helper;
293 UUIDCountRepository m_helper_uuid_count;
295 InfoManagerSignalVoid m_signal_turn_on;
296 InfoManagerSignalVoid m_signal_turn_off;
297 InfoManagerSignalVoid m_signal_show_panel;
298 InfoManagerSignalVoid m_signal_hide_panel;
299 InfoManagerSignalInt m_signal_update_screen;
300 InfoManagerSignalIntIntInt m_signal_update_spot_location;
301 InfoManagerSignalFactoryInfo m_signal_update_factory_info;
302 InfoManagerSignalVoid m_signal_start_default_ise;
303 InfoManagerSignalVoid m_signal_stop_default_ise;
304 InfoManagerSignalIntInt m_signal_update_input_context;
305 InfoManagerSignalIntInt m_signal_set_candidate_ui;
306 InfoManagerSignalIntInt2 m_signal_get_candidate_ui;
307 InfoManagerSignalIntInt m_signal_set_candidate_position;
308 InfoManagerSignalRect m_signal_get_candidate_geometry;
309 InfoManagerSignalRect m_signal_get_input_panel_geometry;
310 InfoManagerSignalString m_signal_set_keyboard_ise;
311 InfoManagerSignalString2 m_signal_get_keyboard_ise;
312 InfoManagerSignalString m_signal_show_help;
313 InfoManagerSignalFactoryInfoVector m_signal_show_factory_menu;
314 InfoManagerSignalVoid m_signal_show_preedit_string;
315 InfoManagerSignalVoid m_signal_show_aux_string;
316 InfoManagerSignalVoid m_signal_show_lookup_table;
317 InfoManagerSignalVoid m_signal_show_associate_table;
318 InfoManagerSignalVoid m_signal_hide_preedit_string;
319 InfoManagerSignalVoid m_signal_hide_aux_string;
320 InfoManagerSignalVoid m_signal_hide_lookup_table;
321 InfoManagerSignalVoid m_signal_hide_associate_table;
322 InfoManagerSignalAttributeStringInt m_signal_update_preedit_string;
323 InfoManagerSignalInt m_signal_update_preedit_caret;
324 InfoManagerSignalAttributeString m_signal_update_aux_string;
325 InfoManagerSignalLookupTable m_signal_update_lookup_table;
326 InfoManagerSignalLookupTable m_signal_update_associate_table;
327 InfoManagerSignalPropertyList m_signal_register_properties;
328 InfoManagerSignalProperty m_signal_update_property;
329 InfoManagerSignalIntPropertyList m_signal_register_helper_properties;
330 InfoManagerSignalIntProperty m_signal_update_helper_property;
331 InfoManagerSignalIntHelperInfo m_signal_register_helper;
332 InfoManagerSignalInt m_signal_remove_helper;
333 InfoManagerSignalStringBool m_signal_set_active_ise_by_uuid;
334 InfoManagerSignalVoid m_signal_focus_in;
335 InfoManagerSignalVoid m_signal_focus_out;
336 InfoManagerSignalVoid m_signal_expand_candidate;
337 InfoManagerSignalVoid m_signal_contract_candidate;
338 InfoManagerSignalInt m_signal_select_candidate;
339 InfoManagerSignalBoolStringVector m_signal_get_ise_list;
340 InfoManagerSignalBoolHelperInfo m_signal_get_all_helper_ise_info;
341 InfoManagerSignalStringBool m_signal_set_has_option_helper_ise_info;
342 InfoManagerSignalStringBool m_signal_set_enable_helper_ise_info;
343 InfoManagerSignalVoid m_signal_show_helper_ise_list;
344 InfoManagerSignalVoid m_signal_show_helper_ise_selector;
345 InfoManagerSignalStringInt m_signal_is_helper_ise_enabled;
346 InfoManagerSignalBoolString4int2 m_signal_get_ise_information;
347 InfoManagerSignalBoolStringVector m_signal_get_keyboard_ise_list;
348 InfoManagerSignalIntIntIntInt m_signal_update_ise_geometry;
349 InfoManagerSignalStringVector m_signal_get_language_list;
350 InfoManagerSignalStringVector m_signal_get_all_language;
351 InfoManagerSignalStrStringVector m_signal_get_ise_language;
352 InfoManagerSignalStringISEINFO m_signal_get_ise_info_by_uuid;
353 InfoManagerSignalKeyEvent m_signal_send_key_event;
355 InfoManagerSignalInt m_signal_accept_connection;
356 InfoManagerSignalInt m_signal_close_connection;
357 InfoManagerSignalVoid m_signal_exit;
359 InfoManagerSignalVoid m_signal_transaction_start;
360 InfoManagerSignalVoid m_signal_transaction_end;
362 InfoManagerSignalVoid m_signal_lock;
363 InfoManagerSignalVoid m_signal_unlock;
365 InfoManagerSignalVoid m_signal_show_ise;
366 InfoManagerSignalVoid m_signal_hide_ise;
368 InfoManagerSignalVoid m_signal_will_show_ack;
369 InfoManagerSignalVoid m_signal_will_hide_ack;
371 InfoManagerSignalInt m_signal_set_keyboard_mode;
373 InfoManagerSignalVoid m_signal_candidate_will_hide_ack;
374 InfoManagerSignalInt2 m_signal_get_ise_state;
375 InfoManagerSignalString3 m_signal_run_helper;
377 InfoManagerSignalIntRect m_signal_get_recent_ise_geometry;
379 InfoManagerSignalStringBool m_signal_remoteinput_send_input_message;
380 InfoManagerSignalIntString m_signal_remoteinput_send_surrounding_text;
382 InfoManagerSignalIntString2 m_signal_check_privilege_by_sockfd;
384 PanelAgentManager m_panel_agent_manager;
389 : m_current_screen (0),
390 m_current_socket_client (-1), m_current_client_context (0),
391 m_current_toolbar_mode (TOOLBAR_KEYBOARD_MODE),
392 m_current_helper_option (0),
393 m_pending_active_imcontrol_id (-1),
394 m_show_request_client_id (-1),
395 m_active_client_id (-1),
396 m_should_shared_ise (false),
397 m_ise_exiting (false), m_is_imengine_aux (false), m_is_imengine_candidate (false),
398 m_current_send_remoteinput_id (0), m_current_recv_remoteinput_id (0),
399 m_last_socket_client (-1), m_last_client_context (0),
400 m_ise_context_buffer (NULL), m_ise_context_length (0) {
401 m_current_ise_name = String (_ ("English Keyboard"));
402 m_imcontrol_repository.clear ();
403 m_imcontrol_map.clear ();
404 m_send_remoteinput_map.clear ();
405 m_recv_remoteinput_map.clear ();
406 m_panel_client_map.clear ();
409 ~InfoManagerImpl () {
410 delete_ise_context_buffer ();
413 void delete_ise_context_buffer (void) {
414 if (m_ise_context_buffer != NULL) {
415 delete[] m_ise_context_buffer;
416 m_ise_context_buffer = NULL;
417 m_ise_context_length = 0;
421 bool initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident) {
423 m_config_name = "socket";
424 m_display_name = display;
426 return m_panel_agent_manager.initialize (info_manager, config, display, resident);
429 bool valid (void) const {
430 return m_panel_agent_manager.valid ();
436 SCIM_DEBUG_MAIN (1) << "InfoManager::stop ()\n";
439 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
440 String helper_uuid = get_current_helper_uuid ();
441 hide_helper (helper_uuid);
442 stop_helper (helper_uuid, -2, 0);
445 m_panel_agent_manager.stop ();
448 TOOLBAR_MODE_T get_current_toolbar_mode () const {
449 return m_current_toolbar_mode;
452 String get_current_ise_name () const {
453 return m_current_ise_name;
456 String get_current_helper_uuid () const {
457 return m_current_helper_uuid;
460 uint32 get_current_helper_option () const {
461 return m_current_helper_option;
464 void set_current_ise_name (String& name) {
465 m_current_ise_name = name;
468 void set_current_toolbar_mode (TOOLBAR_MODE_T mode) {
469 m_current_toolbar_mode = mode;
472 void set_current_helper_option (uint32 option) {
473 m_current_helper_option = option;
476 void update_panel_event (int cmd, uint32 nType, uint32 nValue) {
479 uint32 focused_context;
480 get_focused_context (focused_client, focused_context);
482 if (focused_client == -1 && m_active_client_id != -1) {
483 focused_client = m_panel_client_map[m_active_client_id];
487 SCIM_DEBUG_MAIN (1) << __func__ << " (" << nType << ", " << nValue << "), client=" << focused_client << "\n";
488 ClientInfo client_info = socket_get_client_info (focused_client);
490 if (client_info.type == FRONTEND_CLIENT) {
491 m_panel_agent_manager.update_panel_event (focused_client, focused_context, cmd, nType, nValue);
493 std::cerr << __func__ << " focused client is not existed!!!" << "\n";
496 if (m_panel_client_map[m_show_request_client_id] != focused_client) {
497 client_info = socket_get_client_info (m_panel_client_map[m_show_request_client_id]);
499 if (client_info.type == FRONTEND_CLIENT) {
500 m_panel_agent_manager.update_panel_event (m_panel_client_map[m_show_request_client_id], 0, cmd, nType, nValue);
501 std::cerr << __func__ << " show request client=" << m_panel_client_map[m_show_request_client_id] << "\n";
503 std::cerr << __func__ << " show request client is not existed!!!" << "\n";
508 bool move_preedit_caret (uint32 position) {
509 SCIM_DEBUG_MAIN (1) << "InfoManager::move_preedit_caret (" << position << ")\n";
514 get_focused_context (client, context);
517 m_panel_agent_manager.update_preedit_caret (client, context, position);
525 bool request_help (void) {
526 SCIM_DEBUG_MAIN (1) << "InfoManager::request_help ()\n";
530 get_focused_context (client, context);
533 m_panel_agent_manager.request_help (client, context);
540 bool request_factory_menu (void) {
541 SCIM_DEBUG_MAIN (1) << "InfoManager::request_factory_menu ()\n";
545 get_focused_context (client, context);
548 m_panel_agent_manager.request_factory_menu (client, context);
556 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
557 bool reset_keyboard_ise (void) {
559 SCIM_DEBUG_MAIN (1) << "InfoManager::reset_keyboard_ise ()\n";
563 get_focused_context (client, context);
566 m_panel_agent_manager.reset_keyboard_ise (client, context);
573 bool update_keyboard_ise_list (void) {
575 SCIM_DEBUG_MAIN (1) << "InfoManager::update_keyboard_ise_list ()\n";
579 get_focused_context (client, context);
582 m_panel_agent_manager.update_keyboard_ise_list (client, context);
589 bool change_factory (const String& uuid) {
590 SCIM_DEBUG_MAIN (1) << "InfoManager::change_factory (" << uuid << ")\n";
595 if (scim_global_config_read (SCIM_GLOBAL_CONFIG_PRELOAD_KEYBOARD_ISE, false))
596 m_helper_manager.preload_keyboard_ise (uuid);
599 get_focused_context (client, context);
602 m_panel_agent_manager.change_factory (client, context, uuid);
609 bool helper_candidate_show (void) {
610 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
614 get_focused_context (client, context);
616 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
617 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
619 if (it != m_helper_client_index.end ()) {
620 uint32 ctx = get_helper_ic (client, context);
621 m_panel_agent_manager.helper_candidate_show (it->second.id, ctx, m_current_helper_uuid);
629 bool helper_candidate_hide (void) {
630 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
634 get_focused_context (client, context);
636 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
637 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
639 if (it != m_helper_client_index.end ()) {
640 uint32 ctx = get_helper_ic (client, context);
641 m_panel_agent_manager.helper_candidate_hide (it->second.id, ctx, m_current_helper_uuid);
649 bool candidate_more_window_show (void) {
650 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
654 get_focused_context (client, context);
656 if (m_is_imengine_candidate) {
658 m_panel_agent_manager.candidate_more_window_show (client, context);
662 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
663 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
665 if (it != m_helper_client_index.end ()) {
666 uint32 ctx = get_helper_ic (client, context);
667 m_panel_agent_manager.candidate_more_window_show (it->second.id, ctx);
676 bool candidate_more_window_hide (void) {
677 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
681 get_focused_context (client, context);
683 if (m_is_imengine_candidate) {
685 m_panel_agent_manager.candidate_more_window_hide (client, context);
689 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
690 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
692 if (it != m_helper_client_index.end ()) {
693 uint32 ctx = get_helper_ic (client, context);
694 m_panel_agent_manager.candidate_more_window_hide (it->second.id, ctx);
703 bool update_helper_lookup_table (const LookupTable& table) {
704 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
709 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
710 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
712 if (it != m_helper_client_index.end ()) {
714 get_focused_context (client, context);
715 ctx = get_helper_ic (client, context);
716 m_panel_agent_manager.update_helper_lookup_table (it->second.id, ctx, m_current_helper_uuid, table);
724 bool select_aux (uint32 item) {
725 SCIM_DEBUG_MAIN (1) << "InfoManager::select_aux (" << item << ")\n";
730 get_focused_context (client, context);
732 if (m_is_imengine_aux) {
734 m_panel_agent_manager.select_aux (client, context, item);
737 helper_select_aux (item);
744 bool select_candidate (uint32 item) {
745 SCIM_DEBUG_MAIN (1) << "InfoManager::select_candidate (" << item << ")\n";
750 get_focused_context (client, context);
752 if (m_is_imengine_candidate) {
754 m_panel_agent_manager.select_candidate (client, context, item);
757 helper_select_candidate (item);
764 bool lookup_table_page_up (void) {
765 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_up ()\n";
770 get_focused_context (client, context);
772 if (m_is_imengine_candidate) {
774 m_panel_agent_manager.lookup_table_page_up (client, context);
777 helper_lookup_table_page_up ();
784 bool lookup_table_page_down (void) {
785 SCIM_DEBUG_MAIN (1) << "InfoManager::lookup_table_page_down ()\n";
790 get_focused_context (client, context);
792 if (m_is_imengine_candidate) {
794 m_panel_agent_manager.lookup_table_page_down (client, context);
797 helper_lookup_table_page_down ();
804 bool update_lookup_table_page_size (uint32 size) {
805 SCIM_DEBUG_MAIN (1) << "InfoManager::update_lookup_table_page_size (" << size << ")\n";
810 get_focused_context (client, context);
812 if (m_is_imengine_candidate) {
814 m_panel_agent_manager.update_lookup_table_page_size (client, context, size);
817 helper_update_lookup_table_page_size (size);
824 bool update_candidate_item_layout (const std::vector<uint32>& row_items) {
825 SCIM_DEBUG_MAIN (1) << __func__ << " (" << row_items.size () << ")\n";
830 get_focused_context (client, context);
832 if (m_is_imengine_candidate) {
834 m_panel_agent_manager.update_candidate_item_layout (client, context, row_items);
837 helper_update_candidate_item_layout (row_items);
844 bool select_associate (uint32 item) {
845 SCIM_DEBUG_MAIN (1) << "InfoManager::select_associate (" << item << ")\n";
850 get_focused_context (client, context);
853 m_panel_agent_manager.select_associate (client, context, item);
857 helper_select_associate (item);
861 bool associate_table_page_up (void) {
862 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_up ()\n";
867 get_focused_context (client, context);
870 m_panel_agent_manager.associate_table_page_up (client, context);
874 helper_associate_table_page_up ();
878 bool associate_table_page_down (void) {
879 SCIM_DEBUG_MAIN (1) << "InfoManager::associate_table_page_down ()\n";
884 get_focused_context (client, context);
887 m_panel_agent_manager.associate_table_page_down (client, context);
891 helper_associate_table_page_down ();
895 bool update_associate_table_page_size (uint32 size) {
896 SCIM_DEBUG_MAIN (1) << "InfoManager::update_associate_table_page_size (" << size << ")\n";
901 get_focused_context (client, context);
904 m_panel_agent_manager.update_associate_table_page_size (client, context, size);
908 helper_update_associate_table_page_size (size);
912 bool update_displayed_candidate_number (uint32 size) {
913 SCIM_DEBUG_MAIN (1) << __func__ << " (" << size << ")\n";
918 get_focused_context (client, context);
920 if (m_is_imengine_candidate) {
922 m_panel_agent_manager.update_displayed_candidate_number (client, context, size);
925 helper_update_displayed_candidate_number (size);
932 void send_longpress_event (int type, int index) {
933 SCIM_DEBUG_MAIN (1) << __func__ << " (" << type << ", " << index << ")\n";
937 get_focused_context (client, context);
939 if (m_is_imengine_candidate) {
941 m_panel_agent_manager.send_longpress_event (client, context, index);
944 helper_longpress_candidate (index);
948 bool trigger_property (const String& property) {
949 SCIM_DEBUG_MAIN (1) << "InfoManager::trigger_property (" << property << ")\n";
954 get_focused_context (client, context);
957 m_panel_agent_manager.trigger_property (client, context, property);
964 bool start_helper (const String& uuid, int client, uint32 context) {
965 SCIM_DEBUG_MAIN (1) << "InfoManager::start_helper (" << uuid << ")\n";
966 LOGD ("start ISE(%s)", uuid.c_str ());
968 if (uuid.length () <= 0)
972 /*if (m_current_toolbar_mode != TOOLBAR_HELPER_MODE || m_current_helper_uuid.compare (uuid) != 0)*/ {
973 SCIM_DEBUG_MAIN (1) << "Run_helper\n";
974 m_signal_run_helper (uuid, m_config_name, m_display_name);
976 m_current_helper_uuid = uuid;
981 bool stop_helper (const String& uuid, int client, uint32 context) {
983 snprintf (buf, sizeof (buf), "time:%ld pid:%d %s %s prepare to stop ISE(%s)\n",
984 time (0), getpid (), __FILE__, __func__, uuid.c_str ());
985 LOGD ("prepare to stop ISE(%s)", uuid.c_str ());
986 SCIM_DEBUG_MAIN (1) << "InfoManager::stop_helper (" << uuid << ")\n";
988 if (uuid.length () <= 0)
992 uint32 ctx = get_helper_ic (client, context);
993 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
995 if (it != m_helper_client_index.end ()) {
996 m_ise_exiting = true;
997 m_current_helper_uuid = String ("");
998 m_panel_agent_manager.exit (it->second.id, ctx);
999 SCIM_DEBUG_MAIN (1) << "Stop helper\n";
1000 ISF_SAVE_LOG ("send SCIM_TRANS_CMD_EXIT message to %s\n", uuid.c_str ());
1007 void focus_out_helper (const String& uuid, int client, uint32 context) {
1008 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1010 if (it != m_helper_client_index.end ()) {
1011 uint32 ctx = get_helper_ic (client, context);
1012 m_panel_agent_manager.focus_out_helper (it->second.id, ctx, uuid);
1016 void focus_in_helper (const String& uuid, int client, uint32 context) {
1017 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1019 if (it != m_helper_client_index.end ()) {
1020 uint32 ctx = get_helper_ic (client, context);
1021 m_panel_agent_manager.focus_in_helper (it->second.id, ctx, uuid);
1025 bool show_helper (const String& uuid, char* data, size_t& len, uint32 ctx) {
1026 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1028 if (it != m_helper_client_index.end ()) {
1029 Socket client_socket (it->second.id);
1030 m_panel_agent_manager.show_helper (it->second.id, ctx, uuid, data, len);
1031 LOGD ("Send ISM_TRANS_CMD_SHOW_ISE_PANEL message");
1035 LOGW ("Can't find %s", m_current_helper_uuid.c_str ());
1039 void hide_helper (const String& uuid, uint32 ctx = 0) {
1040 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1043 if (it != m_helper_client_index.end ()) {
1048 get_focused_context (client, context);
1049 ctx = get_helper_ic (client, context);
1052 m_panel_agent_manager.hide_helper (it->second.id, ctx, uuid);
1053 LOGD ("Send ISM_TRANS_CMD_HIDE_ISE_PANEL message");
1057 bool set_helper_mode (const String& uuid, uint32& mode) {
1058 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1060 if (it != m_helper_client_index.end ()) {
1064 get_focused_context (client, context);
1065 ctx = get_helper_ic (client, context);
1066 m_panel_agent_manager.set_helper_mode (it->second.id, ctx, uuid, mode);
1073 bool set_helper_language (const String& uuid, uint32& language) {
1074 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1076 if (it != m_helper_client_index.end ()) {
1080 get_focused_context (client, context);
1081 ctx = get_helper_ic (client, context);
1082 m_panel_agent_manager.set_helper_language (it->second.id, ctx, uuid, language);
1089 bool set_helper_imdata (const String& uuid, const char* imdata, size_t& len) {
1090 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1092 if (it != m_helper_client_index.end ()) {
1096 get_focused_context (client, context);
1097 ctx = get_helper_ic (client, context);
1098 m_panel_agent_manager.set_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1105 bool set_helper_return_key_type (const String& uuid, int type) {
1106 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1108 if (it != m_helper_client_index.end ()) {
1112 get_focused_context (client, context);
1113 ctx = get_helper_ic (client, context);
1114 m_panel_agent_manager.set_helper_return_key_type (it->second.id, ctx, uuid, type);
1121 bool get_helper_return_key_type (const String& uuid, uint32& type) {
1122 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1124 if (it != m_helper_client_index.end ()) {
1128 get_focused_context (client, context);
1129 ctx = get_helper_ic (client, context);
1130 m_panel_agent_manager.get_helper_return_key_type (it->second.id, ctx, uuid, type);
1136 bool set_helper_return_key_disable (const String& uuid, bool disabled) {
1137 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1139 if (it != m_helper_client_index.end ()) {
1143 get_focused_context (client, context);
1144 ctx = get_helper_ic (client, context);
1145 m_panel_agent_manager.set_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1152 bool get_helper_return_key_disable (const String& uuid, uint32& disabled) {
1153 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1155 if (it != m_helper_client_index.end ()) {
1159 get_focused_context (client, context);
1160 ctx = get_helper_ic (client, context);
1161 m_panel_agent_manager.get_helper_return_key_disable (it->second.id, ctx, uuid, disabled);
1167 bool set_helper_layout (const String& uuid, uint32& layout) {
1168 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1170 if (it != m_helper_client_index.end ()) {
1174 get_focused_context (client, context);
1175 ctx = get_helper_ic (client, context);
1176 m_panel_agent_manager.set_helper_layout (it->second.id, ctx, uuid, layout);
1183 bool set_helper_input_mode (const String& uuid, uint32& mode) {
1184 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1186 if (it != m_helper_client_index.end ()) {
1190 get_focused_context (client, context);
1191 ctx = get_helper_ic (client, context);
1192 m_panel_agent_manager.set_helper_input_mode (it->second.id, ctx, uuid, mode);
1199 bool set_helper_input_hint (const String& uuid, uint32& hint) {
1200 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1202 if (it != m_helper_client_index.end ()) {
1206 get_focused_context (client, context);
1207 ctx = get_helper_ic (client, context);
1208 m_panel_agent_manager.set_helper_input_hint (it->second.id, ctx, uuid, hint);
1215 bool set_helper_bidi_direction (const String& uuid, uint32& direction) {
1216 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1218 if (it != m_helper_client_index.end ()) {
1222 get_focused_context (client, context);
1223 ctx = get_helper_ic (client, context);
1224 m_panel_agent_manager.set_helper_bidi_direction (it->second.id, ctx, uuid, direction);
1231 bool set_helper_caps_mode (const String& uuid, uint32& mode) {
1232 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1234 if (it != m_helper_client_index.end ()) {
1238 get_focused_context (client, context);
1239 ctx = get_helper_ic (client, context);
1240 m_panel_agent_manager.set_helper_caps_mode (it->second.id, ctx, uuid, mode);
1247 bool show_helper_option_window (const String& uuid) {
1248 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1250 if (it != m_helper_client_index.end ()) {
1254 get_focused_context (client, context);
1255 ctx = get_helper_ic (client, context);
1256 LOGD ("Send ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW message");
1257 m_panel_agent_manager.show_helper_option_window (it->second.id, ctx, uuid);
1264 bool resume_helper_option_window (const String& uuid) {
1265 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1267 if (it != m_helper_client_index.end ()) {
1271 get_focused_context (client, context);
1272 ctx = get_helper_ic (client, context);
1273 LOGD ("Send ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW message");
1274 m_panel_agent_manager.resume_helper_option_window (it->second.id, ctx, uuid);
1281 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
1282 void show_isf_panel (int client_id) {
1284 SCIM_DEBUG_MAIN (4) << "InfoManager::show_isf_panel ()\n";
1285 m_signal_show_panel ();
1288 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
1289 bool send_remote_input_message (int client_id, char* buf, size_t len) {
1290 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_input_message ()\n";
1292 if (buf && len > 0) {
1294 m_signal_remoteinput_send_input_message (msg, true);
1301 void send_remote_surrounding_text (const char* text, uint32 cursor) {
1302 SCIM_DEBUG_MAIN(4) << "InfoManager::send_remote_surrounding_text ()\n";
1304 m_signal_remoteinput_send_surrounding_text (cursor, text);
1307 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
1308 void hide_isf_panel (int client_id) {
1310 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_isf_panel ()\n";
1311 m_signal_hide_panel ();
1314 //ISM_TRANS_CMD_SHOW_ISE_PANEL
1315 void show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len) {
1316 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_panel ()\n";
1318 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1319 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1320 LOGD ("prepare to show ISE %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
1322 m_show_request_client_id = client_id;
1323 m_active_client_id = client_id;
1324 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1326 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
1327 uint32 ctx = get_helper_ic (client, context);
1328 ret = show_helper (m_current_helper_uuid, data, len, ctx);
1331 /* Save ISE context for ISE panel re-showing */
1332 if (data && len > 0) {
1333 delete_ise_context_buffer ();
1334 m_ise_context_buffer = new char [len];
1336 if (m_ise_context_buffer) {
1337 m_ise_context_length = len;
1338 memcpy (m_ise_context_buffer, data, m_ise_context_length);
1343 m_signal_show_ise ();
1345 m_signal_start_default_ise ();
1349 //ISM_TRANS_CMD_HIDE_ISE_PANEL
1350 void hide_ise_panel (int client_id, uint32 client, uint32 context) {
1351 SCIM_DEBUG_MAIN (4) << "InfoManager::hide_ise_panel ()\n";
1352 LOGD ("prepare to hide ISE, %d %d", client_id, m_show_request_client_id);
1353 SCIM_DEBUG_MAIN (4) << __func__ << " (client:" << client << " context:" << context << ")\n";
1355 if (m_panel_client_map[client_id] == m_current_socket_client || client_id == m_show_request_client_id) {
1356 // && (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
1358 uint32 focused_context;
1359 get_focused_context (focused_client, focused_context);
1361 if (focused_client == -1 && m_active_client_id != -1) {
1362 focused_client = m_panel_client_map[m_active_client_id];
1363 focused_context = 0;
1366 m_signal_hide_ise ();
1369 /* Release ISE context buffer */
1370 delete_ise_context_buffer ();
1373 void hide_helper_ise (void) {
1376 uint32 focused_context;
1377 get_focused_context (focused_client, focused_context);
1378 m_panel_agent_manager.hide_helper_ise (focused_client, focused_context);
1380 m_signal_hide_ise ();
1384 void set_default_ise (const DEFAULT_ISE_T& ise) {
1386 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), ise.uuid);
1387 scim_global_config_flush ();
1390 void set_should_shared_ise (const bool should_shared_ise) {
1392 m_should_shared_ise = should_shared_ise;
1394 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
1395 bool process_key_event (KeyEvent& key, uint32 serial) {
1398 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1400 if (it != m_helper_client_index.end ()) {
1404 get_focused_context (client, context);
1405 ctx = get_helper_ic (client, context);
1406 return m_panel_agent_manager.process_key_event (it->second.id, ctx, m_current_helper_uuid, key, serial);
1412 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
1413 bool process_input_device_event(int client_id, uint32 type, const char *data, size_t len, _OUT_ uint32& result) {
1414 SCIM_DEBUG_MAIN(4) << "InfoManager::process_input_device_event ()\n";
1415 HelperClientIndex::iterator it = m_helper_client_index.find(m_current_helper_uuid);
1417 if (it != m_helper_client_index.end()) {
1421 get_focused_context(client, context);
1422 ctx = get_helper_ic(client, context);
1423 return m_panel_agent_manager.process_input_device_event(it->second.id, ctx, m_current_helper_uuid, type, data, len, result);
1429 bool get_helper_geometry (String& uuid, struct rectinfo& info) {
1430 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1432 if (it != m_helper_client_index.end ()) {
1436 get_focused_context (client, context);
1437 ctx = get_helper_ic (client, context);
1438 return m_panel_agent_manager.get_helper_geometry (it->second.id, ctx, uuid, info);
1444 bool get_helper_imdata (String& uuid, char** imdata, size_t& len) {
1445 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1447 if (it != m_helper_client_index.end ()) {
1451 get_focused_context (client, context);
1452 ctx = get_helper_ic (client, context);
1453 m_panel_agent_manager.get_helper_imdata (it->second.id, ctx, uuid, imdata, len);
1460 bool get_helper_layout (String& uuid, uint32& layout) {
1461 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1463 if (it != m_helper_client_index.end ()) {
1467 get_focused_context (client, context);
1468 ctx = get_helper_ic (client, context);
1469 m_panel_agent_manager.get_helper_layout (it->second.id, ctx, uuid, layout);
1475 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
1476 void get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info) {
1477 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1479 m_signal_get_input_panel_geometry (info);
1481 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
1482 void get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info) {
1483 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1485 m_signal_get_candidate_geometry (info);
1487 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
1488 void get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len) {
1489 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1493 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
1494 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1496 if (it != m_helper_client_index.end ()) {
1499 get_focused_context (client, context);
1500 uint32 ctx = get_helper_ic (client, context);
1501 m_panel_agent_manager.get_ise_language_locale (it->second.id, ctx, m_current_helper_uuid, data, len);
1506 void get_current_ise_geometry (rectinfo& rect) {
1508 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
1511 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1512 ret = get_helper_geometry (m_current_helper_uuid, rect);
1522 void set_ise_mode (int client_id, uint32 mode) {
1523 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_mode ()\n";
1526 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1527 set_helper_mode (m_current_helper_uuid, mode);
1529 //ISM_TRANS_CMD_SET_LAYOUT
1530 void set_ise_layout (int client_id, uint32 layout) {
1531 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_layout ()\n";
1534 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1535 set_helper_layout (m_current_helper_uuid, layout);
1537 //ISM_TRANS_CMD_SET_INPUT_MODE
1538 void set_ise_input_mode (int client_id, uint32 input_mode) {
1539 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_mode ()\n";
1542 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1543 set_helper_input_mode (m_current_helper_uuid, input_mode);
1545 //ISM_TRANS_CMD_SET_INPUT_HINT
1546 void set_ise_input_hint (int client_id, uint32 input_hint) {
1547 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_input_hint ()\n";
1550 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1551 set_helper_input_hint (m_current_helper_uuid, input_hint);
1553 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
1554 void update_ise_bidi_direction (int client_id, uint32 bidi_direction) {
1556 SCIM_DEBUG_MAIN (4) << "InfoManager::update_ise_bidi_direction ()\n";
1558 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1559 set_helper_bidi_direction (m_current_helper_uuid, bidi_direction);
1561 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
1562 void set_ise_language (int client_id, uint32 language) {
1563 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_language ()\n";
1566 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1567 set_helper_language (m_current_helper_uuid, language);
1569 //ISM_TRANS_CMD_SET_ISE_IMDATA
1570 void set_ise_imdata (int client_id, const char* imdata, size_t len) {
1571 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_imdata ()\n";
1574 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1575 set_helper_imdata (m_current_helper_uuid, imdata, len);
1577 //ISM_TRANS_CMD_GET_ISE_IMDATA
1578 bool get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len) {
1579 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_imdata ()\n";
1583 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1584 ret = get_helper_imdata (m_current_helper_uuid, imdata, len);
1588 //ISM_TRANS_CMD_GET_LAYOUT
1589 bool get_ise_layout (int client_id, _OUT_ uint32& layout) {
1590 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_layout ()\n";
1594 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1595 ret = get_helper_layout (m_current_helper_uuid, layout);
1599 //ISM_TRANS_CMD_GET_ISE_STATE
1600 void get_ise_state (int client_id, _OUT_ int& state) {
1601 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1603 m_signal_get_ise_state (state);
1605 //ISM_TRANS_CMD_GET_ACTIVE_ISE
1606 void get_active_ise (int client_id, _OUT_ String& default_uuid) {
1608 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1609 default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1611 //ISM_TRANS_CMD_GET_ISE_LIST
1612 void get_ise_list (int client_id, _OUT_ std::vector<String>& strlist) {
1614 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_list ()\n";
1615 m_signal_get_ise_list (strlist);
1617 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
1618 void get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info) {
1619 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_helper_ise_info ()\n";
1621 m_signal_get_all_helper_ise_info (info);
1623 //1 Check if the current IME's option (setting) is available or not.
1624 for (uint32 i = 0; i < info.appid.size (); i++) {
1625 if (m_current_helper_uuid.compare (info.appid [i]) == 0) { // Find the current IME
1626 // If the current IME's "has_option" is unknown (-1), get it through ISM_TRANS_CMD_CHECK_OPTION_WINDOW command.
1627 // And it's saved to ime_info DB. Then next time this will be skipped.
1628 if (info.has_option [i] >= 2) {
1629 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1631 if (it != m_helper_client_index.end ()) {
1634 get_focused_context (client, context);
1635 uint32 ctx = get_helper_ic (client, context);
1636 uint32 avail = static_cast<uint32> (-1);
1637 m_panel_agent_manager.check_option_window (it->second.id, ctx, m_current_helper_uuid, avail);
1640 info.has_option [i] = avail;
1641 // Update "has_option" column of ime_info DB and global variable.
1642 m_signal_set_has_option_helper_ise_info (info.appid [i], static_cast<bool> (avail));
1649 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
1650 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1651 void set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled) {
1653 SCIM_DEBUG_MAIN (4) << "InfoManager::set_enable_helper_ise_info ()\n";
1654 m_signal_set_enable_helper_ise_info (appid, static_cast<bool> (is_enabled));
1656 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
1657 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1658 void show_helper_ise_list (int client_id) {
1659 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_list ()\n";
1661 m_signal_show_helper_ise_list ();
1663 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
1664 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1665 void show_helper_ise_selector (int client_id) {
1666 SCIM_DEBUG_MAIN (4) << "InfoManager::show_helper_ise_selector ()\n";
1668 m_signal_show_helper_ise_selector ();
1670 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
1672 void is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled) {
1673 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1676 m_signal_is_helper_ise_enabled (strAppid, _nEnabled);
1677 nEnabled = (uint32)_nEnabled;
1679 //ISM_TRANS_CMD_GET_ISE_INFORMATION
1680 void get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
1681 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName) {
1682 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1684 m_signal_get_ise_information (strUuid, strName, strLanguage, nType, nOption, strModuleName);
1689 void get_language_list (int client_id, _OUT_ std::vector<String>& strlist) {
1690 SCIM_DEBUG_MAIN (4) << "InfoManager::get_language_list ()\n";
1691 m_signal_get_language_list (strlist);
1694 void get_all_language (int client_id, _OUT_ std::vector<String>& strlist) {
1695 SCIM_DEBUG_MAIN (4) << "InfoManager::get_all_language ()\n";
1696 m_signal_get_all_language (strlist);
1701 void get_ise_language (int client_id, char* buf, size_t len, _OUT_ std::vector<String>& strlist) {
1702 SCIM_DEBUG_MAIN (4) << "InfoManager::get_ise_language ()\n";
1703 m_signal_get_ise_language (buf, strlist);
1705 //ISM_TRANS_CMD_RESET_ISE_OPTION
1706 //reply SCIM_TRANS_CMD_OK
1707 bool reset_ise_option (int client_id) {
1708 SCIM_DEBUG_MAIN (1) << "InfoManager::resect_ise_option ()\n";
1713 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
1715 if (it != m_client_context_uuids.end ()) {
1716 get_imengine_client_context (it->first, client, context);
1720 m_panel_agent_manager.reset_ise_option (client, context);
1727 bool find_active_ise_by_uuid (String uuid) {
1728 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
1730 for (; iter != m_helper_info_repository.end (); iter++) {
1731 if (!uuid.compare (iter->second.uuid))
1737 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
1739 bool set_active_ise_by_uuid (int client_id, char* buf, size_t len) {
1740 SCIM_DEBUG_MAIN (4) << "InfoManager::set_active_ise_by_uuid ()\n";
1750 if (!m_signal_get_ise_info_by_uuid (uuid, info)) {
1754 if (info.type == TOOLBAR_KEYBOARD_MODE) {
1755 m_signal_set_active_ise_by_uuid (uuid, 1);
1758 m_signal_set_active_ise_by_uuid (uuid, 1);
1763 if (find_active_ise_by_uuid (uuid)) {
1766 m_ise_pending_repository[uuid] = client_id;
1770 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
1771 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
1772 void set_initial_ise_by_uuid (int client_id, char* buf, size_t len) {
1773 SCIM_DEBUG_MAIN (4) << "InfoManager::set_initial_ise_by_uuid ()\n";
1781 scim_global_config_write (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (uuid));
1782 scim_global_config_flush ();
1784 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
1785 void set_ise_return_key_type (int client_id, uint32 type) {
1786 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1789 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1790 set_helper_return_key_type (m_current_helper_uuid, type);
1792 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
1794 bool get_ise_return_key_type (int client_id, _OUT_ uint32& type) {
1795 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1799 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1800 ret = get_helper_return_key_type (m_current_helper_uuid, type);
1804 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
1805 void set_ise_return_key_disable (int client_id, uint32 disabled) {
1806 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1809 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1810 set_helper_return_key_disable (m_current_helper_uuid, disabled);
1812 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
1813 void get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled) {
1814 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1817 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1818 get_helper_return_key_disable (m_current_helper_uuid, disabled);
1821 void reset_helper_context (const String& uuid) {
1822 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
1824 if (it != m_helper_client_index.end ()) {
1828 get_focused_context (client, context);
1829 ctx = get_helper_ic (client, context);
1830 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
1836 void reset_ise_context (int client_id) {
1837 SCIM_DEBUG_MAIN (4) << "InfoManager::reset_ise_context ()\n";
1839 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1840 reset_helper_context (m_current_helper_uuid);
1842 //ISM_TRANS_CMD_SET_CAPS_MODE
1843 void set_ise_caps_mode (int client_id, uint32 mode) {
1844 SCIM_DEBUG_MAIN (4) << "InfoManager::set_ise_caps_mode ()\n";
1847 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
1848 set_helper_caps_mode (m_current_helper_uuid, mode);
1851 //SCIM_TRANS_CMD_RELOAD_CONFIG
1852 void reload_config (void) {
1853 SCIM_DEBUG_MAIN (1) << "InfoManager::reload_config ()\n";
1857 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
1858 if (it->second.type == FRONTEND_CLIENT || it->second.type == HELPER_CLIENT) {
1859 m_panel_agent_manager.reload_config (it->first);
1867 SCIM_DEBUG_MAIN (1) << "InfoManager::exit ()\n";
1870 for (ClientRepository::iterator it = m_client_repository.begin (); it != m_client_repository.end (); ++it) {
1871 m_panel_agent_manager.exit (it->first, 0);
1879 void update_ise_list (std::vector<String>& strList) {
1880 /* request PanelClient to update keyboard ise list */
1881 update_keyboard_ise_list ();
1883 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
1884 void will_show_ack (int client_id) {
1885 SCIM_DEBUG_MAIN (4) << "InfoManager::will_show_ack ()\n";
1887 m_signal_will_show_ack ();
1889 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
1890 void will_hide_ack (int client_id) {
1891 SCIM_DEBUG_MAIN (4) << "InfoManager::will_hide_ack ()\n";
1893 m_signal_will_hide_ack ();
1895 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
1896 void reset_default_ise (int client_id) {
1897 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1899 String initial_ise = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1901 if (initial_ise.length () > 0)
1902 m_signal_set_active_ise_by_uuid (initial_ise, 1);
1904 std::cerr << "Read SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID is failed!!!\n";
1906 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
1907 void set_keyboard_mode (int client_id, uint32 mode) {
1909 SCIM_DEBUG_MAIN (4) << "InfoManager::set_keyboard_mode ()\n";
1910 m_signal_set_keyboard_mode (mode);
1912 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
1913 void candidate_will_hide_ack (int client_id) {
1914 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "\n";
1916 m_signal_candidate_will_hide_ack ();
1919 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
1920 void get_active_helper_option (int client_id, _OUT_ uint32& option) {
1922 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1923 option = get_current_helper_option ();
1925 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
1926 void show_ise_option_window (int client_id) {
1927 SCIM_DEBUG_MAIN (4) << "InfoManager::show_ise_option_window ()\n";
1929 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1930 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1931 LOGD ("prepare to show ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
1933 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
1934 show_helper_option_window (m_current_helper_uuid);
1938 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
1939 void resume_ise_option_window (int client_id) {
1940 SCIM_DEBUG_MAIN (4) << "InfoManager::resume_ise_option_window ()\n";
1942 String initial_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_INITIAL_ISE_UUID), String (""));
1943 String default_uuid = scim_global_config_read (String (SCIM_GLOBAL_CONFIG_DEFAULT_ISE_UUID), String (""));
1944 LOGD ("prepare to resime ISE option window %d [%s] [%s]", client_id, initial_uuid.c_str (), default_uuid.c_str ());
1946 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode) {
1947 resume_helper_option_window (m_current_helper_uuid);
1951 //ISM_TRANS_CMD_EXPAND_CANDIDATE
1952 void expand_candidate () {
1954 m_signal_expand_candidate ();
1957 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
1958 void contract_candidate () {
1960 m_signal_contract_candidate ();
1962 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
1963 void get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info) {
1964 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
1966 m_signal_get_recent_ise_geometry (angle, info);
1969 bool check_privilege_by_sockfd (int client_id, const String& privilege) {
1970 return m_signal_check_privilege_by_sockfd (client_id, privilege);
1973 bool remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
1975 SCIM_DEBUG_MAIN(1) << "PanelAgent::update_preedit_string ()\n";
1981 get_focused_context (client, context);
1983 m_panel_agent_manager.remote_update_preedit_string (client, context, str, str, attrs, caret);
1991 bool remoteinput_commit_string (const WideString &str)
1993 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_commit_string ()\n";
1999 get_focused_context (client, context);
2001 m_panel_agent_manager.remote_commit_string (client, context, str);
2009 bool remoteinput_send_key_event (const KeyEvent &key)
2011 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_send_key_event ()\n";
2015 get_focused_context (client, context);
2017 m_panel_agent_manager.remote_send_key_event (client, context, key);
2023 bool remoteinput_forward_key_event (const KeyEvent &key)
2025 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_forward_key_event ()\n";
2029 get_focused_context (client, context);
2031 m_panel_agent_manager.remote_forward_key_event (client, context, key);
2037 bool remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
2039 SCIM_DEBUG_MAIN(1) << "PanelAgent::remote_delete_surrounding_text ()\n";
2043 get_focused_context (client, context);
2045 m_panel_agent_manager.remote_delete_surrounding_text (client, context, offset, len);
2051 Connection signal_connect_turn_on (InfoManagerSlotVoid* slot) {
2052 return m_signal_turn_on.connect (slot);
2055 Connection signal_connect_turn_off (InfoManagerSlotVoid* slot) {
2056 return m_signal_turn_off.connect (slot);
2059 Connection signal_connect_show_panel (InfoManagerSlotVoid* slot) {
2060 return m_signal_show_panel.connect (slot);
2063 Connection signal_connect_hide_panel (InfoManagerSlotVoid* slot) {
2064 return m_signal_hide_panel.connect (slot);
2067 Connection signal_connect_update_screen (InfoManagerSlotInt* slot) {
2068 return m_signal_update_screen.connect (slot);
2071 Connection signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot) {
2072 return m_signal_update_spot_location.connect (slot);
2075 Connection signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot) {
2076 return m_signal_update_factory_info.connect (slot);
2079 Connection signal_connect_start_default_ise (InfoManagerSlotVoid* slot) {
2080 return m_signal_start_default_ise.connect (slot);
2083 Connection signal_connect_stop_default_ise (InfoManagerSlotVoid* slot) {
2084 return m_signal_stop_default_ise.connect (slot);
2087 Connection signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot) {
2088 return m_signal_set_candidate_ui.connect (slot);
2091 Connection signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot) {
2092 return m_signal_get_candidate_ui.connect (slot);
2095 Connection signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot) {
2096 return m_signal_set_candidate_position.connect (slot);
2099 Connection signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot) {
2100 return m_signal_get_candidate_geometry.connect (slot);
2103 Connection signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot) {
2104 return m_signal_get_input_panel_geometry.connect (slot);
2107 Connection signal_connect_set_keyboard_ise (InfoManagerSlotString* slot) {
2108 return m_signal_set_keyboard_ise.connect (slot);
2111 Connection signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot) {
2112 return m_signal_get_keyboard_ise.connect (slot);
2115 Connection signal_connect_show_help (InfoManagerSlotString* slot) {
2116 return m_signal_show_help.connect (slot);
2119 Connection signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot) {
2120 return m_signal_show_factory_menu.connect (slot);
2123 Connection signal_connect_show_preedit_string (InfoManagerSlotVoid* slot) {
2124 return m_signal_show_preedit_string.connect (slot);
2127 Connection signal_connect_show_aux_string (InfoManagerSlotVoid* slot) {
2128 return m_signal_show_aux_string.connect (slot);
2131 Connection signal_connect_show_lookup_table (InfoManagerSlotVoid* slot) {
2132 return m_signal_show_lookup_table.connect (slot);
2135 Connection signal_connect_show_associate_table (InfoManagerSlotVoid* slot) {
2136 return m_signal_show_associate_table.connect (slot);
2139 Connection signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot) {
2140 return m_signal_hide_preedit_string.connect (slot);
2143 Connection signal_connect_hide_aux_string (InfoManagerSlotVoid* slot) {
2144 return m_signal_hide_aux_string.connect (slot);
2147 Connection signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot) {
2148 return m_signal_hide_lookup_table.connect (slot);
2151 Connection signal_connect_hide_associate_table (InfoManagerSlotVoid* slot) {
2152 return m_signal_hide_associate_table.connect (slot);
2155 Connection signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot) {
2156 return m_signal_update_preedit_string.connect (slot);
2159 Connection signal_connect_update_preedit_caret (InfoManagerSlotInt* slot) {
2160 return m_signal_update_preedit_caret.connect (slot);
2163 Connection signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot) {
2164 return m_signal_update_aux_string.connect (slot);
2167 Connection signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot) {
2168 return m_signal_update_lookup_table.connect (slot);
2171 Connection signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot) {
2172 return m_signal_update_associate_table.connect (slot);
2175 Connection signal_connect_register_properties (InfoManagerSlotPropertyList* slot) {
2176 return m_signal_register_properties.connect (slot);
2179 Connection signal_connect_update_property (InfoManagerSlotProperty* slot) {
2180 return m_signal_update_property.connect (slot);
2183 Connection signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot) {
2184 return m_signal_register_helper_properties.connect (slot);
2187 Connection signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot) {
2188 return m_signal_update_helper_property.connect (slot);
2191 Connection signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot) {
2192 return m_signal_register_helper.connect (slot);
2195 Connection signal_connect_remove_helper (InfoManagerSlotInt* slot) {
2196 return m_signal_remove_helper.connect (slot);
2199 Connection signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot) {
2200 return m_signal_set_active_ise_by_uuid.connect (slot);
2203 Connection signal_connect_focus_in (InfoManagerSlotVoid* slot) {
2204 return m_signal_focus_in.connect (slot);
2207 Connection signal_connect_focus_out (InfoManagerSlotVoid* slot) {
2208 return m_signal_focus_out.connect (slot);
2211 Connection signal_connect_expand_candidate (InfoManagerSlotVoid* slot) {
2212 return m_signal_expand_candidate.connect (slot);
2215 Connection signal_connect_contract_candidate (InfoManagerSlotVoid* slot) {
2216 return m_signal_contract_candidate.connect (slot);
2219 Connection signal_connect_select_candidate (InfoManagerSlotInt* slot) {
2220 return m_signal_select_candidate.connect (slot);
2223 Connection signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot) {
2224 return m_signal_get_ise_list.connect (slot);
2227 Connection signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot) {
2228 return m_signal_get_all_helper_ise_info.connect (slot);
2231 Connection signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot) {
2232 return m_signal_set_has_option_helper_ise_info.connect (slot);
2235 Connection signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot) {
2236 return m_signal_set_enable_helper_ise_info.connect (slot);
2239 Connection signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot) {
2240 return m_signal_show_helper_ise_list.connect (slot);
2243 Connection signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot) {
2244 return m_signal_show_helper_ise_selector.connect (slot);
2247 Connection signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot) {
2248 return m_signal_is_helper_ise_enabled.connect (slot);
2251 Connection signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot) {
2252 return m_signal_get_ise_information.connect (slot);
2255 Connection signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot) {
2256 return m_signal_get_keyboard_ise_list.connect (slot);
2259 Connection signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot) {
2260 return m_signal_update_ise_geometry.connect (slot);
2263 Connection signal_connect_get_language_list (InfoManagerSlotStringVector* slot) {
2264 return m_signal_get_language_list.connect (slot);
2267 Connection signal_connect_get_all_language (InfoManagerSlotStringVector* slot) {
2268 return m_signal_get_all_language.connect (slot);
2271 Connection signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot) {
2272 return m_signal_get_ise_language.connect (slot);
2275 Connection signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot) {
2276 return m_signal_get_ise_info_by_uuid.connect (slot);
2279 Connection signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot) {
2280 return m_signal_send_key_event.connect (slot);
2283 Connection signal_connect_accept_connection (InfoManagerSlotInt* slot) {
2284 return m_signal_accept_connection.connect (slot);
2287 Connection signal_connect_close_connection (InfoManagerSlotInt* slot) {
2288 return m_signal_close_connection.connect (slot);
2291 Connection signal_connect_exit (InfoManagerSlotVoid* slot) {
2292 return m_signal_exit.connect (slot);
2295 Connection signal_connect_transaction_start (InfoManagerSlotVoid* slot) {
2296 return m_signal_transaction_start.connect (slot);
2299 Connection signal_connect_transaction_end (InfoManagerSlotVoid* slot) {
2300 return m_signal_transaction_end.connect (slot);
2303 Connection signal_connect_lock (InfoManagerSlotVoid* slot) {
2304 return m_signal_lock.connect (slot);
2307 Connection signal_connect_unlock (InfoManagerSlotVoid* slot) {
2308 return m_signal_unlock.connect (slot);
2311 Connection signal_connect_update_input_context (InfoManagerSlotIntInt* slot) {
2312 return m_signal_update_input_context.connect (slot);
2315 Connection signal_connect_show_ise (InfoManagerSlotVoid* slot) {
2316 return m_signal_show_ise.connect (slot);
2319 Connection signal_connect_hide_ise (InfoManagerSlotVoid* slot) {
2320 return m_signal_hide_ise.connect (slot);
2323 Connection signal_connect_will_show_ack (InfoManagerSlotVoid* slot) {
2324 return m_signal_will_show_ack.connect (slot);
2327 Connection signal_connect_will_hide_ack (InfoManagerSlotVoid* slot) {
2328 return m_signal_will_hide_ack.connect (slot);
2331 Connection signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot) {
2332 return m_signal_set_keyboard_mode.connect (slot);
2335 Connection signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot) {
2336 return m_signal_candidate_will_hide_ack.connect (slot);
2339 Connection signal_connect_get_ise_state (InfoManagerSlotInt2* slot) {
2340 return m_signal_get_ise_state.connect (slot);
2343 Connection signal_connect_run_helper (InfoManagerSlotString3* slot)
2345 return m_signal_run_helper.connect (slot);
2348 Connection signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot) {
2349 return m_signal_get_recent_ise_geometry.connect (slot);
2352 Connection signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
2354 return m_signal_check_privilege_by_sockfd.connect (slot);
2357 Connection signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
2359 return m_signal_remoteinput_send_input_message.connect (slot);
2362 Connection signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
2364 return m_signal_remoteinput_send_surrounding_text.connect (slot);
2367 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
2368 void register_panel_client (uint32 client_id, uint32 id) {
2370 m_panel_client_map [client_id] = (int)id;
2372 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
2373 void register_input_context (uint32 client_id, uint32 context, String uuid) {
2375 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2376 m_client_context_uuids [ctx] = uuid;
2378 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
2379 void remove_input_context (uint32 client_id, uint32 context) {
2381 uint32 ctx = get_helper_ic (m_panel_client_map[client_id], context);
2382 m_client_context_uuids.erase (ctx);
2384 if (ctx == get_helper_ic (m_current_socket_client, m_current_client_context)) {
2386 m_current_socket_client = m_last_socket_client;
2387 m_current_client_context = m_last_client_context;
2388 m_current_context_uuid = m_last_context_uuid;
2389 m_last_socket_client = -1;
2390 m_last_client_context = 0;
2391 m_last_context_uuid = String ("");
2393 if (m_current_socket_client == -1) {
2395 socket_update_control_panel ();
2399 } else if (ctx == get_helper_ic (m_last_socket_client, m_last_client_context)) {
2401 m_last_socket_client = -1;
2402 m_last_client_context = 0;
2403 m_last_context_uuid = String ("");
2407 if (m_client_context_uuids.size () == 0)
2408 m_signal_stop_default_ise ();
2411 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
2412 void socket_reset_input_context (int client_id, uint32 context) {
2413 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_reset_input_context \n";
2416 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2417 socket_reset_helper_input_context (m_current_helper_uuid, m_panel_client_map[client_id], context);
2420 //SCIM_TRANS_CMD_FOCUS_IN
2421 void focus_in (int client_id, uint32 context, String uuid) {
2423 m_signal_focus_in ();
2424 focus_in_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2425 SCIM_DEBUG_MAIN (2) << "PanelAgent::focus_in (" << client_id << "," << context << "," << uuid << ")\n";
2426 m_active_client_id = client_id;
2429 if (m_current_socket_client >= 0) {
2430 m_last_socket_client = m_current_socket_client;
2431 m_last_client_context = m_current_client_context;
2432 m_last_context_uuid = m_current_context_uuid;
2435 m_current_socket_client = m_panel_client_map[client_id];
2436 m_current_client_context = context;
2437 m_current_context_uuid = uuid;
2441 //SCIM_TRANS_CMD_FOCUS_OUT
2442 void focus_out (int client_id, uint32 context) {
2444 m_signal_focus_out ();
2446 focus_out_helper (m_current_helper_uuid, m_panel_client_map[client_id], context);
2448 if (m_current_socket_client >= 0) {
2449 m_last_socket_client = m_current_socket_client;
2450 m_last_client_context = m_current_client_context;
2451 m_last_context_uuid = m_current_context_uuid;
2454 m_current_socket_client = -1;
2455 m_current_client_context = 0;
2456 m_current_context_uuid = String ("");
2460 //ISM_TRANS_CMD_TURN_ON_LOG
2461 void socket_turn_on_log (uint32 isOn) {
2465 DebugOutput::enable_debug (SCIM_DEBUG_AllMask);
2466 DebugOutput::set_verbose_level (7);
2467 SCIM_DEBUG_MAIN (4) << __func__ << " on\n";
2469 SCIM_DEBUG_MAIN (4) << __func__ << " off\n";
2470 DebugOutput::disable_debug (SCIM_DEBUG_AllMask);
2471 DebugOutput::set_verbose_level (0);
2475 uint32 focused_context;
2476 get_focused_context (focused_client, focused_context);
2478 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
2479 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2481 if (it != m_helper_client_index.end ()) {
2482 //uint32 ctx = get_helper_ic (focused_client, focused_context);
2484 //m_panel_agent_manager.socket_turn_on_log (it->second.id, ctx, m_current_helper_uuid, isOn);
2488 if (focused_client == -1) {
2489 std::cerr << __func__ << " get_focused_context is failed!!!\n";
2493 ClientInfo client_info = socket_get_client_info (focused_client);
2495 if (client_info.type == FRONTEND_CLIENT) {
2497 //m_panel_agent_manager.socket_turn_on_log (focused_client, focused_context, isOn);
2502 void add_client (int client_id, uint32 key, ClientType type) {
2503 LOGD ("id:%d, key:%d, type:%d", client_id, key, type);
2507 SCIM_DEBUG_MAIN (4) << "Add client to repository. Type=" << type << " key=" << key << "\n";
2509 m_client_repository [client_id] = info;
2511 if (info.type == IMCONTROL_ACT_CLIENT) {
2512 m_pending_active_imcontrol_id = client_id;
2513 } else if (info.type == IMCONTROL_CLIENT) {
2514 m_imcontrol_map [m_pending_active_imcontrol_id] = client_id;
2515 m_pending_active_imcontrol_id = -1;
2516 } else if (info.type == REMOTEINPUT_ACT_CLIENT) {
2517 m_current_send_remoteinput_id = client_id;
2518 m_send_remoteinput_map [m_current_send_remoteinput_id] = 1;
2519 } else if (info.type == REMOTEINPUT_CLIENT) {
2520 m_current_recv_remoteinput_id = client_id;
2521 m_recv_remoteinput_map [m_current_recv_remoteinput_id] = 1;
2524 LOGD ("%d clients connecting", m_client_repository.size());
2529 void del_client (int client_id) {
2531 m_signal_close_connection (client_id);
2532 ClientInfo client_info = socket_get_client_info (client_id);
2533 m_client_repository.erase (client_id);
2534 LOGD ("id:%d, type:%d", client_id, client_info.type);
2535 #ifdef PANEL_SERVER_AUTO_EXIT
2536 /* Exit panel if there is no connected client anymore. */
2537 if (client_info.type != UNKNOWN_CLIENT && m_client_repository.size () == 0 && !m_should_resident) {
2538 SCIM_DEBUG_MAIN (4) << "Exit Socket Server Thread.\n";
2539 server->shutdown ();
2540 m_signal_exit.emit ();
2544 LOGD ("id:%d type:%d", client_id, client_info.type);
2546 if (client_info.type == FRONTEND_CLIENT) {
2547 SCIM_DEBUG_MAIN (4) << "It's a FrontEnd client.\n";
2549 /* The focused client is closed. */
2550 if (m_current_socket_client == client_id) {
2551 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)
2552 hide_helper (m_current_helper_uuid);
2555 m_current_socket_client = -1;
2556 m_current_client_context = 0;
2557 m_current_context_uuid = String ("");
2559 socket_transaction_start ();
2561 socket_transaction_end ();
2564 if (m_last_socket_client == client_id) {
2566 m_last_socket_client = -1;
2567 m_last_client_context = 0;
2568 m_last_context_uuid = String ("");
2572 /* Erase all associated Client Context UUIDs. */
2573 std::vector <uint32> ctx_list;
2574 ClientContextUUIDRepository::iterator it = m_client_context_uuids.begin ();
2576 for (; it != m_client_context_uuids.end (); ++it) {
2577 if ((it->first & 0xFFFF) == (client_id & 0xFFFF))
2578 ctx_list.push_back (it->first);
2581 for (size_t i = 0; i < ctx_list.size (); ++i)
2582 m_client_context_uuids.erase (ctx_list [i]);
2584 /* Erase all helperise info associated with the client */
2586 it = m_client_context_helper.begin ();
2588 for (; it != m_client_context_helper.end (); ++it) {
2589 if ((it->first & 0xFFFF) == (client_id & 0xFFFF)) {
2590 ctx_list.push_back (it->first);
2591 /* similar to stop_helper except that it will not call get_focused_context() */
2592 String uuid = it->second;
2594 if (m_helper_uuid_count.find (uuid) != m_helper_uuid_count.end ()) {
2595 uint32 count = m_helper_uuid_count[uuid];
2598 m_helper_uuid_count.erase (uuid);
2599 HelperClientIndex::iterator pise = m_helper_client_index.find (uuid);
2601 if (pise != m_helper_client_index.end ()) {
2602 stop_helper (uuid, pise->second.id, it->first);
2605 SCIM_DEBUG_MAIN (1) << "Stop HelperISE " << uuid << " ...\n";
2607 m_helper_uuid_count[uuid] = count - 1;
2608 focus_out_helper (uuid, (it->first & 0xFFFF), ((it->first >> 16) & 0x7FFF));
2609 SCIM_DEBUG_MAIN (1) << "Decrement usage count of HelperISE " << uuid
2610 << " to " << m_helper_uuid_count[uuid] << "\n";
2616 for (size_t i = 0; i < ctx_list.size (); ++i)
2617 m_client_context_helper.erase (ctx_list [i]);
2619 HelperInfoRepository::iterator iter = m_helper_info_repository.begin ();
2621 for (; iter != m_helper_info_repository.end (); iter++) {
2622 if (!m_current_helper_uuid.compare (iter->second.uuid))
2623 if (! (iter->second.option & ISM_ISE_HIDE_IN_CONTROL_PANEL))
2624 socket_update_control_panel ();
2626 } else if (client_info.type == FRONTEND_ACT_CLIENT) {
2627 SCIM_DEBUG_MAIN (4) << "It's a FRONTEND_ACT_CLIENT client.\n";
2628 IntIntRepository::iterator iter2 = m_panel_client_map.find (client_id);
2630 if (iter2 != m_panel_client_map.end ())
2631 m_panel_client_map.erase (iter2);
2632 } else if (client_info.type == HELPER_CLIENT) {
2633 SCIM_DEBUG_MAIN (4) << "It's a Helper client.\n";
2635 HelperInfoRepository::iterator hiit = m_helper_info_repository.find (client_id);
2637 if (hiit != m_helper_info_repository.end ()) {
2638 bool restart = false;
2639 String uuid = hiit->second.uuid;
2640 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
2642 if ((hiit->second.option & SCIM_HELPER_AUTO_RESTART) &&
2643 (it != m_helper_client_index.end () && it->second.ref > 0))
2646 m_helper_client_index.erase (uuid);
2647 m_helper_info_repository.erase (hiit);
2649 if (restart && !m_ise_exiting) {
2650 struct tms tiks_buf;
2651 static clock_t start_tiks = times (&tiks_buf);
2652 static double clock_tiks = (double)sysconf (_SC_CLK_TCK);
2653 clock_t curr_tiks = times (&tiks_buf);
2654 double secs = (double) (curr_tiks - start_tiks) / clock_tiks;
2655 //LOGE ("time second:%f\n", secs);
2656 static String restart_uuid;
2658 if (restart_uuid != uuid || secs > MIN_REPEAT_TIME) {
2659 scim_usleep (100000);
2660 m_signal_run_helper (uuid, m_config_name, m_display_name);
2661 restart_uuid = uuid;
2662 LOGE ("Auto restart soft ISE:%s", uuid.c_str ());
2664 reset_default_ise (0);
2665 ISF_SAVE_LOG ("Auto restart is abnormal, reset default ISE\n");
2668 start_tiks = curr_tiks;
2672 m_ise_exiting = false;
2674 socket_transaction_start ();
2675 m_signal_remove_helper (client_id);
2676 socket_transaction_end ();
2677 } else if (client_info.type == HELPER_ACT_CLIENT) {
2678 SCIM_DEBUG_MAIN (4) << "It's a Helper passive client.\n";
2680 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client_id);
2682 if (hiit != m_helper_active_info_repository.end ())
2683 m_helper_active_info_repository.erase (hiit);
2686 } else if (client_info.type == IMCONTROL_ACT_CLIENT) {
2687 SCIM_DEBUG_MAIN (4) << "It's a IMCONTROL_ACT_CLIENT client.\n";
2688 IMControlRepository::iterator iter = m_imcontrol_repository.find (client_id);
2690 if (iter != m_imcontrol_repository.end ()) {
2691 int size = iter->second.info.size ();
2695 stop_helper ((iter->second.info)[i].uuid, (iter->second.count)[i], DEFAULT_CONTEXT_VALUE);
2697 if ((iter->second.info)[i].option & ISM_ISE_HIDE_IN_CONTROL_PANEL)
2698 m_current_helper_uuid = m_last_helper_uuid;
2703 m_imcontrol_repository.erase (iter);
2706 IntIntRepository::iterator iter2 = m_imcontrol_map.find (client_id);
2708 if (iter2 != m_imcontrol_map.end ())
2709 m_imcontrol_map.erase (iter2);
2710 } else if (client_info.type == REMOTEINPUT_ACT_CLIENT) {
2711 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_ACT_CLIENT client.\n";
2713 IntIntRepository::iterator iter = m_send_remoteinput_map.find (client_id);
2715 if (iter != m_send_remoteinput_map.end())
2716 m_send_remoteinput_map.erase (iter);
2718 m_current_send_remoteinput_id = -1;
2719 } else if (client_info.type == REMOTEINPUT_CLIENT) {
2720 SCIM_DEBUG_MAIN (4) << "It's a REMOTEINPUT_CLIENT client.\n";
2722 IntIntRepository::iterator iter = m_recv_remoteinput_map.find (client_id);
2724 if (iter != m_recv_remoteinput_map.end())
2725 m_recv_remoteinput_map.erase (iter);
2727 m_current_recv_remoteinput_id = -1;
2728 } else if (client_info.type == CONFIG_CLIENT) {
2729 SCIM_DEBUG_MAIN(4) << "It's a CONFIG_CLIENT client.\n";
2731 LOGI ("clients: %d, panel clients: %d, imcontrols size: %d, helper infos: %d, \
2732 helper active infos: %d, helper client indexs: %d, ises pending: %d, \
2733 imcontrols: %d, start helper ic indexs: %d, client context uuids: %d, \
2734 client context helpers: %d, helpers uuid count: %d",
2735 m_client_repository.size(),
2736 m_panel_client_map.size(),
2737 m_imcontrol_map.size(),
2738 m_helper_info_repository.size(),
2739 m_helper_active_info_repository.size(),
2740 m_helper_client_index.size(),
2741 m_ise_pending_repository.size(),
2742 m_imcontrol_repository.size(),
2743 m_start_helper_ic_index.size(),
2744 m_client_context_uuids.size(),
2745 m_client_context_helper.size(),
2746 m_helper_uuid_count.size());
2749 const ClientInfo& socket_get_client_info (int client) {
2750 static ClientInfo null_client = { 0, UNKNOWN_CLIENT };
2751 ClientRepository::iterator it = m_client_repository.find (client);
2753 if (it != m_client_repository.end ())
2759 //SCIM_TRANS_CMD_PANEL_TURN_ON
2760 void socket_turn_on (void) {
2761 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_on ()\n";
2763 m_signal_turn_on ();
2765 //SCIM_TRANS_CMD_PANEL_TURN_OFF
2766 void socket_turn_off (void) {
2767 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_turn_off ()\n";
2769 m_signal_turn_off ();
2771 //SCIM_TRANS_CMD_UPDATE_SCREEN
2772 void socket_update_screen (int client_id, uint32 num) {
2773 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_screen ()\n";
2776 if (((int) num) != m_current_screen) {
2777 SCIM_DEBUG_MAIN (4) << "New Screen number = " << num << "\n";
2778 m_signal_update_screen ((int) num);
2779 helper_all_update_screen ((int) num);
2780 m_current_screen = (num);
2783 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
2784 void socket_update_spot_location (uint32 x, uint32 y, uint32 top_y) {
2785 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_spot_location ()\n";
2787 SCIM_DEBUG_MAIN (4) << "New Spot location x=" << x << " y=" << y << "\n";
2788 m_signal_update_spot_location ((int)x, (int)y, (int)top_y);
2789 helper_all_update_spot_location ((int)x, (int)y);
2791 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
2792 void socket_update_cursor_position (uint32 cursor_pos) {
2793 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_cursor_position ()\n";
2795 SCIM_DEBUG_MAIN (4) << "New cursor position pos=" << cursor_pos << "\n";
2796 helper_all_update_cursor_position ((int)cursor_pos);
2798 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
2799 void socket_update_surrounding_text (String text, uint32 cursor) {
2800 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
2802 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2804 if (it != m_helper_client_index.end ()) {
2809 get_focused_context (client, context);
2810 ctx = get_helper_ic (client, context);
2811 m_panel_agent_manager.socket_update_surrounding_text (it->second.id, ctx, m_current_helper_uuid, text, cursor);
2816 void remoteinput_callback_focus_in () {
2817 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
2821 m_panel_agent_manager.socket_remoteinput_focus_in (m_current_recv_remoteinput_id);
2825 void remoteinput_callback_focus_out () {
2826 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
2830 m_panel_agent_manager.socket_remoteinput_focus_out (m_current_recv_remoteinput_id);
2834 void remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled) {
2835 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
2839 m_panel_agent_manager.socket_remoteinput_entry_metadata (m_current_recv_remoteinput_id, hint, layout, variation, autocapital_type, return_key_disabled);
2843 void remoteinput_callback_surrounding_text (String text, uint32 cursor) {
2844 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
2848 m_panel_agent_manager.socket_remoteinput_surrounding_text (m_current_recv_remoteinput_id, text, cursor);
2852 void remoteinput_callback_input_resource (uint32 input_resource) {
2853 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
2857 m_panel_agent_manager.socket_remoteinput_input_resource (m_current_recv_remoteinput_id, input_resource);
2861 //ISM_TRANS_CMD_UPDATE_SELECTION
2862 void socket_update_selection (String text) {
2863 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n";
2865 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
2867 if (it != m_helper_client_index.end ()) {
2872 get_focused_context (client, context);
2873 ctx = get_helper_ic (client, context);
2874 m_panel_agent_manager.socket_update_selection (it->second.id, ctx, m_current_helper_uuid, text);
2878 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
2879 void socket_update_factory_info (PanelFactoryInfo& info) {
2880 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_factory_info ()\n";
2882 SCIM_DEBUG_MAIN (4) << "New Factory info uuid=" << info.uuid << " name=" << info.name << "\n";
2883 info.lang = scim_get_normalized_language (info.lang);
2884 m_signal_update_factory_info (info);
2886 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
2887 void socket_show_help (String help) {
2888 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_help ()\n";
2890 m_signal_show_help (help);
2892 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
2893 void socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec) {
2894 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_factory_menu ()\n";
2898 m_signal_show_factory_menu (vec);
2902 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
2903 void socket_show_preedit_string (void) {
2905 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_preedit_string ()\n";
2906 m_signal_show_preedit_string ();
2908 //SCIM_TRANS_CMD_SHOW_AUX_STRING
2909 void socket_show_aux_string (void) {
2911 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_aux_string ()\n";
2912 m_signal_show_aux_string ();
2914 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
2915 void socket_show_lookup_table (void) {
2917 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_lookup_table ()\n";
2918 m_signal_show_lookup_table ();
2920 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
2921 void socket_show_associate_table (void) {
2923 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_show_associate_table ()\n";
2924 m_signal_show_associate_table ();
2926 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
2927 void socket_hide_preedit_string (void) {
2929 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_preedit_string ()\n";
2930 m_signal_hide_preedit_string ();
2932 //SCIM_TRANS_CMD_HIDE_AUX_STRING
2933 void socket_hide_aux_string (void) {
2935 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_aux_string ()\n";
2936 m_signal_hide_aux_string ();
2938 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
2939 void socket_hide_lookup_table (void) {
2941 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_lookup_table ()\n";
2942 m_signal_hide_lookup_table ();
2944 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
2945 void socket_hide_associate_table (void) {
2947 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_associate_table ()\n";
2948 m_signal_hide_associate_table ();
2950 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
2951 void socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret) {
2952 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_string ()\n";
2954 m_signal_update_preedit_string (str, attrs, (int) caret);
2956 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
2957 void socket_update_preedit_caret (uint32 caret) {
2958 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_preedit_caret ()\n";
2960 m_signal_update_preedit_caret ((int) caret);
2962 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
2963 void socket_update_aux_string (String& str, const AttributeList& attrs) {
2964 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_aux_string ()\n";
2966 m_signal_update_aux_string (str, attrs);
2967 m_is_imengine_aux = true;
2969 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
2970 void socket_update_lookup_table (const LookupTable& table) {
2971 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_lookup_table ()\n";
2974 //g_isf_candidate_table = _isf_candidate_table;
2975 m_signal_update_lookup_table (table);
2976 m_is_imengine_candidate = true;
2978 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
2979 void socket_update_associate_table (const LookupTable& table) {
2980 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_associate_table ()\n";
2982 m_signal_update_associate_table (table);
2985 void socket_update_control_panel (void) {
2986 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_control_panel ()\n";
2988 m_signal_get_keyboard_ise (name, uuid);
2989 PanelFactoryInfo info;
2991 if (name.length () > 0)
2992 info = PanelFactoryInfo (uuid, name, String (""), String (""));
2994 info = PanelFactoryInfo (String (""), String (_ ("English Keyboard")), String ("C"), String (SCIM_KEYBOARD_ICON_FILE));
2996 m_signal_update_factory_info (info);
2998 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
2999 void socket_register_properties (const PropertyList& properties) {
3000 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_register_properties ()\n";
3002 m_signal_register_properties (properties);
3004 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3005 void socket_update_property (const Property& property) {
3006 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_update_property ()\n";
3008 m_signal_update_property (property);
3010 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
3011 void socket_get_keyboard_ise_list (String& uuid) {
3012 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise_list ()\n";
3014 std::vector<String> list;
3016 m_signal_get_keyboard_ise_list (list);
3017 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3019 if (it != m_helper_client_index.end ()) {
3022 get_focused_context (client, context);
3023 uint32 ctx = get_helper_ic (client, context);
3024 m_panel_agent_manager.socket_get_keyboard_ise_list (it->second.id, ctx, uuid, list);
3027 //ISM_TRANS_CMD_SET_CANDIDATE_UI
3028 void socket_set_candidate_ui (uint32 portrait_line, uint32 mode) {
3029 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3031 m_signal_set_candidate_ui (portrait_line, mode);
3033 //ISM_TRANS_CMD_GET_CANDIDATE_UI
3034 void socket_get_candidate_ui (String uuid) {
3036 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_candidate_ui ()\n";
3037 int style = 0, mode = 0;
3038 m_signal_get_candidate_ui (style, mode);
3039 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3041 if (it != m_helper_client_index.end ()) {
3044 get_focused_context (client, context);
3045 uint32 ctx = get_helper_ic (client, context);
3046 m_panel_agent_manager.socket_get_candidate_ui (it->second.id, ctx, uuid, style, mode);
3049 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
3050 void socket_set_candidate_position (uint32 left, uint32 top) {
3052 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_candidate_position ()\n";
3053 m_signal_set_candidate_position (left, top);
3055 //ISM_TRANS_CMD_HIDE_CANDIDATE
3056 void socket_hide_candidate (void) {
3057 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_hide_candidate ()\n";
3059 m_signal_hide_preedit_string ();
3060 m_signal_hide_aux_string ();
3061 m_signal_hide_lookup_table ();
3062 m_signal_hide_associate_table ();
3064 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
3065 void socket_get_candidate_geometry (String& uuid) {
3067 SCIM_DEBUG_MAIN (4) << __func__ << " \n";
3068 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3070 if (it != m_helper_client_index.end ()) {
3071 struct rectinfo info = {0, 0, 0, 0};
3072 m_signal_get_candidate_geometry (info);
3075 get_focused_context (client, context);
3076 uint32 ctx = get_helper_ic (client, context);
3077 m_panel_agent_manager.socket_get_candidate_geometry (it->second.id, ctx, uuid, info);
3080 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
3081 void socket_set_keyboard_ise (String uuid) {
3082 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3084 m_signal_set_keyboard_ise (uuid);
3086 //ISM_TRANS_CMD_SELECT_CANDIDATE
3087 void socket_helper_select_candidate (uint32 index) {
3088 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_set_keyboard_ise ()\n";
3090 m_signal_select_candidate (index);
3092 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
3093 void socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height) {
3094 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3096 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3098 if (it != m_helper_active_info_repository.end ()) {
3099 if (it->second.uuid == m_current_helper_uuid)
3100 m_signal_update_ise_geometry (x, y, width, height);
3103 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
3104 void socket_get_keyboard_ise (String uuid) {
3105 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_get_keyboard_ise ()\n";
3107 String ise_name, ise_uuid;
3111 get_focused_context (client, context);
3112 ctx = get_helper_ic (client, context);
3114 if (m_client_context_uuids.find (ctx) != m_client_context_uuids.end ())
3115 ise_uuid = m_client_context_uuids[ctx];
3117 m_signal_get_keyboard_ise (ise_name, ise_uuid);
3118 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3120 if (it != m_helper_client_index.end ()) {
3121 get_focused_context (client, context);
3122 ctx = get_helper_ic (client, context);
3123 m_panel_agent_manager.socket_get_keyboard_ise (it->second.id, ctx, uuid, ise_name, ise_uuid);
3127 //SCIM_TRANS_CMD_START_HELPER
3128 void socket_start_helper (int client_id, uint32 context, String uuid) {
3129 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_start_helper ()\n";
3131 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3133 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3135 /* Get the context uuid from the client context registration table. */
3137 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3139 if (it != m_client_context_uuids.end ())
3140 ic_uuid = it->second;
3143 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3144 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3145 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3146 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3149 if (it == m_helper_client_index.end ()) {
3150 SCIM_DEBUG_MAIN (5) << "Run this Helper.\n";
3151 m_start_helper_ic_index [uuid].push_back (std::make_pair (ic, ic_uuid));
3152 m_signal_run_helper (uuid, m_config_name, m_display_name);
3154 SCIM_DEBUG_MAIN (5) << "Increase the Reference count.\n";
3155 m_panel_agent_manager.socket_start_helper (it->second.id, ic, ic_uuid);
3161 //SCIM_TRANS_CMD_STOP_HELPER
3162 void socket_stop_helper (int client_id, uint32 context, String uuid) {
3163 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_stop_helper ()\n";
3165 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3167 uint32 ic = get_helper_ic (m_panel_client_map[client_id], context);
3169 if (it != m_helper_client_index.end ()) {
3170 SCIM_DEBUG_MAIN (5) << "Decrase the Reference count.\n";
3173 /* Get the context uuid from the client context registration table. */
3175 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3177 if (it != m_client_context_uuids.end ())
3178 ic_uuid = it->second;
3181 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3182 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3183 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3184 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3187 m_panel_agent_manager.helper_detach_input_context (it->second.id, ic, ic_uuid);
3189 if (it->second.ref <= 0)
3190 m_panel_agent_manager.exit (it->second.id, ic);
3195 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
3196 void socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans) {
3197 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_send_helper_event ()\n";
3199 HelperClientIndex::iterator it = m_helper_client_index.find (uuid);
3201 if (it != m_helper_client_index.end ()) {
3203 /* Get the context uuid from the client context registration table. */
3205 ClientContextUUIDRepository::iterator it = m_client_context_uuids.find (get_helper_ic (m_panel_client_map[client_id], context));
3207 if (it != m_client_context_uuids.end ())
3208 ic_uuid = it->second;
3211 if (m_current_socket_client == m_panel_client_map[client_id] && m_current_client_context == context) {
3212 if (!ic_uuid.length ()) ic_uuid = m_current_context_uuid;
3213 } else if (m_last_socket_client == m_panel_client_map[client_id] && m_last_client_context == context) {
3214 if (!ic_uuid.length ()) ic_uuid = m_last_context_uuid;
3217 m_panel_agent_manager.helper_process_imengine_event (it->second.id, get_helper_ic (m_panel_client_map[client_id], context), ic_uuid, _nest_trans);
3221 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
3222 void socket_helper_register_properties (int client, PropertyList& properties) {
3223 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_properties (" << client << ")\n";
3225 m_signal_register_helper_properties (client, properties);
3227 #if 0 //why? remove if useless, infinite loop
3228 /* Check whether application is already focus_in */
3229 if (m_current_socket_client != -1) {
3230 SCIM_DEBUG_MAIN (2) << "Application is already focus_in!\n";
3231 focus_in_helper (m_current_helper_uuid, m_current_socket_client, m_current_client_context);
3232 reset_keyboard_ise ();
3235 /* Check whether ISE panel is already shown */
3236 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode && m_ise_context_length > 0) {
3237 SCIM_DEBUG_MAIN (2) << "Re-show ISE panel!\n";
3239 uint32 focused_context;
3240 get_focused_context (focused_client, focused_context);
3242 if (focused_client == -1 && m_active_client_id != -1) {
3243 focused_client = m_panel_client_map[m_active_client_id];
3244 focused_context = 0;
3247 uint32 ctx = get_helper_ic (focused_client, focused_context);
3248 bool ret = show_helper (m_current_helper_uuid, m_ise_context_buffer, m_ise_context_length, ctx);
3251 m_signal_show_ise ();
3255 //SCIM_TRANS_CMD_UPDATE_PROPERTY
3256 void socket_helper_update_property (int client, Property& property) {
3257 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_property (" << client << ")\n";
3259 m_signal_update_helper_property (client, property);
3261 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
3262 void socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans) {
3263 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_imengine_event (" << client << ")\n";
3265 HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3267 if (hiit != m_helper_active_info_repository.end ()) {
3269 uint32 target_context;
3270 get_imengine_client_context (target_ic, target_client, target_context);
3272 uint32 focused_context;
3273 String focused_uuid;
3274 focused_uuid = get_focused_context (focused_client, focused_context);
3276 if (target_ic == (uint32) (-1)) {
3277 target_client = focused_client;
3278 target_context = focused_context;
3281 if (target_uuid.length () == 0)
3282 target_uuid = focused_uuid;
3284 ClientInfo client_info = socket_get_client_info (target_client);
3285 SCIM_DEBUG_MAIN (5) << "Target UUID = " << target_uuid << " Focused UUId = " << focused_uuid << "\nTarget Client = " << target_client << "\n";
3287 if (client_info.type == FRONTEND_CLIENT) {
3288 m_panel_agent_manager.process_helper_event (target_client, target_context, target_uuid, hiit->second.uuid, nest_trans);
3293 void socket_helper_key_event_op (int client, int cmd, uint32 target_ic, String& target_uuid, KeyEvent& key) {
3294 if (!key.empty ()) {
3296 uint32 target_context;
3297 get_imengine_client_context (target_ic, target_client, target_context);
3299 uint32 focused_context;
3300 String focused_uuid;
3301 focused_uuid = get_focused_context (focused_client, focused_context);
3303 if (target_ic == (uint32) (-1)) {
3304 target_client = focused_client;
3305 target_context = focused_context;
3308 if (target_uuid.length () == 0)
3309 target_uuid = focused_uuid;
3311 if (target_client == -1) {
3312 /* FIXUP: monitor 'Invalid Window' error */
3313 LOGW ("focused target client is NULL");
3314 } else if (target_client == focused_client && target_context == focused_context && target_uuid == focused_uuid) {
3315 ClientInfo client_info = socket_get_client_info (target_client);
3317 if (client_info.type == FRONTEND_CLIENT) {
3318 m_panel_agent_manager.socket_helper_key_event (target_client, target_context, cmd, key);
3323 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
3324 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
3325 void socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3326 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_send_key_event (" << client << ")\n";
3327 ISF_PROF_DEBUG ("first message")
3329 socket_helper_key_event_op (client, SCIM_TRANS_CMD_PROCESS_KEY_EVENT, target_ic, target_uuid, key);
3331 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
3332 void socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key) {
3333 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_forward_key_event (" << client << ")\n";
3335 socket_helper_key_event_op (client, SCIM_TRANS_CMD_FORWARD_KEY_EVENT, target_ic, target_uuid, key);
3338 //SCIM_TRANS_CMD_COMMIT_STRING
3339 void socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr) {
3340 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_commit_string (" << client << ")\n";
3343 if (wstr.length ()) {
3345 uint32 target_context;
3346 get_imengine_client_context (target_ic, target_client, target_context);
3348 uint32 focused_context;
3349 String focused_uuid;
3350 focused_uuid = get_focused_context (focused_client, focused_context);
3352 if (target_ic == (uint32) (-1)) {
3353 target_client = focused_client;
3354 target_context = focused_context;
3357 if (target_uuid.length () == 0)
3358 target_uuid = focused_uuid;
3360 if (target_client == focused_client &&
3361 target_context == focused_context &&
3362 target_uuid == focused_uuid) {
3363 ClientInfo client_info = socket_get_client_info (target_client);
3365 if (client_info.type == FRONTEND_CLIENT) {
3366 m_panel_agent_manager.commit_string (target_client, target_context, wstr);
3368 std::cerr << "target client is not existed!!!" << "\n";
3373 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
3374 void socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after) {
3375 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3378 uint32 focused_context;
3379 String focused_uuid = get_focused_context (focused_client, focused_context);
3380 ClientInfo client_info = socket_get_client_info (focused_client);
3382 if (client_info.type == FRONTEND_CLIENT) {
3383 m_panel_agent_manager.socket_helper_get_surrounding_text (focused_client, focused_context, maxlen_before, maxlen_after);
3386 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
3387 void socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len) {
3388 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3391 uint32 focused_context;
3392 String focused_uuid = get_focused_context (focused_client, focused_context);
3393 ClientInfo client_info = socket_get_client_info (focused_client);
3395 if (client_info.type == FRONTEND_CLIENT) {
3396 m_panel_agent_manager.socket_helper_delete_surrounding_text (focused_client, focused_context, offset, len);
3399 //SCIM_TRANS_CMD_GET_SELECTION
3400 void socket_helper_get_selection (int client, String uuid) {
3401 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3404 uint32 focused_context;
3405 String focused_uuid = get_focused_context (focused_client, focused_context);
3406 ClientInfo client_info = socket_get_client_info (focused_client);
3408 if (client_info.type == FRONTEND_CLIENT) {
3409 m_panel_agent_manager.socket_helper_get_selection (focused_client, focused_context);
3412 //SCIM_TRANS_CMD_SET_SELECTION
3413 void socket_helper_set_selection (int client, uint32 start, uint32 end) {
3414 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3417 uint32 focused_context;
3418 String focused_uuid = get_focused_context (focused_client, focused_context);
3419 ClientInfo client_info = socket_get_client_info (focused_client);
3421 if (client_info.type == FRONTEND_CLIENT) {
3422 m_panel_agent_manager.socket_helper_set_selection (focused_client, focused_context, start, end);
3426 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
3427 void socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid) {
3428 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_show_preedit_string (" << client << ")\n";
3431 uint32 target_context;
3432 get_imengine_client_context (target_ic, target_client, target_context);
3434 uint32 focused_context;
3435 String focused_uuid = get_focused_context (focused_client, focused_context);
3437 if (target_ic == (uint32) (-1)) {
3438 target_client = focused_client;
3439 target_context = focused_context;
3442 if (target_uuid.length () == 0)
3443 target_uuid = focused_uuid;
3445 if (target_client == focused_client &&
3446 target_context == focused_context &&
3447 target_uuid == focused_uuid) {
3448 ClientInfo client_info = socket_get_client_info (target_client);
3450 if (client_info.type == FRONTEND_CLIENT) {
3451 m_panel_agent_manager.show_preedit_string (target_client, target_context);
3455 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
3456 void socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid) {
3457 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_hide_preedit_string (" << client << ")\n";
3460 uint32 target_context;
3461 get_imengine_client_context (target_ic, target_client, target_context);
3463 uint32 focused_context;
3464 String focused_uuid = get_focused_context (focused_client, focused_context);
3466 if (target_ic == (uint32) (-1)) {
3467 target_client = focused_client;
3468 target_context = focused_context;
3471 if (target_uuid.length () == 0)
3472 target_uuid = focused_uuid;
3474 if (target_client == focused_client &&
3475 target_context == focused_context &&
3476 target_uuid == focused_uuid) {
3477 ClientInfo client_info = socket_get_client_info (target_client);
3479 if (client_info.type == FRONTEND_CLIENT) {
3480 m_panel_agent_manager.hide_preedit_string (target_client, target_context);
3484 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
3485 void socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret) {
3486 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_preedit_string (" << client << ")\n";
3489 uint32 target_context;
3490 get_imengine_client_context (target_ic, target_client, target_context);
3492 uint32 focused_context;
3493 String focused_uuid;
3494 focused_uuid = get_focused_context (focused_client, focused_context);
3496 if (target_ic == (uint32) (-1)) {
3497 target_client = focused_client;
3498 target_context = focused_context;
3501 if (target_uuid.length () == 0)
3502 target_uuid = focused_uuid;
3504 if (target_client == focused_client &&
3505 target_context == focused_context &&
3506 target_uuid == focused_uuid) {
3507 ClientInfo client_info = socket_get_client_info (target_client);
3509 if (client_info.type == FRONTEND_CLIENT) {
3510 m_panel_agent_manager.update_preedit_string (target_client, target_context, preedit, commit, attrs, caret);
3514 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
3515 void socket_helper_update_preedit_caret (int client, uint32 caret) {
3516 SCIM_DEBUG_MAIN (4) << __func__ << " (" << client << ")\n";
3519 uint32 focused_context;
3520 String focused_uuid;
3521 focused_uuid = get_focused_context (focused_client, focused_context);
3522 ClientInfo client_info = socket_get_client_info (focused_client);
3524 if (client_info.type == FRONTEND_CLIENT) {
3525 m_panel_agent_manager.update_preedit_caret (focused_client, focused_context, caret);
3529 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
3530 void socket_helper_register_helper (int client, HelperInfo& info) {
3531 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper (" << client << ")\n";
3532 bool result = false;
3540 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3541 LOGD ("This helper is not IME");
3544 info.option = option;
3546 if (info.uuid.length ()) {
3547 SCIM_DEBUG_MAIN (4) << "New Helper uuid=" << info.uuid << " name=" << info.name << "\n";
3548 HelperClientIndex::iterator it = m_helper_client_index.find (info.uuid);
3550 if (it == m_helper_client_index.end ()) {
3551 m_helper_info_repository [client] = info;
3552 m_helper_client_index [info.uuid] = HelperClientStub (client, 1);
3553 StartHelperICIndex::iterator icit = m_start_helper_ic_index.find (info.uuid);
3555 if (icit != m_start_helper_ic_index.end ()) {
3556 m_panel_agent_manager.helper_attach_input_context_and_update_screen (client, icit->second, m_current_screen);
3557 m_start_helper_ic_index.erase (icit);
3567 m_signal_register_helper (client, info);
3570 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
3571 void socket_helper_register_helper_passive (int client, HelperInfo& info) {
3572 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_register_helper_passive (" << client << ")\n";
3580 if (!m_signal_get_ise_information (info.uuid, info.name, language, type, option, module_name)) {
3581 LOGD ("This helper is not IME");
3584 info.option = option;
3586 if (info.uuid.length ()) {
3587 SCIM_DEBUG_MAIN (4) << "New Helper Passive uuid=" << info.uuid << " name=" << info.name << "\n";
3588 HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client);
3590 if (it == m_helper_active_info_repository.end ()) {
3591 m_helper_active_info_repository[client] = info;
3594 StringIntRepository::iterator iter = m_ise_pending_repository.find (info.uuid);
3596 if (iter != m_ise_pending_repository.end ()) {
3597 m_ise_pending_repository.erase (iter);
3600 iter = m_ise_pending_repository.find (info.name);
3602 if (iter != m_ise_pending_repository.end ()) {
3603 m_ise_pending_repository.erase (iter);
3609 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
3610 void socket_helper_update_input_context (int client, uint32 type, uint32 value) {
3611 SCIM_DEBUG_MAIN (4) << "InfoManager::socket_helper_update_input_context (" << client << ")\n";
3613 m_signal_update_input_context ((int)type, (int)value);
3615 uint32 focused_context;
3616 get_focused_context (focused_client, focused_context);
3617 ClientInfo client_info = socket_get_client_info (focused_client);
3619 if (client_info.type == FRONTEND_CLIENT) {
3620 m_panel_agent_manager.update_ise_input_context (focused_client, focused_context, type, value);
3622 std::cerr << "focused client is not existed!!!" << "\n";
3625 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
3626 void socket_helper_send_private_command (int client, String command) {
3627 SCIM_DEBUG_MAIN (4) << __FUNCTION__ << " (" << client << ")\n";
3630 uint32 focused_context;
3631 String focused_uuid = get_focused_context (focused_client, focused_context);
3632 ClientInfo client_info = socket_get_client_info (focused_client);
3634 if (client_info.type == FRONTEND_CLIENT) {
3635 m_panel_agent_manager.send_private_command (focused_client, focused_context, command);
3638 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
3639 //void UPDATE_ISE_EXIT (int client) {
3641 // HelperInfoRepository::iterator hiit = m_helper_active_info_repository.find (client);
3643 // if (hiit != m_helper_active_info_repository.end ()) {
3644 // String l_uuid = hiit->second.uuid;
3645 // HelperClientIndex::iterator it = m_helper_client_index.find (l_uuid);
3647 // if (it != m_helper_client_index.end ()) {
3648 // del_client (it->second.id);
3652 // del_client (client);
3655 void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
3658 uint32 focused_context;
3659 String focused_uuid = get_focused_context (focused_client, focused_context);
3660 ClientInfo client_info = socket_get_client_info (focused_client);
3662 if (client_info.type == FRONTEND_CLIENT) {
3663 m_panel_agent_manager.process_key_event_done (focused_client, focused_context, key, ret, serial);
3667 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
3668 void request_ise_hide () {
3671 uint32 focused_context;
3672 String focused_uuid = get_focused_context (focused_client, focused_context);
3673 ClientInfo client_info = socket_get_client_info (focused_client);
3675 if (client_info.type == FRONTEND_CLIENT) {
3676 m_panel_agent_manager.request_ise_hide (focused_client, focused_context);
3680 void socket_reset_helper_input_context (const String& uuid, int client, uint32 context) {
3681 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3683 if (it != m_helper_client_index.end ()) {
3684 uint32 ctx = get_helper_ic (client, context);
3685 m_panel_agent_manager.reset_helper_context (it->second.id, ctx, uuid);
3689 bool helper_select_aux (uint32 item) {
3690 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_aux \n";
3692 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3693 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3695 if (it != m_helper_client_index.end ()) {
3699 get_focused_context (client, context);
3700 ctx = get_helper_ic (client, context);
3701 m_panel_agent_manager.select_aux (it->second.id, ctx, item);
3709 bool helper_select_candidate (uint32 item) {
3710 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_candidate \n";
3712 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3713 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3715 if (it != m_helper_client_index.end ()) {
3719 get_focused_context (client, context);
3720 ctx = get_helper_ic (client, context);
3721 m_panel_agent_manager.select_candidate (it->second.id, ctx, item);
3729 bool helper_lookup_table_page_up (void) {
3730 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_up \n";
3732 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3733 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3735 if (it != m_helper_client_index.end ()) {
3739 get_focused_context (client, context);
3740 ctx = get_helper_ic (client, context);
3741 m_panel_agent_manager.lookup_table_page_up (it->second.id, ctx);
3749 bool helper_lookup_table_page_down (void) {
3750 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_lookup_table_page_down \n";
3752 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3753 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3755 if (it != m_helper_client_index.end ()) {
3759 get_focused_context (client, context);
3760 ctx = get_helper_ic (client, context);
3761 m_panel_agent_manager.lookup_table_page_down (it->second.id, ctx);
3769 bool helper_update_lookup_table_page_size (uint32 size) {
3770 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_lookup_table_page_size \n";
3772 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3773 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3775 if (it != m_helper_client_index.end ()) {
3779 get_focused_context (client, context);
3780 ctx = get_helper_ic (client, context);
3781 m_panel_agent_manager.update_lookup_table_page_size (it->second.id, ctx, size);
3789 bool helper_update_candidate_item_layout (const std::vector<uint32>& row_items) {
3790 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3792 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3793 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3795 if (it != m_helper_client_index.end ()) {
3799 get_focused_context (client, context);
3800 ctx = get_helper_ic (client, context);
3801 m_panel_agent_manager.update_candidate_item_layout (it->second.id, ctx, row_items);
3809 bool helper_select_associate (uint32 item) {
3810 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_select_associate \n";
3812 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3813 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3815 if (it != m_helper_client_index.end ()) {
3819 get_focused_context (client, context);
3820 ctx = get_helper_ic (client, context);
3821 m_panel_agent_manager.select_associate (it->second.id, ctx, item);
3829 bool helper_associate_table_page_up (void) {
3830 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_up \n";
3832 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3833 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3835 if (it != m_helper_client_index.end ()) {
3839 get_focused_context (client, context);
3840 ctx = get_helper_ic (client, context);
3841 m_panel_agent_manager.associate_table_page_up (it->second.id, ctx);
3849 bool helper_associate_table_page_down (void) {
3850 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_associate_table_page_down \n";
3852 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3853 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3855 if (it != m_helper_client_index.end ()) {
3859 get_focused_context (client, context);
3860 ctx = get_helper_ic (client, context);
3861 m_panel_agent_manager.associate_table_page_down (it->second.id, ctx);
3869 bool helper_update_associate_table_page_size (uint32 size) {
3870 SCIM_DEBUG_MAIN (4) << "InfoManager::helper_update_associate_table_page_size \n";
3872 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3873 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3875 if (it != m_helper_client_index.end ()) {
3879 get_focused_context (client, context);
3880 ctx = get_helper_ic (client, context);
3881 m_panel_agent_manager.update_associate_table_page_size (it->second.id, ctx, size);
3889 bool helper_update_displayed_candidate_number (uint32 size) {
3890 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3892 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3893 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3895 if (it != m_helper_client_index.end ()) {
3899 get_focused_context (client, context);
3900 ctx = get_helper_ic (client, context);
3901 m_panel_agent_manager.update_displayed_candidate_number (it->second.id, ctx, size);
3909 bool helper_longpress_candidate (uint32 index) {
3910 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3912 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT) {
3913 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3915 if (it != m_helper_client_index.end ()) {
3919 get_focused_context (client, context);
3920 ctx = get_helper_ic (client, context);
3921 m_panel_agent_manager.send_longpress_event (it->second.id, ctx, index);
3926 std::cerr << __func__ << " is failed!!!\n";
3930 void helper_all_update_spot_location (int x, int y) {
3931 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_spot_location (" << x << "," << y << ")\n";
3932 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
3935 String uuid = get_focused_context (client, context);
3937 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
3938 if (hiit->second.option & SCIM_HELPER_NEED_SPOT_LOCATION_INFO) {
3939 m_panel_agent_manager.helper_all_update_spot_location (hiit->first, get_helper_ic (client, context), uuid, x, y);
3944 void helper_all_update_cursor_position (int cursor_pos) {
3945 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_cursor_position (" << cursor_pos << ")\n";
3946 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
3949 String uuid = get_focused_context (client, context);
3951 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
3952 m_panel_agent_manager.helper_all_update_cursor_position (hiit->first, get_helper_ic (client, context), uuid, cursor_pos);
3956 void helper_all_update_screen (int screen) {
3957 SCIM_DEBUG_MAIN (5) << "InfoManager::helper_all_update_screen (" << screen << ")\n";
3958 HelperInfoRepository::iterator hiit = m_helper_info_repository.begin ();
3962 uuid = get_focused_context (client, context);
3964 for (; hiit != m_helper_info_repository.end (); ++ hiit) {
3965 if (hiit->second.option & SCIM_HELPER_NEED_SCREEN_INFO) {
3966 m_panel_agent_manager.helper_all_update_screen (hiit->first, get_helper_ic (client, context), uuid, screen);
3971 bool set_autocapital_type (int mode) {
3972 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3974 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
3975 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3977 if (it != m_helper_client_index.end ()) {
3981 get_focused_context (client, context);
3982 ctx = get_helper_ic (client, context);
3983 m_panel_agent_manager.set_autocapital_type (it->second.id, ctx, m_current_helper_uuid, mode);
3988 std::cerr << __func__ << " is failed!!!\n";
3992 bool set_prediction_allow (int client, int mode) {
3993 SCIM_DEBUG_MAIN (4) << __func__ << "\n";
3995 if (TOOLBAR_HELPER_MODE == m_current_toolbar_mode || (m_current_helper_option & ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT)) {
3996 HelperClientIndex::iterator it = m_helper_client_index.find (m_current_helper_uuid);
3998 if (it != m_helper_client_index.end ()) {
4002 get_focused_context (client, context);
4003 ctx = get_helper_ic (client, context);
4004 m_panel_agent_manager.set_prediction_allow (it->second.id, ctx, m_current_helper_uuid, mode);
4009 std::cerr << __func__ << " is failed!!!\n";
4013 const String& get_focused_context (int& client, uint32& context, bool force_last_context = false) const {
4014 if (m_current_socket_client >= 0) {
4015 client = m_current_socket_client;
4016 context = m_current_client_context;
4017 return m_current_context_uuid;
4019 client = m_last_socket_client;
4020 context = m_last_client_context;
4021 return m_last_context_uuid;
4026 void socket_transaction_start (void) {
4027 m_signal_transaction_start ();
4030 void socket_transaction_end (void) {
4031 m_signal_transaction_end ();
4037 void unlock (void) {
4042 InfoManager::InfoManager ()
4043 : m_impl (new InfoManagerImpl ())
4047 InfoManager::~InfoManager ()
4053 InfoManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
4055 return m_impl->initialize (info_manager, config, display, resident);
4059 InfoManager::valid (void) const
4061 return m_impl->valid ();
4065 InfoManager::stop (void)
4072 InfoManager::socket_get_client_info (int client) const
4074 return m_impl->socket_get_client_info (client);
4077 void InfoManager::hide_helper (const String& uuid)
4079 m_impl->hide_helper (uuid);
4082 InfoManager::get_current_toolbar_mode () const
4084 return m_impl->get_current_toolbar_mode ();
4088 InfoManager::get_current_ise_geometry (rectinfo& rect)
4090 m_impl->get_current_ise_geometry (rect);
4094 InfoManager::get_current_helper_uuid () const
4096 return m_impl->get_current_helper_uuid ();
4100 InfoManager::get_current_ise_name () const
4102 return m_impl->get_current_ise_name ();
4106 InfoManager::set_current_toolbar_mode (TOOLBAR_MODE_T mode)
4108 m_impl->set_current_toolbar_mode (mode);
4112 InfoManager::set_current_ise_name (String& name)
4114 m_impl->set_current_ise_name (name);
4118 InfoManager::set_current_helper_option (uint32 option)
4120 m_impl->set_current_helper_option (option);
4124 InfoManager::update_candidate_panel_event (uint32 nType, uint32 nValue)
4126 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL, nType, nValue);
4130 InfoManager::update_input_panel_event (uint32 nType, uint32 nValue)
4132 m_impl->update_panel_event (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT, nType, nValue);
4136 InfoManager::move_preedit_caret (uint32 position)
4138 return m_impl->move_preedit_caret (position);
4144 InfoManager::request_help (void)
4146 return m_impl->request_help ();
4150 InfoManager::request_factory_menu (void)
4152 return m_impl->request_factory_menu ();
4157 InfoManager::change_factory (const String& uuid)
4159 return m_impl->change_factory (uuid);
4163 InfoManager::helper_candidate_show (void)
4165 return m_impl->helper_candidate_show ();
4169 InfoManager::helper_candidate_hide (void)
4171 return m_impl->helper_candidate_hide ();
4175 InfoManager::candidate_more_window_show (void)
4177 return m_impl->candidate_more_window_show ();
4181 InfoManager::candidate_more_window_hide (void)
4183 return m_impl->candidate_more_window_hide ();
4187 InfoManager::update_helper_lookup_table (const LookupTable& table)
4189 return m_impl->update_helper_lookup_table (table);
4193 InfoManager::select_aux (uint32 item)
4195 return m_impl->select_aux (item);
4199 InfoManager::select_candidate (uint32 item)
4201 return m_impl->select_candidate (item);
4205 InfoManager::lookup_table_page_up (void)
4207 return m_impl->lookup_table_page_up ();
4211 InfoManager::lookup_table_page_down (void)
4213 return m_impl->lookup_table_page_down ();
4217 InfoManager::update_lookup_table_page_size (uint32 size)
4219 return m_impl->update_lookup_table_page_size (size);
4223 InfoManager::update_candidate_item_layout (const std::vector<uint32>& row_items)
4225 return m_impl->update_candidate_item_layout (row_items);
4229 InfoManager::select_associate (uint32 item)
4231 return m_impl->select_associate (item);
4235 InfoManager::associate_table_page_up (void)
4237 return m_impl->associate_table_page_up ();
4241 InfoManager::associate_table_page_down (void)
4243 return m_impl->associate_table_page_down ();
4247 InfoManager::update_associate_table_page_size (uint32 size)
4249 return m_impl->update_associate_table_page_size (size);
4253 InfoManager::update_displayed_candidate_number (uint32 size)
4255 return m_impl->update_displayed_candidate_number (size);
4259 InfoManager::send_longpress_event (int type, int index)
4261 m_impl->send_longpress_event (type, index);
4265 InfoManager::trigger_property (const String& property)
4267 return m_impl->trigger_property (property);
4271 InfoManager::start_helper (const String& uuid)
4273 return m_impl->start_helper (uuid, -2, 0);
4277 InfoManager::stop_helper (const String& uuid)
4279 return m_impl->stop_helper (uuid, -2, 0);
4283 InfoManager::set_default_ise (const DEFAULT_ISE_T& ise)
4285 m_impl->set_default_ise (ise);
4289 InfoManager::set_should_shared_ise (const bool should_shared_ise)
4291 m_impl->set_should_shared_ise (should_shared_ise);
4295 //InfoManager::reload_config (void)
4297 // m_impl->reload_config ();
4301 InfoManager::exit (void)
4303 return m_impl->exit ();
4306 InfoManager::update_ise_list (std::vector<String>& strList)
4308 m_impl->update_ise_list (strList);
4312 InfoManager::remoteinput_update_preedit_string (WideString str, AttributeList &attrs, uint32 caret)
4314 return m_impl->remoteinput_update_preedit_string (str, attrs, caret);
4318 InfoManager::remoteinput_commit_string (const WideString &str)
4320 return m_impl->remoteinput_commit_string (str);
4324 InfoManager::remoteinput_send_key_event (const KeyEvent &key)
4326 return m_impl->remoteinput_send_key_event (key);
4330 InfoManager::remoteinput_forward_key_event (const KeyEvent &key)
4332 return m_impl->remoteinput_forward_key_event (key);
4336 InfoManager::remoteinput_delete_surrounding_text (uint32 offset, uint32 len)
4338 return m_impl->remoteinput_delete_surrounding_text (offset, len);
4341 /////////////////////////////////Message function begin/////////////////////////////////////////
4343 //ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE
4344 bool InfoManager:: reset_keyboard_ise (void)
4346 return m_impl->reset_keyboard_ise ();
4349 //ISM_TRANS_CMD_SHOW_ISF_CONTROL
4350 void InfoManager::show_isf_panel (int client_id)
4352 m_impl->show_isf_panel (client_id);
4355 //ISM_TRANS_CMD_HIDE_ISF_CONTROL
4356 void InfoManager::hide_isf_panel (int client_id)
4358 m_impl->hide_isf_panel (client_id);
4361 //ISM_TRANS_CMD_SHOW_ISE_PANEL
4362 void InfoManager::show_ise_panel (int client_id, uint32 client, uint32 context, char* data, size_t len)
4364 m_impl->show_ise_panel (client_id, client, context, data, len);
4367 //ISM_TRANS_CMD_HIDE_ISE_PANEL
4368 void InfoManager::hide_ise_panel (int client_id, uint32 client, uint32 context)
4370 m_impl->hide_ise_panel (client_id, client, context);
4373 //ISM_TRANS_CMD_HIDE_ISE_PANEL from ISF control
4374 void InfoManager::hide_helper_ise (void)
4376 m_impl->hide_helper_ise ();
4379 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4380 bool InfoManager::process_key_event (KeyEvent& key, uint32 serial)
4382 return m_impl->process_key_event (key, serial);
4385 //ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY
4386 void InfoManager::get_input_panel_geometry (int client_id, _OUT_ struct rectinfo& info)
4388 m_impl->get_input_panel_geometry (client_id, info);
4391 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4392 void InfoManager::get_candidate_window_geometry (int client_id, _OUT_ struct rectinfo& info)
4394 m_impl->get_candidate_window_geometry (client_id, info);
4398 //ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE
4399 void InfoManager::get_ise_language_locale (int client_id, _OUT_ char** data, _OUT_ size_t& len)
4401 m_impl->get_ise_language_locale (client_id, data, len);
4404 //ISM_TRANS_CMD_SET_LAYOUT
4405 void InfoManager::set_ise_layout (int client_id, uint32 layout)
4407 m_impl->set_ise_layout (client_id, layout);
4410 //ISM_TRANS_CMD_SET_INPUT_MODE
4411 void InfoManager::set_ise_input_mode (int client_id, uint32 input_mode)
4413 m_impl->set_ise_input_mode (client_id, input_mode);
4416 //ISM_TRANS_CMD_SET_INPUT_HINT
4417 void InfoManager::set_ise_input_hint (int client_id, uint32 input_hint)
4419 m_impl->set_ise_input_hint (client_id, input_hint);
4422 //ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION
4423 void InfoManager::update_ise_bidi_direction (int client_id, uint32 bidi_direction)
4425 m_impl->update_ise_bidi_direction (client_id, bidi_direction);
4429 //ISM_TRANS_CMD_SET_ISE_LANGUAGE
4430 void InfoManager::set_ise_language (int client_id, uint32 language)
4432 m_impl->set_ise_language (client_id, language);
4435 //ISM_TRANS_CMD_SET_ISE_IMDATA
4436 void InfoManager::set_ise_imdata (int client_id, const char* imdata, size_t len)
4438 m_impl->set_ise_imdata (client_id, imdata, len);
4441 //ISM_TRANS_CMD_GET_ISE_IMDATA
4442 bool InfoManager:: get_ise_imdata (int client_id, _OUT_ char** imdata, _OUT_ size_t& len)
4444 return m_impl->get_ise_imdata (client_id, imdata, len);
4447 //ISM_TRANS_CMD_GET_LAYOUT
4448 bool InfoManager:: get_ise_layout (int client_id, _OUT_ uint32& layout)
4450 return m_impl->get_ise_layout (client_id, layout);
4453 //ISM_TRANS_CMD_GET_ISE_STATE
4454 void InfoManager::get_ise_state (int client_id, _OUT_ int& state)
4456 m_impl->get_ise_state (client_id, state);
4459 //ISM_TRANS_CMD_GET_ACTIVE_ISE
4460 void InfoManager::get_active_ise (int client_id, _OUT_ String& default_uuid)
4462 m_impl->get_active_ise (client_id, default_uuid);
4465 //ISM_TRANS_CMD_GET_ISE_LIST
4466 void InfoManager::get_ise_list (int client_id, _OUT_ std::vector<String>& strlist)
4468 m_impl->get_ise_list (client_id, strlist);
4472 //ISM_TRANS_CMD_GET_ALL_HELPER_ISE_INFO
4473 void InfoManager::get_all_helper_ise_info (int client_id, _OUT_ HELPER_ISE_INFO& info)
4475 m_impl->get_all_helper_ise_info (client_id, info);
4478 //ISM_TRANS_CMD_SET_ENABLE_HELPER_ISE_INFO
4479 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4480 void InfoManager::set_enable_helper_ise_info (int client_id, String appid, uint32 is_enabled)
4482 m_impl->set_enable_helper_ise_info (client_id, appid, is_enabled);
4485 //ISM_TRANS_CMD_SHOW_HELPER_ISE_LIST
4486 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4487 void InfoManager::show_helper_ise_list (int client_id)
4489 m_impl->show_helper_ise_list (client_id);
4493 //ISM_TRANS_CMD_SHOW_HELPER_ISE_SELECTOR
4494 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4495 void InfoManager::show_helper_ise_selector (int client_id)
4497 m_impl->show_helper_ise_selector (client_id);
4500 //ISM_TRANS_CMD_IS_HELPER_ISE_ENABLED
4502 void InfoManager::is_helper_ise_enabled (int client_id, String strAppid, _OUT_ uint32& nEnabled)
4504 m_impl->is_helper_ise_enabled (client_id, strAppid, nEnabled);
4507 //ISM_TRANS_CMD_GET_ISE_INFORMATION
4508 void InfoManager::get_ise_information (int client_id, String strUuid, _OUT_ String& strName, _OUT_ String& strLanguage,
4509 _OUT_ int& nType, _OUT_ int& nOption, _OUT_ String& strModuleName)
4511 m_impl->get_ise_information (client_id, strUuid, strName, strLanguage, nType, nOption, strModuleName);
4514 //ISM_TRANS_CMD_RESET_ISE_OPTION
4515 //reply SCIM_TRANS_CMD_OK
4516 bool InfoManager:: reset_ise_option (int client_id)
4518 return m_impl->reset_ise_option (client_id);
4521 //ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID
4523 bool InfoManager:: set_active_ise_by_uuid (int client_id, char* buf, size_t len)
4525 return m_impl->set_active_ise_by_uuid (client_id, buf, len);
4528 //ISM_TRANS_CMD_SET_INITIAL_ISE_BY_UUID
4529 //reply SCIM_TRANS_CMD_FAIL or SCIM_TRANS_CMD_OK
4530 void InfoManager::set_initial_ise_by_uuid (int client_id, char* buf, size_t len)
4532 m_impl->set_initial_ise_by_uuid (client_id, buf, len);
4535 //ISM_TRANS_CMD_SET_RETURN_KEY_TYPE
4536 void InfoManager::set_ise_return_key_type (int client_id, uint32 type)
4538 m_impl->set_ise_return_key_type (client_id, type);
4541 //ISM_TRANS_CMD_GET_RETURN_KEY_TYPE
4543 bool InfoManager:: get_ise_return_key_type (int client_id, _OUT_ uint32& type)
4545 return m_impl->get_ise_return_key_type (client_id, type);
4549 //ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE
4550 void InfoManager::set_ise_return_key_disable (int client_id, uint32 disabled)
4552 m_impl->set_ise_return_key_disable (client_id, disabled);
4555 //ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE
4556 void InfoManager::get_ise_return_key_disable (int client_id, _OUT_ uint32& disabled)
4558 m_impl->get_ise_return_key_disable (client_id, disabled);
4561 //ISM_TRANS_CMD_SET_CAPS_MODE
4562 void InfoManager::set_ise_caps_mode (int client_id, uint32 mode)
4564 m_impl->set_ise_caps_mode (client_id, mode);
4567 //SCIM_TRANS_CMD_RELOAD_CONFIG
4568 void InfoManager::reload_config (void)
4570 m_impl->reload_config ();
4573 //ISM_TRANS_CMD_SEND_WILL_SHOW_ACK
4574 void InfoManager::will_show_ack (int client_id)
4576 m_impl->will_show_ack (client_id);
4579 //ISM_TRANS_CMD_SEND_WILL_HIDE_ACK
4580 void InfoManager::will_hide_ack (int client_id)
4582 m_impl->will_hide_ack (client_id);
4585 //ISM_TRANS_CMD_RESET_DEFAULT_ISE
4586 void InfoManager::reset_default_ise (int client_id)
4588 m_impl->reset_default_ise (client_id);
4591 //ISM_TRANS_CMD_SET_HARDWARE_KEYBOARD_MODE
4592 void InfoManager::set_keyboard_mode (int client_id, uint32 mode)
4594 m_impl->set_keyboard_mode (client_id, mode);
4597 //ISM_TRANS_CMD_SEND_CANDIDATE_WILL_HIDE_ACK
4598 void InfoManager::candidate_will_hide_ack (int client_id)
4600 m_impl->candidate_will_hide_ack (client_id);
4603 //ISM_TRANS_CMD_GET_ACTIVE_HELPER_OPTION
4604 void InfoManager::get_active_helper_option (int client_id, _OUT_ uint32& option)
4606 m_impl->get_active_helper_option (client_id, option);
4609 //ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW
4610 void InfoManager::show_ise_option_window (int client_id)
4612 m_impl->show_ise_option_window (client_id);
4615 //ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW
4616 void InfoManager::resume_ise_option_window (int client_id)
4618 m_impl->resume_ise_option_window (client_id);
4621 //ISM_TRANS_CMD_EXPAND_CANDIDATE
4622 void InfoManager::expand_candidate ()
4624 m_impl->expand_candidate ();
4627 //ISM_TRANS_CMD_CONTRACT_CANDIDATE
4628 void InfoManager::contract_candidate ()
4630 m_impl->contract_candidate ();
4633 //ISM_TRANS_CMD_GET_RECENT_ISE_GEOMETRY
4634 void InfoManager::get_recent_ise_geometry (int client_id, uint32 angle, _OUT_ struct rectinfo& info)
4636 m_impl->get_recent_ise_geometry (client_id, angle, info);
4639 //ISM_TRANS_CMD_SEND_REMOTE_INPUT_MESSAGE
4640 bool InfoManager::remoteinput_send_input_message (int client_id, char* buf, size_t len)
4642 return m_impl->send_remote_input_message (client_id, buf, len);
4645 void InfoManager::remoteinput_send_surrounding_text (const char* text, uint32 cursor)
4647 return m_impl->send_remote_surrounding_text (text, cursor);
4650 //ISM_TRANS_CMD_REGISTER_PANEL_CLIENT
4651 void InfoManager::register_panel_client (uint32 client_id, uint32 id)
4653 m_impl->register_panel_client (client_id, id);
4656 //SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT
4657 void InfoManager::register_input_context (uint32 client_id, uint32 context, String uuid)
4659 m_impl->register_input_context (client_id, context, uuid);
4662 //SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT
4663 void InfoManager::remove_input_context (uint32 client_id, uint32 context)
4665 m_impl->remove_input_context (client_id, context);
4668 //SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT
4669 void InfoManager::socket_reset_input_context (int client_id, uint32 context)
4671 m_impl->socket_reset_input_context (client_id, context);
4674 //SCIM_TRANS_CMD_FOCUS_IN
4675 void InfoManager::focus_in (int client_id, uint32 context, String uuid)
4677 m_impl->focus_in (client_id, context, uuid);
4680 //SCIM_TRANS_CMD_FOCUS_OUT
4681 void InfoManager::focus_out (int client_id, uint32 context)
4683 m_impl->focus_out (client_id, context);
4686 //ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT
4687 bool InfoManager::process_input_device_event(int client, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
4689 return m_impl->process_input_device_event(client, type, data, len, result);
4692 //ISM_TRANS_CMD_TURN_ON_LOG
4693 void InfoManager::socket_turn_on_log (uint32 isOn)
4695 m_impl->socket_turn_on_log (isOn);
4698 //SCIM_TRANS_CMD_PANEL_TURN_ON
4699 void InfoManager::socket_turn_on (void)
4701 m_impl->socket_turn_on ();
4704 //SCIM_TRANS_CMD_PANEL_TURN_OFF
4705 void InfoManager::socket_turn_off (void)
4707 m_impl->socket_turn_off ();
4710 //SCIM_TRANS_CMD_UPDATE_SCREEN
4711 void InfoManager::socket_update_screen (int client_id, uint32 num)
4713 m_impl->socket_update_screen (client_id, num);
4716 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
4717 void InfoManager::socket_update_spot_location (uint32 x, uint32 y, uint32 top_y)
4719 m_impl->socket_update_spot_location (x, y, top_y);
4722 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
4723 void InfoManager::socket_update_cursor_position (uint32 cursor_pos)
4725 m_impl->socket_update_cursor_position (cursor_pos);
4728 //ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT
4729 void InfoManager::socket_update_surrounding_text (String text, uint32 cursor)
4731 m_impl->socket_update_surrounding_text (text, cursor);
4734 void InfoManager::remoteinput_callback_focus_in (void)
4736 m_impl->remoteinput_callback_focus_in ();
4739 void InfoManager::remoteinput_callback_focus_out (void)
4741 m_impl->remoteinput_callback_focus_out ();
4744 void InfoManager::remoteinput_callback_entry_metadata (uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled)
4746 m_impl->remoteinput_callback_entry_metadata (hint, layout, variation, autocapital_type, return_key_disabled);
4749 void InfoManager::remoteinput_callback_surrounding_text (String text, uint32 cursor)
4751 m_impl->remoteinput_callback_surrounding_text (text, cursor);
4754 void InfoManager::remoteinput_callback_input_resource (uint32 input_resource)
4756 m_impl->remoteinput_callback_input_resource (input_resource);
4759 //ISM_TRANS_CMD_UPDATE_SELECTION
4760 void InfoManager::socket_update_selection (String text)
4762 m_impl->socket_update_selection (text);
4765 //FIXME: useless anymore
4766 //SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
4767 void InfoManager::socket_update_factory_info (PanelFactoryInfo& info)
4769 m_impl->socket_update_factory_info (info);
4772 //SCIM_TRANS_CMD_PANEL_SHOW_HELP
4773 void InfoManager::socket_show_help (String help)
4775 m_impl->socket_show_help (help);
4778 //SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
4779 void InfoManager::socket_show_factory_menu (std::vector <PanelFactoryInfo>& vec)
4781 m_impl->socket_show_factory_menu (vec);
4784 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
4785 void InfoManager::socket_show_preedit_string (void)
4787 m_impl->socket_show_preedit_string ();
4790 //SCIM_TRANS_CMD_SHOW_AUX_STRING
4791 void InfoManager::socket_show_aux_string (void)
4793 m_impl->socket_show_aux_string ();
4796 //SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
4797 void InfoManager::socket_show_lookup_table (void)
4799 m_impl->socket_show_lookup_table ();
4802 //ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE
4803 void InfoManager::socket_show_associate_table (void)
4805 m_impl->socket_show_associate_table ();
4808 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
4809 void InfoManager::socket_hide_preedit_string (void)
4811 m_impl->socket_hide_preedit_string ();
4814 //SCIM_TRANS_CMD_HIDE_AUX_STRING
4815 void InfoManager::socket_hide_aux_string (void)
4817 m_impl->socket_hide_aux_string ();
4820 //SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
4821 void InfoManager::socket_hide_lookup_table (void)
4823 m_impl->socket_hide_lookup_table ();
4826 //ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE
4827 void InfoManager::socket_hide_associate_table (void)
4829 m_impl->socket_hide_associate_table ();
4832 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
4833 void InfoManager::socket_update_preedit_string (String& str, const AttributeList& attrs, uint32 caret)
4835 m_impl->socket_update_preedit_string (str, attrs, caret);
4838 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
4839 void InfoManager::socket_update_preedit_caret (uint32 caret)
4841 m_impl->socket_update_preedit_caret (caret);
4844 //SCIM_TRANS_CMD_UPDATE_AUX_STRING
4845 void InfoManager::socket_update_aux_string (String& str, const AttributeList& attrs)
4847 m_impl->socket_update_aux_string (str, attrs);
4850 //SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
4851 void InfoManager::socket_update_lookup_table (const LookupTable& table)
4853 m_impl->socket_update_lookup_table (table);
4856 //ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE
4857 void InfoManager::socket_update_associate_table (const LookupTable& table)
4859 m_impl->socket_update_associate_table (table);
4862 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
4863 void InfoManager::socket_register_properties (const PropertyList& properties)
4865 m_impl->socket_register_properties (properties);
4868 //SCIM_TRANS_CMD_UPDATE_PROPERTY
4869 void InfoManager::socket_update_property (const Property& property)
4871 m_impl->socket_update_property (property);
4874 //ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST
4875 void InfoManager::socket_get_keyboard_ise_list (String& uuid)
4877 m_impl->socket_get_keyboard_ise_list (uuid);
4880 //ISM_TRANS_CMD_SET_CANDIDATE_UI
4881 void InfoManager::socket_set_candidate_ui (uint32 portrait_line, uint32 mode)
4883 m_impl->socket_set_candidate_ui (portrait_line, mode);
4886 //ISM_TRANS_CMD_GET_CANDIDATE_UI
4887 void InfoManager::socket_get_candidate_ui (String uuid)
4889 m_impl->socket_get_candidate_ui (uuid);
4892 //ISM_TRANS_CMD_SET_CANDIDATE_POSITION
4893 void InfoManager::socket_set_candidate_position (uint32 left, uint32 top)
4895 m_impl->socket_set_candidate_position (left, top);
4898 //ISM_TRANS_CMD_HIDE_CANDIDATE
4899 void InfoManager::socket_hide_candidate (void)
4901 m_impl->socket_hide_candidate ();
4904 //ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY
4905 void InfoManager::socket_get_candidate_geometry (String& uuid)
4907 m_impl->socket_get_candidate_geometry (uuid);
4910 //ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID
4911 void InfoManager::socket_set_keyboard_ise (String uuid)
4913 m_impl->socket_set_keyboard_ise (uuid);
4916 //ISM_TRANS_CMD_SELECT_CANDIDATE
4917 void InfoManager::socket_helper_select_candidate (uint32 index)
4919 m_impl->socket_helper_select_candidate (index);
4922 //ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY
4923 void InfoManager::socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height)
4925 m_impl->socket_helper_update_ise_geometry (client, x, y, width, height);
4928 //ISM_TRANS_CMD_GET_KEYBOARD_ISE
4929 void InfoManager::socket_get_keyboard_ise (String uuid)
4931 m_impl->socket_get_keyboard_ise (uuid);
4934 //SCIM_TRANS_CMD_START_HELPER
4935 void InfoManager::socket_start_helper (int client_id, uint32 context, String uuid)
4937 m_impl->socket_start_helper (client_id, context, uuid);
4940 //SCIM_TRANS_CMD_STOP_HELPER
4941 void InfoManager::socket_stop_helper (int client_id, uint32 context, String uuid)
4943 m_impl->socket_stop_helper (client_id, context, uuid);
4946 //SCIM_TRANS_CMD_SEND_HELPER_EVENT
4947 void InfoManager::socket_send_helper_event (int client_id, uint32 context, String uuid, const Transaction& _nest_trans)
4949 m_impl->socket_send_helper_event (client_id, context, uuid, _nest_trans);
4952 //SCIM_TRANS_CMD_REGISTER_PROPERTIES
4953 void InfoManager::socket_helper_register_properties (int client, PropertyList& properties)
4955 m_impl->socket_helper_register_properties (client, properties);
4958 //SCIM_TRANS_CMD_UPDATE_PROPERTY
4959 void InfoManager::socket_helper_update_property (int client, Property& property)
4961 m_impl->socket_helper_update_property (client, property);
4964 //SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
4965 void InfoManager::socket_helper_send_imengine_event (int client, uint32 target_ic, String target_uuid , Transaction& nest_trans)
4967 m_impl->socket_helper_send_imengine_event (client, target_ic, target_uuid, nest_trans);
4970 //SCIM_TRANS_CMD_PROCESS_KEY_EVENT
4971 //SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
4972 void InfoManager::socket_helper_send_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
4974 m_impl->socket_helper_send_key_event (client, target_ic, target_uuid, key);
4977 //SCIM_TRANS_CMD_FORWARD_KEY_EVENT
4978 void InfoManager::socket_helper_forward_key_event (int client, uint32 target_ic, String target_uuid, KeyEvent key)
4980 m_impl->socket_helper_forward_key_event (client, target_ic, target_uuid, key);
4983 //SCIM_TRANS_CMD_COMMIT_STRING
4984 void InfoManager::socket_helper_commit_string (int client, uint32 target_ic, String target_uuid, WideString wstr)
4986 m_impl->socket_helper_commit_string (client, target_ic, target_uuid, wstr);
4989 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
4990 void InfoManager::socket_helper_get_surrounding_text (int client, String uuid, uint32 maxlen_before, uint32 maxlen_after)
4992 m_impl->socket_helper_get_surrounding_text (client, uuid, maxlen_before, maxlen_after);
4995 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
4996 void InfoManager::socket_helper_delete_surrounding_text (int client, uint32 offset, uint32 len)
4998 m_impl->socket_helper_delete_surrounding_text (client, offset, len);
5001 //SCIM_TRANS_CMD_GET_SELECTION
5002 void InfoManager::socket_helper_get_selection (int client, String uuid)
5004 m_impl->socket_helper_get_selection (client, uuid);
5007 //SCIM_TRANS_CMD_SET_SELECTION
5008 void InfoManager::socket_helper_set_selection (int client, uint32 start, uint32 end)
5010 m_impl->socket_helper_set_selection (client, start, end);
5013 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
5014 void InfoManager::socket_helper_show_preedit_string (int client, uint32 target_ic, String target_uuid)
5016 m_impl->socket_helper_show_preedit_string (client, target_ic, target_uuid);
5019 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
5020 void InfoManager::socket_helper_hide_preedit_string (int client, uint32 target_ic, String target_uuid)
5022 m_impl->socket_helper_hide_preedit_string (client, target_ic, target_uuid);
5025 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
5026 void InfoManager::socket_helper_update_preedit_string (int client, uint32 target_ic, String target_uuid, WideString preedit,
5027 WideString commit, AttributeList& attrs, uint32 caret)
5029 m_impl->socket_helper_update_preedit_string (client, target_ic, target_uuid, preedit, commit, attrs, caret);
5032 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
5033 void InfoManager::socket_helper_update_preedit_caret (int client, uint32 caret)
5035 m_impl->socket_helper_update_preedit_caret (client, caret);
5038 //SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
5039 void InfoManager::socket_helper_register_helper (int client, HelperInfo& info)
5041 m_impl->socket_helper_register_helper (client, info);
5044 //SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER
5045 void InfoManager::socket_helper_register_helper_passive (int client, HelperInfo& info)
5047 m_impl->socket_helper_register_helper_passive (client, info);
5050 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
5051 void InfoManager::socket_helper_update_input_context (int client, uint32 type, uint32 value)
5053 m_impl->socket_helper_update_input_context (client, type, value);
5056 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
5057 void InfoManager::socket_helper_send_private_command (int client, String command)
5059 m_impl->socket_helper_send_private_command (client, command);
5062 //ISM_TRANS_CMD_UPDATE_ISE_EXIT
5063 //void InfoManager::UPDATE_ISE_EXIT (int client)
5065 // m_impl->UPDATE_ISE_EXIT (client);
5068 //ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE
5069 void InfoManager::process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial)
5071 m_impl->process_key_event_done (key, ret, serial);
5074 //ISM_TRANS_CMD_REQUEST_ISE_HIDE
5075 void InfoManager::request_ise_hide ()
5077 m_impl->request_ise_hide ();
5080 bool InfoManager::check_privilege_by_sockfd (int client_id, const String& privilege) {
5081 return m_impl->check_privilege_by_sockfd (client_id, privilege);
5084 void InfoManager::add_client (int client_id, uint32 key, ClientType type)
5086 m_impl->add_client (client_id, key, type);
5089 void InfoManager::del_client (int client_id)
5091 m_impl->del_client (client_id);
5094 bool InfoManager::set_autocapital_type (int mode)
5096 return m_impl->set_autocapital_type (mode);
5099 void InfoManager::set_prediction_allow (int client, bool mode)
5101 m_impl->set_prediction_allow (client, mode);
5105 //////////////////////////////////Message function end/////////////////////////////////////////
5108 InfoManager::signal_connect_turn_on (InfoManagerSlotVoid* slot)
5110 return m_impl->signal_connect_turn_on (slot);
5114 InfoManager::signal_connect_turn_off (InfoManagerSlotVoid* slot)
5116 return m_impl->signal_connect_turn_off (slot);
5120 InfoManager::signal_connect_show_panel (InfoManagerSlotVoid* slot)
5122 return m_impl->signal_connect_show_panel (slot);
5126 InfoManager::signal_connect_hide_panel (InfoManagerSlotVoid* slot)
5128 return m_impl->signal_connect_hide_panel (slot);
5132 InfoManager::signal_connect_update_screen (InfoManagerSlotInt* slot)
5134 return m_impl->signal_connect_update_screen (slot);
5138 InfoManager::signal_connect_update_spot_location (InfoManagerSlotIntIntInt* slot)
5140 return m_impl->signal_connect_update_spot_location (slot);
5144 InfoManager::signal_connect_update_factory_info (InfoManagerSlotFactoryInfo* slot)
5146 return m_impl->signal_connect_update_factory_info (slot);
5150 InfoManager::signal_connect_start_default_ise (InfoManagerSlotVoid* slot)
5152 return m_impl->signal_connect_start_default_ise (slot);
5156 InfoManager::signal_connect_stop_default_ise (InfoManagerSlotVoid* slot)
5158 return m_impl->signal_connect_stop_default_ise (slot);
5162 InfoManager::signal_connect_set_candidate_ui (InfoManagerSlotIntInt* slot)
5164 return m_impl->signal_connect_set_candidate_ui (slot);
5168 InfoManager::signal_connect_get_candidate_ui (InfoManagerSlotIntInt2* slot)
5170 return m_impl->signal_connect_get_candidate_ui (slot);
5174 InfoManager::signal_connect_set_candidate_position (InfoManagerSlotIntInt* slot)
5176 return m_impl->signal_connect_set_candidate_position (slot);
5180 InfoManager::signal_connect_get_candidate_geometry (InfoManagerSlotRect* slot)
5182 return m_impl->signal_connect_get_candidate_geometry (slot);
5186 InfoManager::signal_connect_get_input_panel_geometry (InfoManagerSlotRect* slot)
5188 return m_impl->signal_connect_get_input_panel_geometry (slot);
5192 InfoManager::signal_connect_set_keyboard_ise (InfoManagerSlotString* slot)
5194 return m_impl->signal_connect_set_keyboard_ise (slot);
5198 InfoManager::signal_connect_get_keyboard_ise (InfoManagerSlotString2* slot)
5200 return m_impl->signal_connect_get_keyboard_ise (slot);
5204 InfoManager::signal_connect_show_help (InfoManagerSlotString* slot)
5206 return m_impl->signal_connect_show_help (slot);
5210 InfoManager::signal_connect_show_factory_menu (InfoManagerSlotFactoryInfoVector* slot)
5212 return m_impl->signal_connect_show_factory_menu (slot);
5216 InfoManager::signal_connect_show_preedit_string (InfoManagerSlotVoid* slot)
5218 return m_impl->signal_connect_show_preedit_string (slot);
5222 InfoManager::signal_connect_show_aux_string (InfoManagerSlotVoid* slot)
5224 return m_impl->signal_connect_show_aux_string (slot);
5228 InfoManager::signal_connect_show_lookup_table (InfoManagerSlotVoid* slot)
5230 return m_impl->signal_connect_show_lookup_table (slot);
5234 InfoManager::signal_connect_show_associate_table (InfoManagerSlotVoid* slot)
5236 return m_impl->signal_connect_show_associate_table (slot);
5240 InfoManager::signal_connect_hide_preedit_string (InfoManagerSlotVoid* slot)
5242 return m_impl->signal_connect_hide_preedit_string (slot);
5246 InfoManager::signal_connect_hide_aux_string (InfoManagerSlotVoid* slot)
5248 return m_impl->signal_connect_hide_aux_string (slot);
5252 InfoManager::signal_connect_hide_lookup_table (InfoManagerSlotVoid* slot)
5254 return m_impl->signal_connect_hide_lookup_table (slot);
5258 InfoManager::signal_connect_hide_associate_table (InfoManagerSlotVoid* slot)
5260 return m_impl->signal_connect_hide_associate_table (slot);
5264 InfoManager::signal_connect_update_preedit_string (InfoManagerSlotAttributeStringInt* slot)
5266 return m_impl->signal_connect_update_preedit_string (slot);
5270 InfoManager::signal_connect_update_preedit_caret (InfoManagerSlotInt* slot)
5272 return m_impl->signal_connect_update_preedit_caret (slot);
5276 InfoManager::signal_connect_update_aux_string (InfoManagerSlotAttributeString* slot)
5278 return m_impl->signal_connect_update_aux_string (slot);
5282 InfoManager::signal_connect_update_lookup_table (InfoManagerSlotLookupTable* slot)
5284 return m_impl->signal_connect_update_lookup_table (slot);
5288 InfoManager::signal_connect_update_associate_table (InfoManagerSlotLookupTable* slot)
5290 return m_impl->signal_connect_update_associate_table (slot);
5294 InfoManager::signal_connect_register_properties (InfoManagerSlotPropertyList* slot)
5296 return m_impl->signal_connect_register_properties (slot);
5300 InfoManager::signal_connect_update_property (InfoManagerSlotProperty* slot)
5302 return m_impl->signal_connect_update_property (slot);
5306 InfoManager::signal_connect_register_helper_properties (InfoManagerSlotIntPropertyList* slot)
5308 return m_impl->signal_connect_register_helper_properties (slot);
5312 InfoManager::signal_connect_update_helper_property (InfoManagerSlotIntProperty* slot)
5314 return m_impl->signal_connect_update_helper_property (slot);
5318 InfoManager::signal_connect_register_helper (InfoManagerSlotIntHelperInfo* slot)
5320 return m_impl->signal_connect_register_helper (slot);
5324 InfoManager::signal_connect_remove_helper (InfoManagerSlotInt* slot)
5326 return m_impl->signal_connect_remove_helper (slot);
5330 InfoManager::signal_connect_set_active_ise_by_uuid (InfoManagerSlotStringBool* slot)
5332 return m_impl->signal_connect_set_active_ise_by_uuid (slot);
5336 InfoManager::signal_connect_focus_in (InfoManagerSlotVoid* slot)
5338 return m_impl->signal_connect_focus_in (slot);
5342 InfoManager::signal_connect_focus_out (InfoManagerSlotVoid* slot)
5344 return m_impl->signal_connect_focus_out (slot);
5348 InfoManager::signal_connect_expand_candidate (InfoManagerSlotVoid* slot)
5350 return m_impl->signal_connect_expand_candidate (slot);
5354 InfoManager::signal_connect_contract_candidate (InfoManagerSlotVoid* slot)
5356 return m_impl->signal_connect_contract_candidate (slot);
5360 InfoManager::signal_connect_select_candidate (InfoManagerSlotInt* slot)
5362 return m_impl->signal_connect_select_candidate (slot);
5366 InfoManager::signal_connect_get_ise_list (InfoManagerSlotBoolStringVector* slot)
5368 return m_impl->signal_connect_get_ise_list (slot);
5372 InfoManager::signal_connect_get_all_helper_ise_info (InfoManagerSlotBoolHelperInfo* slot)
5374 return m_impl->signal_connect_get_all_helper_ise_info (slot);
5378 InfoManager::signal_connect_set_has_option_helper_ise_info (InfoManagerSlotStringBool* slot)
5380 return m_impl->signal_connect_set_has_option_helper_ise_info (slot);
5384 InfoManager::signal_connect_set_enable_helper_ise_info (InfoManagerSlotStringBool* slot)
5386 return m_impl->signal_connect_set_enable_helper_ise_info (slot);
5390 InfoManager::signal_connect_show_helper_ise_list (InfoManagerSlotVoid* slot)
5392 return m_impl->signal_connect_show_helper_ise_list (slot);
5396 InfoManager::signal_connect_show_helper_ise_selector (InfoManagerSlotVoid* slot)
5398 return m_impl->signal_connect_show_helper_ise_selector (slot);
5402 InfoManager::signal_connect_is_helper_ise_enabled (InfoManagerSlotStringInt* slot)
5404 return m_impl->signal_connect_is_helper_ise_enabled (slot);
5408 InfoManager::signal_connect_get_ise_information (InfoManagerSlotBoolString4int2* slot)
5410 return m_impl->signal_connect_get_ise_information (slot);
5414 InfoManager::signal_connect_get_keyboard_ise_list (InfoManagerSlotBoolStringVector* slot)
5416 return m_impl->signal_connect_get_keyboard_ise_list (slot);
5420 InfoManager::signal_connect_update_ise_geometry (InfoManagerSlotIntIntIntInt* slot)
5422 return m_impl->signal_connect_update_ise_geometry (slot);
5426 InfoManager::signal_connect_get_language_list (InfoManagerSlotStringVector* slot)
5428 return m_impl->signal_connect_get_language_list (slot);
5432 InfoManager::signal_connect_get_all_language (InfoManagerSlotStringVector* slot)
5434 return m_impl->signal_connect_get_all_language (slot);
5438 InfoManager::signal_connect_get_ise_language (InfoManagerSlotStrStringVector* slot)
5440 return m_impl->signal_connect_get_ise_language (slot);
5444 InfoManager::signal_connect_get_ise_info_by_uuid (InfoManagerSlotStringISEINFO* slot)
5446 return m_impl->signal_connect_get_ise_info_by_uuid (slot);
5450 InfoManager::signal_connect_send_key_event (InfoManagerSlotKeyEvent* slot)
5452 return m_impl->signal_connect_send_key_event (slot);
5456 InfoManager::signal_connect_accept_connection (InfoManagerSlotInt* slot)
5458 return m_impl->signal_connect_accept_connection (slot);
5462 InfoManager::signal_connect_close_connection (InfoManagerSlotInt* slot)
5464 return m_impl->signal_connect_close_connection (slot);
5468 InfoManager::signal_connect_exit (InfoManagerSlotVoid* slot)
5470 return m_impl->signal_connect_exit (slot);
5474 InfoManager::signal_connect_transaction_start (InfoManagerSlotVoid* slot)
5476 return m_impl->signal_connect_transaction_start (slot);
5480 InfoManager::signal_connect_transaction_end (InfoManagerSlotVoid* slot)
5482 return m_impl->signal_connect_transaction_end (slot);
5486 InfoManager::signal_connect_lock (InfoManagerSlotVoid* slot)
5488 return m_impl->signal_connect_lock (slot);
5492 InfoManager::signal_connect_unlock (InfoManagerSlotVoid* slot)
5494 return m_impl->signal_connect_unlock (slot);
5498 InfoManager::signal_connect_update_input_context (InfoManagerSlotIntInt* slot)
5500 return m_impl->signal_connect_update_input_context (slot);
5504 InfoManager::signal_connect_show_ise (InfoManagerSlotVoid* slot)
5506 return m_impl->signal_connect_show_ise (slot);
5510 InfoManager::signal_connect_hide_ise (InfoManagerSlotVoid* slot)
5512 return m_impl->signal_connect_hide_ise (slot);
5516 InfoManager::signal_connect_will_show_ack (InfoManagerSlotVoid* slot)
5518 return m_impl->signal_connect_will_show_ack (slot);
5522 InfoManager::signal_connect_will_hide_ack (InfoManagerSlotVoid* slot)
5524 return m_impl->signal_connect_will_hide_ack (slot);
5528 InfoManager::signal_connect_set_keyboard_mode (InfoManagerSlotInt* slot)
5530 return m_impl->signal_connect_set_keyboard_mode (slot);
5534 InfoManager::signal_connect_candidate_will_hide_ack (InfoManagerSlotVoid* slot)
5536 return m_impl->signal_connect_candidate_will_hide_ack (slot);
5540 InfoManager::signal_connect_get_ise_state (InfoManagerSlotInt2* slot)
5542 return m_impl->signal_connect_get_ise_state (slot);
5546 InfoManager::signal_connect_run_helper (InfoManagerSlotString3* slot)
5548 return m_impl->signal_connect_run_helper (slot);
5552 InfoManager::signal_connect_get_recent_ise_geometry (InfoManagerSlotIntRect* slot)
5554 return m_impl->signal_connect_get_recent_ise_geometry (slot);
5558 InfoManager::signal_connect_check_privilege_by_sockfd (InfoManagerSlotIntString2* slot)
5560 return m_impl->signal_connect_check_privilege_by_sockfd (slot);
5564 InfoManager::signal_connect_remoteinput_send_input_message (InfoManagerSlotStringBool* slot)
5566 return m_impl->signal_connect_remoteinput_send_input_message (slot);
5570 InfoManager::signal_connect_remoteinput_send_surrounding_text (InfoManagerSlotIntString* slot)
5572 return m_impl->signal_connect_remoteinput_send_surrounding_text (slot);
5575 } /* namespace scim */
5578 vi:ts=4:nowrap:ai:expandtab