#[repr(C)]pub struct ArkUI_NativeNodeAPI_1 {Show 41 fields
pub version: i32,
pub createNode: Option<unsafe extern "C" fn(type_: ArkUI_NodeType) -> ArkUI_NodeHandle>,
pub disposeNode: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle)>,
pub addChild: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle) -> i32>,
pub removeChild: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle) -> i32>,
pub insertChildAfter: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle, sibling: ArkUI_NodeHandle) -> i32>,
pub insertChildBefore: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle, sibling: ArkUI_NodeHandle) -> i32>,
pub insertChildAt: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle, position: i32) -> i32>,
pub setAttribute: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, attribute: ArkUI_NodeAttributeType, item: *const ArkUI_AttributeItem) -> i32>,
pub getAttribute: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, attribute: ArkUI_NodeAttributeType) -> *const ArkUI_AttributeItem>,
pub resetAttribute: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, attribute: ArkUI_NodeAttributeType) -> i32>,
pub registerNodeEvent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventType: ArkUI_NodeEventType, targetId: i32, userData: *mut c_void) -> i32>,
pub unregisterNodeEvent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventType: ArkUI_NodeEventType)>,
pub registerNodeEventReceiver: Option<unsafe extern "C" fn(eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeEvent)>)>,
pub unregisterNodeEventReceiver: Option<unsafe extern "C" fn()>,
pub markDirty: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, dirtyFlag: ArkUI_NodeDirtyFlag)>,
pub getTotalChildCount: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> u32>,
pub getChildAt: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, position: i32) -> ArkUI_NodeHandle>,
pub getFirstChild: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>,
pub getLastChild: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>,
pub getPreviousSibling: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>,
pub getNextSibling: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>,
pub registerNodeCustomEvent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventType: ArkUI_NodeCustomEventType, targetId: i32, userData: *mut c_void) -> i32>,
pub unregisterNodeCustomEvent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventType: ArkUI_NodeCustomEventType)>,
pub registerNodeCustomEventReceiver: Option<unsafe extern "C" fn(eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeCustomEvent)>)>,
pub unregisterNodeCustomEventReceiver: Option<unsafe extern "C" fn()>,
pub setMeasuredSize: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, width: i32, height: i32) -> i32>,
pub setLayoutPosition: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, positionX: i32, positionY: i32) -> i32>,
pub getMeasuredSize: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_IntSize>,
pub getLayoutPosition: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_IntOffset>,
pub measureNode: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, Constraint: *mut ArkUI_LayoutConstraint) -> i32>,
pub layoutNode: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, positionX: i32, positionY: i32) -> i32>,
pub addNodeEventReceiver: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeEvent)>) -> i32>,
pub removeNodeEventReceiver: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeEvent)>) -> i32>,
pub addNodeCustomEventReceiver: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeCustomEvent)>) -> i32>,
pub removeNodeCustomEventReceiver: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeCustomEvent)>) -> i32>,
pub setUserData: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, userData: *mut c_void) -> i32>,
pub getUserData: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> *mut c_void>,
pub setLengthMetricUnit: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, unit: ArkUI_LengthMetricUnit) -> i32>,
pub getParent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>,
pub removeAllChildren: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle) -> i32>,
}api-12 only.Expand description
Declares a collection of native node APIs provided by ArkUI.
The APIs related to the native node must be called in the main thread.
Version: 1
Available since API-level: 12
Fields§
§version: i32Struct version.
createNode: Option<unsafe extern "C" fn(type_: ArkUI_NodeType) -> ArkUI_NodeHandle>Creates a component based on ArkUI_NodeType and returns the pointer to the created component.
§Arguments
type- Indicates the type of component to create.
§Returns
- Returns the pointer to the created component. If the component fails to be created, NULL is returned.
disposeNode: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle)>Destroys the component to which the specified pointer points.
§Arguments
node- Indicates the pointer.
addChild: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle) -> i32>Adds a component to a parent node.
§Arguments
-
parent- Indicates the pointer to the parent node. -
child- Indicates the pointer to the child node.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs. Returns [ARKUI_ERROR_CODE_NOT_SUPPROTED_FOR_ARKTS_NODE] if the following operations are not allowed on BuilderNode generated nodes: setting or resetting attributes, setting events, or adding or editing subnodes.
removeChild: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle) -> i32>Removes a component from its parent node.
§Arguments
-
parent- Indicates the pointer to the parent node. -
child- Indicates the pointer to the child node.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs. Returns [ARKUI_ERROR_CODE_NOT_SUPPROTED_FOR_ARKTS_NODE] if the following operations are not allowed on BuilderNode generated nodes: setting or resetting attributes, setting events, or adding or editing subnodes.
insertChildAfter: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle, sibling: ArkUI_NodeHandle) -> i32>Inserts a component to a parent node after the specified sibling node.
§Arguments
-
parent- Indicates the pointer to the parent node. -
child- Indicates the pointer to the child node. -
sibling- Indicates the pointer to the sibling node after which the target node is to be inserted. If the value is null, the node is inserted at the start of the parent node.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs. Returns [ARKUI_ERROR_CODE_NOT_SUPPROTED_FOR_ARKTS_NODE] if the following operations are not allowed on BuilderNode generated nodes: setting or resetting attributes, setting events, or adding or editing subnodes.
insertChildBefore: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle, sibling: ArkUI_NodeHandle) -> i32>Inserts a component to a parent node before the specified sibling node.
§Arguments
-
parent- Indicates the pointer to the parent node. -
child- Indicates the pointer to the child node. -
sibling- Indicates the pointer to the sibling node before which the target node is to be inserted. If the value is null, the node is inserted at the end of the parent node.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs. Returns [ARKUI_ERROR_CODE_NOT_SUPPROTED_FOR_ARKTS_NODE] if the following operations are not allowed on BuilderNode generated nodes: setting or resetting attributes, setting events, or adding or editing subnodes.
insertChildAt: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle, child: ArkUI_NodeHandle, position: i32) -> i32>Inserts a component to the specified position in a parent node.
§Arguments
-
parent- Indicates the pointer to the parent node. -
child- Indicates the pointer to the child node. -
position- Indicates the position to which the target child node is to be inserted. If the value is a negative number or invalid, the node is inserted at the end of the parent node.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs. Returns [ARKUI_ERROR_CODE_NOT_SUPPROTED_FOR_ARKTS_NODE] if the following operations are not allowed on BuilderNode generated nodes: setting or resetting attributes, setting events, or adding or editing subnodes.
setAttribute: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, attribute: ArkUI_NodeAttributeType, item: *const ArkUI_AttributeItem) -> i32>Sets the attribute of a node.
§Arguments
-
node- Indicates the node whose attribute needs to be set. -
attribute- Indicates the type of attribute to set. -
value- Indicates the attribute value.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs. Returns [ARKUI_ERROR_CODE_ATTRIBUTE_OR_EVENT_NOT_SUPPORTED] if the dynamic implementation library of the native API was not found. Returns [ARKUI_ERROR_CODE_NOT_SUPPROTED_FOR_ARKTS_NODE] if the following operations are not allowed on BuilderNode generated nodes: setting or resetting attributes, setting events, or adding or editing subnodes.
getAttribute: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, attribute: ArkUI_NodeAttributeType) -> *const ArkUI_AttributeItem>Obtains an attribute.
The pointer returned by this API is an internal buffer pointer of the ArkUI framework. As such, you do not need to call delete to release the memory. However, the pointer must be used before this API is called next time. Otherwise, the pointer may be overwritten by other values.
§Arguments
-
node- Indicates the node whose attribute needs to be obtained. -
attribute- Indicates the type of attribute to obtain.
§Returns
- Returns the attribute value. If the operation fails, a null pointer is returned.
resetAttribute: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, attribute: ArkUI_NodeAttributeType) -> i32>Resets an attribute.
§Arguments
-
node- Indicates the node whose attribute needs to be reset. -
attribute- Indicates the type of attribute to reset.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs. Returns [ARKUI_ERROR_CODE_ATTRIBUTE_OR_EVENT_NOT_SUPPORTED] if the dynamic implementation library of the native API was not found. Returns [ARKUI_ERROR_CODE_NOT_SUPPROTED_FOR_ARKTS_NODE] if the following operations are not allowed on BuilderNode generated nodes: setting or resetting attributes, setting events, or adding or editing subnodes.
registerNodeEvent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventType: ArkUI_NodeEventType, targetId: i32, userData: *mut c_void) -> i32>Registers an event for the specified node.
When the component is being displayed, this API must be called in the main thread.
§Arguments
-
node- Indicates the target node. -
eventType- Indicates the type of event to register. -
targetId- Indicates the custom event ID, which is passed in the callback ofArkUI_NodeEventwhen the event is triggered. -
userData- Indicates the custom event parameter, which is passed in the callback ofArkUI_NodeEvent
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs. Returns [ARKUI_ERROR_CODE_ATTRIBUTE_OR_EVENT_NOT_SUPPORTED] if the dynamic implementation library of the native API was not found. Returns [ARKUI_ERROR_CODE_NOT_SUPPROTED_FOR_ARKTS_NODE] if the following operations are not allowed on BuilderNode generated nodes: setting or resetting attributes, setting events, or adding or editing subnodes.
unregisterNodeEvent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventType: ArkUI_NodeEventType)>Unregisters an event for the specified node.
When the component is being displayed, this API must be called in the main thread.
§Arguments
-
node- Indicates the target node. -
eventType- Indicates the type of event to unregister.
registerNodeEventReceiver: Option<unsafe extern "C" fn(eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeEvent)>)>Registers an event receiver.
The ArkUI framework collects component events generated during the process and calls back the events through the registered event receiver.
A new call to this API will overwrite the previously registered event receiver.
Do not directly save the ArkUI_NodeEvent object pointer. The data will be destroyed after the callback is complete.
To bind with a component instance, you can use the addNodeEventReceiver function.
§Arguments
eventReceiver- Indicates the event receiver to register.
unregisterNodeEventReceiver: Option<unsafe extern "C" fn()>Unregisters the event receiver.
markDirty: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, dirtyFlag: ArkUI_NodeDirtyFlag)>Forcibly marks the current node that needs to be measured, laid out, or rendered again.
Regarding updates to system attributes, the ArkUI framework automatically marks the dirty area and performs measuring, layout, or rendering again. In this case, you do not need to call this API.
§Arguments
-
node- Indicates the node for which you want to mark as dirty area. -
dirtyFlag- Indicates type of dirty area.
getTotalChildCount: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> u32>Obtains the number of subnodes.
§Arguments
node- Indicates the target node.
§Returns
- the number of subnodes. If not, returns 0.
getChildAt: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, position: i32) -> ArkUI_NodeHandle>Obtains a subnode.
§Arguments
-
node- Indicates the target node. -
position- Indicates the position of the subnode.
§Returns
- Returns the pointer to the subnode if the subnode exists; returns NULL otherwise.
getFirstChild: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>Obtains the first subnode.
§Arguments
node- Indicates the target node.
§Returns
- Returns the pointer to the subnode if the subnode exists; returns NULL otherwise.
getLastChild: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>Obtains the last subnode.
§Arguments
node- Indicates the target node.
§Returns
- Returns the pointer to the subnode if the subnode exists; returns NULL otherwise.
getPreviousSibling: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>Obtains the previous sibling node.
§Arguments
node- Indicates the target node.
§Returns
- Returns the pointer to the subnode if the subnode exists; returns NULL otherwise.
getNextSibling: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>Obtains the next sibling node.
§Arguments
node- Indicates the target node.
§Returns
- Returns the pointer to the subnode if the subnode exists; returns NULL otherwise.
registerNodeCustomEvent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventType: ArkUI_NodeCustomEventType, targetId: i32, userData: *mut c_void) -> i32>Registers a custom event for a node. When the event is triggered, the value is returned through the entry point function registered by registerNodeCustomEventReceiver.
§Arguments
-
node- Indicates the target node. -
eventType- Indicates the type of event to register. -
targetId- Indicates the custom event ID, which is passed in the callback ofArkUI_NodeCustomEventwhen the event is triggered. -
userData- Indicates the custom event parameter, which is passed in the callback ofArkUI_NodeCustomEventwhen the event is triggered.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs. Returns [ARKUI_ERROR_CODE_ATTRIBUTE_OR_EVENT_NOT_SUPPORTED] if the dynamic implementation library of the native API was not found.
unregisterNodeCustomEvent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventType: ArkUI_NodeCustomEventType)>Unregisters a custom event for a node.
§Arguments
-
node- Indicates the target node. -
eventType- Indicates the type of event to unregister.
registerNodeCustomEventReceiver: Option<unsafe extern "C" fn(eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeCustomEvent)>)>Registers a unified entry point function for custom node event callbacks.
The ArkUI framework collects custom component events generated during the process and calls back the events through the registered registerNodeCustomEventReceiver.
A new call to this API will overwrite the previously registered event receiver. Do not directly save the ArkUI_NodeCustomEvent object pointer. The data will be destroyed after the callback is complete.
To bind with a component instance, you can use the addNodeCustomEventReceiver function.
§Arguments
eventReceiver- Indicates the event receiver to register.
unregisterNodeCustomEventReceiver: Option<unsafe extern "C" fn()>Unregisters the unified entry point function for custom node event callbacks.
setMeasuredSize: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, width: i32, height: i32) -> i32>Sets the width and height for a component after the measurement.
§Arguments
-
node- Indicates the target node. -
width- Indicates the width. -
height- Indicates the height.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs..
setLayoutPosition: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, positionX: i32, positionY: i32) -> i32>Sets the position for a component.
§Arguments
-
node- Indicates the target node. -
positionX- Indicates the X coordinate. -
positionY- Indicates the Y coordinate.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs..
getMeasuredSize: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_IntSize>Obtains the width and height of a component after measurement.
§Arguments
node- Indicates the target node.
§Returns
- Returns the width and height of the component.
getLayoutPosition: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_IntOffset>Obtains the position of a component after the layout is complete.
§Arguments
node- Indicates the target node.
§Returns
- Returns the position of the component.
measureNode: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, Constraint: *mut ArkUI_LayoutConstraint) -> i32>Measures a node. You can use the getMeasuredSize API to obtain the size after the measurement.
§Arguments
-
node- Indicates the target node. -
Constraint- Indicates the size constraint.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs..
layoutNode: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, positionX: i32, positionY: i32) -> i32>Lays outs a component and passes the expected position of the component relative to its parent component.
When the component is being displayed, this API must be called in the main thread.
§Arguments
-
node- Indicates the target node. -
positionX- Indicates the X coordinate. -
positionY- Indicates the Y coordinate.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs..
addNodeEventReceiver: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeEvent)>) -> i32>Adds a component event callback function to a component to receive component events generated by the component.
Unlike the global registration function registerNodeEventReceiver, this API allows multiple event receivers to be added to the same component.
The callback added by this API is triggered before the global callback registered by registerNodeEventReceiver.
Do not directly save the ArkUI_NodeEvent object pointer. The data will be destroyed after the callback is complete.
§Arguments
-
node- Indicates the component for which you want to add the event callback function. -
eventReceiver- Indicates the component event callback function to add.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs..
removeNodeEventReceiver: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeEvent)>) -> i32>Removes the registered component event callback function from a component.
§Arguments
-
node- Indicates the component from which you want to remove the event callback function. -
eventReceiver- Indicates the component event callback function to remove.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs..
addNodeCustomEventReceiver: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeCustomEvent)>) -> i32>Adds a custom event callback function to a component to receive custom events (such as layout and drawing events) generated by the component.
Unlike the global registration function registerNodeCustomEventReceiver, this API allows multiple event receivers to be added to the same component.
The callback added by this API is triggered before the global callback registered by registerNodeCustomEventReceiver.
Do not directly save the ArkUI_NodeCustomEvent object pointer. The data will be destroyed after the callback is complete.
§Arguments
-
node- Indicates the component for which you want to add the custom event callback function. -
eventReceiver- Indicates the custom event callback function to add.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.
removeNodeCustomEventReceiver: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, eventReceiver: Option<unsafe extern "C" fn(event: *mut ArkUI_NodeCustomEvent)>) -> i32>Removes a registered custom event callback function from a component.
§Arguments
-
node- Indicates the component from which you want to remove the custom event callback function. -
eventReceiver- Indicates the custom event callback function to remove.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.
setUserData: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, userData: *mut c_void) -> i32>Saves custom data on the specified component.
§Arguments
-
node- Indicates the component on which the custom data will be saved. -
userData- Indicates the custom data to be saved.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs..
getUserData: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> *mut c_void>Obtains the custom data saved on the specified component.
§Arguments
node- Indicates the target component.
§Returns
- Returns the custom data.
setLengthMetricUnit: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle, unit: ArkUI_LengthMetricUnit) -> i32>Sets the unit for a component.
§Arguments
-
node- Indicates the component for which you want to set the unit. -
unit- Indicates the unit, which is an enumerated value ofArkUI_LengthMetricUnit. The default value is ARKUI_LENGTH_METRIC_UNIT_DEFAULT.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.
getParent: Option<unsafe extern "C" fn(node: ArkUI_NodeHandle) -> ArkUI_NodeHandle>Get the parent node.
§Arguments
node- target node object.
§Returns
- Returns the pointer of the component, if not return NULL
removeAllChildren: Option<unsafe extern "C" fn(parent: ArkUI_NodeHandle) -> i32>Uninstall all child nodes from the parent component.
§Arguments
parent- target node object.
§Returns
- Returns the error code.
Returns [
ARKUI_ERROR_CODE_NO_ERROR] if the operation is successful. Returns [ARKUI_ERROR_CODE_PARAM_INVALID] if a parameter error occurs.
Available since API-level: 12
Trait Implementations§
Source§impl Clone for ArkUI_NativeNodeAPI_1
impl Clone for ArkUI_NativeNodeAPI_1
Source§fn clone(&self) -> ArkUI_NativeNodeAPI_1
fn clone(&self) -> ArkUI_NativeNodeAPI_1
1.0.0§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ArkUI_NativeNodeAPI_1
impl Debug for ArkUI_NativeNodeAPI_1
impl Copy for ArkUI_NativeNodeAPI_1
Auto Trait Implementations§
impl Freeze for ArkUI_NativeNodeAPI_1
impl RefUnwindSafe for ArkUI_NativeNodeAPI_1
impl Send for ArkUI_NativeNodeAPI_1
impl Sync for ArkUI_NativeNodeAPI_1
impl Unpin for ArkUI_NativeNodeAPI_1
impl UnwindSafe for ArkUI_NativeNodeAPI_1
Blanket Implementations§
§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§unsafe fn clone_to_uninit(&self, dest: *mut u8)
unsafe fn clone_to_uninit(&self, dest: *mut u8)
clone_to_uninit)