1 /** 2 * @file scim_trans_commands.h 3 * @brief Transaction commands. 4 */ 5 6 /* 7 * Smart Common Input Method 8 * 9 * Copyright (c) 2002-2005 James Su <suzhe@tsinghua.org.cn> 10 * 11 * 12 * This library is free software; you can redistribute it and/or 13 * modify it under the terms of the GNU Lesser General Public 14 * License as published by the Free Software Foundation; either 15 * version 2 of the License, or (at your option) any later version. 16 * 17 * This library is distributed in the hope that it will be useful, 18 * but WITHOUT ANY WARRANTY; without even the implied warranty of 19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20 * GNU Lesser General Public License for more details. 21 * 22 * You should have received a copy of the GNU Lesser General Public 23 * License along with this program; if not, write to the 24 * Free Software Foundation, Inc., 59 Temple Place, Suite 330, 25 * Boston, MA 02111-1307 USA 26 * 27 * $Id: scim_trans_commands.h,v 1.9 2005/06/26 16:35:33 suzhe Exp $ 28 */ 29 30 #ifndef __SCIM_TRANS_COMMANDS_H 31 #define __SCIM_TRANS_COMMANDS_H 32 33 namespace scim { 34 35 /** 36 * @brief Transaction command types used by Socket Frontend/IMEngine/Config, Helper and Panel. 37 * 38 * This commands are used in communication protocols of SocketFrontEnd, SocketIMEngine, SocketConfig, Helper and Panel. 39 * 40 * There are mainly four major protocols used in the communications among each part of SCIM: 41 * - between SocketFrontEnd and SocketIMEngine (SocketFrontEnd is server) 42 * - between SocketFrontEnd and SocketConfig (SocketFrontEnd is server) 43 * - between Panel and FrontEnds (eg. X11 FrontEnd, Gtk IMModule and QT IMModule. Panel is server) 44 * - between Panel and Helper (Panel is server). 45 * 46 * As soon as the socket to the server is established, the client must call function 47 * scim_socket_open_connection() to create the connection and get the magic key for later communication. 48 * 49 * At the same time, the server must call function scim_socket_accept_connection() to 50 * accept the connection and get the same magic key for later client verification. 51 * 52 * The valid types of servers are: 53 * - "SocketFrontEnd"\n 54 * The socket FrontEnd server provides remote IMEngine and Config services. 55 * It accepts "SocketIMEngine" and "SocketConfig" clients. 56 * - "Panel"\n 57 * The Panel server provides GUI and Helper management services. 58 * It accepts "FrontEnd" and "Helper" clients. 59 * 60 * The valid types of clients are: 61 * - "SocketIMEngine"\n 62 * The socket IMEngine client acts as a proxy IMEngine forwarding all requests to SocketFrontEnd. 63 * It can only connect to "SocketFrontEnd" server. 64 * - "SocketConfig"\n 65 * The socket Config client acts as a proxy Config forwarding all request to SocketFrontEnd. 66 * It can only connect to "SocketFrontEnd" server. 67 * - "FrontEnd"\n 68 * If a FrontEnd needs a Panel GUI services, it'll be a "FrontEnd" client of the Panel. 69 * It can only connect to "Panel" server. 70 * - "Helper"\n 71 * All Helper objects should be "Helper" clients of a Panel. 72 * It can only connect to "Panel" server. 73 * 74 * Then the client and the server can communicate with each other via the socket by sending transactions. 75 * 76 * Multiple commands and their data may be put into one transaction with a restricted order. 77 * The data of a command must be put into the transaction just follow the command itself. 78 * 79 * A transaction sent from a socket client to a socket server (eg. SocketIMEngine to SocketFrontEnd) 80 * must be started with a SCIM_TRANS_CMD_REQUEST command followed by an uint32 magic key of the client 81 * (returned by scim_socket_open_connection() function. 82 * 83 * A transaction sent back to a socket client from a socket server must be started with a 84 * SCIM_TRANS_CMD_REPLY command. 85 * 86 * So for example, the layout of a transaction sent from SocketIMEngine to SocketFrontEnd may look like: 87 * - #SCIM_TRANS_CMD_REQUEST 88 * - an uint32 data (the magic key of a client) 89 * - #SCIM_TRANS_CMD_PROCESS_KEY_EVENT 90 * - an uint32 data (the id of the IMEngineInstance object used to process the KeyEvent) 91 * - a scim::KeyEvent data (the KeyEvent to be processed) 92 * 93 * Some commands may be used in more than one protocols for similar purpose, but they may have different 94 * data in different protocol. 95 * 96 * <b>Brief introduction of communication protocols used in SCIM:</b> 97 * 98 * Please refer to the descriptions of each Transaction commands for details. 99 * 100 * -# <b>Protocol used between SocketIMEngine and SocketFrontEnd</b>\n 101 * In this protocol, SocketFrontEnd is socket server, SocketIMEngine is client. 102 * - <b>from SocketIMEngine to SocketFrontEnd:</b>\n 103 * The Transaction sent from SocketIMEngine to SocketFrontEnd must 104 * start with #SCIM_TRANS_CMD_REQUEST and followed by an uint32 magic 105 * key which was returned by scim_socket_open_connection() and 106 * scim_socket_accept_connection().\n 107 * Before parsing the Transaction, 108 * SocketFrontEnd must verify if the magic key is matched. 109 * If the magic key is not matched, then SocketFrontEnd should just 110 * discard this transaction.\n 111 * There can be one or more commands and corresponding data right after the 112 * magic key.\n 113 * The valid commands which can be used here are: 114 * - #SCIM_TRANS_CMD_NEW_INSTANCE 115 * - #SCIM_TRANS_CMD_DELETE_INSTANCE 116 * - #SCIM_TRANS_CMD_DELETE_ALL_INSTANCES 117 * - #SCIM_TRANS_CMD_GET_FACTORY_LIST 118 * - #SCIM_TRANS_CMD_GET_FACTORY_NAME 119 * - #SCIM_TRANS_CMD_GET_FACTORY_AUTHORS 120 * - #SCIM_TRANS_CMD_GET_FACTORY_CREDITS 121 * - #SCIM_TRANS_CMD_GET_FACTORY_HELP 122 * - #SCIM_TRANS_CMD_GET_FACTORY_LOCALES 123 * - #SCIM_TRANS_CMD_GET_FACTORY_ICON_FILE 124 * - #SCIM_TRANS_CMD_GET_FACTORY_LANGUAGE 125 * - #SCIM_TRANS_CMD_PROCESS_KEY_EVENT 126 * - #SCIM_TRANS_CMD_MOVE_PREEDIT_CARET 127 * - #SCIM_TRANS_CMD_SELECT_CANDIDATE 128 * - #SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE_PAGE_SIZE 129 * - #SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_UP 130 * - #SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_DOWN 131 * - #SCIM_TRANS_CMD_RESET 132 * - #SCIM_TRANS_CMD_FOCUS_IN 133 * - #SCIM_TRANS_CMD_FOCUS_OUT 134 * - #SCIM_TRANS_CMD_TRIGGER_PROPERTY 135 * - #SCIM_TRANS_CMD_PROCESS_HELPER_EVENT 136 * - #SCIM_TRANS_CMD_UPDATE_CLIENT_CAPABILITIES 137 * - #SCIM_TRANS_CMD_LOAD_FILE 138 * - #SCIM_TRANS_CMD_CLOSE_CONNECTION 139 * - <b>from SocketFrontEnd to SocketIMEngine:</b>\n 140 * The Transaction sent back from SocketFrontEnd to SocketIMEngine must 141 * start with #SCIM_TRANS_CMD_REPLY and end with #SCIM_TRANS_CMD_OK or 142 * #SCIM_TRANS_CMD_FAIL to indicate if the request previously sent by 143 * SocketIMEngine was executed successfully.\n 144 * For some requests, like SCIM_TRANS_CMD_GET_FACTORY_LIST, etc. 145 * only some result data will be returned between #SCIM_TRANS_CMD_REPLY and #SCIM_TRANS_CMD_OK.\n 146 * For some requests, like SCIM_TRANS_CMD_PROCESS_KEY_EVENT, etc. 147 * one or more following commands and corresponding data may be returned between 148 * #SCIM_TRANS_CMD_REPLY and #SCIM_TRANS_CMD_OK commands.\n 149 * The valid commands can be used here are: 150 * - #SCIM_TRANS_CMD_SHOW_PREEDIT_STRING 151 * - #SCIM_TRANS_CMD_SHOW_AUX_STRING 152 * - #SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE 153 * - #SCIM_TRANS_CMD_HIDE_PREEDIT_STRING 154 * - #SCIM_TRANS_CMD_HIDE_AUX_STRING 155 * - #SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE 156 * - #SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET 157 * - #SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING 158 * - #SCIM_TRANS_CMD_UPDATE_AUX_STRING 159 * - #SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE 160 * - #SCIM_TRANS_CMD_COMMIT_STRING 161 * - #SCIM_TRANS_CMD_FORWARD_KEY_EVENT 162 * - #SCIM_TRANS_CMD_REGISTER_PROPERTIES 163 * - #SCIM_TRANS_CMD_UPDATE_PROPERTY 164 * - #SCIM_TRANS_CMD_BEEP 165 * - #SCIM_TRANS_CMD_START_HELPER 166 * - #SCIM_TRANS_CMD_STOP_HELPER 167 * - #SCIM_TRANS_CMD_SEND_HELPER_EVENT 168 * -# <b>Protocol used between SocketConfig and SocketFrontEnd</b>\n 169 * In this protocol, SocketFrontEnd is socket server, SocketConfig is client. 170 * - <b>from SocketConfig to SocketFrontEnd:</b>\n 171 * The Transaction sent from SocketConfig to SocketFrontEnd must 172 * start with #SCIM_TRANS_CMD_REQUEST and followed by an uint32 magic 173 * key which was returned by scim_socket_open_connection() and 174 * scim_socket_accept_connection().\n 175 * Before parsing the Transaction, 176 * SocketFrontEnd must verify if the magic key is matched. 177 * If the magic key is not matched, then SocketFrontEnd should just 178 * discard this transaction.\n 179 * There can be one or more commands and corresponding data right after the 180 * magic key.\n 181 * The valid commands which can be used here are: 182 * - #SCIM_TRANS_CMD_FLUSH_CONFIG 183 * - #SCIM_TRANS_CMD_ERASE_CONFIG 184 * - #SCIM_TRANS_CMD_GET_CONFIG_STRING 185 * - #SCIM_TRANS_CMD_SET_CONFIG_STRING 186 * - #SCIM_TRANS_CMD_GET_CONFIG_INT 187 * - #SCIM_TRANS_CMD_SET_CONFIG_INT 188 * - #SCIM_TRANS_CMD_GET_CONFIG_BOOL 189 * - #SCIM_TRANS_CMD_SET_CONFIG_BOOL 190 * - #SCIM_TRANS_CMD_GET_CONFIG_DOUBLE 191 * - #SCIM_TRANS_CMD_SET_CONFIG_DOUBLE 192 * - #SCIM_TRANS_CMD_GET_CONFIG_VECTOR_STRING 193 * - #SCIM_TRANS_CMD_SET_CONFIG_VECTOR_STRING 194 * - #SCIM_TRANS_CMD_GET_CONFIG_VECTOR_INT 195 * - #SCIM_TRANS_CMD_SET_CONFIG_VECTOR_INT 196 * - #SCIM_TRANS_CMD_RELOAD_CONFIG 197 * - #SCIM_TRANS_CMD_LOAD_FILE 198 * - #SCIM_TRANS_CMD_CLOSE_CONNECTION 199 * - <b>from SocketFrontEnd to SocketConfig:</b>\n 200 * The Transaction sent back from SocketFrontEnd to SocketConfig must 201 * start with #SCIM_TRANS_CMD_REPLY and end with #SCIM_TRANS_CMD_OK or 202 * #SCIM_TRANS_CMD_FAIL to indicate if the request previously sent by 203 * SocketConfig was executed successfully.\n 204 * For some requests, like SCIM_TRANS_CMD_FLUSH_CONFIG, etc. 205 * no result data will be returned.\n 206 * For some requests, like SCIM_TRANS_CMD_GET_CONFIG_STRING, etc. 207 * the corresponding data will be returned between 208 * #SCIM_TRANS_CMD_REPLY and #SCIM_TRANS_CMD_OK commands.\n 209 * -# <b>Protocol used between FrontEnds and Panel</b>\n 210 * In this protocol, Panel (eg. scim-panel-gtk or scim-panel-kde) is socket server, FrontEnds are clients. 211 * - <b>from FrontEnds to Panel:</b>\n 212 * The Transaction sent from FrontEnds to Panel must 213 * start with #SCIM_TRANS_CMD_REQUEST and followed by an uint32 magic 214 * key which was returned by scim_socket_open_connection() and 215 * scim_socket_accept_connection(). Then there must be an uint32 id 216 * for current focused input context right after the magic key.\n 217 * Before parsing the Transaction, 218 * Panel must verify if the magic key is matched. 219 * If the magic key is not matched, then Panel should just 220 * discard this transaction.\n 221 * There can be one or more commands and corresponding data right after the 222 * magic key.\n 223 * The valid commands which can be used here are: 224 * - #SCIM_TRANS_CMD_UPDATE_SCREEN 225 * - #SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION 226 * - #SCIM_TRANS_CMD_PANEL_TURN_ON 227 * - #SCIM_TRANS_CMD_PANEL_TURN_OFF 228 * - #SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO 229 * - #SCIM_TRANS_CMD_PANEL_SHOW_HELP 230 * - #SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU 231 * - #SCIM_TRANS_CMD_SHOW_PREEDIT_STRING 232 * - #SCIM_TRANS_CMD_SHOW_AUX_STRING 233 * - #SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE 234 * - #SCIM_TRANS_CMD_HIDE_PREEDIT_STRING 235 * - #SCIM_TRANS_CMD_HIDE_AUX_STRING 236 * - #SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE 237 * - #SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET 238 * - #SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING 239 * - #SCIM_TRANS_CMD_UPDATE_AUX_STRING 240 * - #SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE 241 * - #SCIM_TRANS_CMD_REGISTER_PROPERTIES 242 * - #SCIM_TRANS_CMD_UPDATE_PROPERTY 243 * - #SCIM_TRANS_CMD_START_HELPER 244 * - #SCIM_TRANS_CMD_STOP_HELPER 245 * - #SCIM_TRANS_CMD_SEND_HELPER_EVENT 246 * - <b>from Panel to FrontEnds:</b>\n 247 * The Transaction sent from Panel to FrontEnds must 248 * start with #SCIM_TRANS_CMD_REPLY. 249 * For the following commands except 250 * #SCIM_TRANS_CMD_RELOAD_CONFIG and #SCIM_TRANS_CMD_EXIT, 251 * there must be an uint32 id of the currently focused input context 252 * right after the #SCIM_TRANS_CMD_REPLY command. 253 * Then there can be one or more commands and corresponding data following.\n 254 * The valid commands which can be used here are: 255 * - #SCIM_TRANS_CMD_RELOAD_CONFIG 256 * - #SCIM_TRANS_CMD_EXIT 257 * - #SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE_PAGE_SIZE 258 * - #SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_UP 259 * - #SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_DOWN 260 * - #SCIM_TRANS_CMD_PROCESS_KEY_EVENT 261 * - #SCIM_TRANS_CMD_MOVE_PREEDIT_CARET 262 * - #SCIM_TRANS_CMD_SELECT_CANDIDATE 263 * - #SCIM_TRANS_CMD_TRIGGER_PROPERTY 264 * - #SCIM_TRANS_CMD_PROCESS_HELPER_EVENT 265 * - #SCIM_TRANS_CMD_COMMIT_STRING 266 * - #SCIM_TRANS_CMD_FORWARD_KEY_EVENT 267 * - #SCIM_TRANS_CMD_PANEL_REQUEST_HELP 268 * - #SCIM_TRANS_CMD_PANEL_REQUEST_FACTORY_MENU 269 * - #SCIM_TRANS_CMD_PANEL_CHANGE_FACTORY 270 * -# <b>Protocol used between Helper and Panel</b>\n 271 * In this protocol, Panel (eg. scim-panel-gtk or scim-panel-kde) is socket server, Helper is client. 272 * - <b>from Helper to Panel:</b>\n 273 * The Transaction sent from Helper to Panel must 274 * start with #SCIM_TRANS_CMD_REQUEST and followed by an uint32 magic 275 * key which was returned by scim_socket_open_connection() and 276 * scim_socket_accept_connection(). 277 * Before parsing the Transaction, 278 * Panel must verify if the magic key is matched. 279 * If the magic key is not matched, then Panel should just 280 * discard this transaction.\n 281 * There can be one or more commands and corresponding data right after the 282 * magic key.\n 283 * The valid commands which can be used here are: 284 * - #SCIM_TRANS_CMD_PANEL_REGISTER_HELPER 285 * - #SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT 286 * - #SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT 287 * - #SCIM_TRANS_CMD_REGISTER_PROPERTIES 288 * - #SCIM_TRANS_CMD_UPDATE_PROPERTY 289 * - #SCIM_TRANS_CMD_FORWARD_KEY_EVENT 290 * - #SCIM_TRANS_CMD_COMMIT_STRING 291 * - <b>from Panel to Helper:</b>\n 292 * The Transaction sent from Panel to Helper must 293 * start with #SCIM_TRANS_CMD_REPLY and followed by an 294 * uint32 input context id and a scim::String input context UUID. 295 * Then there can be one or more commands and corresponding data just after the UUID.\n 296 * The valid commands which can be used here are: 297 * - #SCIM_TRANS_CMD_EXIT 298 * - #SCIM_TRANS_CMD_UPDATE_SCREEN 299 * - #SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION 300 * - #SCIM_TRANS_CMD_TRIGGER_PROPERTY 301 * - #SCIM_TRANS_CMD_HELPER_PROCESS_IMENGINE_EVENT 302 * 303 * @addtogroup TransactionCommands 304 * @{ 305 */ 306 307 /// Unknown command. No use. 308 const int SCIM_TRANS_CMD_UNKNOWN = 0; 309 310 // Common Commands 311 312 /** 313 * @brief It's the first command which should be put into the Transaction 314 * sending from a socket client to a socket server. 315 * 316 * The corresponding data for this command is an uint32 magic key 317 * which is returned by scim_socket_open_connection() function. 318 * 319 */ 320 const int SCIM_TRANS_CMD_REQUEST = 1; 321 322 /** 323 * @brief It's the first command which should be put into the Transaction 324 * sending from a socket server to a socket client. 325 * 326 * The corresponding data for this command is different in 327 * each protocol. Please refer to the previous protocol notes for details. 328 * 329 */ 330 const int SCIM_TRANS_CMD_REPLY = 2; 331 332 /** 333 * @brief This command is usually used in the Transaction sending from 334 * a socket server to a socket client to indicate that the request 335 * previously sent from the client was executed successfully. 336 * 337 * There is no data for this command. 338 * 339 */ 340 const int SCIM_TRANS_CMD_OK = 3; 341 342 /** 343 * @brief This command is usually used in the Transaction sending from 344 * a socket server to a socket client to indicate that the request 345 * previously sent from the client was failed to be executed. 346 * 347 * There is no data for this command. 348 * 349 */ 350 const int SCIM_TRANS_CMD_FAIL = 4; 351 352 /** 353 * @brief This command is used internally by scim_socket_open_connection() and 354 * scim_socket_accept_connection(). 355 * 356 * It's sent from a socket client to a socket server to 357 * request the server to create the connection. 358 * 359 * The corresponding data are: 360 * - (scim::String) a version string (the binary version of SCIM). 361 * - (scim::String) type of the client, eg. "SocketIMEngine", "FrontEnd", "Helper" etc. 362 * 363 * If the socket server accept the connection request, it must send back a Transaction with 364 * following content: 365 * - #SCIM_TRANS_CMD_REPLY 366 * - (scim::String) a comma separated server types which are supported by the server, eg. "SocketFrontEnd" etc. 367 * - (uint32) a magic key used to validate the communication later. 368 * 369 * Then if the client accept the result too, it must send the following content back to the 370 * socket server: 371 * - #SCIM_TRANS_CMD_REPLY 372 * - #SCIM_TRANS_CMD_OK 373 * 374 * Otherwise, the client must return: 375 * - #SCIM_TRANS_CMD_REPLY 376 * - #SCIM_TRANS_CMD_FAIL 377 * 378 * If the socket server do not accept the connection in the first stage, it should discard the request and send 379 * nothing back. 380 * 381 */ 382 const int SCIM_TRANS_CMD_OPEN_CONNECTION = 5; 383 384 /** 385 * @brief It's used to request the socket server to close the connection forcedly. 386 * 387 * It's currently not used at all. 388 * 389 */ 390 const int SCIM_TRANS_CMD_CLOSE_CONNECTION = 6; 391 392 /** 393 * @brief Request the socket server to load and send a file to the client. 394 * 395 * The corresponding data is: 396 * - (scim::String) the full file path to be loaded. 397 * 398 * If the file is loaded successfully, then the server should send back: 399 * - #SCIM_TRANS_CMD_REPLY 400 * - (raw buffer) the buffer which holds the file content. 401 * - #SCIM_TRANS_CMD_OK 402 * 403 * Otherwise it should send back: 404 * - #SCIM_TRANS_CMD_REPLY 405 * - #SCIM_TRANS_CMD_FAIL 406 * 407 * This command is only supported by SocketFrontEnd. 408 * 409 */ 410 const int SCIM_TRANS_CMD_LOAD_FILE = 7; 411 412 /** 413 * @brief Request the socket server to save a buffer into a file. 414 * 415 * The corresponding data is: 416 * - (scim::String) the full file path to be used to save the buffer. 417 * - (raw buffer) the buffer to be saved. 418 * 419 * If the file is saved successfully, then the server should return: 420 * - #SCIM_TRANS_CMD_REPLY 421 * - #SCIM_TRANS_CMD_OK 422 * 423 * Otherwise it should return: 424 * - #SCIM_TRANS_CMD_REPLY 425 * - #SCIM_TRANS_CMD_FAIL 426 * 427 * This command is currently not supported by any servers. 428 * 429 */ 430 const int SCIM_TRANS_CMD_SAVE_FILE = 8; 431 432 /** 433 * @brief This command should be sent from a socket server to its clients to let them exit. 434 * 435 * No data is associated to this command. 436 * 437 * This command is currently only used by Panel server. 438 * 439 */ 440 const int SCIM_TRANS_CMD_EXIT = 99; 441 442 // Socket IMEngine to Socket FrontEnd 443 444 /** 445 * @brief This command is used in SocketIMEngine to SocketFrontEnd and 446 * Panel to FrontEnd protocols to send a KeyEvent to an IMEngineInstance. 447 * 448 * When used in SocketIMEngine to SocketFrontEnd protocol, 449 * the corresponding data is: 450 * - (uint32) the id of the IMEngineInstance to process the KeyEvent. 451 * - (KeyEvent) the KeyEvent object to be processed. 452 * 453 * The Transaction returned from SocketFrontEnd should contain: 454 * - #SCIM_TRANS_CMD_REPLY 455 * - (any valid commands and their corresponding data) 456 * - #SCIM_TRANS_CMD_OK or #SCIM_TRANS_CMD_FAIL to indicate 457 * that if the KeyEvent was processed successfully. 458 * 459 * When used in Panel to FrontEnds protocol, the corresponding data is: 460 * - (KeyEvent) the KeyEvent object to be processed. 461 */ 462 const int SCIM_TRANS_CMD_PROCESS_KEY_EVENT = 100; 463 const int SCIM_TRANS_CMD_MOVE_PREEDIT_CARET = 101; 464 const int SCIM_TRANS_CMD_SELECT_CANDIDATE = 102; 465 const int SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE_PAGE_SIZE = 103; 466 const int SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_UP = 104; 467 const int SCIM_TRANS_CMD_LOOKUP_TABLE_PAGE_DOWN = 105; 468 const int SCIM_TRANS_CMD_RESET = 106; 469 const int SCIM_TRANS_CMD_FOCUS_IN = 107; 470 const int SCIM_TRANS_CMD_FOCUS_OUT = 108; 471 const int SCIM_TRANS_CMD_TRIGGER_PROPERTY = 109; 472 const int SCIM_TRANS_CMD_PROCESS_HELPER_EVENT = 110; 473 const int SCIM_TRANS_CMD_UPDATE_CLIENT_CAPABILITIES = 111; 474 475 // Socket FrontEnd to Socket IMEngine 476 // FrontEnds to Panel 477 const int SCIM_TRANS_CMD_SHOW_PREEDIT_STRING = 150; 478 const int SCIM_TRANS_CMD_SHOW_AUX_STRING = 151; 479 const int SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE = 152; 480 const int SCIM_TRANS_CMD_HIDE_PREEDIT_STRING = 153; 481 const int SCIM_TRANS_CMD_HIDE_AUX_STRING = 154; 482 const int SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE = 155; 483 const int SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET = 156; 484 const int SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING = 157; 485 const int SCIM_TRANS_CMD_UPDATE_AUX_STRING = 158; 486 const int SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE = 159; 487 const int SCIM_TRANS_CMD_COMMIT_STRING = 160; 488 const int SCIM_TRANS_CMD_FORWARD_KEY_EVENT = 161; 489 const int SCIM_TRANS_CMD_REGISTER_PROPERTIES = 162; 490 const int SCIM_TRANS_CMD_UPDATE_PROPERTY = 163; 491 const int SCIM_TRANS_CMD_BEEP = 164; 492 const int SCIM_TRANS_CMD_START_HELPER = 165; 493 const int SCIM_TRANS_CMD_STOP_HELPER = 166; 494 const int SCIM_TRANS_CMD_SEND_HELPER_EVENT = 167; 495 const int SCIM_TRANS_CMD_GET_SURROUNDING_TEXT = 168; 496 const int SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT = 169; 497 498 // Socket IMEngine to Socket FrontEnd 499 const int SCIM_TRANS_CMD_NEW_INSTANCE = 200; 500 const int SCIM_TRANS_CMD_DELETE_INSTANCE = 201; 501 const int SCIM_TRANS_CMD_DELETE_ALL_INSTANCES = 202; 502 503 const int SCIM_TRANS_CMD_GET_FACTORY_LIST = 203; 504 const int SCIM_TRANS_CMD_GET_FACTORY_NAME = 204; 505 const int SCIM_TRANS_CMD_GET_FACTORY_AUTHORS = 205; 506 const int SCIM_TRANS_CMD_GET_FACTORY_CREDITS = 206; 507 const int SCIM_TRANS_CMD_GET_FACTORY_HELP = 207; 508 const int SCIM_TRANS_CMD_GET_FACTORY_LOCALES = 208; 509 const int SCIM_TRANS_CMD_GET_FACTORY_ICON_FILE = 209; 510 const int SCIM_TRANS_CMD_GET_FACTORY_LANGUAGE = 210; 511 512 // Socket Config to Socket FrontEnd 513 const int SCIM_TRANS_CMD_FLUSH_CONFIG = 300; 514 const int SCIM_TRANS_CMD_ERASE_CONFIG = 301; 515 const int SCIM_TRANS_CMD_GET_CONFIG_STRING = 302; 516 const int SCIM_TRANS_CMD_SET_CONFIG_STRING = 303; 517 const int SCIM_TRANS_CMD_GET_CONFIG_INT = 304; 518 const int SCIM_TRANS_CMD_SET_CONFIG_INT = 305; 519 const int SCIM_TRANS_CMD_GET_CONFIG_BOOL = 306; 520 const int SCIM_TRANS_CMD_SET_CONFIG_BOOL = 307; 521 const int SCIM_TRANS_CMD_GET_CONFIG_DOUBLE = 308; 522 const int SCIM_TRANS_CMD_SET_CONFIG_DOUBLE = 309; 523 const int SCIM_TRANS_CMD_GET_CONFIG_VECTOR_STRING = 310; 524 const int SCIM_TRANS_CMD_SET_CONFIG_VECTOR_STRING = 311; 525 const int SCIM_TRANS_CMD_GET_CONFIG_VECTOR_INT = 312; 526 const int SCIM_TRANS_CMD_SET_CONFIG_VECTOR_INT = 313; 527 const int SCIM_TRANS_CMD_RELOAD_CONFIG = 314; 528 529 // Used by Panel and Helper 530 const int SCIM_TRANS_CMD_UPDATE_SCREEN = 400; 531 const int SCIM_TRANS_CMD_UPDATE_SPOT_LOCATION = 401; 532 533 //Privately used by panel. 534 const int SCIM_TRANS_CMD_PANEL_EXIT = 500; 535 536 //FrontEnd Client to Panel 537 const int SCIM_TRANS_CMD_PANEL_TURN_ON = 501; 538 const int SCIM_TRANS_CMD_PANEL_TURN_OFF = 502; 539 const int SCIM_TRANS_CMD_PANEL_UPDATE_FACTORY_INFO = 503; 540 const int SCIM_TRANS_CMD_PANEL_SHOW_HELP = 504; 541 const int SCIM_TRANS_CMD_PANEL_SHOW_FACTORY_MENU = 505; 542 const int SCIM_TRANS_CMD_PANEL_REGISTER_INPUT_CONTEXT = 506; 543 const int SCIM_TRANS_CMD_PANEL_REMOVE_INPUT_CONTEXT = 507; 544 545 //Panel to FrontEnd Client 546 const int SCIM_TRANS_CMD_PANEL_REQUEST_HELP = 520; 547 const int SCIM_TRANS_CMD_PANEL_REQUEST_FACTORY_MENU = 521; 548 const int SCIM_TRANS_CMD_PANEL_CHANGE_FACTORY = 522; 549 550 //Helper Client To Panel 551 const int SCIM_TRANS_CMD_PANEL_REGISTER_HELPER = 540; 552 const int SCIM_TRANS_CMD_PANEL_SEND_IMENGINE_EVENT = 541; 553 const int SCIM_TRANS_CMD_PANEL_SEND_KEY_EVENT = 542; 554 555 //Panel to Helper Client 556 const int SCIM_TRANS_CMD_HELPER_PROCESS_IMENGINE_EVENT = 602; 557 const int SCIM_TRANS_CMD_HELPER_ATTACH_INPUT_CONTEXT = 603; 558 const int SCIM_TRANS_CMD_HELPER_DETACH_INPUT_CONTEXT = 604; 559 560 //HelperManager Commands 561 const int SCIM_TRANS_CMD_HELPER_MANAGER_GET_HELPER_LIST = 700; 562 const int SCIM_TRANS_CMD_HELPER_MANAGER_RUN_HELPER = 701; 563 564 const int SCIM_TRANS_CMD_USER_DEFINED = 10000; 565 /** 566 * @} 567 */ 568 569 } // namespace scim 570 571 #endif //__SCIM_TRANS_COMMANDS_H 572 573 /* 574 vi:ts=4:nowrap:ai:expandtab 575 */ 576 577