847e0ace1b30114aa5fa3effa73f8336c2734aa1
[profile/ivi/isf.git] / ism / src / scim_helper.h
1 /**
2  * @file scim_helper.h
3  * @brief Defines scim::HelperAgent and it's related types.
4  *
5  * scim::HelperAgent is a class used to write Client Helper modules.
6  *
7  */
8
9 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
10
11 /*
12  * Smart Common Input Method
13  *
14  * Copyright (c) 2004-2005 James Su <suzhe@tsinghua.org.cn>
15  *
16  *
17  * This library is free software; you can redistribute it and/or
18  * modify it under the terms of the GNU Lesser General Public
19  * License as published by the Free Software Foundation; either
20  * version 2 of the License, or (at your option) any later version.
21  *
22  * This library is distributed in the hope that it will be useful,
23  * but WITHOUT ANY WARRANTY; without even the implied warranty of
24  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
25  * GNU Lesser General Public License for more details.
26  *
27  * You should have received a copy of the GNU Lesser General Public
28  * License along with this program; if not, write to the
29  * Free Software Foundation, Inc., 59 Temple Place, Suite 330,
30  * Boston, MA  02111-1307  USA
31  *
32  * $Id: scim_helper.h,v 1.16 2005/05/24 12:22:51 suzhe Exp $
33  */
34
35 #ifndef __SCIM_HELPER_H
36 #define __SCIM_HELPER_H
37
38 #include "scim_utility.h"
39
40 namespace scim {
41
42 /**
43  * @addtogroup Helper
44  * @ingroup InputServiceFramework
45  * The accessory classes to help develop and manage Client Helper objects.
46  * @{
47  */
48 class HelperError: public Exception
49 {
50 public:
51     HelperError (const String& what_arg)
52         : Exception (String("scim::Helper: ") + what_arg) { }
53 };
54
55 /**
56  * @brief Helper option indicates that it's a stand alone Helper.
57  *
58  * Stand alone Helper has no corresponding IMEngine Factory,
59  * Such Helper can not be started by IMEngine Factory.
60  * So Panel must provide a menu, or something else, which contains
61  * all stand alone Helper items, so that user can start them by
62  * clicking the items.
63  */
64 const uint32 SCIM_HELPER_STAND_ALONE             = 1;
65
66 /**
67  * @brief Helper option indicates that it must be started
68  * automatically when Panel starts.
69  *
70  * If Helper objects want to start itself as soon as
71  * the Panel starts, set this option.
72  */
73 const uint32 SCIM_HELPER_AUTO_START              = (1<<1);
74
75 /**
76  * @brief Helper option indicates that it should be restarted
77  * when it exits abnormally.
78  *
79  * This option should not be used with #SCIM_HELPER_STAND_ALONE.
80  */
81 const uint32 SCIM_HELPER_AUTO_RESTART            = (1<<2);
82
83 /**
84  * @brief Helper option indicates that it needs the screen update
85  * information.
86  *
87  * Helper object with this option will receive the UPDATE_SCREEN event
88  * when the screen of focused ic is changed.
89  */
90 const uint32 SCIM_HELPER_NEED_SCREEN_INFO        = (1<<3);
91
92 /**
93  * @brief Helper option indicates that it needs the spot location
94  * information.
95  *
96  * Helper object with this option will receive the SPOT_LOCATION_INFO event
97  * when the spot location of focused ic is changed.
98  */
99 const uint32 SCIM_HELPER_NEED_SPOT_LOCATION_INFO = (1<<4);
100
101 /**
102  * @brief ISE option indicates whether it should be full style
103  */
104 const uint32 ISM_ISE_FULL_STYLE                  = (1<<16);
105
106 /**
107  * @brief ISE option indicates whether it should be hidden in control panel.
108  */
109 const uint32 ISM_ISE_HIDE_IN_CONTROL_PANEL       = (1<<17);
110
111
112 /**
113  * @brief Structure to hold the information of a Helper object.
114  */
115 struct HelperInfo
116 {
117     String uuid;            /**< The UUID of this Helper object */
118     String name;            /**< The Name of this Helper object, UTF-8 encoding. */
119     String icon;            /**< The Icon file path of this Helper object. */
120     String description;     /**< The short description of this Helper object. */
121     uint32 option;          /**< The options of this Helper object. @sa #SCIM_HELPER_STAND_ALONE etc.*/
122
123     HelperInfo (const String &puuid = String (),
124                 const String &pname = String (),
125                 const String &picon = String (),
126                 const String &pdesc = String (),
127                 uint32 opt = 0)
128         : uuid (puuid),
129           name (pname),
130           icon (picon),
131           description (pdesc),
132           option (opt) {
133     }
134 };
135
136 enum HelperState
137 {
138     HELPER_SHOWED,
139     HELPER_HIDED,
140     HELPER_INVALID_STATE
141 };
142
143 class HelperAgent;
144
145 typedef Slot3<void, const HelperAgent *, int, const String &>
146         HelperAgentSlotVoid;
147
148 typedef Slot4<void, const HelperAgent *, int, const String &, const String &>
149         HelperAgentSlotString;
150
151 typedef Slot4<void, const HelperAgent *, int, const String &, const std::vector<String> &>
152         HelperAgentSlotStringVector;
153
154 typedef Slot5<void, const HelperAgent *, int, const String &, const String &, const String &>
155         HelperAgentSlotString2;
156
157 typedef Slot4<void, const HelperAgent *, int, const String &, int>
158         HelperAgentSlotInt;
159
160 typedef Slot5<void, const HelperAgent *, int, const String &, int, int>
161         HelperAgentSlotIntInt;
162
163 typedef Slot4<void, const HelperAgent *, int, const String &, const Transaction &>
164         HelperAgentSlotTransaction;
165
166 typedef Slot4<void, const HelperAgent *, int, const String &, const rectinfo &>
167         HelperAgentSlotRect;
168
169 typedef Slot2<void, const HelperAgent *, struct rectinfo &>
170         HelperAgentSlotSize;
171
172 typedef Slot2<void, const HelperAgent *, uint32 &>
173         HelperAgentSlotUintVoid;
174
175 typedef Slot3<void, const HelperAgent *, int, uint32 &>
176         HelperAgentSlotIntUint;
177
178 typedef Slot3 <void, const HelperAgent *, char *, size_t &>
179         HelperAgentSlotRawVoid;
180
181 typedef Slot3 <void, const HelperAgent *, char **, size_t &>
182         HelperAgentSlotGetRawVoid;
183
184 typedef Slot4 <void, const HelperAgent *, int, char *, size_t &>
185         HelperAgentSlotIntRawVoid;
186
187 typedef Slot3 <void, const HelperAgent *, int, char **>
188         HelperAgentSlotIntGetStringVoid;
189
190 typedef Slot2<void, const HelperAgent *, std::vector<uint32> &>
191         HelperAgentSlotUintVector;
192
193 /**
194  * @brief The accessory class to write a Helper object.
195  *
196  * This class implements all Socket Transaction protocol between
197  * Helper object and Panel.
198  */
199 class HelperAgent
200 {
201     class HelperAgentImpl;
202     HelperAgentImpl *m_impl;
203
204     HelperAgent (const HelperAgent &);
205     const HelperAgent & operator = (const HelperAgent &);
206
207 public:
208     HelperAgent  ();
209     ~HelperAgent ();
210
211     /**
212      * @brief Open socket connection to the Panel.
213      *
214      * Helper objects and Panel communicate with each other via the Socket
215      * created by Panel, just same as the Socket between FrontEnds and Panel.
216      *
217      * Helper object can select/poll on the connection id returned by this function
218      * to see if there are any data available to be read. If any data are available,
219      * Helper object should call HelperAgent::filter_event() to process the data.
220      *
221      * This method should be called after the necessary signal-slots are connected.
222      * If this Helper is started by an IMEngine Instance, then signal attach_input_context
223      * will be emitted during this call.
224      *
225      * Signal update_screen will be emitted during this call as well to set the startup
226      * screen of this Helper. The ic and ic_uuid parameters are invalid here.
227      *
228      * @param info The information of this Helper object.
229      * @param display The display which this Helper object should run on.
230      *
231      * @return The connection socket id. -1 means failed to create
232      *         the connection.
233      */
234     int  open_connection        (const HelperInfo   &info,
235                                  const String       &display);
236
237     /**
238      * @brief Close the socket connection to Panel.
239      */
240     void close_connection       ();
241
242     /**
243      * @brief Get the connection id previously returned by open_connection().
244      *
245      * @return the connection id
246      */
247     int  get_connection_number  () const;
248
249     /**
250      * @brief Check whether this HelperAgent has been connected to a Panel.
251      *
252      * Return true when it is connected to panel, otherwise return false.
253      */
254     bool is_connected           () const;
255
256     /**
257      * @brief Check if there are any events available to be processed.
258      *
259      * If it returns true then Helper object should call
260      * HelperAgent::filter_event() to process them.
261      *
262      * @return true if there are any events available.
263      */
264     bool has_pending_event      () const;
265
266     /**
267      * @brief Process the pending events.
268      *
269      * This function will emit the corresponding signals according
270      * to the events.
271      *
272      * @return false if the connection is broken, otherwise return true.
273      */
274     bool filter_event           ();
275
276     /**
277      * @brief Request SCIM to reload all configuration.
278      *
279      * This function should only by used by Setup Helper to request
280      * scim's reloading the configuration.
281      */
282     void reload_config          () const;
283
284     /**
285      * @brief Register some properties into Panel.
286      *
287      * This function send the request to Panel to register a list
288      * of Properties.
289      *
290      * @param properties The list of Properties to be registered into Panel.
291      *
292      * @sa scim::Property.
293      */
294     void register_properties    (const PropertyList &properties) const;
295
296     /**
297      * @brief Update a registered property.
298      *
299      * @param property The property to be updated.
300      */
301     void update_property        (const Property     &property) const;
302
303     /**
304      * @brief Send a set of events to an IMEngineInstance.
305      *
306      * All events should be put into a Transaction.
307      * And the events can only be received by one IMEngineInstance object.
308      *
309      * @param ic The handle of the Input Context to receive the events.
310      * @param ic_uuid The UUID of the Input Context.
311      * @param trans The Transaction object holds the events.
312      */
313     void send_imengine_event    (int                 ic,
314                                  const String       &ic_uuid,
315                                  const Transaction  &trans) const;
316
317     /**
318      * @brief Send a KeyEvent to an IMEngineInstance.
319      *
320      * @param ic The handle of the IMEngineInstance to receive the event.
321      *        -1 means the currently focused IMEngineInstance.
322      * @param ic_uuid The UUID of the IMEngineInstance. Empty means don't match.
323      * @param key The KeyEvent to be sent.
324      */
325     void send_key_event         (int                 ic,
326                                  const String       &ic_uuid,
327                                  const KeyEvent     &key) const;
328
329     /**
330      * @brief Forward a KeyEvent to client application directly.
331      *
332      * @param ic The handle of the client Input Context to receive the event.
333      *        -1 means the currently focused Input Context.
334      * @param ic_uuid The UUID of the IMEngine used by the Input Context.
335      *        Empty means don't match.
336      * @param key The KeyEvent to be forwarded.
337      */
338     void forward_key_event      (int                 ic,
339                                  const String       &ic_uuid,
340                                  const KeyEvent     &key) const;
341
342     /**
343      * @brief Commit a WideString to client application directly.
344      *
345      * @param ic The handle of the client Input Context to receive the WideString.
346      *        -1 means the currently focused Input Context.
347      * @param ic_uuid The UUID of the IMEngine used by the Input Context.
348      *        Empty means don't match.
349      * @param wstr The WideString to be committed.
350      */
351     void commit_string          (int                 ic,
352                                  const String       &ic_uuid,
353                                  const WideString   &wstr) const;
354
355     /**
356      * @brief Request to show preedit string.
357      *
358      * @param ic The handle of the client Input Context to receive the request.
359      *        -1 means the currently focused Input Context.
360      * @param ic_uuid The UUID of the IMEngine used by the Input Context.
361      *        Empty means don't match.
362      */
363     void show_preedit_string    (int                 ic,
364                                  const String       &ic_uuid) const;
365
366     /**
367      * @brief Request to show aux string.
368      */
369     void show_aux_string        (void) const;
370
371     /**
372      * @brief Request to show candidate string.
373      */
374     void show_candidate_string  (void) const;
375
376     /**
377      * @brief Request to show associate string.
378      */
379     void show_associate_string  (void) const;
380
381     /**
382      * @brief Request to hide preedit string.
383      *
384      * @param ic The handle of the client Input Context to receive the request.
385      *        -1 means the currently focused Input Context.
386      * @param ic_uuid The UUID of the IMEngine used by the Input Context.
387      *        Empty means don't match.
388      */
389     void hide_preedit_string    (int                 ic,
390                                  const String       &ic_uuid) const;
391
392     /**
393      * @brief Request to hide aux string.
394      */
395     void hide_aux_string        (void) const;
396
397     /**
398      * @brief Request to hide candidate string.
399      */
400     void hide_candidate_string  (void) const;
401
402     /**
403      * @brief Request to hide associate string.
404      */
405     void hide_associate_string  (void) const;
406
407     /**
408      * @brief Update a new WideString for preedit.
409      *
410      * @param ic The handle of the client Input Context to receive the WideString.
411      *        -1 means the currently focused Input Context.
412      * @param ic_uuid The UUID of the IMEngine used by the Input Context.
413      *        Empty means don't match.
414      * @param wstr The WideString to be updated.
415      * @param attrs The attribute list for preedit string.
416      */
417     void update_preedit_string  (int                 ic,
418                                  const String       &ic_uuid,
419                                  const WideString   &wstr,
420                                  const AttributeList &attrs) const;
421
422     /**
423      * @brief Update a new string for aux.
424      *
425      * @param str The string to be updated.
426      * @param attrs The attribute list for aux string.
427      */
428     void update_aux_string      (const String       &str,
429                                  const AttributeList &attrs) const;
430
431     /**
432      * @brief Request to update candidate.
433      *
434      * @param table The lookup table for candidate.
435      */
436     void update_candidate_string (const LookupTable &table) const;
437
438     /**
439      * @brief Request to update associate.
440      *
441      * @param table The lookup table for associate.
442      */
443     void update_associate_string (const LookupTable &table) const;
444
445     /**
446      * @ brief When the input context of ISE is changed,
447      *         ISE can call this function to notify application
448      *
449      * @param type  type of event.
450      * @param value value of event.
451      */
452     void update_input_context     (uint32                       type,
453                                    uint32                       value) const;
454
455     /**
456      * @ brief Request to get surrounding text.
457      *
458      * @param uuid The helper ISE UUID.
459      * @param maxlen_before The max length of before.
460      * @param maxlen_after The max length of after.
461      */
462     void get_surrounding_text     (const String                &uuid,
463                                    int                          maxlen_before,
464                                    int                          maxlen_after) const;
465
466     /**
467      * @ brief Request to delete surrounding text.
468      *
469      * @param offset The offset for cursor position.
470      * @param len The length for delete text.
471      */
472     void delete_surrounding_text  (int                          offset,
473                                    int                          len) const;
474
475     /**
476      * @ brief Set candidate position in screen.
477      *
478      * @param left The x position in screen.
479      * @param top The y position in screen.
480      */
481     void set_candidate_position   (int                          left,
482                                    int                          top) const;
483
484     /**
485      * @ brief Request to hide candidate window.
486      */
487     void candidate_hide           (void) const;
488
489     /**
490      * @ brief Request to get candidate window size and position.
491      *
492      * @param uuid The helper ISE UUID.
493      */
494     void get_candidate_window_geometry (const String           &uuid) const;
495
496     /**
497      * @ brief Set current keyboard ISE.
498      *
499      * @param uuid The keyboard ISE UUID.
500      */
501     void set_keyboard_ise_by_uuid (const String                &uuid) const;
502
503     /**
504      * @ brief Request to get current keyboard ISE information.
505      *
506      * @param uuid The helper ISE UUID.
507      */
508     void get_keyboard_ise         (const String                &uuid) const;
509
510     /**
511      * @ brief Request to get uuid list of all keyboard ISEs.
512      *
513      * @param uuid The helper ISE UUID.
514      */
515     void get_keyboard_ise_list    (const String                &uuid) const;
516
517 public:
518     /**
519      * @brief Connect a slot to Helper exit signal.
520      *
521      * This signal is used to let the Helper exit.
522      *
523      * The prototype of the slot is:
524      *
525      * void exit (const HelperAgent *agent, int ic, const String &ic_uuid);
526      *
527      * Parameters:
528      * - agent    The pointer to the HelperAgent object which emits this signal.
529      * - ic       An opaque handle of the currently focused input context.
530      * - ic_uuid  The UUID of the IMEngineInstance associated with the focused input context.
531      */
532     Connection signal_connect_exit                   (HelperAgentSlotVoid        *slot);
533
534     /**
535      * @brief Connect a slot to Helper attach input context signal.
536      *
537      * This signal is used to attach an input context to this helper.
538      *
539      * When an input context requst to start this helper, then this
540      * signal will be emitted as soon as the helper is started.
541      *
542      * When an input context want to start an already started helper,
543      * this signal will also be emitted.
544      *
545      * Helper can send some events back to the IMEngineInstance in this
546      * signal-slot, to inform that it has been started sccessfully.
547      *
548      * The prototype of the slot is:
549      *
550      * void attach_input_context (const HelperAgent *agent, int ic, const String &ic_uuid);
551      */
552     Connection signal_connect_attach_input_context   (HelperAgentSlotVoid        *slot);
553
554     /**
555      * @brief Connect a slot to Helper detach input context signal.
556      *
557      * This signal is used to detach an input context from this helper.
558      *
559      * When an input context requst to stop this helper, then this
560      * signal will be emitted.
561      *
562      * Helper shouldn't send any event back to the IMEngineInstance, because
563      * the IMEngineInstance attached to the ic should have been destroyed.
564      *
565      * The prototype of the slot is:
566      *
567      * void detach_input_context (const HelperAgent *agent, int ic, const String &ic_uuid);
568      */
569     Connection signal_connect_detach_input_context   (HelperAgentSlotVoid        *slot);
570
571     /**
572      * @brief Connect a slot to Helper reload config signal.
573      *
574      * This signal is used to let the Helper reload configuration.
575      *
576      * The prototype of the slot is:
577      *
578      * void reload_config (const HelperAgent *agent, int ic, const String &ic_uuid);
579      */
580     Connection signal_connect_reload_config          (HelperAgentSlotVoid        *slot);
581
582     /**
583      * @brief Connect a slot to Helper update screen signal.
584      *
585      * This signal is used to let the Helper move its GUI to another screen.
586      * It can only be emitted when SCIM_HELPER_NEED_SCREEN_INFO is set in HelperInfo.option.
587      *
588      * The prototype of the slot is:
589      *
590      * void update_screen (const HelperAgent *agent, int ic, const String &ic_uuid, int screen_number);
591      */
592     Connection signal_connect_update_screen          (HelperAgentSlotInt         *slot);
593
594     /**
595      * @brief Connect a slot to Helper update spot location signal.
596      *
597      * This signal is used to let the Helper move its GUI according to the current spot location.
598      * It can only be emitted when SCIM_HELPER_NEED_SPOT_LOCATION_INFO is set in HelperInfo.option.
599      *
600      * The prototype of the slot is:
601      * void update_spot_location (const HelperAgent *agent, int ic, const String &ic_uuid, int x, int y);
602      */
603     Connection signal_connect_update_spot_location   (HelperAgentSlotIntInt      *slot);
604
605     /**
606      * @brief Connect a slot to Helper update cursor position signal.
607      *
608      * This signal is used to let the Helper get the cursor position information.
609      *
610      * The prototype of the slot is:
611      * void update_cursor_position (const HelperAgent *agent, int ic, const String &ic_uuid, int cursor_pos);
612      */
613     Connection signal_connect_update_cursor_position (HelperAgentSlotInt         *slot);
614
615     /**
616      * @brief Connect a slot to Helper update surrounding text signal.
617      *
618      * This signal is used to let the Helper get the surrounding text.
619      *
620      * The prototype of the slot is:
621      * void update_surrounding_text (const HelperAgent *agent, int ic, const String &text, int cursor);
622      */
623     Connection signal_connect_update_surrounding_text (HelperAgentSlotInt        *slot);
624
625     /**
626      * @brief Connect a slot to Helper trigger property signal.
627      *
628      * This signal is used to trigger a property registered by this Helper.
629      * A property will be triggered when user clicks on it.
630      *
631      * The prototype of the slot is:
632      * void trigger_property (const HelperAgent *agent, int ic, const String &ic_uuid, const String &property);
633      */
634     Connection signal_connect_trigger_property       (HelperAgentSlotString      *slot);
635
636     /**
637      * @brief Connect a slot to Helper process imengine event signal.
638      *
639      * This signal is used to deliver the events sent from IMEngine to Helper.
640      *
641      * The prototype of the slot is:
642      * void process_imengine_event (const HelperAgent *agent, int ic, const String &ic_uuid, const Transaction &transaction);
643      */
644     Connection signal_connect_process_imengine_event (HelperAgentSlotTransaction *slot);
645
646     /**
647      * @brief Connect a slot to Helper focus out signal.
648      *
649      * This signal is used to do something when input context is focus out.
650      *
651      * The prototype of the slot is:
652      * void focus_out (const HelperAgent *agent, int ic, const String &ic_uuid);
653      */
654     Connection signal_connect_focus_out                         (HelperAgentSlotVoid                *slot);
655
656     /**
657      * @brief Connect a slot to Helper focus in signal.
658      *
659      * This signal is used to do something when input context is focus in.
660      *
661      * The prototype of the slot is:
662      * void focus_in (const HelperAgent *agent, int ic, const String &ic_uuid);
663      */
664     Connection signal_connect_focus_in                          (HelperAgentSlotVoid                *slot);
665
666     /**
667      * @brief Connect a slot to Helper show signal.
668      *
669      * This signal is used to show Helper ISE window.
670      *
671      * The prototype of the slot is:
672      * void ise_show (const HelperAgent *agent, int ic, char *buf, size_t &len);
673      */
674     Connection signal_connect_ise_show                          (HelperAgentSlotIntRawVoid          *slot);
675
676     /**
677      * @brief Connect a slot to Helper hide signal.
678      *
679      * This signal is used to hide Helper ISE window.
680      *
681      * The prototype of the slot is:
682      * void ise_hide (const HelperAgent *agent, int ic, const String &ic_uuid);
683      */
684     Connection signal_connect_ise_hide                          (HelperAgentSlotVoid                *slot);
685
686     /**
687      * @brief Connect a slot to Helper get ISE window geometry signal.
688      *
689      * This signal is used to get Helper ISE window size and position.
690      *
691      * The prototype of the slot is:
692      * void get_geometry (const HelperAgent *agent, struct rectinfo &info);
693      */
694     Connection signal_connect_get_geometry                      (HelperAgentSlotSize                *slot);
695
696     /**
697      * @brief Connect a slot to Helper set mode signal.
698      *
699      * This signal is used to set Helper ISE mode.
700      *
701      * The prototype of the slot is:
702      * void set_mode (const HelperAgent *agent, uint32 &mode);
703      */
704     Connection signal_connect_set_mode                          (HelperAgentSlotUintVoid            *slot);
705
706     /**
707      * @brief Connect a slot to Helper set language signal.
708      *
709      * This signal is used to set Helper ISE language.
710      *
711      * The prototype of the slot is:
712      * void set_language (const HelperAgent *agent, uint32 &language);
713      */
714     Connection signal_connect_set_language                      (HelperAgentSlotUintVoid            *slot);
715
716     /**
717      * @brief Connect a slot to Helper set im data signal.
718      *
719      * This signal is used to send im data to Helper ISE.
720      *
721      * The prototype of the slot is:
722      * void set_imdata (const HelperAgent *agent, char *buf, size_t &len);
723      */
724     Connection signal_connect_set_imdata                        (HelperAgentSlotRawVoid             *slot);
725
726     /**
727      * @brief Connect a slot to Helper get im data signal.
728      *
729      * This signal is used to get im data from Helper ISE.
730      *
731      * The prototype of the slot is:
732      * void get_imdata (const HelperAgent *, char **buf, size_t &len);
733      */
734     Connection signal_connect_get_imdata                        (HelperAgentSlotGetRawVoid          *slot);
735
736     /**
737      * @brief Connect a slot to Helper get language locale.
738      *
739      * This signal is used to get language locale from Helper ISE.
740      *
741      * The prototype of the slot is:
742      * void get_language_locale (const HelperAgent *, int ic, char **locale);
743      */
744     Connection signal_connect_get_language_locale               (HelperAgentSlotIntGetStringVoid    *slot);
745
746     /**
747      * @brief Connect a slot to Helper set return key type signal.
748      *
749      * This signal is used to set return key type to Helper ISE.
750      *
751      * The prototype of the slot is:
752      * void set_return_key_type (const HelperAgent *agent, uint32 &type);
753      */
754     Connection signal_connect_set_return_key_type               (HelperAgentSlotUintVoid            *slot);
755
756     /**
757      * @brief Connect a slot to Helper get return key type signal.
758      *
759      * This signal is used to get return key type from Helper ISE.
760      *
761      * The prototype of the slot is:
762      * void get_return_key_type (const HelperAgent *agent, uint32 &type);
763      */
764     Connection signal_connect_get_return_key_type               (HelperAgentSlotUintVoid            *slot);
765
766     /**
767      * @brief Connect a slot to Helper set return key disable signal.
768      *
769      * This signal is used to set return key disable to Helper ISE.
770      *
771      * The prototype of the slot is:
772      * void set_return_key_disable (const HelperAgent *agent, uint32 &disabled);
773      */
774     Connection signal_connect_set_return_key_disable            (HelperAgentSlotUintVoid            *slot);
775
776     /**
777      * @brief Connect a slot to Helper get return key disable signal.
778      *
779      * This signal is used to get return key disable from Helper ISE.
780      *
781      * The prototype of the slot is:
782      * void get_return_key_disable (const HelperAgent *agent, uint32 &disabled);
783      */
784     Connection signal_connect_get_return_key_disable            (HelperAgentSlotUintVoid            *slot);
785
786     /**
787      * @brief Connect a slot to Helper get layout signal.
788      *
789      * This signal is used to get Helper ISE layout.
790      *
791      * The prototype of the slot is:
792      * void get_layout (const HelperAgent *agent, uint32 &layout);
793      */
794     Connection signal_connect_get_layout                        (HelperAgentSlotUintVoid            *slot);
795
796     /**
797      * @brief Connect a slot to Helper set layout signal.
798      *
799      * This signal is used to set Helper ISE layout.
800      *
801      * The prototype of the slot is:
802      * void set_layout (const HelperAgent *agent, uint32 &layout);
803      */
804     Connection signal_connect_set_layout                        (HelperAgentSlotUintVoid            *slot);
805
806     /**
807      * @brief Connect a slot to Helper set shift mode signal.
808      *
809      * This signal is used to set Helper shift mode.
810      *
811      * The prototype of the slot is:
812      * void set_caps_mode (const HelperAgent *agent, uint32 &mode);
813      */
814     Connection signal_connect_set_caps_mode               (HelperAgentSlotUintVoid            *slot);
815
816     /**
817      * @brief Connect a slot to Helper reset input context signal.
818      *
819      * This signal is used to reset Helper ISE input context.
820      *
821      * The prototype of the slot is:
822      * void reset_input_context (const HelperAgent *agent, int ic, const String &uuid);
823      */
824     Connection signal_connect_reset_input_context               (HelperAgentSlotVoid                *slot);
825
826     /**
827      * @brief Connect a slot to Helper update candidate window geometry signal.
828      *
829      * This signal is used to get candidate window size and position.
830      *
831      * The prototype of the slot is:
832      * void update_candidate_geometry (const HelperAgent *agent, int ic, const String &uuid, const rectinfo &info);
833      */
834     Connection signal_connect_update_candidate_geometry         (HelperAgentSlotRect                *slot);
835
836     /**
837      * @brief Connect a slot to Helper update keyboard ISE signal.
838      *
839      * This signal is used to get current keyboard ISE name and uuid.
840      *
841      * The prototype of the slot is:
842      * void update_keyboard_ise (const HelperAgent *agent, int ic, const String &uuid,
843      *                           const String &ise_name, const String &ise_uuid);
844      */
845     Connection signal_connect_update_keyboard_ise               (HelperAgentSlotString2             *slot);
846
847     /**
848      * @brief Connect a slot to Helper update keyboard ISE list signal.
849      *
850      * This signal is used to get uuid list of all keyboard ISEs.
851      *
852      * The prototype of the slot is:
853      * void update_keyboard_ise_list (const HelperAgent *agent, int ic, const String &uuid,
854      *                                const std::vector<String> &ise_list);
855      */
856     Connection signal_connect_update_keyboard_ise_list          (HelperAgentSlotStringVector        *slot);
857
858     /**
859      * @brief Connect a slot to Helper candidate more window show signal.
860      *
861      * This signal is used to do someting when candidate more window is showed.
862      *
863      * The prototype of the slot is:
864      * void candidate_more_window_show (const HelperAgent *agent, int ic, const String &uuid);
865      */
866     Connection signal_connect_candidate_more_window_show        (HelperAgentSlotVoid                *slot);
867
868     /**
869      * @brief Connect a slot to Helper candidate more window hide signal.
870      *
871      * This signal is used to do someting when candidate more window is hidden.
872      *
873      * The prototype of the slot is:
874      * void candidate_more_window_hide (const HelperAgent *agent, int ic, const String &uuid);
875      */
876     Connection signal_connect_candidate_more_window_hide        (HelperAgentSlotVoid                *slot);
877
878     /**
879      * @brief Connect a slot to Helper select aux signal.
880      *
881      * This signal is used to do something when aux is selected.
882      *
883      * The prototype of the slot is:
884      * void select_aux (const HelperAgent *agent, int ic, const String &uuid, int index);
885      */
886     Connection signal_connect_select_aux                        (HelperAgentSlotInt                 *slot);
887
888     /**
889      * @brief Connect a slot to Helper select candidate signal.
890      *
891      * This signal is used to do something when candidate is selected.
892      *
893      * The prototype of the slot is:
894      * void select_candidate (const HelperAgent *agent, int ic, const String &uuid, int index);
895      */
896     Connection signal_connect_select_candidate                  (HelperAgentSlotInt                 *slot);
897
898     /**
899      * @brief Connect a slot to Helper candidate table page up signal.
900      *
901      * This signal is used to do something when candidate table is paged up.
902      *
903      * The prototype of the slot is:
904      * void candidate_table_page_up (const HelperAgent *agent, int ic, const String &uuid);
905      */
906     Connection signal_connect_candidate_table_page_up           (HelperAgentSlotVoid                *slot);
907
908     /**
909      * @brief Connect a slot to Helper candidate table page down signal.
910      *
911      * This signal is used to do something when candidate table is paged down.
912      *
913      * The prototype of the slot is:
914      * void candidate_table_page_down (const HelperAgent *agent, int ic, const String &uuid);
915      */
916     Connection signal_connect_candidate_table_page_down         (HelperAgentSlotVoid                *slot);
917
918     /**
919      * @brief Connect a slot to Helper update candidate table page size signal.
920      *
921      * This signal is used to do something when candidate table page size is changed.
922      *
923      * The prototype of the slot is:
924      * void update_candidate_table_page_size (const HelperAgent *, int ic, const String &uuid, int page_size);
925      */
926     Connection signal_connect_update_candidate_table_page_size  (HelperAgentSlotInt                 *slot);
927
928     /**
929      * @brief Connect a slot to Helper select associate signal.
930      *
931      * This signal is used to do something when associate is selected.
932      *
933      * The prototype of the slot is:
934      * void select_associate (const HelperAgent *agent, int ic, const String &uuid, int index);
935      */
936     Connection signal_connect_select_associate                  (HelperAgentSlotInt                 *slot);
937
938     /**
939      * @brief Connect a slot to Helper associate table page up signal.
940      *
941      * This signal is used to do something when associate table is paged up.
942      *
943      * The prototype of the slot is:
944      * void associate_table_page_up (const HelperAgent *agent, int ic, const String &uuid);
945      */
946     Connection signal_connect_associate_table_page_up           (HelperAgentSlotVoid                *slot);
947
948     /**
949      * @brief Connect a slot to Helper associate table page down signal.
950      *
951      * This signal is used to do something when associate table is paged down.
952      *
953      * The prototype of the slot is:
954      * void associate_table_page_down (const HelperAgent *agent, int ic, const String &uuid);
955      */
956     Connection signal_connect_associate_table_page_down         (HelperAgentSlotVoid                *slot);
957
958     /**
959      * @brief Connect a slot to Helper update associate table page size signal.
960      *
961      * This signal is used to do something when associate table page size is changed.
962      *
963      * The prototype of the slot is:
964      * void update_associate_table_page_size (const HelperAgent *, int ic, const String &uuid, int page_size);
965      */
966     Connection signal_connect_update_associate_table_page_size  (HelperAgentSlotInt                 *slot);
967
968     /**
969      * @brief Connect a slot to Helper turn on log signal.
970      *
971      * This signal is used to turn on Helper ISE debug information.
972      *
973      * The prototype of the slot is:
974      * void turn_on_log (const HelperAgent *agent, uint32 &on);
975      */
976     Connection signal_connect_turn_on_log                              (HelperAgentSlotUintVoid     *slot);
977 };
978
979 /**  @} */
980
981 } /* namespace scim */
982
983 struct ArgInfo
984 {
985     char **argv;
986     int    argc;
987 };
988
989 #endif /* __SCIM_HELPER_H */
990
991 /*
992 vi:ts=4:nowrap:ai:expandtab
993 */
994