Get surrounding and selection text by fd
[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
51 #ifdef LOG_TAG
52 # undef LOG_TAG
53 #endif
54 #define LOG_TAG             "ISF_PANEL_AGENT_BASE"
55
56
57 namespace scim
58 {
59
60
61 PanelAgentBase::PanelAgentBase (const String& name)
62     :m_name (name)
63 {
64 }
65
66 PanelAgentBase::~PanelAgentBase ()
67 {
68 }
69
70 bool PanelAgentBase::initialize (InfoManager* info_manager, const String& display, bool resident)
71 {
72     LOGW ("not implemented for %s", m_name.c_str ());
73     return false;
74 }
75
76 bool PanelAgentBase::valid (void) const
77 {
78     LOGW ("not implemented for %s", m_name.c_str ());
79     return false;
80 }
81
82 void PanelAgentBase::stop (void)
83 {
84     LOGW ("not implemented for %s", m_name.c_str ());
85 }
86
87
88 void PanelAgentBase::update_panel_event (int client,  uint32 context, int cmd, uint32 nType, uint32 nValue)
89 {
90     LOGW ("not implemented for %s", m_name.c_str ());
91 }
92
93 void PanelAgentBase::reset_keyboard_ise (int client, uint32 context)
94 {
95     LOGW ("not implemented for %s", m_name.c_str ());
96 }
97
98 void PanelAgentBase::update_keyboard_ise_list (int client, uint32 context)
99 {
100     LOGW ("not implemented for %s", m_name.c_str ());
101 }
102
103 void PanelAgentBase::change_factory (int client, uint32 context, const String&  uuid)
104 {
105     LOGW ("not implemented for %s", m_name.c_str ());
106 }
107
108 void PanelAgentBase::helper_candidate_show (int client, uint32 context, const String&  uuid)
109 {
110     LOGW ("not implemented for %s", m_name.c_str ());
111 }
112
113 void PanelAgentBase::helper_candidate_hide (int client, uint32 context, const String&  uuid)
114 {
115     LOGW ("not implemented for %s", m_name.c_str ());
116 }
117
118 /* if the uuid is empty, it must send to panelclient otherwise HelperAgent
119  */
120 void PanelAgentBase::candidate_more_window_show (int client, uint32 context)
121 {
122     LOGW ("not implemented for %s", m_name.c_str ());
123 }
124 /* if the uuid is empty, it must send to panelclient otherwise HelperAgent
125  */
126 void PanelAgentBase::candidate_more_window_hide (int client, uint32 context)
127 {
128     LOGW ("not implemented for %s", m_name.c_str ());
129 }
130
131 void PanelAgentBase::update_helper_lookup_table (int client, uint32 context, const String&  uuid, const LookupTable& table)
132 {
133     LOGW ("not implemented for %s", m_name.c_str ());
134 }
135
136 //select_aux
137 //helper_select_aux
138 //SCIM_TRANS_CMD_SELECT_AUX
139 //this function called by two places, will send message to help(with uuid) or app
140 void PanelAgentBase::select_aux (int client, uint32 context, uint32 item)
141 {
142     LOGW ("not implemented for %s", m_name.c_str ());
143 }
144 //SCIM_TRANS_CMD_SELECT_CANDIDATE
145 //this function called by two places, will send message to help(with uuid) or app
146 void PanelAgentBase::select_candidate (int client, uint32 context, uint32 item)
147 {
148     LOGW ("not implemented for %s", m_name.c_str ());
149 }
150
151 void PanelAgentBase::lookup_table_page_up (int client, uint32 context)
152 {
153     LOGW ("not implemented for %s", m_name.c_str ());
154 }
155
156 void PanelAgentBase::lookup_table_page_down (int client, uint32 context)
157 {
158     LOGW ("not implemented for %s", m_name.c_str ());
159 }
160
161 void PanelAgentBase::update_lookup_table_page_size (int client, uint32 context, uint32 size)
162 {
163     LOGW ("not implemented for %s", m_name.c_str ());
164 }
165
166 void PanelAgentBase::update_candidate_item_layout (int client, uint32 context, const std::vector<uint32>& row_items)
167 {
168     LOGW ("not implemented for %s", m_name.c_str ());
169 }
170
171 void PanelAgentBase::select_associate (int client, uint32 context, uint32 item)
172 {
173     LOGW ("not implemented for %s", m_name.c_str ());
174 }
175
176 void PanelAgentBase::associate_table_page_up (int client, uint32 context)
177 {
178     LOGW ("not implemented for %s", m_name.c_str ());
179 }
180
181 void PanelAgentBase::associate_table_page_down (int client, uint32 context)
182 {
183     LOGW ("not implemented for %s", m_name.c_str ());
184 }
185
186 void PanelAgentBase::update_associate_table_page_size (int client, uint32 context, uint32 size)
187 {
188     LOGW ("not implemented for %s", m_name.c_str ());
189 }
190
191 void PanelAgentBase::update_displayed_candidate_number (int client, uint32 context, uint32 size)
192 {
193     LOGW ("not implemented for %s", m_name.c_str ());
194 }
195
196 void PanelAgentBase::send_longpress_event (int client, uint32 context, uint32 index)
197 {
198     LOGW ("not implemented for %s", m_name.c_str ());
199 }
200
201 void PanelAgentBase::trigger_property (int client, uint32 context, const String&  property)
202 {
203     LOGW ("not implemented for %s", m_name.c_str ());
204 }
205
206 void PanelAgentBase::socket_start_helper (int client, uint32 context, const String& ic_uuid)
207 {
208     LOGW ("not implemented for %s", m_name.c_str ());
209 }
210
211
212 void PanelAgentBase::exit (int client, uint32 context)
213 {
214     LOGW ("not implemented for %s", m_name.c_str ());
215 }
216
217 void PanelAgentBase::focus_out_helper (int client, uint32 context, const String& uuid)
218 {
219     LOGW ("not implemented for %s", m_name.c_str ());
220 }
221
222 void PanelAgentBase::focus_in_helper (int client, uint32 context, const String& uuid)
223 {
224     LOGW ("not implemented for %s", m_name.c_str ());
225 }
226
227 void PanelAgentBase::show_helper (int client, uint32 context, const String& uuid, char* data, size_t& len)
228 {
229     LOGW ("not implemented for %s", m_name.c_str ());
230 }
231
232 void PanelAgentBase::hide_helper (int client, uint32 context, const String& uuid)
233 {
234     LOGW ("not implemented for %s", m_name.c_str ());
235 }
236
237 void PanelAgentBase::set_helper_mode (int client, uint32 context, const String& uuid, uint32& mode)
238 {
239     LOGW ("not implemented for %s", m_name.c_str ());
240 }
241
242 void PanelAgentBase::set_helper_language (int client, uint32 context, const String& uuid, uint32& language)
243 {
244     LOGW ("not implemented for %s", m_name.c_str ());
245 }
246
247 void PanelAgentBase::set_helper_imdata (int client, uint32 context, const String& uuid, const char* imdata, size_t& len)
248 {
249     LOGW ("not implemented for %s", m_name.c_str ());
250 }
251
252 void PanelAgentBase::set_helper_return_key_type (int client, uint32 context, const String& uuid, uint32 type)
253 {
254     LOGW ("not implemented for %s", m_name.c_str ());
255 }
256
257 void PanelAgentBase::get_helper_return_key_type (int client, uint32 context, const String& uuid, _OUT_ uint32& type)
258 {
259     LOGW ("not implemented for %s", m_name.c_str ());
260 }
261
262 void PanelAgentBase::set_helper_return_key_disable (int client, uint32 context, const String& uuid, uint32 disabled)
263 {
264     LOGW ("not implemented for %s", m_name.c_str ());
265 }
266
267 void PanelAgentBase::get_helper_return_key_disable (int client, uint32 context, const String& uuid, _OUT_ uint32& disabled)
268 {
269     LOGW ("not implemented for %s", m_name.c_str ());
270 }
271
272 void PanelAgentBase::set_helper_layout (int client, uint32 context, const String& uuid, uint32& layout)
273 {
274     LOGW ("not implemented for %s", m_name.c_str ());
275 }
276
277 void PanelAgentBase::set_helper_input_mode (int client, uint32 context, const String& uuid, uint32& mode)
278 {
279     LOGW ("not implemented for %s", m_name.c_str ());
280 }
281
282 void PanelAgentBase::set_helper_input_hint (int client, uint32 context, const String& uuid, uint32& hint)
283 {
284     LOGW ("not implemented for %s", m_name.c_str ());
285 }
286
287 void PanelAgentBase::set_helper_bidi_direction (int client, uint32 context, const String& uuid, uint32& direction)
288 {
289     LOGW ("not implemented for %s", m_name.c_str ());
290 }
291
292 void PanelAgentBase::set_helper_caps_mode (int client, uint32 context, const String& uuid, uint32& mode)
293 {
294     LOGW ("not implemented for %s", m_name.c_str ());
295 }
296
297 void PanelAgentBase::show_helper_option_window (int client, uint32 context, const String& uuid)
298 {
299     LOGW ("not implemented for %s", m_name.c_str ());
300 }
301
302 bool PanelAgentBase::process_key_event (int client, uint32 context, const String& uuid, KeyEvent& key, _OUT_ uint32& result)
303 {
304     LOGW ("not implemented for %s", m_name.c_str ());
305     return false;
306 }
307
308 bool PanelAgentBase::get_helper_geometry (int client, uint32 context, String& uuid, _OUT_ struct rectinfo& info)
309 {
310     LOGW ("not implemented for %s", m_name.c_str ());
311     return false;
312 }
313
314 void PanelAgentBase::get_helper_imdata (int client, uint32 context, String& uuid, _OUT_ char** imdata, _OUT_ size_t& len)
315 {
316     LOGW ("not implemented for %s", m_name.c_str ());
317 }
318
319 void PanelAgentBase::get_helper_layout (int client, uint32 context, String& uuid, uint32& layout)
320 {
321     LOGW ("not implemented for %s", m_name.c_str ());
322 }
323
324
325 void PanelAgentBase::get_ise_language_locale (int client, uint32 context, String& uuid, _OUT_ char* data, _OUT_ size_t& len)
326 {
327     LOGW ("not implemented for %s", m_name.c_str ());
328 }
329
330 void PanelAgentBase::check_option_window (int client, uint32 context, String& uuid, _OUT_ uint32& avail)
331 {
332     LOGW ("not implemented for %s", m_name.c_str ());
333 }
334
335 void PanelAgentBase::reset_ise_option (int client, uint32 context)
336 {
337     LOGW ("not implemented for %s", m_name.c_str ());
338 }
339
340 void PanelAgentBase::reset_helper_context (int client, uint32 context, const String& uuid)
341 {
342     LOGW ("not implemented for %s", m_name.c_str ());
343 }
344
345 void PanelAgentBase::reload_config (int client)
346 {
347     LOGW ("not implemented for %s", m_name.c_str ());
348 }
349
350 void PanelAgentBase::socket_update_surrounding_text (int client, uint32 context, const String& uuid, String& text, uint32 cursor)
351 {
352     LOGW ("not implemented for %s", m_name.c_str ());
353 }
354
355 void PanelAgentBase::socket_update_selection (int client, uint32 context, String& uuid, String text)
356 {
357     LOGW ("not implemented for %s", m_name.c_str ());
358 }
359
360 void PanelAgentBase::socket_get_keyboard_ise_list (int client, uint32 context, const String& uuid, std::vector<String>& list)
361 {
362     LOGW ("not implemented for %s", m_name.c_str ());
363 }
364
365 void PanelAgentBase::socket_get_candidate_ui (int client, uint32 context, const String& uuid,  int style,  int mode)
366 {
367     LOGW ("not implemented for %s", m_name.c_str ());
368 }
369
370 void PanelAgentBase::socket_get_candidate_geometry (int client, uint32 context, const String& uuid, struct rectinfo& info)
371 {
372     LOGW ("not implemented for %s", m_name.c_str ());
373 }
374 void PanelAgentBase::socket_get_keyboard_ise (int client, uint32 context, const String& uuid, String& ise_name, String& ise_uuid)
375 {
376     LOGW ("not implemented for %s", m_name.c_str ());
377 }
378
379 void PanelAgentBase::helper_detach_input_context (int client, uint32 context, const String& ic_uuid)
380 {
381     LOGW ("not implemented for %s", m_name.c_str ());
382 }
383
384 void PanelAgentBase::helper_process_imengine_event (int client, uint32 context, const String& ic_uuid, const Transaction& nest_transaction)
385 {
386     LOGW ("not implemented for %s", m_name.c_str ());
387 }
388
389 void PanelAgentBase::process_helper_event (int client, uint32 context, String target_uuid, String active_uuid, Transaction& nest_trans)
390 {
391     LOGW ("not implemented for %s", m_name.c_str ());
392 }
393
394 void PanelAgentBase::socket_helper_key_event (int client, uint32 context, int cmd , KeyEvent& key)
395 {
396     LOGW ("not implemented for %s", m_name.c_str ());
397 }
398
399 //SCIM_TRANS_CMD_GET_SURROUNDING_TEXT
400 //socket_helper_get_surrounding_text
401 void PanelAgentBase::socket_helper_get_surrounding_text (int client, uint32 context, uint32 maxlen_before, uint32 maxlen_after, const int fd)
402 {
403     LOGW ("not implemented for %s", m_name.c_str ());
404 }
405 //SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT
406 //socket_helper_delete_surrounding_text
407 void PanelAgentBase::socket_helper_delete_surrounding_text (int client, uint32 context, uint32 offset, uint32 len)
408 {
409     LOGD ("not implemented ");
410 }
411 //SCIM_TRANS_CMD_GET_SELECTION
412 void PanelAgentBase::socket_helper_get_selection (int client, uint32 context, const int fd)
413 {
414     LOGW ("not implemented for %s", m_name.c_str ());
415 }
416 //SCIM_TRANS_CMD_SET_SELECTION
417 void PanelAgentBase::socket_helper_set_selection (int client, uint32 context, uint32 start, uint32 end)
418 {
419     LOGW ("not implemented for %s", m_name.c_str ());
420 }
421
422 //socket_helper_update_input_context
423 //ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT
424 void PanelAgentBase::update_ise_input_context (int client, uint32 context, uint32 type, uint32 value)
425 {
426     LOGW ("not implemented for %s", m_name.c_str ());
427 }
428
429 //socket_helper_send_private_command
430 //SCIM_TRANS_CMD_SEND_PRIVATE_COMMAND
431 void PanelAgentBase::send_private_command (int client, uint32 context, const String& command)
432 {
433     LOGW ("not implemented for %s", m_name.c_str ());
434 }
435
436 //SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
437 void PanelAgentBase::helper_all_update_spot_location (int client, uint32 context, String uuid, int x, int y)
438 {
439     LOGW ("not implemented for %s", m_name.c_str ());
440 }
441 //ISM_TRANS_CMD_UPDATE_CURSOR_POSITION
442 void PanelAgentBase::helper_all_update_cursor_position (int client, uint32 context, String uuid, int cursor_pos)
443 {
444     LOGW ("not implemented for %s", m_name.c_str ());
445 }
446 //SCIM_TRANS_CMD_UPDATE_SCREEN
447 void PanelAgentBase::helper_all_update_screen (int client, uint32 context, String uuid, int screen)
448 {
449     LOGW ("not implemented for %s", m_name.c_str ());
450 }
451
452 //socket_helper_commit_string
453 //SCIM_TRANS_CMD_COMMIT_STRING
454 void PanelAgentBase::commit_string (int client, uint32 context,const WideString& wstr)
455 {
456     LOGW ("not implemented for %s", m_name.c_str ());
457 }
458 //socket_helper_show_preedit_string
459 //SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
460 void PanelAgentBase::show_preedit_string (int client, uint32 context)
461 {
462     LOGW ("not implemented for %s", m_name.c_str ());
463 }
464 //socket_helper_hide_preedit_string
465 //SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
466 void PanelAgentBase::hide_preedit_string (int client, uint32 context)
467 {
468     LOGW ("not implemented for %s", m_name.c_str ());
469 }
470 //socket_helper_update_preedit_string
471 //SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
472 void PanelAgentBase::update_preedit_string (int client, uint32 context, WideString wstr, AttributeList& attrs, uint32 caret)
473 {
474     LOGW ("not implemented for %s", m_name.c_str ());
475 }
476 //socket_helper_update_preedit_caret
477 //SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
478 void PanelAgentBase::update_preedit_caret (int client, uint32 context, uint32 caret)
479 {
480     LOGW ("not implemented for %s", m_name.c_str ());
481 }
482 //socket_helper_register_helper
483 //SCIM_TRANS_CMD_HELPER_ATTACH_INPUT_CONTEXT
484 //SCIM_TRANS_CMD_UPDATE_SCREEN
485 void PanelAgentBase::helper_attach_input_context_and_update_screen (int client, std::vector < std::pair <uint32, String> >& helper_ic_index,
486         uint32 current_screen)
487 {
488     LOGW ("not implemented for %s", m_name.c_str ());
489 }
490
491 void PanelAgentBase::hide_helper_ise (int client, uint32 context)
492 {
493     LOGW ("not implemented for %s", m_name.c_str ());
494 }
495
496
497 } /* namespace scim */
498
499 /*
500 vi:ts=4:nowrap:ai:expandtab
501 */