OH_ArkUI_NativeModule_RegisterCommonEvent

Function OH_ArkUI_NativeModule_RegisterCommonEvent 

Source
pub unsafe extern "C" fn OH_ArkUI_NativeModule_RegisterCommonEvent(
    node: ArkUI_NodeHandle,
    eventType: ArkUI_NodeEventType,
    userData: *mut c_void,
    callback: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeEvent)>,
) -> i32
Available on crate features api-12 and api-21 only.
Expand description

Register common event callback of target node.

§Arguments

  • node - The ArkUI-NodeHandle pointer.

  • eventType - Indicates the type of event to set.

  • userData - Indicates the pointer to the custom data.

  • callback - Indicates the event callback function.

§Returns

  • Returns the result code. Returns [ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] Function params is invalid. Returns [ARKUI_ERROR_CODE_NODE_UNSUPPORTED_EVENT_TYPE] Function parameter eventType is not supported.

Available since API-level: 21