目录

common_type.h

Overview

Defines the common types of ArkUI native APIs.

File to include: <arkui/common_type.h>

Library: libace_ndk.z.so

System capability: SystemCapability.ArkUI.ArkUI.Full

Since: 12

Related module: ArkUI_NativeModule

Summary

[h2]Structs

Name typedef Keyword Description
ArkUI_ContextCallback ArkUI_ContextCallback Defines an event callback type, which is used to define the callback function and its user-defined data. When an API of this type is called to trigger a callback, the callback is invoked and userData is passed as a parameter.
ArkUI_NumberValue ArkUI_NumberValue Defines a numeric type used by ArkUI on the native side, including floating-point, signed integer, and unsigned integer types.
ArkUI_AttributeItem ArkUI_AttributeItem Defines the setAttribute function. This is a general input parameter struct. Individual attribute-setting APIs can use appropriate member variables within it to store parameter data of specific types.
ArkUI_Rect ArkUI_Rect Defines a mask area.
ArkUI_IntSize ArkUI_IntSize Describes the width and height of a component.
ArkUI_IntOffset ArkUI_IntOffset Defines an offset, which describes the position of the current component relative to its parent component.
ArkUI_Node* ArkUI_NodeHandle Defines the pointer to an ArkUI native component object, which is used to identify and pass component instances in ArkUI native APIs, for example, creating, mounting, removing, or destroying component nodes.
ArkUI_NodeContent* ArkUI_NodeContentHandle Defines the pointer to the node content on the native side, which is used to reference and pass the NodeContent instance in native APIs.
ArkUI_LayoutConstraint ArkUI_LayoutConstraint Defines the layout constraint, which is used to limit the size range during component layout. You can set the minimum and maximum size constraints. The constraint values are non-negative floating-point numbers. During component layout, the system limits the final size range of the component based on the constraint values to ensure that the layout result meets the constraints. This struct is applicable to scenarios where the size range of child components needs to be controlled during custom layout container design. For example, in a waterfall layout, the height of image cards can be limited; in a grid layout, the size of cells can be limited. It is also applicable to scenarios where the upper and lower limits of the component size need to be restricted. For example, the maximum width of an image display component can be limited to prevent stretching, and the minimum size can be limited in a responsive layout to ensure readability. This prevents the component size from exceeding the expected range, enabling more precise layout control, improving the predictability and stability of the layout, and enhancing the controllability of the interface.
ArkUI_DrawContext ArkUI_DrawContext Defines component drawing context, which is used to provide drawing context information during the drawing of a custom component. You can obtain the canvas pointer used for drawing and the size of the drawing area.
ArkUI_Context ArkUI_Context Defines the context object of the native UI.
ArkUI_Context* ArkUI_ContextHandle Defines the pointer to the context object of ArkUI on the native side, which is used to represent the UI context of the page where the component is located. You can obtain the pointer through OH_ArkUI_GetContextByNode or OH_ArkUI_GetContextFromNapiValue and use it as the context input parameter for APIs such as UI task scheduling, animation, and focus control.
ArkUI_NodeEvent ArkUI_NodeEvent Defines a component event. This is a general struct type. This struct is used to pass event information in the component event handling process.