Signed-off-by: fenglinbailu <liubin249@huawei.com>

🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[0%]
This commit is contained in:
fenglinbailu
2026-06-13 18:39:30 +08:00
37 changed files with 8870 additions and 4011 deletions
+13 -3
View File
@@ -43,7 +43,6 @@ if (!is_arkui_x) {
"native_type.h",
"native_type_visual.h",
"node_attributes",
"node_types",
"styled_string.h",
"ui_input_event.h",
]
@@ -72,12 +71,23 @@ if (!is_arkui_x) {
"arkui/native_type_visual.h",
"arkui/node_attributes/layout.h",
"arkui/node_attributes/navigation_router/navigation_router.h",
"arkui/node_attributes/node_attr_custom.h",
"arkui/node_attributes/image.h",
"arkui/node_attributes/image_animator.h",
"arkui/node_attributes/custom_attributes.h",
"arkui/node_attributes/picker.h",
"arkui/node_attributes/swiper/node_attr_swiper.h",
"arkui/node_attributes/swiper/node_event_swiper.h",
"arkui/node_attributes/swiper/swiper.h",
"arkui/node_types/native_type_common.h",
"arkui/node_attributes/common_attributes.h",
"arkui/node_attributes/embedded_component.h",
"arkui/node_attributes/custom_span.h",
"arkui/node_attributes/image_span.h",
"arkui/node_attributes/progress.h",
"arkui/node_attributes/rich_editor.h",
"arkui/node_attributes/text.h",
"arkui/node_attributes/text_area.h",
"arkui/node_attributes/text_common.h",
"arkui/node_attributes/text_input.h",
"arkui/node_attributes/xcomponent.h",
"arkui/styled_string.h",
"arkui/ui_input_event.h",
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -40,6 +40,8 @@
#include "native_type.h"
#include "ui_input_event.h"
#include "node_attributes/custom_attributes.h"
#ifdef __cplusplus
#include <cstdint>
#else
@@ -11311,8 +11313,6 @@ typedef enum {
NODE_NEED_RENDER,
} ArkUI_NodeDirtyFlag;
#include "node_attributes/node_attr_custom.h"
/**
* @brief Defines the general structure of a custom component event.
*
File diff suppressed because it is too large Load Diff
File diff suppressed because it is too large Load Diff
@@ -24,7 +24,7 @@
*/
/**
* @file native_type_common.h
* @file common_attributes.h
*
* @brief Defines the common property and method types for the native module.
*
@@ -34,8 +34,8 @@
* @since 12
*/
#ifndef ARKUI_NATIVE_TYPE_COMMON_H
#define ARKUI_NATIVE_TYPE_COMMON_H
#ifndef ARKUI_COMMON_ATTRIBUTES_H
#define ARKUI_COMMON_ATTRIBUTES_H
#include <stdint.h>
#include <stdbool.h>
@@ -397,5 +397,5 @@ bool OH_ArkUI_VisibleAreaEventOptions_GetMeasureFromViewport(ArkUI_VisibleAreaEv
};
#endif
#endif // ARKUI_NATIVE_TYPE_COMMON_H
#endif // ARKUI_COMMON_ATTRIBUTES_H
/** @} */
@@ -23,7 +23,7 @@
*/
/**
* @file node_attr_custom.h
* @file custom_attributes.h
*
* @brief Provides custom node event definitions for <b>NativeNode</b> APIs.
*
@@ -0,0 +1,184 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Defines a set of CustomSpan enum and interface.
*
* @since 12
*/
/**
* @file custom_span.h
*
* @brief Defines a set of CustomSpan enum and interface.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_CUSTOM_SPAN_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_CUSTOM_SPAN_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Defines a struct for the measurement information of a custom span.
*
* @since 12
*/
typedef struct ArkUI_CustomSpanMeasureInfo ArkUI_CustomSpanMeasureInfo;
/**
* @brief Defines a struct for the measurement metrics of a custom span.
*
* @since 12
*/
typedef struct ArkUI_CustomSpanMetrics ArkUI_CustomSpanMetrics;
/**
* @brief Defines a struct for the drawing information of a custom span.
*
* @since 12
*/
typedef struct ArkUI_CustomSpanDrawInfo ArkUI_CustomSpanDrawInfo;
/**
* @brief Disposes of measurement information of this custom span.
*
* @param info The CustomSpanMeasureInfo instance to be destroyed.
* @since 12
*/
void OH_ArkUI_CustomSpanMeasureInfo_Dispose(ArkUI_CustomSpanMeasureInfo* info);
/**
* @brief Obtains the font size of a custom span.
*
* @param info Indicates the pointer to the measurement information of a custom span.
* @return Returns the font size. If a parameter error occurs, <b>0.0f</b> is returned.
* <br> Possible causes: Parameter verification failed, the parameter should not be nullptr.
* @since 12
*/
float OH_ArkUI_CustomSpanMeasureInfo_GetFontSize(ArkUI_CustomSpanMeasureInfo* info);
/**
* @brief Disposes of measurement metrics of this custom span.
*
* @param metrics The CustomSpanMetrics instance to be destroyed.
* @since 12
*/
void OH_ArkUI_CustomSpanMetrics_Dispose(ArkUI_CustomSpanMetrics* metrics);
/**
* @brief Sets the width for a custom span.
*
* @param metrics Indicates the pointer to a <b>CustomSpanMetrics</b> instance.
* @param width Indicates the width, in px. The width should be greater than 0.
* @return Returns the result code.
* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* <br> Possible causes: Parameter verification failed, the parameter should not be nullptr.
* @since 12
*/
int32_t OH_ArkUI_CustomSpanMetrics_SetWidth(ArkUI_CustomSpanMetrics* metrics, float width);
/**
* @brief Sets the height for a custom span.
*
* @param metrics Indicates the pointer to a <b>CustomSpanMetrics</b> instance.
* @param width Indicates the height, in px. The width should be greater than 0.
* @return Returns the result code.
* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* <br> Possible causes: Parameter verification failed, the parameter should not be nullptr.
* @since 12
*/
int32_t OH_ArkUI_CustomSpanMetrics_SetHeight(ArkUI_CustomSpanMetrics* metrics, float height);
/**
* @brief Disposes of drawing information for this custom span.
*
* @param info The CustomSpanDrawInfo instance to be destroyed.
* @since 12
*/
void OH_ArkUI_CustomSpanDrawInfo_Dispose(ArkUI_CustomSpanDrawInfo* info);
/**
* @brief Obtains the x-axis offset of the custom span relative to the mounted component.
*
* @param info Indicates the pointer to the drawing information of a custom span.
* @return Returns the x-axis offset. If a parameter error occurs, <b>0.0f</b> is returned.
* <br> Possible causes: Parameter verification failed, the parameter should not be nullptr.
* @since 12
*/
float OH_ArkUI_CustomSpanDrawInfo_GetXOffset(ArkUI_CustomSpanDrawInfo* info);
/**
* @brief Obtains the top margin of the custom span relative to the mounted component.
*
* @param info Indicates the pointer to the drawing information of a custom span.
* @return Returns the top margin. If a parameter error occurs, <b>0.0f</b> is returned.
* <br> Possible causes: Parameter verification failed, the parameter should not be nullptr.
* @since 12
*/
float OH_ArkUI_CustomSpanDrawInfo_GetLineTop(ArkUI_CustomSpanDrawInfo* info);
/**
* @brief Obtains the bottom margin of the custom span relative to the mounted component.
*
* @param info Indicates the pointer to the drawing information of a custom span.
* @return Returns the bottom margin. If a parameter error occurs, <b>0.0f</b> is returned.
* <br> Possible causes: Parameter verification failed, the parameter should not be nullptr.
* @since 12
*/
float OH_ArkUI_CustomSpanDrawInfo_GetLineBottom(ArkUI_CustomSpanDrawInfo* info);
/**
* @brief Obtains the baseline offset of the custom span relative to the mounted component.
*
* @param info Indicates the pointer to the drawing information of a custom span.
* @return Returns the baseline offset. If a parameter error occurs, <b>0.0f</b> is returned.
* <br> Possible causes: Parameter verification failed, the parameter should not be nullptr.
* @since 12
*/
float OH_ArkUI_CustomSpanDrawInfo_GetBaseline(ArkUI_CustomSpanDrawInfo* info);
/**
* @brief Creates measurement information for this custom span.
*
* @return Returns a <b>CustomSpanMeasureInfo</b> instance.
* <br> If the result returns nullptr, there may be out of memory.
* @since 12
*/
ArkUI_CustomSpanMeasureInfo* OH_ArkUI_CustomSpanMeasureInfo_Create(void);
/**
* @brief Creates measurement metrics for this custom span.
*
* @return Returns a <b>CustomSpanMetrics</b> instance.
* <br> If the result returns nullptr, there may be out of memory.
* @since 12
*/
ArkUI_CustomSpanMetrics* OH_ArkUI_CustomSpanMetrics_Create(void);
/**
* @brief Creates drawing information for this custom span.
*
* @return Returns a <b>CustomSpanDrawInfo</b> instance.
* <br> If the result returns nullptr, there may be out of memory.
* @since 12
*/
ArkUI_CustomSpanDrawInfo* OH_ArkUI_CustomSpanDrawInfo_Create(void);
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_CUSTOM_SPAN_H
/** @} */
@@ -0,0 +1,355 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Provides Image type definitions of ArkUI on the native side.
*
* @since 12
*/
/**
* @file image.h
*
* @brief Defines the common types for the Image component.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_IMAGE_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_IMAGE_H
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enumerates the image repeat patterns.
*
* @since 12
*/
typedef enum {
/**
* The image is not repeatedly drawn.
*
* @since 12
*/
ARKUI_IMAGE_REPEAT_NONE = 0,
/**
* The image is repeatedly drawn only along the x-axis.
*
* @since 12
*/
ARKUI_IMAGE_REPEAT_X = 1,
/**
* The image is repeatedly drawn only along the y-axis.
*
* @since 12
*/
ARKUI_IMAGE_REPEAT_Y = 2,
/**
* The image is repeatedly drawn along both axes.
*
* @since 12
*/
ARKUI_IMAGE_REPEAT_XY = 3,
} ArkUI_ImageRepeat;
/**
* @brief Defines the image size.
*
* @since 12
*/
typedef enum {
/**
* The original image aspect ratio is retained.
*
* @since 12
*/
ARKUI_IMAGE_SIZE_AUTO = 0,
/**
* The image is scaled with its aspect ratio retained for both sides to be greater than or equal
* to the display boundaries.
*
* @since 12
*/
ARKUI_IMAGE_SIZE_COVER = 1,
/**
* The image is scaled with its aspect ratio retained for the content to be completely displayed
* within the display boundaries.
*
* @since 12
*/
ARKUI_IMAGE_SIZE_CONTAIN = 2,
} ArkUI_ImageSize;
/**
* @brief Defines how the image is resized to fit its container.
*
* @since 12
*/
typedef enum {
/**
* The image is scaled with its aspect ratio retained for the content to be completely displayed
* within the display boundaries.
*
* @since 12
*/
ARKUI_OBJECT_FIT_CONTAIN = 0,
/**
* The image is scaled with its aspect ratio retained for both sides to be greater than or
* equal to the display boundaries.
*
* @since 12
*/
ARKUI_OBJECT_FIT_COVER = 1,
/**
* The image is scaled automatically to fit the display area.
*
* @since 12
*/
ARKUI_OBJECT_FIT_AUTO = 2,
/**
* The image is scaled to fill the display area, and its aspect ratio is not retained.
*
* @since 12
*/
ARKUI_OBJECT_FIT_FILL = 3,
/**
* The image content is displayed with its aspect ratio retained. The size is smaller than or
* equal to the original size.
*
* @since 12
*/
ARKUI_OBJECT_FIT_SCALE_DOWN = 4,
/**
* The original size is retained.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE = 5,
/**
* Not resized, the image is aligned with the start edge of the top of the container.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_START = 6,
/**
* Not resized, the image is horizontally centered at the top of the container.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP = 7,
/**
* Not resized, the image is aligned with the end edge at the top of the container.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_END = 8,
/**
* Not resized, the image is vertically centered on the start edge of the container.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE_AND_ALIGN_START = 9,
/**
* Not resized, the image is horizontally and vertically centered in the container.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE_AND_ALIGN_CENTER = 10,
/**
* Not resized, the image is vertically centered on the end edge of the container.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE_AND_ALIGN_END = 11,
/**
* Not resized, the image is aligned with the start edge at the bottom of the container.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_START = 12,
/**
* Not resized, the image is horizontally centered at the bottom of the container.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM = 13,
/**
* Not resized, the image is aligned with the end edge at the bottom of the container.
*
* @since 12
*/
ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_END = 14,
/**
* Not resized, and is used in conjunction with NODE_IMAGE_IMAGE_MATRIX.
*
* @since 21
*/
ARKUI_OBJECT_FIT_NONE_MATRIX = 15,
} ArkUI_ObjectFit;
/**
* @brief Enumerates the image interpolation effect.
*
* @since 12
*/
typedef enum {
/**
* No image interpolation.
*
* @since 12
*/
ARKUI_IMAGE_INTERPOLATION_NONE = 0,
/**
* Low quality interpolation.
*
* @since 12
*/
ARKUI_IMAGE_INTERPOLATION_LOW = 1,
/**
* Medium quality interpolation.
*
* @since 12
*/
ARKUI_IMAGE_INTERPOLATION_MEDIUM = 2,
/**
* High quality interpolation. This mode produces scaled images of the highest possible quality.
*
* @since 12
*/
ARKUI_IMAGE_INTERPOLATION_HIGH = 3,
} ArkUI_ImageInterpolation;
/**
* @brief Enumerates the image dynamic range mode.
*
* @since 21
*/
typedef enum {
/**
* high dynamic range mode.
*
* @since 21
*/
ARKUI_DYNAMIC_RANGE_MODE_HIGH = 0,
/**
* constraint dynamic range mode.
*
* @since 21
*/
ARKUI_DYNAMIC_RANGE_MODE_CONSTRAINT = 1,
/**
* standard dynamic range mode.
*
* @since 21
*/
ARKUI_DYNAMIC_RANGE_MODE_STANDARD = 2,
} ArkUI_DynamicRangeMode;
/**
* @brief Enumerates the image rotate orientation.
*
* @since 21
*/
typedef enum {
/**
* Use EXIF metadata for display orientation, with support for rotation and mirroring.
*
* @since 21
*/
ARKUI_ORIENTATION_AUTO = 0,
/**
* Display original pixel data without transformation.
*
* @since 21
*/
ARKUI_ORIENTATION_UP = 1,
/**
* Display the image after rotating it 90 degrees clockwise.
*
* @since 21
*/
ARKUI_ORIENTATION_RIGHT = 2,
/**
* Display the image after rotating it 180 degrees clockwise.
*
* @since 21
*/
ARKUI_ORIENTATION_DOWN = 3,
/**
* Display the image after rotating it 270 degrees clockwise.
*
* @since 21
*/
ARKUI_ORIENTATION_LEFT = 4,
/**
* Display the image after flipping it horizontally.
*
* @since 21
*/
ARKUI_ORIENTATION_UP_MIRRORED = 5,
/**
* Display the image after flipping it horizontally and then rotating it 90 degrees clockwise.
*
* @since 21
*/
ARKUI_ORIENTATION_RIGHT_MIRRORED = 6,
/**
* Display the image after flipping it vertically.
*
* @since 21
*/
ARKUI_ORIENTATION_DOWN_MIRRORED = 7,
/**
* Display the image after flipping it horizontally and then rotating it 270 degrees clockwise.
*
* @since 21
*/
ARKUI_ORIENTATION_LEFT_MIRRORED = 8,
} ArkUI_ImageRotateOrientation;
/**
* @brief Enumerates the image rendering modes.
*
* @since 12
*/
typedef enum {
/**
* Render image pixels as they are in the original source image.
*
* @since 12
*/
ARKUI_IMAGE_RENDER_MODE_ORIGINAL = 0,
/**
* Render image pixels to create a monochrome template image.
*
* @since 12
*/
ARKUI_IMAGE_RENDER_MODE_TEMPLATE = 1,
} ArkUI_ImageRenderMode;
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_IMAGE_H
/** @} */
@@ -0,0 +1,215 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Provides ImageAnimator type definitions of ArkUI on the native side.
*
* @since 12
*/
/**
* @file image_animator.h
*
* @brief Defines the common types and APIs for the ImageAnimator component.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_IMAGE_ANIMATOR_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_IMAGE_ANIMATOR_H
#include <stdint.h>
#include "../drawable_descriptor.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Defines the playback status for the image animator.
*
* @since 12
*/
typedef enum {
/**
* The animation is in the initial state.
*
* @since 12
*/
ARKUI_ANIMATION_STATUS_INITIAL = 0,
/**
* The animation is being played.
*
* @since 12
*/
ARKUI_ANIMATION_STATUS_RUNNING = 1,
/**
* The animation is paused.
*
* @since 12
*/
ARKUI_ANIMATION_STATUS_PAUSED = 2,
/**
* The animation is stopped.
*
* @since 12
*/
ARKUI_ANIMATION_STATUS_STOPPED = 3,
} ArkUI_AnimationStatus;
/**
* @brief Defines the image frame.
*
* @since 12
*/
typedef struct ArkUI_ImageAnimatorFrameInfo ArkUI_ImageAnimatorFrameInfo;
/**
* @brief Create a image frame from the image path.
* @param src Indicates the image path.
* @return Returns the pointer to the image frame object.
* If a null pointer is returned, the object fails to be created. The possible cause is that
* the src parameter is abnormal, for example, the pointer is null.
* @since 12
*/
ArkUI_ImageAnimatorFrameInfo* OH_ArkUI_ImageAnimatorFrameInfo_CreateFromString(char* src);
/**
* @brief Create a image frame from the drawable descriptor.
*
* @param drawable Indicates the pointer to the drawable descriptor.
* @return Returns the pointer to the image frame object. If a null pointer is returned, the object fails to be created.
* The possible cause is that the drawable parameter is abnormal, for example, the pointer is null.
* @since 12
*/
ArkUI_ImageAnimatorFrameInfo* OH_ArkUI_ImageAnimatorFrameInfo_CreateFromDrawableDescriptor(
ArkUI_DrawableDescriptor* drawable);
/**
* @brief Destroy the pointer to the image frame.
*
* @param imageInfo Indicates the pointer to the image frame.
* @since 12
*/
void OH_ArkUI_ImageAnimatorFrameInfo_Dispose(ArkUI_ImageAnimatorFrameInfo* imageInfo);
/**
* @brief Set the width of the image frame.
*
* @param imageInfo Indicates the pointer to the image frame.
* @param width Indicates the width of the image frame, and the unit is PX.
* @since 12
*/
void OH_ArkUI_ImageAnimatorFrameInfo_SetWidth(ArkUI_ImageAnimatorFrameInfo* imageInfo, int32_t width);
/**
* @brief Get the width of the image frame.
*
* @param imageInfo Indicates the pointer to the image frame.
* @return Return the width of the image frame, and the unit is PX. Return 0 when the imageInfo is null.
* @since 12
*/
int32_t OH_ArkUI_ImageAnimatorFrameInfo_GetWidth(ArkUI_ImageAnimatorFrameInfo* imageInfo);
/**
* @brief Set the height of the image frame.
*
* @param imageInfo Indicates the pointer to the image frame.
* @param height Indicates the height of the image frame, and the unit is PX.
* @since 12
*/
void OH_ArkUI_ImageAnimatorFrameInfo_SetHeight(ArkUI_ImageAnimatorFrameInfo* imageInfo, int32_t height);
/**
* @brief Get the height of the image frame.
*
* @param imageInfo Indicates the pointer to the image frame.
* @return Return the height of the image frame, and the unit is PX. Return 0 when the imageInfo is null.
* @since 12
*/
int32_t OH_ArkUI_ImageAnimatorFrameInfo_GetHeight(ArkUI_ImageAnimatorFrameInfo* imageInfo);
/**
* @brief Set the vertical coordinate of the image relative to the upper left corner of the widget.
*
* @param imageInfo Indicates the pointer to the image frame.
* @param top Indicates the vertical coordinate of the image relative to the upper left corner of the widget,
* and the unit is PX.
* @since 12
*/
void OH_ArkUI_ImageAnimatorFrameInfo_SetTop(ArkUI_ImageAnimatorFrameInfo* imageInfo, int32_t top);
/**
* @brief Get the vertical coordinate of the image relative to the upper left corner of the widget.
*
* @param imageInfo Indicates the pointer to the image frame.
* @return Returns the vertical coordinate of the image relative to the upper left corner of the widget,
* and the unit is PX. Return 0 when the imageInfo is null.
* @since 12
*/
int32_t OH_ArkUI_ImageAnimatorFrameInfo_GetTop(ArkUI_ImageAnimatorFrameInfo* imageInfo);
/**
* @brief Set the horizontal coordinate of the image relative to the upper left corner of the widget.
*
* @param imageInfo Indicates the pointer to the image frame.
* @param left Indicates the horizontal coordinate of the image relative to the upper left corner of the widget,
* and the unit is PX.
* @since 12
*/
void OH_ArkUI_ImageAnimatorFrameInfo_SetLeft(ArkUI_ImageAnimatorFrameInfo* imageInfo, int32_t left);
/**
* @brief Get the horizontal coordinate of the image relative to the upper left corner of the widget.
*
* @param imageInfo Indicates the pointer to the image frame.
* @return Returns the horizontal coordinate of the image relative to the upper left corner of the widget,
* and the unit is PX. Return 0 when the imageInfo is null.
* @since 12
*/
int32_t OH_ArkUI_ImageAnimatorFrameInfo_GetLeft(ArkUI_ImageAnimatorFrameInfo* imageInfo);
/**
* @brief Set the playback duration of the image frame.
*
* @param imageInfo Indicates the pointer to the image frame.
* @param duration Indicates the playback duration of each image frame, and the unit is milliseconds.
* @since 12
*/
void OH_ArkUI_ImageAnimatorFrameInfo_SetDuration(ArkUI_ImageAnimatorFrameInfo* imageInfo, int32_t duration);
/**
* @brief Get the playback duration of the image frame.
*
* @param imageInfo Indicates the pointer to the image frame.
* @return Returns the playback duration of the image frame, and the unit is milliseconds.
* Return 0 when the imageInfo is null.
* @since 12
*/
int32_t OH_ArkUI_ImageAnimatorFrameInfo_GetDuration(ArkUI_ImageAnimatorFrameInfo* imageInfo);
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_IMAGE_ANIMATOR_H
/** @} */
@@ -0,0 +1,72 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Defines a set of ImageSpan enum and interface.
*
* @since 12
*/
/**
* @file image_span.h
*
* @brief Defines a set of ImageSpan enum and interface.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_IMAGE_SPAN_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_IMAGE_SPAN_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enumerates the alignment mode of the image with the text.
*
* @since 12
*/
typedef enum {
/** The image is bottom aligned with the text baseline. */
ARKUI_IMAGE_SPAN_ALIGNMENT_BASELINE = 0,
/** The image is bottom aligned with the text. */
ARKUI_IMAGE_SPAN_ALIGNMENT_BOTTOM,
/** The image is centered aligned with the text. */
ARKUI_IMAGE_SPAN_ALIGNMENT_CENTER,
/** The image is top aligned with the text. */
ARKUI_IMAGE_SPAN_ALIGNMENT_TOP,
/**
* The image alignment mode follows the text component's alignment mode.
*
* @since 20
*/
ARKUI_IMAGE_SPAN_ALIGNMENT_FOLLOW_PARAGRAPH,
} ArkUI_ImageSpanAlignment;
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_IMAGE_SPAN_H
/** @} */
@@ -0,0 +1,427 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Provides picker type definitions of ArkUI on the native side.
*
* @since 12
*/
/**
* @file picker.h
*
* @brief Defines the common types and APIs for picker components.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_PICKER_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_PICKER_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enumerates the modes of the date picker.
*
* @since 18
*/
typedef enum {
/**
* A mode that displays the date in months, days of month, and years.
*
* @since 18
*/
ARKUI_DATEPICKER_MODE_DATE = 0,
/**
* A mode that displays the date in months and years.
*
* @since 18
*/
ARKUI_DATEPICKER_YEAR_AND_MONTH = 1,
/**
* A mode that displays the date in months and days of the month.
*
* @since 18
*/
ARKUI_DATEPICKER_MONTH_AND_DAY = 2,
} ArkUI_DatePickerMode;
/**
* @brief Enumerates the types of the text picker.
*
* @since 12
*/
typedef enum {
/**
* Single-column text picker.
*
* @since 12
*/
ARKUI_TEXTPICKER_RANGETYPE_SINGLE = 0,
/**
* Multi-column text picker.
*
* @since 12
*/
ARKUI_TEXTPICKER_RANGETYPE_MULTI = 1,
/**
* Single-column text picker with image resources.
*
* @since 12
*/
ARKUI_TEXTPICKER_RANGETYPE_RANGE_CONTENT = 2,
/**
* Interconnected multi-column text picker.
*
* @since 12
*/
ARKUI_TEXTPICKER_RANGETYPE_CASCADE_RANGE_CONTENT = 3,
} ArkUI_TextPickerRangeType;
/**
* @brief Defines the input structure of the single-column text picker with image resources.
*
* @since 12
*/
typedef struct {
/**
* Image resource.
*
* @since 12
*/
const char* icon;
/**
* Text information.
*
* @since 12
*/
const char* text;
} ARKUI_TextPickerRangeContent;
/**
* @brief Defines the input structure of the interconnected multi-column text picker.
*
* @since 12
*/
typedef struct {
/**
* Text information.
*
* @since 12
*/
const char* text;
/**
* Interconnected data.
*
* @since 12
*/
const ARKUI_TextPickerRangeContent* children;
/**
* Size of the interconnected data array.
*
* @since 12
*/
int32_t size;
} ARKUI_TextPickerCascadeRangeContent;
/**
* @brief Enumerates the alignment modes between the calendar picker and the entry component.
*
* @since 12
*/
typedef enum {
/**
* Left aligned.
*
* @since 12
*/
ARKUI_CALENDAR_ALIGNMENT_START = 0,
/**
* Center aligned.
*
* @since 12
*/
ARKUI_CALENDAR_ALIGNMENT_CENTER = 1,
/**
* Right aligned.
*
* @since 12
*/
ARKUI_CALENDAR_ALIGNMENT_END = 2,
} ArkUI_CalendarAlignment;
/**
* @brief Enumerates the selected indicator type of picker.
*
* @since 23
*/
typedef enum {
/**
* background.
*
* @since 23
*/
ARKUI_PICKER_INDICATOR_BACKGROUND = 0,
/**
* divider.
*
* @since 23
*/
ARKUI_PICKER_INDICATOR_DIVIDER = 1,
} ArkUI_PickerIndicatorType;
/**
* @brief Style parameters of background indicator.
*
* @since 23
*/
typedef struct {
/**
* background color, 0xARGB format for example <b>0xFF1122FF</b>
*
* @since 23
*/
uint32_t backgroundColor;
/**
* radius of the top left corner.
*
* @since 23
*/
float topLeftRadius;
/**
* radius of the top right corner
*
* @since 23
*/
float topRightRadius;
/**
* radius of the bottom left corner
*
* @since 23
*/
float bottomLeftRadius;
/**
* radius of the bottom right corner.
*
* @since 23
*/
float bottomRightRadius;
} ArkUI_PickerIndicatorBackground;
/**
* @brief Style parameters of divider indicator.
*
* @since 23
*/
typedef struct {
/**
* stroke width
*
* @since 23
*/
float strokeWidth;
/**
* divider color, 0xARGB format for example <b>0xFF1122FF</b>
*
* @since 23
*/
uint32_t dividerColor;
/**
* the distance between the divider and the beginning of the side of the picker (unit: vp).
*
* @since 23
*/
float startMargin;
/**
* the distance between the divider and the end of the side of the picker (unit: vp).
*
* @since 23
*/
float endMargin;
} ArkUI_PickerIndicatorDivider;
/**
* @brief Definition of indicator style.
*
* @since 23
*/
typedef struct ArkUI_PickerIndicatorStyle ArkUI_PickerIndicatorStyle;
/**
* @brief TextPicker single column selector, supports mixing text and images.
*
* @since 19
*/
typedef struct ArkUI_TextPickerRangeContentArray ArkUI_TextPickerRangeContentArray;
/**
* @brief TextPicker multi column selector, supports mixing text and images.
*
* @since 19
*/
typedef struct ArkUI_TextCascadePickerRangeContentArray ArkUI_TextCascadePickerRangeContentArray;
/**
* @brief Creates a TextPickerRangeContent instance.
*
* @param length The length of the picker array. Value range: [1, +infinity).
* @return Returns a pointer to the created instance on success. Initialize each item of the array
* as a null pointer;call {@link OH_ArkUI_TextPickerRangeContentArray_SetIconAtIndex} and/or
* {@link OH_ArkUI_TextPickerRangeContentArray_SetTextAtIndex} for each index as needed.
* Returns <b>nullptr</b> if <b>length</b> is not in <b>[1, +infinity)</b>.
* When the object is no longer used, release it with {@link OH_ArkUI_TextPickerRangeContentArray_Destroy}.
* @since 19
*/
ArkUI_TextPickerRangeContentArray* OH_ArkUI_TextPickerRangeContentArray_Create(int32_t length);
/**
* @brief Sets the icon resource path or URI for one item in an {@link ArkUI_TextPickerRangeContentArray}.
*
* @param handle Pointer returned by {@link OH_ArkUI_TextPickerRangeContentArray_Create}. If <b>nullptr</b>, this
* function has no effect.
* @param icon Null-terminated C string for the icon (path or URI). The content is copied into the array; the caller
* keeps ownership of <b>icon</b>. If <b>nullptr</b>, this function has no effect.
* @param index Index of the item to set. Valid values are greater than or equal to <b>0</b> and less than the
* <b>length</b> argument passed to {@link OH_ArkUI_TextPickerRangeContentArray_Create}. Otherwise this function
* does nothing.
* @note If an icon was already set at <b>index</b>, the previous buffer is released before assigning the new value.
* @since 19
*/
void OH_ArkUI_TextPickerRangeContentArray_SetIconAtIndex(
ArkUI_TextPickerRangeContentArray* handle, char* icon, int32_t index);
/**
* @brief Sets the display text for one item in an {@link ArkUI_TextPickerRangeContentArray}.
*
* @param handle Pointer returned by {@link OH_ArkUI_TextPickerRangeContentArray_Create}. If <b>nullptr</b>, this
* function has no effect.
* @param text Null-terminated C string shown for the item. The content is copied into the array; the caller keeps
* ownership of <b>text</b>. If <b>nullptr</b>, this function has no effect.
* @param index Index of the item to set. Valid values are greater than or equal to <b>0</b> and less than the
* <b>length</b> argument passed to {@link OH_ArkUI_TextPickerRangeContentArray_Create}. Otherwise this function
* does nothing.
* @note If text was already set at <b>index</b>, the previous buffer is released before assigning the new value.
* @since 19
*/
void OH_ArkUI_TextPickerRangeContentArray_SetTextAtIndex(
ArkUI_TextPickerRangeContentArray* handle, char* text, int32_t index);
/**
* @brief Releases an {@link ArkUI_TextPickerRangeContentArray} created by
* {@link OH_ArkUI_TextPickerRangeContentArray_Create}.
*
* @param handle Instance to destroy. If <b>nullptr</b>, this function has no effect.
* @note After this call, <b>handle</b> must not be used. Do not pass pointers that were not returned by
* {@link OH_ArkUI_TextPickerRangeContentArray_Create}.
* @since 19
*/
void OH_ArkUI_TextPickerRangeContentArray_Destroy(ArkUI_TextPickerRangeContentArray* handle);
/**
* @brief Allocates one column level of an interconnected (cascade) TextPicker range. Use with range type
* {@link ARKUI_TEXTPICKER_RANGETYPE_CASCADE_RANGE_CONTENT}. The returned pointer addresses a contiguous array
* of sibling nodes; each node may carry display text and an optional next-level range from
* {@link OH_ArkUI_TextCascadePickerRangeContentArray_SetChildAtIndex}.
*
* @param length Number of sibling entries on this column. Value range: <b>[1, +infinity)</b>.
* @return Returns a pointer to the first sibling node when <b>length</b> is in <b>[1, +infinity)</b>; returns
* <b>nullptr</b> otherwise. The sibling count used for bounds checks equals <b>length</b>.
* @since 19
*/
ArkUI_TextCascadePickerRangeContentArray* OH_ArkUI_TextCascadePickerRangeContentArray_Create(int32_t length);
/**
* @brief Sets the display text for one sibling node on a cascade TextPicker level.
*
* @param handle Pointer returned by {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create}. If <b>nullptr</b>,
* this function has no effect.
* @param text Null-terminated C string. The content is copied; the caller keeps ownership of <b>text</b>. If
* <b>nullptr</b>, this function has no effect.
* @param index Index of the sibling to set. Valid values are greater than or equal to <b>0</b> and less than the
* <b>length</b> argument passed to {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create}. Otherwise this
* function does nothing.
* @note If text was already set at <b>index</b>, the previous buffer is released before assigning the new value.
* @since 19
*/
void OH_ArkUI_TextCascadePickerRangeContentArray_SetTextAtIndex(
ArkUI_TextCascadePickerRangeContentArray* handle, char* text, int32_t index);
/**
* @brief Sets the childs info of items in a multi text picker ranges.
*
* @param handle Pointer returned by {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create}. If <b>nullptr</b>,
* this function has no effect.
* @param child Pointer returned by {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create} for the child column.
* If <b>nullptr</b>, this function has no effect. If a subtree already exists at <b>index</b>, it is destroyed
* with {@link OH_ArkUI_TextCascadePickerRangeContentArray_Destroy} before the new <b>child</b> is stored.
* While <b>child</b> stays attached under the parent, the caller must not call
* {@link OH_ArkUI_TextCascadePickerRangeContentArray_Destroy} on <b>child</b>.
* @param index Index of the sibling that owns the subtree. Valid values are greater than or equal to <b>0</b> and less
* than the <b>length</b> argument passed to {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create}.
* Otherwise this function does nothing.
* @since 19
*/
void OH_ArkUI_TextCascadePickerRangeContentArray_SetChildAtIndex(
ArkUI_TextCascadePickerRangeContentArray* handle, ArkUI_TextCascadePickerRangeContentArray* child, int32_t index);
/**
* @brief Releases a cascade range level allocated with {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create}.
*
* @param handle Instance to destroy. If <b>nullptr</b>, this function has no effect.
* @note After this call, <b>handle</b> must not be used. Do not pass pointers that were not returned by
* {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create}.
* @note Do not call {@link OH_ArkUI_TextCascadePickerRangeContentArray_Destroy} on a <b>child</b> while
* it is still stored in a parent's {@code children}.
* @since 19
*/
void OH_ArkUI_TextCascadePickerRangeContentArray_Destroy(ArkUI_TextCascadePickerRangeContentArray* handle);
/**
* @brief Create the ArkUI_PickerIndicatorStyle instance.
*
* @param type The picker selection indicator enumeration type.
* @return ArkUI_PickerIndicatorStyle instance. If the instance returns a null pointer,
* it indicates creation failure, and the reason for the failure may be that the address space is full or
* the type not supported.
* @since 23
*/
ArkUI_PickerIndicatorStyle* OH_ArkUI_PickerIndicatorStyle_Create(ArkUI_PickerIndicatorType type);
/**
* @brief Destroy the ArkUI_PickerIndicatorStyle instance.
*
* @param style The ArkUI_PickerIndicatorStyle instance to be destroyed.
* @since 23
*/
void OH_ArkUI_PickerIndicatorStyle_Dispose(ArkUI_PickerIndicatorStyle* style);
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_PICKER_H
/** @} */
@@ -0,0 +1,158 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Defines a set of Progress enum and interface.
*
* @since 12
*/
/**
* @file progress.h
*
* @brief Defines a set of Progress enum and interface.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_PROGRESS_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_PROGRESS_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Set the linear progress indicator style.
*
* @since 15
*/
typedef struct ArkUI_ProgressLinearStyleOption ArkUI_ProgressLinearStyleOption;
/**
* @brief Enumerates the styles of the progress indicator.
*
* @since 12
*/
typedef enum {
/** Linear style. */
ARKUI_PROGRESS_TYPE_LINEAR = 0,
/** Indeterminate ring style. */
ARKUI_PROGRESS_TYPE_RING,
/** Eclipse style. */
ARKUI_PROGRESS_TYPE_ECLIPSE,
/** Determinate ring style. */
ARKUI_PROGRESS_TYPE_SCALE_RING,
/** Capsule style. */
ARKUI_PROGRESS_TYPE_CAPSULE,
} ArkUI_ProgressType;
/**
* @brief Destroy linear progress indicator style information.
*
* @param option Linear progress indicator style information.
* @since 15
*/
void OH_ArkUI_ProgressLinearStyleOption_Destroy(ArkUI_ProgressLinearStyleOption* option);
/**
* @brief Set whether the scan effect is enabled.
*
* @param option Linear progress indicator style information.
* @param enabled Whether to enable the scan effect. Default value: false.
* @since 15
*/
void OH_ArkUI_ProgressLinearStyleOption_SetScanEffectEnabled(ArkUI_ProgressLinearStyleOption* option, bool enabled);
/**
* @brief Set whether smoothing effect is enabled.
*
* @param option Linear progress indicator style information.
* @param enabled Whether to enable the smooth effect. When this effect is enabled, the progress change to
* the set value takes place gradually. Otherwise, it takes place immediately. Default value: true.
* @since 15
*/
void OH_ArkUI_ProgressLinearStyleOption_SetSmoothEffectEnabled(ArkUI_ProgressLinearStyleOption* option, bool enabled);
/**
* @brief Set linear progress indicator stroke width.
*
* @param option Linear progress indicator style information.
* @param strokeWidth Stroke width of the progress indicator. It cannot be set in percentage.
* Default value: 4.0vp.
* @since 15
*/
void OH_ArkUI_ProgressLinearStyleOption_SetStrokeWidth(ArkUI_ProgressLinearStyleOption* option, float strokeWidth);
/**
* @brief Set linear progress indicator stroke radius.
*
* @param option Linear progress indicator style information.
* @param strokeRadius Rounded corner radius of the progress indicator. Value range: [0, strokeWidth/2].
* Default value: strokeWidth/2.
* @since 15
*/
void OH_ArkUI_ProgressLinearStyleOption_SetStrokeRadius(ArkUI_ProgressLinearStyleOption* option, float strokeRadius);
/**
* @brief Get whether scan effect is enable.
*
* @param option Linear progress indicator style information.
* @return Whether to enable the scan effect.
* @since 15
*/
bool OH_ArkUI_ProgressLinearStyleOption_GetScanEffectEnabled(ArkUI_ProgressLinearStyleOption* option);
/**
* @brief Get whether smoothing effect is enabled.
*
* @param option Linear progress indicator style information.
* @return Whether to enable the smooth effect.
* @since 15
*/
bool OH_ArkUI_ProgressLinearStyleOption_GetSmoothEffectEnabled(ArkUI_ProgressLinearStyleOption* option);
/**
* @brief Get linear progress indicator stroke width.
*
* @param option Linear progress indicator style information.
* @return Stroke width of the progress indicator.
* @since 15
*/
float OH_ArkUI_ProgressLinearStyleOption_GetStrokeWidth(ArkUI_ProgressLinearStyleOption* option);
/**
* @brief Get linear progress indicator stroke radius.
*
* @param option Linear progress indicator style information.
* @return Rounded corner radius of the progress indicator.
* @since 15
*/
float OH_ArkUI_ProgressLinearStyleOption_GetStrokeRadius(ArkUI_ProgressLinearStyleOption* option);
/**
* @brief Create linear progress indicator style information.
*
* @return Returns a <b>ProgressLinearStyleOption</b> instance.
* <br> If the result returns nullptr, there may be out of memory.
* @since 15
*/
ArkUI_ProgressLinearStyleOption* OH_ArkUI_ProgressLinearStyleOption_Create(void);
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_PROGRESS_H
/** @} */
@@ -0,0 +1,262 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Defines a set of RichEditor enum and interface.
*
* @since 24
*/
/**
* @file rich_editor.h
*
* @brief Defines a set of RichEditor enum and interface.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 24
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_RICH_EDITOR_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_RICH_EDITOR_H
#include <stdint.h>
#include <stdbool.h>
#include "text_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Defines the text selection menu options of the text editor.
*
* @since 24
*/
typedef struct OH_ArkUI_TextEditorSelectionMenuOptions OH_ArkUI_TextEditorSelectionMenuOptions;
/**
* @brief Defines the hint text options when no content is entered in the text editor.
*
* @since 24
*/
typedef struct OH_ArkUI_TextEditorPlaceholderOptions OH_ArkUI_TextEditorPlaceholderOptions;
/**
* @brief Defines the attribute string controller of the text editor.
*
* @since 24
*/
typedef struct OH_ArkUI_TextEditorStyledStringController OH_ArkUI_TextEditorStyledStringController;
/**
* @brief Defines the paragraph style of the text editor.
*
* @since 24
*/
typedef struct OH_ArkUI_TextEditorParagraphStyle OH_ArkUI_TextEditorParagraphStyle;
/**
* @brief Defines the text style of the text editor.
*
* @since 24
*/
typedef struct OH_ArkUI_TextEditorTextStyle OH_ArkUI_TextEditorTextStyle;
/**
* @brief Enumerates vibration effect types.
*
* @since 24
*/
typedef enum {
/**
* No vibration.
* @since 24
*/
OH_ARKUI_HAPTIC_FEEDBACK_MODE_DISABLED = 0,
/**
* Vibration.
* @since 24
*/
OH_ARKUI_HAPTIC_FEEDBACK_MODE_ENABLED = 1,
/**
* System vibration.
* @since 24
*/
OH_ARKUI_HAPTIC_FEEDBACK_MODE_AUTO = 2,
} OH_ArkUI_HapticFeedbackMode;
/**
* @brief Enumerates the span types of a custom text selection menu.
*
* @since 24
*/
typedef enum {
/**
* Text span.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_SPAN_TYPE_TEXT = 0,
/**
* Image span.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_SPAN_TYPE_IMAGE = 1,
/**
* Mixed span.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_SPAN_TYPE_MIXED = 2,
/**
* Custom layout span.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_SPAN_TYPE_BUILDER = 3,
/**
* Default span.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_SPAN_TYPE_DEFAULT = 4
} OH_ArkUI_TextEditorSpanType;
/**
* @brief Enumerates the response types of a custom text selection menu.
*
* @since 24
*/
typedef enum {
/**
* The menu is displayed when the component is right-clicked.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_RESPONSE_TYPE_RIGHT_CLICK = 0,
/**
* The menu is displayed when the component is long-pressed.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_RESPONSE_TYPE_LONG_PRESS = 1,
/**
* The menu is displayed when the component is selected.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_RESPONSE_TYPE_SELECT = 2,
/**
* Default response type.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_RESPONSE_TYPE_DEFAULT = 3,
} OH_ArkUI_TextEditorResponseType;
/**
* @brief Enumerates text menu types.
*
* @since 24
*/
typedef enum {
/**
* Text selection menu.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_SELECTION_MENU = 0,
/**
* Preview menu.
* @since 24
*/
OH_ARKUI_TEXT_EDITOR_PREVIEW_MENU = 1,
} OH_ArkUI_TextMenuType;
/**
* @brief Creates an option object for the placeholder text used when there is no input. When the object is no longer
* used, call {@link OH_ArkUI_TextEditorPlaceholderOptions_Destroy} to destroy it.
*
* @return Pointer to the {@link OH_ArkUI_TextEditorPlaceholderOptions} object.
* @since 24
*/
OH_ArkUI_TextEditorPlaceholderOptions* OH_ArkUI_TextEditorPlaceholderOptions_Create();
/**
* @brief Destroys the option object for the placeholder text used when there is no input.
*
* @param options Pointer to the {@link OH_ArkUI_TextEditorPlaceholderOptions} object.
* @since 24
*/
void OH_ArkUI_TextEditorPlaceholderOptions_Destroy(OH_ArkUI_TextEditorPlaceholderOptions* options);
/**
* @brief Creates a styled string controller object for the text editor. When the object is no longer used, call
* {@link OH_ArkUI_TextEditorStyledStringController_Destroy} to destroy it.
*
* @return Pointer to the {@link OH_ArkUI_TextEditorStyledStringController} object.
* @since 24
*/
OH_ArkUI_TextEditorStyledStringController* OH_ArkUI_TextEditorStyledStringController_Create();
/**
* @brief Destroys the styled string controller object.
*
* @param controller Pointer to the {@link OH_ArkUI_TextEditorStyledStringController} object.
* @since 24
*/
void OH_ArkUI_TextEditorStyledStringController_Destroy(OH_ArkUI_TextEditorStyledStringController* controller);
/**
* @brief Creates a paragraph style object for the text editor. When the object is no longer used, call
* {@link OH_ArkUI_TextEditorParagraphStyle_Destroy} to destroy it.
*
* @return Pointer to the {@link OH_ArkUI_TextEditorParagraphStyle} object.
* @since 24
*/
OH_ArkUI_TextEditorParagraphStyle* OH_ArkUI_TextEditorParagraphStyle_Create();
/**
* @brief Destroys the paragraph style object.
*
* @param style Pointer to the {@link OH_ArkUI_TextEditorParagraphStyle} object.
* @since 24
*/
void OH_ArkUI_TextEditorParagraphStyle_Destroy(OH_ArkUI_TextEditorParagraphStyle* style);
/**
* @brief Creates a text style object. When the object is no longer used, call
* {@link OH_ArkUI_TextEditorTextStyle_Destroy} to destroy it.
*
* @return Pointer to the {@link OH_ArkUI_TextEditorTextStyle} object.
* @since 24
*/
OH_ArkUI_TextEditorTextStyle* OH_ArkUI_TextEditorTextStyle_Create();
/**
* @brief Destroys the text style object.
*
* @param style Pointer to the {@link OH_ArkUI_TextEditorTextStyle} object.
* @since 24
*/
void OH_ArkUI_TextEditorTextStyle_Destroy(OH_ArkUI_TextEditorTextStyle* style);
/**
* @brief Creates a text selection menu option object of the text editor. When the object is no longer used, call
* {@link OH_ArkUI_TextEditorSelectionMenuOptions_Destroy} to destroy it.
*
* @return Pointer to the {@link OH_ArkUI_TextEditorSelectionMenuOptions} object.
* @since 24
*/
OH_ArkUI_TextEditorSelectionMenuOptions* OH_ArkUI_TextEditorSelectionMenuOptions_Create();
/**
* @brief Destroys the text selection menu option object of the text editor.
*
* @param options Pointer to the {@link OH_ArkUI_TextEditorSelectionMenuOptions} object.
* @since 24
*/
void OH_ArkUI_TextEditorSelectionMenuOptions_Destroy(OH_ArkUI_TextEditorSelectionMenuOptions* options);
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_RICH_EDITOR_H
/** @} */
@@ -0,0 +1,486 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Defines a set of Text enum and interface.
*
* @since 12
*/
/**
* @file text.h
*
* @brief Defines a set of Text enum and interface.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_H
#include <stdint.h>
#include <stdbool.h>
#include "text_common.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enumerates the font styles.
*
* @since 12
*/
typedef enum {
/** Standard font style. */
ARKUI_FONT_STYLE_NORMAL = 0,
/** Italic font style. */
ARKUI_FONT_STYLE_ITALIC
} ArkUI_FontStyle;
/**
* @brief Enumerates the font weights.
*
* @since 12
*/
typedef enum {
/** 100 */
ARKUI_FONT_WEIGHT_W100 = 0,
/** 200 */
ARKUI_FONT_WEIGHT_W200,
/** 300 */
ARKUI_FONT_WEIGHT_W300,
/** 400 */
ARKUI_FONT_WEIGHT_W400,
/** 500 */
ARKUI_FONT_WEIGHT_W500,
/** 600 */
ARKUI_FONT_WEIGHT_W600,
/** 700 */
ARKUI_FONT_WEIGHT_W700,
/** 800 */
ARKUI_FONT_WEIGHT_W800,
/** 900 */
ARKUI_FONT_WEIGHT_W900,
/** The font weight is bold. */
ARKUI_FONT_WEIGHT_BOLD,
/** The font weight is normal. */
ARKUI_FONT_WEIGHT_NORMAL,
/** The font weight is bolder. */
ARKUI_FONT_WEIGHT_BOLDER,
/** The font weight is lighter. */
ARKUI_FONT_WEIGHT_LIGHTER,
/** The font weight is medium. */
ARKUI_FONT_WEIGHT_MEDIUM,
/** The font weight is normal. */
ARKUI_FONT_WEIGHT_REGULAR,
} ArkUI_FontWeight;
/**
* @brief Defines how the adaptive height is determined for the text.
*
* @since 12
*/
typedef enum {
/** Prioritize the <b>maxLines</b> settings. */
ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MAX_LINES_FIRST = 0,
/** Prioritize the <b>minFontSize</b> settings. */
ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MIN_FONT_SIZE_FIRST,
/** Prioritize the layout constraint settings in terms of height. */
ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_LAYOUT_CONSTRAINT_FIRST,
} ArkUI_TextHeightAdaptivePolicy;
/**
* @brief Defines the entity type for text recognition.
*
* @since 12
*/
typedef enum {
/** Phone Number.*/
ARKUI_TEXT_DATA_DETECTOR_TYPE_PHONE_NUMBER = 0,
/** Link. */
ARKUI_TEXT_DATA_DETECTOR_TYPE_URL,
/** Mailbox. */
ARKUI_TEXT_DATA_DETECTOR_TYPE_EMAIL,
/** Address. */
ARKUI_TEXT_DATA_DETECTOR_TYPE_ADDRESS,
} ArkUI_TextDataDetectorType;
/**
* @brief Defines the configuration of text entity recognition.
*
* @since 24
*/
typedef struct OH_ArkUI_TextDataDetectorConfig OH_ArkUI_TextDataDetectorConfig;
/**
* @brief Enumerates the MarqueeStartPolicy.
*
* @since 23
*/
typedef enum {
/** Start marquee in any case. This is the default policy. */
ARKUI_MARQUEESTARTPOLICY_DEFAULT = 0,
/** Start marquee only when get focus. */
ARKUI_MARQUEESTARTPOLICY_ONFOCUS = 1
} ArkUI_MarqueeStartPolicy;
/**
* @brief Enumerates the MarqueeUpdatePolicy.
*
* @since 23
*/
typedef enum {
/** Reset scroll position and restart scroll. */
ARKUI_MARQUEEUPDATEPOLICY_DEFAULT = 0,
/** Preserve scroll position, just change to new text. */
ARKUI_MARQUEEUPDATEPOLICY_PRESERVEPOSITION = 1
} ArkUI_MarqueeUpdatePolicy;
/**
* @brief Defines the marquee options of text.
*
* @since 23
*/
typedef struct ArkUI_TextMarqueeOptions ArkUI_TextMarqueeOptions;
/**
* @brief Defines controller for text.
* @since 26.0.0
*/
typedef struct OH_ArkUI_TextController OH_ArkUI_TextController;
/**
* @brief Defines the font weight configuration of text.
*
* @since 24
*/
typedef struct OH_ArkUI_FontWeightConfigs OH_ArkUI_FontWeightConfigs;
/**
* @brief Defines the font configuration of text.
*
* @since 24
*/
typedef struct OH_ArkUI_FontConfigs OH_ArkUI_FontConfigs;
/**
* @brief Create an option object for marquee animation of text.
*
* @return A pointer to the option object.
* @since 23
*/
ArkUI_TextMarqueeOptions* OH_ArkUI_TextMarqueeOptions_Create();
/**
* @brief Dispose the option object for marquee animation of text.
*
* @param option Pointer to the option object to be disposed.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_Dispose(ArkUI_TextMarqueeOptions* option);
/**
* @brief Sets the start flag of the option object for marquee animation of text.
*
* @param option Pointer to the option object to be modified.
* @param start Flag of is need to start marquee. True means start marquee, false means stop marquee.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_SetStart(ArkUI_TextMarqueeOptions* option, bool start);
/**
* @brief Gets the start flag of the option object for marquee animation of text.
*
* @param option Pointer to the option object.
* @return Returns the start flag.
* @since 23
*/
bool OH_ArkUI_TextMarqueeOptions_GetStart(ArkUI_TextMarqueeOptions* option);
/**
* @brief Sets the step size of the option object for marquee animation of text.
*
* @param option Pointer to the option object to be modified.
* @param step The step size of the marquee. The unit is vp.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_SetStep(ArkUI_TextMarqueeOptions* option, float step);
/**
* @brief Gets the step size of the option object for marquee animation of text.
*
* @param option Pointer to the option object.
* @return Returns the step size of the marquee. The unit is vp.
* @since 23
*/
float OH_ArkUI_TextMarqueeOptions_GetStep(ArkUI_TextMarqueeOptions* option);
/**
* @brief Sets the spacing between two rounds of the option object for marquee animation of text.
*
* @param option Pointer to the option object to be modified.
* @param spacing The spacing between two rounds of marquee. The unit is vp.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_SetSpacing(ArkUI_TextMarqueeOptions* option, float spacing);
/**
* @brief Gets the spacing between two rounds of the option object for marquee animation of text.
*
* @param option Pointer to the option object.
* @return Returns the spacing between two rounds of marquee. The unit is vp.
* @since 23
*/
float OH_ArkUI_TextMarqueeOptions_GetSpacing(ArkUI_TextMarqueeOptions* option);
/**
* @brief Sets the rounds of the option object for marquee animation of text.
*
* @param option Pointer to the option object to be modified.
* @param loop The rounds of the marquee.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_SetLoop(ArkUI_TextMarqueeOptions* option, int32_t loop);
/**
* @brief Gets the rounds of the option object for marquee animation of text.
*
* @param option Pointer to the option object.
* @return Returns the rounds of the marquee.
* @since 23
*/
int32_t OH_ArkUI_TextMarqueeOptions_GetLoop(ArkUI_TextMarqueeOptions* option);
/**
* @brief Sets the fromStart flag of the option object for marquee animation of text.
*
* @param option Pointer to the option object to be modified.
* @param fromStart The running direction of the marquee, true means running from start.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_SetFromStart(ArkUI_TextMarqueeOptions* option, bool fromStart);
/**
* @brief Gets the fromStart flag of the option object for marquee animation of text.
*
* @param option Pointer to the option object.
* @return Returns the fromStart flag.
* @since 23
*/
bool OH_ArkUI_TextMarqueeOptions_GetFromStart(ArkUI_TextMarqueeOptions* option);
/**
* @brief Sets the delay time between each round of the option object for marquee animation of text.
*
* @param option Pointer to the option object to be modified.
* @param delay The delay time between each round of the marquee.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_SetDelay(ArkUI_TextMarqueeOptions* option, int32_t delay);
/**
* @brief Gets the delay time between each round of the option object for marquee animation of text.
*
* @param option Pointer to the option object.
* @return Returns the delay time between each round of the marquee.
* @since 23
*/
int32_t OH_ArkUI_TextMarqueeOptions_GetDelay(ArkUI_TextMarqueeOptions* option);
/**
* @brief Sets the fadeout flag of the option object for marquee animation of text.
*
* @param option Pointer to the option object to be modified.
* @param fadeout The flag of whether the text is faded out.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_SetFadeout(ArkUI_TextMarqueeOptions* option, bool fadeout);
/**
* @brief Gets the fadeout flag of the option object for marquee animation of text.
*
* @param option Pointer to the option object.
* @return Returns the fadeout flag.
* @since 23
*/
bool OH_ArkUI_TextMarqueeOptions_GetFadeout(ArkUI_TextMarqueeOptions* option);
/**
* @brief Sets the start policy of the option object for marquee animation of text.
*
* @param option Pointer to the option object to be modified.
* @param startPolicy The start policy for marquee.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_SetStartPolicy(ArkUI_TextMarqueeOptions* option, ArkUI_MarqueeStartPolicy startPolicy);
/**
* @brief Gets the start policy of the option object for marquee animation of text.
*
* @param option Pointer to the option object.
* @return Returns the start policy for marquee.
* @since 23
*/
ArkUI_MarqueeStartPolicy OH_ArkUI_TextMarqueeOptions_GetStartPolicy(ArkUI_TextMarqueeOptions* option);
/**
* @brief Sets the update policy of the option object for marquee animation of text.
*
* @param option Pointer to the option object to be modified.
* @param updatePolicy The update policy for marquee.
* @since 23
*/
void OH_ArkUI_TextMarqueeOptions_SetUpdatePolicy(ArkUI_TextMarqueeOptions* option,
ArkUI_MarqueeUpdatePolicy updatePolicy);
/**
* @brief Gets the update policy of the option object for marquee animation of text.
*
* @param option Pointer to the option object.
* @return Returns the update policy for marquee.
* @since 23
*/
ArkUI_MarqueeUpdatePolicy OH_ArkUI_TextMarqueeOptions_GetUpdatePolicy(ArkUI_TextMarqueeOptions* option);
/**
* @brief Creates a text entity recognition configuration object. When the object is no longer used, call
* {@link OH_ArkUI_TextDataDetectorConfig_Destroy} to destroy it.
*
* @return Pointer to the {@link OH_ArkUI_TextDataDetectorConfig} object.
* @since 24
*/
OH_ArkUI_TextDataDetectorConfig* OH_ArkUI_TextDataDetectorConfig_Create();
/**
* @brief Destroys the text entity recognition configuration object.
*
* @param config Pointer to the {@link OH_ArkUI_TextDataDetectorConfig} object.
* @since 24
*/
void OH_ArkUI_TextDataDetectorConfig_Destroy(OH_ArkUI_TextDataDetectorConfig* config);
/**
* @brief Create a controller object for text.
* @return A pointer to the text controller object.
* @since 26.0.0
*/
OH_ArkUI_TextController* OH_ArkUI_TextController_Create();
/**
* @brief Destroys the text controller.
*
* @param controller <b>Text</b> controller.
* @since 26.0.0
*/
void OH_ArkUI_TextController_Destroy(OH_ArkUI_TextController* controller);
/**
* @brief Create an option object for font weight configuration of text.
*
* @return A pointer to the option object.
* @since 24
*/
OH_ArkUI_FontWeightConfigs* OH_ArkUI_FontWeightConfigs_Create();
/**
* @brief Destroy an option object for font weight configuration of text.
*
* @param option Pointer to the option object to be destroyed.
* @since 24
*/
void OH_ArkUI_FontWeightConfigs_Destroy(OH_ArkUI_FontWeightConfigs* option);
/**
* @brief Sets the enableVariableFontWeight flag of an option object for font weight configuration of text.
* The flag defines whether VariableFontWeight is supported. The default value is false.
* True means enable VariableFontWeight, false means disable VariableFontWeight.
*
* @param option Pointer to the option object to be modified.
* @param enable enableVariableFontWeight Flag.
* @since 24
*/
void OH_ArkUI_FontWeightConfigs_SetEnableVariableFontWeight(OH_ArkUI_FontWeightConfigs* option, bool enable);
/**
* @brief Gets the enableVariableFontWeight flag of an option object for font weight configuration of text.
* The flag defines whether VariableFontWeight is supported. The default value is false.
* True means enable VariableFontWeight, false means disable VariableFontWeight.
*
* @param option Pointer to the option object.
* @return Returns the enableVariableFontWeight flag.
* @since 24
*/
bool OH_ArkUI_FontWeightConfigs_GetEnableVariableFontWeight(OH_ArkUI_FontWeightConfigs* option);
/**
* @brief Sets the enableDeviceFontWeightCategory flag of an option object for font weight configuration of text.
* Defines whether font weight will be automatically updated when the device's font weight category changes.
* The default value is true.
* True means font weight will be automatically updated when the device's font weight category changes.
* False means font weight will not be automatically updated when the device's font weight category changes.
*
* @param option Pointer to the option object to be modified.
* @param enable enableDeviceFontWeightCategory Flag.
* @since 24
*/
void OH_ArkUI_FontWeightConfigs_SetEnableDeviceFontWeightCategory(OH_ArkUI_FontWeightConfigs* option, bool enable);
/**
* @brief Gets the enableDeviceFontWeightCategory flag of an option object for font weight configuration of text.
* Defines whether font weight will be automatically updated when the device's font weight category changes.
* The default value is true.
* True means font weight will be automatically updated when the device's font weight category changes.
* False means font weight will not be automatically updated when the device's font weight category changes.
*
* @param option Pointer to the option object.
* @return Returns the enableDeviceFontWeightCategory flag.
* @since 24
*/
bool OH_ArkUI_FontWeightConfigs_GetEnableDeviceFontWeightCategory(OH_ArkUI_FontWeightConfigs* option);
/**
* @brief Create an option object for font configuration of text.
*
* @return A pointer to the option object.
* @since 24
*/
OH_ArkUI_FontConfigs* OH_ArkUI_FontConfigs_Create();
/**
* @brief Destroy an option object for font configuration of text.
*
* @param option Pointer to the option object to be destroyed.
* @since 24
*/
void OH_ArkUI_FontConfigs_Destroy(OH_ArkUI_FontConfigs* option);
/**
* @brief Sets the font weight configs of an option object for font configuration of text.
*
* @param option Pointer to the option object to be modified.
* @param fontWeightConfigs font weight configs.
* @since 24
*/
void OH_ArkUI_FontConfigs_SetFontWeightConfigs(OH_ArkUI_FontConfigs* option,
OH_ArkUI_FontWeightConfigs* fontWeightConfigs);
/**
* @brief Gets the font weight configs of an option object for font configuration of text.
*
* @param option Pointer to the option object.
* @return Returns the font weight configs.
* @since 24
*/
OH_ArkUI_FontWeightConfigs* OH_ArkUI_FontConfigs_GetFontWeightConfigs(OH_ArkUI_FontConfigs* option);
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_H
/** @} */
@@ -0,0 +1,71 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Defines a set of TextArea enum and interface.
*
* @since 12
*/
/**
* @file text_area.h
*
* @brief Defines a set of TextArea enum and interface.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_AREA_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_AREA_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enumerates the text box types.
*
* @since 12
*/
typedef enum {
/** Normal input mode. */
ARKUI_TEXTAREA_TYPE_NORMAL = 0,
/** Number input mode. */
ARKUI_TEXTAREA_TYPE_NUMBER = 2,
/** Phone number input mode. */
ARKUI_TEXTAREA_TYPE_PHONE_NUMBER = 3,
/** Email address input mode. */
ARKUI_TEXTAREA_TYPE_EMAIL = 5,
/**
* One time code input mode.
* @since 20
*/
ARKUI_TEXTAREA_TYPE_ONE_TIME_CODE = 14,
} ArkUI_TextAreaType;
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_AREA_H
/** @} */
@@ -0,0 +1,699 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Defines a set of text common enum and interface.
*
* @since 12
*/
/**
* @file text_common.h
*
* @brief Defines a set of text common enum and interface.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_COMMON_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_COMMON_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Define the data objects of styled string supported by text components.
*
* @since 14
*/
typedef struct ArkUI_StyledString_Descriptor ArkUI_StyledString_Descriptor;
/**
* @brief Defines the textField's counter configuration.
*
* @since 22
*/
typedef struct ArkUI_ShowCounterConfig ArkUI_ShowCounterConfig;
/**
* @brief Defines the text content base controller.
*
* @since 23
*/
typedef struct ArkUI_TextContentBaseController ArkUI_TextContentBaseController;
/**
* @brief Enumerates the text alignment mode.
*
* @since 12
*/
typedef enum {
/** Aligned with the start. */
ARKUI_TEXT_ALIGNMENT_START = 0,
/** Horizontally centered. */
ARKUI_TEXT_ALIGNMENT_CENTER,
/** Aligned with the end. */
ARKUI_TEXT_ALIGNMENT_END,
/** Aligned with both margins. */
ARKUI_TEXT_ALIGNMENT_JUSTIFY,
/**
* Aligned with left to right.
* @since 23
*/
ARKUI_TEXT_ALIGNMENT_LEFT_TO_RIGHT = 4,
/**
* Aligned with right to left.
* @since 23
*/
ARKUI_TEXT_ALIGNMENT_RIGHT_TO_LEFT = 5,
} ArkUI_TextAlignment;
/**
* @brief Enumerates text vertical alignment styles.
*
* @since 20
*/
typedef enum {
/** Aligned to the baseline. */
ARKUI_TEXT_VERTICAL_ALIGNMENT_BASELINE = 0,
/** Bottom aligned. */
ARKUI_TEXT_VERTICAL_ALIGNMENT_BOTTOM,
/** Center aligned. */
ARKUI_TEXT_VERTICAL_ALIGNMENT_CENTER,
/** Top aligned. */
ARKUI_TEXT_VERTICAL_ALIGNMENT_TOP,
} ArkUI_TextVerticalAlignment;
/**
* @brief Enumerates text content align styles.
*
* @since 21
*/
typedef enum {
/** Top aligned. */
ARKUI_TEXT_CONTENT_ALIGN_TOP = 0,
/** Center aligned. */
ARKUI_TEXT_CONTENT_ALIGN_CENTER = 1,
/** Bottom aligned. */
ARKUI_TEXT_CONTENT_ALIGN_BOTTOM = 2,
} ArkUI_TextContentAlign;
/**
* @brief Enumerates the text text direction.
*
* @since 23
*/
typedef enum {
/** The text direction is left to right. */
ARKUI_TEXT_DIRECTION_LTR = 0,
/** The text direction is right to left. */
ARKUI_TEXT_DIRECTION_RTL = 1,
/** The text direction follows the component layout. */
ARKUI_TEXT_DIRECTION_DEFAULT = 2,
/** The text direction follows the actual text. */
ARKUI_TEXT_DIRECTION_AUTO = 3,
} ArkUI_TextDirection;
/**
* @brief Enumerates the types of the Enter key for a single-line text box.
*
* @since 12
*/
typedef enum {
/** The Enter key is labeled "Go." */
ARKUI_ENTER_KEY_TYPE_GO = 2,
/** The Enter key is labeled "Search." */
ARKUI_ENTER_KEY_TYPE_SEARCH = 3,
/** The Enter key is labeled "Send." */
ARKUI_ENTER_KEY_TYPE_SEND,
/** The Enter key is labeled "Next." */
ARKUI_ENTER_KEY_TYPE_NEXT,
/** The Enter key is labeled "Done." */
ARKUI_ENTER_KEY_TYPE_DONE,
/** The Enter key is labeled "Previous." */
ARKUI_ENTER_KEY_TYPE_PREVIOUS,
/** The Enter key is labeled "New Line." */
ARKUI_ENTER_KEY_TYPE_NEW_LINE,
} ArkUI_EnterKeyType;
/**
* @brief Enumerates the text decoration types.
*
* @since 12
*/
typedef enum {
/** No text decoration. */
ARKUI_TEXT_DECORATION_TYPE_NONE = 0,
/** Line under the text. */
ARKUI_TEXT_DECORATION_TYPE_UNDERLINE,
/** Line over the text. */
ARKUI_TEXT_DECORATION_TYPE_OVERLINE,
/** Line through the text. */
ARKUI_TEXT_DECORATION_TYPE_LINE_THROUGH,
} ArkUI_TextDecorationType;
/**
* @brief Enumerates the text decoration styles.
*
* @since 12
*/
typedef enum {
/** Single solid line. */
ARKUI_TEXT_DECORATION_STYLE_SOLID = 0,
/** Double solid line. */
ARKUI_TEXT_DECORATION_STYLE_DOUBLE,
/** Dotted line. */
ARKUI_TEXT_DECORATION_STYLE_DOTTED,
/** Dashed line. */
ARKUI_TEXT_DECORATION_STYLE_DASHED,
/** Wavy line. */
ARKUI_TEXT_DECORATION_STYLE_WAVY,
} ArkUI_TextDecorationStyle;
/**
* @brief Enumerates the text cases.
*
* @since 12
*/
typedef enum {
/** The original case of the text is retained. */
ARKUI_TEXT_CASE_NORMAL = 0,
/** All letters in the text are in lowercase. */
ARKUI_TEXT_CASE_LOWER,
/** All letters in the text are in uppercase. */
ARKUI_TEXT_CASE_UPPER,
} ArkUI_TextCase;
/**
* @brief Defines whether copy and paste is allowed for text content.
*
* @since 12
*/
typedef enum {
/** Copy is not allowed. */
ARKUI_TEXT_COPY_OPTIONS_NONE = 0,
/** Intra-application copy is allowed. */
ARKUI_TEXT_COPY_OPTIONS_IN_APP,
/** Intra-device copy is allowed. */
ARKUI_TEXT_COPY_OPTIONS_LOCAL_DEVICE,
/** Cross-device copy is allowed. */
ARKUI_TEXT_COPY_OPTIONS_CROSS_DEVICE,
} ArkUI_TextCopyOptions;
/**
* @brief Enumerates the display modes when the text is too long.
*
* @since 12
*/
typedef enum {
/** Extra-long text is not clipped. */
ARKUI_TEXT_OVERFLOW_NONE = 0,
/** Extra-long text is clipped. */
ARKUI_TEXT_OVERFLOW_CLIP,
/** An ellipsis (...) is used to represent text overflow. */
ARKUI_TEXT_OVERFLOW_ELLIPSIS,
/** Text continuously scrolls when text overflow occurs. */
ARKUI_TEXT_OVERFLOW_MARQUEE,
} ArkUI_TextOverflow;
/**
* @brief Enumerates the word break rules.
*
* @since 12
*/
typedef enum {
/** Word breaks can occur between any two characters for Chinese, Japanese, and Korean (CJK) text, but can occur
* only at a space character for non-CJK text (such as English). */
ARKUI_WORD_BREAK_NORMAL = 0,
/** Word breaks can occur between any two characters for non-CJK text. CJK text behavior is the same as for
* <b>NORMAL</b>. */
ARKUI_WORD_BREAK_BREAK_ALL,
/** This option has the same effect as <b>BREAK_ALL</b> for non-CJK text, except that if it preferentially wraps
* lines at appropriate characters (for example, spaces) whenever possible.
CJK text behavior is the same as for <b>NORMAL</b>. */
ARKUI_WORD_BREAK_BREAK_WORD,
/**
* @brief Line breaks can occur between any two syllabic units for non-CJK text.
* CJK text behavior is the same as for <b>NORMAL</b>.
* @since 18
*/
ARKUI_WORD_BREAK_HYPHENATION,
} ArkUI_WordBreak;
/**
* @brief Enumerates the ellipsis positions.
*
* @since 12
*/
typedef enum {
/** An ellipsis is used at the start of the line of text. */
ARKUI_ELLIPSIS_MODE_START = 0,
/** An ellipsis is used at the center of the line of text. */
ARKUI_ELLIPSIS_MODE_CENTER,
/** An ellipsis is used at the end of the line of text. */
ARKUI_ELLIPSIS_MODE_END,
/**
* @brief An ellipsis is used at the start of the line of text for multiline and single line.
* @since 24
*/
ARKUI_ELLIPSIS_MODE_MULTILINE_START,
/**
* @brief An ellipsis is used at the center of the line of text for multiline and single line.
* @since 24
*/
ARKUI_ELLIPSIS_MODE_MULTILINE_CENTER,
} ArkUI_EllipsisMode;
/**
* @brief Defines the keyboard style of input box
*
* @since 15
*/
typedef enum {
/**
* Default appearance mode, won't adopt immersive styles.
* @since 15
*/
ARKUI_KEYBOARD_APPEARANCE_NONE_IMMERSIVE = 0,
/**
* Immersive mode.
* @since 15
*/
ARKUI_KEYBOARD_APPEARANCE_IMMERSIVE = 1,
/**
* Light immersive style.
* @since 15
*/
ARKUI_KEYBOARD_APPEARANCE_LIGHT_IMMERSIVE = 2,
/**
* Dark immersive style.
* @since 15
*/
ARKUI_KEYBOARD_APPEARANCE_DARK_IMMERSIVE = 3,
} ArkUI_KeyboardAppearance;
/**
* @brief Defines the text menu item for edit menu item.
*
* @since 22
*/
typedef struct ArkUI_TextMenuItem ArkUI_TextMenuItem;
/**
* @brief Defines text menu item array.
*
* @since 22
*/
typedef struct ArkUI_TextMenuItemArray ArkUI_TextMenuItemArray;
/**
* @brief Enumerates the text menu item id.
*
* @since 22
*/
typedef enum {
/**
* Indicates the TextMenuItemId to copy and delete the currently selected text.
*/
ARKUI_TEXT_MENU_ITEM_ID_CUT = 0,
/**
* Indicates the TextMenuItemId to copy the currently selected text to the clipboard.
*/
ARKUI_TEXT_MENU_ITEM_ID_COPY = 1,
/**
* Indicates the TextMenuItemId to copy the current contents of the clipboard into the text view.
*/
ARKUI_TEXT_MENU_ITEM_ID_PASTE = 2,
/**
* Indicates the TextMenuItemId to select all text in a text view.
*/
ARKUI_TEXT_MENU_ITEM_ID_SELECT_ALL = 3,
/**
* Indicates the TextMenuItemId for collaboration service menu items.
*/
ARKUI_TEXT_MENU_ITEM_ID_COLLABORATION_SERVICE = 4,
/**
* Indicates the TextMenuItemId to recognize the text in the picture and input it into the text view.
*/
ARKUI_TEXT_MENU_ITEM_ID_CAMERA_INPUT = 5,
/**
* Indicates the TextMenuItemId to help with text creation by invoking large models.
*/
ARKUI_TEXT_MENU_ITEM_ID_AI_WRITER = 6,
/**
* Indicates the TextMenuItemId to translate the selected content.
*/
ARKUI_TEXT_MENU_ITEM_ID_TRANSLATE = 7,
/**
* Indicates the TextMenuItemId to search the selected content.
*/
ARKUI_TEXT_MENU_ITEM_ID_SEARCH = 8,
/**
* Indicates the TextMenuItemId to share the selected content.
*/
ARKUI_TEXT_MENU_ITEM_ID_SHARE = 9,
/**
* Indicates the TextMenuItemId to open url.
*/
ARKUI_TEXT_MENU_ITEM_ID_URL = 10,
/**
* Indicates the TextMenuItemId to open email.
*/
ARKUI_TEXT_MENU_ITEM_ID_EMAIL = 11,
/**
* Indicates the TextMenuItemId to call the phone number.
*/
ARKUI_TEXT_MENU_ITEM_ID_PHONE_NUMBER = 12,
/**
* Indicates the TextMenuItemId to open map.
*/
ARKUI_TEXT_MENU_ITEM_ID_ADDRESS = 13,
/**
* Indicates the TextMenuItemId to open calendar.
*/
ARKUI_TEXT_MENU_ITEM_ID_DATA_TIME = 14,
/**
* Indicates the TextMenuItemId for asking AI.
*/
ARKUI_TEXT_MENU_ITEM_ID_ASK_AI = 15,
/**
* Autofill. For example, the account and password can be automatically filled.
* @since 24
*/
ARKUI_TEXT_MENU_ITEM_ID_AUTO_FILL = 16,
/**
* Password vault.
* @since 24
*/
ARKUI_TEXT_MENU_ITEM_ID_PASSWORD_VAULT = 17,
/**
* Inclusive begin of app-reserved ID range.
*/
ARKUI_TEXT_MENU_ITEM_ID_APP_RESERVED_BEGIN = 10000,
/**
* Inclusive end of app-reserved ID range.
*/
ARKUI_TEXT_MENU_ITEM_ID_APP_RESERVED_END = 20000,
} ArkUI_TextMenuItemId;
/**
* @brief Defines the text menu item for edit menu options.
*
* @since 22
*/
typedef struct ArkUI_TextEditMenuOptions ArkUI_TextEditMenuOptions;
/**
* The text menu create callback function.
*
* @param items The framework creates and owns the array.
* In callback: the developer can modify the array by calling {@link OH_ArkUI_TextMenuItemArray_Insert},
* {@link OH_ArkUI_TextMenuItemArray_Erase}, or similar APIs.
* The developer must not free the array instance.
* @param userData User defined data.
* @since 22
*/
typedef void (*ArkUI_TextCreateMenuCallback)(
ArkUI_TextMenuItemArray* items,
void* userData
);
/**
* The text menu prepare callback function.
*
* @param items The framework creates and owns the array.
* In callback: the developer can modify the array by calling {@link OH_ArkUI_TextMenuItemArray_Insert},
* {@link OH_ArkUI_TextMenuItemArray_Erase}, or similar APIs.
* The developer must not free the array instance.
* @param userData User defined data.
* @since 22
*/
typedef void (*ArkUI_TextPrepareMenuCallback)(
ArkUI_TextMenuItemArray* items,
void* userData
);
/**
* The text menu item click callback function.
*
* @param item The menu item click.
* @param start The start offset of the selected content.
* @param end The end offset of the selected content.
* @param userData The user data.
* @return bool Return True, the event is consumed, false otherwise.
* @since 22
*/
typedef bool (*ArkUI_TextMenuItemClickCallback)(
const ArkUI_TextMenuItem* item,
int32_t start,
int32_t end,
void* userData
);
/**
* @brief Defines the selection menu.
*
* @since 22
*/
typedef struct ArkUI_TextSelectionMenuOptions ArkUI_TextSelectionMenuOptions;
/**
* @brief Defines decoration style options.
*
* @since 24
*/
typedef struct OH_ArkUI_DecorationStyleOptions OH_ArkUI_DecorationStyleOptions;
/**
* @brief Enumerates line break policies.
*
* @since 24
*/
typedef enum {
/**
* Greedy mode.<br>Places as many words on a line as possible and moves to the next line only if no more words can
* fit into the same line.
* @since 24
*/
OH_ARKUI_LINE_BREAK_STRATEGY_GREEDY = 0,
/**
* High-quality mode.<br>Fills in lines as much as possible on the basis of **BALANCED**, which may results in a
* large blank area on the last line.
* @since 24
*/
OH_ARKUI_LINE_BREAK_STRATEGY_HIGH_QUALITY = 1,
/**
* Balance mode.<br>Without splitting words, the width of each line in a paragraph is the same as much as possible.
* @since 24
*/
OH_ARKUI_LINE_BREAK_STRATEGY_BALANCE = 2,
} OH_ArkUI_LineBreakStrategy;
/**
* @brief Enumerates the text span type.
*
* @since 22
*/
typedef enum {
/** The span type only contains text. */
ARKUI_TEXT_SPAN_TYPE_TEXT = 0,
/** The span type only contains image. */
ARKUI_TEXT_SPAN_TYPE_IMAGE = 1,
/** The span type contains both text and image. */
ARKUI_TEXT_SPAN_TYPE_MIXED = 2,
/**
* When no other types are explicitly specified, this type will be matched.
* When this type is registered but TEXT, IMAGE, or MIXED types are not registered,
* this type will be triggered and displayed for those registered types.
*/
ARKUI_TEXT_SPAN_TYPE_DEFAULT = 3,
} ArkUI_TextSpanType;
/**
* @brief Enumerates the text response type.
*
* @since 22
*/
typedef enum {
/** The response type of right click. */
ARKUI_TEXT_RESPONSE_TYPE_RIGHT_CLICK = 0,
/** The response type of long press. */
ARKUI_TEXT_RESPONSE_TYPE_LONG_PRESS = 1,
/** The response type of select by mouse. */
ARKUI_TEXT_RESPONSE_TYPE_SELECT = 2,
/**
* When no other types are explicitly specified, this type will be matched.
* When this type is registered but RIGHT_CLICK, LONG_PRESS, or SELECT types are not registered,
* this type will be triggered and displayed for right-click, long press, and mouse selection actions.
*/
ARKUI_TEXT_RESPONSE_TYPE_DEFAULT = 3,
} ArkUI_TextResponseType;
/**
* @brief Creates a configuration object for textField's counter.
*
* @return A pointer to the configuration object.
* @since 22
*/
ArkUI_ShowCounterConfig* OH_ArkUI_ShowCounterConfig_Create();
/**
* @brief Disposes a configuration object for textField's counter.
*
* @param config Pointer to the configuration object to be disposed.
* @since 22
*/
void OH_ArkUI_ShowCounterConfig_Dispose(ArkUI_ShowCounterConfig* config);
/**
* @brief Sets the color of counter when textField hasn't wanted to exceed the maximum character count.
*
* @param config Pointer to the configuration object to be modified.
* @param color The color of the counter when textField hasn't wanted to exceed the maximum character count, in 0xARGB format.
* @since 22
*/
void OH_ArkUI_ShowCounterConfig_SetCounterTextColor(ArkUI_ShowCounterConfig* config, uint32_t color);
/**
* @brief Sets the color of counter when textField wants to exceed the maximum character count.
*
* @param config Pointer to the configuration object to be modified.
* @param color The color of the counter when textField wants to exceed the maximum character count, in 0xARGB format.
* @since 22
*/
void OH_ArkUI_ShowCounterConfig_SetCounterTextOverflowColor(ArkUI_ShowCounterConfig* config, uint32_t color);
/**
* @brief Gets the color of counter when textField hasn't wanted to exceed the maximum character count.
*
* @param config Pointer to the configuration object.
* @return Returns the color of the counter when textField hasn't wanted to exceed the maximum character count, in 0xARGB format.
* @since 22
*/
uint32_t OH_ArkUI_ShowCounterConfig_GetCounterTextColor(ArkUI_ShowCounterConfig* config);
/**
* @brief Gets the color of counter when textField wants to exceed the maximum character count.
*
* @param config Pointer to the configuration object.
* @return Returns the color of the counter when textField wants to exceed the maximum character count, in 0xARGB format.
* @since 22
*/
uint32_t OH_ArkUI_ShowCounterConfig_GetCounterTextOverflowColor(ArkUI_ShowCounterConfig* config);
/**
* @brief Create an object of the text edit menu item.
*
* @return A pointer to the ArkUI_TextMenuItem.
* @since 22
*/
ArkUI_TextMenuItem* OH_ArkUI_TextMenuItem_Create();
/**
* @brief Dispose an object of the text edit menu options.
*
* @param textMenuItem Pointer to the ArkUI_TextMenuItem object to be disposed.
* @since 22
*/
void OH_ArkUI_TextMenuItem_Dispose(ArkUI_TextMenuItem* textMenuItem);
/**
* @brief Create an object of the text edit menu options.
*
* @return A pointer to the ArkUI_TextEditMenuOptions.
* @since 22
*/
ArkUI_TextEditMenuOptions* OH_ArkUI_TextEditMenuOptions_Create();
/**
* @brief Dispose an object of the text edit menu options.
*
* @param editMenuOptions Pointer to the ArkUI_TextEditMenuOptions object to be disposed.
* @since 22
*/
void OH_ArkUI_TextEditMenuOptions_Dispose(ArkUI_TextEditMenuOptions* editMenuOptions);
/**
* @brief Create an object of the text selection menu options.
*
* @return A pointer to the ArkUI_TextSelectionMenuOptions.
* @since 22
*/
ArkUI_TextSelectionMenuOptions* OH_ArkUI_TextSelectionMenuOptions_Create();
/**
* @brief Dispose an object of the text selection menu options.
*
* @param selectionMenuOptions Pointer to the ArkUI_TextSelectionMenuOptions object to be disposed.
* @since 22
*/
void OH_ArkUI_TextSelectionMenuOptions_Dispose(ArkUI_TextSelectionMenuOptions* selectionMenuOptions);
/**
* @brief Create an object of the text content base controller.
*
* @return A pointer to the controller object.
* @since 23
*/
ArkUI_TextContentBaseController* OH_ArkUI_TextContentBaseController_Create();
/**
* @brief Dispose an object of the text content base controller.
*
* @param {ArkUI_TextContentBaseController*} controller Pointer to the controller object to be disposed.
* @since 23
*/
void OH_ArkUI_TextContentBaseController_Dispose(ArkUI_TextContentBaseController* controller);
/**
* @brief Delete the character before the caret of the input field component in editing state.
* Otherwise, delete the last character of the input field component.
*
* @param {ArkUI_TextContentBaseController*} controller Pointer to the configuration object to be modified.
* @since 23
*/
void OH_ArkUI_TextContentBaseController_DeleteBackward(ArkUI_TextContentBaseController* controller);
/**
* @brief Scroll the input field component to make the specified content visible.
*
* @param {ArkUI_TextContentBaseController*} controller Pointer to the
* configuration object to be modified.
* @param {int32_t} start The start offset of the content to be made visible.
* @param {int32_t} end The end offset of the content to be made visible
* @since 23
*/
void OH_ArkUI_TextContentBaseController_ScrollToVisible(
ArkUI_TextContentBaseController *controller, int32_t start, int32_t end);
/**
* @brief Creates a decorative line style object. When the object is no longer used, call
* {@link OH_ArkUI_DecorationStyleOptions_Destroy} to destroy it.
*
* @return Pointer to the {@link OH_ArkUI_DecorationStyleOptions} object.
* @since 24
*/
OH_ArkUI_DecorationStyleOptions* OH_ArkUI_DecorationStyleOptions_Create();
/**
* @brief Destroys the decorative line style object.
*
* @param options Pointer to the option object to be destroyed.
* @since 24
*/
void OH_ArkUI_DecorationStyleOptions_Destroy(OH_ArkUI_DecorationStyleOptions* options);
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_COMMON_H
/** @} */
@@ -0,0 +1,240 @@
/*
* Copyright (c) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Defines a set of TextInput enum and interface.
*
* @since 12
*/
/**
* @file text_input.h
*
* @brief Defines a set of TextInput enum and interface.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_INPUT_H
#define ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_INPUT_H
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Enumerates the text input types.
*
* @since 12
*/
typedef enum {
/** Normal input mode. */
ARKUI_TEXTINPUT_TYPE_NORMAL = 0,
/** Number input mode. */
ARKUI_TEXTINPUT_TYPE_NUMBER = 2,
/** Phone number input mode. */
ARKUI_TEXTINPUT_TYPE_PHONE_NUMBER = 3,
/** Email address input mode. */
ARKUI_TEXTINPUT_TYPE_EMAIL = 5,
/** Password input mode. */
ARKUI_TEXTINPUT_TYPE_PASSWORD = 7,
/** Numeric password input mode. */
ARKUI_TEXTINPUT_TYPE_NUMBER_PASSWORD = 8,
/** Lock screen password input mode. */
ARKUI_TEXTINPUT_TYPE_SCREEN_LOCK_PASSWORD = 9,
/** Username input mode. */
ARKUI_TEXTINPUT_TYPE_USER_NAME = 10,
/** New password input mode. */
ARKUI_TEXTINPUT_TYPE_NEW_PASSWORD = 11,
/** Number input mode with a decimal point. */
ARKUI_TEXTINPUT_TYPE_NUMBER_DECIMAL = 12,
/**
* One time code input mode.
* @since 20
*/
ARKUI_TEXTINPUT_TYPE_ONE_TIME_CODE = 14,
} ArkUI_TextInputType;
/**
* @brief Enumerates the styles of the Cancel button.
*
* @since 12
*/
typedef enum {
/** The Cancel button is always displayed. */
ARKUI_CANCELBUTTON_STYLE_CONSTANT = 0,
/** The Cancel button is always hidden. */
ARKUI_CANCELBUTTON_STYLE_INVISIBLE,
/** The Cancel button is displayed when there is text input. */
ARKUI_CANCELBUTTON_STYLE_INPUT,
} ArkUI_CancelButtonStyle;
/**
* @brief Enumerates the autofill types.
*
* @since 12
*/
typedef enum {
/** Username. Password Vault, when enabled, can automatically save and fill in usernames. */
ARKUI_TEXTINPUT_CONTENT_TYPE_USER_NAME = 0,
/** Password. Password Vault, when enabled, can automatically save and fill in passwords. */
ARKUI_TEXTINPUT_CONTENT_TYPE_PASSWORD,
/** New password. Password Vault, when enabled, can automatically generate a new password. */
ARKUI_TEXTINPUT_CONTENT_TYPE_NEW_PASSWORD,
/** Full street address. The scenario-based autofill feature, when enabled, can automatically save and fill in full
* street addresses. */
ARKUI_TEXTINPUT_CONTENT_TYPE_FULL_STREET_ADDRESS,
/** House number. The scenario-based autofill feature, when enabled, can automatically save and fill in house
* numbers. */
ARKUI_TEXTINPUT_CONTENT_TYPE_HOUSE_NUMBER,
/** District and county. The scenario-based autofill feature, when enabled, can automatically save and fill in
* districts and counties. */
ARKUI_TEXTINPUT_CONTENT_TYPE_DISTRICT_ADDRESS,
/** City. The scenario-based autofill feature, when enabled, can automatically save and fill in cities. */
ARKUI_TEXTINPUT_CONTENT_TYPE_CITY_ADDRESS,
/** Province. The scenario-based autofill feature, when enabled, can automatically save and fill in provinces. */
ARKUI_TEXTINPUT_CONTENT_TYPE_PROVINCE_ADDRESS,
/** Country. The scenario-based autofill feature, when enabled, can automatically save and fill in countries. */
ARKUI_TEXTINPUT_CONTENT_TYPE_COUNTRY_ADDRESS,
/** Full name. The scenario-based autofill feature, when enabled, can automatically save and fill in full names. */
ARKUI_TEXTINPUT_CONTENT_TYPE_PERSON_FULL_NAME,
/** Last name. The scenario-based autofill feature, when enabled, can automatically save and fill in last names. */
ARKUI_TEXTINPUT_CONTENT_TYPE_PERSON_LAST_NAME,
/** First name. The scenario-based autofill feature, when enabled, can automatically save and fill in first names.
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_PERSON_FIRST_NAME,
/** Phone number. The scenario-based autofill feature, when enabled, can automatically save and fill in phone
* numbers. */
ARKUI_TEXTINPUT_CONTENT_TYPE_PHONE_NUMBER,
/** Country code. The scenario-based autofill feature, when enabled, can automatically save and fill in country
* codes. */
ARKUI_TEXTINPUT_CONTENT_TYPE_PHONE_COUNTRY_CODE,
/** Phone number with country code. The scenario-based autofill feature, when enabled, can automatically save and
* fill in phone numbers with country codes. */
ARKUI_TEXTINPUT_CONTENT_TYPE_FULL_PHONE_NUMBER,
/** Email address. The scenario-based autofill feature, when enabled, can automatically save and fill in email
* addresses. */
ARKUI_TEXTINPUT_CONTENT_EMAIL_ADDRESS,
/** Bank card number. The scenario-based autofill feature, when enabled, can automatically save and fill in bank
* card numbers. */
ARKUI_TEXTINPUT_CONTENT_TYPE_BANK_CARD_NUMBER,
/** ID card number. The scenario-based autofill feature, when enabled, can automatically save and fill in ID card
* numbers. */
ARKUI_TEXTINPUT_CONTENT_TYPE_ID_CARD_NUMBER,
/** Nickname. The scenario-based autofill feature, when enabled, can automatically save and fill in nicknames. */
ARKUI_TEXTINPUT_CONTENT_TYPE_NICKNAME,
/** Address information without street address. The scenario-based autofill feature, when enabled, can automatically
* save and fill in address information without street addresses. */
ARKUI_TEXTINPUT_CONTENT_TYPE_DETAIL_INFO_WITHOUT_STREET,
/** Standard address. The scenario-based autofill feature, when enabled, can automatically save and fill in standard
* addresses. */
ARKUI_TEXTINPUT_CONTENT_TYPE_FORMAT_ADDRESS,
/**
* Passport number. The scenario-based autofill feature, when enabled, can automatically save and fill in passport
* numbers.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_PASSPORT_NUMBER,
/**
* Passport validity. The scenario-based autofill feature, when enabled, can automatically save and fill in
* passport validities.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_VALIDITY,
/**
* Place of issue. The scenario-based autofill feature, when enabled, can automatically save and fill in
* place of issues.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_ISSUE_AT,
/**
* Tax organization. The scenario-based autofill feature, when enabled, can automatically save and fill in tax
* organizations.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_ORGANIZATION,
/**
* Tax id. The scenario-based autofill feature, when enabled, can automatically save and fill in standard Tax ids.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_TAX_ID,
/**
* City name and state name or state code. The scenario-based autofill feature, when enabled, can automatically
* save and fill in city names and state names or state codes.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_ADDRESS_CITY_AND_STATE,
/**
* Flight number. The scenario-based autofill feature, when enabled, can automatically save and fill in flight
* numbers.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_FLIGHT_NUMBER,
/**
* License number. The scenario-based autofill feature, when enabled, can automatically save and fill in license
* numbers.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_LICENSE_NUMBER,
/**
* License file number. The scenario-based autofill feature, when enabled, can automatically save and fill in
* license file numbers.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_LICENSE_FILE_NUMBER,
/**
* License plate number. The scenario-based autofill feature, when enabled, can automatically save and fill in
* license plate numbers.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_LICENSE_PLATE,
/**
* Engine number. The scenario-based autofill feature, when enabled, can automatically save and fill in engine
* numbers.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_ENGINE_NUMBER,
/**
* License chassis number. The scenario-based autofill feature, when enabled, can automatically save and fill in
* license chassis numbers.
* @since 18
*/
ARKUI_TEXTINPUT_CONTENT_TYPE_LICENSE_CHASSIS_NUMBER,
} ArkUI_TextInputContentType;
/**
* @brief Defines the text input style.
*
* @since 12
*/
typedef enum {
/** Default style. The caret width is fixed at 1.5 vp, and the caret height is subject to the background height and
* font size of the selected text. */
ARKUI_TEXTINPUT_STYLE_DEFAULT = 0,
/** Inline input style. The background height of the selected text is the same as the height of the text box. */
ARKUI_TEXTINPUT_STYLE_INLINE
} ArkUI_TextInputStyle;
#ifdef __cplusplus
}
#endif
#endif // ARKUI_NATIVE_NODE_ATTRIBUTES_TEXT_INPUT_H
/** @} */
@@ -34,11 +34,22 @@
{ "filePath": "arkui/ace_engine/native/native_node.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/layout.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/navigation_router/navigation_router.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/node_attr_custom.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/image.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/image_animator.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/custom_attributes.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/picker.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/swiper/node_attr_swiper.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/swiper/node_event_swiper.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/swiper/swiper.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_types/native_type_common.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/text_common.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/text.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/text_input.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/text_area.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/rich_editor.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/image_span.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/custom_span.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/progress.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/common_attributes.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/native_node_napi.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/native_type.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
{ "filePath": "arkui/ace_engine/native/node_attributes/embedded_component.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" },
+1
View File
@@ -40,6 +40,7 @@
#ifndef UDS_H
#define UDS_H
#include <stdbool.h>
#include "multimedia/image_framework/image/pixelmap_native.h"
#ifdef __cplusplus
@@ -245,15 +245,28 @@ typedef enum OH_NativeBuffer_MetadataKey {
/** byte stream of SEI in video stream*/
OH_HDR_DYNAMIC_METADATA,
/**
* Region of interest(ROI) metadata is used to conifgure ROI feature in video encoding. Value type is string
* in the format "Top1,Left1-Bottom1,Right1=QpOffset1;Top2,Left2-Bottom2,Right2=QpOffset2;".
* Each "Top,Left-Bottom,Right=QpOffset" represents the coordinate information and quantization parameter
* offset of one ROI. Each "=QpOffset" in the string can be omitted,
* like "Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2=QpOffset2;", the encoder will use the default
* quantization parameter offset to perform the ROI encoding on the first ROI and use QpOffset2 on the second ROI.
* Region of interest(ROI) metadata is used to configure ROI feature in video encoding. Value type is string
* in the format "Top1,Left1-Bottom1,Right1[=Params1];Top2,Left2-Bottom2,Right2[=Params2];".
* Each "Top,Left-Bottom,Right" represents the coordinate information of one ROI.
* The "[=Params]" is optional.
* The format of "[=Params]" varies by version:
* 1. Prior to version 26.0.0: Only a single int32_t value representing the
* quantization parameter offset is supported (e.g., "=QpOffset").
* 2. Since version 26.0.0: A Key-Value format is additionally supported and recommended.
* It uses comma-separated key-value pairs (e.g., "=dqp:-6,slb:1").
* Supported keys:
* - "dqp": Quantization parameter offset.
* - "slb": Semantic label. The value must correspond to {@link OH_VideoMetadataRoiSemanticLabel}.
*
* If "=Params" is omitted entirely, like "Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2=dqp:-6;",
* the encoder will use the default parameters to perform the ROI encoding on the first ROI and
* use the specified parameters on the second ROI.
* Note that the number of ROIs that can be applied simultaneously does not exceed six, and the total area must
* not exceed one-fifth of the total image area.
*
* @note Since version 26.0.0, it is highly recommended to use {@link OH_VideoMetadata_AppendRoiString} to format
* and append ROI configurations safely instead of concatenating the string manually.
*
* @since 22
*/
OH_REGION_OF_INTEREST_METADATA
+2
View File
@@ -19,6 +19,7 @@ ohos_ndk_headers("native_media_codecbase_header") {
"../avcodec_audio_channel_layout.h",
"../native_avcapability.h",
"../native_avcodec_base.h",
"../native_avcodec_videobase.h",
]
}
@@ -31,6 +32,7 @@ ohos_ndk_library("libnative_media_codecbase") {
system_capability = "SystemCapability.Multimedia.Media.CodecBase"
system_capability_headers = [
"multimedia/player_framework/native_avcodec_base.h",
"multimedia/player_framework/native_avcodec_videobase.h",
"multimedia/player_framework/native_avcapability.h",
"multimedia/player_framework/avcodec_audio_channel_layout.h",
]
@@ -861,5 +861,47 @@
{
"first_introduced": "26.0.0",
"name": "OH_MD_KEY_VIDEO_ENCODER_REPEAT_HEADER_BEFORE_SYNC_FRAMES"
},
{
"first_introduced": "26.0.0",
"name": "OH_MD_KEY_VIDEO_METADATA_ROI_TOP",
"type": "variable"
},
{
"first_introduced": "26.0.0",
"name": "OH_MD_KEY_VIDEO_METADATA_ROI_LEFT",
"type": "variable"
},
{
"first_introduced": "26.0.0",
"name": "OH_MD_KEY_VIDEO_METADATA_ROI_BOTTOM",
"type": "variable"
},
{
"first_introduced": "26.0.0",
"name": "OH_MD_KEY_VIDEO_METADATA_ROI_RIGHT",
"type": "variable"
},
{
"first_introduced": "26.0.0",
"name": "OH_MD_KEY_VIDEO_METADATA_ROI_DELTA_QP",
"type": "variable"
},
{
"first_introduced": "26.0.0",
"name": "OH_MD_KEY_VIDEO_METADATA_ROI_SEM_LABEL",
"type": "variable"
},
{
"first_introduced": "26.0.0",
"name": "OH_VideoMetadata_AppendRoiString"
},
{
"first_introduced": "26.0.0",
"name": "OH_VideoMetadata_GetRoiCount"
},
{
"first_introduced": "26.0.0",
"name": "OH_VideoMetadata_ParseRoiString"
}
]
+22 -7
View File
@@ -1670,18 +1670,33 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_ENABLE_B_FRAME;
extern const char *OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES;
/**
* @brief Key to set the region of interest(ROI) as QpOffset-Rects, value type is string in the format
* "Top1,Left1-Bottom1,Right1=Offset1;Top2,Left2-Bottom2,Right2=Offset2;". Each "Top,Left-Bottom,Right=Offset"
* represents the coordinate information and quantization parameter of one ROI. Each "=Offset" in the string
* can be omitted, like "Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2=Offset2;", the encoder
* will use the default quantization parameter to perform the ROI encoding on the first ROI and
* use Offset2 on the second ROI.
* @brief Key to set the region of interest(ROI) parameters. Value type is string in the format
* "Top1,Left1-Bottom1,Right1[=Params1];Top2,Left2-Bottom2,Right2[=Params2];".
*
* Each "Top,Left-Bottom,Right" represents the coordinate information of one ROI.
* The "[=Params]" is optional.
* The format of "[=Params]" varies by version:
* 1. Prior to version 26.0.0: Only a single int32_t value representing the
* quantization parameter offset is supported (e.g., "=Offset").
* 2. Since version 26.0.0: A Key-Value format is additionally supported and recommended.
* It uses comma-separated key-value pairs (e.g., "=dqp:-6,slb:1").
* Supported keys:
* - "dqp": Quantization parameter offset.
* - "slb": Semantic label. The value must correspond to {@link OH_VideoMetadataRoiSemanticLabel}.
*
* If "=Params" is omitted entirely, like "Top1,Left1-Bottom1,Right1;Top2,Left2-Bottom2,Right2=dqp:-6;",
* the encoder will use the default parameters to perform the ROI encoding on the first ROI and
* use the specified parameters on the second ROI.
* Note that the number of ROIs that can be applied simultaneously does not exceed six, and the total area must
* not exceed one-fifth of the total image area.
*
* This is an optional key that applies only to video encoder.
* It is used in running process and is set with each frame.
* In surface mode, it is used in {@link OH_VideoEncoder_OnNeedInputParameter}.
* In buffer mode, it is configured via {@link OH_AVBuffer_SetParameter}.
* @syscap SystemCapability.Multimedia.Media.CodecBase
*
* @note Since version 26.0.0, it is highly recommended to use {@link OH_VideoMetadata_AppendRoiString} to format
* and append ROI configurations safely instead of concatenating the string manually.
* @since 20
*/
extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS;
@@ -0,0 +1,202 @@
/*
* Copyright (C) 2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup CodecBase
* @{
*
* @brief The CodecBase module provides variables, properties, and functions
* for audio and video muxer, demuxer, and basic encoding and decoding functions.
*
* @since 9
*/
/**
* @file native_avcodec_videobase.h
*
* @brief Declare the Native API used for basic video encoding and decoding functions,
* as well as video-specific configurations and parameters.
*
* @kit AVCodecKit
* @library libnative_media_codecbase.so
* @syscap SystemCapability.Multimedia.Media.CodecBase
* @since 26.0.0
*/
#ifndef NATIVE_AVCODEC_VIDEOBASE_H
#define NATIVE_AVCODEC_VIDEOBASE_H
#include <stdint.h>
#include "native_avformat.h"
#include "native_averrors.h"
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief Key for describing the top-coordinate (y) of a single ROI rectangle, value type is int32_t.
*
* The origin of the coordinate system is the top-left corner of the video.
* The value range is [0, {@link OH_MD_KEY_VIDEO_METADATA_ROI_BOTTOM}).
* This is a mandatory key used when configuring ROI parameters.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_TOP;
/**
* @brief Key for describing the left-coordinate (x) of a single ROI rectangle, value type is int32_t.
*
* The origin of the coordinate system is the top-left corner of the video.
* The value range is [0, {@link OH_MD_KEY_VIDEO_METADATA_ROI_RIGHT}).
* This is a mandatory key used when configuring ROI parameters.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_LEFT;
/**
* @brief Key for describing the bottom-coordinate (y) of a single ROI rectangle, value type is int32_t.
*
* The origin of the coordinate system is the top-left corner of the video.
* The value range is ({@link OH_MD_KEY_VIDEO_METADATA_ROI_TOP}, {@link OH_MD_KEY_VIDEO_HEIGHT}].
* This is a mandatory key used when configuring ROI parameters.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_BOTTOM;
/**
* @brief Key for describing the right-coordinate (x) of a single ROI rectangle, value type is int32_t.
*
* The origin of the coordinate system is the top-left corner of the video.
* The value range is ({@link OH_MD_KEY_VIDEO_METADATA_ROI_LEFT}, {@link OH_MD_KEY_VIDEO_WIDTH}].
* This is a mandatory key used when configuring ROI parameters.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_RIGHT;
/**
* @brief Key for describing the quantization parameter offset of a single ROI, value type is int32_t.
*
* The value range is [-51, 51].
* This is an optional key used when configuring ROI parameters.
* If this key is not set, the encoder uses its default quantization parameter strategy for this region.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_DELTA_QP;
/**
* @brief Key for describing the semantic label of a single ROI, value type is int32_t.
*
* The value must correspond to {@link OH_VideoMetadataRoiSemanticLabel}.
* This is an optional key used when configuring ROI parameters.
* If this key is not set, the region is treated with the default semantic processing strategy.
*
* @since 26.0.0
*/
extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_SEM_LABEL;
/**
* @brief The semantic labels for Region of Interest (ROI) in video encoding.
*
* @since 26.0.0
*/
typedef enum OH_VideoMetadataRoiSemanticLabel {
/**
* @brief Indicates an unspecified or unknown region.
*
* @since 26.0.0
*/
OH_VIDEO_METADATA_ROI_SEM_LABEL_OTHER = 0,
/**
* @brief Indicates that the ROI contains a human face.
*
* @since 26.0.0
*/
OH_VIDEO_METADATA_ROI_SEM_LABEL_FACE = 1
} OH_VideoMetadataRoiSemanticLabel;
/**
* @brief Formats the region of interest (ROI) configuration from an OH_AVFormat handle
* into a string and appends it to the target string.
*
* This function extracts ROI properties (such as coordinates, delta quantization parameter,
* and semantic label) from the provided format handle, constructs the standard ROI string
* representation, and seamlessly appends it to the string pointed to by roiStrInOut.
* If *roiStrInOut is NULL, a new string is allocated; if not NULL, the existing string is
* reallocated to append the new configuration.
*
* @note The caller takes ownership of the memory allocated for *roiStrInOut.
* The memory is allocated using the standard C library allocator (malloc/realloc).
* The caller must free the string using the matching standard C library deallocator (free)
* when it is no longer needed, and set the pointer to NULL to prevent double-free.
*
* @param roiStrInOut A double pointer to the target string. The pointer itself must not be NULL.
* If *roiStrInOut is NULL, a new string is allocated.
* @param format The OH_AVFormat handle containing the ROI parameters to be appended, must not be NULL.
* @return Result code.
* <br>Returns {@link AV_ERR_OK} if the string is successfully formatted and appended.
* <br>Returns {@link AV_ERR_INVALID_VAL} if the roiStrInOut pointer or format handle is NULL,
* or if the format lacks required ROI keys.
* <br>Returns {@link AV_ERR_NO_MEMORY} if internal memory allocation or reallocation fails.
* @release free {roiStrInOut}
* @since 26.0.0
*/
OH_AVErrCode OH_VideoMetadata_AppendRoiString(char **roiStrInOut, OH_AVFormat *format);
/**
* @brief Pre-parses the ROI string to obtain the number of valid ROI regions contained within it.
*
* This interface is decoupled from specific backend capacity limits and accurately returns
* the number of valid regions identified in the string based on syntax rules.
*
* @param roiStr The input ROI configuration string.
* @param outCount [OUT] Returns the number of valid ROI regions parsed from the string.
* @return Result code.
* <br>Returns {@link AV_ERR_OK} if the operation is successful.
* <br>Returns {@link AV_ERR_INVALID_VAL} if the roiStr or outCount pointer is NULL.
* @since 26.0.0
*/
OH_AVErrCode OH_VideoMetadata_GetRoiCount(const char *roiStr, uint32_t *outCount);
/**
* @brief Parses the ROI string and populates the caller-provided OH_AVFormat array.
*
* @note The caller takes ownership of every successfully created OH_AVFormat handle. Upon return,
* the valid handles are stored in the first *outCount elements of the outOwnedFormats array.
* - On full or partial success (*outCount > 0), the caller must individually destroy
* each valid handle using {@link OH_AVFormat_Destroy} to prevent memory leaks.
* - On total failure (*outCount == 0), no handles are created and no destruction is needed.
*
* @param roiStr The input ROI configuration string.
* @param outOwnedFormats [OUT] A pointer array allocated by the caller to receive the parsed
* OH_AVFormat handles. The caller owns each non-NULL handle in this array.
* @param maxCapacity [IN] Indicates the maximum physical capacity of the outOwnedFormats array to prevent
* out-of-bounds writes.
* @param outCount [OUT] Returns the actual number of ROIs successfully parsed and populated into the array.
* @return Result code.
* <br>Returns {@link AV_ERR_OK} if the operation is successful.
* <br>Returns {@link AV_ERR_INVALID_VAL} if roiStr, outOwnedFormats, or outCount is NULL.
* @release media_foundation/OH_AVFormat_Destroy {outOwnedFormats}
* @since 26.0.0
*/
OH_AVErrCode OH_VideoMetadata_ParseRoiString(const char *roiStr, OH_AVFormat **outOwnedFormats, uint32_t maxCapacity,
uint32_t *outCount);
#ifdef __cplusplus
}
#endif
#endif // NATIVE_AVCODEC_VIDEOBASE_H
/** @} */
+97
View File
@@ -206,6 +206,103 @@ typedef enum Camera_Position {
CAMERA_POSITION_FRONT = 2
} Camera_Position;
/**
* @brief Enum for automotive camera position.
*
* @since 26.0.0
*/
typedef enum OH_Camera_AutomotiveCameraPosition {
/**
* Exterior other position.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_EXTERIOR_OTHER = 0,
/**
* Exterior front position.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_EXTERIOR_FRONT = 1,
/**
* Exterior rear position.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_EXTERIOR_REAR = 2,
/**
* Exterior left position.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_EXTERIOR_LEFT = 3,
/**
* Exterior right position.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_EXTERIOR_RIGHT = 4,
/**
* Interior other position.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_OTHER = 5,
/**
* Interior left side position of the first row.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_ROW_1_LEFT = 6,
/**
* Interior center side position of the first row.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_ROW_1_CENTER = 7,
/**
* Interior right side position of the first row.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_ROW_1_RIGHT = 8,
/**
* Interior left side position of the second row.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_ROW_2_LEFT = 9,
/**
* Interior center side position of the second row.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_ROW_2_CENTER = 10,
/**
* Interior right side position of the second row.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_ROW_2_RIGHT = 11,
/**
* Interior left side position of the third row.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_ROW_3_LEFT = 12,
/**
* Interior center side position of the third row.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_ROW_3_CENTER = 13,
/**
* Interior right side position of the third row.
* @since 26.0.0
*/
OH_CAMERA_AUTOMOTIVE_CAMERA_POSITION_INTERIOR_ROW_3_RIGHT = 14
} OH_Camera_AutomotiveCameraPosition;
/**
* @brief Enumerates the camera types.
*
@@ -1138,5 +1138,9 @@
{
"first_introduced": "26.0.0",
"name": "OH_MetadataObjectExt_Destroy"
},
{
"first_introduced": "26.0.0",
"name": "OH_CameraDevice_GetAutomotiveCameraPosition"
}
]
@@ -217,6 +217,17 @@ Camera_ErrorCode OH_CameraDevice_GetSensorPixelArraySize(const Camera_Device* ca
*/
Camera_ErrorCode OH_CameraDevice_GetSensorColorFilterArrangement(const Camera_Device* camera, OH_Camera_SensorColorFilterArrangement* sensorCFA);
/**
* @brief Gets the automotive position of a camera sensor.
*
* @param camera Pointer to the Camera_Device used to retrieve attributes.
* @param automotiveCameraPosition Output parameter, returns the automotive camera position enum value.
* @return {@link CAMERA_OK} if the operation succeeds
* {@link CAMERA_INVALID_ARGUMENT} if parameter is missing or invalid
* {@link CAMERA_SERVICE_FATAL_ERROR} if camera service fails
* @since 26.0.0
*/
Camera_ErrorCode OH_CameraDevice_GetAutomotiveCameraPosition(const Camera_Device* camera, OH_Camera_AutomotiveCameraPosition* automotiveCameraPosition);
#ifdef __cplusplus
}
#endif
+5 -1
View File
@@ -300,6 +300,7 @@ _ndk_library_targets = [
_ndk_base_libs = [
"//interface/sdk_c/third_party/musl/ndk_script/adapter:libc_ndk",
"//interface/sdk_c/third_party/musl/ndk_script/adapter:libc_ndk_lite",
"//interface/sdk_c/third_party/musl/ndk_script:musl_ndk_libs_arm32",
"//interface/sdk_c/third_party/musl/ndk_script:musl_ndk_libs_aarch64",
"//interface/sdk_c/third_party/musl/ndk_script:musl_ndk_libs_x86_64",
@@ -308,6 +309,9 @@ _ndk_base_libs = [
_ndk_sysroot_uapi =
[ "//interface/sdk_c/third_party/musl/ndk_script:musl_sysroot" ]
_ndk_sysroot_lite_uapi =
[ "//interface/sdk_c/third_party/musl/ndk_script:musl_sysroot_lite" ]
_ndk_cmake = [ "//build/ohos/ndk:ndk_cmake_files" ]
_ndk_ninja = []
@@ -345,7 +349,7 @@ _ndk_tee_build_tool =
all_ndk_targets_list =
_ndk_library_targets + _ndk_base_libs + _ndk_sysroot_uapi + _ndk_cmake +
_ndk_ninja + _ndk_tee_build_tool
_ndk_ninja + _ndk_tee_build_tool + _ndk_sysroot_lite_uapi
if (build_windows_ndk_target) {
all_ndk_targets_list +=
+78
View File
@@ -242,6 +242,14 @@ group("musl_sysroot") {
]
}
group("musl_sysroot_lite") {
deps = [
":copy_musl_sysroot_lite",
":musl_bits_riscv32",
":musl_bits_cortex_m",
]
}
action("copy_ndk_uapi") {
outputs = [ "${musl_target_out_dir}/${ndk_musl_include}/linux" ]
script = "${musl_dir}/scripts/copy_uapi.sh"
@@ -279,6 +287,16 @@ action("copy_musl_sysroot") {
deps = [ ":updated_version" ]
}
action("copy_musl_sysroot_lite") {
outputs = [ "${ndk_lite_headers_out_dir}" ]
script = "copy_musl_sysroot_lite.sh"
args =
[ "-i" ] + [ rebase_path("${musl_target_out_dir}/${ndk_musl_include}") ]
args += [ "-o" ] + [ rebase_path("${ndk_lite_headers_out_dir}") ]
args += [ "-t" ] + [ "${musl_arch}" ]
deps = [ ":updated_version" ]
}
musl_libs_arm32 = [
"//third_party/musl:create_alltypes_h(//build/toolchain/ohos:ohos_clang_arm)",
"//third_party/musl:create_syscall_h(//build/toolchain/ohos:ohos_clang_arm)",
@@ -297,6 +315,16 @@ musl_libs_x86_64 = [
"//third_party/musl:musl_copy_inc_bits(//build/toolchain/ohos:ohos_clang_x86_64)",
]
musl_libs_riscv32 = [
"//third_party/musl:create_alltypes_h(//build/toolchain/ohos:ohos_clang_riscv32)",
"//third_party/musl:musl_copy_inc_bits(//build/toolchain/ohos:ohos_clang_riscv32)",
]
musl_libs_cortex_m = [
"//third_party/musl:create_alltypes_h(//build/toolchain/ohos:ohos_clang_cortex_m)",
"//third_party/musl:musl_copy_inc_bits(//build/toolchain/ohos:ohos_clang_cortex_m)",
]
musl_lib_arm32 = [
"//third_party/musl:soft_musl_crt_install_action(//build/toolchain/ohos:ohos_clang_arm)",
"//third_party/musl:soft_libc_musl_static(//build/toolchain/ohos:ohos_clang_arm)",
@@ -405,6 +433,56 @@ ohos_copy("musl_bits_x86_64") {
outputs = [ "$ndk_os_irrelevant_out_dir/sysroot/usr/include/x86_64-linux-ohos/bits/{{source_file_part}}" ]
}
## riscv32-linux-ohos bits directory
ohos_copy("musl_bits_riscv32") {
deps = musl_libs_riscv32
sources = []
sources_orig = [
"alltypes.h",
"posix.h",
"signal.h",
"stat.h",
"stdint.h",
"fcntl.h",
"errno.h",
"limits.h",
"pthread_adapt.h",
]
foreach(s, sources_orig) {
sources += [ get_label_info(deps[0], "target_out_dir") +
"/usr/include/riscv32-linux-ohos/bits/${s}" ]
}
outputs = [ "$ndk_os_irrelevant_out_dir/sysroot_lite/usr/include/riscv32-linux-ohos/bits/{{source_file_part}}" ]
}
## arm-liteos-ohos bits directory
ohos_copy("musl_bits_cortex_m") {
deps = musl_libs_cortex_m
sources = []
sources_orig = [
"alltypes.h",
"posix.h",
"signal.h",
"stat.h",
"stdint.h",
"fcntl.h",
"errno.h",
"limits.h",
"pthread_adapt.h",
]
foreach(s, sources_orig) {
sources += [ get_label_info(deps[0], "target_out_dir") +
"/usr/include/arm-liteos-ohos/bits/${s}" ]
}
outputs = [ "$ndk_os_irrelevant_out_dir/sysroot_lite/usr/include/arm-liteos-ohos/bits/{{source_file_part}}" ]
}
ohos_copy("musl_ndk_libs_arm32") {
deps = musl_lib_arm32
crt_dir = "${root_build_dir}/obj/third_party/musl/usr/lib/arm-linux-ohos"
+12
View File
@@ -25,3 +25,15 @@ ohos_ndk_library("libc_ndk") {
"-Wno-incomplete-setjmp-declaration",
]
}
ohos_ndk_lite_library("libc_ndk_lite") {
output_name = "c"
output_extension = "so"
ndk_description_file = "./libc_lite.ndk.json"
cflags = [
"-Wno-incompatible-library-redeclaration",
"-Wno-builtin-requires-header",
"-Wno-invalid-noreturn",
"-Wno-incomplete-setjmp-declaration",
]
}
+67
View File
@@ -0,0 +1,67 @@
[
{ "name": "access"},
{ "name": "atoi"},
{ "name": "calloc"},
{ "name": "clock_gettime"},
{ "name": "close"},
{ "name": "floorf"},
{ "name": "free"},
{ "name": "gettimeofday"},
{ "name": "lseek"},
{ "name": "malloc"},
{ "name": "memcmp"},
{ "name": "memcpy"},
{ "name": "memmove"},
{ "name": "memset"},
{ "name": "mkdir"},
{ "name": "open"},
{ "name": "pthread_attr_destroy"},
{ "name": "pthread_attr_init"},
{ "name": "pthread_attr_setstack"},
{ "name": "pthread_attr_setstacksize"},
{ "name": "pthread_condattr_destroy"},
{ "name": "pthread_condattr_init"},
{ "name": "pthread_condattr_setclock"},
{ "name": "pthread_cond_broadcast"},
{ "name": "pthread_cond_destroy"},
{ "name": "pthread_cond_init"},
{ "name": "pthread_cond_signal"},
{ "name": "pthread_cond_timedwait"},
{ "name": "pthread_cond_wait"},
{ "name": "pthread_create"},
{ "name": "pthread_detach"},
{ "name": "pthread_getspecific"},
{ "name": "pthread_join"},
{ "name": "pthread_key_create"},
{ "name": "pthread_mutex_destroy"},
{ "name": "pthread_mutex_init"},
{ "name": "pthread_mutex_lock"},
{ "name": "pthread_mutex_trylock"},
{ "name": "pthread_mutex_unlock"},
{ "name": "pthread_self"},
{ "name": "pthread_setspecific"},
{ "name": "rand"},
{ "name": "read"},
{ "name": "realloc"},
{ "name": "sleep"},
{ "name": "snprintf"},
{ "name": "sprintf"},
{ "name": "sqrtf"},
{ "name": "srand"},
{ "name": "sscanf"},
{ "name": "stat"},
{ "name": "strcat"},
{ "name": "strcmp"},
{ "name": "strcpy"},
{ "name": "strlen"},
{ "name": "strncmp"},
{ "name": "strtod"},
{ "name": "strtoul"},
{ "name": "time"},
{ "name": "timer_settime"},
{ "name": "tolower"},
{ "name": "unlink"},
{ "name": "usleep"},
{ "name": "vsnprintf"},
{ "name": "write"}
]
+56
View File
@@ -0,0 +1,56 @@
#!/bin/bash
# Copyright (c) Huawei Technologies Co., Ltd. 2020-2030. All rights reserved.
set -e
while getopts "o:i:t:h" arg
do
case "${arg}" in
"o")
OUT_DIR=${OPTARG}
;;
"i")
SOURCE_DIR=${OPTARG}
;;
"t")
TARGET_ARCH=${OPTARG}
;;
"h")
echo "help"
;;
?)
echo "unkonw argument"
exit 1
;;
esac
done
if [ ! -d "${OUT_DIR}" ];then
mkdir -p ${OUT_DIR}
fi
if [ ! -d "${OUT_DIR}/sys" ];then
mkdir -p ${OUT_DIR}/sys
fi
cp -rp ${SOURCE_DIR}/fortify/ ${OUT_DIR}
cp ${SOURCE_DIR}/sys/select.h ${OUT_DIR}/sys/
cp ${SOURCE_DIR}/sys/stat.h ${OUT_DIR}/sys/
cp ${SOURCE_DIR}/sys/time.h ${OUT_DIR}/sys/
cp ${SOURCE_DIR}/alloca.h ${OUT_DIR}
cp ${SOURCE_DIR}/ctype.h ${OUT_DIR}
cp ${SOURCE_DIR}/fcntl.h ${OUT_DIR}
cp ${SOURCE_DIR}/features.h ${OUT_DIR}
cp ${SOURCE_DIR}/math.h ${OUT_DIR}
cp ${SOURCE_DIR}/pthread.h ${OUT_DIR}
cp ${SOURCE_DIR}/sched.h ${OUT_DIR}
cp ${SOURCE_DIR}/signal.h ${OUT_DIR}
cp ${SOURCE_DIR}/stdarg.h ${OUT_DIR}
cp ${SOURCE_DIR}/stddef.h ${OUT_DIR}
cp ${SOURCE_DIR}/stdint.h ${OUT_DIR}
cp ${SOURCE_DIR}/stdio.h ${OUT_DIR}
cp ${SOURCE_DIR}/stdlib.h ${OUT_DIR}
cp ${SOURCE_DIR}/string.h ${OUT_DIR}
cp ${SOURCE_DIR}/strings.h ${OUT_DIR}
cp ${SOURCE_DIR}/time.h ${OUT_DIR}
cp ${SOURCE_DIR}/unistd.h ${OUT_DIR}
File diff suppressed because it is too large Load Diff
+2 -352
View File
@@ -41,6 +41,8 @@
#include "drawable_descriptor.h"
#include "node_attributes/common_attributes.h"
#ifdef __cplusplus
extern "C" {
#endif
@@ -1062,39 +1064,6 @@ typedef enum {
ARKUI_BORDER_STYLE_DOTTED,
} ArkUI_BorderStyle;
/**
* @brief Enumerates the hit test modes.
*
* @since 12
*/
typedef enum {
/** Both the node and its child node respond to the hit test of a touch event, but its sibling node is blocked from
* the hit test. */
ARKUI_HIT_TEST_MODE_DEFAULT = 0,
/** The node responds to the hit test of a touch event, but its child node and sibling node are blocked from the
* hit test. */
ARKUI_HIT_TEST_MODE_BLOCK,
/** Both the node and its child node respond to the hit test of a touch event, and its sibling node is also
* considered during the hit test. */
ARKUI_HIT_TEST_MODE_TRANSPARENT,
/** The node does not respond to the hit test of a touch event. */
ARKUI_HIT_TEST_MODE_NONE,
/**
* The node and its child nodes participate in hit tests, while blocking hit tests for all sibling nodes and
* parent nodes with lower priority.
*
* @since 20
*/
ARKUI_HIT_TEST_MODE_BLOCK_HIERARCHY,
/**
* The node does not respond to hit tests, and none of its descendants (including children and grandchildren)
* participate in hit tests either.
*
* @since 20
*/
ARKUI_HIT_TEST_MODE_BLOCK_DESCENDANTS,
} ArkUI_HitTestMode;
/**
* @brief Enumerates the shadow styles.
*
@@ -1853,20 +1822,6 @@ typedef enum {
ARKUI_FLEX_WRAP_WRAP_REVERSE,
} ArkUI_FlexWrap;
/**
* @brief Enumerates the visibility values.
*
* @since 12
*/
typedef enum {
/** The component is visible. */
ARKUI_VISIBILITY_VISIBLE = 0,
/** The component is hidden, and a placeholder is used for it in the layout. */
ARKUI_VISIBILITY_HIDDEN,
/** The component is hidden. It is not involved in the layout, and no placeholder is used for it. */
ARKUI_VISIBILITY_NONE,
} ArkUI_Visibility;
/**
* @brief Enumerates the alignment modes between the calendar picker and the entry component.
*
@@ -2804,37 +2759,6 @@ typedef enum {
ARKUI_ANIMATION_DIRECTION_ALTERNATE_REVERSE,
} ArkUI_AnimationDirection;
/**
* @brief Enumerates the hover effects when a component is hovered over.
*
* @since 23
*/
typedef enum {
/** Default effect. */
ARKUI_HOVER_EFFECT_AUTO = 0,
/** Scale effect. */
ARKUI_HOVER_EFFECT_SCALE,
/** Highlight effect. */
ARKUI_HOVER_EFFECT_HIGHLIGHT,
/** No effect. */
ARKUI_HOVER_EFFECT_NONE,
} ArkUI_HoverEffect;
/**
* @brief Enumerates the priority levels for focus management within the application.
* These levels determine the sequence in which UI components receive focus during user interaction.
*
* @since 23
*/
typedef enum {
/** Default priority. */
ARKUI_FOCUS_PRIORITY_AUTO = 0,
/** Higher priority. */
ARKUI_FOCUS_PRIORITY_PRIOR = 2000,
/** Previous focus priority. */
ARKUI_FOCUS_PRIORITY_PREVIOUS = 3000,
} ArkUI_FocusPriority;
/**
* @brief Define the rolling source enumeration value.
*
@@ -3046,26 +2970,6 @@ typedef enum {
ARKUI_SAFE_AREA_EDGE_END = 1 << 3,
} ArkUI_SafeAreaEdge;
/**
* @brief Define an enum for the focus movement directions.
*
* @since 18
*/
typedef enum {
/** Move focus forward. */
ARKUI_FOCUS_MOVE_FORWARD = 0,
/** Move focus backward. */
ARKUI_FOCUS_MOVE_BACKWARD,
/** Move focus up. */
ARKUI_FOCUS_MOVE_UP,
/** Move focus down. */
ARKUI_FOCUS_MOVE_DOWN,
/** Move focus left. */
ARKUI_FOCUS_MOVE_LEFT,
/** Move focus right. */
ARKUI_FOCUS_MOVE_RIGHT,
} ArkUI_FocusMove;
/**
* @brief defines the enumerated value of the customDialog's keyboard avoid mode.
*
@@ -3104,33 +3008,6 @@ typedef enum {
ARKUI_LAZY_EXPAND = 2,
} ArkUI_ExpandMode;
/**
* @brief Defines the navigation point indicator style of the <b><Swiper></b> component.
* @brief Enumerates the UI states of a component, used for handling state-specific styles.
*
* @since 20
*/
typedef enum {
/** Normal state. */
UI_STATE_NORMAL = 0,
/** Pressed state. */
UI_STATE_PRESSED = 1 << 0,
/** Focused state. */
UI_STATE_FOCUSED = 1 << 1,
/** Disabled state. */
UI_STATE_DISABLED = 1 << 2,
/**
* Selected state. This state is supported only by specific component types:
* <b>Checkbox</b>, <b>Radio</b>, <b>Toggle</b>, <b>List</b>, <b>Grid</b>, and <b>MenuItem</b>.
*/
UI_STATE_SELECTED = 1 << 3,
/**
* The hovered state.
* @since 26.0.0
*/
UI_STATE_HOVERED = 1 << 4,
} ArkUI_UIState;
/**
* @brief Enumerates the edge direction.
*
@@ -3213,21 +3090,6 @@ typedef enum {
ARKUI_LIST_ITEM_SWIPE_ACTION_DIRECTION_END = 1,
} ArkUI_ListItemSwipeActionDirection;
/**
* @brief Enumerates the input tool types supported for response region configuration.
*
* @since 23
*/
typedef enum {
/** All input tool types. */
ARKUI_RESPONSE_REGIN_SUPPORTED_TOOL_ALL = 0,
/** Finger input. */
ARKUI_RESPONSE_REGIN_SUPPORTED_TOOL_FINGER = 1,
/** Stylus input. */
ARKUI_RESPONSE_REGIN_SUPPORTED_TOOL_PEN = 2,
/** Mouse input. */
ARKUI_RESPONSE_REGIN_SUPPORTED_TOOL_MOUSE = 3,
} ArkUI_ResponseRegionSupportedTool;
/**
* @brief Define the types for expanding the safe area in layout.
*
@@ -3323,13 +3185,6 @@ typedef enum {
*/
typedef struct ArkUI_SystemFontStyleEvent ArkUI_SystemFontStyleEvent;
/**
* @brief Defines the options for taking snapshot.
*
* @since 15
*/
typedef struct ArkUI_SnapshotOptions ArkUI_SnapshotOptions;
/**
* @brief TextPicker single column selector, supports mixing text and images.
*
@@ -3344,22 +3199,6 @@ typedef struct ArkUI_TextPickerRangeContentArray ArkUI_TextPickerRangeContentArr
*/
typedef struct ArkUI_TextCascadePickerRangeContentArray ArkUI_TextCascadePickerRangeContentArray;
/**
* @brief Defines a two-dimensional point struct, with coordinates stored as float type.
*
* @since 24
*/
typedef struct {
/**
* x-axis coordinate.
*/
float x;
/**
* y-axis coordinate.
*/
float y;
} ArkUI_PointF;
/**
* @brief Defines the options for selection operation.
*
@@ -5784,195 +5623,6 @@ void OH_ArkUI_CrossLanguageOption_SetAttributeSettingStatus(ArkUI_CrossLanguageO
*/
bool OH_ArkUI_CrossLanguageOption_GetAttributeSettingStatus(ArkUI_CrossLanguageOption* option);
/**
* @brief Creates an option for taking snapshot, the returned value must be released through
* {@link OH_ArkUI_DestroySnapshotOptions} when it's not used anymore.
*
* @return Returns the pointer to the created snapshot options object.If the object returns a null pointer,
* it indicates a creation failure, and the reason for the failure may be that the address space is full.
* @since 15
*/
ArkUI_SnapshotOptions* OH_ArkUI_CreateSnapshotOptions();
/**
* @brief Dispose a snapshot option object.
*
* @param snapshotOptions Indicates the pointer to the snapshot option.
* @since 15
*/
void OH_ArkUI_DestroySnapshotOptions(ArkUI_SnapshotOptions* snapshotOptions);
/**
* @brief Config the snapshot option with scale.
*
* @param snapshotOptions Indicates the pointer to the snapshot option.
* @param scale Indicates the scale property to take the snapshot.
* @return Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* @since 15
*/
int32_t OH_ArkUI_SnapshotOptions_SetScale(ArkUI_SnapshotOptions* snapshotOptions, float scale);
/**
* @brief Sets the color mode for snapshot capture.
* By default, snapshots are captured in SRGB mode, which may lose visual effects for components using wide color
* gamut display modes.
* If the target component's color space is known, specify it through <b>colorSpace</b> and set <b>isAuto</b> to
* <b>false</b> to achieve optimal snapshot quality.
* Since determining the exact color space used by a component is often difficult, set <b>isAuto</b> to <b>true</b>
* to let the system automatically select the appropriate color space.
* If <b>isAuto</b> is set to <b>true</b>, the <b>colorSpace</b> parameter value is ignored.
*
* @param snapshotOptions Pointer to the target snapshot configuration options.
* @param colorSpace Target color space. Supported values: <b>3</b> (DISPLAY_P3), <b>4</b> (SRGB), <b>27</b>
* (DISPLAY_BT2020_SRGB).
* @param isAuto Whether to auto-detect the color space.
* <b>true</b>: ignores the <b>colorSpace</b> parameter value and auto-detects the color space.
* <b>false</b>: uses the color space specified by <b>colorSpace</b>.
* @return Returns the result code.
* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* @since 23
*/
int32_t OH_ArkUI_SnapshotOptions_SetColorMode(ArkUI_SnapshotOptions* snapshotOptions, int32_t colorSpace, bool isAuto);
/**
* @brief Sets the dynamic range mode for snapshot capture.
* By default, the system captures snapshots in {@link ARKUI_DYNAMIC_RANGE_MODE_STANDARD} mode.
* To use a specific mode, specify it via the <b>dynamicRangeMode</b> parameter and set <b>isAuto</b> to <b>false</b>.
* Alternatively, set <b>isAuto</b> to <b>true</b> to let the system auto-detect the appropriate dynamic range mode.
* If <b>isAuto</b> is set to <b>true</b>, the <b>dynamicRangeMode</b> parameter value is ignored.
*
* @param snapshotOptions Pointer to the target snapshot configuration options.
* @param dynamicRangeMode Target dynamic range mode, specified using {@link ArkUI_DynamicRangeMode}.
* @param isAuto Whether to auto-detect the dynamic range mode.
* <b>true</b>: ignores the <b>dynamicRangeMode</b> parameter value and auto-detects the dynamic range
* mode.
* <b>false</b>: uses the dynamic range mode specified by <b>dynamicRangeMode</b>.
* @return Returns the result code.
* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* @since 23
*/
int32_t OH_ArkUI_SnapshotOptions_SetDynamicRangeMode(
ArkUI_SnapshotOptions* snapshotOptions, int32_t dynamicRangeMode, bool isAuto);
/**
* @brief Defines the parameters for visible area change events.
*
* @since 17
*/
typedef struct ArkUI_VisibleAreaEventOptions ArkUI_VisibleAreaEventOptions;
/**
* @brief Creates an instance of visible area change event parameters
*
* @return Returns the created instance of visible area change event parameters.
* @since 17
*/
ArkUI_VisibleAreaEventOptions* OH_ArkUI_VisibleAreaEventOptions_Create();
/**
* @brief Disposes of an instance of visible area change event parameters.
*
* @param option Instance to be destroyed.
* @since 17
*/
void OH_ArkUI_VisibleAreaEventOptions_Dispose(ArkUI_VisibleAreaEventOptions* option);
/**
* @brief Sets the threshold ratios for visible area changes.
*
* @param option Instance of visible area change event parameters.
* @param value Array of threshold ratios. Each element represents the ratio of the visible area of a component to
* its total area. The visible area is calculated within the parent component's bounds; any area outside the parent
* component is not considered. Each value must be within the [0.0, 1.0] range.
* Values outside this range will be handled as 0.0 or 1.0.
* @param size Size of the threshold array.
* @return Returns the result code.
* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* If an error code is returned, it may be due to a failure in parameter validation;
* the parameter must not be null.
* @since 17
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_SetRatios(ArkUI_VisibleAreaEventOptions* option, float* value, int32_t size);
/**
* @brief Sets the expected update interval for visible area changes.
*
* @param option Instance of visible area change event parameters.
* @param value Expected update interval, in ms. Default value: <b>1000</b>.
* @return Returns the result code.
* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* If an error code is returned, it may be due to a failure in parameter validation;
* the parameter must not be null.
* @since 17
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_SetExpectedUpdateInterval(
ArkUI_VisibleAreaEventOptions *option, int32_t value);
/**
* @brief Sets the flag for controlling if the child components can exceed the parent's bounds.
* if set to false, the part that exceeds the parent's bounds will be considered as invisible area,
* set to true to allow the exceeding, the part that exceeds will be considered as visible area.
*
* Please note that if the parent component set clip(true), the measureFromViewport configuration
* will be ignored.
*
* @param option Instance of visible area change event parameters.
* @param measureFromViewport When this parameter is set to true, the parts of the component
* that exceed the parent component's area will also be included in the visible area calculation. However, this
* only applies if the parent component does not explicitly set the clip property to true. If the parent component
* sets clip to true, regardless of the value of this parameter, the parts that exceed the parent component's area
* will still be treated as invisible in the visible area calculation.
* Default measureFromViewport: <b>false</b>.
* @return Returns the result code.
* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* If an error code is returned, it may be due to a failure in parameter validation;
* the parameter must not be null.
* @since 22
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_SetMeasureFromViewport(
ArkUI_VisibleAreaEventOptions* option, bool measureFromViewport);
/**
* @brief Obtains the threshold ratios for visible area changes.
*
* @param option Instance of visible area change event parameters.
* @param value Array of threshold ratios.
* @param size Size of the threshold array.
* @return Returns the result code.
* Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
* Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter error occurs.
* Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the provided buffer size is insufficient.
* If an error code is returned, it may be due to a failure in parameter validation;
* the parameter must not be null.
* @since 17
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_GetRatios(ArkUI_VisibleAreaEventOptions* option, float* value, int32_t* size);
/**
* @brief Obtains the expected update interval for visible area changes.
*
* @param option Instance of visible area change event parameters.
* @return Returns the expected update interval, in ms. Default value: <b>1000</b>.
* @since 17
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_GetExpectedUpdateInterval(ArkUI_VisibleAreaEventOptions* option);
/**
* @brief Obtains the value set through {@link OH_ArkUI_VisibleAreaEventOptions_SetMeasureFromViewport} .
*
* @param option Instance of visible area change event parameters.
* @return Returns the flag for controlling of the visible area calculation. Default value: <b>false</b>.
*
* @since 22
*/
bool OH_ArkUI_VisibleAreaEventOptions_GetMeasureFromViewport(ArkUI_VisibleAreaEventOptions* option);
/**
* @brief Creates a TextPickerRangeContent instance.
*
File diff suppressed because it is too large Load Diff
@@ -0,0 +1,365 @@
/*
* Copyright (c) 2024-2026 Huawei Device Co., Ltd.
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* @addtogroup ArkUI_NativeModule
* @{
*
* @brief Provides UI capabilities of ArkUI on the native side, such as UI component creation and destruction,
* tree node operations, attribute setting, and event listening.
*
* @since 12
*/
/**
* @file common_attributes.h
*
* @brief Defines the common property and method types for the native module.
*
* @library libace_ndk.z.so
* @syscap SystemCapability.ArkUI.ArkUI.Full
* @kit ArkUI
* @since 12
*/
#ifndef ARKUI_COMMON_ATTRIBUTES_H
#define ARKUI_COMMON_ATTRIBUTES_H
#include <stdint.h>
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
* @brief 触摸测试控制枚举值。
*
* @since 12
*/
typedef enum {
/** 默认触摸测试效果。自身及子节点响应触摸测试,但阻塞兄弟节点的触摸测试,不影响祖先节点的触摸测试。 */
ARKUI_HIT_TEST_MODE_DEFAULT = 0,
/** 自身响应触摸测试,阻塞子节点、兄弟节点和祖先节点的触摸测试。 */
ARKUI_HIT_TEST_MODE_BLOCK,
/** 自身和子节点都响应触摸测试,不会阻塞兄弟节点和祖先节点的触摸测试。 */
ARKUI_HIT_TEST_MODE_TRANSPARENT,
/** 自身不响应触摸测试,不会阻塞子节点、兄弟节点和祖先节点的触摸测试。 */
ARKUI_HIT_TEST_MODE_NONE,
/**
* 自身和子节点响应触摸测试,阻止所有优先级较低的兄弟节点和父节点参与触摸测试。
* @since 20
*/
ARKUI_HIT_TEST_MODE_BLOCK_HIERARCHY,
/**
* 自身不响应触摸测试,并且所有的后代(孩子,孙子等)也不响应触摸测试,不会影响祖先节点的触摸测试。
* @since 20
*/
ARKUI_HIT_TEST_MODE_BLOCK_DESCENDANTS
} ArkUI_HitTestMode;
/**
* @brief 控制组件的显隐枚举值。
*
* @since 12
*/
typedef enum {
/** 显示。 */
ARKUI_VISIBILITY_VISIBLE = 0,
/** 隐藏,但参与布局进行占位。 */
ARKUI_VISIBILITY_HIDDEN,
/** 隐藏,但不参与布局,不进行占位。 */
ARKUI_VISIBILITY_NONE
} ArkUI_Visibility;
/**
* @brief 组件被悬停时的效果。
*
* @since 23
*/
typedef enum {
/** 默认效果。 */
ARKUI_HOVER_EFFECT_AUTO = 0,
/** 缩放效果。 */
ARKUI_HOVER_EFFECT_SCALE,
/** 高亮效果。 */
ARKUI_HOVER_EFFECT_HIGHLIGHT,
/** 无效果。 */
ARKUI_HOVER_EFFECT_NONE
} ArkUI_HoverEffect;
/**
* @brief 应用程序内焦点管理的优先级级别。确定UI组件在交互期间接收焦点的顺序。
*
* @since 23
*/
typedef enum {
/** 默认优先级。 */
ARKUI_FOCUS_PRIORITY_AUTO = 0,
/** 容器内优先获焦的优先级。 */
ARKUI_FOCUS_PRIORITY_PRIOR = 2000,
/** 上一次容器整体失焦时获焦节点的优先级。 */
ARKUI_FOCUS_PRIORITY_PREVIOUS = 3000
} ArkUI_FocusPriority;
/**
* @brief 组件的UI状态枚举,用于处理状态样式。
*
* @since 20
*/
typedef enum {
/** 正常状态。 */
UI_STATE_NORMAL = 0,
/** 按压状态。 */
UI_STATE_PRESSED = 1 << 0,
/** 获焦状态。 */
UI_STATE_FOCUSED = 1 << 1,
/** 禁用状态。 */
UI_STATE_DISABLED = 1 << 2,
/** 选中状态,此状态仅由某些特定类型的组件支持,分别是Checkbox、Radio、Toggle、List、Grid和MenuItem。 */
UI_STATE_SELECTED = 1 << 3,
/**
* 悬浮状态。
* @since 26.0.0
*/
UI_STATE_HOVERED = 1 << 4
} ArkUI_UIState;
/**
* @brief 定义焦点移动方向的枚举值。
*
* @since 18
*/
typedef enum {
/** 向前移动焦点。 */
ARKUI_FOCUS_MOVE_FORWARD = 0,
/** 向后移动焦点。 */
ARKUI_FOCUS_MOVE_BACKWARD,
/** 向上移动焦点。 */
ARKUI_FOCUS_MOVE_UP,
/** 向下移动焦点。 */
ARKUI_FOCUS_MOVE_DOWN,
/** 向左移动焦点。 */
ARKUI_FOCUS_MOVE_LEFT,
/** 向右移动焦点。 */
ARKUI_FOCUS_MOVE_RIGHT
} ArkUI_FocusMove;
/**
* @brief 定义支持响应区域设置的事件工具类型。
*
* @since 23
*/
typedef enum {
/** 所有输入工具类型。 */
ARKUI_RESPONSE_REGIN_SUPPORTED_TOOL_ALL = 0,
/** 手指类型。 */
ARKUI_RESPONSE_REGIN_SUPPORTED_TOOL_FINGER = 1,
/** 手写笔类型。 */
ARKUI_RESPONSE_REGIN_SUPPORTED_TOOL_PEN = 2,
/** 鼠标类型。 */
ARKUI_RESPONSE_REGIN_SUPPORTED_TOOL_MOUSE = 3
} ArkUI_ResponseRegionSupportedTool;
/**
* @brief 定义截图的可选项。
*
* @since 15
*/
typedef struct ArkUI_SnapshotOptions ArkUI_SnapshotOptions;
/**
* @brief 创建一个截图选项,当返回值不再使用时必须通过{@link OH_ArkUI_DestroySnapshotOptions()}释放。
*
* @return 返回指向创建的截图选项对象的指针。如果对象返回空指针,则表示创建失败,失败的原因可能是地址空间已满。
* @since 15
*/
ArkUI_SnapshotOptions* OH_ArkUI_CreateSnapshotOptions();
/**
* @brief 销毁截图选项指针。
*
* @param snapshotOptions 截图选项。
* @since 15
*/
void OH_ArkUI_DestroySnapshotOptions(ArkUI_SnapshotOptions* snapshotOptions);
/**
* @brief 配置截图选项中的缩放属性。
*
* @param snapshotOptions 截图选项。
* @param scale 缩放值。
* @return 错误码
* <br>{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。
* <br>{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。
* <br>异常原因:传入参数验证失败,参数不能为空。
*
* @since 15
*/
int32_t OH_ArkUI_SnapshotOptions_SetScale(ArkUI_SnapshotOptions* snapshotOptions, float scale);
/**
* @brief 设置截图选项中的色彩空间。
*
* @param snapshotOptions 截图选项指针。
* @param colorSpace 指定截图使用的色彩空间。
* <br>如果知道需要截图的组件使用的色彩空间,可以通过colorSpace参数指定,并将isAuto设置为false,以达到预期的截图效果。
* <br>支持的取值为:3RGB色域为Display P3类型)、4RGB色域为SRGB类型)、27RGB色域为DISPLAY BT2020类型)。
* <br>默认值:4
* <br>仅当isAuto设置为false,该参数设置生效。
* @param isAuto 是否由系统自动决定所使用的色彩空间。
* <br>true表示系统自动决定所使用的色彩空间。在不确定组件使用的色彩空间时,建议将isAuto设置为true,让系统根据实际情况自动决定使用的色彩空间。
* <br>false表示使用通过colorSpace字段设置的色彩空间类型进行截图。
* <br>默认值:false
* @return 错误码。
* <br>{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。
* <br>{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。
* @since 23
*/
int32_t OH_ArkUI_SnapshotOptions_SetColorMode(ArkUI_SnapshotOptions* snapshotOptions, int32_t colorSpace, bool isAuto);
/**
* @brief 设置截图选项中的动态范围模式。
*
* @param snapshotOptions 截图选项指针。
* @param dynamicRangeMode 指定截图使用的动态范围模式。
* <br>如果知道截图对象使用的动态范围模式,可通过dynamicRangeMode参数指定动态范围模式,并将isAuto设置为false,以达到预期的截图效果。
* <br>支持的取值为:{@link ArkUI_DynamicRangeMode}枚举值。
* <br>默认值:ARKUI_DYNAMIC_RANGE_MODE_STANDARD
* <br>仅当isAuto设置为false,该参数设置生效。
* @param isAuto 是否由系统自动决定所使用的动态范围模式。
* <br>true表示系统自动决定所使用的动态范围模式。在不确定组件使用的动态范围模式时,建议将isAuto设置为true,让系统根据实际情况自动决定使用的动态范围模式。
* <br>false表示使用通过dynamicRangeMode字段设置的动态范围模式进行截图。
* <br>默认值:false
* @return 错误码。
* <br>{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。
* <br>{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。
* @since 23
*/
int32_t OH_ArkUI_SnapshotOptions_SetDynamicRangeMode(
ArkUI_SnapshotOptions* snapshotOptions, int32_t dynamicRangeMode, bool isAuto);
/**
* @brief 可见区域变化监听的参数。
*
* @since 17
*/
typedef struct ArkUI_VisibleAreaEventOptions ArkUI_VisibleAreaEventOptions;
/**
* @brief 创建可见区域变化监听的参数。
*
* @return 可见区域变化监听的参数。
* @since 17
*/
ArkUI_VisibleAreaEventOptions* OH_ArkUI_VisibleAreaEventOptions_Create();
/**
* @brief 销毁可见区域变化监听的参数。
*
* @param option 需要销毁的实例。
* @since 17
*/
void OH_ArkUI_VisibleAreaEventOptions_Dispose(ArkUI_VisibleAreaEventOptions* option);
/**
* @brief 设置阈值数组。
*
* @param option 可见区域变化监听的参数实例。
* @param value 阈值数组。其中每个元素代表组件可见面积(即组件在屏幕显示区的面积,只计算父组件内的面积,超出父组件部分不会计算)与组件自身面积的比值。
* 每个阈值的取值范围为[0.0, 1.0],如果开发者设置的阈值超出该范围,则会实际取值0.0或1.0。
* @param size 阈值数组大小。
* @return 错误码。
* <br>{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。
* <br>{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。
* <br>异常原因:传入参数验证失败,参数不能为空。
* @since 17
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_SetRatios(ArkUI_VisibleAreaEventOptions* option, float* value, int32_t size);
/**
* @brief 设置预期更新间隔,单位为ms。定义了开发者期望的更新间隔。
*
* @param option 可见区域变化监听的参数实例。
* @param value 预期更新间隔,单位为ms。定义了开发者期望的更新间隔。默认值:1000。
* @return 错误码。
* <br>{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。
* <br>{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常
* <br>异常原因:传入参数验证失败,参数不能为空。
* @since 17
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_SetExpectedUpdateInterval(
ArkUI_VisibleAreaEventOptions *option, int32_t value);
/**
* @brief 设置可见区域计算模式。
*
* @param option 可见区域变化监听的参数实例。
* @param measureFromViewport 当measureFromViewport设置为true时,系统在计算该组件的可见区域时,会考虑父组件的NODE_CLIP属性设置。如果父组件的NODE_CLIP为false
* 则认为其内的子组件可以超出其区域进行显示,因此超出父组件的区域也将被视为可见区域纳入计算;如果父组件的NODE_CLIP设置为true,则组件超出父组件的区域会被裁剪,
* 无法显示,因此会被视为不可见区域进行计算。而当measureFromViewport设置为false时,则不考虑NODE_CLIP的影响,直接将组件超出父组件的部分视为不可见区域。
* 默认值:false
* @return 错误码。
* <br>{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。
* <br>{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。
* <br>异常原因:传入参数验证失败,参数不能为空。
* @since 22
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_SetMeasureFromViewport(
ArkUI_VisibleAreaEventOptions* option, bool measureFromViewport);
/**
* @brief 获取阈值数组。
*
* @param option 可见区域变化监听的参数实例。
* @param value 阈值数组。
* @param size 阈值数组大小。
* @return 错误码。
* <br>{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。
* <br>{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。
* <br>{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} 数组大小不够。
* <br>异常原因:传入参数验证失败,参数不能为空。
* @since 17
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_GetRatios(ArkUI_VisibleAreaEventOptions* option, float* value, int32_t* size);
/**
* @brief 获取预期更新间隔。
*
* @param option 可见区域变化监听的参数实例。
* @return 预期更新间隔,单位为ms。定义了开发者期望的更新间隔。默认值:1000。
* @since 17
*/
int32_t OH_ArkUI_VisibleAreaEventOptions_GetExpectedUpdateInterval(ArkUI_VisibleAreaEventOptions* option);
/**
* @brief 获取可见区域计算模式。
*
* @param option 可见区域变化监听的参数实例。
* @return 获取可见区域计算模式。
* 当measureFromViewport设置为true时,系统在计算该组件的可见区域时,会考虑父组件的NODE_CLIP属性设置。如果父组件的NODE_CLIP为false,则认为其内的子组件可以超出其区域进行显示,
* 因此超出父组件的区域也将被视为可见区域纳入计算;如果父组件的NODE_CLIP设置为true,则组件超出父组件的区域会被裁剪,无法显示,因此会被视为不可见区域进行计算。
* 而当measureFromViewport设置为false时,则不考虑NODE_CLIP的影响,直接将组件超出父组件的部分视为不可见区域。
* 默认值:false
* @since 22
*/
bool OH_ArkUI_VisibleAreaEventOptions_GetMeasureFromViewport(ArkUI_VisibleAreaEventOptions* option);
#ifdef __cplusplus
};
#endif
#endif // ARKUI_COMMON_ATTRIBUTES_H
/** @} */