openharmony 鸿蒙 capi-inputmethod-private-command-capi-h

2026-08-25 浏览 (1)

inputmethod_private_command_capi.h

Overview

Provides methods for creating, destroying, reading, and writing private data objects.

Header file: <inputmethod/inputmethod_private_command_capi.h>

Library: libohinputmethod.so

System capability: SystemCapability.MiscServices.InputMethodFramework

Since: 12

Related module: InputMethod

Summary

Structs

Nametypedef KeywordDescription
InputMethod_PrivateCommandInputMethod_PrivateCommandPrivate data exchanged between the text box and the input method application.

Functions

NameDescription
InputMethod_PrivateCommand *OH_PrivateCommand_Create(char key[], size_t keyLength)Creates an InputMethod_PrivateCommand instance.
void OH_PrivateCommand_Destroy(InputMethod_PrivateCommand *command)Destroys an InputMethod_PrivateCommand instance.
InputMethod_ErrorCode OH_PrivateCommand_SetKey(InputMethod_PrivateCommand *command, char key[], size_t keyLength)Sets the key value for InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_SetBoolValue(InputMethod_PrivateCommand *command, bool value)Sets the value of the Boolean type for InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_SetIntValue(InputMethod_PrivateCommand *command, int32_t value)Sets the value of the integer type for InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_SetStrValue(InputMethod_PrivateCommand *command, char value[], size_t valueLength)Sets the value of the string type for InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetKey(InputMethod_PrivateCommand *command, const char **key, size_t *keyLength)Obtains the key value from InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetValueType(InputMethod_PrivateCommand *command, InputMethod_CommandValueType *type)Obtains the data type of value from InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetBoolValue(InputMethod_PrivateCommand *command, bool *value)Obtains the value of the Boolean type from InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetIntValue(InputMethod_PrivateCommand *command, int32_t *value)Obtains the value of the integer type from InputMethod_PrivateCommand.
InputMethod_ErrorCode OH_PrivateCommand_GetStrValue(InputMethod_PrivateCommand *command, const char **value, size_t *valueLength)Obtains the value of the string type from InputMethod_PrivateCommand.

Function Description

OH_PrivateCommand_Create()

InputMethod_PrivateCommand *OH_PrivateCommand_Create(char key[], size_t keyLength)

Description

Creates an InputMethod_PrivateCommand instance.

Since: 12

Parameters

NameDescription
char key[]Key value of the private data.
size_t keyLengthKey length. The total size of all private data and keys in a single operation cannot exceed 32 KB.

Returns

TypeDescription
InputMethod_PrivateCommand *If the operation is successful, a pointer to the created InputMethod_PrivateCommand instance is returned.
If the operation failed, NULL is returned, which may be caused by insufficient application address space.

OH_PrivateCommand_Destroy()

void OH_PrivateCommand_Destroy(InputMethod_PrivateCommand *command)

Description

Destroys an InputMethod_PrivateCommand instance.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance to be destroyed.

OH_PrivateCommand_SetKey()

InputMethod_ErrorCode OH_PrivateCommand_SetKey(InputMethod_PrivateCommand *command, char key[], size_t keyLength)

Description

Sets the key value for InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance to be set.
char key[]Key value.
size_t keyLengthKey length.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

OH_PrivateCommand_SetBoolValue()

InputMethod_ErrorCode OH_PrivateCommand_SetBoolValue(InputMethod_PrivateCommand *command, bool value)

Description

Sets the value of the Boolean type for InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance to be set.
bool valueBoolean value.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

OH_PrivateCommand_SetIntValue()

InputMethod_ErrorCode OH_PrivateCommand_SetIntValue(InputMethod_PrivateCommand *command, int32_t value)

Description

Sets the value of the integer type for InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance to be set.
int32_t valueValue of the integer type.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

OH_PrivateCommand_SetStrValue()

InputMethod_ErrorCode OH_PrivateCommand_SetStrValue(InputMethod_PrivateCommand *command, char value[], size_t valueLength)

Description

Sets the value of the string type for InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance to be set.
char value[]Value of the string type.
size_t valueLengthValue length.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

OH_PrivateCommand_GetKey()

InputMethod_ErrorCode OH_PrivateCommand_GetKey(InputMethod_PrivateCommand *command, const char **key, size_t *keyLength)

Description

Obtains the key value from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance from which the key value is to be obtained.
const char **keyThe lifespan of key is consistent with that of command. You are advised to copy instead of directly saving the key address or writing key.
size_t *keyLengthKey length.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

OH_PrivateCommand_GetValueType()

InputMethod_ErrorCode OH_PrivateCommand_GetValueType(InputMethod_PrivateCommand *command, InputMethod_CommandValueType *type)

Description

Obtains the data type of value from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance from which the value is to be obtained.
InputMethod_CommandValueType *typePointer to the InputMethod_CommandValueType instance, used to indicate the data type of the value.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
For details about the error codes, see InputMethod_ErrorCode.

OH_PrivateCommand_GetBoolValue()

InputMethod_ErrorCode OH_PrivateCommand_GetBoolValue(InputMethod_PrivateCommand *command, bool *value)

Description

Obtains the value of the Boolean type from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance from which the value is to be obtained.
bool *valueBoolean value.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
IME_ERR_QUERY_FAILED - Query failed as the command contains no Boolean value.
For details about the error codes, see InputMethod_ErrorCode.

OH_PrivateCommand_GetIntValue()

InputMethod_ErrorCode OH_PrivateCommand_GetIntValue(InputMethod_PrivateCommand *command, int32_t *value)

Description

Obtains the value of the integer type from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance from which the value is to be obtained.
int32_t *valueValue of the integer type.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
IME_ERR_QUERY_FAILED - Query failed because the command does not contain an integer value.
For details about the error codes, see InputMethod_ErrorCode.

OH_PrivateCommand_GetStrValue()

InputMethod_ErrorCode OH_PrivateCommand_GetStrValue(InputMethod_PrivateCommand *command, const char **value, size_t *valueLength)

Description

Obtains the value of the string type from InputMethod_PrivateCommand.

Since: 12

Parameters

NameDescription
InputMethod_PrivateCommand *commandPointer to the InputMethod_PrivateCommand instance from which the value is to be obtained.
const char **valueValue of the string type.
size_t *valueLengthThe lifespan of value is consistent with that of command. You are advised to copy instead of directly saving the value address or writing value.

Returns

TypeDescription
InputMethod_ErrorCodeAn error code.
IME_ERR_OK - Success.
IME_ERR_NULL_POINTER - An unexpected null pointer.
IME_ERR_QUERY_FAILED - Query failed because the command does not contain a string value.
For details about the error codes, see InputMethod_ErrorCode.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 capi-inputmethod-inputmethod-textconfig

openharmony 鸿蒙 js-apis-inputmethod-extension-context

openharmony 鸿蒙 js-apis-inputmethod-subtype

openharmony 鸿蒙 capi-inputmethod-inputmethod-proxy-capi-h

openharmony 鸿蒙 capi-inputmethod-text-editor-proxy-capi-h

openharmony 鸿蒙 capi-inputmethod-controller-capi-h

openharmony 鸿蒙 capi-inputmethod

openharmony 鸿蒙 js-apis-inputmethod-panel

openharmony 鸿蒙 js-apis-inputmethodengine

openharmony 鸿蒙 capi-inputmethod-cursor-info-capi-h

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/0ep5qs31