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