1 /** @file scim_helper.cpp
2 * @brief Implementation of class HelperAgent.
5 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
8 * Smart Common Input Method
10 * Copyright (c) 2004-2005 James Su <suzhe@tsinghua.org.cn>
11 * Copyright (c) 2012-2015 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.
30 * 1. Add new interface APIs for keyboard ISE
31 * a. expand_candidate (), contract_candidate () and set_candidate_style ()
32 * b. set_keyboard_ise_by_uuid () and reset_keyboard_ise ()
33 * c. get_surrounding_text () and delete_surrounding_text ()
34 * d. show_preedit_string (), hide_preedit_string (), update_preedit_string () and update_preedit_caret ()
35 * e. show_candidate_string (), hide_candidate_string () and update_candidate_string ()
37 * $Id: scim_helper.cpp,v 1.13 2005/05/24 12:22:51 suzhe Exp $
41 #define Uses_SCIM_TRANSACTION
42 #define Uses_SCIM_TRANS_COMMANDS
43 #define Uses_SCIM_HELPER
44 #define Uses_SCIM_SOCKET
45 #define Uses_SCIM_EVENT
46 #define Uses_SCIM_BACKEND
47 #define Uses_SCIM_IMENGINE_MODULE
52 #include <Ecore_IMF.h>
54 #include "scim_private.h"
56 #include <scim_panel_common.h>
57 #include "isf_query_utility.h"
59 #include "isf_debug.h"
60 #include "isf_message_queue.h"
61 #include "tizen_profile.h"
62 #ifdef HAVE_PKGMGR_INFO
63 #include <pkgmgr-info.h>
64 #endif // HAVE_PKGMGR_INFO
65 #include "isf_device_event.h"
70 #define LOG_TAG "SCIM_HELPER"
73 //FIXME: remove this definitions
74 #define SHIFT_MODE_OFF 0xffe1
75 #define SHIFT_MODE_ON 0xffe2
76 #define SHIFT_MODE_LOCK 0xffe6
77 #define SHIFT_MODE_ENABLE 0x9fe7
78 #define SHIFT_MODE_DISABLE 0x9fe8
82 typedef Signal3<void, const HelperAgent *, int, const String &>
83 HelperAgentSignalVoid;
85 typedef Signal4<void, const HelperAgent *, int, const String &, const String &>
86 HelperAgentSignalString;
88 typedef Signal4<void, const HelperAgent *, int, const String &, const std::vector<String> &>
89 HelperAgentSignalStringVector;
91 typedef Signal5<void, const HelperAgent *, int, const String &, const String &, const String &>
92 HelperAgentSignalString2;
94 typedef Signal4<void, const HelperAgent *, int, const String &, int>
97 typedef Signal5<void, const HelperAgent *, int, const String &, int, int>
98 HelperAgentSignalIntInt;
100 typedef Signal4<void, const HelperAgent *, int, const String &, const Transaction &>
101 HelperAgentSignalTransaction;
103 typedef Signal4<void, const HelperAgent *, int, const String &, const rectinfo &>
104 HelperAgentSignalRect;
106 typedef Signal2<void, const HelperAgent *, struct rectinfo &>
107 HelperAgentSignalSize;
109 typedef Signal2<void, const HelperAgent *, uint32 &>
110 HelperAgentSignalUintVoid;
112 typedef Signal3<void, const HelperAgent *, int, uint32 &>
113 HelperAgentSignalIntUint;
115 typedef Signal3 <void, const HelperAgent *, char *, size_t &>
116 HelperAgentSignalRawVoid;
118 typedef Signal3 <void, const HelperAgent *, char **, size_t &>
119 HelperAgentSignalGetRawVoid;
121 typedef Signal4 <void, const HelperAgent *, int, char *, size_t &>
122 HelperAgentSignalIntRawVoid;
124 typedef Signal3 <void, const HelperAgent *, int, char **>
125 HelperAgentSignalIntGetStringVoid;
127 typedef Signal2<void, const HelperAgent *, const std::vector<uint32> &>
128 HelperAgentSignalUintVector;
130 typedef Signal2<void, const HelperAgent *, LookupTable &>
131 HelperAgentSignalLookupTable;
133 typedef Signal4<void, const HelperAgent *, KeyEvent &, uint32 &, uint32>
134 HelperAgentSignalKeyEventUint;
136 typedef Signal5<void, const HelperAgent *, uint32 &, char *, size_t &, uint32 &>
137 HelperAgentSignalUintCharSizeUint;
139 typedef Signal2<void, const HelperAgent *, const String &>
140 HelperAgentSignalStringVoid;
142 class HelperAgent::HelperAgentImpl
146 SocketClient socket_active;
155 IMEngineInstancePointer si;
156 ConfigPointer m_config;
157 IMEngineModule engine_module;
159 char* surrounding_text;
160 char* selection_text;
162 int need_update_surrounding_text;
163 int need_update_selection_text;
166 bool need_update_entry_metadata;
168 char* finalized_text;
169 uint32 finalized_cursor_pos;
171 HelperAgentSignalVoid signal_exit;
172 HelperAgentSignalVoid signal_attach_input_context;
173 HelperAgentSignalVoid signal_detach_input_context;
174 HelperAgentSignalVoid signal_reload_config;
175 HelperAgentSignalInt signal_update_screen;
176 HelperAgentSignalIntInt signal_update_spot_location;
177 HelperAgentSignalInt signal_update_cursor_position;
178 HelperAgentSignalInt signal_update_surrounding_text;
179 HelperAgentSignalVoid signal_update_selection;
180 HelperAgentSignalString signal_trigger_property;
181 HelperAgentSignalTransaction signal_process_imengine_event;
182 HelperAgentSignalVoid signal_focus_out;
183 HelperAgentSignalVoid signal_focus_in;
184 HelperAgentSignalIntRawVoid signal_ise_show;
185 HelperAgentSignalVoid signal_ise_hide;
186 HelperAgentSignalVoid signal_candidate_show;
187 HelperAgentSignalVoid signal_candidate_hide;
188 HelperAgentSignalSize signal_get_geometry;
189 HelperAgentSignalUintVoid signal_set_mode;
190 HelperAgentSignalUintVoid signal_set_language;
191 HelperAgentSignalRawVoid signal_set_imdata;
192 HelperAgentSignalGetRawVoid signal_get_imdata;
193 HelperAgentSignalIntGetStringVoid signal_get_language_locale;
194 HelperAgentSignalUintVoid signal_set_return_key_type;
195 HelperAgentSignalUintVoid signal_get_return_key_type;
196 HelperAgentSignalUintVoid signal_set_return_key_disable;
197 HelperAgentSignalUintVoid signal_get_return_key_disable;
198 HelperAgentSignalUintVoid signal_set_layout;
199 HelperAgentSignalUintVoid signal_get_layout;
200 HelperAgentSignalUintVoid signal_set_caps_mode;
201 HelperAgentSignalVoid signal_reset_input_context;
202 HelperAgentSignalIntInt signal_update_candidate_ui;
203 HelperAgentSignalRect signal_update_candidate_geometry;
204 HelperAgentSignalString2 signal_update_keyboard_ise;
205 HelperAgentSignalStringVector signal_update_keyboard_ise_list;
206 HelperAgentSignalVoid signal_candidate_more_window_show;
207 HelperAgentSignalVoid signal_candidate_more_window_hide;
208 HelperAgentSignalLookupTable signal_update_lookup_table;
209 HelperAgentSignalInt signal_select_aux;
210 HelperAgentSignalInt signal_select_candidate;
211 HelperAgentSignalVoid signal_candidate_table_page_up;
212 HelperAgentSignalVoid signal_candidate_table_page_down;
213 HelperAgentSignalInt signal_update_candidate_table_page_size;
214 HelperAgentSignalUintVector signal_update_candidate_item_layout;
215 HelperAgentSignalInt signal_select_associate;
216 HelperAgentSignalVoid signal_associate_table_page_up;
217 HelperAgentSignalVoid signal_associate_table_page_down;
218 HelperAgentSignalInt signal_update_associate_table_page_size;
219 HelperAgentSignalVoid signal_reset_ise_context;
220 HelperAgentSignalUintVoid signal_turn_on_log;
221 HelperAgentSignalInt signal_update_displayed_candidate_number;
222 HelperAgentSignalInt signal_longpress_candidate;
223 HelperAgentSignalKeyEventUint signal_process_key_event;
224 HelperAgentSignalUintVoid signal_set_input_mode;
225 HelperAgentSignalUintVoid signal_set_input_hint;
226 HelperAgentSignalUintVoid signal_update_bidi_direction;
227 HelperAgentSignalVoid signal_show_option_window;
228 HelperAgentSignalVoid signal_resume_option_window;
229 HelperAgentSignalUintVoid signal_check_option_window;
230 HelperAgentSignalUintCharSizeUint signal_process_input_device_event;
231 HelperAgentSignalStringVoid signal_set_prediction_hint;
232 HelperAgentSignalStringVoid signal_set_mime_type;
233 HelperAgentSignalString signal_set_prediction_hint_data;
234 HelperAgentSignalUintVoid signal_set_optimization_hint;
237 HelperAgentImpl (HelperAgent* thiz) : magic(0), magic_active(0), timeout(-1), focused_ic ((uint32) -1), thiz (thiz),
238 surrounding_text (NULL), selection_text (NULL), cursor_pos (0),
239 need_update_surrounding_text (0), need_update_selection_text (0),
240 layout (0), ise_show_flag (false), need_update_entry_metadata (false), ise_focus_flag (false),
241 finalized_text(NULL), finalized_cursor_pos(0) {
244 ~HelperAgentImpl () {
249 if (surrounding_text != NULL)
250 free (surrounding_text);
252 if (finalized_text != NULL)
253 free(finalized_text);
255 if (selection_text != NULL)
256 free (selection_text);
258 if (engine_module.valid ()) {
259 engine_module.unload ();
263 // Implementation of slot functions
265 slot_show_preedit_string (IMEngineInstanceBase *si)
267 thiz->show_preedit_string (focused_ic, "");
271 slot_show_aux_string (IMEngineInstanceBase *si)
273 thiz->show_aux_string ();
277 slot_show_lookup_table (IMEngineInstanceBase *si)
279 thiz->show_candidate_string ();
283 slot_hide_preedit_string (IMEngineInstanceBase *si)
285 thiz->hide_preedit_string (focused_ic, "");
289 slot_hide_aux_string (IMEngineInstanceBase *si)
291 thiz->hide_aux_string ();
295 slot_hide_lookup_table (IMEngineInstanceBase *si)
297 thiz->hide_candidate_string ();
301 slot_update_preedit_caret (IMEngineInstanceBase *si, int caret)
303 thiz->update_preedit_caret (caret);
307 slot_update_preedit_string (IMEngineInstanceBase *si,
308 const WideString & str,
309 const AttributeList & attrs,
312 thiz->update_preedit_string (-1, "", str, attrs, caret);
316 slot_update_preedit_string_with_commit (IMEngineInstanceBase *si,
317 const WideString & preedit,
318 const WideString & commit,
319 const AttributeList & attrs,
322 thiz->update_preedit_string (-1, "", preedit, commit, attrs, caret);
326 slot_update_aux_string (IMEngineInstanceBase *si,
327 const WideString & str,
328 const AttributeList & attrs)
330 thiz->update_aux_string (utf8_wcstombs(str), attrs);
334 slot_commit_string (IMEngineInstanceBase *si,
335 const WideString & str)
337 thiz->commit_string (-1, "", str);
341 slot_recapture_string (IMEngineInstanceBase *si,
344 const WideString & preedit,
345 const WideString & commit,
346 const AttributeList & attrs)
348 thiz->recapture_string (-1, "", offset, len, preedit, commit, attrs);
352 slot_forward_key_event (IMEngineInstanceBase *si,
353 const KeyEvent & key)
355 thiz->forward_key_event (-1, "", key);
359 slot_update_lookup_table (IMEngineInstanceBase *si,
360 const LookupTable & table)
362 thiz->update_candidate_string (table);
366 slot_register_properties (IMEngineInstanceBase *si,
367 const PropertyList & properties)
369 thiz->register_properties (properties);
373 slot_update_property (IMEngineInstanceBase *si,
374 const Property & property)
376 thiz->update_property (property);
380 slot_beep (IMEngineInstanceBase *si)
386 slot_start_helper (IMEngineInstanceBase *si,
387 const String &helper_uuid)
389 LOGW ("deprecated function");
393 slot_stop_helper (IMEngineInstanceBase *si,
394 const String &helper_uuid)
396 LOGW ("deprecated function");
400 slot_send_helper_event (IMEngineInstanceBase *si,
401 const String &helper_uuid,
402 const Transaction &trans)
404 signal_process_imengine_event (thiz, focused_ic, helper_uuid, trans);
408 slot_get_surrounding_text (IMEngineInstanceBase *si,
415 thiz->get_surrounding_text (maxlen_before, maxlen_after, _text, cursor);
416 text = utf8_mbstowcs(_text);
421 slot_delete_surrounding_text (IMEngineInstanceBase *si,
426 thiz->delete_surrounding_text (offset, len);
431 slot_get_selection (IMEngineInstanceBase *si,
435 thiz->get_selection_text (_text);
436 text = utf8_mbstowcs (_text);
441 slot_set_selection (IMEngineInstanceBase *si,
445 thiz->set_selection (start, end);
450 slot_expand_candidate (IMEngineInstanceBase *si)
452 thiz->expand_candidate ();
456 slot_contract_candidate (IMEngineInstanceBase *si)
458 thiz->contract_candidate ();
462 slot_set_candidate_style (IMEngineInstanceBase *si, ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line, ISF_CANDIDATE_MODE_T mode)
464 thiz->set_candidate_style (portrait_line, mode);
468 slot_send_private_command (IMEngineInstanceBase *si,
469 const String &command)
471 thiz->send_private_command (command);
475 slot_commit_content (IMEngineInstanceBase *si,
476 const String &content,
477 const String &description,
478 const String &mime_types)
481 thiz->commit_content (content, description, mime_types);
487 si->signal_connect_show_preedit_string (
488 slot (this, &HelperAgent::HelperAgentImpl::slot_show_preedit_string));
489 si->signal_connect_show_aux_string (
490 slot (this, &HelperAgent::HelperAgentImpl::slot_show_aux_string));
491 si->signal_connect_show_lookup_table (
492 slot (this, &HelperAgent::HelperAgentImpl::slot_show_lookup_table));
494 si->signal_connect_hide_preedit_string (
495 slot (this, &HelperAgent::HelperAgentImpl::slot_hide_preedit_string));
496 si->signal_connect_hide_aux_string (
497 slot (this, &HelperAgent::HelperAgentImpl::slot_hide_aux_string));
498 si->signal_connect_hide_lookup_table (
499 slot (this, &HelperAgent::HelperAgentImpl::slot_hide_lookup_table));
501 si->signal_connect_update_preedit_caret (
502 slot (this, &HelperAgent::HelperAgentImpl::slot_update_preedit_caret));
503 si->signal_connect_update_preedit_string (
504 slot (this, &HelperAgent::HelperAgentImpl::slot_update_preedit_string));
505 si->signal_connect_update_preedit_string_with_commit (
506 slot (this, &HelperAgent::HelperAgentImpl::slot_update_preedit_string_with_commit));
507 si->signal_connect_recapture_string (
508 slot (this, &HelperAgent::HelperAgentImpl::slot_recapture_string));
510 si->signal_connect_update_aux_string (
511 slot (this, &HelperAgent::HelperAgentImpl::slot_update_aux_string));
512 si->signal_connect_update_lookup_table (
513 slot (this, &HelperAgent::HelperAgentImpl::slot_update_lookup_table));
515 si->signal_connect_commit_string (
516 slot (this, &HelperAgent::HelperAgentImpl::slot_commit_string));
518 si->signal_connect_forward_key_event (
519 slot (this, &HelperAgent::HelperAgentImpl::slot_forward_key_event));
521 si->signal_connect_register_properties (
522 slot (this, &HelperAgent::HelperAgentImpl::slot_register_properties));
524 si->signal_connect_update_property (
525 slot (this, &HelperAgent::HelperAgentImpl::slot_update_property));
527 si->signal_connect_beep (
528 slot (this, &HelperAgent::HelperAgentImpl::slot_beep));
530 si->signal_connect_start_helper (
531 slot (this, &HelperAgent::HelperAgentImpl::slot_start_helper));
533 si->signal_connect_stop_helper (
534 slot (this, &HelperAgent::HelperAgentImpl::slot_stop_helper));
536 si->signal_connect_send_helper_event (
537 slot (this, &HelperAgent::HelperAgentImpl::slot_send_helper_event));
539 si->signal_connect_get_surrounding_text (
540 slot (this, &HelperAgent::HelperAgentImpl::slot_get_surrounding_text));
542 si->signal_connect_delete_surrounding_text (
543 slot (this, &HelperAgent::HelperAgentImpl::slot_delete_surrounding_text));
545 si->signal_connect_get_selection (
546 slot (this, &HelperAgent::HelperAgentImpl::slot_get_selection));
548 si->signal_connect_set_selection (
549 slot (this, &HelperAgent::HelperAgentImpl::slot_set_selection));
551 si->signal_connect_expand_candidate (
552 slot (this, &HelperAgent::HelperAgentImpl::slot_expand_candidate));
553 si->signal_connect_contract_candidate (
554 slot (this, &HelperAgent::HelperAgentImpl::slot_contract_candidate));
556 si->signal_connect_set_candidate_style (
557 slot (this, &HelperAgent::HelperAgentImpl::slot_set_candidate_style));
559 si->signal_connect_send_private_command (
560 slot (this, &HelperAgent::HelperAgentImpl::slot_send_private_command));
563 void process_key_event_done (KeyEvent &key, uint32 ret, uint32 serial) {
564 LOGD ("ret: %d, serial: %d", ret, serial);
565 if (socket_active.is_connected ()) {
567 send.put_command (SCIM_TRANS_CMD_REQUEST);
568 send.put_data (magic_active);
569 send.put_command (ISM_TRANS_CMD_PROCESS_KEY_EVENT_DONE);
572 send.put_data (serial);
573 send.write_to_socket (socket_active, magic_active);
577 void request_ise_hide () {
578 if (socket_active.is_connected ()) {
580 send.put_command (SCIM_TRANS_CMD_REQUEST);
581 send.put_data (magic_active);
582 send.put_command (ISM_TRANS_CMD_REQUEST_ISE_HIDE);
583 send.write_to_socket (socket_active, magic_active);
587 HelperAgentImpl () : magic (0), magic_active (0), timeout (-1), focused_ic ((uint32) -1), thiz (NULL), surrounding_text (NULL), selection_text (NULL), cursor_pos (0), need_update_surrounding_text (0), need_update_selection_text (0), layout (0), ise_show_flag (false), need_update_entry_metadata (false), ise_focus_flag (false), finalized_text (NULL), finalized_cursor_pos (0) { }
590 static MessageQueue message_queue;
592 HelperAgent::HelperAgent ()
593 : m_impl (new HelperAgentImpl (this))
595 message_queue.create();
598 HelperAgent::~HelperAgent ()
600 message_queue.destroy();
605 * @brief Open socket connection to the Panel.
607 * @param info The information of this Helper object.
608 * @param display The display which this Helper object should run on.
610 * @return The connection socket id. -1 means failed to create
614 HelperAgent::open_connection (const HelperInfo &info,
615 const String &display)
617 if (m_impl->socket.is_connected ())
620 SocketAddress address (scim_get_default_panel_socket_address (display));
621 int timeout = m_impl->timeout = scim_get_default_socket_timeout ();
624 if (!address.valid ())
628 std::cerr << " Connecting to PanelAgent server.";
629 ISF_LOG (" Connecting to PanelAgent server.\n");
630 while (!m_impl->socket.connect (address)) {
632 scim_usleep (100000);
634 std::cerr << "m_impl->socket.connect () is failed!!!\n";
635 ISF_LOG ("m_impl->socket.connect () is failed!!!\n");
639 std::cerr << " Connected :" << i << "\n";
640 ISF_LOG (" Connected :%d\n", i);
641 LOGD ("Connection to PanelAgent succeeded, %d", i);
643 /* Let's retry 10 times when failed */
644 int open_connection_retries = 0;
645 while (!scim_socket_open_connection (magic,
650 if (++open_connection_retries > 10) {
651 m_impl->socket.close ();
652 std::cerr << "scim_socket_open_connection () is failed!!!\n";
653 ISF_LOG ("scim_socket_open_connection () is failed!!!\n");
654 ISF_SAVE_LOG ("scim_socket_open_connection failed, %d", timeout);
659 /* Retry after re-connecting the socket */
660 if (m_impl->socket.is_connected ())
663 /* This time, just retry atmost 2 seconds */
665 while (!m_impl->socket.connect (address) && ++i < 10) {
666 scim_usleep (200000);
670 ISF_LOG ("scim_socket_open_connection () is successful.\n");
671 LOGD ("scim_socket_open_connection successful");
673 m_impl->send.clear ();
674 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
675 m_impl->send.put_data (magic);
676 m_impl->send.put_command (SCIM_TRANS_CMD_PANEL_REGISTER_HELPER);
677 m_impl->send.put_data (info.uuid);
678 m_impl->send.put_data (info.name);
679 m_impl->send.put_data (info.icon);
680 m_impl->send.put_data (info.description);
681 m_impl->send.put_data (info.option);
683 if (!m_impl->send.write_to_socket (m_impl->socket, magic)) {
684 m_impl->socket.close ();
689 if (m_impl->recv.read_from_socket (m_impl->socket, timeout) &&
690 m_impl->recv.get_command (cmd) && cmd == SCIM_TRANS_CMD_REPLY &&
691 m_impl->recv.get_command (cmd) && cmd == SCIM_TRANS_CMD_OK) {
692 m_impl->magic = magic;
694 while (m_impl->recv.get_command (cmd)) {
696 case SCIM_TRANS_CMD_HELPER_ATTACH_INPUT_CONTEXT:
700 while (m_impl->recv.get_data (ic) && m_impl->recv.get_data (ic_uuid))
701 m_impl->signal_attach_input_context (this, ic, ic_uuid);
704 case SCIM_TRANS_CMD_UPDATE_SCREEN:
707 if (m_impl->recv.get_data (screen))
708 m_impl->signal_update_screen (this, (uint32) -1, String (""), (int) screen);
716 //FIXME: Attaching input context is needed for desktop environment
717 LOGW ("Attach input context and update screen failed");
720 ISF_SAVE_LOG ("Trying connect() with Helper_Active");
722 /* connect to the panel agent as the active helper client */
723 if (!m_impl->socket_active.connect (address)) return -1;
724 open_connection_retries = 0;
725 while (!scim_socket_open_connection (magic,
726 String ("Helper_Active"),
728 m_impl->socket_active,
730 if (++open_connection_retries > 10) {
731 m_impl->socket_active.close ();
732 std::cerr << "Helper_Active scim_socket_open_connection () is failed!!!\n";
733 ISF_LOG ("Helper_Active scim_socket_open_connection () is failed!!!\n");
734 ISF_SAVE_LOG ("Helper_Active scim_socket_open_connection failed, %d", timeout);
739 /* Retry after re-connecting the socket */
740 if (m_impl->socket_active.is_connected ())
741 m_impl->socket_active.close ();
743 /* This time, just retry atmost 2 seconds */
745 while (!m_impl->socket_active.connect (address) && ++i < 10) {
746 scim_usleep (200000);
750 m_impl->magic_active = magic;
752 m_impl->send.clear ();
753 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
754 m_impl->send.put_data (magic);
755 m_impl->send.put_command (SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER);
756 m_impl->send.put_data (info.uuid);
757 m_impl->send.put_data (info.name);
758 m_impl->send.put_data (info.icon);
759 m_impl->send.put_data (info.description);
760 m_impl->send.put_data (info.option);
762 if (!m_impl->send.write_to_socket (m_impl->socket_active, magic)) {
763 ISF_SAVE_LOG ("Helper_Active write_to_socket() failed");
764 m_impl->socket_active.close ();
767 m_impl->m_config = ConfigBase::get (false, "socket");
769 return m_impl->socket.get_id ();
773 * @brief Close the socket connection to Panel.
776 HelperAgent::close_connection ()
778 m_impl->socket.close ();
779 m_impl->socket_active.close ();
780 m_impl->send.clear ();
781 m_impl->recv.clear ();
783 m_impl->magic_active = 0;
788 * @brief Get the connection id previously returned by open_connection().
790 * @return the connection id
793 HelperAgent::get_connection_number () const
795 if (m_impl->socket.is_connected ())
796 return m_impl->socket.get_id ();
801 * @brief Check whether this HelperAgent has been connected to a Panel.
803 * Return true when it is connected to panel, otherwise return false.
806 HelperAgent::is_connected () const
808 return m_impl->socket.is_connected ();
812 * @brief Check if there are any events available to be processed.
814 * If it returns true then Helper object should call
815 * HelperAgent::filter_event() to process them.
817 * @return true if there are any events available.
820 HelperAgent::has_pending_event () const
822 if (m_impl->socket.is_connected () && m_impl->socket.wait_for_data (0) > 0)
825 if (message_queue.has_pending_message())
832 * @brief Process the pending events.
834 * This function will emit the corresponding signals according
837 * @return false if the connection is broken, otherwise return true.
840 HelperAgent::filter_event ()
842 if (!m_impl->socket.is_connected ()) {
843 LOGW("Connection lost, returning false");
847 if (m_impl->recv.read_from_socket (m_impl->socket, m_impl->timeout)) {
848 message_queue.read_from_transaction(m_impl->recv);
850 while (message_queue.has_pending_message()) {
851 MessageItem *message = message_queue.get_pending_message();
852 handle_message(message);
853 message_queue.remove_message(message);
856 LOGD("read_from_socket() failed but continuing");
864 * @brief Read messages from socket buffer, and see if there is a message with the given cmd.
866 * @return false if the connection is broken, or no message available with given cmd. Otherwise return true.
869 HelperAgent::wait_for_message(int cmd, int timeout)
871 struct timeval t0 = { 0, 0 };
872 struct timeval t1 = { 0, 0 };
874 gettimeofday(&t0, NULL);
878 if (!m_impl->socket.is_connected() || !m_impl->recv.read_from_socket(m_impl->socket, timeout))
881 message_queue.read_from_transaction(m_impl->recv);
882 if (message_queue.has_pending_message_by_cmd(cmd)) {
886 gettimeofday(&t1, NULL);
887 etime = ((t1.tv_sec * 1000000 + t1.tv_usec) - (t0.tv_sec * 1000000 + t0.tv_usec)) / 1000;
888 } while (etime < timeout);
894 * @brief Process one message that is in our message queue.
896 * This function will emit the corresponding signals according
899 * @param message The message that needs to be handled.
901 * @return false if the connection is broken, otherwise return true.
904 HelperAgent::handle_message (MessageItem *message)
909 int cmd = message->get_command_ref();
910 LOGD ("HelperAgent::cmd = %d", cmd);
912 case SCIM_TRANS_CMD_EXIT:
914 MessageItemExit *subclass = static_cast<MessageItemExit*>(message);
915 ISF_SAVE_LOG ("Helper ISE received SCIM_TRANS_CMD_EXIT message");
916 m_impl->signal_exit(this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
919 case SCIM_TRANS_CMD_RELOAD_CONFIG:
921 MessageItemReloadConfig *subclass = static_cast<MessageItemReloadConfig*>(message);
922 m_impl->signal_reload_config (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
923 if (!m_impl->m_config.null())
924 m_impl->m_config->ConfigBase::reload();
927 case SCIM_TRANS_CMD_UPDATE_SCREEN:
929 MessageItemUpdateScreen *subclass = static_cast<MessageItemUpdateScreen*>(message);
930 m_impl->signal_update_screen (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
931 subclass->get_screen_ref());
934 case SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION:
936 MessageItemUpdateSpotLocation *subclass = static_cast<MessageItemUpdateSpotLocation*>(message);
937 m_impl->signal_update_spot_location (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
938 subclass->get_x_ref(), subclass->get_y_ref());
941 case ISM_TRANS_CMD_UPDATE_CURSOR_POSITION:
943 MessageItemUpdateCursorPosition *subclass = static_cast<MessageItemUpdateCursorPosition*>(message);
944 m_impl->cursor_pos = subclass->get_cursor_pos_ref();
945 LOGD ("update cursor position %d", subclass->get_cursor_pos_ref());
946 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
947 m_impl->signal_update_cursor_position (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
948 subclass->get_cursor_pos_ref());
950 if (!m_impl->si.null ()) m_impl->si->update_cursor_position(subclass->get_cursor_pos_ref());
953 case ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT:
955 MessageItemUpdateSurroundingText *subclass = static_cast<MessageItemUpdateSurroundingText*>(message);
956 if (m_impl->surrounding_text != NULL)
957 free (m_impl->surrounding_text);
958 m_impl->surrounding_text = strdup (subclass->get_text_ref().c_str ());
959 m_impl->cursor_pos = subclass->get_cursor_ref();
960 LOGD ("surrounding text: %s, %d", m_impl->surrounding_text, subclass->get_cursor_ref());
961 while (m_impl->need_update_surrounding_text > 0) {
962 m_impl->need_update_surrounding_text--;
963 m_impl->signal_update_surrounding_text (this, subclass->get_ic_ref(),
964 subclass->get_text_ref(), subclass->get_cursor_ref());
968 case ISM_TRANS_CMD_UPDATE_SELECTION:
970 MessageItemUpdateSelection *subclass = static_cast<MessageItemUpdateSelection*>(message);
971 if (m_impl->selection_text != NULL)
972 free (m_impl->selection_text);
974 m_impl->selection_text = strdup (subclass->get_text_ref().c_str ());
975 LOGD ("selection text: %s", m_impl->selection_text);
977 while (m_impl->need_update_selection_text > 0) {
978 m_impl->need_update_selection_text--;
979 m_impl->signal_update_selection (this, subclass->get_ic_ref(), subclass->get_text_ref());
983 case SCIM_TRANS_CMD_TRIGGER_PROPERTY:
985 MessageItemTriggerProperty *subclass = static_cast<MessageItemTriggerProperty*>(message);
986 m_impl->signal_trigger_property (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
987 subclass->get_property_ref());
988 if (!m_impl->si.null ()) m_impl->si->trigger_property(subclass->get_property_ref());
991 case SCIM_TRANS_CMD_HELPER_PROCESS_IMENGINE_EVENT:
993 MessageItemHelperProcessImengineEvent *subclass = static_cast<MessageItemHelperProcessImengineEvent*>(message);
994 m_impl->signal_process_imengine_event (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
995 subclass->get_transaction_ref());
998 case SCIM_TRANS_CMD_HELPER_ATTACH_INPUT_CONTEXT:
1000 MessageItemHelperAttachInputContext *subclass = static_cast<MessageItemHelperAttachInputContext*>(message);
1001 m_impl->signal_attach_input_context (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1004 case SCIM_TRANS_CMD_HELPER_DETACH_INPUT_CONTEXT:
1006 MessageItemHelperDetachInputContext *subclass = static_cast<MessageItemHelperDetachInputContext*>(message);
1007 m_impl->signal_detach_input_context (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1010 case SCIM_TRANS_CMD_FOCUS_OUT:
1012 MessageItemFocusOut *subclass = static_cast<MessageItemFocusOut*>(message);
1013 m_impl->ise_focus_flag = false;
1014 m_impl->signal_focus_out (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1015 m_impl->focused_ic = (uint32) -1;
1016 if (!m_impl->si.null ()) m_impl->si->focus_out();
1018 m_impl->ise_show_flag = false;
1021 case SCIM_TRANS_CMD_FOCUS_IN:
1023 MessageItemFocusIn *subclass = static_cast<MessageItemFocusIn*>(message);
1024 m_impl->ise_focus_flag = true;
1026 m_impl->need_update_entry_metadata = true;
1027 m_impl->signal_focus_in (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1028 m_impl->focused_ic = subclass->get_ic_ref();
1029 if (m_impl->finalized_text != NULL)
1030 free(m_impl->finalized_text);
1031 m_impl->finalized_text = NULL;
1032 m_impl->finalized_cursor_pos = 0;
1033 if (!m_impl->si.null ()) m_impl->si->focus_in();
1036 case ISM_TRANS_CMD_SHOW_ISE_PANEL:
1038 MessageItemShowISEPanel *subclass = static_cast<MessageItemShowISEPanel*>(message);
1039 LOGD ("Helper ISE received ISM_TRANS_CMD_SHOW_ISE_PANEL message");
1041 m_impl->signal_ise_show (this, subclass->get_ic_ref(), *(subclass->get_data_ptr()),
1042 subclass->get_len_ref());
1043 m_impl->ise_show_flag = true;
1046 case ISM_TRANS_CMD_HIDE_ISE_PANEL:
1048 MessageItemHideISEPanel *subclass = static_cast<MessageItemHideISEPanel*>(message);
1049 LOGD ("Helper ISE received ISM_TRANS_CMD_HIDE_ISE_PANEL message");
1050 m_impl->signal_ise_hide (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1051 m_impl->ise_show_flag = false;
1054 case ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY:
1056 struct rectinfo info = {0, 0, 0, 0};
1057 m_impl->signal_get_geometry (this, info);
1058 m_impl->send.clear ();
1059 m_impl->send.put_command (SCIM_TRANS_CMD_REPLY);
1060 m_impl->send.put_data (info.pos_x);
1061 m_impl->send.put_data (info.pos_y);
1062 m_impl->send.put_data (info.width);
1063 m_impl->send.put_data (info.height);
1064 m_impl->send.write_to_socket (m_impl->socket);
1067 case ISM_TRANS_CMD_SET_ISE_MODE:
1069 MessageItemSetISEMode *subclass = static_cast<MessageItemSetISEMode*>(message);
1070 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
1071 m_impl->signal_set_mode (this, subclass->get_mode_ref());
1075 case ISM_TRANS_CMD_SET_ISE_LANGUAGE:
1077 MessageItemSetISELanguage *subclass = static_cast<MessageItemSetISELanguage*>(message);
1078 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
1079 m_impl->signal_set_language (this, subclass->get_language_ref());
1083 case ISM_TRANS_CMD_SET_ISE_IMDATA:
1085 MessageItemSetISEImData *subclass = static_cast<MessageItemSetISEImData*>(message);
1086 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
1087 m_impl->signal_set_imdata (this, *(subclass->get_imdata_ptr()), subclass->get_len_ref());
1089 if (!m_impl->si.null ()) m_impl->si->set_imdata(*(subclass->get_imdata_ptr()),
1090 subclass->get_len_ref());
1093 case ISM_TRANS_CMD_GET_ISE_IMDATA:
1098 m_impl->signal_get_imdata (this, &buf, len);
1099 LOGD ("send ise imdata len = %zu", len);
1100 m_impl->send.clear ();
1101 m_impl->send.put_command (SCIM_TRANS_CMD_REPLY);
1102 m_impl->send.put_data (buf, len);
1103 m_impl->send.write_to_socket (m_impl->socket);
1108 case ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE:
1110 MessageItemGetISELanguageLocale *subclass = static_cast<MessageItemGetISELanguageLocale*>(message);
1112 m_impl->signal_get_language_locale (this, subclass->get_ic_ref(), &buf);
1113 m_impl->send.clear ();
1114 m_impl->send.put_command (SCIM_TRANS_CMD_REPLY);
1116 m_impl->send.put_data (buf, strlen (buf));
1117 m_impl->send.write_to_socket (m_impl->socket);
1122 case ISM_TRANS_CMD_SET_RETURN_KEY_TYPE:
1124 MessageItemSetReturnKeyType *subclass = static_cast<MessageItemSetReturnKeyType*>(message);
1125 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
1126 m_impl->signal_set_return_key_type (this, subclass->get_type_ref());
1130 case ISM_TRANS_CMD_GET_RETURN_KEY_TYPE:
1133 m_impl->signal_get_return_key_type (this, type);
1134 m_impl->send.clear ();
1135 m_impl->send.put_command (SCIM_TRANS_CMD_REPLY);
1136 m_impl->send.put_data (type);
1137 m_impl->send.write_to_socket (m_impl->socket);
1140 case ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE:
1142 MessageItemSetReturnKeyDisable *subclass = static_cast<MessageItemSetReturnKeyDisable*>(message);
1143 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
1144 m_impl->signal_set_return_key_disable (this, subclass->get_disabled_ref());
1148 case ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE:
1150 uint32 disabled = 0;
1151 m_impl->signal_get_return_key_type (this, disabled);
1152 m_impl->send.clear ();
1153 m_impl->send.put_command (SCIM_TRANS_CMD_REPLY);
1154 m_impl->send.put_data (disabled);
1155 m_impl->send.write_to_socket (m_impl->socket);
1158 case SCIM_TRANS_CMD_PROCESS_KEY_EVENT:
1160 MessageItemProcessKeyEvent *subclass = static_cast<MessageItemProcessKeyEvent*>(message);
1162 m_impl->signal_process_key_event(this, subclass->get_key_ref(), ret, subclass->get_keycode_ref());
1164 if (!m_impl->si.null ()) {
1165 if (!(subclass->get_key_ref().get_key_string().compare("KeyRelease+XF86Back") == 0 ||
1166 subclass->get_key_ref().get_key_string().compare("XF86Back") == 0)) {
1167 ret = m_impl->si->process_key_event (subclass->get_key_ref());
1168 LOGD("imengine(%s) process key %d return %d", m_impl->si->get_factory_uuid().c_str(),
1169 subclass->get_key_ref().code, ret);
1173 m_impl->process_key_event_done (subclass->get_key_ref(), ret, subclass->get_serial_ref());
1176 case ISM_TRANS_CMD_SET_LAYOUT:
1178 MessageItemSetLayout *subclass = static_cast<MessageItemSetLayout*>(message);
1179 m_impl->layout = subclass->get_layout_ref();
1180 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
1181 m_impl->signal_set_layout (this, subclass->get_layout_ref());
1183 if (!m_impl->si.null ()) m_impl->si->set_layout(subclass->get_layout_ref());
1186 case ISM_TRANS_CMD_GET_LAYOUT:
1190 m_impl->signal_get_layout (this, layout);
1191 m_impl->send.clear ();
1192 m_impl->send.put_command (SCIM_TRANS_CMD_REPLY);
1193 m_impl->send.put_data (layout);
1194 m_impl->send.write_to_socket (m_impl->socket);
1197 case ISM_TRANS_CMD_SET_INPUT_MODE:
1199 MessageItemSetInputMode *subclass = static_cast<MessageItemSetInputMode*>(message);
1200 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
1201 m_impl->signal_set_input_mode (this, subclass->get_input_mode_ref());
1205 case ISM_TRANS_CMD_SET_CAPS_MODE:
1207 MessageItemSetCapsMode *subclass = static_cast<MessageItemSetCapsMode*>(message);
1208 m_impl->signal_set_caps_mode (this, subclass->get_mode_ref());
1211 case SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT:
1213 MessageItemPanelResetInputContext *subclass = static_cast<MessageItemPanelResetInputContext*>(message);
1214 m_impl->signal_reset_input_context (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1215 if (!m_impl->si.null ()) m_impl->si->reset();
1218 case ISM_TRANS_CMD_UPDATE_CANDIDATE_UI:
1220 MessageItemUpdateCandidateUI *subclass = static_cast<MessageItemUpdateCandidateUI*>(message);
1221 m_impl->signal_update_candidate_ui (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1222 subclass->get_style_ref(), subclass->get_mode_ref());
1225 case ISM_TRANS_CMD_UPDATE_CANDIDATE_GEOMETRY:
1227 MessageItemUpdateCandidateGeometry *subclass = static_cast<MessageItemUpdateCandidateGeometry*>(message);
1228 m_impl->signal_update_candidate_geometry (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1229 subclass->get_rectinfo_ref());
1232 case ISM_TRANS_CMD_UPDATE_KEYBOARD_ISE:
1234 MessageItemUpdateKeyboardISE *subclass = static_cast<MessageItemUpdateKeyboardISE*>(message);
1235 m_impl->signal_update_keyboard_ise (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1236 subclass->get_name_ref(), subclass->get_uuid_ref());
1239 case ISM_TRANS_CMD_UPDATE_KEYBOARD_ISE_LIST:
1241 MessageItemUpdateKeyboardISEList *subclass = static_cast<MessageItemUpdateKeyboardISEList*>(message);
1242 m_impl->signal_update_keyboard_ise_list (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1243 subclass->get_list_ref());
1246 case ISM_TRANS_CMD_CANDIDATE_MORE_WINDOW_SHOW:
1248 MessageItemCandidateMoreWindowShow *subclass = static_cast<MessageItemCandidateMoreWindowShow*>(message);
1249 m_impl->signal_candidate_more_window_show (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1250 if (!m_impl->si.null ()) m_impl->si->candidate_more_window_show();
1253 case ISM_TRANS_CMD_CANDIDATE_MORE_WINDOW_HIDE:
1255 MessageItemCandidateMoreWindowHide *subclass = static_cast<MessageItemCandidateMoreWindowHide*>(message);
1256 m_impl->signal_candidate_more_window_hide (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1257 if (!m_impl->si.null ()) m_impl->si->candidate_more_window_hide();
1260 case ISM_TRANS_CMD_SELECT_AUX:
1262 MessageItemSelectAux *subclass = static_cast<MessageItemSelectAux*>(message);
1263 m_impl->signal_select_aux (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1264 subclass->get_item_ref());
1265 if (!m_impl->si.null ()) m_impl->si->select_aux(subclass->get_item_ref());
1268 case SCIM_TRANS_CMD_SELECT_CANDIDATE: //FIXME:remove if useless
1270 MessageItemSelectCandidate *subclass = static_cast<MessageItemSelectCandidate*>(message);
1271 m_impl->signal_select_candidate (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1272 subclass->get_item_ref());
1273 if (!m_impl->si.null ()) m_impl->si->select_candidate(subclass->get_item_ref());
1276 case SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_UP: //FIXME:remove if useless
1278 MessageItemLookupTablePageUp *subclass = static_cast<MessageItemLookupTablePageUp*>(message);
1279 m_impl->signal_candidate_table_page_up (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1280 if (!m_impl->si.null ()) m_impl->si->lookup_table_page_up();
1283 case SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_DOWN: //FIXME:remove if useless
1285 MessageItemLookupTablePageDown *subclass = static_cast<MessageItemLookupTablePageDown*>(message);
1286 m_impl->signal_candidate_table_page_down (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1287 if (!m_impl->si.null ()) m_impl->si->lookup_table_page_down();
1290 case SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE_PAGE_SIZE:
1292 MessageItemUpdateLookupTablePageSize *subclass = static_cast<MessageItemUpdateLookupTablePageSize*>(message);
1293 m_impl->signal_update_candidate_table_page_size (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1294 subclass->get_size_ref());
1295 if (!m_impl->si.null ()) m_impl->si->update_lookup_table_page_size(subclass->get_size_ref());
1298 case ISM_TRANS_CMD_CANDIDATE_SHOW: //FIXME:remove if useless
1300 MessageItemCandidateShow *subclass = static_cast<MessageItemCandidateShow*>(message);
1301 m_impl->signal_candidate_show (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1304 case ISM_TRANS_CMD_CANDIDATE_HIDE: //FIXME:remove if useless
1306 MessageItemCandidateHide *subclass = static_cast<MessageItemCandidateHide*>(message);
1307 m_impl->signal_candidate_hide (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1310 case ISM_TRANS_CMD_UPDATE_LOOKUP_TABLE: //FIXME:remove if useless
1312 MessageItemUpdateLookupTable *subclass = static_cast<MessageItemUpdateLookupTable*>(message);
1313 m_impl->signal_update_lookup_table (this, subclass->get_candidate_table_ref());
1316 case ISM_TRANS_CMD_UPDATE_CANDIDATE_ITEM_LAYOUT:
1318 MessageItemUpdateCandidateItemLayout *subclass = static_cast<MessageItemUpdateCandidateItemLayout*>(message);
1319 m_impl->signal_update_candidate_item_layout (this, subclass->get_row_items_ref());
1320 if (!m_impl->si.null ()) m_impl->si->update_candidate_item_layout(subclass->get_row_items_ref());
1323 case ISM_TRANS_CMD_SELECT_ASSOCIATE:
1325 MessageItemSelectAssociate *subclass = static_cast<MessageItemSelectAssociate*>(message);
1326 m_impl->signal_select_associate (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1327 subclass->get_item_ref());
1330 case ISM_TRANS_CMD_ASSOCIATE_TABLE_PAGE_UP:
1332 MessageItemAssociateTablePageUp *subclass = static_cast<MessageItemAssociateTablePageUp*>(message);
1333 m_impl->signal_associate_table_page_up (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1336 case ISM_TRANS_CMD_ASSOCIATE_TABLE_PAGE_DOWN:
1338 MessageItemAssociateTablePageDown *subclass = static_cast<MessageItemAssociateTablePageDown*>(message);
1339 m_impl->signal_associate_table_page_down (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1342 case ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE_PAGE_SIZE:
1344 MessageItemUpdateAssociateTablePageSize *subclass = static_cast<MessageItemUpdateAssociateTablePageSize*>(message);
1345 m_impl->signal_update_associate_table_page_size (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1346 subclass->get_size_ref());
1349 case ISM_TRANS_CMD_RESET_ISE_CONTEXT:
1351 MessageItemResetISEContext *subclass = static_cast<MessageItemResetISEContext*>(message);
1352 m_impl->signal_reset_ise_context (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1353 m_impl->signal_reset_input_context (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1354 if (!m_impl->si.null ()) m_impl->si->reset();
1357 case ISM_TRANS_CMD_TURN_ON_LOG:
1359 MessageItemTurnOnLog *subclass = static_cast<MessageItemTurnOnLog*>(message);
1360 m_impl->signal_turn_on_log (this, subclass->get_state_ref());
1363 case ISM_TRANS_CMD_UPDATE_DISPLAYED_CANDIDATE:
1365 MessageItemUpdateDisplayedCandidate *subclass = static_cast<MessageItemUpdateDisplayedCandidate*>(message);
1366 m_impl->signal_update_displayed_candidate_number (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1367 subclass->get_size_ref());
1368 if (!m_impl->si.null ()) m_impl->si->update_displayed_candidate_number(subclass->get_size_ref());
1371 case ISM_TRANS_CMD_LONGPRESS_CANDIDATE:
1373 MessageItemLongpressCandidate *subclass = static_cast<MessageItemLongpressCandidate*>(message);
1374 m_impl->signal_longpress_candidate (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref(),
1375 subclass->get_index_ref());
1376 if (!m_impl->si.null ()) m_impl->si->longpress_candidate(subclass->get_index_ref());
1379 case ISM_TRANS_CMD_SET_INPUT_HINT:
1381 MessageItemSetInputHint *subclass = static_cast<MessageItemSetInputHint*>(message);
1382 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
1383 m_impl->signal_set_input_hint (this, subclass->get_input_hint_ref());
1385 if (!m_impl->si.null ()) m_impl->si->set_input_hint(subclass->get_input_hint_ref());
1388 case ISM_TRANS_CMD_UPDATE_BIDI_DIRECTION:
1390 MessageItemUpdateBidiDirection *subclass = static_cast<MessageItemUpdateBidiDirection*>(message);
1391 m_impl->signal_update_bidi_direction (this, subclass->get_bidi_direction());
1392 if (!m_impl->si.null ()) m_impl->si->update_bidi_direction(subclass->get_bidi_direction());
1395 case ISM_TRANS_CMD_SHOW_ISE_OPTION_WINDOW:
1397 MessageItemShowISEOptionWindow *subclass = static_cast<MessageItemShowISEOptionWindow*>(message);
1398 m_impl->signal_show_option_window (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1401 case ISM_TRANS_CMD_RESUME_ISE_OPTION_WINDOW:
1403 MessageItemResumeISEOptionWindow *subclass = static_cast<MessageItemResumeISEOptionWindow*>(message);
1404 m_impl->signal_resume_option_window (this, subclass->get_ic_ref(), subclass->get_ic_uuid_ref());
1407 case ISM_TRANS_CMD_CHECK_OPTION_WINDOW:
1410 m_impl->signal_check_option_window (this, avail);
1411 m_impl->send.clear ();
1412 m_impl->send.put_command (SCIM_TRANS_CMD_REPLY);
1413 m_impl->send.put_data (avail);
1414 m_impl->send.write_to_socket (m_impl->socket);
1417 case ISM_TRANS_CMD_PROCESS_INPUT_DEVICE_EVENT:
1419 MessageItemProcessInputDeviceEvent *subclass = static_cast<MessageItemProcessInputDeviceEvent*>(message);
1421 unsigned int ecore_event_id = find_ecore_event_from_device_type((isf_device_type_e)(subclass->get_type_ref()));
1422 char *decoded = (char*)malloc(subclass->get_len_ref());
1423 size_t decoded_size = subclass->get_len_ref();
1425 if(device_buffer_decode((const char*)*(subclass->get_data_ptr()),
1426 subclass->get_len_ref(), (char*)(decoded), &decoded_size)) {
1427 m_impl->signal_process_input_device_event(this, ecore_event_id, decoded, decoded_size, ret);
1433 case SCIM_TRANS_CMD_SET_AUTOCAPITAL_TYPE:
1435 MessageItemSetAutocapitalType *subclass = static_cast<MessageItemSetAutocapitalType*>(message);
1436 if (!m_impl->si.null ()) m_impl->si->set_autocapital_type(subclass->get_auto_capital_type_ref());
1439 case ISM_TRANS_CMD_SET_PREDICTION_ALLOW:
1441 MessageItemSetPredictionAllow *subclass = static_cast<MessageItemSetPredictionAllow*>(message);
1442 if (!m_impl->si.null ()) m_impl->si->set_prediction_allow(subclass->get_prediction_allow_ref() == 0 ? false : true);
1445 case ISM_TRANS_CMD_SET_KEYBOARD_MODE:
1447 MessageItemSetKeyboardMode *subclass = static_cast<MessageItemSetKeyboardMode*>(message);
1448 if (subclass->get_mode_ref())
1449 m_impl->need_update_entry_metadata = false;
1451 m_impl->need_update_entry_metadata = true;
1454 case ISM_TRANS_CMD_SET_PREDICTION_HINT:
1456 MessageItemSetPredictionHint *subclass = static_cast<MessageItemSetPredictionHint*>(message);
1457 m_impl->signal_set_prediction_hint (this, subclass->get_message_ref());
1460 case ISM_TRANS_CMD_SET_MIME_TYPE:
1462 MessageItemSetMimeType *subclass = static_cast<MessageItemSetMimeType*>(message);
1463 if (m_impl->ise_show_flag || m_impl->need_update_entry_metadata) {
1464 m_impl->signal_set_mime_type (this, subclass->get_mime_type_ref());
1468 case ISM_TRANS_CMD_FINALIZE_CONTENT:
1470 MessageItemFinalizeContent *subclass = static_cast<MessageItemFinalizeContent*>(message);
1472 if (m_impl->finalized_text != NULL)
1473 free(m_impl->finalized_text);
1474 m_impl->finalized_text = strdup(subclass->get_text_ref().c_str());
1475 m_impl->finalized_cursor_pos = subclass->get_cursor_pos_ref();
1479 case ISM_TRANS_CMD_SET_PREDICTION_HINT_DATA:
1481 MessageItemSetPredictionHintData *subclass = static_cast<MessageItemSetPredictionHintData*>(message);
1482 m_impl->signal_set_prediction_hint_data (this, 0, subclass->get_key_ref(), subclass->get_value_ref());
1485 case ISM_TRANS_CMD_SET_OPTIMIZATION_HINT:
1487 MessageItemSetOptimizationHint *subclass = static_cast<MessageItemSetOptimizationHint*>(message);
1488 m_impl->signal_set_optimization_hint(this, subclass->get_hint_ref());
1498 * @brief Request SCIM to reload all configuration.
1500 * This function should only by used by Setup Helper to request
1501 * scim's reloading the configuration.
1502 * Deprecated: reload config message only send by socketconfig client
1503 * using socketconfig::reload instead.
1506 HelperAgent::reload_config () const
1508 LOGD ("send reload config message to isf");
1509 if (!m_impl->m_config.null())
1510 m_impl->m_config->reload();
1514 * @brief Register some properties into Panel.
1516 * This function send the request to Panel to register a list
1519 * @param properties The list of Properties to be registered into Panel.
1521 * @sa scim::Property.
1524 HelperAgent::register_properties (const PropertyList &properties) const
1526 if (m_impl->socket_active.is_connected ()) {
1527 m_impl->send.clear ();
1528 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1529 m_impl->send.put_data (m_impl->magic_active);
1530 m_impl->send.put_command (SCIM_TRANS_CMD_REGISTER_PROPERTIES);
1531 m_impl->send.put_data (properties);
1532 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1537 * @brief Update a registered property.
1539 * @param property The property to be updated.
1542 HelperAgent::update_property (const Property &property) const
1544 if (m_impl->socket_active.is_connected ()) {
1545 m_impl->send.clear ();
1546 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1547 m_impl->send.put_data (m_impl->magic_active);
1548 m_impl->send.put_command (SCIM_TRANS_CMD_UPDATE_PROPERTY);
1549 m_impl->send.put_data (property);
1550 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1555 * @brief Send a set of events to an IMEngineInstance.
1557 * All events should be put into a Transaction.
1558 * And the events can only be received by one IMEngineInstance object.
1560 * @param ic The handle of the Input Context to receive the events.
1561 * @param ic_uuid The UUID of the Input Context.
1562 * @param trans The Transaction object holds the events.
1565 HelperAgent::send_imengine_event (int ic,
1566 const String &ic_uuid,
1567 const Transaction &trans) const
1569 //remove if not necessary
1571 if (m_impl->socket_active.is_connected ()) {
1572 m_impl->send.clear ();
1573 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1574 m_impl->send.put_data (m_impl->magic_active);
1575 m_impl->send.put_command (SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT);
1576 m_impl->send.put_data ((uint32)ic);
1577 m_impl->send.put_data (ic_uuid);
1578 m_impl->send.put_data (trans);
1579 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1582 if (!m_impl->si.null ()) m_impl->si->process_helper_event (ic_uuid, trans);
1586 * @brief Send a KeyEvent to an IMEngineInstance.
1588 * @param ic The handle of the IMEngineInstance to receive the event.
1589 * -1 means the currently focused IMEngineInstance.
1590 * @param ic_uuid The UUID of the IMEngineInstance. Empty means don't match.
1591 * @param key The KeyEvent to be sent.
1594 HelperAgent::send_key_event (int ic,
1595 const String &ic_uuid,
1596 const KeyEvent &key) const
1599 //FIXME: remove shift_mode_off, shift_mode_on, shift_mode_lock from ISE side
1600 if (key.code == SHIFT_MODE_OFF ||
1601 key.code == SHIFT_MODE_ON ||
1602 key.code == SHIFT_MODE_LOCK ||
1603 key.code == SHIFT_MODE_ENABLE ||
1604 key.code == SHIFT_MODE_DISABLE) {
1605 LOGW("FIXME ignore shift codes");
1609 if (m_impl->socket_active.is_connected ()) {
1610 m_impl->send.clear ();
1611 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1612 m_impl->send.put_data (m_impl->magic_active);
1613 m_impl->send.put_command (SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT);
1615 m_impl->send.put_data (m_impl->focused_ic);
1617 m_impl->send.put_data ((uint32)ic);
1619 m_impl->send.put_data (ic_uuid);
1620 m_impl->send.put_data (key);
1621 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1626 * @brief Forward a KeyEvent to client application directly.
1628 * @param ic The handle of the client Input Context to receive the event.
1629 * -1 means the currently focused Input Context.
1630 * @param ic_uuid The UUID of the IMEngine used by the Input Context.
1631 * Empty means don't match.
1632 * @param key The KeyEvent to be forwarded.
1635 HelperAgent::forward_key_event (int ic,
1636 const String &ic_uuid,
1637 const KeyEvent &key) const
1639 if (m_impl->socket_active.is_connected ()) {
1640 m_impl->send.clear ();
1641 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1642 m_impl->send.put_data (m_impl->magic_active);
1643 m_impl->send.put_command (SCIM_TRANS_CMD_FORWARD_KEY_EVENT);
1645 m_impl->send.put_data (m_impl->focused_ic);
1647 m_impl->send.put_data ((uint32)ic);
1649 m_impl->send.put_data (ic_uuid);
1650 m_impl->send.put_data (key);
1651 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1656 * @brief Commit a WideString to client application directly.
1658 * @param ic The handle of the client Input Context to receive the WideString.
1659 * -1 means the currently focused Input Context.
1660 * @param ic_uuid The UUID of the IMEngine used by the Input Context.
1661 * Empty means don't match.
1662 * @param wstr The WideString to be committed.
1665 HelperAgent::commit_string (int ic,
1666 const String &ic_uuid,
1667 const WideString &wstr) const
1669 if (m_impl->socket_active.is_connected ()) {
1670 m_impl->send.clear ();
1671 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1672 m_impl->send.put_data (m_impl->magic_active);
1673 m_impl->send.put_command (SCIM_TRANS_CMD_COMMIT_STRING);
1675 m_impl->send.put_data (m_impl->focused_ic);
1677 m_impl->send.put_data ((uint32)ic);
1679 m_impl->send.put_data (ic_uuid);
1680 m_impl->send.put_data (wstr);
1681 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1686 HelperAgent::commit_string (int ic,
1687 const String &ic_uuid,
1691 if (m_impl->socket_active.is_connected ()) {
1692 m_impl->send.clear ();
1693 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1694 m_impl->send.put_data (m_impl->magic_active);
1695 m_impl->send.put_command (SCIM_TRANS_CMD_COMMIT_STRING);
1697 m_impl->send.put_data (m_impl->focused_ic);
1699 m_impl->send.put_data ((uint32)ic);
1701 m_impl->send.put_data (ic_uuid);
1702 m_impl->send.put_dataw (buf, buflen);
1703 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1708 * @brief Request to show preedit string.
1710 * @param ic The handle of the client Input Context to receive the request.
1711 * -1 means the currently focused Input Context.
1712 * @param ic_uuid The UUID of the IMEngine used by the Input Context.
1713 * Empty means don't match.
1716 HelperAgent::show_preedit_string (int ic,
1717 const String &ic_uuid) const
1720 if (m_impl->socket_active.is_connected ()) {
1721 m_impl->send.clear ();
1722 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1723 m_impl->send.put_data (m_impl->magic_active);
1724 m_impl->send.put_command (SCIM_TRANS_CMD_SHOW_PREEDIT_STRING);
1725 m_impl->send.put_data ((uint32)ic);
1726 m_impl->send.put_data (ic_uuid);
1727 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1732 * @brief Request to show aux string.
1735 HelperAgent::show_aux_string (void) const
1738 if (m_impl->socket_active.is_connected ()) {
1739 m_impl->send.clear ();
1740 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1741 m_impl->send.put_data (m_impl->magic_active);
1742 m_impl->send.put_command (SCIM_TRANS_CMD_SHOW_AUX_STRING);
1743 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1748 * @brief Request to show candidate string.
1751 HelperAgent::show_candidate_string (void) const
1754 if (m_impl->socket_active.is_connected ()) {
1755 m_impl->send.clear ();
1756 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1757 m_impl->send.put_data (m_impl->magic_active);
1758 m_impl->send.put_command (SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE);
1759 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1764 * @brief Request to show associate string.
1767 HelperAgent::show_associate_string (void) const
1769 if (m_impl->socket_active.is_connected ()) {
1770 m_impl->send.clear ();
1771 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1772 m_impl->send.put_data (m_impl->magic_active);
1773 m_impl->send.put_command (ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE);
1774 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1779 * @brief Request to hide preedit string.
1781 * @param ic The handle of the client Input Context to receive the request.
1782 * -1 means the currently focused Input Context.
1783 * @param ic_uuid The UUID of the IMEngine used by the Input Context.
1784 * Empty means don't match.
1787 HelperAgent::hide_preedit_string (int ic,
1788 const String &ic_uuid) const
1791 if (m_impl->socket_active.is_connected ()) {
1792 m_impl->send.clear ();
1793 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1794 m_impl->send.put_data (m_impl->magic_active);
1795 m_impl->send.put_command (SCIM_TRANS_CMD_HIDE_PREEDIT_STRING);
1796 m_impl->send.put_data ((uint32)ic);
1797 m_impl->send.put_data (ic_uuid);
1798 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1803 * @brief Request to hide aux string.
1806 HelperAgent::hide_aux_string (void) const
1808 if (m_impl->socket_active.is_connected ()) {
1809 m_impl->send.clear ();
1810 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1811 m_impl->send.put_data (m_impl->magic_active);
1812 m_impl->send.put_command (SCIM_TRANS_CMD_HIDE_AUX_STRING);
1813 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1818 * @brief Request to hide candidate string.
1821 HelperAgent::hide_candidate_string (void) const
1823 if (m_impl->socket_active.is_connected ()) {
1824 m_impl->send.clear ();
1825 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1826 m_impl->send.put_data (m_impl->magic_active);
1827 m_impl->send.put_command (SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE);
1828 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1833 * @brief Request to hide associate string.
1836 HelperAgent::hide_associate_string (void) const
1838 if (m_impl->socket_active.is_connected ()) {
1839 m_impl->send.clear ();
1840 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1841 m_impl->send.put_data (m_impl->magic_active);
1842 m_impl->send.put_command (ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE);
1843 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1848 * @brief Update a new WideString for preedit.
1850 * @param ic The handle of the client Input Context to receive the WideString.
1851 * -1 means the currently focused Input Context.
1852 * @param ic_uuid The UUID of the IMEngine used by the Input Context.
1853 * Empty means don't match.
1854 * @param str The WideString to be updated.
1855 * @param attrs The attribute list for preedit string.
1858 HelperAgent::update_preedit_string (int ic,
1859 const String &ic_uuid,
1860 const WideString &str,
1861 const AttributeList &attrs) const
1863 update_preedit_string (ic, ic_uuid, str, str, attrs, -1);
1867 HelperAgent::update_preedit_string (int ic,
1868 const String &ic_uuid,
1871 const AttributeList &attrs) const
1873 update_preedit_string (ic, ic_uuid, buf, buflen, attrs, -1);
1877 * @brief Update a new WideString for preedit.
1879 * @param ic The handle of the client Input Context to receive the WideString.
1880 * -1 means the currently focused Input Context.
1881 * @param ic_uuid The UUID of the IMEngine used by the Input Context.
1882 * Empty means don't match.
1883 * @param str The WideString to be updated.
1884 * @param attrs The attribute list for preedit string.
1885 * @param caret The caret position in preedit string.
1888 HelperAgent::update_preedit_string (int ic,
1889 const String &ic_uuid,
1890 const WideString &wstr,
1891 const AttributeList &attrs,
1894 update_preedit_string (ic, ic_uuid, wstr, wstr, attrs, caret);
1898 HelperAgent::update_preedit_string (int ic,
1899 const String &ic_uuid,
1902 const AttributeList &attrs,
1906 if (m_impl->socket_active.is_connected ()) {
1907 m_impl->send.clear ();
1908 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1909 m_impl->send.put_data (m_impl->magic_active);
1910 m_impl->send.put_command (SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING);
1911 m_impl->send.put_data ((uint32)ic);
1912 m_impl->send.put_data (ic_uuid);
1913 m_impl->send.put_dataw (buf, buflen);
1914 m_impl->send.put_dataw (buf, buflen);
1915 m_impl->send.put_data (attrs);
1916 m_impl->send.put_data (caret);
1917 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1922 HelperAgent::update_preedit_string (int ic,
1923 const String &ic_uuid,
1924 const WideString &preedit,
1925 const WideString &commit,
1926 const AttributeList &attrs,
1929 if (m_impl->socket_active.is_connected ()) {
1930 m_impl->send.clear ();
1931 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1932 m_impl->send.put_data (m_impl->magic_active);
1933 m_impl->send.put_command (SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING);
1934 m_impl->send.put_data ((uint32)ic);
1935 m_impl->send.put_data (ic_uuid);
1936 m_impl->send.put_data (preedit);
1937 m_impl->send.put_data (commit);
1938 m_impl->send.put_data (attrs);
1939 m_impl->send.put_data (caret);
1940 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1945 * @brief Update the preedit caret position in the preedit string.
1947 * @param caret - the new position of the preedit caret.
1950 HelperAgent::update_preedit_caret (int caret) const
1953 if (m_impl->socket_active.is_connected ()) {
1954 m_impl->send.clear ();
1955 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1956 m_impl->send.put_data (m_impl->magic_active);
1957 m_impl->send.put_command (SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET);
1958 m_impl->send.put_data ((uint32)caret);
1959 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1964 * @brief Update a new string for aux.
1966 * @param str The string to be updated.
1967 * @param attrs The attribute list for aux string.
1970 HelperAgent::update_aux_string (const String &str,
1971 const AttributeList &attrs) const
1973 if (m_impl->socket_active.is_connected ()) {
1974 m_impl->send.clear ();
1975 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1976 m_impl->send.put_data (m_impl->magic_active);
1977 m_impl->send.put_command (SCIM_TRANS_CMD_UPDATE_AUX_STRING);
1978 m_impl->send.put_data (str);
1979 m_impl->send.put_data (attrs);
1980 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
1985 * @brief Request to update candidate.
1987 * @param table The lookup table for candidate.
1990 HelperAgent::update_candidate_string (const LookupTable &table) const
1992 if (m_impl->socket_active.is_connected ()) {
1993 m_impl->send.clear ();
1994 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
1995 m_impl->send.put_data (m_impl->magic_active);
1996 m_impl->send.put_command (SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE);
1997 m_impl->send.put_data (table);
1998 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2003 * @brief Request to update associate.
2005 * @param table The lookup table for associate.
2008 HelperAgent::update_associate_string (const LookupTable &table) const
2010 if (m_impl->socket_active.is_connected ()) {
2011 m_impl->send.clear ();
2012 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2013 m_impl->send.put_data (m_impl->magic_active);
2014 m_impl->send.put_command (ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE);
2015 m_impl->send.put_data (table);
2016 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2021 * @brief When the input context of ISE is changed,
2022 * ISE can call this function to notify application
2024 * @param type type of event.
2025 * @param value value of event.
2028 HelperAgent::update_input_context (uint32 type, uint32 value) const
2030 if (type == ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT) {
2031 /* Update all state variables that could be queried by the client application */
2033 m_impl->signal_get_language_locale(this, -1, &buf);
2036 if (m_impl->socket_active.is_connected()) {
2037 m_impl->send.clear();
2038 m_impl->send.put_command(SCIM_TRANS_CMD_REQUEST);
2039 m_impl->send.put_data(m_impl->magic_active);
2040 m_impl->send.put_command(ISM_TRANS_CMD_UPDATE_ISE_LANGUAGE_LOCALE);
2041 m_impl->send.put_data(buf, strlen(buf));
2042 m_impl->send.write_to_socket(m_impl->socket_active, m_impl->magic_active);
2049 if (m_impl->socket_active.is_connected ()) {
2050 m_impl->send.clear ();
2051 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2052 m_impl->send.put_data (m_impl->magic_active);
2053 m_impl->send.put_command (ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT);
2054 m_impl->send.put_data (type);
2055 m_impl->send.put_data (value);
2056 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2061 * @brief Request to get surrounding text asynchronously.
2063 * @param uuid The helper ISE UUID.
2064 * @param maxlen_before The max length of before.
2065 * @param maxlen_after The max length of after.
2068 HelperAgent::get_surrounding_text (const String &uuid, int maxlen_before, int maxlen_after) const
2070 if (m_impl->socket_active.is_connected () && (m_impl->need_update_surrounding_text == 0)) {
2071 m_impl->send.clear ();
2072 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2073 m_impl->send.put_data (m_impl->magic_active);
2074 m_impl->send.put_command (SCIM_TRANS_CMD_GET_SURROUNDING_TEXT);
2075 m_impl->send.put_data (uuid);
2076 m_impl->send.put_data (maxlen_before);
2077 m_impl->send.put_data (maxlen_after);
2078 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2080 m_impl->need_update_surrounding_text++;
2084 * @brief Request to get surrounding text synchronously.
2086 * @param uuid The helper ISE UUID.
2087 * @param maxlen_before The max length of before.
2088 * @param maxlen_after The max length of after.
2089 * @param text The surrounding text.
2090 * @param cursor The cursor position.
2093 HelperAgent::get_surrounding_text (int maxlen_before, int maxlen_after, String &text, int &cursor)
2095 if (!m_impl->socket_active.is_connected ())
2098 if (!m_impl->ise_focus_flag) {
2099 if (m_impl->finalized_text) {
2100 String buffer = m_impl->finalized_text;
2101 cursor = m_impl->finalized_cursor_pos;
2102 int pos = cursor - maxlen_before;
2103 if (maxlen_before < 0) pos = 0;
2104 if (pos > (int)buffer.length()) pos = (int)buffer.length();
2105 if (pos < 0) pos = 0;
2106 size_t len = maxlen_after + (cursor - pos);
2107 if (maxlen_after < 0) len = String::npos;
2108 text = buffer.substr (pos, len);
2114 m_impl->send.clear();
2115 m_impl->send.put_command(SCIM_TRANS_CMD_REQUEST);
2116 m_impl->send.put_data(m_impl->magic_active);
2117 m_impl->send.put_command(SCIM_TRANS_CMD_GET_SURROUNDING_TEXT);
2118 m_impl->send.put_data("");
2119 m_impl->send.put_data(maxlen_before);
2120 m_impl->send.put_data(maxlen_after);
2121 m_impl->send.write_to_socket(m_impl->socket_active, m_impl->magic_active);
2122 if (m_impl->surrounding_text) {
2123 free(m_impl->surrounding_text);
2124 m_impl->surrounding_text = NULL;
2127 const int WAIT_FOR_SYNC_RESPONSE_TIMEOUT = 1000;
2128 /* Now we are waiting for the ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT message */
2129 if (wait_for_message(ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT, WAIT_FOR_SYNC_RESPONSE_TIMEOUT)) {
2130 MessageItem *message = message_queue.get_pending_message_by_cmd(ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT);
2131 handle_message(message);
2132 message_queue.remove_message(message);
2134 if (m_impl->surrounding_text) {
2135 text = m_impl->surrounding_text;
2136 cursor = m_impl->cursor_pos;
2140 if (m_impl->surrounding_text) {
2141 free(m_impl->surrounding_text);
2142 m_impl->surrounding_text = NULL;
2148 * @brief Request to delete surrounding text.
2150 * @param offset The offset for cursor position.
2151 * @param len The length for delete text.
2154 HelperAgent::delete_surrounding_text (int offset, int len) const
2156 LOGD ("offset = %d, len = %d", offset, len);
2158 if (m_impl->socket_active.is_connected ()) {
2159 m_impl->send.clear ();
2160 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2161 m_impl->send.put_data (m_impl->magic_active);
2162 m_impl->send.put_command (SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT);
2163 m_impl->send.put_data (offset);
2164 m_impl->send.put_data (len);
2165 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2170 * @brief Request to get selection text asynchronously.
2172 * @param uuid The helper ISE UUID.
2175 HelperAgent::get_selection (const String &uuid) const
2177 if (m_impl->socket_active.is_connected () && (m_impl->need_update_selection_text == 0)) {
2178 m_impl->send.clear ();
2179 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2180 m_impl->send.put_data (m_impl->magic_active);
2181 m_impl->send.put_command (SCIM_TRANS_CMD_GET_SELECTION);
2182 m_impl->send.put_data (uuid);
2183 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2185 m_impl->need_update_selection_text++;
2189 * @brief Request to get selection text synchronously.
2191 * @param text The selection text.
2194 HelperAgent::get_selection_text (String &text)
2197 if (!m_impl->socket_active.is_connected ())
2200 m_impl->send.clear ();
2201 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2202 m_impl->send.put_data (m_impl->magic_active);
2203 m_impl->send.put_command (SCIM_TRANS_CMD_GET_SELECTION);
2204 m_impl->send.put_data ("");
2205 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2206 if (m_impl->selection_text) {
2207 free (m_impl->selection_text);
2208 m_impl->selection_text = NULL;
2211 const int WAIT_FOR_SYNC_RESPONSE_TIMEOUT = 1000;
2212 /* Now we are waiting for the ISM_TRANS_CMD_UPDATE_SELECTION message */
2213 if (wait_for_message(ISM_TRANS_CMD_UPDATE_SELECTION, WAIT_FOR_SYNC_RESPONSE_TIMEOUT)) {
2214 MessageItem *message = message_queue.get_pending_message_by_cmd(ISM_TRANS_CMD_UPDATE_SELECTION);
2215 handle_message(message);
2216 message_queue.remove_message(message);
2217 if (m_impl->selection_text) {
2218 text = m_impl->selection_text;
2222 if (m_impl->selection_text) {
2223 free (m_impl->selection_text);
2224 m_impl->selection_text = NULL;
2229 * @brief Request to select text.
2231 * @param start The start position in text.
2232 * @param end The end position in text.
2235 HelperAgent::set_selection (int start, int end) const
2237 if (m_impl->socket_active.is_connected ()) {
2238 m_impl->send.clear ();
2239 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2240 m_impl->send.put_data (m_impl->magic_active);
2241 m_impl->send.put_command (SCIM_TRANS_CMD_SET_SELECTION);
2242 m_impl->send.put_data (start);
2243 m_impl->send.put_data (end);
2244 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2249 * @brief Send a private command to an application.
2251 * @param command The private command sent from IME.
2254 HelperAgent::send_private_command (const String &command) const
2256 if (m_impl->socket_active.is_connected ()) {
2257 m_impl->send.clear ();
2258 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2259 m_impl->send.put_data (m_impl->magic_active);
2260 m_impl->send.put_command (SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND);
2261 m_impl->send.put_data (command);
2262 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2267 * @brief Commit content to an application.
2269 * @param content The content sent from IME.
2272 HelperAgent::commit_content (const String &content, const String &description, const String &mime_types) const
2275 if (m_impl->socket_active.is_connected ()) {
2276 m_impl->send.clear ();
2277 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2278 m_impl->send.put_data (m_impl->magic_active);
2279 m_impl->send.put_command (SCIM_TRANS_CMD_COMMIT_CONTENT);
2280 m_impl->send.put_data (content);
2281 m_impl->send.put_data (description);
2282 m_impl->send.put_data (mime_types);
2283 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2288 * @brief Request to get uuid list of all keyboard ISEs.
2290 * @param uuid The helper ISE UUID.
2293 HelperAgent::get_keyboard_ise_list (const String &uuid) const
2295 if (m_impl->socket_active.is_connected ()) {
2296 m_impl->send.clear ();
2297 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2298 m_impl->send.put_data (m_impl->magic_active);
2299 m_impl->send.put_command (ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST);
2300 m_impl->send.put_data (uuid);
2301 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2306 * @brief Set candidate position in screen.
2308 * @param left The x position in screen.
2309 * @param top The y position in screen.
2312 HelperAgent::set_candidate_position (int left, int top) const
2314 if (m_impl->socket_active.is_connected ()) {
2315 m_impl->send.clear ();
2316 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2317 m_impl->send.put_data (m_impl->magic_active);
2318 m_impl->send.put_command (ISM_TRANS_CMD_SET_CANDIDATE_POSITION);
2319 m_impl->send.put_data (left);
2320 m_impl->send.put_data (top);
2321 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2326 * @brief Set candidate style.
2328 * @param portrait_line - the displayed line number for portrait mode.
2329 * @param mode - candidate window mode.
2332 HelperAgent::set_candidate_style (ISF_CANDIDATE_PORTRAIT_LINE_T portrait_line,
2333 ISF_CANDIDATE_MODE_T mode) const
2335 if (m_impl->socket_active.is_connected ()) {
2336 m_impl->send.clear ();
2337 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2338 m_impl->send.put_data (m_impl->magic_active);
2339 m_impl->send.put_command (ISM_TRANS_CMD_SET_CANDIDATE_UI);
2340 m_impl->send.put_data (portrait_line);
2341 m_impl->send.put_data (mode);
2342 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2347 * @brief Request to hide candidate window.
2350 HelperAgent::candidate_hide (void) const
2352 if (m_impl->socket_active.is_connected ()) {
2353 m_impl->send.clear ();
2354 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2355 m_impl->send.put_data (m_impl->magic_active);
2356 m_impl->send.put_command (ISM_TRANS_CMD_HIDE_CANDIDATE);
2357 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2362 * @brief Request to get candidate window size and position.
2364 * @param uuid The helper ISE UUID.
2367 HelperAgent::get_candidate_window_geometry (const String &uuid) const
2369 if (m_impl->socket_active.is_connected ()) {
2370 m_impl->send.clear ();
2371 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2372 m_impl->send.put_data (m_impl->magic_active);
2373 m_impl->send.put_command (ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY);
2374 m_impl->send.put_data (uuid);
2375 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2380 * @brief Set current keyboard ISE.
2382 * @param uuid The keyboard ISE UUID.
2385 HelperAgent::set_keyboard_ise_by_uuid (const String &uuid) const
2388 IMEngineFactoryPointer factory;
2389 IMEngineModule *engine_module = NULL;
2390 static int instance_count = 1;
2392 if ((!m_impl->si.null ()) && m_impl->si->get_factory_uuid () == uuid) {
2393 ISF_SAVE_LOG ("Already in UUID: %s", uuid.c_str());
2397 if (!m_impl->si.null()) {
2398 m_impl->si->focus_out();
2402 if (m_impl->m_config.null ()) {
2403 ISF_SAVE_LOG ("config is not working");
2407 #ifdef HAVE_PKGMGR_INFO
2410 pkgmgrinfo_appinfo_h handle;
2411 ret = pkgmgrinfo_appinfo_get_appinfo(uuid.c_str(), &handle);
2412 if (ret != PMINFO_R_OK) {
2413 ISF_SAVE_LOG ("Retrieve app info failed : %s", uuid.c_str ());
2417 ret = pkgmgrinfo_appinfo_get_pkgid(handle, &pkgid);
2418 if (ret != PMINFO_R_OK) {
2419 ISF_SAVE_LOG ("Retrieve pkgid failed : %s, %p", uuid.c_str(), handle);
2420 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2424 imeInfo.module_name = pkgid;
2425 pkgmgrinfo_appinfo_destroy_appinfo(handle);
2427 if (isf_db_select_ime_info_by_appid(uuid.c_str(), &imeInfo) < 1) {
2428 ISF_SAVE_LOG ("ime_info row is not available for %s", uuid.c_str());
2433 engine_module = &m_impl->engine_module;
2435 if (engine_module->valid() && imeInfo.module_name != engine_module->get_module_name()) {
2436 ISF_SAVE_LOG ("imengine module %s unloaded", engine_module->get_module_name().c_str());
2437 engine_module->unload();
2440 if (!engine_module->valid()) {
2441 if (engine_module->load (imeInfo.module_name, m_impl->m_config) == false) {
2442 ISF_SAVE_LOG ("load module %s failed", imeInfo.module_name.c_str());
2445 ISF_SAVE_LOG ("imengine module %s loaded", imeInfo.module_name.c_str());
2448 for (size_t j = 0; j < engine_module->number_of_factories (); ++j) {
2450 factory = engine_module->create_factory (j);
2451 if (factory.null () == false && factory->get_uuid () == uuid)
2459 if (factory.null()) {
2460 ISF_SAVE_LOG ("imengine uuid %s is not found", uuid.c_str());
2464 m_impl->si = factory->create_instance ("UTF-8", instance_count++);
2465 if (m_impl->si.null ()) {
2466 ISF_SAVE_LOG ("create_instance %s failed", uuid.c_str ());
2470 m_impl->attach_instance ();
2471 ISF_SAVE_LOG ("Require UUID: %s Current UUID: %s", uuid.c_str (), m_impl->si->get_factory_uuid ().c_str ());
2472 m_impl->si->set_layout (m_impl->layout);
2473 if (m_impl->focused_ic != (uint32)-1)
2474 m_impl->si->focus_in ();
2478 * @brief Request to get current keyboard ISE information.
2480 * @param uuid The helper ISE UUID.
2483 HelperAgent::get_keyboard_ise (const String &uuid) const
2485 //FIXME: maybe useless
2487 if (m_impl->socket_active.is_connected ()) {
2488 m_impl->send.clear ();
2489 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2490 m_impl->send.put_data (m_impl->magic_active);
2491 m_impl->send.put_command (ISM_TRANS_CMD_GET_KEYBOARD_ISE);
2492 m_impl->send.put_data (uuid);
2493 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2499 * @brief Update ISE window geometry.
2501 * @param x The x position in screen.
2502 * @param y The y position in screen.
2503 * @param width The ISE window width.
2504 * @param height The ISE window height.
2507 HelperAgent::update_geometry (int x, int y, int width, int height) const
2509 if (m_impl->socket_active.is_connected ()) {
2510 m_impl->send.clear ();
2511 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2512 m_impl->send.put_data (m_impl->magic_active);
2513 m_impl->send.put_command (ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY);
2514 m_impl->send.put_data (x);
2515 m_impl->send.put_data (y);
2516 m_impl->send.put_data (width);
2517 m_impl->send.put_data (height);
2518 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2523 * @brief Request to expand candidate window.
2526 HelperAgent::expand_candidate (void) const
2528 if (m_impl->socket_active.is_connected ()) {
2529 m_impl->send.clear ();
2530 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2531 m_impl->send.put_data (m_impl->magic_active);
2532 m_impl->send.put_command (ISM_TRANS_CMD_EXPAND_CANDIDATE);
2533 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2538 * @brief Request to contract candidate window.
2541 HelperAgent::contract_candidate (void) const
2543 if (m_impl->socket_active.is_connected ()) {
2544 m_impl->send.clear ();
2545 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2546 m_impl->send.put_data (m_impl->magic_active);
2547 m_impl->send.put_command (ISM_TRANS_CMD_CONTRACT_CANDIDATE);
2548 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2553 * @brief Send selected candidate string index number.
2556 HelperAgent::select_candidate (int index) const
2558 if (!m_impl->si.null ())
2559 m_impl->si->select_candidate (index);
2560 //FIXME: maybe useless
2563 if (m_impl->socket_active.is_connected ()) {
2564 m_impl->send.clear ();
2565 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2566 m_impl->send.put_data (m_impl->magic_active);
2567 m_impl->send.put_command (ISM_TRANS_CMD_SELECT_CANDIDATE);
2568 m_impl->send.put_data (index);
2569 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2575 * @brief Update our ISE is exiting.
2577 * The IME must call this function before terminating IME itself in On-demand mode.
2578 * If this function isn't called, IME will automatically restart.
2579 * This function only works in On-demand mode.
2583 HelperAgent::update_ise_exit (void) const
2585 if (m_impl->socket_active.is_connected ()) {
2586 m_impl->send.clear ();
2587 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2588 m_impl->send.put_data (m_impl->magic_active);
2589 m_impl->send.put_command (ISM_TRANS_CMD_UPDATE_ISE_EXIT);
2590 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2592 // The update_ise_exit must be delivered before del_client of isf_info_manager was called.
2598 * @brief Request to reset keyboard ISE.
2601 HelperAgent::reset_keyboard_ise (void) const
2603 //FIXME: maybe useless
2605 if (m_impl->socket_active.is_connected ()) {
2606 m_impl->send.clear ();
2607 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2608 m_impl->send.put_data (m_impl->magic_active);
2609 m_impl->send.put_command (ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE);
2610 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2613 if (!m_impl->si.null ()) {
2614 m_impl->si->reset ();
2619 * @brief Request to flush keyboard ISE.
2622 HelperAgent::flush_keyboard_ise (void) const
2624 if (!m_impl->si.null ()) {
2625 m_impl->si->flush ();
2630 * @brief Request panel to hide ISE.
2633 HelperAgent::request_ise_hide (void) const
2635 if (m_impl->socket_active.is_connected ()) {
2636 m_impl->send.clear ();
2637 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2638 m_impl->send.put_data (m_impl->magic_active);
2639 m_impl->send.put_command (ISM_TRANS_CMD_REQUEST_ISE_HIDE);
2640 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2648 HelperAgent::recapture_string (int ic,
2649 const String &ic_uuid,
2652 const WideString &preedit_str,
2653 const WideString &commit_str,
2654 const AttributeList &attrs) const
2656 LOGD ("offset = %d, len = %d", offset, len);
2658 if (m_impl->socket_active.is_connected ()) {
2659 m_impl->send.clear ();
2660 m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST);
2661 m_impl->send.put_data (m_impl->magic_active);
2662 m_impl->send.put_command (ISM_TRANS_CMD_RECAPTURE_STRING);
2664 m_impl->send.put_data ((uint32)ic);
2665 m_impl->send.put_data (ic_uuid);
2667 // Deleting surrounding text
2668 m_impl->send.put_data (offset);
2669 m_impl->send.put_data (len);
2671 // Update preedit text
2672 m_impl->send.put_data (preedit_str);
2675 m_impl->send.put_data (commit_str);
2677 // preedit attributes
2678 m_impl->send.put_data (attrs);
2680 m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active);
2685 * @brief Connect a slot to Helper exit signal.
2687 * This signal is used to let the Helper exit.
2689 * The prototype of the slot is:
2691 * void exit (const HelperAgent *agent, int ic, const String &ic_uuid);
2694 * - agent The pointer to the HelperAgent object which emits this signal.
2695 * - ic An opaque handle of the currently focused input context.
2696 * - ic_uuid The UUID of the IMEngineInstance associated with the focused input context.
2699 HelperAgent::signal_connect_exit (HelperAgentSlotVoid *slot)
2701 return m_impl->signal_exit.connect (slot);
2705 * @brief Connect a slot to Helper attach input context signal.
2707 * This signal is used to attach an input context to this helper.
2709 * When an input context requst to start this helper, then this
2710 * signal will be emitted as soon as the helper is started.
2712 * When an input context want to start an already started helper,
2713 * this signal will also be emitted.
2715 * Helper can send some events back to the IMEngineInstance in this
2716 * signal-slot, to inform that it has been started sccessfully.
2718 * The prototype of the slot is:
2720 * void attach_input_context (const HelperAgent *agent, int ic, const String &ic_uuid);
2723 HelperAgent::signal_connect_attach_input_context (HelperAgentSlotVoid *slot)
2725 return m_impl->signal_attach_input_context.connect (slot);
2729 * @brief Connect a slot to Helper detach input context signal.
2731 * This signal is used to detach an input context from this helper.
2733 * When an input context requst to stop this helper, then this
2734 * signal will be emitted.
2736 * Helper shouldn't send any event back to the IMEngineInstance, because
2737 * the IMEngineInstance attached to the ic should have been destroyed.
2739 * The prototype of the slot is:
2741 * void detach_input_context (const HelperAgent *agent, int ic, const String &ic_uuid);
2744 HelperAgent::signal_connect_detach_input_context (HelperAgentSlotVoid *slot)
2746 return m_impl->signal_detach_input_context.connect (slot);
2750 * @brief Connect a slot to Helper reload config signal.
2752 * This signal is used to let the Helper reload configuration.
2754 * The prototype of the slot is:
2756 * void reload_config (const HelperAgent *agent, int ic, const String &ic_uuid);
2759 HelperAgent::signal_connect_reload_config (HelperAgentSlotVoid *slot)
2761 return m_impl->signal_reload_config.connect (slot);
2765 * @brief Connect a slot to Helper update screen signal.
2767 * This signal is used to let the Helper move its GUI to another screen.
2768 * It can only be emitted when SCIM_HELPER_NEED_SCREEN_INFO is set in HelperInfo.option.
2770 * The prototype of the slot is:
2772 * void update_screen (const HelperAgent *agent, int ic, const String &ic_uuid, int screen_number);
2775 HelperAgent::signal_connect_update_screen (HelperAgentSlotInt *slot)
2777 return m_impl->signal_update_screen.connect (slot);
2781 * @brief Connect a slot to Helper update spot location signal.
2783 * This signal is used to let the Helper move its GUI according to the current spot location.
2784 * It can only be emitted when SCIM_HELPER_NEED_SPOT_LOCATION_INFO is set in HelperInfo.option.
2786 * The prototype of the slot is:
2787 * void update_spot_location (const HelperAgent *agent, int ic, const String &ic_uuid, int x, int y);
2790 HelperAgent::signal_connect_update_spot_location (HelperAgentSlotIntInt *slot)
2792 return m_impl->signal_update_spot_location.connect (slot);
2796 * @brief Connect a slot to Helper update cursor position signal.
2798 * This signal is used to let the Helper get the cursor position information.
2800 * The prototype of the slot is:
2801 * void update_cursor_position (const HelperAgent *agent, int ic, const String &ic_uuid, int cursor_pos);
2804 HelperAgent::signal_connect_update_cursor_position (HelperAgentSlotInt *slot)
2806 return m_impl->signal_update_cursor_position.connect (slot);
2810 * @brief Connect a slot to Helper update surrounding text signal.
2812 * This signal is used to let the Helper get the surrounding text.
2814 * The prototype of the slot is:
2815 * void update_surrounding_text (const HelperAgent *agent, int ic, const String &text, int cursor);
2818 HelperAgent::signal_connect_update_surrounding_text (HelperAgentSlotInt *slot)
2820 return m_impl->signal_update_surrounding_text.connect (slot);
2824 * @brief Connect a slot to Helper update selection signal.
2826 * This signal is used to let the Helper get the selection.
2828 * The prototype of the slot is:
2829 * void update_selection (const HelperAgent *agent, int ic, const String &text);
2832 HelperAgent::signal_connect_update_selection (HelperAgentSlotVoid *slot)
2834 return m_impl->signal_update_selection.connect (slot);
2838 * @brief Connect a slot to Helper trigger property signal.
2840 * This signal is used to trigger a property registered by this Helper.
2841 * A property will be triggered when user clicks on it.
2843 * The prototype of the slot is:
2844 * void trigger_property (const HelperAgent *agent, int ic, const String &ic_uuid, const String &property);
2847 HelperAgent::signal_connect_trigger_property (HelperAgentSlotString *slot)
2849 return m_impl->signal_trigger_property.connect (slot);
2853 * @brief Connect a slot to Helper process imengine event signal.
2855 * This signal is used to deliver the events sent from IMEngine to Helper.
2857 * The prototype of the slot is:
2858 * void process_imengine_event (const HelperAgent *agent, int ic, const String &ic_uuid, const Transaction &transaction);
2861 HelperAgent::signal_connect_process_imengine_event (HelperAgentSlotTransaction *slot)
2863 return m_impl->signal_process_imengine_event.connect (slot);
2867 * @brief Connect a slot to Helper focus out signal.
2869 * This signal is used to do something when input context is focus out.
2871 * The prototype of the slot is:
2872 * void focus_out (const HelperAgent *agent, int ic, const String &ic_uuid);
2875 HelperAgent::signal_connect_focus_out (HelperAgentSlotVoid *slot)
2877 return m_impl->signal_focus_out.connect (slot);
2881 * @brief Connect a slot to Helper focus in signal.
2883 * This signal is used to do something when input context is focus in.
2885 * The prototype of the slot is:
2886 * void focus_in (const HelperAgent *agent, int ic, const String &ic_uuid);
2889 HelperAgent::signal_connect_focus_in (HelperAgentSlotVoid *slot)
2891 return m_impl->signal_focus_in.connect (slot);
2895 * @brief Connect a slot to Helper show signal.
2897 * This signal is used to show Helper ISE window.
2899 * The prototype of the slot is:
2900 * void ise_show (const HelperAgent *agent, int ic, char *buf, size_t &len);
2903 HelperAgent::signal_connect_ise_show (HelperAgentSlotIntRawVoid *slot)
2905 return m_impl->signal_ise_show.connect (slot);
2909 * @brief Connect a slot to Helper hide signal.
2911 * This signal is used to hide Helper ISE window.
2913 * The prototype of the slot is:
2914 * void ise_hide (const HelperAgent *agent, int ic, const String &ic_uuid);
2917 HelperAgent::signal_connect_ise_hide (HelperAgentSlotVoid *slot)
2919 return m_impl->signal_ise_hide.connect (slot);
2923 * @brief Connect a slot to Helper get ISE window geometry signal.
2925 * This signal is used to get Helper ISE window size and position.
2927 * The prototype of the slot is:
2928 * void get_geometry (const HelperAgent *agent, struct rectinfo &info);
2931 HelperAgent::signal_connect_get_geometry (HelperAgentSlotSize *slot)
2933 return m_impl->signal_get_geometry.connect (slot);
2937 * @brief Connect a slot to Helper set mode signal.
2939 * This signal is used to set Helper ISE mode.
2941 * The prototype of the slot is:
2942 * void set_mode (const HelperAgent *agent, uint32 &mode);
2945 HelperAgent::signal_connect_set_mode (HelperAgentSlotUintVoid *slot)
2947 return m_impl->signal_set_mode.connect (slot);
2951 * @brief Connect a slot to Helper set language signal.
2953 * This signal is used to set Helper ISE language.
2955 * The prototype of the slot is:
2956 * void set_language (const HelperAgent *agent, uint32 &language);
2959 HelperAgent::signal_connect_set_language (HelperAgentSlotUintVoid *slot)
2961 return m_impl->signal_set_language.connect (slot);
2965 * @brief Connect a slot to Helper set im data signal.
2967 * This signal is used to send im data to Helper ISE.
2969 * The prototype of the slot is:
2970 * void set_imdata (const HelperAgent *agent, char *buf, size_t &len);
2973 HelperAgent::signal_connect_set_imdata (HelperAgentSlotRawVoid *slot)
2975 return m_impl->signal_set_imdata.connect (slot);
2979 * @brief Connect a slot to Helper get im data signal.
2981 * This signal is used to get im data from Helper ISE.
2983 * The prototype of the slot is:
2984 * void get_imdata (const HelperAgent *, char **buf, size_t &len);
2987 HelperAgent::signal_connect_get_imdata (HelperAgentSlotGetRawVoid *slot)
2989 return m_impl->signal_get_imdata.connect (slot);
2993 * @brief Connect a slot to Helper get language locale signal.
2995 * This signal is used to get language locale from Helper ISE.
2997 * The prototype of the slot is:
2998 * void get_language_locale (const HelperAgent *, int ic, char **locale);
3001 HelperAgent::signal_connect_get_language_locale (HelperAgentSlotIntGetStringVoid *slot)
3003 return m_impl->signal_get_language_locale.connect (slot);
3007 * @brief Connect a slot to Helper set return key type signal.
3009 * This signal is used to send return key type to Helper ISE.
3011 * The prototype of the slot is:
3012 * void set_return_key_type (const HelperAgent *agent, uint32 &type);
3015 HelperAgent::signal_connect_set_return_key_type (HelperAgentSlotUintVoid *slot)
3017 return m_impl->signal_set_return_key_type.connect (slot);
3021 * @brief Connect a slot to Helper get return key type signal.
3023 * This signal is used to get return key type from Helper ISE.
3025 * The prototype of the slot is:
3026 * void get_return_key_type (const HelperAgent *agent, uint32 &type);
3029 HelperAgent::signal_connect_get_return_key_type (HelperAgentSlotUintVoid *slot)
3031 return m_impl->signal_get_return_key_type.connect (slot);
3035 * @brief Connect a slot to Helper set return key disable signal.
3037 * This signal is used to send return key disable to Helper ISE.
3039 * The prototype of the slot is:
3040 * void set_return_key_disable (const HelperAgent *agent, uint32 &disabled);
3043 HelperAgent::signal_connect_set_return_key_disable (HelperAgentSlotUintVoid *slot)
3045 return m_impl->signal_set_return_key_disable.connect (slot);
3049 * @brief Connect a slot to Helper process key event signal.
3051 * This signal is used to send keyboard key event to Helper ISE.
3053 * The prototype of the slot is:
3054 * void process_key_event (const HelperAgent *agent, KeyEvent &key, uint32 &ret, uint32 keycode);
3057 HelperAgent::signal_connect_process_key_event (HelperAgentSlotKeyEventUint *slot)
3059 return m_impl->signal_process_key_event.connect (slot);
3063 * @brief Connect a slot to Helper get return key disable signal.
3065 * This signal is used to get return key disable from Helper ISE.
3067 * The prototype of the slot is:
3068 * void get_return_key_disable (const HelperAgent *agent, uint32 &disabled);
3071 HelperAgent::signal_connect_get_return_key_disable (HelperAgentSlotUintVoid *slot)
3073 return m_impl->signal_get_return_key_disable.connect (slot);
3077 * @brief Connect a slot to Helper set layout signal.
3079 * This signal is used to set Helper ISE layout.
3081 * The prototype of the slot is:
3082 * void set_layout (const HelperAgent *agent, uint32 &layout);
3085 HelperAgent::signal_connect_set_layout (HelperAgentSlotUintVoid *slot)
3087 return m_impl->signal_set_layout.connect (slot);
3091 * @brief Connect a slot to Helper get layout signal.
3093 * This signal is used to get Helper ISE layout.
3095 * The prototype of the slot is:
3096 * void get_layout (const HelperAgent *agent, uint32 &layout);
3099 HelperAgent::signal_connect_get_layout (HelperAgentSlotUintVoid *slot)
3101 return m_impl->signal_get_layout.connect (slot);
3105 * @brief Connect a slot to Helper set input mode signal.
3107 * This signal is used to set Helper ISE input mode.
3109 * The prototype of the slot is:
3110 * void set_input_mode (const HelperAgent *agent, uint32 &input_mode);
3113 HelperAgent::signal_connect_set_input_mode (HelperAgentSlotUintVoid *slot)
3115 return m_impl->signal_set_input_mode.connect (slot);
3119 * @brief Connect a slot to Helper set input hint signal.
3121 * This signal is used to set Helper ISE input hint.
3123 * The prototype of the slot is:
3124 * void set_input_hint (const HelperAgent *agent, uint32 &input_hint);
3127 HelperAgent::signal_connect_set_input_hint (HelperAgentSlotUintVoid *slot)
3129 return m_impl->signal_set_input_hint.connect (slot);
3133 * @brief Connect a slot to Helper set BiDi direction signal.
3135 * This signal is used to set Helper ISE BiDi direction.
3137 * The prototype of the slot is:
3138 * void update_bidi_direction (const HelperAgent *agent, uint32 &bidi_direction);
3141 HelperAgent::signal_connect_update_bidi_direction (HelperAgentSlotUintVoid *slot)
3143 return m_impl->signal_update_bidi_direction.connect (slot);
3147 * @brief Connect a slot to Helper set shift mode signal.
3149 * This signal is used to set Helper shift mode.
3151 * The prototype of the slot is:
3152 * void set_caps_mode (const HelperAgent *agent, uint32 &mode);
3155 HelperAgent::signal_connect_set_caps_mode (HelperAgentSlotUintVoid *slot)
3157 return m_impl->signal_set_caps_mode.connect (slot);
3161 * @brief Connect a slot to Helper reset input context signal.
3163 * This signal is used to reset Helper ISE input context.
3165 * The prototype of the slot is:
3166 * void reset_input_context (const HelperAgent *agent, int ic, const String &uuid);
3169 HelperAgent::signal_connect_reset_input_context (HelperAgentSlotVoid *slot)
3171 return m_impl->signal_reset_input_context.connect (slot);
3175 * @brief Connect a slot to Helper update candidate window geometry signal.
3177 * This signal is used to get candidate window size and position.
3179 * The prototype of the slot is:
3180 * void update_candidate_geometry (const HelperAgent *agent, int ic, const String &uuid, const rectinfo &info);
3183 HelperAgent::signal_connect_update_candidate_geometry (HelperAgentSlotRect *slot)
3185 return m_impl->signal_update_candidate_geometry.connect (slot);
3189 * @brief Connect a slot to Helper update keyboard ISE signal.
3191 * This signal is used to get current keyboard ISE name and uuid.
3193 * The prototype of the slot is:
3194 * void update_keyboard_ise (const HelperAgent *agent, int ic, const String &uuid,
3195 * const String &ise_name, const String &ise_uuid);
3198 HelperAgent::signal_connect_update_keyboard_ise (HelperAgentSlotString2 *slot)
3200 return m_impl->signal_update_keyboard_ise.connect (slot);
3204 * @brief Connect a slot to Helper update keyboard ISE list signal.
3206 * This signal is used to get uuid list of all keyboard ISEs.
3208 * The prototype of the slot is:
3209 * void update_keyboard_ise_list (const HelperAgent *agent, int ic, const String &uuid,
3210 * const std::vector<String> &ise_list);
3213 HelperAgent::signal_connect_update_keyboard_ise_list (HelperAgentSlotStringVector *slot)
3215 return m_impl->signal_update_keyboard_ise_list.connect (slot);
3219 * @brief Connect a slot to Helper candidate more window show signal.
3221 * This signal is used to do someting when candidate more window is showed.
3223 * The prototype of the slot is:
3224 * void candidate_more_window_show (const HelperAgent *agent, int ic, const String &uuid);
3227 HelperAgent::signal_connect_candidate_more_window_show (HelperAgentSlotVoid *slot)
3229 return m_impl->signal_candidate_more_window_show.connect (slot);
3233 * @brief Connect a slot to Helper candidate more window hide signal.
3235 * This signal is used to do someting when candidate more window is hidden.
3237 * The prototype of the slot is:
3238 * void candidate_more_window_hide (const HelperAgent *agent, int ic, const String &uuid);
3241 HelperAgent::signal_connect_candidate_more_window_hide (HelperAgentSlotVoid *slot)
3243 return m_impl->signal_candidate_more_window_hide.connect (slot);
3247 * @brief Connect a slot to Helper candidate show signal.
3249 * This signal is used to do candidate show.
3251 * The prototype of the slot is:
3252 * void candidate_show (const HelperAgent *agent, int ic, const String &uuid);
3255 HelperAgent::signal_connect_candidate_show (HelperAgentSlotVoid *slot)
3257 return m_impl->signal_candidate_show.connect (slot);
3261 * @brief Connect a slot to Helper candidate hide signal.
3263 * This signal is used to do candidate hide.
3265 * The prototype of the slot is:
3266 * void candidate_hide (const HelperAgent *agent, int ic, const String &uuid);
3269 HelperAgent::signal_connect_candidate_hide (HelperAgentSlotVoid *slot)
3271 return m_impl->signal_candidate_hide.connect (slot);
3275 * @brief Connect a slot to Helper update lookup table signal.
3277 * This signal is used to do someting when update lookup table.
3279 * The prototype of the slot is:
3280 * void update_lookup_table (const HelperAgent *agent, int ic, const String &uuid ,LookupTable &table);
3283 HelperAgent::signal_connect_update_lookup_table (HelperAgentSlotLookupTable *slot)
3285 return m_impl->signal_update_lookup_table.connect (slot);
3289 * @brief Connect a slot to Helper select aux signal.
3291 * This signal is used to do something when aux is selected.
3293 * The prototype of the slot is:
3294 * void select_aux (const HelperAgent *agent, int ic, const String &uuid, int index);
3297 HelperAgent::signal_connect_select_aux (HelperAgentSlotInt *slot)
3299 return m_impl->signal_select_aux.connect (slot);
3303 * @brief Connect a slot to Helper select candidate signal.
3305 * This signal is used to do something when candidate is selected.
3307 * The prototype of the slot is:
3308 * void select_candidate (const HelperAgent *agent, int ic, const String &uuid, int index);
3311 HelperAgent::signal_connect_select_candidate (HelperAgentSlotInt *slot)
3313 return m_impl->signal_select_candidate.connect (slot);
3317 * @brief Connect a slot to Helper candidate table page up signal.
3319 * This signal is used to do something when candidate table is paged up.
3321 * The prototype of the slot is:
3322 * void candidate_table_page_up (const HelperAgent *agent, int ic, const String &uuid);
3325 HelperAgent::signal_connect_candidate_table_page_up (HelperAgentSlotVoid *slot)
3327 return m_impl->signal_candidate_table_page_up.connect (slot);
3331 * @brief Connect a slot to Helper candidate table page down signal.
3333 * This signal is used to do something when candidate table is paged down.
3335 * The prototype of the slot is:
3336 * void candidate_table_page_down (const HelperAgent *agent, int ic, const String &uuid);
3339 HelperAgent::signal_connect_candidate_table_page_down (HelperAgentSlotVoid *slot)
3341 return m_impl->signal_candidate_table_page_down.connect (slot);
3345 * @brief Connect a slot to Helper update candidate table page size signal.
3347 * This signal is used to do something when candidate table page size is changed.
3349 * The prototype of the slot is:
3350 * void update_candidate_table_page_size (const HelperAgent *, int ic, const String &uuid, int page_size);
3353 HelperAgent::signal_connect_update_candidate_table_page_size (HelperAgentSlotInt *slot)
3355 return m_impl->signal_update_candidate_table_page_size.connect (slot);
3359 * @brief Connect a slot to Helper update candidate item layout signal.
3361 * The prototype of the slot is:
3362 * void update_candidate_item_layout (const HelperAgent *, const std::vector<uint32> &row_items);
3365 HelperAgent::signal_connect_update_candidate_item_layout (HelperAgentSlotUintVector *slot)
3367 return m_impl->signal_update_candidate_item_layout.connect (slot);
3371 * @brief Connect a slot to Helper select associate signal.
3373 * This signal is used to do something when associate is selected.
3375 * The prototype of the slot is:
3376 * void select_associate (const HelperAgent *agent, int ic, const String &uuid, int index);
3379 HelperAgent::signal_connect_select_associate (HelperAgentSlotInt *slot)
3381 return m_impl->signal_select_associate.connect (slot);
3385 * @brief Connect a slot to Helper associate table page up signal.
3387 * This signal is used to do something when associate table is paged up.
3389 * The prototype of the slot is:
3390 * void associate_table_page_up (const HelperAgent *agent, int ic, const String &uuid);
3393 HelperAgent::signal_connect_associate_table_page_up (HelperAgentSlotVoid *slot)
3395 return m_impl->signal_associate_table_page_up.connect (slot);
3399 * @brief Connect a slot to Helper associate table page down signal.
3401 * This signal is used to do something when associate table is paged down.
3403 * The prototype of the slot is:
3404 * void associate_table_page_down (const HelperAgent *agent, int ic, const String &uuid);
3407 HelperAgent::signal_connect_associate_table_page_down (HelperAgentSlotVoid *slot)
3409 return m_impl->signal_associate_table_page_down.connect (slot);
3413 * @brief Connect a slot to Helper update associate table page size signal.
3415 * This signal is used to do something when associate table page size is changed.
3417 * The prototype of the slot is:
3418 * void update_associate_table_page_size (const HelperAgent *, int ic, const String &uuid, int page_size);
3421 HelperAgent::signal_connect_update_associate_table_page_size (HelperAgentSlotInt *slot)
3423 return m_impl->signal_update_associate_table_page_size.connect (slot);
3427 * @brief Connect a slot to Helper turn on log signal.
3429 * This signal is used to turn on Helper ISE debug information.
3431 * The prototype of the slot is:
3432 * void turn_on_log (const HelperAgent *agent, uint32 &on);
3435 HelperAgent::signal_connect_turn_on_log (HelperAgentSlotUintVoid *slot)
3437 return m_impl->signal_turn_on_log.connect (slot);
3441 * @brief Connect a slot to Helper update displayed candidate number signal.
3443 * This signal is used to inform helper ISE displayed candidate number.
3445 * The prototype of the slot is:
3446 * void update_displayed_candidate_number (const HelperAgent *, int ic, const String &uuid, int number);
3449 HelperAgent::signal_connect_update_displayed_candidate_number (HelperAgentSlotInt *slot)
3451 return m_impl->signal_update_displayed_candidate_number.connect (slot);
3455 * @brief Connect a slot to Helper longpress candidate signal.
3457 * This signal is used to do something when candidate is longpress.
3459 * The prototype of the slot is:
3460 * void longpress_candidate (const HelperAgent *agent, int ic, const String &uuid, int index);
3463 HelperAgent::signal_connect_longpress_candidate (HelperAgentSlotInt *slot)
3465 return m_impl->signal_longpress_candidate.connect (slot);
3469 * @brief Connect a slot to Helper show option window.
3471 * This signal is used to do request the ISE to show option window.
3473 * The prototype of the slot is:
3474 * void show_option_window (const HelperAgent *agent, int ic, const String &uuid);
3477 HelperAgent::signal_connect_show_option_window (HelperAgentSlotVoid *slot)
3479 return m_impl->signal_show_option_window.connect (slot);
3483 * @brief Connect a slot to Helper resume option window.
3485 * This signal is used to do request the ISE to resume option window.
3487 * The prototype of the slot is:
3488 * void resume_option_window (const HelperAgent *agent, int ic, const String &uuid);
3491 HelperAgent::signal_connect_resume_option_window (HelperAgentSlotVoid *slot)
3493 return m_impl->signal_resume_option_window.connect (slot);
3497 * @brief Connect a slot to Helper check if the option is available.
3499 * This signal is used to check if the option (setting) is available from Helper ISE.
3501 * The prototype of the slot is:
3502 * void check_option_window (const HelperAgent *agent, uint32 &avail);
3505 HelperAgent::signal_connect_check_option_window (HelperAgentSlotUintVoid *slot)
3507 return m_impl->signal_check_option_window.connect (slot);
3511 * @brief Connect a slot to Helper process unconventional input device event signal.
3513 * This signal is used to send unconventional input device event to Helper ISE.
3515 * The prototype of the slot is:
3516 * void process_input_device_event (const HelperAgent *, uint32 &type, char *data, size_t &size, uint32 &ret);
3519 HelperAgent::signal_connect_process_input_device_event (HelperAgentSlotUintCharSizeUint *slot)
3521 return m_impl->signal_process_input_device_event.connect (slot);
3525 * @brief Connect a slot to Helper set prediction hint signal.
3527 * This signal is used to send prediction hint to Helper ISE.
3529 * The prototype of the slot is:
3530 * void set_prediction_hint (const HelperAgent *agent, char *prediction_hint);
3533 HelperAgent::signal_connect_set_prediction_hint (HelperAgentSlotStringVoid *slot)
3535 return m_impl->signal_set_prediction_hint.connect (slot);
3539 * @brief Connect a slot to Helper set mime type signal.
3541 * This signal is used to send mime type to Helper ISE.
3543 * The prototype of the slot is:
3544 * void set_mime_type (const HelperAgent *agent, char *mime_type);
3547 HelperAgent::signal_connect_set_mime_type (HelperAgentSlotStringVoid *slot)
3549 return m_impl->signal_set_mime_type.connect (slot);
3553 * @brief Connect a slot to Helper set prediction hint data signal.
3555 * This signal is used to send prediction hint data to Helper ISE.
3557 * The prototype of the slot is:
3558 * void set_prediction_hint_data (const HelperAgent *agent, char *key, char *value);
3561 HelperAgent::signal_connect_set_prediction_hint_data (HelperAgentSlotString *slot)
3563 return m_impl->signal_set_prediction_hint_data.connect (slot);
3567 * @brief Connect a slot to Helper set optimization hint signal.
3569 * This signal is used to send optimization hint to Helper ISE.
3571 * The prototype of the slot is:
3572 * void set_optimization_hint (const HelperAgent *agent, uint32 &hint);
3575 HelperAgent::signal_connect_set_optimization_hint (HelperAgentSlotUintVoid *slot)
3577 return m_impl->signal_set_optimization_hint.connect (slot);
3580 } /* namespace scim */
3583 vi:ts=4:nowrap:ai:expandtab