Add process_key_event_done function
[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 bool PanelAgentBase::process_key_event (int client, uint32 context, const String& uuid, KeyEvent& key, uint32 serial)
304 {
305     LOGW ("not implemented for %s", m_name.c_str ());
306     return false;
307 }
308
309 bool PanelAgentBase::get_helper_geometry (int client, uint32 context, String& uuid, _OUT_ struct rectinfo& info)
310 {
311     LOGW ("not implemented for %s", m_name.c_str ());
312     return false;
313 }
314
315 void PanelAgentBase::get_helper_imdata (int client, uint32 context, String& uuid, _OUT_ char** imdata, _OUT_ size_t& len)
316 {
317     LOGW ("not implemented for %s", m_name.c_str ());
318 }
319
320 void PanelAgentBase::get_helper_layout (int client, uint32 context, String& uuid, uint32& layout)
321 {
322     LOGW ("not implemented for %s", m_name.c_str ());
323 }
324
325
326 void PanelAgentBase::get_ise_language_locale (int client, uint32 context, String& uuid, _OUT_ char** data, _OUT_ size_t& len)
327 {
328     LOGW ("not implemented for %s", m_name.c_str ());
329 }
330
331 void PanelAgentBase::check_option_window (int client, uint32 context, String& uuid, _OUT_ uint32& avail)
332 {
333     LOGW ("not implemented for %s", m_name.c_str ());
334 }
335
336 void PanelAgentBase::reset_ise_option (int client, uint32 context)
337 {
338     LOGW ("not implemented for %s", m_name.c_str ());
339 }
340
341 void PanelAgentBase::reset_helper_context (int client, uint32 context, const String& uuid)
342 {
343     LOGW ("not implemented for %s", m_name.c_str ());
344 }
345
346 void PanelAgentBase::reload_config (int client)
347 {
348     LOGW ("not implemented for %s", m_name.c_str ());
349 }
350
351 void PanelAgentBase::socket_update_surrounding_text (int client, uint32 context, const String& uuid, String& text, uint32 cursor)
352 {
353     LOGW ("not implemented for %s", m_name.c_str ());
354 }
355
356 void PanelAgentBase::socket_update_selection (int client, uint32 context, String& uuid, String text)
357 {
358     LOGW ("not implemented for %s", m_name.c_str ());
359 }
360
361 void PanelAgentBase::socket_get_keyboard_ise_list (int client, uint32 context, const String& uuid, std::vector<String>& list)
362 {
363     LOGW ("not implemented for %s", m_name.c_str ());
364 }
365
366 void PanelAgentBase::socket_get_candidate_ui (int client, uint32 context, const String& uuid,  int style,  int mode)
367 {
368     LOGW ("not implemented for %s", m_name.c_str ());
369 }
370
371 void PanelAgentBase::socket_get_candidate_geometry (int client, uint32 context, const String& uuid, struct rectinfo& info)
372 {
373     LOGW ("not implemented for %s", m_name.c_str ());
374 }
375 void PanelAgentBase::socket_get_keyboard_ise (int client, uint32 context, const String& uuid, String& ise_name, String& ise_uuid)
376 {
377     LOGW ("not implemented for %s", m_name.c_str ());
378 }
379
380 void PanelAgentBase::helper_detach_input_context (int client, uint32 context, const String& ic_uuid)
381 {
382     LOGW ("not implemented for %s", m_name.c_str ());
383 }
384
385 void PanelAgentBase::helper_process_imengine_event (int client, uint32 context, const String& ic_uuid, const Transaction& nest_transaction)
386 {
387     LOGW ("not implemented for %s", m_name.c_str ());
388 }
389
390 void PanelAgentBase::process_helper_event (int client, uint32 context, String target_uuid, String active_uuid, Transaction& nest_trans)
391 {
392     LOGW ("not implemented for %s", m_name.c_str ());
393 }
394
395 void PanelAgentBase::socket_helper_key_event (int client, uint32 context, int cmd , KeyEvent& key)
396 {
397     LOGW ("not implemented for %s", m_name.c_str ());
398 }
399
400 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
401 //socket_helper_get_surrounding_text
402 void PanelAgentBase::socket_helper_get_surrounding_text (int client, uint32 context, uint32 maxlen_before, uint32 maxlen_after, const int fd)
403 {
404     LOGW ("not implemented for %s", m_name.c_str ());
405 }
406 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
407 //socket_helper_delete_surrounding_text
408 void PanelAgentBase::socket_helper_delete_surrounding_text (int client, uint32 context, uint32 offset, uint32 len)
409 {
410     LOGD ("not implemented ");
411 }
412 //SCIM_TRANS_CMD_GET_SELECTION
413 void PanelAgentBase::socket_helper_get_selection (int client, uint32 context, const int fd)
414 {
415     LOGW ("not implemented for %s", m_name.c_str ());
416 }
417 //SCIM_TRANS_CMD_SET_SELECTION
418 void PanelAgentBase::socket_helper_set_selection (int client, uint32 context, uint32 start, uint32 end)
419 {
420     LOGW ("not implemented for %s", m_name.c_str ());
421 }
422
423 //socket_helper_update_input_context
424 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
425 void PanelAgentBase::update_ise_input_context (int client, uint32 context, uint32 type, uint32 value)
426 {
427     LOGW ("not implemented for %s", m_name.c_str ());
428 }
429
430 //socket_helper_send_private_command
431 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
432 void PanelAgentBase::send_private_command (int client, uint32 context, const String& command)
433 {
434     LOGW ("not implemented for %s", m_name.c_str ());
435 }
436
437 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
438 void PanelAgentBase::helper_all_update_spot_location (int client, uint32 context, String uuid, int x, int y)
439 {
440     LOGW ("not implemented for %s", m_name.c_str ());
441 }
442 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
443 void PanelAgentBase::helper_all_update_cursor_position (int client, uint32 context, String uuid, int cursor_pos)
444 {
445     LOGW ("not implemented for %s", m_name.c_str ());
446 }
447 //SCIM_TRANS_CMD_UPDATE_SCREEN
448 void PanelAgentBase::helper_all_update_screen (int client, uint32 context, String uuid, int screen)
449 {
450     LOGW ("not implemented for %s", m_name.c_str ());
451 }
452
453 //socket_helper_commit_string
454 //SCIM_TRANS_CMD_COMMIT_STRING
455 void PanelAgentBase::commit_string (int client, uint32 context,const WideString& wstr)
456 {
457     LOGW ("not implemented for %s", m_name.c_str ());
458 }
459 //socket_helper_show_preedit_string
460 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
461 void PanelAgentBase::show_preedit_string (int client, uint32 context)
462 {
463     LOGW ("not implemented for %s", m_name.c_str ());
464 }
465 //socket_helper_hide_preedit_string
466 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
467 void PanelAgentBase::hide_preedit_string (int client, uint32 context)
468 {
469     LOGW ("not implemented for %s", m_name.c_str ());
470 }
471 //socket_helper_update_preedit_string
472 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
473 void PanelAgentBase::update_preedit_string (int client, uint32 context, WideString wstr, AttributeList& attrs, uint32 caret)
474 {
475     LOGW ("not implemented for %s", m_name.c_str ());
476 }
477 //socket_helper_update_preedit_caret
478 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
479 void PanelAgentBase::update_preedit_caret (int client, uint32 context, uint32 caret)
480 {
481     LOGW ("not implemented for %s", m_name.c_str ());
482 }
483 //socket_helper_register_helper
484 //SCIM_TRANS_CMD_HELPER_ATTACH_INPUT_CONTEXT
485 //SCIM_TRANS_CMD_UPDATE_SCREEN
486 void PanelAgentBase::helper_attach_input_context_and_update_screen (int client, std::vector < std::pair <uint32, String> >& helper_ic_index,
487         uint32 current_screen)
488 {
489     LOGW ("not implemented for %s", m_name.c_str ());
490 }
491
492 void PanelAgentBase::hide_helper_ise (int client, uint32 context)
493 {
494     LOGW ("not implemented for %s", m_name.c_str ());
495 }
496
497 bool PanelAgentBase::process_input_device_event(int client, uint32 context, const String& uuid, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
498 {
499     LOGW("not implemented for %s", m_name.c_str());
500     return false;
501 }
502
503 void PanelAgentBase::process_key_event_done(int client, uint32 context, KeyEvent &key, uint32 ret, uint32 serial)
504 {
505     LOGW("not implemented for %s", m_name.c_str());
506 }
507
508
509 } /* namespace scim */
510
511 /*
512 vi:ts=4:nowrap:ai:expandtab
513 */