6a57c4a419cfdd48bec8a6b3851eb3cce5e9ab2e
[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 void PanelAgentManager::set_helper_keyboard_mode (int id, uint32 context_id, const String& uuid, uint32& mode)
502 {
503     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
504
505     if (!_p.null ())
506         _p->set_helper_keyboard_mode (id, context_id, uuid, mode);
507 }
508
509 void PanelAgentManager::set_helper_prediction_hint (int id, uint32 context_id, const String& uuid, String& prediction_hint)
510 {
511     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
512
513     if (!_p.null ())
514         _p->set_helper_prediction_hint (id, context_id, uuid, prediction_hint);
515 }
516
517 void PanelAgentManager::set_helper_mime_type (int id, uint32 context_id, const String& uuid, String& mime_type)
518 {
519     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
520
521     if (!_p.null ())
522         _p->set_helper_mime_type (id, context_id, uuid, mime_type);
523 }
524
525 void PanelAgentManager::finalize_content_helper (int id, uint32 context_id, const String& uuid, String& text, uint32& cursor_pos)
526 {
527     PanelAgentPointer _p = m_impl->get_panel_agent_by_id(id);
528
529     if (!_p.null())
530         _p->finalize_content_helper (id, context_id, uuid, text, cursor_pos);
531 }
532
533 void PanelAgentManager::set_helper_prediction_hint_data (int id, uint32 context_id, const String& uuid, String& key, String& value)
534 {
535     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
536
537     if (!_p.null ())
538         _p->set_helper_prediction_hint_data (id, context_id, uuid, key, value);
539 }
540
541 void PanelAgentManager::set_helper_optimization_hint(int id, uint32 context_id, const String& uuid, uint32 hint)
542 {
543     PanelAgentPointer _p = m_impl->get_panel_agent_by_id(id);
544
545     if (!_p.null())
546         _p->set_helper_optimization_hint(id, context_id, uuid, hint);
547 }
548
549 bool PanelAgentManager::process_key_event (int id, uint32 context_id, const String& uuid, KeyEvent& key, uint32 serial)
550 {
551     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
552
553     if (!_p.null ())
554         return _p->process_key_event (id, context_id, uuid, key, serial);
555     return false;
556 }
557
558 bool PanelAgentManager::get_helper_geometry (int id, uint32 context_id, String& uuid, _OUT_ struct rectinfo& info)
559 {
560     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
561
562     if (!_p.null ())
563         return _p->get_helper_geometry (id, context_id, uuid, info);
564     return false;
565 }
566
567 void PanelAgentManager::get_helper_imdata (int id, uint32 context_id, String& uuid, _OUT_ char** imdata, _OUT_ size_t& len)
568 {
569     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
570
571     if (!_p.null ())
572         _p->get_helper_imdata (id, context_id, uuid, imdata, len);
573 }
574
575 void PanelAgentManager::get_helper_layout (int id, uint32 context_id, String& uuid, uint32& layout)
576 {
577     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
578
579     if (!_p.null ())
580         _p->get_helper_layout (id, context_id, uuid, layout);
581 }
582
583 void PanelAgentManager::get_ise_language_locale (int id, uint32 context_id, String& uuid, _OUT_ char** data, _OUT_ size_t& len)
584 {
585     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
586
587     if (!_p.null ())
588         _p->get_ise_language_locale (id, context_id, uuid, data, len);
589 }
590
591 void PanelAgentManager::check_option_window (int id, uint32 context_id, String& uuid, _OUT_ uint32& avail)
592 {
593     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
594
595     if (!_p.null ())
596         _p->check_option_window (id, context_id, uuid, avail);
597 }
598
599 void PanelAgentManager::reset_ise_option (int id, uint32 context_id)
600 {
601     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
602
603     if (!_p.null ())
604         _p->reset_ise_option (id, context_id);
605 }
606
607 void PanelAgentManager::reset_helper_context (int id, uint32 context_id, const String& uuid)
608 {
609     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
610
611     if (!_p.null ())
612         _p->reset_helper_context (id, context_id, uuid);
613 }
614
615 void PanelAgentManager::reload_config (int id)
616 {
617     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
618
619     if (!_p.null ())
620         _p->reload_config (id);
621 }
622
623 void PanelAgentManager::socket_update_surrounding_text (int id, uint32 context_id, const String& uuid, String& text, uint32 cursor)
624 {
625     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
626
627     if (!_p.null ())
628         _p->socket_update_surrounding_text (id, context_id, uuid, text, cursor);
629 }
630
631 void PanelAgentManager::socket_remoteinput_focus_in (int id)
632 {
633     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
634
635     if (!_p.null ())
636         _p->socket_remoteinput_focus_in (id);
637 }
638
639 void PanelAgentManager::socket_remoteinput_focus_out (int id)
640 {
641     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
642
643     if (!_p.null ())
644         _p->socket_remoteinput_focus_out (id);
645 }
646
647 void PanelAgentManager::socket_remoteinput_entry_metadata (int id, uint32 hint, uint32 layout, int variation, uint32 autocapital_type, int return_key_disabled)
648 {
649     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
650
651     if (!_p.null ())
652         _p->socket_remoteinput_entry_metadata (id, hint, layout, variation, autocapital_type, return_key_disabled);
653 }
654
655 void PanelAgentManager::socket_remoteinput_surrounding_text (int id, String& text, uint32 cursor)
656 {
657     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
658
659     if (!_p.null ())
660         _p->socket_remoteinput_surrounding_text (id, text, cursor);
661 }
662
663 void PanelAgentManager::socket_remoteinput_input_resource (int id, uint32 input_resource)
664 {
665     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
666
667     if (!_p.null ())
668         _p->socket_remoteinput_input_resource (id, input_resource);
669 }
670
671 void PanelAgentManager::socket_update_selection (int id, uint32 context_id, String& uuid, String text)
672 {
673     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
674
675     if (!_p.null ())
676         _p->socket_update_selection (id, context_id, uuid, text);
677 }
678
679 void PanelAgentManager::socket_get_keyboard_ise_list (int id, uint32 context_id, const String& uuid, std::vector<String>& list)
680 {
681     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
682
683     if (!_p.null ())
684         _p->socket_get_keyboard_ise_list (id, context_id, uuid, list);
685 }
686
687 void PanelAgentManager::socket_get_candidate_ui (int id, uint32 context_id, const String& uuid,  int style,  int mode)
688 {
689     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
690
691     if (!_p.null ())
692         _p->socket_get_candidate_ui (id, context_id, uuid, style, mode);
693 }
694
695 void PanelAgentManager::socket_get_candidate_geometry (int id, uint32 context_id, const String& uuid, struct rectinfo& info)
696 {
697     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
698
699     if (!_p.null ())
700         _p->socket_get_candidate_geometry (id, context_id, uuid, info);
701 }
702
703 void PanelAgentManager::socket_get_keyboard_ise (int id, uint32 context_id, const String& uuid, String& ise_name, String& ise_uuid)
704 {
705     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
706
707     if (!_p.null ())
708         _p->socket_get_keyboard_ise (id, context_id, uuid, ise_name, ise_uuid);
709 }
710
711 void PanelAgentManager::helper_detach_input_context (int id, uint32 context_id, const String& uuid)
712 {
713     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
714
715     if (!_p.null ())
716         _p->helper_detach_input_context (id, context_id, uuid);
717 }
718
719 void PanelAgentManager::helper_process_imengine_event (int id, uint32 context_id, const String& uuid, const Transaction& nest_transaction)
720 {
721     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
722
723     if (!_p.null ())
724         _p->helper_process_imengine_event (id, context_id, uuid, nest_transaction);
725 }
726
727 void PanelAgentManager::process_helper_event (int id, uint32 context_id, String target_uuid, String active_uuid, Transaction& nest_trans)
728 {
729     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
730
731     if (!_p.null ())
732         _p->process_helper_event (id, context_id, target_uuid, active_uuid, nest_trans);
733 }
734
735 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)
736 {
737     PanelAgentPointer _p = m_impl->get_panel_agent_by_id(id);
738
739     if (!_p.null())
740         return _p->process_input_device_event(id, context_id, uuid, type, data, len, result);
741     return false;
742 }
743
744 void PanelAgentManager::socket_helper_key_event (int id, uint32 context_id, int cmd , KeyEvent& key)
745 {
746     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
747
748     if (!_p.null ())
749         _p->socket_helper_key_event (id, context_id, cmd, key);
750 }
751
752 void PanelAgentManager::socket_helper_get_surrounding_text (int id, uint32 context_id, uint32 maxlen_before, uint32 maxlen_after)
753 {
754     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
755
756     if (!_p.null ())
757         _p->socket_helper_get_surrounding_text (id, context_id, maxlen_before, maxlen_after);
758 }
759
760 void PanelAgentManager::socket_helper_delete_surrounding_text (int id, uint32 context_id, uint32 offset, uint32 len)
761 {
762     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
763
764     if (!_p.null ())
765         _p->socket_helper_delete_surrounding_text (id, context_id, offset, len);
766 }
767
768 void PanelAgentManager::socket_helper_get_selection (int id, uint32 context_id)
769 {
770     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
771
772     if (!_p.null ())
773         _p->socket_helper_get_selection (id, context_id);
774 }
775
776 void PanelAgentManager::socket_helper_set_selection (int id, uint32 context_id, uint32 start, uint32 end)
777 {
778     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
779
780     if (!_p.null ())
781         _p->socket_helper_set_selection (id, context_id, start, end);
782 }
783
784 void PanelAgentManager::update_ise_input_context (int id, uint32 context_id, uint32 type, uint32 value)
785 {
786     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
787
788     if (!_p.null ())
789         _p->update_ise_input_context (id, context_id, type, value);
790 }
791
792 void PanelAgentManager::update_ise_language_locale(int id, uint32 context_id, String locale)
793 {
794     PanelAgentPointer _p = m_impl->get_panel_agent_by_id(id);
795
796     if (!_p.null())
797         _p->update_ise_language_locale(id, context_id, locale);
798 }
799
800 void PanelAgentManager::send_private_command (int id, uint32 context_id, String command)
801 {
802     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
803
804     if (!_p.null ())
805         _p->send_private_command (id, context_id, command);
806 }
807
808 void PanelAgentManager::commit_content (int id, uint32 context_id, String content, String description, String mime_types)
809 {
810     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
811
812     if (!_p.null ())
813         _p->commit_content (id, context_id, content, description, mime_types);
814 }
815
816 void PanelAgentManager::helper_all_update_spot_location (int id, uint32 context_id, String uuid, int x, int y)
817 {
818     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
819
820     if (!_p.null ())
821         _p->helper_all_update_spot_location (id, context_id, uuid, x, y);
822 }
823
824 void PanelAgentManager::helper_all_update_cursor_position (int id, uint32 context_id, String uuid, int cursor_pos)
825 {
826     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
827
828     if (!_p.null ())
829         _p->helper_all_update_cursor_position (id, context_id, uuid, cursor_pos);
830 }
831
832 void PanelAgentManager::helper_all_update_screen (int id, uint32 context_id, String uuid, int screen)
833 {
834     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
835
836     if (!_p.null ())
837         _p->helper_all_update_screen (id, context_id, uuid, screen);
838 }
839
840 void PanelAgentManager::commit_string (int id, uint32 context_id, const WideString& wstr)
841 {
842     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
843
844     if (!_p.null ())
845         _p->commit_string (id, context_id, wstr);
846 }
847
848 void PanelAgentManager::show_preedit_string (int id, uint32 context_id)
849 {
850     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
851
852     if (!_p.null ())
853         _p->show_preedit_string (id, context_id);
854 }
855
856 void PanelAgentManager::hide_preedit_string (int id, uint32 context_id)
857 {
858     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
859
860     if (!_p.null ())
861         _p->hide_preedit_string (id, context_id);
862 }
863
864 void PanelAgentManager::update_preedit_string (int id, uint32 context_id, WideString preedit, WideString commit, AttributeList& attrs, uint32 caret)
865 {
866     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
867
868     if (!_p.null ())
869         _p->update_preedit_string (id, context_id, preedit, commit, attrs, caret);
870 }
871
872 void PanelAgentManager::update_preedit_caret (int id, uint32 context_id, uint32 caret)
873 {
874     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
875
876     if (!_p.null ())
877         _p->update_preedit_caret (id, context_id, caret);
878 }
879
880 void PanelAgentManager::recapture_string (int id, uint32 context_id, int offset, int len, WideString preedit, WideString commit, AttributeList& attrs)
881 {
882     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
883
884     if (!_p.null ())
885         _p->recapture_string (id, context_id, offset, len, preedit, commit, attrs);
886 }
887
888 void PanelAgentManager::helper_attach_input_context_and_update_screen (int id, std::vector < std::pair <uint32, String> >& helper_ic_index,
889         uint32 current_screen)
890 {
891     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
892
893     if (!_p.null ())
894         _p->helper_attach_input_context_and_update_screen (id, helper_ic_index, current_screen);
895 }
896
897 void PanelAgentManager::hide_helper_ise (int id, uint32 context)
898 {
899     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
900
901     if (!_p.null ())
902         _p->hide_helper_ise (id, context);
903 }
904
905 void PanelAgentManager::process_key_event_done (int id, uint32 context_id, KeyEvent &key, uint32 ret, uint32 serial)
906 {
907     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
908
909     if (!_p.null ())
910         _p->process_key_event_done (id, context_id, key, ret, serial);
911 }
912
913 void PanelAgentManager::request_ise_hide (int id, uint32 context_id)
914 {
915     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
916
917     if (!_p.null ())
918         _p->request_ise_hide (id, context_id);
919 }
920
921 void PanelAgentManager::set_autocapital_type(int id, uint32 context_id, String uuid, int mode)
922 {
923     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
924
925     if (!_p.null ())
926         _p->set_autocapital_type (id, context_id, uuid, mode);
927 }
928
929 void PanelAgentManager::update_ise_geometry(int id, uint32 context_id, uint32 x, uint32 y, uint32 width, uint32 height)
930 {
931     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
932
933     if (!_p.null ())
934         _p->update_ise_geometry (id, context_id, x, y, width, height);
935 }
936
937 void PanelAgentManager::remote_update_preedit_string (int id, uint32 context_id, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret)
938 {
939     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
940
941     if (!_p.null ())
942         _p->remote_update_preedit_string (id, context_id, str, commit, attrs, caret);
943 }
944
945 void PanelAgentManager::remote_send_key_event (int id, uint32 context_id, const KeyEvent &key)
946 {
947     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
948
949     if (!_p.null ())
950         _p->remote_send_key_event (id, context_id, key);
951 }
952
953 void PanelAgentManager::remote_forward_key_event (int id, uint32 context_id, const KeyEvent &key)
954 {
955     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
956
957     if (!_p.null ())
958         _p->remote_forward_key_event (id, context_id, key);
959 }
960
961 void PanelAgentManager::remote_commit_string (int id, uint32 context_id, const WideString& wstr)
962 {
963     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
964
965     if (!_p.null ())
966         _p->remote_commit_string (id, context_id, wstr);
967 }
968
969 void PanelAgentManager::remote_delete_surrounding_text (int id, uint32 context_id, uint32 offset, uint32 len)
970 {
971     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
972
973     if (!_p.null ())
974         _p->remote_delete_surrounding_text (id, context_id, offset, len);
975 }
976
977 void PanelAgentManager::set_prediction_allow (int id, uint32 context_id, String uuid, int mode)
978 {
979     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
980
981     if (!_p.null ())
982         _p->set_prediction_allow (id, context_id, uuid, mode);
983 }
984
985 void PanelAgentManager::send_fail_reply (int id)
986 {
987     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
988
989     if (!_p.null ())
990         _p->send_fail_reply (id);
991 }
992
993 void PanelAgentManager::update_entry_metadata (int id, uint32 context_id)
994 {
995     PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id);
996
997     if (!_p.null ())
998         _p->update_entry_metadata (id, context_id);
999 }
1000
1001 } /* namespace scim */
1002
1003 /*
1004 vi:ts=4:nowrap:ai:expandtab
1005 */