Git init
[framework/uifw/isf.git] / ism / src / scim_trans_commands.h
1 /**
2  * @file scim_trans_commands.h
3  * @brief Transaction commands.
4  */
5
6 /* ISF is based on SCIM 1.4.7 and extended for supporting more mobile fitable. */
7
8 /*
9  * Smart Common Input Method
10  *
11  * Copyright (c) 2002-2005 James Su <suzhe@tsinghua.org.cn>
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  * $Id: scim_trans_commands.h,v 1.9 2005/06/26 16:35:33 suzhe Exp $
30  */
31
32 #ifndef __SCIM_TRANS_COMMANDS_H
33 #define __SCIM_TRANS_COMMANDS_H
34
35 namespace scim {
36
37 /**
38  * @brief Transaction command types used by Socket Frontend/IMEngine/Config, Helper and Panel.
39  *
40  * This commands are used in communication protocols of SocketFrontEnd, SocketIMEngine, SocketConfig, Helper and Panel.
41  *
42  * There are mainly four major protocols used in the communications among each part of SCIM:
43  * - between SocketFrontEnd and SocketIMEngine (SocketFrontEnd is server)
44  * - between SocketFrontEnd and SocketConfig (SocketFrontEnd is server)
45  * - between Panel and FrontEnds (eg. X11 FrontEnd, Gtk IMModule and QT IMModule. Panel is server)
46  * - between Panel and Helper (Panel is server).
47  *
48  * As soon as the socket to the server is established, the client must call function
49  * scim_socket_open_connection() to create the connection and get the magic key for later communication.
50  *
51  * At the same time, the server must call function scim_socket_accept_connection() to
52  * accept the connection and get the same magic key for later client verification.
53  *
54  * The valid types of servers are:
55  * - "SocketFrontEnd"\n
56  *   The socket FrontEnd server provides remote IMEngine and Config services.
57  *   It accepts "SocketIMEngine" and "SocketConfig" clients.
58  * - "Panel"\n
59  *   The Panel server provides GUI and Helper management services.
60  *   It accepts "FrontEnd" and "Helper" clients.
61  *
62  * The valid types of clients are:
63  * - "SocketIMEngine"\n
64  *   The socket IMEngine client acts as a proxy IMEngine forwarding all requests to SocketFrontEnd.
65  *   It can only connect to "SocketFrontEnd" server.
66  * - "SocketConfig"\n
67  *   The socket Config client acts as a proxy Config forwarding all request  to SocketFrontEnd.
68  *   It can only connect to "SocketFrontEnd" server.
69  * - "FrontEnd"\n
70  *   If a FrontEnd needs a Panel GUI services, it'll be a "FrontEnd" client of the Panel.
71  *   It can only connect to "Panel" server.
72  * - "Helper"\n
73  *   All Helper objects should be "Helper" clients of a Panel.
74  *   It can only connect to "Panel" server.
75  *
76  * Then the client and the server can communicate with each other via the socket by sending transactions.
77  *
78  * Multiple commands and their data may be put into one transaction with a restricted order.
79  * The data of a command must be put into the transaction just follow the command itself.
80  *
81  * A transaction sent from a socket client to a socket server (eg. SocketIMEngine to SocketFrontEnd)
82  * must be started with a SCIM_TRANS_CMD_REQUEST command followed by an uint32 magic key of the client
83  * (returned by scim_socket_open_connection() function.
84  *
85  * A transaction sent back to a socket client from a socket server must be started with a
86  * SCIM_TRANS_CMD_REPLY command.
87  *
88  * So for example, the layout of a transaction sent from SocketIMEngine to SocketFrontEnd may look like:
89  * - #SCIM_TRANS_CMD_REQUEST
90  * - an uint32 data (the magic key of a client)
91  * - #SCIM_TRANS_CMD_PROCESS_KEY_EVENT
92  * - an uint32 data (the id of the IMEngineInstance object used to process the KeyEvent)
93  * - a scim::KeyEvent data (the KeyEvent to be processed)
94  *
95  * Some commands may be used in more than one protocols for similar purpose, but they may have different
96  * data in different protocol.
97  *
98  * <b>Brief introduction of communication protocols used in SCIM:</b>
99  *
100  * Please refer to the descriptions of each Transaction commands for details.
101  *
102  * -# <b>Protocol used between SocketIMEngine and SocketFrontEnd</b>\n
103  *   In this protocol, SocketFrontEnd is socket server, SocketIMEngine is client.
104  *   - <b>from SocketIMEngine to SocketFrontEnd:</b>\n
105  *     The Transaction sent from SocketIMEngine to SocketFrontEnd must
106  *     start with #SCIM_TRANS_CMD_REQUEST and followed by an uint32 magic
107  *     key which was returned by scim_socket_open_connection() and
108  *     scim_socket_accept_connection().\n
109  *     Before parsing the Transaction,
110  *     SocketFrontEnd must verify if the magic key is matched.
111  *     If the magic key is not matched, then SocketFrontEnd should just
112  *     discard this transaction.\n
113  *     There can be one or more commands and corresponding data right after the
114  *     magic key.\n
115  *     The valid commands which can be used here are:
116  *     - #SCIM_TRANS_CMD_NEW_INSTANCE
117  *     - #SCIM_TRANS_CMD_DELETE_INSTANCE
118  *     - #SCIM_TRANS_CMD_DELETE_ALL_INSTANCES
119  *     - #SCIM_TRANS_CMD_GET_FACTORY_LIST
120  *     - #SCIM_TRANS_CMD_GET_FACTORY_NAME
121  *     - #SCIM_TRANS_CMD_GET_FACTORY_AUTHORS
122  *     - #SCIM_TRANS_CMD_GET_FACTORY_CREDITS
123  *     - #SCIM_TRANS_CMD_GET_FACTORY_HELP
124  *     - #SCIM_TRANS_CMD_GET_FACTORY_LOCALES
125  *     - #SCIM_TRANS_CMD_GET_FACTORY_ICON_FILE
126  *     - #SCIM_TRANS_CMD_GET_FACTORY_LANGUAGE
127  *     - #SCIM_TRANS_CMD_PROCESS_KEY_EVENT
128  *     - #SCIM_TRANS_CMD_MOVE_PREEDIT_CARET
129  *     - #SCIM_TRANS_CMD_SELECT_CANDIDATE
130  *     - #SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE_PAGE_SIZE
131  *     - #SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_UP
132  *     - #SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_DOWN
133  *     - #SCIM_TRANS_CMD_RESET
134  *     - #SCIM_TRANS_CMD_FOCUS_IN
135  *     - #SCIM_TRANS_CMD_FOCUS_OUT
136  *     - #SCIM_TRANS_CMD_TRIGGER_PROPERTY
137  *     - #SCIM_TRANS_CMD_PROCESS_HELPER_EVENT
138  *     - #SCIM_TRANS_CMD_UPDATE_CLIENT_CAPABILITIES
139  *     - #SCIM_TRANS_CMD_LOAD_FILE
140  *     - #SCIM_TRANS_CMD_CLOSE_CONNECTION
141  *   - <b>from SocketFrontEnd to SocketIMEngine:</b>\n
142  *     The Transaction sent back from SocketFrontEnd to SocketIMEngine must
143  *     start with #SCIM_TRANS_CMD_REPLY and end with #SCIM_TRANS_CMD_OK or
144  *     #SCIM_TRANS_CMD_FAIL to indicate if the request previously sent by
145  *     SocketIMEngine was executed successfully.\n
146  *     For some requests, like SCIM_TRANS_CMD_GET_FACTORY_LIST, etc.
147  *     only some result data will be returned between #SCIM_TRANS_CMD_REPLY and #SCIM_TRANS_CMD_OK.\n
148  *     For some requests, like SCIM_TRANS_CMD_PROCESS_KEY_EVENT, etc.
149  *     one or more following commands and corresponding data may be returned between
150  *     #SCIM_TRANS_CMD_REPLY and #SCIM_TRANS_CMD_OK commands.\n
151  *     The valid commands can be used here are:
152  *     - #SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
153  *     - #SCIM_TRANS_CMD_SHOW_AUX_STRING
154  *     - #SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
155  *     - #SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
156  *     - #SCIM_TRANS_CMD_HIDE_AUX_STRING
157  *     - #SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
158  *     - #SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
159  *     - #SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
160  *     - #SCIM_TRANS_CMD_UPDATE_AUX_STRING
161  *     - #SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
162  *     - #SCIM_TRANS_CMD_COMMIT_STRING
163  *     - #SCIM_TRANS_CMD_FORWARD_KEY_EVENT
164  *     - #SCIM_TRANS_CMD_REGISTER_PROPERTIES
165  *     - #SCIM_TRANS_CMD_UPDATE_PROPERTY
166  *     - #SCIM_TRANS_CMD_BEEP
167  *     - #SCIM_TRANS_CMD_START_HELPER
168  *     - #SCIM_TRANS_CMD_STOP_HELPER
169  *     - #SCIM_TRANS_CMD_SEND_HELPER_EVENT
170  * -# <b>Protocol used between SocketConfig and SocketFrontEnd</b>\n
171  *   In this protocol, SocketFrontEnd is socket server, SocketConfig is client.
172  *   - <b>from SocketConfig to SocketFrontEnd:</b>\n
173  *     The Transaction sent from SocketConfig to SocketFrontEnd must
174  *     start with #SCIM_TRANS_CMD_REQUEST and followed by an uint32 magic
175  *     key which was returned by scim_socket_open_connection() and
176  *     scim_socket_accept_connection().\n
177  *     Before parsing the Transaction,
178  *     SocketFrontEnd must verify if the magic key is matched.
179  *     If the magic key is not matched, then SocketFrontEnd should just
180  *     discard this transaction.\n
181  *     There can be one or more commands and corresponding data right after the
182  *     magic key.\n
183  *     The valid commands which can be used here are:
184  *     - #SCIM_TRANS_CMD_FLUSH_CONFIG
185  *     - #SCIM_TRANS_CMD_ERASE_CONFIG
186  *     - #SCIM_TRANS_CMD_GET_CONFIG_STRING
187  *     - #SCIM_TRANS_CMD_SET_CONFIG_STRING
188  *     - #SCIM_TRANS_CMD_GET_CONFIG_INT
189  *     - #SCIM_TRANS_CMD_SET_CONFIG_INT
190  *     - #SCIM_TRANS_CMD_GET_CONFIG_BOOL
191  *     - #SCIM_TRANS_CMD_SET_CONFIG_BOOL
192  *     - #SCIM_TRANS_CMD_GET_CONFIG_DOUBLE
193  *     - #SCIM_TRANS_CMD_SET_CONFIG_DOUBLE
194  *     - #SCIM_TRANS_CMD_GET_CONFIG_VECTOR_STRING
195  *     - #SCIM_TRANS_CMD_SET_CONFIG_VECTOR_STRING
196  *     - #SCIM_TRANS_CMD_GET_CONFIG_VECTOR_INT
197  *     - #SCIM_TRANS_CMD_SET_CONFIG_VECTOR_INT
198  *     - #SCIM_TRANS_CMD_RELOAD_CONFIG
199  *     - #SCIM_TRANS_CMD_LOAD_FILE
200  *     - #SCIM_TRANS_CMD_CLOSE_CONNECTION
201  *   - <b>from SocketFrontEnd to SocketConfig:</b>\n
202  *     The Transaction sent back from SocketFrontEnd to SocketConfig must
203  *     start with #SCIM_TRANS_CMD_REPLY and end with #SCIM_TRANS_CMD_OK or
204  *     #SCIM_TRANS_CMD_FAIL to indicate if the request previously sent by
205  *     SocketConfig was executed successfully.\n
206  *     For some requests, like SCIM_TRANS_CMD_FLUSH_CONFIG, etc.
207  *     no result data will be returned.\n
208  *     For some requests, like SCIM_TRANS_CMD_GET_CONFIG_STRING, etc.
209  *     the corresponding data will be returned between
210  *     #SCIM_TRANS_CMD_REPLY and #SCIM_TRANS_CMD_OK commands.\n
211  * -# <b>Protocol used between FrontEnds and Panel</b>\n
212  *   In this protocol, Panel (eg. scim-panel-gtk or scim-panel-kde) is socket server, FrontEnds are clients.
213  *   - <b>from FrontEnds to Panel:</b>\n
214  *     The Transaction sent from FrontEnds to Panel must
215  *     start with #SCIM_TRANS_CMD_REQUEST and followed by an uint32 magic
216  *     key which was returned by scim_socket_open_connection() and
217  *     scim_socket_accept_connection(). Then there must be an uint32 id
218  *     for current focused input context right after the magic key.\n
219  *     Before parsing the Transaction,
220  *     Panel must verify if the magic key is matched.
221  *     If the magic key is not matched, then Panel should just
222  *     discard this transaction.\n
223  *     There can be one or more commands and corresponding data right after the
224  *     magic key.\n
225  *     The valid commands which can be used here are:
226  *     - #SCIM_TRANS_CMD_UPDATE_SCREEN
227  *     - #SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
228  *     - #SCIM_TRANS_CMD_PANEL_TURN_ON
229  *     - #SCIM_TRANS_CMD_PANEL_TURN_OFF
230  *     - #SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO
231  *     - #SCIM_TRANS_CMD_PANEL_SHOW_HELP
232  *     - #SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU
233  *     - #SCIM_TRANS_CMD_SHOW_PREEDIT_STRING
234  *     - #SCIM_TRANS_CMD_SHOW_AUX_STRING
235  *     - #SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE
236  *     - #SCIM_TRANS_CMD_HIDE_PREEDIT_STRING
237  *     - #SCIM_TRANS_CMD_HIDE_AUX_STRING
238  *     - #SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE
239  *     - #SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET
240  *     - #SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING
241  *     - #SCIM_TRANS_CMD_UPDATE_AUX_STRING
242  *     - #SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE
243  *     - #SCIM_TRANS_CMD_REGISTER_PROPERTIES
244  *     - #SCIM_TRANS_CMD_UPDATE_PROPERTY
245  *     - #SCIM_TRANS_CMD_START_HELPER
246  *     - #SCIM_TRANS_CMD_STOP_HELPER
247  *     - #SCIM_TRANS_CMD_SEND_HELPER_EVENT
248  *   - <b>from Panel to FrontEnds:</b>\n
249  *     The Transaction sent from Panel to FrontEnds must
250  *     start with #SCIM_TRANS_CMD_REPLY.
251  *     For the following commands except
252  *     #SCIM_TRANS_CMD_RELOAD_CONFIG and #SCIM_TRANS_CMD_EXIT,
253  *     there must be an uint32 id of the currently focused input context
254  *     right after the #SCIM_TRANS_CMD_REPLY command.
255  *     Then there can be one or more commands and corresponding data following.\n
256  *     The valid commands which can be used here are:
257  *     - #SCIM_TRANS_CMD_RELOAD_CONFIG
258  *     - #SCIM_TRANS_CMD_EXIT
259  *     - #SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE_PAGE_SIZE
260  *     - #SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_UP
261  *     - #SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_DOWN
262  *     - #SCIM_TRANS_CMD_PROCESS_KEY_EVENT
263  *     - #SCIM_TRANS_CMD_MOVE_PREEDIT_CARET
264  *     - #SCIM_TRANS_CMD_SELECT_CANDIDATE
265  *     - #SCIM_TRANS_CMD_TRIGGER_PROPERTY
266  *     - #SCIM_TRANS_CMD_PROCESS_HELPER_EVENT
267  *     - #SCIM_TRANS_CMD_COMMIT_STRING
268  *     - #SCIM_TRANS_CMD_FORWARD_KEY_EVENT
269  *     - #SCIM_TRANS_CMD_PANEL_REQUEST_HELP
270  *     - #SCIM_TRANS_CMD_PANEL_REQUEST_FACTORY_MENU
271  *     - #SCIM_TRANS_CMD_PANEL_CHANGE_FACTORY
272  * -# <b>Protocol used between Helper and Panel</b>\n
273  *   In this protocol, Panel (eg. scim-panel-gtk or scim-panel-kde) is socket server, Helper is client.
274  *   - <b>from Helper to Panel:</b>\n
275  *     The Transaction sent from Helper to Panel must
276  *     start with #SCIM_TRANS_CMD_REQUEST and followed by an uint32 magic
277  *     key which was returned by scim_socket_open_connection() and
278  *     scim_socket_accept_connection().
279  *     Before parsing the Transaction,
280  *     Panel must verify if the magic key is matched.
281  *     If the magic key is not matched, then Panel should just
282  *     discard this transaction.\n
283  *     There can be one or more commands and corresponding data right after the
284  *     magic key.\n
285  *     The valid commands which can be used here are:
286  *     - #SCIM_TRANS_CMD_PANEL_REGISTER_HELPER
287  *     - #SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT
288  *     - #SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT
289  *     - #SCIM_TRANS_CMD_REGISTER_PROPERTIES
290  *     - #SCIM_TRANS_CMD_UPDATE_PROPERTY
291  *     - #SCIM_TRANS_CMD_FORWARD_KEY_EVENT
292  *     - #SCIM_TRANS_CMD_COMMIT_STRING
293  *   - <b>from Panel to Helper:</b>\n
294  *     The Transaction sent from Panel to Helper must
295  *     start with #SCIM_TRANS_CMD_REPLY and followed by an
296  *     uint32 input context id and a scim::String input context UUID.
297  *     Then there can be one or more commands and corresponding data just after the UUID.\n
298  *     The valid commands which can be used here are:
299  *     - #SCIM_TRANS_CMD_EXIT
300  *     - #SCIM_TRANS_CMD_UPDATE_SCREEN
301  *     - #SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION
302  *     - #SCIM_TRANS_CMD_TRIGGER_PROPERTY
303  *     - #SCIM_TRANS_CMD_HELPER_PROCESS_IMENGINE_EVENT
304  *
305  * @addtogroup TransactionCommands
306  * @ingroup InputServiceFramework
307  * @{
308  */
309
310 /// Unknown command. No use.
311 #ifndef SCIM_TRANS_CMD_UNKNOWN
312     #define SCIM_TRANS_CMD_UNKNOWN                           0
313 #endif
314
315 // Common Commands
316
317 /**
318  * @brief It's the first command which should be put into the Transaction
319  *        sending from a socket client to a socket server.
320  *
321  * The corresponding data for this command is an uint32 magic key
322  * which is returned by scim_socket_open_connection() function.
323  *
324  */
325 #ifndef SCIM_TRANS_CMD_REQUEST
326     #define SCIM_TRANS_CMD_REQUEST                           1
327 #endif
328
329 /**
330  * @brief It's the first command which should be put into the Transaction
331  *        sending from a socket server to a socket client.
332  *
333  * The corresponding data for this command is different in
334  * each protocol. Please refer to the previous protocol notes for details.
335  *
336  */
337 #ifndef SCIM_TRANS_CMD_REPLY
338     #define SCIM_TRANS_CMD_REPLY                             2
339 #endif
340
341 /**
342  * @brief This command is usually used in the Transaction sending from
343  *        a socket server to a socket client to indicate that the request
344  *        previously sent from the client was executed successfully.
345  *
346  * There is no data for this command.
347  *
348  */
349 #ifndef SCIM_TRANS_CMD_OK
350     #define SCIM_TRANS_CMD_OK                                3
351 #endif
352
353 /**
354  * @brief This command is usually used in the Transaction sending from
355  *        a socket server to a socket client to indicate that the request
356  *        previously sent from the client was failed to be executed.
357  *
358  * There is no data for this command.
359  *
360  */
361 #ifndef SCIM_TRANS_CMD_FAIL
362     #define SCIM_TRANS_CMD_FAIL                              4
363 #endif
364
365 /**
366  * @brief This command is used internally by scim_socket_open_connection() and
367  *        scim_socket_accept_connection().
368  *
369  * It's sent from a socket client to a socket server to
370  * request the server to create the connection.
371  *
372  * The corresponding data are:
373  *   - (scim::String) a version string (the binary version of SCIM).
374  *   - (scim::String) type of the client, eg. "SocketIMEngine", "FrontEnd", "Helper" etc.
375  *
376  * If the socket server accept the connection request, it must send back a Transaction with
377  * following content:
378  *   - #SCIM_TRANS_CMD_REPLY
379  *   - (scim::String) a comma separated server types which are supported by the server, eg. "SocketFrontEnd" etc.
380  *   - (uint32) a magic key used to validate the communication later.
381  *
382  * Then if the client accept the result too, it must send the following content back to the
383  * socket server:
384  *   - #SCIM_TRANS_CMD_REPLY
385  *   - #SCIM_TRANS_CMD_OK
386  *
387  * Otherwise, the client must return:
388  *   - #SCIM_TRANS_CMD_REPLY
389  *   - #SCIM_TRANS_CMD_FAIL
390  *
391  * If the socket server do not accept the connection in the first stage, it should discard the request and send
392  * nothing back.
393  *
394  */
395 #ifndef SCIM_TRANS_CMD_OPEN_CONNECTION
396     #define SCIM_TRANS_CMD_OPEN_CONNECTION                   5
397 #endif
398
399 /**
400  * @brief It's used to request the socket server to close the connection forcedly.
401  *
402  * It's currently not used at all.
403  *
404  */
405 #ifndef SCIM_TRANS_CMD_CLOSE_CONNECTION
406     #define SCIM_TRANS_CMD_CLOSE_CONNECTION                  6
407 #endif
408
409 /**
410  * @brief Request the socket server to load and send a file to the client.
411  *
412  * The corresponding data is:
413  *   - (scim::String) the full file path to be loaded.
414  *
415  * If the file is loaded successfully, then the server should send back:
416  *   - #SCIM_TRANS_CMD_REPLY
417  *   - (raw buffer) the buffer which holds the file content.
418  *   - #SCIM_TRANS_CMD_OK
419  *
420  * Otherwise it should send back:
421  *   - #SCIM_TRANS_CMD_REPLY
422  *   - #SCIM_TRANS_CMD_FAIL
423  *
424  * This command is only supported by SocketFrontEnd.
425  *
426  */
427 #ifndef SCIM_TRANS_CMD_LOAD_FILE
428     #define SCIM_TRANS_CMD_LOAD_FILE                         7
429 #endif
430
431 /**
432  * @brief Request the socket server to save a buffer into a file.
433  *
434  * The corresponding data is:
435  *   - (scim::String) the full file path to be used to save the buffer.
436  *   - (raw buffer) the buffer to be saved.
437  *
438  * If the file is saved successfully, then the server should return:
439  *   - #SCIM_TRANS_CMD_REPLY
440  *   - #SCIM_TRANS_CMD_OK
441  *
442  * Otherwise it should return:
443  *   - #SCIM_TRANS_CMD_REPLY
444  *   - #SCIM_TRANS_CMD_FAIL
445  *
446  * This command is currently not supported by any servers.
447  *
448  */
449 #ifndef SCIM_TRANS_CMD_SAVE_FILE
450     #define SCIM_TRANS_CMD_SAVE_FILE                         8
451 #endif
452
453 /**
454  * @brief This command should be sent from a socket server to its clients to let them exit.
455  *
456  * No data is associated to this command.
457  *
458  * This command is currently only used by Panel server.
459  *
460  */
461 #ifndef SCIM_TRANS_CMD_EXIT
462     #define SCIM_TRANS_CMD_EXIT                              99
463 #endif
464
465 // Socket IMEngine to Socket FrontEnd
466
467 /**
468  * @brief This command is used in SocketIMEngine to SocketFrontEnd and
469  *        Panel to FrontEnd protocols to send a KeyEvent to an IMEngineInstance.
470  *
471  * When used in SocketIMEngine to SocketFrontEnd protocol,
472  * the corresponding data is:
473  *   - (uint32) the id of the IMEngineInstance to process the KeyEvent.
474  *   - (KeyEvent) the KeyEvent object to be processed.
475  *
476  * The Transaction returned from SocketFrontEnd should contain:
477  *   - #SCIM_TRANS_CMD_REPLY
478  *   - (any valid commands and their corresponding data)
479  *   - #SCIM_TRANS_CMD_OK or #SCIM_TRANS_CMD_FAIL to indicate
480  *     that if the KeyEvent was processed successfully.
481  *
482  * When used in Panel to FrontEnds protocol, the corresponding data is:
483  *   - (KeyEvent) the KeyEvent object to be processed.
484  */
485 const int SCIM_TRANS_CMD_PROCESS_KEY_EVENT                = 100;
486 const int SCIM_TRANS_CMD_MOVE_PREEDIT_CARET               = 101;
487 const int SCIM_TRANS_CMD_SELECT_CANDIDATE                 = 102;
488 const int SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE_PAGE_SIZE    = 103;
489 const int SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_UP             = 104;
490 const int SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_DOWN           = 105;
491 const int SCIM_TRANS_CMD_RESET                            = 106;
492 const int SCIM_TRANS_CMD_FOCUS_IN                         = 107;
493 const int SCIM_TRANS_CMD_FOCUS_OUT                        = 108;
494 const int SCIM_TRANS_CMD_TRIGGER_PROPERTY                 = 109;
495 const int SCIM_TRANS_CMD_PROCESS_HELPER_EVENT             = 110;
496 const int SCIM_TRANS_CMD_UPDATE_CLIENT_CAPABILITIES       = 111;
497 const int ISM_TRANS_CMD_SHOW_ISE                          = 112;
498 const int ISM_TRANS_CMD_HIDE_ISE                          = 113;
499 const int ISM_TRANS_CMD_SELECT_ASSOCIATE                  = 114;
500 const int ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE_PAGE_SIZE  = 115;
501 const int ISM_TRANS_CMD_ASSOCIATE_TABLE_PAGE_UP           = 116;
502 const int ISM_TRANS_CMD_ASSOCIATE_TABLE_PAGE_DOWN         = 117;
503 const int ISM_TRANS_CMD_SELECT_AUX                        = 118;
504
505 // Socket FrontEnd to Socket IMEngine
506 // FrontEnds to Panel
507 const int SCIM_TRANS_CMD_SHOW_PREEDIT_STRING              = 150;
508 const int SCIM_TRANS_CMD_SHOW_AUX_STRING                  = 151;
509 const int SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE                = 152;
510 const int SCIM_TRANS_CMD_HIDE_PREEDIT_STRING              = 153;
511 const int SCIM_TRANS_CMD_HIDE_AUX_STRING                  = 154;
512 const int SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE                = 155;
513 const int SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET             = 156;
514 const int SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING            = 157;
515 const int SCIM_TRANS_CMD_UPDATE_AUX_STRING                = 158;
516 const int SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE              = 159;
517 const int SCIM_TRANS_CMD_COMMIT_STRING                    = 160;
518 const int SCIM_TRANS_CMD_FORWARD_KEY_EVENT                = 161;
519 const int SCIM_TRANS_CMD_REGISTER_PROPERTIES              = 162;
520 const int SCIM_TRANS_CMD_UPDATE_PROPERTY                  = 163;
521 const int SCIM_TRANS_CMD_BEEP                             = 164;
522 const int SCIM_TRANS_CMD_START_HELPER                     = 165;
523 const int SCIM_TRANS_CMD_STOP_HELPER                      = 166;
524 const int SCIM_TRANS_CMD_SEND_HELPER_EVENT                = 167;
525 const int SCIM_TRANS_CMD_GET_SURROUNDING_TEXT             = 168;
526 const int SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT          = 169;
527 const int ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE              = 170;
528 const int ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE              = 171;
529 const int ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE            = 172;
530
531 // Socket IMEngine to Socket FrontEnd
532 const int SCIM_TRANS_CMD_NEW_INSTANCE                     = 200;
533 const int SCIM_TRANS_CMD_DELETE_INSTANCE                  = 201;
534 const int SCIM_TRANS_CMD_DELETE_ALL_INSTANCES             = 202;
535
536 const int SCIM_TRANS_CMD_GET_FACTORY_LIST                 = 203;
537 const int SCIM_TRANS_CMD_GET_FACTORY_NAME                 = 204;
538 const int SCIM_TRANS_CMD_GET_FACTORY_AUTHORS              = 205;
539 const int SCIM_TRANS_CMD_GET_FACTORY_CREDITS              = 206;
540 const int SCIM_TRANS_CMD_GET_FACTORY_HELP                 = 207;
541 const int SCIM_TRANS_CMD_GET_FACTORY_LOCALES              = 208;
542 const int SCIM_TRANS_CMD_GET_FACTORY_ICON_FILE            = 209;
543 const int SCIM_TRANS_CMD_GET_FACTORY_LANGUAGE             = 210;
544
545 // Socket Config to Socket FrontEnd
546 const int SCIM_TRANS_CMD_FLUSH_CONFIG                     = 300;
547 const int SCIM_TRANS_CMD_ERASE_CONFIG                     = 301;
548 const int SCIM_TRANS_CMD_GET_CONFIG_STRING                = 302;
549 const int SCIM_TRANS_CMD_SET_CONFIG_STRING                = 303;
550 const int SCIM_TRANS_CMD_GET_CONFIG_INT                   = 304;
551 const int SCIM_TRANS_CMD_SET_CONFIG_INT                   = 305;
552 const int SCIM_TRANS_CMD_GET_CONFIG_BOOL                  = 306;
553 const int SCIM_TRANS_CMD_SET_CONFIG_BOOL                  = 307;
554 const int SCIM_TRANS_CMD_GET_CONFIG_DOUBLE                = 308;
555 const int SCIM_TRANS_CMD_SET_CONFIG_DOUBLE                = 309;
556 const int SCIM_TRANS_CMD_GET_CONFIG_VECTOR_STRING         = 310;
557 const int SCIM_TRANS_CMD_SET_CONFIG_VECTOR_STRING         = 311;
558 const int SCIM_TRANS_CMD_GET_CONFIG_VECTOR_INT            = 312;
559 const int SCIM_TRANS_CMD_SET_CONFIG_VECTOR_INT            = 313;
560 const int SCIM_TRANS_CMD_RELOAD_CONFIG                    = 314;
561
562 // Used by Panel and Helper
563 const int SCIM_TRANS_CMD_UPDATE_SCREEN                    = 400;
564 const int SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION             = 401;
565 const int ISM_TRANS_CMD_UPDATE_CURSOR_POSITION            = 402;
566
567 //Privately used by panel.
568 const int SCIM_TRANS_CMD_PANEL_EXIT                       = 500;
569
570 //FrontEnd Client to Panel
571 const int SCIM_TRANS_CMD_PANEL_TURN_ON                    = 501;
572 const int SCIM_TRANS_CMD_PANEL_TURN_OFF                   = 502;
573 const int SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO        = 503;
574 const int SCIM_TRANS_CMD_PANEL_SHOW_HELP                  = 504;
575 const int SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU          = 505;
576 const int SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT     = 506;
577 const int SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT       = 507;
578 const int SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT        = 508;
579 const int ISM_TRANS_CMD_PANEL_START_DEFAULT_ISE           = 509;
580
581 //Panel to FrontEnd Client
582 const int SCIM_TRANS_CMD_PANEL_REQUEST_HELP               = 520;
583 const int SCIM_TRANS_CMD_PANEL_REQUEST_FACTORY_MENU       = 521;
584 const int SCIM_TRANS_CMD_PANEL_CHANGE_FACTORY             = 522;
585 const int ISM_TRANS_CMD_PANEL_REQUEST_RESET_ISE           = 523;
586 const int ISM_TRANS_CMD_PANEL_UPDATE_KEYBOARD_ISE         = 524;
587
588 //Helper Client To Panel
589 const int SCIM_TRANS_CMD_PANEL_REGISTER_HELPER            = 540;
590 const int SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT        = 541;
591 const int SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT             = 542;
592 const int SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER     = 543;
593
594 //Panel to Helper Client
595 const int SCIM_TRANS_CMD_HELPER_PROCESS_IMENGINE_EVENT    = 602;
596 const int SCIM_TRANS_CMD_HELPER_ATTACH_INPUT_CONTEXT      = 603;
597 const int SCIM_TRANS_CMD_HELPER_DETACH_INPUT_CONTEXT      = 604;
598
599 //HelperManager Commands
600 const int SCIM_TRANS_CMD_HELPER_MANAGER_GET_HELPER_LIST   = 700;
601 const int SCIM_TRANS_CMD_HELPER_MANAGER_RUN_HELPER        = 701;
602 const int SCIM_TRANS_CMD_HELPER_MANAGER_STOP_HELPER       = 702;
603 const int SCIM_TRANS_CMD_HELPER_MANAGER_SEND_DISPLAY      = 703;
604 const int SCIM_TRANS_CMD_HELPER_MANAGER_SEND_ISE_LIST     = 704;
605
606 const int ISM_TRANS_CMD_GET_ACTIVE_ISE_LIST               = 950;
607
608
609 /* commands to send from IMControl to Control Panel*/
610 #define ISM_TRANS_CMD_SHOW_ISE_PANEL                        1100
611 #define ISM_TRANS_CMD_HIDE_ISE_PANEL                        1101
612 #define ISM_TRANS_CMD_SHOW_ISF_CONTROL                      1102
613 #define ISM_TRANS_CMD_HIDE_ISF_CONTROL                      1103
614
615 /*command that ISE sends to IMControl*/
616 #define ISM_TRANS_CMD_UPDATE_ISE_STYLE                      1106
617
618 /* commands to communicate between IMControl and Control Panel*/
619 #define ISM_TRANS_CMD_SET_ISE_MODE                          1107
620 #define ISM_TRANS_CMD_SET_ISE_LANGUAGE                      1108
621 #define ISM_TRANS_CMD_SET_ISE_IMDATA                        1109
622 #define ISM_TRANS_CMD_GET_ISE_IMDATA                        1110
623 #define ISM_TRANS_CMD_GET_ACTIVE_ISE_NAME                   1111
624 #define ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_NAME                1112
625 #define ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID                1113
626 #define ISM_TRANS_CMD_GET_ACTIVE_ISE_SIZE                   1114
627 #define ISM_TRANS_CMD_ISE_CHANGED                           1115
628 #define ISM_TRANS_CMD_SET_PRIVATE_KEY                       1116
629 #define ISM_TRANS_CMD_SET_PRIVATE_KEY_BY_IMG                1117
630 #define ISM_TRANS_CMD_SET_LAYOUT                            1118
631 #define ISM_TRANS_CMD_GET_LAYOUT                            1119
632 #define ISM_TRANS_CMD_SET_CAPS_MODE                         1120
633
634 /* commands that ISE sends info to IMControl*/
635 #define ISM_TRANS_CMD_UPDATE_ISE_HIDED                      1122
636 #define ISM_TRANS_CMD_GET_ISE_LIST                          1123
637 #define ISM_TRANS_CMD_GET_LANGUAGE_LIST                     1124
638 #define ISM_TRANS_CMD_GET_ISE_LANGUAGE                      1125
639 #define ISM_TRANS_CMD_SET_ISF_LANGUAGE                      1126
640 #define ISM_TRANS_CMD_GET_ALL_LANGUAGE_LIST                 1127
641 #define ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT              1128
642 #define ISM_TRANS_CMD_RESET_ISE_OPTION                      1129
643
644 /* commands to send from Control Panel to IMControl*/
645 #define ISM_TRANS_CMD_ISE_PANEL_SHOWED                      1130
646 #define ISM_TRANS_CMD_ISE_PANEL_HIDED                       1131
647 #define ISM_TRANS_CMD_ISF_CONTROL_SHOWED                    1132
648 #define ISM_TRANS_CMD_ISF_CONTROL_HIDED                     1133
649
650 #define ISM_TRANS_CMD_RESET_ISE_CONTEXT                     1134
651 #define ISM_TRANS_CMD_SET_ISE_SCREEN_DIRECTION              1135
652 #define ISM_TRANS_CMD_ISE_RESULT_TO_IMCONTROL               1136
653 #define ISM_TRANS_CMD_SET_INDICATOR_CHAR_COUNT              1137
654 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_STRING             1138
655 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_IM_BUTTON_SET_LABEL 1139
656 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_SET_PRESET_TEXT    1140
657 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_SET_TEXT           1141
658 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_SET_MAX_LENGTH     1142
659 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_CHANGED            1143
660 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_GET_TEXT           1144
661 #define ISM_TRANS_CMD_IM_INDICATOR_SET_COUNT_LABEL          1145
662 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_BUTTON_SENSTIVITY  1146
663 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_PROGRESS_BAR       1147
664 #define ISM_TRANS_CMD_IM_EMBEDDED_EDITOR_PREEDIT_CHANGED    1148
665 #define ISM_TRANS_CMD_SET_DISABLE_KEY                       1149
666 #define ISM_TRANS_CMD_GET_LAYOUT_LIST                       1150
667
668
669 // ISE to Control Panel
670 const int ISM_TRANS_CMD_SET_CANDIDATE_UI            = 1201;
671 const int ISM_TRANS_CMD_GET_CANDIDATE_UI            = 1202;
672 const int ISM_TRANS_CMD_UPDATE_CANDIDATE_UI         = 1203;
673 const int ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST       = 1204;
674 const int ISM_TRANS_CMD_UPDATE_KEYBOARD_ISE_LIST    = 1205;
675 const int ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_NAME    = 1206;
676 const int ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID    = 1207;
677 const int ISM_TRANS_CMD_GET_KEYBOARD_ISE            = 1208;
678 const int ISM_TRANS_CMD_UPDATE_KEYBOARD_ISE         = 1209;
679 const int ISM_TRANS_CMD_SET_CANDIDATE_POSITION      = 1210;
680 const int ISM_TRANS_CMD_HIDE_CANDIDATE              = 1211;
681 const int ISM_TRANS_CMD_GET_CANDIDATE_RECT          = 1212;
682 const int ISM_TRANS_CMD_UPDATE_CANDIDATE_RECT       = 1213;
683 const int ISM_TRANS_CMD_LAUNCH_HELPER_ISE_LIST_SELECTION = 1214;
684 // Candidate to Helper ISE
685 const int ISM_TRANS_CMD_CANDIDATE_MORE_WINDOW_SHOW  = 1251;
686 const int ISM_TRANS_CMD_CANDIDATE_MORE_WINDOW_HIDE  = 1252;
687
688 const int ISM_TRANS_CMD_TURN_ON_LOG                 = 1301;
689
690 const int SCIM_TRANS_CMD_USER_DEFINED               = 10000;
691 /**
692  * @}
693  */
694
695 } // namespace scim
696
697 #endif //__SCIM_TRANS_COMMANDS_H
698
699 /*
700 vi:ts=4:nowrap:ai:expandtab
701 */
702