1 /* 2 * Copyright (c) 2024 Huawei Device Co., Ltd. 3 * Licensed under the Apache License, Version 2.0 (the "License"); 4 * you may not use this file except in compliance with the License. 5 * You may obtain a copy of the License at 6 * 7 * http://www.apache.org/licenses/LICENSE-2.0 8 * 9 * Unless required by applicable law or agreed to in writing, software 10 * distributed under the License is distributed on an "AS IS" BASIS, 11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 * See the License for the specific language governing permissions and 13 * limitations under the License. 14 */ 15 #ifndef OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H 16 #define OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAPI_H 17 /** 18 * @addtogroup InputMethod 19 * @{ 20 * 21 * @brief InputMethod provides functions to use input methods and develop input methods. 22 * 23 * @since 12 24 */ 25 26 /** 27 * @file inputmethod_text_editor_proxy_capi.h 28 * 29 * @brief Provides functions for getting requests and notifications from input method. 30 * 31 * @library libohinputmethod.so 32 * @kit IMEKit 33 * @syscap SystemCapability.MiscServices.InputMethodFramework 34 * @since 12 35 * @version 1.0 36 */ 37 #include <stddef.h> 38 39 #include "inputmethod_private_command_capi.h" 40 #include "inputmethod_text_config_capi.h" 41 #include "inputmethod_types_capi.h" 42 #ifdef __cplusplus 43 extern "C" { 44 #endif /* __cplusplus */ 45 /** 46 * @brief Define the InputMethod_TextEditorProxy structure type. 47 * 48 * Provides methods for getting requests and notifications from input method.\n 49 * When input method sends request or notification to editor, the methods will be called.\n 50 * 51 * @since 12 52 */ 53 typedef struct InputMethod_TextEditorProxy InputMethod_TextEditorProxy; 54 55 /** 56 * @brief Defines the function called when input method getting text config. 57 * 58 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 59 * OH_TextEditorProxy_SetGetTextConfigFunc}, and use {@link OH_InputMethodController_Attach} to complete the 60 * registration.\n 61 * 62 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance. 63 * @param config Represents a pointer to an {@link InputMethod_TextConfig} instance. 64 * @since 12 65 */ 66 typedef void (*OH_TextEditorProxy_GetTextConfigFunc)( 67 InputMethod_TextEditorProxy *textEditorProxy, InputMethod_TextConfig *config); 68 /** 69 * @brief Defines the function called when input method inserting text. 70 * 71 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 72 * OH_TextEditorProxy_SetInsertTextFunc}, and use {@link OH_InputMethodController_Attach} to complete the 73 * registration.\n 74 * 75 * @param textEditorProxy Represents a pointer to the {@link InputMethod_TextEditorProxy} instance which will be set 76 * in. 77 * @param text Represents a pointer to the text to be inserted. 78 * @param length Represents the length of the text to be inserted. 79 * @since 12 80 */ 81 typedef void (*OH_TextEditorProxy_InsertTextFunc)( 82 InputMethod_TextEditorProxy *textEditorProxy, const char16_t *text, size_t length); 83 /** 84 * @brief Defines the function called when input method deleting text forward. 85 * 86 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 87 * OH_TextEditorProxy_SetDeleteForwardFunc}, and use {@link OH_InputMethodController_Attach} to complete the 88 * registration.\n 89 * 90 * @param textEditorProxy Represents a pointer to the {@link InputMethod_TextEditorProxy} instance which will be set 91 * in. 92 * @param length Represents the length of the text to be deleted. 93 * @since 12 94 */ 95 typedef void (*OH_TextEditorProxy_DeleteForwardFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t length); 96 /** 97 * @brief Defines the function called when input method deleting text backward. 98 * 99 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 100 * OH_TextEditorProxy_SetDeleteForwardFunc}, and use {@link OH_InputMethodController_Attach} to complete the 101 * registration.\n 102 * 103 * @param textEditorProxy Represents a pointer to the {@link InputMethod_TextEditorProxy} instance which will be set 104 * in. 105 * @param length Represents the length of the text to be deleted. 106 * @since 12 107 */ 108 typedef void (*OH_TextEditorProxy_DeleteBackwardFunc)(InputMethod_TextEditorProxy *textEditorProxy, int32_t length); 109 /** 110 * @brief Called when input method notifying keyboard status. 111 * 112 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 113 * OH_TextEditorProxy_SetSendKeyboardStatusFunc}, and use {@link OH_InputMethodController_Attach} to complete the 114 * registration.\n 115 * 116 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 117 * @param keyboardStatus Keyboard status, which is defined in {@link InputMethod_KeyboardStatus}. 118 * @since 12 119 */ 120 typedef void (*OH_TextEditorProxy_SendKeyboardStatusFunc)( 121 InputMethod_TextEditorProxy *textEditorProxy, InputMethod_KeyboardStatus keyboardStatus); 122 /** 123 * @brief Called when input method sending enter key. 124 * 125 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 126 * OH_TextEditorProxy_SetSendEnterKeyFunc}, and use {@link OH_InputMethodController_Attach} to complete the 127 * registration.\n 128 * 129 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 130 * @param enterKeyType Enter key type, which is defined in {@link InputMethod_EnterKeyType}. 131 * @since 12 132 */ 133 typedef void (*OH_TextEditorProxy_SendEnterKeyFunc)( 134 InputMethod_TextEditorProxy *textEditorProxy, InputMethod_EnterKeyType enterKeyType); 135 /** 136 * @brief Called when input method requesting to move cursor. 137 * 138 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 139 * OH_TextEditorProxy_SetMoveCursorFunc}, and use {@link OH_InputMethodController_Attach} to complete the 140 * registration.\n 141 * 142 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 143 * @param direction Represents the direction of the cursor movement, which is defined in {@link InputMethod_Direction}. 144 * @since 12 145 */ 146 typedef void (*OH_TextEditorProxy_MoveCursorFunc)( 147 InputMethod_TextEditorProxy *textEditorProxy, InputMethod_Direction direction); 148 /** 149 * @brief Called when input method requesting to set selection. 150 * 151 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 152 * OH_TextEditorProxy_SetHandleSetSelectionFunc}, and use {@link OH_InputMethodController_Attach} to complete the 153 * registration.\n 154 * 155 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 156 * @param start Represents the start position of the selection. 157 * @param end Represents the end position of the selection. 158 * @since 12 159 */ 160 typedef void (*OH_TextEditorProxy_HandleSetSelectionFunc)( 161 InputMethod_TextEditorProxy *textEditorProxy, int32_t start, int32_t end); 162 /** 163 * @brief Called when input method sending extend action. 164 * 165 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 166 * OH_TextEditorProxy_SetHandleExtendActionFunc}, and use {@link OH_InputMethodController_Attach} to complete the 167 * registration.\n 168 * 169 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 170 * @param action Represents the extend action, which is defined in {@link InputMethod_ExtendAction}. 171 * @since 12 172 */ 173 typedef void (*OH_TextEditorProxy_HandleExtendActionFunc)( 174 InputMethod_TextEditorProxy *textEditorProxy, InputMethod_ExtendAction action); 175 /** 176 * @brief Called when input method requesting to get left text of cursor. 177 * 178 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 179 * OH_TextEditorProxy_SetGetLeftTextOfCursorFunc}, and use {@link OH_InputMethodController_Attach} to complete the 180 * registration.\n 181 * 182 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 183 * @param number Represents the number of characters to be get. 184 * @param text Represents the left text of cursor, you need to assing this parameter. 185 * @param length Represents the length of the left text of cursor, you need to assing this parameter. 186 * @since 12 187 */ 188 typedef void (*OH_TextEditorProxy_GetLeftTextOfCursorFunc)( 189 InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length); 190 /** 191 * @brief Called when input method requesting to get right text of cursor. 192 * 193 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 194 * OH_TextEditorProxy_SetGetRightTextOfCursorFunc}, and use {@link OH_InputMethodController_Attach} to complete the 195 * registration.\n 196 * 197 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 198 * @param number Represents the number of characters to be get. 199 * @param text Represents the right text of cursor, you need to assing this parameter. 200 * @param length Represents the length of the right text of cursor. 201 * @since 12 202 */ 203 typedef void (*OH_TextEditorProxy_GetRightTextOfCursorFunc)( 204 InputMethod_TextEditorProxy *textEditorProxy, int32_t number, char16_t text[], size_t *length); 205 /** 206 * @brief Called when input method requesting to get text index at cursor. 207 * 208 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 209 * OH_TextEditorProxy_SetGetTextIndexAtCursorFunc}, and use {@link OH_InputMethodController_Attach} to complete the 210 * registration.\n 211 * 212 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 213 * @return Returns the index of text at cursor. 214 * @since 12 215 */ 216 typedef int32_t (*OH_TextEditorProxy_GetTextIndexAtCursorFunc)(InputMethod_TextEditorProxy *textEditorProxy); 217 /** 218 * @brief Called when input method sending private command. 219 * 220 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 221 * OH_TextEditorProxy_SetReceivePrivateCommandFunc}, and use {@link OH_InputMethodController_Attach} to complete the 222 * registration.\n 223 * 224 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 225 * @param privateCommand Private command from input method. 226 * @param size Size of private command. 227 * @return Returns the result of handling private command. 228 * @since 12 229 */ 230 typedef int32_t (*OH_TextEditorProxy_ReceivePrivateCommandFunc)( 231 InputMethod_TextEditorProxy *textEditorProxy, InputMethod_PrivateCommand *privateCommand[], size_t size); 232 /** 233 * @brief Called when input method setting preview text. 234 * 235 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 236 * OH_TextEditorProxy_SetReceivePrivateCommandFunc}, and use {@link OH_InputMethodController_Attach} to complete the 237 * registration.\n 238 * 239 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 240 * @param text Represents text to be previewd. 241 * @param length Length of preview text. 242 * @param start Start position of preview text. 243 * @param end End position of preview text. 244 * @return Returns the result of setting preview text. 245 * @since 12 246 */ 247 typedef int32_t (*OH_TextEditorProxy_SetPreviewTextFunc)( 248 InputMethod_TextEditorProxy *textEditorProxy, const char16_t text[], size_t length, int32_t start, int32_t end); 249 /** 250 * @brief Called when input method finishing preview text. 251 * 252 * You need to implement this function, set it to {@link InputMethod_TextEditorProxy} through {@link 253 * OH_TextEditorProxy_SetReceivePrivateCommandFunc}, and use {@link OH_InputMethodController_Attach} to complete the 254 * registration.\n 255 * 256 * @param textEditorProxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set in. 257 * @since 12 258 */ 259 typedef void (*OH_TextEditorProxy_FinishTextPreviewFunc)(InputMethod_TextEditorProxy *textEditorProxy); 260 261 /** 262 * @brief Create a new {@link InputMethod_TextEditorProxy} instance. 263 * 264 * @return If the creation succeeds, a pointer to the newly created {@link InputMethod_TextEditorProxy} 265 * instance is returned. If the creation fails, NULL is returned, possible cause is insufficient memory. 266 * @since 12 267 */ 268 InputMethod_TextEditorProxy *OH_TextEditorProxy_Create(void); 269 /** 270 * @brief Destroy a {@link InputMethod_TextEditorProxy} instance. 271 * 272 * @param proxy The {@link InputMethod_TextEditorProxy} instance to be destroyed. 273 * @since 12 274 */ 275 void OH_TextEditorProxy_Destroy(InputMethod_TextEditorProxy *proxy); 276 /** 277 * @brief Set function {@link OH_TextEditorProxy_GetTextConfigFunc} into {@link InputMethod_TextEditorProxy}. 278 * 279 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 280 * @param getTextConfigFunc Represents function {@link OH_TextEditorProxy_GetTextConfigFunc} which will be set. 281 * @return Returns a specific error code. 282 * {@link IME_ERR_OK} - success. 283 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 284 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 285 * @since 12 286 */ 287 InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextConfigFunc( 288 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc getTextConfigFunc); 289 /** 290 * @brief Set function {@link OH_TextEditorProxy_InsertTextFunc} into {@link InputMethod_TextEditorProxy}. 291 * 292 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 293 * @param insertTextFunc Represents function {@link OH_TextEditorProxy_InsertTextFunc} which will be set. 294 * @return Returns a specific error code. 295 * {@link IME_ERR_OK} - success. 296 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 297 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 298 * @since 12 299 */ 300 InputMethod_ErrorCode OH_TextEditorProxy_SetInsertTextFunc( 301 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc insertTextFunc); 302 /** 303 * @brief Set function {@link OH_TextEditorProxy_SetDeleteForwardFunc} into {@link InputMethod_TextEditorProxy}. 304 * 305 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 306 * @param deleteForwardFunc Represents function {@link OH_TextEditorProxy_DeleteForwardFunc} which will be set. 307 * @return Returns a specific error code. 308 * {@link IME_ERR_OK} - success. 309 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 310 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 311 * @since 12 312 */ 313 InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteForwardFunc( 314 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc deleteForwardFunc); 315 /** 316 * @brief Set function {@link OH_TextEditorProxy_DeleteBackwardFunc} into {@link InputMethod_TextEditorProxy}. 317 * 318 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 319 * @param deleteBackwardFunc Represents function {@link OH_TextEditorProxy_DeleteBackwardFunc} which will be set. 320 * @return Returns a specific error code. 321 * {@link IME_ERR_OK} - success. 322 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 323 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 324 * @since 12 325 */ 326 InputMethod_ErrorCode OH_TextEditorProxy_SetDeleteBackwardFunc( 327 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc deleteBackwardFunc); 328 /** 329 * @brief Set function {@link OH_TextEditorProxy_SendKeyboardStatusFunc} into {@link InputMethod_TextEditorProxy}. 330 * 331 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 332 * @param sendKeyboardStatusFunc Represents function {@link OH_TextEditorProxy_SendKeyboardStatusFunc} which will be 333 * set. 334 * @return Returns a specific error code. 335 * {@link IME_ERR_OK} - success. 336 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 337 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 338 * @since 12 339 */ 340 InputMethod_ErrorCode OH_TextEditorProxy_SetSendKeyboardStatusFunc( 341 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc sendKeyboardStatusFunc); 342 /** 343 * @brief Set function {@link OH_TextEditorProxy_SendEnterKeyFunc} into {@link InputMethod_TextEditorProxy}. 344 * 345 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 346 * @param sendEnterKeyFunc Represents function {@link OH_TextEditorProxy_SendEnterKeyFunc} which will be set. 347 * @return Returns a specific error code. 348 * {@link IME_ERR_OK} - success. 349 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 350 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 351 * @since 12 352 */ 353 InputMethod_ErrorCode OH_TextEditorProxy_SetSendEnterKeyFunc( 354 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc sendEnterKeyFunc); 355 /** 356 * @brief Set function {@link OH_TextEditorProxy_MoveCursorFunc} into {@link InputMethod_TextEditorProxy}. 357 * 358 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 359 * @param moveCursorFunc Represents function {@link OH_TextEditorProxy_MoveCursorFunc} which will be set. 360 * @return Returns a specific error code. 361 * {@link IME_ERR_OK} - success. 362 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 363 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 364 * @since 12 365 */ 366 InputMethod_ErrorCode OH_TextEditorProxy_SetMoveCursorFunc( 367 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc moveCursorFunc); 368 /** 369 * @brief Set function {@link OH_TextEditorProxy_HandleSetSelectionFunc} into {@link InputMethod_TextEditorProxy}. 370 * 371 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 372 * @param handleSetSelectionFunc Represents function {@link OH_TextEditorProxy_HandleSetSelectionFunc} which will be 373 * set. 374 * @return Returns a specific error code. 375 * {@link IME_ERR_OK} - success. 376 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 377 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 378 * @since 12 379 */ 380 InputMethod_ErrorCode OH_TextEditorProxy_SetHandleSetSelectionFunc( 381 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc handleSetSelectionFunc); 382 /** 383 * @brief Set function {@link OH_TextEditorProxy_HandleExtendActionFunc} into {@link InputMethod_TextEditorProxy}. 384 * 385 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 386 * @param handleExtendActionFunc Represents function {@link OH_TextEditorProxy_HandleExtendActionFunc} which will be 387 * set. 388 * @return Returns a specific error code. 389 * {@link IME_ERR_OK} - success. 390 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 391 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 392 * @since 12 393 */ 394 InputMethod_ErrorCode OH_TextEditorProxy_SetHandleExtendActionFunc( 395 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc handleExtendActionFunc); 396 /** 397 * @brief Set function {@link OH_TextEditorProxy_GetLeftTextOfCursorFunc} into {@link InputMethod_TextEditorProxy}. 398 * 399 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 400 * @param getLeftTextOfCursorFunc Represents function {@link OH_TextEditorProxy_GetLeftTextOfCursorFunc} which will 401 * be set. 402 * @return Returns a specific error code. 403 * {@link IME_ERR_OK} - success. 404 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 405 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 406 * @since 12 407 */ 408 InputMethod_ErrorCode OH_TextEditorProxy_SetGetLeftTextOfCursorFunc( 409 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc getLeftTextOfCursorFunc); 410 /** 411 * @brief Set function {@link OH_TextEditorProxy_GetRightTextOfCursorFunc} into {@link InputMethod_TextEditorProxy}. 412 * 413 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 414 * @param getRightTextOfCursorFunc Represents function {@link OH_TextEditorProxy_GetRightTextOfCursorFunc} which 415 * will be set. 416 * @return Returns a specific error code. 417 * {@link IME_ERR_OK} - success. 418 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 419 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 420 * @since 12 421 */ 422 InputMethod_ErrorCode OH_TextEditorProxy_SetGetRightTextOfCursorFunc( 423 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc getRightTextOfCursorFunc); 424 /** 425 * @brief Set function {@link OH_TextEditorProxy_GetTextIndexAtCursorFunc} into {@link InputMethod_TextEditorProxy}. 426 * 427 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 428 * @param getTextIndexAtCursorFunc Represents function {@link OH_TextEditorProxy_GetTextIndexAtCursorFunc} which 429 * will be set. 430 * @return Returns a specific error code. 431 * {@link IME_ERR_OK} - success. 432 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 433 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 434 * @since 12 435 */ 436 InputMethod_ErrorCode OH_TextEditorProxy_SetGetTextIndexAtCursorFunc( 437 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc getTextIndexAtCursorFunc); 438 /** 439 * @brief Set function {@link OH_TextEditorProxy_ReceivePrivateCommandFunc} into {@link InputMethod_TextEditorProxy}. 440 * 441 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 442 * @param receivePrivateCommandFunc Represents function {@link OH_TextEditorProxy_ReceivePrivateCommandFunc} which 443 * will be set. 444 * @return Returns a specific error code. 445 * {@link IME_ERR_OK} - success. 446 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 447 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 448 * @since 12 449 */ 450 InputMethod_ErrorCode OH_TextEditorProxy_SetReceivePrivateCommandFunc( 451 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc receivePrivateCommandFunc); 452 /** 453 * @brief Set function {@link OH_TextEditorProxy_SetPreviewTextFunc} into {@link InputMethod_TextEditorProxy}. 454 * 455 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 456 * @param setPreviewTextFunc Represents function {@link OH_TextEditorProxy_SetPreviewTextFunc} which will be set. 457 * @return Returns a specific error code. 458 * {@link IME_ERR_OK} - success. 459 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 460 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 461 * @since 12 462 */ 463 InputMethod_ErrorCode OH_TextEditorProxy_SetSetPreviewTextFunc( 464 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc setPreviewTextFunc); 465 /** 466 * @brief Set function {@link OH_TextEditorProxy_FinishTextPreviewFunc} into {@link InputMethod_TextEditorProxy}. 467 * 468 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be set function in. 469 * @param finishTextPreviewFunc Represents function {@link OH_TextEditorProxy_FinishTextPreviewFunc} which will be 470 * set. 471 * @return Returns a specific error code. 472 * {@link IME_ERR_OK} - success. 473 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 474 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 475 * @since 12 476 */ 477 InputMethod_ErrorCode OH_TextEditorProxy_SetFinishTextPreviewFunc( 478 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc finishTextPreviewFunc); 479 480 /** 481 * @brief Get function {@link OH_TextEditorProxy_GetTextConfigFunc} from {@link InputMethod_TextEditorProxy}. 482 * 483 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 484 * from. 485 * @param getTextConfigFunc Represents function {@link OH_TextEditorProxy_GetTextConfigFunc} which will be get. 486 * @return Returns a specific error code. 487 * {@link IME_ERR_OK} - success. 488 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 489 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 490 * @since 12 491 */ 492 InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextConfigFunc( 493 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextConfigFunc *getTextConfigFunc); 494 /** 495 * @brief Get function {@link OH_TextEditorProxy_InsertTextFunc} from {@link InputMethod_TextEditorProxy}. 496 * 497 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 498 * from. 499 * @param insertTextFunc Represents function {@link OH_TextEditorProxy_InsertTextFunc} which will be get. 500 * @return Returns a specific error code. 501 * {@link IME_ERR_OK} - success. 502 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 503 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 504 * @since 12 505 */ 506 InputMethod_ErrorCode OH_TextEditorProxy_GetInsertTextFunc( 507 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_InsertTextFunc *insertTextFunc); 508 /** 509 * @brief Get function {@link OH_TextEditorProxy_DeleteForwardFunc} from {@link InputMethod_TextEditorProxy}. 510 * 511 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 512 * from. 513 * @param deleteForwardFunc Represents function {@link OH_TextEditorProxy_DeleteForwardFunc} which will be get. 514 * @return Returns a specific error code. 515 * {@link IME_ERR_OK} - success. 516 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 517 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 518 * @since 12 519 */ 520 InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteForwardFunc( 521 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteForwardFunc *deleteForwardFunc); 522 /** 523 * @brief Get function {@link OH_TextEditorProxy_DeleteBackwardFunc} from {@link InputMethod_TextEditorProxy}. 524 * 525 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 526 * from. 527 * @param deleteBackwardFunc Represents function {@link OH_TextEditorProxy_DeleteBackwardFunc} which will be get. 528 * @return Returns a specific error code. 529 * {@link IME_ERR_OK} - success. 530 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 531 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 532 * @since 12 533 */ 534 InputMethod_ErrorCode OH_TextEditorProxy_GetDeleteBackwardFunc( 535 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_DeleteBackwardFunc *deleteBackwardFunc); 536 /** 537 * @brief Get function {@link OH_TextEditorProxy_SendKeyboardStatusFunc} from {@link InputMethod_TextEditorProxy}. 538 * 539 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 540 * from. 541 * @param sendKeyboardStatusFunc Represents function {@link OH_TextEditorProxy_SendKeyboardStatusFunc} which will be 542 * get. 543 * @return Returns a specific error code. 544 * {@link IME_ERR_OK} - success. 545 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 546 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 547 * @since 12 548 */ 549 InputMethod_ErrorCode OH_TextEditorProxy_GetSendKeyboardStatusFunc( 550 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendKeyboardStatusFunc *sendKeyboardStatusFunc); 551 /** 552 * @brief Get function {@link OH_TextEditorProxy_SendEnterKeyFunc} from {@link InputMethod_TextEditorProxy}. 553 * 554 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 555 * from. 556 * @param sendEnterKeyFunc Represents function {@link OH_TextEditorProxy_SendEnterKeyFunc} which will be get. 557 * @return Returns a specific error code. 558 * {@link IME_ERR_OK} - success. 559 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 560 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 561 * @since 12 562 */ 563 InputMethod_ErrorCode OH_TextEditorProxy_GetSendEnterKeyFunc( 564 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SendEnterKeyFunc *sendEnterKeyFunc); 565 /** 566 * @brief Get function {@link OH_TextEditorProxy_MoveCursorFunc} from {@link InputMethod_TextEditorProxy}. 567 * 568 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 569 * from. 570 * @param moveCursorFunc Represents function {@link OH_TextEditorProxy_MoveCursorFunc} which will be get. 571 * @return Returns a specific error code. 572 * {@link IME_ERR_OK} - success. 573 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 574 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 575 * @since 12 576 */ 577 InputMethod_ErrorCode OH_TextEditorProxy_GetMoveCursorFunc( 578 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_MoveCursorFunc *moveCursorFunc); 579 /** 580 * @brief Get function {@link OH_TextEditorProxy_HandleSetSelectionFunc} from {@link InputMethod_TextEditorProxy}. 581 * 582 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 583 * from. 584 * @param handleSetSelectionFunc Represents function {@link OH_TextEditorProxy_HandleSetSelectionFunc} which will be 585 * get. 586 * @return Returns a specific error code. 587 * {@link IME_ERR_OK} - success. 588 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 589 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 590 * @since 12 591 */ 592 InputMethod_ErrorCode OH_TextEditorProxy_GetHandleSetSelectionFunc( 593 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleSetSelectionFunc *handleSetSelectionFunc); 594 /** 595 * @brief Get function {@link OH_TextEditorProxy_HandleExtendActionFunc} from {@link InputMethod_TextEditorProxy}. 596 * 597 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 598 * from. 599 * @param handleExtendActionFunc Represents function {@link OH_TextEditorProxy_HandleExtendActionFunc} which will be 600 * get. 601 * @return Returns a specific error code. 602 * {@link IME_ERR_OK} - success. 603 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 604 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 605 * @since 12 606 */ 607 InputMethod_ErrorCode OH_TextEditorProxy_GetHandleExtendActionFunc( 608 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_HandleExtendActionFunc *handleExtendActionFunc); 609 /** 610 * @brief Get function {@link OH_TextEditorProxy_GetLeftTextOfCursorFunc} from {@link InputMethod_TextEditorProxy}. 611 * 612 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 613 * from. 614 * @param getLeftTextOfCursorFunc Represents function {@link OH_TextEditorProxy_GetLeftTextOfCursorFunc} which will 615 * be get. 616 * @return Returns a specific error code. 617 * {@link IME_ERR_OK} - success. 618 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 619 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 620 * @since 12 621 */ 622 InputMethod_ErrorCode OH_TextEditorProxy_GetGetLeftTextOfCursorFunc( 623 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetLeftTextOfCursorFunc *getLeftTextOfCursorFunc); 624 /** 625 * @brief Get function {@link OH_TextEditorProxy_GetRightTextOfCursorFunc} from {@link InputMethod_TextEditorProxy}. 626 * 627 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 628 * from. 629 * @param getRightTextOfCursorFunc Represents function {@link OH_TextEditorProxy_GetRightTextOfCursorFunc} which 630 * will be get. 631 * @return Returns a specific error code. 632 * {@link IME_ERR_OK} - success. 633 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 634 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 635 * @since 12 636 */ 637 InputMethod_ErrorCode OH_TextEditorProxy_GetGetRightTextOfCursorFunc( 638 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetRightTextOfCursorFunc *getRightTextOfCursorFunc); 639 /** 640 * @brief Get function {@link OH_TextEditorProxy_GetTextIndexAtCursorFunc} from {@link InputMethod_TextEditorProxy}. 641 * 642 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 643 * from. 644 * @param getTextIndexAtCursorFunc Represents function {@link OH_TextEditorProxy_GetTextIndexAtCursorFunc} which 645 * will be get. 646 * @return Returns a specific error code. 647 * {@link IME_ERR_OK} - success. 648 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 649 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 650 * @since 12 651 */ 652 InputMethod_ErrorCode OH_TextEditorProxy_GetGetTextIndexAtCursorFunc( 653 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_GetTextIndexAtCursorFunc *getTextIndexAtCursorFunc); 654 /** 655 * @brief Get function {@link OH_TextEditorProxy_ReceivePrivateCommandFunc} from {@link InputMethod_TextEditorProxy}. 656 * 657 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 658 * from. 659 * @param receivePrivateCommandFunc Represents function {@link OH_TextEditorProxy_ReceivePrivateCommandFunc} which 660 * will be get. 661 * @return Returns a specific error code. 662 * {@link IME_ERR_OK} - success. 663 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 664 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 665 * @since 12 666 */ 667 InputMethod_ErrorCode OH_TextEditorProxy_GetReceivePrivateCommandFunc( 668 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_ReceivePrivateCommandFunc *receivePrivateCommandFunc); 669 /** 670 * @brief Get function {@link OH_TextEditorProxy_SetPreviewTextFunc} from {@link InputMethod_TextEditorProxy}. 671 * 672 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 673 * from. 674 * @param setPreviewTextFunc Represents function {@link OH_TextEditorProxy_SetPreviewTextFunc} which will be get. 675 * @return Returns a specific error code. 676 * {@link IME_ERR_OK} - success. 677 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 678 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 679 * @since 12 680 */ 681 InputMethod_ErrorCode OH_TextEditorProxy_GetSetPreviewTextFunc( 682 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_SetPreviewTextFunc *setPreviewTextFunc); 683 /** 684 * @brief Get function {@link OH_TextEditorProxy_FinishTextPreviewFunc} from {@link InputMethod_TextEditorProxy}. 685 * 686 * @param proxy Represents a pointer to an {@link InputMethod_TextEditorProxy} instance which will be get function 687 * from. 688 * @param finishTextPreviewFunc Represents function {@link OH_TextEditorProxy_FinishTextPreviewFunc} which will be 689 * get. 690 * @return Returns a specific error code. 691 * {@link IME_ERR_OK} - success. 692 * {@link IME_ERR_NULL_POINTER} - unexpected null pointer. 693 * Specific error codes can be referenced {@link InputMethod_ErrorCode}. 694 * @since 12 695 */ 696 InputMethod_ErrorCode OH_TextEditorProxy_GetFinishTextPreviewFunc( 697 InputMethod_TextEditorProxy *proxy, OH_TextEditorProxy_FinishTextPreviewFunc *finishTextPreviewFunc); 698 #ifdef __cplusplus 699 } 700 #endif /* __cplusplus */ 701 /** @} */ 702 #endif // OHOS_INPUTMETHOD_TEXT_EDITOR_PROXY_CAP_H