upload tizen 2.0 beta code
[profile/ivi/isf.git] / ism / src / scim_panel_agent.h
1 /**
2  * @file scim_panel_agent.h
3  * @brief Defines scim::PanelAgent and their related types.
4  *
5  * scim::PanelAgent is a class used to write Panel daemons.
6  * It acts like a Socket Server and handles all socket clients
7  * issues.
8  */
9
10 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
11
12 /*
13  * Smart Common Input Method
14  *
15  * Copyright (c) 2004-2005 James Su <suzhe@tsinghua.org.cn>
16  *
17  *
18  * This library is free software; you can redistribute it and/or
19  * modify it under the terms of the GNU Lesser General Public
20  * License as published by the Free Software Foundation; either
21  * version 2 of the License, or (at your option) any later version.
22  *
23  * This library is distributed in the hope that it will be useful,
24  * but WITHOUT ANY WARRANTY; without even the implied warranty of
25  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
26  * GNU Lesser General Public License for more details.
27  *
28  * You should have received a copy of the GNU Lesser General Public
29  * License along with this program; if not, write to the
30  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
31  * Boston, MA  02111-1307  USA
32  *
33  * $Id: scim_panel_agent.h,v 1.2 2005/06/11 14:50:31 suzhe Exp $
34  */
35
36 #ifndef __SCIM_PANEL_AGENT_H
37 #define __SCIM_PANEL_AGENT_H
38
39 #include <scim_panel_common.h>
40
41 namespace scim {
42
43 /**
44  * @addtogroup Panel
45  * @ingroup InputServiceFramework
46  * The accessory classes to help develop Panel daemons and FrontEnds
47  * which need to communicate with Panel daemons.
48  * @{
49  */
50
51 typedef enum
52 {
53     TOOLBAR_KEYBOARD_MODE = 0,  /* Hardware keyboard ISE */
54     TOOLBAR_HELPER_MODE         /* Software keyboard ISE */
55 } TOOLBAR_MODE_T;
56
57 typedef struct _ISE_INFO
58 {
59     String uuid;
60     String name;
61     String lang;
62     String icon;
63     uint32 option;
64     TOOLBAR_MODE_T type;
65 } ISE_INFO;
66
67 typedef Slot0<void>
68         PanelAgentSlotVoid;
69
70 typedef Slot1<void, int>
71         PanelAgentSlotInt;
72
73 typedef Slot1<void, const String &>
74         PanelAgentSlotString;
75
76 typedef Slot2<void, String &, String &>
77         PanelAgentSlotString2;
78
79 typedef Slot2<void, int, const String &>
80         PanelAgentSlotIntString;
81
82 typedef Slot1<void, const PanelFactoryInfo &>
83         PanelAgentSlotFactoryInfo;
84
85 typedef Slot1<void, const std::vector <PanelFactoryInfo> &>
86         PanelAgentSlotFactoryInfoVector;
87
88 typedef Slot1<void, const LookupTable &>
89         PanelAgentSlotLookupTable;
90
91 typedef Slot1<void, const Property &>
92         PanelAgentSlotProperty;
93
94 typedef Slot1<void, const PropertyList &>
95         PanelAgentSlotPropertyList;
96
97 typedef Slot2<void, int, int>
98         PanelAgentSlotIntInt;
99
100 typedef Slot2<void, int &, int &>
101         PanelAgentSlotIntInt2;
102
103 typedef Slot3<void, int, int, int>
104         PanelAgentSlotIntIntInt;
105
106 typedef Slot4<void, int, int, int, int>
107         PanelAgentSlotIntIntIntInt;
108
109 typedef Slot2<void, int, const Property &>
110         PanelAgentSlotIntProperty;
111
112 typedef Slot2<void, int, const PropertyList &>
113         PanelAgentSlotIntPropertyList;
114
115 typedef Slot2<void, int, const HelperInfo &>
116         PanelAgentSlotIntHelperInfo;
117
118 typedef Slot2<void, const String &, const AttributeList &>
119         PanelAgentSlotAttributeString;
120
121 typedef Slot1<void, std::vector<String> &>
122         PanelAgentSlotStringVector;
123
124 typedef Slot1<bool, std::vector<String> &>
125         PanelAgentSlotBoolStringVector;
126
127 typedef Slot2<void, char *, std::vector<String> &>
128         PanelAgentSlotStrStringVector;
129
130 typedef Slot2<bool, const String &, ISE_INFO &>
131         PanelAgentSlotStringISEINFO;
132
133 typedef Slot1<void, const KeyEvent &>
134         PanelAgentSlotKeyEvent;
135
136 typedef Slot1<void, struct rectinfo &>
137         PanelAgentSlotRect;
138
139 typedef Slot2<void, const String &, bool>
140         PanelAgentSlotStringBool;
141
142 typedef struct DefaultIse
143 {
144     TOOLBAR_MODE_T type;
145     String         uuid;
146     String         name;
147     DefaultIse () : type (TOOLBAR_KEYBOARD_MODE), uuid (""), name ("") { }
148 } DEFAULT_ISE_T;
149
150 /**
151  * @brief The class to implement all socket protocol in Panel.
152  *
153  * This class acts like a stand alone SocketServer.
154  * It has its own dedicated main loop, and will be blocked when run () is called.
155  * So run () must be called within a separated thread, in order to not block
156  * the main loop of the Panel program itself.
157  *
158  * Before calling run (), the panel must hook the callback functions to the
159  * corresponding signals.
160  *
161  * Note that, there are two special signals: lock(void) and unlock(void). These
162  * two signals are used to provide a thread lock to PanelAgent, so that PanelAgent
163  * can run correctly within a multi-threading Panel program.
164  */
165 class PanelAgent
166 {
167     class PanelAgentImpl;
168     PanelAgentImpl *m_impl;
169
170     PanelAgent (const HelperAgent &);
171     const PanelAgent & operator = (const HelperAgent &);
172
173 public:
174     PanelAgent ();
175     ~PanelAgent ();
176
177     /**
178      * @brief Initialize this PanelAgent.
179      *
180      * @param config The name of the config module to be used by Helpers.
181      * @param display The name of display, on which the Panel should run.
182      * @param resident If this is true then this PanelAgent will keep running
183      *                 even if there is no more client connected.
184      *
185      * @return true if the PanelAgent is initialized correctly and ready to run.
186      */
187     bool initialize (const String &config, const String &display, bool resident = false);
188
189     /**
190      * @brief Check if this PanelAgent is initialized correctly and ready to run.
191      *
192      * @return true if this PanelAgent is ready to run.
193      */
194     bool valid (void) const;
195
196     /**
197      * @brief Run this PanelAgent.
198      *
199      * This method has its own dedicated main loop,
200      * so it should be run in a separated thread.
201      *
202      * @return false if the Panel SocketServer encountered an error when running.
203      *               Otherwise, it won't return until the server exits.
204      */
205     bool run (void);
206
207     /**
208      * @brief Stop this PanelAgent.
209      */
210     void stop (void);
211
212 public:
213
214     /**
215      * @brief Get the list of all helpers.
216      *
217      * Panel program should provide a menu which contains
218      * all stand alone but not auto start Helpers, so that users can activate
219      * the Helpers by clicking in the menu.
220      *
221      * All auto start Helpers should be started by Panel after running PanelAgent
222      * by calling PanelAgent::start_helper().
223      *
224      * @param helpers A list contains information of all Helpers.
225      */
226     int get_helper_list (std::vector <HelperInfo> & helpers) const;
227
228     /**
229      * @brief Get the list of active ISEs.
230      *
231      * @param strlist A list contains information of active ISEs.
232      *
233      * @return the list size.
234      */
235     int get_active_ise_list (std::vector<String> &strlist);
236
237     /**
238      * @brief Get the helper manager connection id.
239      *
240      * @return the connection id
241      */
242     int get_helper_manager_id (void);
243
244     /**
245      * @brief Check if there are any events available to be processed.
246      *
247      * If it returns true then HelperManager object should call
248      * HelperManager::filter_event () to process them.
249      *
250      * @return true if there are any events available.
251      */
252     bool has_helper_manager_pending_event (void);
253
254     /**
255      * @brief Filter the events received from helper manager.
256      *
257      * Corresponding signal will be emitted in this method.
258      *
259      * @return true if the command was sent correctly, otherwise return false.
260      */
261     bool filter_helper_manager_event (void);
262
263     /**
264      * @brief Send display name to FrontEnd.
265      *
266      * @param name The display name.
267      *
268      * @return zero if this operation is successful, otherwise return -1.
269      */
270     int send_display_name (String &name);
271
272
273     /**
274      * @brief Get current ISE type.
275      *
276      * @return the current ISE type.
277      */
278     TOOLBAR_MODE_T get_current_toolbar_mode (void) const;
279
280     /**
281      * @brief Get current ISE icon.
282      *
283      * @return the current ISE icon.
284      */
285     String get_current_factory_icon (void) const;
286
287     /**
288      * @brief Get current helper ISE uuid.
289      *
290      * @return the current helper ISE uuid.
291      */
292    String get_current_helper_uuid (void) const;
293
294     /**
295      * @brief Get current helper ISE name.
296      *
297      * @return the current helper ISE name.
298      */
299     String get_current_helper_name (void) const;
300
301     /**
302      * @brief Get current ISE name.
303      *
304      * @return the current ISE name.
305      */
306     String get_current_ise_name (void) const;
307
308     /**
309      * @brief Set current ISE style.
310      *
311      * @param style The current ISE style.
312      */
313     void set_current_ise_style (uint32 &style);
314
315     /**
316      * @brief Set current ISE name.
317      *
318      * @param name The current ISE name.
319      */
320     void set_current_ise_name (String &name);
321
322     /**
323      * @brief Set current ISE icon.
324      *
325      * @param icon The current ISE icon filepath.
326      */
327     void set_current_factory_icon (String &icon);
328
329     /**
330      * @brief Set current ISE type.
331      *
332      * @param mode The current ISE type.
333      */
334     void set_current_toolbar_mode (TOOLBAR_MODE_T mode);
335
336     /**
337      * @brief Get current ISE size and position.
338      *
339      * @param rect It contains ISE size and position.
340      */
341     void get_current_ise_geometry (rectinfo &rect);
342
343     /**
344      * @brief Update ISE name to IM Control.
345      *
346      * @param name The ISE name.
347      */
348     void update_ise_name (String &name);
349
350     /**
351      * @brief Update ISE style to IM Control.
352      *
353      * @param style The ISE style.
354      */
355     void update_ise_style (uint32 &style);
356
357     /**
358      * @brief Send candidate panel event to IM Control.
359      *
360      * @param nType  The candidate panel event type.
361      * @param nValue The candidate panel event value.
362      */
363     void update_candidate_panel_event (uint32 nType, uint32 nValue);
364
365     /**
366      * @brief Send input panel event to IM Control.
367      *
368      * @param nType  The input panel event type.
369      * @param nValue The input panel event value.
370      */
371     void update_input_panel_event (uint32 nType, uint32 nValue);
372
373     /**
374      * @brief Update ISE control panel status to IM Control.
375      *
376      * @param showed The control panel status.
377      */
378     void update_isf_control_status (const bool showed);
379
380     /**
381      * @brief Notice helper ISE to focus out.
382      *
383      * @param uuid The helper ISE uuid.
384      */
385     void focus_out_helper (const String &uuid);
386
387     /**
388      * @brief Notice helper ISE to focus in.
389      *
390      * @param uuid The helper ISE uuid.
391      */
392     void focus_in_helper (const String &uuid);
393
394     /**
395      * @brief Notice helper ISE to show window.
396      *
397      * @param uuid The helper ISE uuid.
398      */
399     void show_helper (const String &uuid);
400
401     /**
402      * @brief Notice helper ISE to hide window.
403      *
404      * @param uuid The helper ISE uuid.
405      */
406     void hide_helper (const String &uuid);
407
408
409     /**
410      * @brief Set default ISE.
411      *
412      * @param ise The variable contains the information of default ISE.
413      */
414     void set_default_ise (const DEFAULT_ISE_T &ise);
415
416     /**
417      * @brief Set whether shared ISE is for all applications.
418      *
419      * @param should_shared_ise The indicator for shared ISE.
420      */
421     void set_should_shared_ise (const bool should_shared_ise);
422
423     /**
424      * @brief Reset keyboard ISE.
425      *
426      * @return true if this operation is successful, otherwise return false.
427      */
428     bool reset_keyboard_ise (void) const;
429
430     /**
431      * @brief Set whether ISE is changed.
432      *
433      * @param changing The indicator for ISE changing.
434      */
435     void set_ise_changing (bool changing);
436
437 public:
438     /**
439      * @brief Let the focused IMEngineInstance object move the preedit caret.
440      *
441      * @param position The new preedit caret position.
442      * @return true if the command was sent correctly.
443      */
444     bool move_preedit_caret             (uint32         position);
445
446     /**
447      * @brief Request help information from the focused IMEngineInstance object.
448      * @return true if the command was sent correctly.
449      */
450     bool request_help                   (void);
451
452     /**
453      * @brief Request factory menu from the focused FrontEnd.
454      * @return true if the command was sent correctly.
455      */
456     bool request_factory_menu           (void);
457
458     /**
459      * @brief Change the factory used by the focused IMEngineInstance object.
460      *
461      * @param uuid The uuid of the new factory.
462      * @return true if the command was sent correctly.
463      */
464     bool change_factory                 (const String  &uuid);
465
466     /**
467      * @brief Notice Helper ISE that candidate more window is showed.
468      * @return true if the command was sent correctly.
469      */
470     bool candidate_more_window_show     (void);
471
472     /**
473      * @brief Notice Helper ISE that candidate more window is hidden.
474      * @return true if the command was sent correctly.
475      */
476     bool candidate_more_window_hide     (void);
477
478     /**
479      * @brief Let the focused IMEngineInstance object
480      *        select a aux in current aux string.
481      *
482      * @param item The index of the selected aux.
483      * @return true if the command was sent correctly.
484      */
485     bool select_aux                     (uint32         item);
486
487     /**
488      * @brief Let the focused IMEngineInstance object
489      *        select a candidate in current lookup table.
490      *
491      * @param item The index of the selected candidate.
492      * @return true if the command was sent correctly.
493      */
494     bool select_candidate               (uint32         item);
495
496     /**
497      * @brief Let the focused IMEngineInstance object
498      *        flip the LookupTable to previous page.
499      * @return true if the command was sent correctly.
500      */
501     bool lookup_table_page_up           (void);
502
503     /**
504      * @brief Let the focused IMEngineInstance object
505      *        flip the LookupTable to next page.
506      * @return true if the command was sent correctly.
507      */
508     bool lookup_table_page_down         (void);
509
510     /**
511      * @brief Let the focused IMEngineInstance object
512      *        update the page size of the LookupTable.
513      *
514      * @param size The new page size.
515      * @return true if the command was sent correctly.
516      */
517     bool update_lookup_table_page_size  (uint32         size);
518
519     /**
520      * @brief Let the focused IMEngineInstance object
521      *        select a associate in current associate table.
522      *
523      * @param item The index of the selected associate.
524      * @return true if the command was sent correctly.
525      */
526     bool select_associate               (uint32         item);
527
528     /**
529      * @brief Let the focused IMEngineInstance object
530      *        flip the AssociateTable to previous page.
531      * @return true if the command was sent correctly.
532      */
533     bool associate_table_page_up        (void);
534
535     /**
536      * @brief Let the focused IMEngineInstance object
537      *        flip the AssociateTable to next page.
538      * @return true if the command was sent correctly.
539      */
540     bool associate_table_page_down      (void);
541
542     /**
543      * @brief Let the focused IMEngineInstance object
544      *        update the page size of the AssociateTable.
545      *
546      * @param size The new page size.
547      * @return true if the command was sent correctly.
548      */
549     bool update_associate_table_page_size (uint32       size);
550
551     /**
552      * @brief Inform helper ISE to update displayed candidate number.
553      *
554      * @param size The displayed candidate number.
555      * @return true if the command was sent correctly.
556      */
557     bool update_displayed_candidate_number (uint32      size);
558
559     /**
560      * @brief Trigger a property of the focused IMEngineInstance object.
561      *
562      * @param property The property key to be triggered.
563      * @return true if the command was sent correctly.
564      */
565     bool trigger_property               (const String  &property);
566
567     /**
568      * @brief Trigger a property of a Helper object.
569      *
570      * @param client The client id of the Helper object.
571      * @param property The property key to be triggered.
572      * @return true if the command was sent correctly.
573      */
574     bool trigger_helper_property        (int            client,
575                                          const String  &property);
576
577     /**
578      * @brief Start a stand alone helper.
579      *
580      * @param uuid The uuid of the Helper object to be started.
581      * @return true if the command was sent correctly.
582      */
583     bool start_helper                   (const String  &uuid);
584
585     /**
586      * @brief Stop a stand alone helper.
587      *
588      * @param uuid The uuid of the Helper object to be stopped.
589      * @return true if the command was sent correctly.
590      */
591     bool stop_helper                    (const String  &uuid);
592
593     /**
594      * @brief Let all FrontEnds and Helpers reload configuration.
595      * @return true if the command was sent correctly.
596      */
597     bool reload_config                  (void);
598
599     /**
600      * @brief Let all FrontEnds, Helpers and this Panel exit.
601      * @return true if the command was sent correctly.
602      */
603     bool exit                           (void);
604
605     /**
606      * @brief Filter the events received from panel client.
607      *
608      * Corresponding signal will be emitted in this method.
609      *
610      * @param fd The file description for connection.
611      *
612      * @return true if the command was sent correctly, otherwise return false.
613      */
614     bool filter_event                   (int fd);
615
616     /**
617      * @brief Filter the exception events received from panel client.
618      *
619      * Corresponding signal will be emitted in this method.
620      *
621      * @param fd The file description for connection.
622      *
623      * @return true if the command was sent correctly, otherwise return false.
624      */
625     bool filter_exception_event         (int fd);
626
627     /**
628      * @brief Get PanelAgent server fd.
629      *
630      * @return the PanelAgent server fd.
631      */
632     int get_server_id                   (void);
633
634     /**
635      * @brief Set the common ISE uuid.
636      *
637      * @return none.
638      */
639     void set_common_ise_uuid            (String &uuid);
640
641     /**
642      * @brief Request to update ISE list.
643      *
644      * @return none.
645      */
646     void update_ise_list                (std::vector<String> &strList);
647
648 public:
649     /**
650      * @brief Signal: Reload configuration.
651      *
652      * When a Helper object send a RELOAD_CONFIG event to this Panel,
653      * this signal will be emitted. Panel should reload all configuration here.
654      */
655     Connection signal_connect_reload_config              (PanelAgentSlotVoid                *slot);
656
657     /**
658      * @brief Signal: Turn on.
659      *
660      * slot prototype: void turn_on (void);
661      */
662     Connection signal_connect_turn_on                    (PanelAgentSlotVoid                *slot);
663
664     /**
665      * @brief Signal: Turn off.
666      *
667      * slot prototype: void turn_off (void);
668      */
669     Connection signal_connect_turn_off                   (PanelAgentSlotVoid                *slot);
670
671     /**
672      * @brief Signal: Show panel.
673      *
674      * slot prototype: void show_panel (void);
675      */
676     Connection signal_connect_show_panel                 (PanelAgentSlotVoid                *slot);
677
678     /**
679      * @brief Signal: Hide panel.
680      *
681      * slot prototype: void hide_panel (void);
682      */
683     Connection signal_connect_hide_panel                 (PanelAgentSlotVoid                *slot);
684
685     /**
686      * @brief Signal: Update screen.
687      *
688      * slot prototype: void update_screen (int screen);
689      */
690     Connection signal_connect_update_screen              (PanelAgentSlotInt                 *slot);
691
692     /**
693      * @brief Signal: Update spot location.
694      *
695      * slot prototype: void update_spot_location (int x, int y, int top_y);
696      */
697     Connection signal_connect_update_spot_location       (PanelAgentSlotIntIntInt           *slot);
698
699     /**
700      * @brief Signal: Update factory information.
701      *
702      * slot prototype: void update_factory_info (const PanelFactoryInfo &info);
703      */
704     Connection signal_connect_update_factory_info        (PanelAgentSlotFactoryInfo         *slot);
705
706     /**
707      * @brief Signal: start default ise.
708      *
709      * slot prototype: void start_default_ise (void);
710      */
711     Connection signal_connect_start_default_ise          (PanelAgentSlotVoid                *slot);
712
713     /**
714      * @brief Signal: Get the list of keyboard ise name.
715      *
716      * slot prototype: bool get_keyboard_ise_list (std::vector<String> &);
717      */
718     Connection signal_connect_get_keyboard_ise_list      (PanelAgentSlotBoolStringVector    *slot);
719
720     /**
721      * @brief Signal: Set candidate ui.
722      *
723      * slot prototype: void set_candidate_ui (int style, int mode);
724      */
725     Connection signal_connect_set_candidate_ui           (PanelAgentSlotIntInt              *slot);
726
727     /**
728      * @brief Signal: Get candidate ui.
729      *
730      * slot prototype: void get_candidate_ui (int &style, int &mode);
731      */
732     Connection signal_connect_get_candidate_ui           (PanelAgentSlotIntInt2             *slot);
733
734     /**
735      * @brief Signal: Get candidate window geometry information.
736      *
737      * slot prototype: void get_candidate_geometry (rectinfo &info);
738      */
739     Connection signal_connect_get_candidate_geometry     (PanelAgentSlotRect                *slot);
740
741     /**
742      * @brief Signal: Get input panel geometry information.
743      *
744      * slot prototype: void get_input_panel_geometry (rectinfo &info);
745      */
746     Connection signal_connect_get_input_panel_geometry   (PanelAgentSlotRect                *slot);
747
748     /**
749      * @brief Signal: Set candidate position.
750      *
751      * slot prototype: void set_candidate_position (int left, int top);
752      */
753     Connection signal_connect_set_candidate_position     (PanelAgentSlotIntInt              *slot);
754
755     /**
756      * @brief Signal: Set keyboard ise.
757      *
758      * slot prototype: void set_keyboard_ise (int type, const String &ise);
759      */
760     Connection signal_connect_set_keyboard_ise           (PanelAgentSlotIntString           *slot);
761
762     /**
763      * @brief Signal: Get keyboard ise.
764      *
765      * slot prototype: void get_keyboard_ise (String &ise_name);
766      */
767     Connection signal_connect_get_keyboard_ise           (PanelAgentSlotString2             *slot);
768     /**
769      * @brief Signal: Update ise geometry.
770      *
771      * slot prototype: void update_ise_geometry (int x, int y, int width, int height);
772      */
773     Connection signal_connect_update_ise_geometry        (PanelAgentSlotIntIntIntInt        *slot);
774
775     /**
776      * @brief Signal: Show help.
777      *
778      * slot prototype: void show_help (const String &help);
779      */
780     Connection signal_connect_show_help                  (PanelAgentSlotString              *slot);
781
782     /**
783      * @brief Signal: Show factory menu.
784      *
785      * slot prototype: void show_factory_menu (const std::vector <PanelFactoryInfo> &menu);
786      */
787     Connection signal_connect_show_factory_menu          (PanelAgentSlotFactoryInfoVector   *slot);
788
789     /**
790      * @brief Signal: Show preedit string.
791      *
792      * slot prototype: void show_preedit_string (void):
793      */
794     Connection signal_connect_show_preedit_string        (PanelAgentSlotVoid                *slot);
795
796     /**
797      * @brief Signal: Show aux string.
798      *
799      * slot prototype: void show_aux_string (void):
800      */
801     Connection signal_connect_show_aux_string            (PanelAgentSlotVoid                *slot);
802
803     /**
804      * @brief Signal: Show lookup table.
805      *
806      * slot prototype: void show_lookup_table (void):
807      */
808     Connection signal_connect_show_lookup_table          (PanelAgentSlotVoid                *slot);
809
810     /**
811      * @brief Signal: Show associate table.
812      *
813      * slot prototype: void show_associate_table (void):
814      */
815     Connection signal_connect_show_associate_table       (PanelAgentSlotVoid                *slot);
816
817     /**
818      * @brief Signal: Hide preedit string.
819      *
820      * slot prototype: void hide_preedit_string (void);
821      */
822     Connection signal_connect_hide_preedit_string        (PanelAgentSlotVoid                *slot);
823
824     /**
825      * @brief Signal: Hide aux string.
826      *
827      * slot prototype: void hide_aux_string (void);
828      */
829     Connection signal_connect_hide_aux_string            (PanelAgentSlotVoid                *slot);
830
831     /**
832      * @brief Signal: Hide lookup table.
833      *
834      * slot prototype: void hide_lookup_table (void);
835      */
836     Connection signal_connect_hide_lookup_table          (PanelAgentSlotVoid                *slot);
837
838     /**
839      * @brief Signal: Hide associate table.
840      *
841      * slot prototype: void hide_associate_table (void);
842      */
843     Connection signal_connect_hide_associate_table       (PanelAgentSlotVoid                *slot);
844
845     /**
846      * @brief Signal: Update preedit string.
847      *
848      * slot prototype: void update_preedit_string (const String &str, const AttributeList &attrs);
849      * - str   -- The UTF-8 encoded string to be displayed in preedit area.
850      * - attrs -- The attributes of the string.
851      */
852     Connection signal_connect_update_preedit_string      (PanelAgentSlotAttributeString     *slot);
853
854     /**
855      * @brief Signal: Update preedit caret.
856      *
857      * slot prototype: void update_preedit_caret (int caret);
858      */
859     Connection signal_connect_update_preedit_caret       (PanelAgentSlotInt                 *slot);
860
861     /**
862      * @brief Signal: Update aux string.
863      *
864      * slot prototype: void update_aux_string (const String &str, const AttributeList &attrs);
865      * - str   -- The UTF-8 encoded string to be displayed in aux area.
866      * - attrs -- The attributes of the string.
867      */
868     Connection signal_connect_update_aux_string          (PanelAgentSlotAttributeString     *slot);
869
870     /**
871      * @brief Signal: Update lookup table.
872      *
873      * slot prototype: void update_lookup_table (const LookupTable &table);
874      * - table -- The new LookupTable object.
875      */
876     Connection signal_connect_update_lookup_table        (PanelAgentSlotLookupTable         *slot);
877
878     /**
879      * @brief Signal: Update associate table.
880      *
881      * slot prototype: void update_associate_table (const LookupTable &table);
882      * - table -- The new LookupTable object.
883      */
884     Connection signal_connect_update_associate_table     (PanelAgentSlotLookupTable         *slot);
885
886     /**
887      * @brief Signal: Register properties.
888      *
889      * Register properties of the focused instance.
890      *
891      * slot prototype: void register_properties (const PropertyList &props);
892      * - props -- The properties to be registered.
893      */
894     Connection signal_connect_register_properties        (PanelAgentSlotPropertyList        *slot);
895
896     /**
897      * @brief Signal: Update property.
898      *
899      * Update a property of the focused instance.
900      *
901      * slot prototype: void update_property (const Property &prop);
902      * - prop -- The property to be updated.
903      */
904     Connection signal_connect_update_property            (PanelAgentSlotProperty            *slot);
905
906     /**
907      * @brief Signal: Register properties of a helper.
908      *
909      * slot prototype: void register_helper_properties (int id, const PropertyList &props);
910      * - id    -- The client id of the helper object.
911      * - props -- The properties to be registered.
912      */
913     Connection signal_connect_register_helper_properties (PanelAgentSlotIntPropertyList     *slot);
914
915     /**
916      * @brief Signal: Update helper property.
917      *
918      * slot prototype: void update_helper_property (int id, const Property &prop);
919      * - id   -- The client id of the helper object.
920      * - prop -- The property to be updated.
921      */
922     Connection signal_connect_update_helper_property     (PanelAgentSlotIntProperty         *slot);
923
924     /**
925      * @brief Signal: Register a helper object.
926      *
927      * A newly started helper object will send this event to Panel.
928      *
929      * slot prototype: register_helper (int id, const HelperInfo &helper);
930      * - id     -- The client id of the helper object.
931      * - helper -- The information of the helper object.
932      */
933     Connection signal_connect_register_helper            (PanelAgentSlotIntHelperInfo       *slot);
934
935     /**
936      * @brief Signal: Remove a helper object.
937      *
938      * If a running helper close its connection to Panel, then this signal will be triggered to
939      * tell Panel to remove all data associated to this helper.
940      *
941      * slot prototype: void remove_helper (int id);
942      * - id -- The client id of the helper object to be removed.
943      */
944     Connection signal_connect_remove_helper              (PanelAgentSlotInt                 *slot);
945
946     /**
947      * @brief Signal: Start an ise with the speficied uuid
948      *
949      * slot prototype: void set_active_ise_by_uuid (const String& uuid);
950      * - uuid -- the uuid of the ise object
951      */
952     Connection signal_connect_set_active_ise_by_uuid     (PanelAgentSlotStringBool          *slot);
953
954     /**
955      * @brief Signal: Start an ise with the speficied name
956      *
957      * slot prototype: void set_active_ise_by_name (const String& name);
958      * - name -- the name of the ise object
959      */
960     Connection signal_connect_set_active_ise_by_name     (PanelAgentSlotString              *slot);
961
962     /**
963      * @brief Signal: Focus in panel.
964      *
965      * slot prototype: void focus_in (void);
966      */
967     Connection signal_connect_focus_in                   (PanelAgentSlotVoid                *slot);
968
969     /**
970      * @brief Signal: Focus out panel.
971      *
972      * slot prototype: void focus_out (void);
973      */
974     Connection signal_connect_focus_out                  (PanelAgentSlotVoid                *slot);
975
976     /**
977      * @brief Signal: Expand candidate panel.
978      *
979      * slot prototype: void expand_candidate (void);
980      */
981     Connection signal_connect_expand_candidate           (PanelAgentSlotVoid                *slot);
982
983     /**
984      * @brief Signal: Contract candidate panel.
985      *
986      * slot prototype: void contract_candidate (void);
987      */
988     Connection signal_connect_contract_candidate         (PanelAgentSlotVoid                *slot);
989
990     /**
991      * @brief Signal: Get the list of ise name.
992      *
993      * slot prototype: bool get_ise_list (std::vector<String> &);
994      */
995     Connection signal_connect_get_ise_list               (PanelAgentSlotBoolStringVector    *slot);
996
997     /**
998      * @brief Signal: Get the list of selected language name.
999      *
1000      * slot prototype: void get_language_list (std::vector<String> &);
1001      */
1002     Connection signal_connect_get_language_list          (PanelAgentSlotStringVector        *slot);
1003
1004     /**
1005      * @brief Signal: Get the all languages name.
1006      *
1007      * slot prototype: void get_all_language (std::vector<String> &);
1008      */
1009     Connection signal_connect_get_all_language           (PanelAgentSlotStringVector        *slot);
1010     /**
1011      * @brief Signal: Get the language list of a specified ise.
1012      *
1013      * slot prototype: void get_ise_language (char *, std::vector<String> &);
1014      */
1015     Connection signal_connect_get_ise_language           (PanelAgentSlotStrStringVector     *slot);
1016
1017     /**
1018      * @brief Signal: Set the isf language.
1019      *
1020      * slot prototype: void get_ise_language (char *, std::vector<String> &);
1021      */
1022     Connection signal_connect_set_isf_language           (PanelAgentSlotString              *slot);
1023
1024     /**
1025      * @brief Signal: Get the ise information by uuid.
1026      *
1027      * slot prototype: bool get_ise_info_by_uuid (const String &, ISE_INFO &);
1028      */
1029     Connection signal_connect_get_ise_info_by_uuid       (PanelAgentSlotStringISEINFO       *slot);
1030
1031     /**
1032      * @brief Signal: Get the ise information by name.
1033      *
1034      * slot prototype: bool get_ise_info_by_name (const String &, ISE_INFO &);
1035      */
1036     Connection signal_connect_get_ise_info_by_name       (PanelAgentSlotStringISEINFO       *slot);
1037
1038     /**
1039      * @brief Signal: send key event in panel.
1040      *
1041      * slot prototype: void send_key_event (const KeyEvent &);
1042      */
1043     Connection signal_connect_send_key_event             (PanelAgentSlotKeyEvent            *slot);
1044
1045     /**
1046      * @brief Signal: A transaction is started.
1047      *
1048      * This signal infers that the Panel should disable update before this transaction finishes.
1049      *
1050      * slot prototype: void signal_connect_transaction_start (void);
1051      */
1052     Connection signal_connect_transaction_start          (PanelAgentSlotVoid                *slot);
1053
1054     /**
1055      * @brief Signal: Accept connection for this PanelAgent.
1056      *
1057      * slot prototype: void accept_connection (int fd);
1058      * - fd -- the file description for connection
1059      */
1060     Connection signal_connect_accept_connection          (PanelAgentSlotInt                 *slot);
1061
1062     /**
1063      * @brief Signal: Close connection for this PanelAgent.
1064      *
1065      * slot prototype: void close_connection (int fd);
1066      * - fd -- the file description for connection
1067      */
1068     Connection signal_connect_close_connection           (PanelAgentSlotInt                 *slot);
1069
1070     /**
1071      * @brief Signal: Exit application for this PanelAgent.
1072      *
1073      * slot prototype: void app_exit (void);
1074      */
1075     Connection signal_connect_exit                       (PanelAgentSlotVoid                *slot);
1076
1077     /**
1078      * @brief Signal: A transaction is finished.
1079      *
1080      * This signal will get emitted when a transaction is finished. This implys to re-enable
1081      * panel GUI update
1082      *
1083      * slot prototype: void signal_connect_transaction_end (void);
1084      */
1085     Connection signal_connect_transaction_end            (PanelAgentSlotVoid                *slot);
1086
1087     /**
1088      * @brief Signal: Lock the exclusive lock for this PanelAgent.
1089      *
1090      * The panel program should provide a thread lock and hook a slot into this signal to lock it.
1091      * PanelAgent will use this lock to ensure the data integrity.
1092      *
1093      * slot prototype: void lock (void);
1094      */
1095     Connection signal_connect_lock                       (PanelAgentSlotVoid                *slot);
1096
1097     /**
1098      * @brief Signal: Unlock the exclusive lock for this PanelAgent.
1099      *
1100      * slot prototype: void unlock (void);
1101      */
1102     Connection signal_connect_unlock                     (PanelAgentSlotVoid                *slot);
1103
1104     /**
1105      * @brief Signal: The input context of ISE is changed.
1106      *
1107      * slot prototype: void update_input_context (int type, int value);
1108      */
1109     Connection signal_connect_update_input_context       (PanelAgentSlotIntInt              *slot);
1110 };
1111
1112 /**  @} */
1113
1114 } /* namespace scim */
1115
1116 #endif /* __SCIM_PANEL_AGENT_H */
1117
1118 /*
1119 vi:ts=4:nowrap:ai:expandtab
1120 */
1121