Added to send fail_reply message in the panel_agent's socket communication.
[platform/core/uifw/isf.git] / ism / src / isf_panel_agent_base.cpp
1 /** @file isf_panel_agent_base.cpp
2  *  @brief Implementation of class PanelAgentBase.
3  */
4
5 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
6
7 /*
8  * Smart Common Input Method
9  *
10  * Copyright (c) 2005 James Su <suzhe@tsinghua.org.cn>
11  * Copyright (c) 2012-2016 Samsung Electronics Co., Ltd.
12  *
13  *
14  * This library is free software; you can redistribute it and/or
15  * modify it under the terms of the GNU Lesser General Public
16  * License as published by the Free Software Foundation; either
17  * version 2 of the License, or (at your option) any later version.
18  *
19  * This library is distributed in the hope that it will be useful,
20  * but WITHOUT ANY WARRANTY; without even the implied warranty of
21  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
22  * GNU Lesser General Public License for more details.
23  *
24  * You should have received a copy of the GNU Lesser General Public
25  * License along with this program; if not, write to the
26  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
27  * Boston, MA  02111-1307  USA
28  *
29  */
30
31 #define Uses_SCIM_TRANSACTION
32 #define Uses_SCIM_TRANS_COMMANDS
33 #define Uses_SCIM_PANEL_AGENT
34 #define Uses_SCIM_HELPER
35 #define Uses_SCIM_SOCKET
36 #define Uses_SCIM_EVENT
37 #define Uses_SCIM_CONFIG
38 #define Uses_SCIM_CONFIG_MODULE
39 #define Uses_SCIM_CONFIG_PATH
40 #define Uses_SCIM_UTILITY
41
42 #include <string.h>
43 #include <sys/types.h>
44 #include <sys/times.h>
45 #include <dlog.h>
46 #include <unistd.h>
47 #include "scim_private.h"
48 #include "scim.h"
49 #include "scim_stl_map.h"
50 #include "isf_debug.h"
51
52 #ifdef LOG_TAG
53 # undef LOG_TAG
54 #endif
55 #define LOG_TAG             "ISF_PANEL_AGENT_BASE"
56
57
58 namespace scim
59 {
60
61
62 PanelAgentBase::PanelAgentBase (const String& name)
63     :m_name (name)
64 {
65 }
66
67 PanelAgentBase::~PanelAgentBase ()
68 {
69 }
70
71 bool PanelAgentBase::initialize (InfoManager* info_manager, const String& display, bool resident)
72 {
73     LOGW ("not implemented for %s", m_name.c_str ());
74     return false;
75 }
76
77 bool PanelAgentBase::valid (void) const
78 {
79     LOGW ("not implemented for %s", m_name.c_str ());
80     return false;
81 }
82
83 void PanelAgentBase::stop (void)
84 {
85     LOGW ("not implemented for %s", m_name.c_str ());
86 }
87
88
89 void PanelAgentBase::update_panel_event (int client,  uint32 context, int cmd, uint32 nType, uint32 nValue)
90 {
91     LOGW ("not implemented for %s", m_name.c_str ());
92 }
93
94 void PanelAgentBase::reset_keyboard_ise (int client, uint32 context)
95 {
96     LOGW ("not implemented for %s", m_name.c_str ());
97 }
98
99 void PanelAgentBase::update_keyboard_ise_list (int client, uint32 context)
100 {
101     LOGW ("not implemented for %s", m_name.c_str ());
102 }
103
104 void PanelAgentBase::change_factory (int client, uint32 context, const String&  uuid)
105 {
106     LOGW ("not implemented for %s", m_name.c_str ());
107 }
108
109 void PanelAgentBase::helper_candidate_show (int client, uint32 context, const String&  uuid)
110 {
111     LOGW ("not implemented for %s", m_name.c_str ());
112 }
113
114 void PanelAgentBase::helper_candidate_hide (int client, uint32 context, const String&  uuid)
115 {
116     LOGW ("not implemented for %s", m_name.c_str ());
117 }
118
119 /* if the uuid is empty, it must send to panelclient otherwise HelperAgent
120  */
121 void PanelAgentBase::candidate_more_window_show (int client, uint32 context)
122 {
123     LOGW ("not implemented for %s", m_name.c_str ());
124 }
125 /* if the uuid is empty, it must send to panelclient otherwise HelperAgent
126  */
127 void PanelAgentBase::candidate_more_window_hide (int client, uint32 context)
128 {
129     LOGW ("not implemented for %s", m_name.c_str ());
130 }
131
132 void PanelAgentBase::update_helper_lookup_table (int client, uint32 context, const String&  uuid, const LookupTable& table)
133 {
134     LOGW ("not implemented for %s", m_name.c_str ());
135 }
136
137 //select_aux
138 //helper_select_aux
139 //SCIM_TRANS_CMD_SELECT_AUX
140 //this function called by two places, will send message to help(with uuid) or app
141 void PanelAgentBase::select_aux (int client, uint32 context, uint32 item)
142 {
143     LOGW ("not implemented for %s", m_name.c_str ());
144 }
145 //SCIM_TRANS_CMD_SELECT_CANDIDATE
146 //this function called by two places, will send message to help(with uuid) or app
147 void PanelAgentBase::select_candidate (int client, uint32 context, uint32 item)
148 {
149     LOGW ("not implemented for %s", m_name.c_str ());
150 }
151
152 void PanelAgentBase::lookup_table_page_up (int client, uint32 context)
153 {
154     LOGW ("not implemented for %s", m_name.c_str ());
155 }
156
157 void PanelAgentBase::lookup_table_page_down (int client, uint32 context)
158 {
159     LOGW ("not implemented for %s", m_name.c_str ());
160 }
161
162 void PanelAgentBase::update_lookup_table_page_size (int client, uint32 context, uint32 size)
163 {
164     LOGW ("not implemented for %s", m_name.c_str ());
165 }
166
167 void PanelAgentBase::update_candidate_item_layout (int client, uint32 context, const std::vector<uint32>& row_items)
168 {
169     LOGW ("not implemented for %s", m_name.c_str ());
170 }
171
172 void PanelAgentBase::select_associate (int client, uint32 context, uint32 item)
173 {
174     LOGW ("not implemented for %s", m_name.c_str ());
175 }
176
177 void PanelAgentBase::associate_table_page_up (int client, uint32 context)
178 {
179     LOGW ("not implemented for %s", m_name.c_str ());
180 }
181
182 void PanelAgentBase::associate_table_page_down (int client, uint32 context)
183 {
184     LOGW ("not implemented for %s", m_name.c_str ());
185 }
186
187 void PanelAgentBase::update_associate_table_page_size (int client, uint32 context, uint32 size)
188 {
189     LOGW ("not implemented for %s", m_name.c_str ());
190 }
191
192 void PanelAgentBase::update_displayed_candidate_number (int client, uint32 context, uint32 size)
193 {
194     LOGW ("not implemented for %s", m_name.c_str ());
195 }
196
197 void PanelAgentBase::send_longpress_event (int client, uint32 context, uint32 index)
198 {
199     LOGW ("not implemented for %s", m_name.c_str ());
200 }
201
202 void PanelAgentBase::trigger_property (int client, uint32 context, const String&  property)
203 {
204     LOGW ("not implemented for %s", m_name.c_str ());
205 }
206
207 void PanelAgentBase::socket_start_helper (int client, uint32 context, const String& ic_uuid)
208 {
209     LOGW ("not implemented for %s", m_name.c_str ());
210 }
211
212
213 void PanelAgentBase::exit (int client, uint32 context)
214 {
215     LOGW ("not implemented for %s", m_name.c_str ());
216 }
217
218 void PanelAgentBase::focus_out_helper (int client, uint32 context, const String& uuid)
219 {
220     LOGW ("not implemented for %s", m_name.c_str ());
221 }
222
223 void PanelAgentBase::focus_in_helper (int client, uint32 context, const String& uuid)
224 {
225     LOGW ("not implemented for %s", m_name.c_str ());
226 }
227
228 void PanelAgentBase::show_helper (int client, uint32 context, const String& uuid, char* data, size_t& len)
229 {
230     LOGW ("not implemented for %s", m_name.c_str ());
231 }
232
233 void PanelAgentBase::hide_helper (int client, uint32 context, const String& uuid)
234 {
235     LOGW ("not implemented for %s", m_name.c_str ());
236 }
237
238 void PanelAgentBase::set_helper_mode (int client, uint32 context, const String& uuid, uint32& mode)
239 {
240     LOGW ("not implemented for %s", m_name.c_str ());
241 }
242
243 void PanelAgentBase::set_helper_language (int client, uint32 context, const String& uuid, uint32& language)
244 {
245     LOGW ("not implemented for %s", m_name.c_str ());
246 }
247
248 void PanelAgentBase::set_helper_imdata (int client, uint32 context, const String& uuid, const char* imdata, size_t& len)
249 {
250     LOGW ("not implemented for %s", m_name.c_str ());
251 }
252
253 void PanelAgentBase::set_helper_return_key_type (int client, uint32 context, const String& uuid, uint32 type)
254 {
255     LOGW ("not implemented for %s", m_name.c_str ());
256 }
257
258 void PanelAgentBase::get_helper_return_key_type (int client, uint32 context, const String& uuid, _OUT_ uint32& type)
259 {
260     LOGW ("not implemented for %s", m_name.c_str ());
261 }
262
263 void PanelAgentBase::set_helper_return_key_disable (int client, uint32 context, const String& uuid, uint32 disabled)
264 {
265     LOGW ("not implemented for %s", m_name.c_str ());
266 }
267
268 void PanelAgentBase::get_helper_return_key_disable (int client, uint32 context, const String& uuid, _OUT_ uint32& disabled)
269 {
270     LOGW ("not implemented for %s", m_name.c_str ());
271 }
272
273 void PanelAgentBase::set_helper_layout (int client, uint32 context, const String& uuid, uint32& layout)
274 {
275     LOGW ("not implemented for %s", m_name.c_str ());
276 }
277
278 void PanelAgentBase::set_helper_input_mode (int client, uint32 context, const String& uuid, uint32& mode)
279 {
280     LOGW ("not implemented for %s", m_name.c_str ());
281 }
282
283 void PanelAgentBase::set_helper_input_hint (int client, uint32 context, const String& uuid, uint32& hint)
284 {
285     LOGW ("not implemented for %s", m_name.c_str ());
286 }
287
288 void PanelAgentBase::set_helper_bidi_direction (int client, uint32 context, const String& uuid, uint32& direction)
289 {
290     LOGW ("not implemented for %s", m_name.c_str ());
291 }
292
293 void PanelAgentBase::set_helper_caps_mode (int client, uint32 context, const String& uuid, uint32& mode)
294 {
295     LOGW ("not implemented for %s", m_name.c_str ());
296 }
297
298 void PanelAgentBase::show_helper_option_window (int client, uint32 context, const String& uuid)
299 {
300     LOGW ("not implemented for %s", m_name.c_str ());
301 }
302
303 void PanelAgentBase::resume_helper_option_window (int client, uint32 context, const String& uuid)
304 {
305     LOGW ("not implemented for %s", m_name.c_str ());
306 }
307
308 bool PanelAgentBase::process_key_event (int client, uint32 context, const String& uuid, KeyEvent& key, uint32 serial)
309 {
310     LOGW ("not implemented for %s", m_name.c_str ());
311     return false;
312 }
313
314 bool PanelAgentBase::get_helper_geometry (int client, uint32 context, String& uuid, _OUT_ struct rectinfo& info)
315 {
316     LOGW ("not implemented for %s", m_name.c_str ());
317     return false;
318 }
319
320 void PanelAgentBase::get_helper_imdata (int client, uint32 context, String& uuid, _OUT_ char** imdata, _OUT_ size_t& len)
321 {
322     LOGW ("not implemented for %s", m_name.c_str ());
323 }
324
325 void PanelAgentBase::get_helper_layout (int client, uint32 context, String& uuid, uint32& layout)
326 {
327     LOGW ("not implemented for %s", m_name.c_str ());
328 }
329
330
331 void PanelAgentBase::get_ise_language_locale (int client, uint32 context, String& uuid, _OUT_ char** data, _OUT_ size_t& len)
332 {
333     LOGW ("not implemented for %s", m_name.c_str ());
334 }
335
336 void PanelAgentBase::check_option_window (int client, uint32 context, String& uuid, _OUT_ uint32& avail)
337 {
338     LOGW ("not implemented for %s", m_name.c_str ());
339 }
340
341 void PanelAgentBase::reset_ise_option (int client, uint32 context)
342 {
343     LOGW ("not implemented for %s", m_name.c_str ());
344 }
345
346 void PanelAgentBase::reset_helper_context (int client, uint32 context, const String& uuid)
347 {
348     LOGW ("not implemented for %s", m_name.c_str ());
349 }
350
351 void PanelAgentBase::reload_config (int client)
352 {
353     LOGW ("not implemented for %s", m_name.c_str ());
354 }
355
356 void PanelAgentBase::socket_update_surrounding_text (int client, uint32 context, const String& uuid, String& text, uint32 cursor)
357 {
358     LOGW ("not implemented for %s", m_name.c_str ());
359 }
360
361 void PanelAgentBase::socket_remoteinput_focus_in (int client)
362 {
363     LOGW ("not implemented for %s", m_name.c_str ());
364 }
365
366 void PanelAgentBase::socket_remoteinput_focus_out (int client)
367 {
368     LOGW ("not implemented for %s", m_name.c_str ());
369 }
370
371 void PanelAgentBase::socket_remoteinput_entry_metadata (int client, uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled)
372 {
373     LOGW ("not implemented for %s", m_name.c_str ());
374 }
375
376 void PanelAgentBase::socket_remoteinput_surrounding_text (int client, String& text, uint32 cursor)
377 {
378     LOGW ("not implemented for %s", m_name.c_str ());
379 }
380
381 void PanelAgentBase::socket_remoteinput_input_resource (int client, uint32 input_resource)
382 {
383     LOGW ("not implemented for %s", m_name.c_str ());
384 }
385
386 void PanelAgentBase::socket_update_selection (int client, uint32 context, String& uuid, String text)
387 {
388     LOGW ("not implemented for %s", m_name.c_str ());
389 }
390
391 void PanelAgentBase::socket_get_keyboard_ise_list (int client, uint32 context, const String& uuid, std::vector<String>& list)
392 {
393     LOGW ("not implemented for %s", m_name.c_str ());
394 }
395
396 void PanelAgentBase::socket_get_candidate_ui (int client, uint32 context, const String& uuid,  int style,  int mode)
397 {
398     LOGW ("not implemented for %s", m_name.c_str ());
399 }
400
401 void PanelAgentBase::socket_get_candidate_geometry (int client, uint32 context, const String& uuid, struct rectinfo& info)
402 {
403     LOGW ("not implemented for %s", m_name.c_str ());
404 }
405 void PanelAgentBase::socket_get_keyboard_ise (int client, uint32 context, const String& uuid, String& ise_name, String& ise_uuid)
406 {
407     LOGW ("not implemented for %s", m_name.c_str ());
408 }
409
410 void PanelAgentBase::helper_detach_input_context (int client, uint32 context, const String& ic_uuid)
411 {
412     LOGW ("not implemented for %s", m_name.c_str ());
413 }
414
415 void PanelAgentBase::helper_process_imengine_event (int client, uint32 context, const String& ic_uuid, const Transaction& nest_transaction)
416 {
417     LOGW ("not implemented for %s", m_name.c_str ());
418 }
419
420 void PanelAgentBase::process_helper_event (int client, uint32 context, String target_uuid, String active_uuid, Transaction& nest_trans)
421 {
422     LOGW ("not implemented for %s", m_name.c_str ());
423 }
424
425 void PanelAgentBase::socket_helper_key_event (int client, uint32 context, int cmd , KeyEvent& key)
426 {
427     LOGW ("not implemented for %s", m_name.c_str ());
428 }
429
430 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
431 //socket_helper_get_surrounding_text
432 void PanelAgentBase::socket_helper_get_surrounding_text (int client, uint32 context, uint32 maxlen_before, uint32 maxlen_after)
433 {
434     LOGW ("not implemented for %s", m_name.c_str ());
435 }
436 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
437 //socket_helper_delete_surrounding_text
438 void PanelAgentBase::socket_helper_delete_surrounding_text (int client, uint32 context, uint32 offset, uint32 len)
439 {
440     LOGD ("not implemented ");
441 }
442 //SCIM_TRANS_CMD_GET_SELECTION
443 void PanelAgentBase::socket_helper_get_selection (int client, uint32 context)
444 {
445     LOGW ("not implemented for %s", m_name.c_str ());
446 }
447 //SCIM_TRANS_CMD_SET_SELECTION
448 void PanelAgentBase::socket_helper_set_selection (int client, uint32 context, uint32 start, uint32 end)
449 {
450     LOGW ("not implemented for %s", m_name.c_str ());
451 }
452
453 //socket_helper_update_input_context
454 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
455 void PanelAgentBase::update_ise_input_context (int client, uint32 context, uint32 type, uint32 value)
456 {
457     LOGW ("not implemented for %s", m_name.c_str ());
458 }
459
460 //socket_helper_send_private_command
461 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
462 void PanelAgentBase::send_private_command (int client, uint32 context, const String& command)
463 {
464     LOGW ("not implemented for %s", m_name.c_str ());
465 }
466
467 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
468 void PanelAgentBase::helper_all_update_spot_location (int client, uint32 context, String uuid, int x, int y)
469 {
470     LOGW ("not implemented for %s", m_name.c_str ());
471 }
472 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
473 void PanelAgentBase::helper_all_update_cursor_position (int client, uint32 context, String uuid, int cursor_pos)
474 {
475     LOGW ("not implemented for %s", m_name.c_str ());
476 }
477 //SCIM_TRANS_CMD_UPDATE_SCREEN
478 void PanelAgentBase::helper_all_update_screen (int client, uint32 context, String uuid, int screen)
479 {
480     LOGW ("not implemented for %s", m_name.c_str ());
481 }
482
483 //socket_helper_commit_string
484 //SCIM_TRANS_CMD_COMMIT_STRING
485 void PanelAgentBase::commit_string (int client, uint32 context,const WideString& wstr)
486 {
487     LOGW ("not implemented for %s", m_name.c_str ());
488 }
489 //socket_helper_show_preedit_string
490 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
491 void PanelAgentBase::show_preedit_string (int client, uint32 context)
492 {
493     LOGW ("not implemented for %s", m_name.c_str ());
494 }
495 //socket_helper_hide_preedit_string
496 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
497 void PanelAgentBase::hide_preedit_string (int client, uint32 context)
498 {
499     LOGW ("not implemented for %s", m_name.c_str ());
500 }
501 //socket_helper_update_preedit_string
502 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
503 void PanelAgentBase::update_preedit_string (int client, uint32 context, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret)
504 {
505     LOGW ("not implemented for %s", m_name.c_str ());
506 }
507 //socket_helper_update_preedit_caret
508 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
509 void PanelAgentBase::update_preedit_caret (int client, uint32 context, uint32 caret)
510 {
511     LOGW ("not implemented for %s", m_name.c_str ());
512 }
513 //socket_helper_register_helper
514 //SCIM_TRANS_CMD_HELPER_ATTACH_INPUT_CONTEXT
515 //SCIM_TRANS_CMD_UPDATE_SCREEN
516 void PanelAgentBase::helper_attach_input_context_and_update_screen (int client, std::vector < std::pair <uint32, String> >& helper_ic_index,
517         uint32 current_screen)
518 {
519     LOGW ("not implemented for %s", m_name.c_str ());
520 }
521
522 void PanelAgentBase::hide_helper_ise (int client, uint32 context)
523 {
524     LOGW ("not implemented for %s", m_name.c_str ());
525 }
526
527 bool PanelAgentBase::process_input_device_event(int client, uint32 context, const String& uuid, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
528 {
529     LOGW("not implemented for %s", m_name.c_str());
530     return false;
531 }
532
533 void PanelAgentBase::process_key_event_done(int client, uint32 context, KeyEvent &key, uint32 ret, uint32 serial)
534 {
535     LOGW("not implemented for %s", m_name.c_str());
536 }
537
538 void PanelAgentBase::request_ise_hide(int client, uint32 context)
539 {
540     LOGW("not implemented for %s", m_name.c_str());
541 }
542
543 void PanelAgentBase::set_autocapital_type(int client, uint32 context, String uuid, int mode)
544 {
545     LOGW("not implemented for %s", m_name.c_str());
546 }
547
548 void PanelAgentBase::remote_update_preedit_string (int client, uint32 context, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret)
549 {
550     LOGW ("not implemented for %s", m_name.c_str ());
551 }
552
553 void PanelAgentBase::remote_send_key_event (int client, uint32 context, const KeyEvent &key)
554 {
555     LOGW ("not implemented for %s", m_name.c_str ());
556 }
557
558 void PanelAgentBase::remote_forward_key_event (int client, uint32 context, const KeyEvent &key)
559 {
560     LOGW ("not implemented for %s", m_name.c_str ());
561 }
562
563 void PanelAgentBase::remote_commit_string (int client, uint32 context,const WideString& wstr)
564 {
565     LOGW ("not implemented for %s", m_name.c_str ());
566 }
567
568 void PanelAgentBase::remote_delete_surrounding_text (int client, uint32 context, uint32 offset, uint32 len)
569 {
570     LOGD ("not implemented ");
571 }
572
573 void PanelAgentBase::set_prediction_allow (int client, uint32 context, String uuid, int mode)
574 {
575     LOGW ("not implemented for %s", m_name.c_str ());
576 }
577
578 void PanelAgentBase::send_fail_reply (int client)
579 {
580     LOGW ("not implemented for %s", m_name.c_str ());
581 }
582 } /* namespace scim */
583
584 /*
585 vi:ts=4:nowrap:ai:expandtab
586 */