4e6be25b5094f64fd5d5d9fad551666676106333
[platform/core/uifw/isf.git] / ism / src / isf_panel_agent_manager.cpp
1 /** @file isf_panel_agent_manager.cpp
2  *  @brief Implementation of class PanelAgentManager.
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 #define Uses_SCIM_PANEL_AGENT_MODULE
42
43 #include <string.h>
44 #include <sys/types.h>
45 #include <sys/times.h>
46 #include <dlog.h>
47 #include <unistd.h>
48 #include "scim_private.h"
49 #include "scim.h"
50 #include "scim_stl_map.h"
51 #include "isf_debug.h"
52
53 #ifdef LOG_TAG
54 # undef LOG_TAG
55 #endif
56 #define LOG_TAG             "ISF_PANEL_AGENT_MANAGER"
57
58 //FIXME
59 //remove this
60 #define WAYLAND_MODULE_CLIENT_ID (0)
61
62
63 namespace scim
64 {
65
66
67 //==================================== PanelAgent ===========================
68 class PanelAgentManager::PanelAgentManagerImpl
69 {
70 public:
71     std::vector<PanelAgentModule*> m_panel_agent_modules;
72     std::map <int, PanelAgentPointer> m_client_repository;
73
74     PanelAgentPointer m_socket;
75     PanelAgentPointer m_wayland;
76 public:
77     PanelAgentManagerImpl () {
78     }
79
80     ~PanelAgentManagerImpl () {
81         m_socket.reset(0);
82         m_wayland.reset(0);
83         std::vector<PanelAgentModule*>::iterator iter = m_panel_agent_modules.begin ();
84
85         for (; iter != m_panel_agent_modules.end (); iter++) {
86             (*iter)->unload();
87             delete *iter;
88         }
89
90         m_panel_agent_modules.clear ();
91     }
92
93     PanelAgentPointer get_panel_agent_by_id (int id) {
94         if (id == WAYLAND_MODULE_CLIENT_ID)
95             return m_wayland;
96         else
97             return m_socket;
98     }
99
100     PanelAgentPointer get_panel_wl_agent () {
101         return m_wayland;
102     }
103 };
104
105 PanelAgentManager::PanelAgentManager ()
106     :m_impl (new PanelAgentManagerImpl ())
107 {
108 }
109
110 PanelAgentManager::~PanelAgentManager ()
111 {
112     delete m_impl;
113 }
114
115 bool PanelAgentManager::initialize (InfoManager* info_manager, const ConfigPointer& config, const String& display, bool resident)
116 {
117     std::vector <String> mod_list;
118     scim_get_panel_agent_module_list (mod_list);
119
120     for (std::vector<String>::iterator it = mod_list.begin (); it != mod_list.end (); ++it) {
121         LOGD ("Trying to load panelagent module %s", it->c_str ());
122         PanelAgentModule* _panel_agent_module = new PanelAgentModule;
123
124         if (!_panel_agent_module) {
125             LOGD ("");
126             continue;
127         }
128
129         _panel_agent_module->load (*it, config);
130
131         if (!_panel_agent_module->valid ()) {
132             LOGD ("");
133             delete _panel_agent_module;
134             continue;
135         }
136
137         PanelAgentPointer _panelagent = _panel_agent_module->get_instance ();
138
139         if (_panelagent.null ()) {
140             LOGD ("");
141             delete _panel_agent_module;
142             continue;
143         }
144
145         _panelagent->initialize (info_manager, display, resident);
146         LOGD ("PanelAgent Module %s loaded", _panel_agent_module->get_module_name ().c_str ());
147         m_impl->m_panel_agent_modules.push_back (_panel_agent_module);
148
149         if (_panel_agent_module->get_module_name () == "wayland")
150             m_impl->m_wayland = _panelagent;
151         else if (_panel_agent_module->get_module_name () == "ecoresocket")
152             m_impl->m_socket = _panelagent;
153     }
154
155     return true;
156 }
157
158 bool PanelAgentManager::valid (void) const
159 {
160     return true;
161 }
162
163 void PanelAgentManager::stop (void)
164 {
165     SCIM_DEBUG_MAIN (1) << "PanelAgent::stop ()\n";
166 }
167
168 void PanelAgentManager::update_panel_event (int id,  uint32 context_id, int cmd, uint32 nType, uint32 nValue)
169 {
170     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
171
172     if (!_p.null ())
173         _p->update_panel_event (id, context_id, cmd, nType, nValue);
174 }
175
176 void PanelAgentManager::reset_keyboard_ise (int id, uint32 context_id)
177 {
178     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
179
180     if (!_p.null ())
181         _p->reset_keyboard_ise (id, context_id);
182 }
183
184 void PanelAgentManager::update_keyboard_ise_list (int id, uint32 context_id)
185 {
186     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
187
188     if (!_p.null ())
189         _p->update_keyboard_ise_list (id, context_id);
190 }
191
192 void PanelAgentManager::change_factory (int id, uint32 context_id, const String&  uuid)
193 {
194     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
195
196     if (!_p.null ())
197         _p->change_factory (id, context_id, uuid);
198 }
199
200 void PanelAgentManager::helper_candidate_show (int id, uint32 context_id, const String&  uuid)
201 {
202     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
203
204     if (!_p.null ())
205         _p->helper_candidate_show (id, context_id, uuid);
206 }
207
208 void PanelAgentManager::helper_candidate_hide (int id, uint32 context_id, const String&  uuid)
209 {
210     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
211
212     if (!_p.null ())
213         _p->helper_candidate_hide (id, context_id, uuid);
214 }
215
216 void PanelAgentManager::candidate_more_window_show (int id, uint32 context_id)
217 {
218     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
219
220     if (!_p.null ())
221         _p->candidate_more_window_show (id, context_id);
222 }
223
224 void PanelAgentManager::candidate_more_window_hide (int id, uint32 context_id)
225 {
226     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
227
228     if (!_p.null ())
229         _p->candidate_more_window_hide (id, context_id);
230 }
231
232 void PanelAgentManager::update_helper_lookup_table (int id, uint32 context_id, const String&  uuid, const LookupTable& table)
233 {
234     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
235
236     if (!_p.null ())
237         _p->update_helper_lookup_table (id, context_id, uuid, table);
238 }
239
240 void PanelAgentManager::select_aux (int id, uint32 context_id, uint32 item)
241 {
242     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
243
244     if (!_p.null ())
245         _p->select_aux (id, context_id, item);
246 }
247
248 void PanelAgentManager::select_candidate (int id, uint32 context_id, uint32 item)
249 {
250     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
251
252     if (!_p.null ())
253         _p->select_candidate (id, context_id, item);
254 }
255
256 void PanelAgentManager::lookup_table_page_up (int id, uint32 context_id)
257 {
258     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
259
260     if (!_p.null ())
261         _p->lookup_table_page_up (id, context_id);
262 }
263
264 void PanelAgentManager::lookup_table_page_down (int id, uint32 context_id)
265 {
266     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
267
268     if (!_p.null ())
269         _p->lookup_table_page_down (id, context_id);
270 }
271
272 void PanelAgentManager::update_lookup_table_page_size (int id, uint32 context_id, uint32 size)
273 {
274     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
275
276     if (!_p.null ())
277         _p->update_lookup_table_page_size (id, context_id, size);
278 }
279
280 void PanelAgentManager::update_candidate_item_layout (int id, uint32 context_id, const std::vector<uint32>& row_items)
281 {
282     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
283
284     if (!_p.null ())
285         _p->update_candidate_item_layout (id, context_id, row_items);
286 }
287
288 void PanelAgentManager::select_associate (int id, uint32 context_id, uint32 item)
289 {
290     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
291
292     if (!_p.null ())
293         _p->select_associate (id, context_id, item);
294 }
295
296 void PanelAgentManager::associate_table_page_up (int id, uint32 context_id)
297 {
298     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
299
300     if (!_p.null ())
301         _p->associate_table_page_up (id, context_id);
302 }
303
304 void PanelAgentManager::associate_table_page_down (int id, uint32 context_id)
305 {
306     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
307
308     if (!_p.null ())
309         _p->associate_table_page_down (id, context_id);
310 }
311
312 void PanelAgentManager::update_associate_table_page_size (int id, uint32 context_id, uint32 size)
313 {
314     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
315
316     if (!_p.null ())
317         _p->update_associate_table_page_size (id, context_id, size);
318 }
319
320 void PanelAgentManager::update_displayed_candidate_number (int id, uint32 context_id, uint32 size)
321 {
322     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
323
324     if (!_p.null ())
325         _p->update_displayed_candidate_number (id, context_id, size);
326 }
327
328 void PanelAgentManager::send_longpress_event (int id, uint32 context_id, uint32 index)
329 {
330     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
331
332     if (!_p.null ())
333         _p->send_longpress_event (id, context_id, index);
334 }
335
336 void PanelAgentManager::trigger_property (int id, uint32 context_id, const String&  property)
337 {
338     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
339
340     if (!_p.null ())
341         _p->trigger_property (id, context_id, property);
342 }
343
344 void PanelAgentManager::socket_start_helper (int id, uint32 context_id, const String& ic_uuid)
345 {
346     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
347
348     if (!_p.null ())
349         _p->socket_start_helper (id, context_id, ic_uuid);
350 }
351
352
353 void PanelAgentManager::exit (int id, uint32 context_id)
354 {
355     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
356
357     if (!_p.null ())
358         _p->exit (id, context_id);
359 }
360
361 void PanelAgentManager::focus_out_helper (int id, uint32 context_id, const String& uuid)
362 {
363     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
364
365     if (!_p.null ())
366         _p->focus_out_helper (id, context_id, uuid);
367 }
368
369 void PanelAgentManager::focus_in_helper (int id, uint32 context_id, const String& uuid)
370 {
371     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
372
373     if (!_p.null ())
374         _p->focus_in_helper (id, context_id, uuid);
375 }
376
377 void PanelAgentManager::show_helper (int id, uint32 context_id, const String& uuid, char* data, size_t& len)
378 {
379     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
380
381     if (!_p.null ())
382         _p->show_helper (id, context_id, uuid, data, len);
383 }
384
385 void PanelAgentManager::hide_helper (int id, uint32 context_id, const String& uuid)
386 {
387     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
388
389     if (!_p.null ())
390         _p->hide_helper (id, context_id, uuid);
391 }
392
393 void PanelAgentManager::set_helper_mode (int id, uint32 context_id, const String& uuid, uint32& mode)
394 {
395     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
396
397     if (!_p.null ())
398         _p->set_helper_mode (id, context_id, uuid, mode);
399 }
400
401 void PanelAgentManager::set_helper_language (int id, uint32 context_id, const String& uuid, uint32& language)
402 {
403     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
404
405     if (!_p.null ())
406         _p->set_helper_language (id, context_id, uuid, language);
407 }
408
409 void PanelAgentManager::set_helper_imdata (int id, uint32 context_id, const String& uuid, const char* imdata, size_t& len)
410 {
411     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
412
413     if (!_p.null ())
414         _p->set_helper_imdata (id, context_id, uuid, imdata, len);
415 }
416
417 void PanelAgentManager::set_helper_return_key_type (int id, uint32 context_id, const String& uuid, uint32 type)
418 {
419     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
420
421     if (!_p.null ())
422         _p->set_helper_return_key_type (id, context_id, uuid, type);
423 }
424
425 void PanelAgentManager::get_helper_return_key_type (int id, uint32 context_id, const String& uuid, _OUT_ uint32& type)
426 {
427     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
428
429     if (!_p.null ())
430         _p->get_helper_return_key_type (id, context_id, uuid, type);
431 }
432
433 void PanelAgentManager::set_helper_return_key_disable (int id, uint32 context_id, const String& uuid, uint32 disabled)
434 {
435     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
436
437     if (!_p.null ())
438         _p->set_helper_return_key_disable (id, context_id, uuid, disabled);
439 }
440
441 void PanelAgentManager::get_helper_return_key_disable (int id, uint32 context_id, const String& uuid, _OUT_ uint32& disabled)
442 {
443     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
444
445     if (!_p.null ())
446         _p->get_helper_return_key_disable (id, context_id, uuid, disabled);
447 }
448
449 void PanelAgentManager::set_helper_layout (int id, uint32 context_id, const String& uuid, uint32& layout)
450 {
451     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
452
453     if (!_p.null ())
454         _p->set_helper_layout (id, context_id, uuid, layout);
455 }
456
457 void PanelAgentManager::set_helper_input_mode (int id, uint32 context_id, const String& uuid, uint32& mode)
458 {
459     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
460
461     if (!_p.null ())
462         _p->set_helper_input_mode (id, context_id, uuid, mode);
463 }
464
465 void PanelAgentManager::set_helper_input_hint (int id, uint32 context_id, const String& uuid, uint32& hint)
466 {
467     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
468
469     if (!_p.null ())
470         _p->set_helper_input_hint (id, context_id, uuid, hint);
471 }
472
473 void PanelAgentManager::set_helper_bidi_direction (int id, uint32 context_id, const String& uuid, uint32& direction)
474 {
475     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
476
477     if (!_p.null ())
478         _p->set_helper_bidi_direction (id, context_id, uuid, direction);
479 }
480
481 void PanelAgentManager::set_helper_caps_mode (int id, uint32 context_id, const String& uuid, uint32& mode)
482 {
483     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
484
485     if (!_p.null ())
486         _p->set_helper_caps_mode (id, context_id, uuid, mode);
487 }
488
489 void PanelAgentManager::show_helper_option_window (int id, uint32 context_id, const String& uuid, uint32 caller_pid, uint32 ime_pid)
490 {
491     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
492
493     if (!_p.null ())
494         _p->show_helper_option_window (id, context_id, uuid, caller_pid, ime_pid);
495 }
496
497 void PanelAgentManager::resume_helper_option_window (int id, uint32 context_id, const String& uuid)
498 {
499     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
500
501     if (!_p.null ())
502         _p->resume_helper_option_window (id, context_id, uuid);
503 }
504
505 void PanelAgentManager::set_transient_for (uint32 caller_pid, uint32 ime_pid)
506 {
507     PanelAgentPointer _p = m_impl->get_panel_wl_agent ();
508
509     if (!_p.null ())
510         _p->set_transient_for (caller_pid, ime_pid);
511 }
512
513 void PanelAgentManager::set_helper_keyboard_mode (int id, uint32 context_id, const String& uuid, uint32& mode)
514 {
515     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
516
517     if (!_p.null ())
518         _p->set_helper_keyboard_mode (id, context_id, uuid, mode);
519 }
520
521 void PanelAgentManager::set_helper_prediction_hint (int id, uint32 context_id, const String& uuid, String& prediction_hint)
522 {
523     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
524
525     if (!_p.null ())
526         _p->set_helper_prediction_hint (id, context_id, uuid, prediction_hint);
527 }
528
529 void PanelAgentManager::set_helper_mime_type (int id, uint32 context_id, const String& uuid, String& mime_type)
530 {
531     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
532
533     if (!_p.null ())
534         _p->set_helper_mime_type (id, context_id, uuid, mime_type);
535 }
536
537 void PanelAgentManager::finalize_content_helper (int id, uint32 context_id, const String& uuid, String& text, uint32& cursor_pos)
538 {
539     PanelAgentPointer _p = m_impl->get_panel_agent_by_id(id);
540
541     if (!_p.null())
542         _p->finalize_content_helper (id, context_id, uuid, text, cursor_pos);
543 }
544
545 void PanelAgentManager::set_helper_prediction_hint_data (int id, uint32 context_id, const String& uuid, String& key, String& value)
546 {
547     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
548
549     if (!_p.null ())
550         _p->set_helper_prediction_hint_data (id, context_id, uuid, key, value);
551 }
552
553 void PanelAgentManager::set_helper_optimization_hint(int id, uint32 context_id, const String& uuid, uint32 hint)
554 {
555     PanelAgentPointer _p = m_impl->get_panel_agent_by_id(id);
556
557     if (!_p.null())
558         _p->set_helper_optimization_hint(id, context_id, uuid, hint);
559 }
560
561 bool PanelAgentManager::process_key_event (int id, uint32 context_id, const String& uuid, KeyEvent& key, uint32 serial, uint32 keycode)
562 {
563     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
564
565     if (!_p.null ())
566         return _p->process_key_event (id, context_id, uuid, key, serial, keycode);
567     return false;
568 }
569
570 bool PanelAgentManager::get_helper_geometry (int id, uint32 context_id, String& uuid, _OUT_ struct rectinfo& info)
571 {
572     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
573
574     if (!_p.null ())
575         return _p->get_helper_geometry (id, context_id, uuid, info);
576     return false;
577 }
578
579 void PanelAgentManager::get_helper_imdata (int id, uint32 context_id, String& uuid, _OUT_ char** imdata, _OUT_ size_t& len)
580 {
581     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
582
583     if (!_p.null ())
584         _p->get_helper_imdata (id, context_id, uuid, imdata, len);
585 }
586
587 void PanelAgentManager::get_helper_layout (int id, uint32 context_id, String& uuid, uint32& layout)
588 {
589     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
590
591     if (!_p.null ())
592         _p->get_helper_layout (id, context_id, uuid, layout);
593 }
594
595 void PanelAgentManager::get_ise_language_locale (int id, uint32 context_id, String& uuid, _OUT_ char** data, _OUT_ size_t& len)
596 {
597     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
598
599     if (!_p.null ())
600         _p->get_ise_language_locale (id, context_id, uuid, data, len);
601 }
602
603 void PanelAgentManager::check_option_window (int id, uint32 context_id, String& uuid, _OUT_ uint32& avail)
604 {
605     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
606
607     if (!_p.null ())
608         _p->check_option_window (id, context_id, uuid, avail);
609 }
610
611 void PanelAgentManager::reset_ise_option (int id, uint32 context_id)
612 {
613     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
614
615     if (!_p.null ())
616         _p->reset_ise_option (id, context_id);
617 }
618
619 void PanelAgentManager::reset_helper_context (int id, uint32 context_id, const String& uuid)
620 {
621     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
622
623     if (!_p.null ())
624         _p->reset_helper_context (id, context_id, uuid);
625 }
626
627 void PanelAgentManager::reload_config (int id)
628 {
629     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
630
631     if (!_p.null ())
632         _p->reload_config (id);
633 }
634
635 void PanelAgentManager::socket_update_surrounding_text (int id, uint32 context_id, const String& uuid, String& text, uint32 cursor)
636 {
637     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
638
639     if (!_p.null ())
640         _p->socket_update_surrounding_text (id, context_id, uuid, text, cursor);
641 }
642
643 void PanelAgentManager::socket_remoteinput_focus_in (int id)
644 {
645     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
646
647     if (!_p.null ())
648         _p->socket_remoteinput_focus_in (id);
649 }
650
651 void PanelAgentManager::socket_remoteinput_focus_out (int id)
652 {
653     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
654
655     if (!_p.null ())
656         _p->socket_remoteinput_focus_out (id);
657 }
658
659 void PanelAgentManager::socket_remoteinput_entry_metadata (int id, uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled, uint32 return_key_type)
660 {
661     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
662
663     if (!_p.null ())
664         _p->socket_remoteinput_entry_metadata (id, hint, layout, variation, autocapital_type, return_key_disabled, return_key_type);
665 }
666
667 void PanelAgentManager::socket_remoteinput_surrounding_text (int id, String& text, uint32 cursor)
668 {
669     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
670
671     if (!_p.null ())
672         _p->socket_remoteinput_surrounding_text (id, text, cursor);
673 }
674
675 void PanelAgentManager::socket_remoteinput_input_resource (int id, uint32 input_resource)
676 {
677     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
678
679     if (!_p.null ())
680         _p->socket_remoteinput_input_resource (id, input_resource);
681 }
682
683 void PanelAgentManager::socket_update_selection (int id, uint32 context_id, String& uuid, String text)
684 {
685     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
686
687     if (!_p.null ())
688         _p->socket_update_selection (id, context_id, uuid, text);
689 }
690
691 void PanelAgentManager::socket_get_keyboard_ise_list (int id, uint32 context_id, const String& uuid, std::vector<String>& list)
692 {
693     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
694
695     if (!_p.null ())
696         _p->socket_get_keyboard_ise_list (id, context_id, uuid, list);
697 }
698
699 void PanelAgentManager::socket_get_candidate_ui (int id, uint32 context_id, const String& uuid,  int style,  int mode)
700 {
701     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
702
703     if (!_p.null ())
704         _p->socket_get_candidate_ui (id, context_id, uuid, style, mode);
705 }
706
707 void PanelAgentManager::socket_get_candidate_geometry (int id, uint32 context_id, const String& uuid, struct rectinfo& info)
708 {
709     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
710
711     if (!_p.null ())
712         _p->socket_get_candidate_geometry (id, context_id, uuid, info);
713 }
714
715 void PanelAgentManager::socket_get_keyboard_ise (int id, uint32 context_id, const String& uuid, String& ise_name, String& ise_uuid)
716 {
717     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
718
719     if (!_p.null ())
720         _p->socket_get_keyboard_ise (id, context_id, uuid, ise_name, ise_uuid);
721 }
722
723 void PanelAgentManager::helper_detach_input_context (int id, uint32 context_id, const String& uuid)
724 {
725     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
726
727     if (!_p.null ())
728         _p->helper_detach_input_context (id, context_id, uuid);
729 }
730
731 void PanelAgentManager::helper_process_imengine_event (int id, uint32 context_id, const String& uuid, const Transaction& nest_transaction)
732 {
733     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
734
735     if (!_p.null ())
736         _p->helper_process_imengine_event (id, context_id, uuid, nest_transaction);
737 }
738
739 void PanelAgentManager::process_helper_event (int id, uint32 context_id, String target_uuid, String active_uuid, Transaction& nest_trans)
740 {
741     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
742
743     if (!_p.null ())
744         _p->process_helper_event (id, context_id, target_uuid, active_uuid, nest_trans);
745 }
746
747 bool PanelAgentManager::process_input_device_event(int id, uint32 context_id, const String& uuid, uint32 type, const char *data, size_t len, _OUT_ uint32& result)
748 {
749     PanelAgentPointer _p = m_impl->get_panel_agent_by_id(id);
750
751     if (!_p.null())
752         return _p->process_input_device_event(id, context_id, uuid, type, data, len, result);
753     return false;
754 }
755
756 void PanelAgentManager::socket_helper_key_event (int id, uint32 context_id, int cmd , KeyEvent& key)
757 {
758     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
759
760     if (!_p.null ())
761         _p->socket_helper_key_event (id, context_id, cmd, key);
762 }
763
764 void PanelAgentManager::socket_helper_get_surrounding_text (int id, uint32 context_id, uint32 maxlen_before, uint32 maxlen_after)
765 {
766     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
767
768     if (!_p.null ())
769         _p->socket_helper_get_surrounding_text (id, context_id, maxlen_before, maxlen_after);
770 }
771
772 void PanelAgentManager::socket_helper_delete_surrounding_text (int id, uint32 context_id, uint32 offset, uint32 len)
773 {
774     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
775
776     if (!_p.null ())
777         _p->socket_helper_delete_surrounding_text (id, context_id, offset, len);
778 }
779
780 void PanelAgentManager::socket_helper_get_selection (int id, uint32 context_id)
781 {
782     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
783
784     if (!_p.null ())
785         _p->socket_helper_get_selection (id, context_id);
786 }
787
788 void PanelAgentManager::socket_helper_set_selection (int id, uint32 context_id, uint32 start, uint32 end)
789 {
790     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
791
792     if (!_p.null ())
793         _p->socket_helper_set_selection (id, context_id, start, end);
794 }
795
796 void PanelAgentManager::update_ise_input_context (int id, uint32 context_id, uint32 type, uint32 value)
797 {
798     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
799
800     if (!_p.null ())
801         _p->update_ise_input_context (id, context_id, type, value);
802 }
803
804 void PanelAgentManager::update_ise_language_locale(int id, uint32 context_id, String locale)
805 {
806     PanelAgentPointer _p = m_impl->get_panel_agent_by_id(id);
807
808     if (!_p.null())
809         _p->update_ise_language_locale(id, context_id, locale);
810 }
811
812 void PanelAgentManager::send_private_command (int id, uint32 context_id, String command)
813 {
814     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
815
816     if (!_p.null ())
817         _p->send_private_command (id, context_id, command);
818 }
819
820 void PanelAgentManager::commit_content (int id, uint32 context_id, String content, String description, String mime_types)
821 {
822     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
823
824     if (!_p.null ())
825         _p->commit_content (id, context_id, content, description, mime_types);
826 }
827
828 void PanelAgentManager::helper_all_update_spot_location (int id, uint32 context_id, String uuid, int x, int y)
829 {
830     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
831
832     if (!_p.null ())
833         _p->helper_all_update_spot_location (id, context_id, uuid, x, y);
834 }
835
836 void PanelAgentManager::helper_all_update_cursor_position (int id, uint32 context_id, String uuid, int cursor_pos)
837 {
838     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
839
840     if (!_p.null ())
841         _p->helper_all_update_cursor_position (id, context_id, uuid, cursor_pos);
842 }
843
844 void PanelAgentManager::helper_all_update_screen (int id, uint32 context_id, String uuid, int screen)
845 {
846     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
847
848     if (!_p.null ())
849         _p->helper_all_update_screen (id, context_id, uuid, screen);
850 }
851
852 void PanelAgentManager::commit_string (int id, uint32 context_id, const WideString& wstr)
853 {
854     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
855
856     if (!_p.null ())
857         _p->commit_string (id, context_id, wstr);
858 }
859
860 void PanelAgentManager::show_preedit_string (int id, uint32 context_id)
861 {
862     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
863
864     if (!_p.null ())
865         _p->show_preedit_string (id, context_id);
866 }
867
868 void PanelAgentManager::hide_preedit_string (int id, uint32 context_id)
869 {
870     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
871
872     if (!_p.null ())
873         _p->hide_preedit_string (id, context_id);
874 }
875
876 void PanelAgentManager::update_preedit_string (int id, uint32 context_id, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret)
877 {
878     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
879
880     if (!_p.null ())
881         _p->update_preedit_string (id, context_id, preedit, commit, attrs, caret);
882 }
883
884 void PanelAgentManager::update_preedit_caret (int id, uint32 context_id, uint32 caret)
885 {
886     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
887
888     if (!_p.null ())
889         _p->update_preedit_caret (id, context_id, caret);
890 }
891
892 void PanelAgentManager::recapture_string (int id, uint32 context_id, int offset, int len, WideString preedit, WideString commit, AttributeList& attrs)
893 {
894     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
895
896     if (!_p.null ())
897         _p->recapture_string (id, context_id, offset, len, preedit, commit, attrs);
898 }
899
900 void PanelAgentManager::helper_attach_input_context_and_update_screen (int id, std::vector < std::pair <uint32, String> >& helper_ic_index,
901         uint32 current_screen)
902 {
903     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
904
905     if (!_p.null ())
906         _p->helper_attach_input_context_and_update_screen (id, helper_ic_index, current_screen);
907 }
908
909 void PanelAgentManager::hide_helper_ise (int id, uint32 context)
910 {
911     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
912
913     if (!_p.null ())
914         _p->hide_helper_ise (id, context);
915 }
916
917 void PanelAgentManager::process_key_event_done (int id, uint32 context_id, KeyEvent &key, uint32 ret, uint32 serial)
918 {
919     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
920
921     if (!_p.null ())
922         _p->process_key_event_done (id, context_id, key, ret, serial);
923 }
924
925 void PanelAgentManager::request_ise_hide (int id, uint32 context_id)
926 {
927     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
928
929     if (!_p.null ())
930         _p->request_ise_hide (id, context_id);
931 }
932
933 void PanelAgentManager::set_autocapital_type(int id, uint32 context_id, String uuid, int mode)
934 {
935     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
936
937     if (!_p.null ())
938         _p->set_autocapital_type (id, context_id, uuid, mode);
939 }
940
941 void PanelAgentManager::update_ise_geometry(int id, uint32 context_id, uint32 x, uint32 y, uint32 width, uint32 height)
942 {
943     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
944
945     if (!_p.null ())
946         _p->update_ise_geometry (id, context_id, x, y, width, height);
947 }
948
949 void PanelAgentManager::remote_update_preedit_string (int id, uint32 context_id, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret)
950 {
951     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
952
953     if (!_p.null ())
954         _p->remote_update_preedit_string (id, context_id, str, commit, attrs, caret);
955 }
956
957 void PanelAgentManager::remote_send_key_event (int id, uint32 context_id, const KeyEvent &key)
958 {
959     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
960
961     if (!_p.null ())
962         _p->remote_send_key_event (id, context_id, key);
963 }
964
965 void PanelAgentManager::remote_forward_key_event (int id, uint32 context_id, const KeyEvent &key)
966 {
967     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
968
969     if (!_p.null ())
970         _p->remote_forward_key_event (id, context_id, key);
971 }
972
973 void PanelAgentManager::remote_commit_string (int id, uint32 context_id, const WideString& wstr)
974 {
975     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
976
977     if (!_p.null ())
978         _p->remote_commit_string (id, context_id, wstr);
979 }
980
981 void PanelAgentManager::remote_delete_surrounding_text (int id, uint32 context_id, uint32 offset, uint32 len)
982 {
983     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
984
985     if (!_p.null ())
986         _p->remote_delete_surrounding_text (id, context_id, offset, len);
987 }
988
989 void PanelAgentManager::set_prediction_allow (int id, uint32 context_id, String uuid, int mode)
990 {
991     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
992
993     if (!_p.null ())
994         _p->set_prediction_allow (id, context_id, uuid, mode);
995 }
996
997 void PanelAgentManager::send_fail_reply (int id)
998 {
999     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
1000
1001     if (!_p.null ())
1002         _p->send_fail_reply (id);
1003 }
1004
1005 void PanelAgentManager::update_entry_metadata (int id, uint32 context_id)
1006 {
1007     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
1008
1009     if (!_p.null ())
1010         _p->update_entry_metadata (id, context_id);
1011 }
1012
1013 void PanelAgentManager::request_ise_reshow (int id, uint32 context_id)
1014 {
1015     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
1016
1017     if (!_p.null ())
1018         _p->request_ise_reshow (id, context_id);
1019 }
1020
1021 } /* namespace scim */
1022
1023 /*
1024 vi:ts=4:nowrap:ai:expandtab
1025 */