merge with master
[platform/core/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_SELECT_ASSOCIATE                  = 112;
498 const int ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE_PAGE_SIZE  = 113;
499 const int ISM_TRANS_CMD_ASSOCIATE_TABLE_PAGE_UP           = 114;
500 const int ISM_TRANS_CMD_ASSOCIATE_TABLE_PAGE_DOWN         = 115;
501 const int ISM_TRANS_CMD_SELECT_AUX                        = 116;
502 const int ISM_TRANS_CMD_SET_PREDICTION_ALLOW              = 117;
503 const int ISM_TRANS_CMD_UPDATE_CANDIDATE_ITEM_LAYOUT      = 118;
504
505
506 // Socket FrontEnd to Socket IMEngine
507 // FrontEnds to Panel
508 const int SCIM_TRANS_CMD_SHOW_PREEDIT_STRING              = 150;
509 const int SCIM_TRANS_CMD_SHOW_AUX_STRING                  = 151;
510 const int SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE                = 152;
511 const int SCIM_TRANS_CMD_HIDE_PREEDIT_STRING              = 153;
512 const int SCIM_TRANS_CMD_HIDE_AUX_STRING                  = 154;
513 const int SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE                = 155;
514 const int SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET             = 156;
515 const int SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING            = 157;
516 const int SCIM_TRANS_CMD_UPDATE_AUX_STRING                = 158;
517 const int SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE              = 159;
518 const int SCIM_TRANS_CMD_COMMIT_STRING                    = 160;
519 const int SCIM_TRANS_CMD_FORWARD_KEY_EVENT                = 161;
520 const int SCIM_TRANS_CMD_REGISTER_PROPERTIES              = 162;
521 const int SCIM_TRANS_CMD_UPDATE_PROPERTY                  = 163;
522 const int SCIM_TRANS_CMD_BEEP                             = 164;
523 const int SCIM_TRANS_CMD_START_HELPER                     = 165;
524 const int SCIM_TRANS_CMD_STOP_HELPER                      = 166;
525 const int SCIM_TRANS_CMD_SEND_HELPER_EVENT                = 167;
526 const int SCIM_TRANS_CMD_GET_SURROUNDING_TEXT             = 168;
527 const int SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT          = 169;
528 const int ISM_TRANS_CMD_SHOW_ASSOCIATE_TABLE              = 170;
529 const int ISM_TRANS_CMD_HIDE_ASSOCIATE_TABLE              = 171;
530 const int ISM_TRANS_CMD_UPDATE_ASSOCIATE_TABLE            = 172;
531 const int ISM_TRANS_CMD_TRANSACTION_CONTINUE              = 173;
532
533 // Socket IMEngine to Socket FrontEnd
534 const int SCIM_TRANS_CMD_NEW_INSTANCE                     = 200;
535 const int SCIM_TRANS_CMD_DELETE_INSTANCE                  = 201;
536 const int SCIM_TRANS_CMD_DELETE_ALL_INSTANCES             = 202;
537
538 const int SCIM_TRANS_CMD_GET_FACTORY_LIST                 = 203;
539 const int SCIM_TRANS_CMD_GET_FACTORY_NAME                 = 204;
540 const int SCIM_TRANS_CMD_GET_FACTORY_AUTHORS              = 205;
541 const int SCIM_TRANS_CMD_GET_FACTORY_CREDITS              = 206;
542 const int SCIM_TRANS_CMD_GET_FACTORY_HELP                 = 207;
543 const int SCIM_TRANS_CMD_GET_FACTORY_LOCALES              = 208;
544 const int SCIM_TRANS_CMD_GET_FACTORY_ICON_FILE            = 209;
545 const int SCIM_TRANS_CMD_GET_FACTORY_LANGUAGE             = 210;
546
547 // Socket Config to Socket FrontEnd
548 const int SCIM_TRANS_CMD_FLUSH_CONFIG                     = 300;
549 const int SCIM_TRANS_CMD_ERASE_CONFIG                     = 301;
550 const int SCIM_TRANS_CMD_GET_CONFIG_STRING                = 302;
551 const int SCIM_TRANS_CMD_SET_CONFIG_STRING                = 303;
552 const int SCIM_TRANS_CMD_GET_CONFIG_INT                   = 304;
553 const int SCIM_TRANS_CMD_SET_CONFIG_INT                   = 305;
554 const int SCIM_TRANS_CMD_GET_CONFIG_BOOL                  = 306;
555 const int SCIM_TRANS_CMD_SET_CONFIG_BOOL                  = 307;
556 const int SCIM_TRANS_CMD_GET_CONFIG_DOUBLE                = 308;
557 const int SCIM_TRANS_CMD_SET_CONFIG_DOUBLE                = 309;
558 const int SCIM_TRANS_CMD_GET_CONFIG_VECTOR_STRING         = 310;
559 const int SCIM_TRANS_CMD_SET_CONFIG_VECTOR_STRING         = 311;
560 const int SCIM_TRANS_CMD_GET_CONFIG_VECTOR_INT            = 312;
561 const int SCIM_TRANS_CMD_SET_CONFIG_VECTOR_INT            = 313;
562 const int SCIM_TRANS_CMD_RELOAD_CONFIG                    = 314;
563
564 // Used by Panel and Helper
565 const int SCIM_TRANS_CMD_UPDATE_SCREEN                    = 400;
566 const int SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION             = 401;
567 const int ISM_TRANS_CMD_UPDATE_CURSOR_POSITION            = 402;
568 const int ISM_TRANS_CMD_UPDATE_SURROUNDING_TEXT           = 403;
569
570 // Privately used by panel.
571 const int SCIM_TRANS_CMD_PANEL_EXIT                       = 500;
572
573 // FrontEnd Client to Panel
574 const int SCIM_TRANS_CMD_PANEL_TURN_ON                    = 501;
575 const int SCIM_TRANS_CMD_PANEL_TURN_OFF                   = 502;
576 const int SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO        = 503;
577 const int SCIM_TRANS_CMD_PANEL_SHOW_HELP                  = 504;
578 const int SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU          = 505;
579 const int SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT     = 506;
580 const int SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT       = 507;
581 const int SCIM_TRANS_CMD_PANEL_RESET_INPUT_CONTEXT        = 508;
582
583 // Panel to FrontEnd Client
584 const int SCIM_TRANS_CMD_PANEL_REQUEST_HELP               = 520;
585 const int SCIM_TRANS_CMD_PANEL_REQUEST_FACTORY_MENU       = 521;
586 const int SCIM_TRANS_CMD_PANEL_CHANGE_FACTORY             = 522;
587 const int ISM_TRANS_CMD_PANEL_RESET_KEYBOARD_ISE          = 523;
588 const int ISM_TRANS_CMD_PANEL_UPDATE_KEYBOARD_ISE         = 524;
589 const int ISM_TRANS_CMD_PANEL_UPDATE_CLIENT_ID            = 525;
590
591 // Helper Client To Panel
592 const int SCIM_TRANS_CMD_PANEL_REGISTER_HELPER            = 540;
593 const int SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT        = 541;
594 const int SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT             = 542;
595 const int SCIM_TRANS_CMD_PANEL_REGISTER_ACTIVE_HELPER     = 543;
596
597 // Panel to Helper Client
598 const int SCIM_TRANS_CMD_HELPER_PROCESS_IMENGINE_EVENT    = 602;
599 const int SCIM_TRANS_CMD_HELPER_ATTACH_INPUT_CONTEXT      = 603;
600 const int SCIM_TRANS_CMD_HELPER_DETACH_INPUT_CONTEXT      = 604;
601
602 // HelperManager Commands
603 const int SCIM_TRANS_CMD_HELPER_MANAGER_GET_HELPER_LIST   = 700;
604 const int SCIM_TRANS_CMD_HELPER_MANAGER_RUN_HELPER        = 701;
605 const int SCIM_TRANS_CMD_HELPER_MANAGER_STOP_HELPER       = 702;
606 const int SCIM_TRANS_CMD_HELPER_MANAGER_SEND_DISPLAY      = 703;
607 const int SCIM_TRANS_CMD_HELPER_MANAGER_SEND_ISE_LIST     = 704;
608 const int ISM_TRANS_CMD_GET_ACTIVE_ISE_LIST               = 705;
609
610
611 /* IMControl to Panel */
612 const int ISM_TRANS_CMD_SHOW_ISE_PANEL                    = 1000;
613 const int ISM_TRANS_CMD_HIDE_ISE_PANEL                    = 1001;
614 const int ISM_TRANS_CMD_SHOW_ISF_CONTROL                  = 1002;
615 const int ISM_TRANS_CMD_HIDE_ISF_CONTROL                  = 1003;
616 const int ISM_TRANS_CMD_GET_LANGUAGE_LIST                 = 1004;
617 const int ISM_TRANS_CMD_GET_ISE_LANGUAGE                  = 1005;
618 const int ISM_TRANS_CMD_SET_ISF_LANGUAGE                  = 1006;
619 const int ISM_TRANS_CMD_GET_ALL_LANGUAGE_LIST             = 1007;
620 const int ISM_TRANS_CMD_RESET_ISE_OPTION                  = 1008;
621 const int ISM_TRANS_CMD_SET_ACTIVE_ISE_BY_UUID            = 1009;
622 const int ISM_TRANS_CMD_GET_ACTIVE_ISE                    = 1010;
623 const int ISM_TRANS_CMD_GET_ISE_LIST                      = 1011;
624 const int ISM_TRANS_CMD_GET_ISE_INFORMATION               = 1012;
625 const int ISM_TRANS_CMD_SEND_WILL_SHOW_ACK                = 1013;
626 const int ISM_TRANS_CMD_SEND_WILL_HIDE_ACK                = 1014;
627 const int ISM_TRANS_CMD_RESET_DEFAULT_ISE                 = 1015;
628
629
630 /* IMControl to ISE */
631 const int ISM_TRANS_CMD_SET_ISE_MODE                      = 1108;
632 const int ISM_TRANS_CMD_SET_ISE_LANGUAGE                  = 1109;
633 const int ISM_TRANS_CMD_SET_ISE_IMDATA                    = 1110;
634 const int ISM_TRANS_CMD_GET_ISE_IMDATA                    = 1111;
635 const int ISM_TRANS_CMD_GET_ACTIVE_ISE_GEOMETRY           = 1112;
636 const int ISM_TRANS_CMD_SET_LAYOUT                        = 1113;
637 const int ISM_TRANS_CMD_GET_LAYOUT                        = 1114;
638 const int ISM_TRANS_CMD_SET_CAPS_MODE                     = 1115;
639 const int ISM_TRANS_CMD_GET_ISE_LANGUAGE_LOCALE           = 1116;
640 const int ISM_TRANS_CMD_RESET_ISE_CONTEXT                 = 1117;
641 const int ISM_TRANS_CMD_SET_RETURN_KEY_TYPE               = 1118;
642 const int ISM_TRANS_CMD_GET_RETURN_KEY_TYPE               = 1119;
643 const int ISM_TRANS_CMD_SET_RETURN_KEY_DISABLE            = 1120;
644 const int ISM_TRANS_CMD_GET_RETURN_KEY_DISABLE            = 1121;
645
646 /* ISE to IMControl */
647 const int ISM_TRANS_CMD_UPDATE_ISE_HIDED                  = 1127;
648 const int ISM_TRANS_CMD_UPDATE_ISE_INPUT_CONTEXT          = 1128;
649
650 /* Panel to IMControl */
651 const int ISM_TRANS_CMD_ISE_PANEL_SHOWED                  = 1130;
652 const int ISM_TRANS_CMD_ISE_PANEL_HIDED                   = 1131;
653 const int ISM_TRANS_CMD_ISF_CONTROL_SHOWED                = 1132;
654 const int ISM_TRANS_CMD_ISF_CONTROL_HIDED                 = 1133;
655 const int ISM_TRANS_CMD_UPDATE_ISF_CANDIDATE_PANEL        = 1134;
656 const int ISM_TRANS_CMD_UPDATE_ISE_STYLE                  = 1135;
657 const int ISM_TRANS_CMD_ISE_CHANGED                       = 1136;
658
659
660 /* ISE to Panel */
661 const int ISM_TRANS_CMD_SET_CANDIDATE_UI                  = 1201;
662 const int ISM_TRANS_CMD_GET_CANDIDATE_UI                  = 1202;
663 const int ISM_TRANS_CMD_UPDATE_CANDIDATE_UI               = 1203;
664 const int ISM_TRANS_CMD_GET_KEYBOARD_ISE_LIST             = 1204;
665 const int ISM_TRANS_CMD_UPDATE_KEYBOARD_ISE_LIST          = 1205;
666 const int ISM_TRANS_CMD_SET_KEYBOARD_ISE_BY_UUID          = 1206;
667 const int ISM_TRANS_CMD_GET_KEYBOARD_ISE                  = 1207;
668 const int ISM_TRANS_CMD_UPDATE_KEYBOARD_ISE               = 1208;
669 const int ISM_TRANS_CMD_SET_CANDIDATE_POSITION            = 1209;
670 const int ISM_TRANS_CMD_HIDE_CANDIDATE                    = 1210;
671 const int ISM_TRANS_CMD_GET_CANDIDATE_GEOMETRY            = 1211;
672 const int ISM_TRANS_CMD_UPDATE_CANDIDATE_GEOMETRY         = 1212;
673 const int ISM_TRANS_CMD_UPDATE_ISE_GEOMETRY               = 1213;
674 const int ISM_TRANS_CMD_EXPAND_CANDIDATE                  = 1214;
675 const int ISM_TRANS_CMD_CONTRACT_CANDIDATE                = 1215;
676
677 /* Panel to ISE */
678 const int ISM_TRANS_CMD_CANDIDATE_MORE_WINDOW_SHOW        = 1251;
679 const int ISM_TRANS_CMD_CANDIDATE_MORE_WINDOW_HIDE        = 1252;
680 const int ISM_TRANS_CMD_UPDATE_DISPLAYED_CANDIDATE        = 1253;
681 const int ISM_TRANS_CMD_LONGPRESS_CANDIDATE               = 1254;
682
683 const int ISM_TRANS_CMD_TURN_ON_LOG                       = 1301;
684
685 const int SCIM_TRANS_CMD_USER_DEFINED                     = 10000;
686 /**
687  * @}
688  */
689
690 } // namespace scim
691
692 #endif //__SCIM_TRANS_COMMANDS_H
693
694 /*
695 vi:ts=4:nowrap:ai:expandtab
696 */
697