From 23566a7c3e0b41c6dc357cf9b7106b0900b49951 Mon Sep 17 00:00:00 2001 From: Helinshan Date: Tue, 26 May 2026 14:45:01 +0800 Subject: [PATCH 01/44] "Helinshan fix" Signed-off-by: Helinshan --- .../graphic_2d/native_buffer/buffer_common.h | 59 +++++++++++++++++-- 1 file changed, 53 insertions(+), 6 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index 4ddc3e09b..40604232f 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -229,6 +229,47 @@ typedef struct OH_NativeBuffer_StaticMetadata { OH_NativeBuffer_Cta861 cta861; } OH_NativeBuffer_StaticMetadata; +/** + * @brief Enumerates the semantic label types for Region of Interest (ROI). + * + * These types are used as the predefined values for the "slb" key in ROI parameters. + * + * @since 26.0.0 + */ +typedef enum OH_NativeBuffer_RoiMetadataSemanticLabelType { + /** + * Indicates an unspecified or unknown region. + * @since 26.0.0 + */ + OH_ROI_METADATA_SEMANTIC_LABEL_TYPE_OTHER = 0, + /** + * Indicates that the ROI contains a human face. + * @since 26.0.0 + */ + OH_ROI_METADATA_SEMANTIC_LABEL_TYPE_FACE = 1 +} OH_NativeBuffer_RoiMetadataSemanticLabelType; + +/** + * @brief ROI metadata key for Semantic Label. + * + * Used in the Key-Value format of ROI parameters to specify the semantic label of the region. + * The string value is "slb". The configured value mapped to this key should be the string representation + * of the {@link OH_NativeBuffer_RoiMetadataSemanticLabelType} enumeration (e.g., "1" for OH_ROI_SEMANTIC_LABEL_TYPE_FACE). + * + * @since 26.0.0 + */ +extern const char *OH_ROI_METADATA_KEY_SEMANTIC_LABEL; + +/** + * @brief ROI metadata key for Delta QP. + * + * Used in the Key-Value format of ROI parameters to specify the quantization parameter offset. + * The string value is "dqp". + * + * @since 26.0.0 + */ +extern const char *OH_ROI_METADATA_KEY_DELTA_QP; + /** * @brief Indicates the descriptive information of a native buffer, * such as HDR metadata, ROI metadata, etc. @@ -245,12 +286,18 @@ 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 and supports two formats for backward compatibility: + * 1. Legacy format: A single integer representing the quantization parameter offset (e.g., "=QpOffset"). + * 2. Key-Value format (Recommended): 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_NativeBuffer_RoiMetadataSemanticLabelType}. + * 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. * From ed450abea524b51f99e90467cddf84ff2ebfed03 Mon Sep 17 00:00:00 2001 From: Helinshan Date: Tue, 26 May 2026 15:45:45 +0800 Subject: [PATCH 02/44] "Helinshan fix" Signed-off-by: Helinshan --- multimedia/av_codec/native_avcodec_base.h | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index c7c341008..2f048f3b5 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1672,12 +1672,20 @@ 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 and supports two formats for backward compatibility: + * 1. Legacy format: A single integer representing the quantization parameter offset (e.g., "=Offset"). + * 2. Key-Value format (Recommended): 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_NativeBuffer_RoiMetadataSemanticLabelType}. + * 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. From 77be3904d343879fd2445d923569a408e1d3b046 Mon Sep 17 00:00:00 2001 From: Helinshan Date: Wed, 27 May 2026 15:26:18 +0800 Subject: [PATCH 03/44] "Helinshan fix" Signed-off-by: Helinshan --- .../graphic_2d/native_buffer/libnative_buffer.ndk.json | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/graphic/graphic_2d/native_buffer/libnative_buffer.ndk.json b/graphic/graphic_2d/native_buffer/libnative_buffer.ndk.json index 1c3604260..1f7cb5104 100644 --- a/graphic/graphic_2d/native_buffer/libnative_buffer.ndk.json +++ b/graphic/graphic_2d/native_buffer/libnative_buffer.ndk.json @@ -40,5 +40,13 @@ { "first_introduced": "23", "name": "OH_NativeBuffer_MapAndGetConfig" + }, + { + "first_introduced": "26.0.0", + "name": "OH_ROI_METADATA_KEY_SEMANTIC_LABEL" + }, + { + "first_introduced": "26.0.0", + "name": "OH_ROI_METADATA_KEY_DELTA_QP" } ] \ No newline at end of file From 10b8bfcecf6ea50b0a76169f987e4d3f7cbf5d9f Mon Sep 17 00:00:00 2001 From: Helinshan Date: Fri, 29 May 2026 10:28:51 +0800 Subject: [PATCH 04/44] "Helinshan fix" Signed-off-by: Helinshan --- graphic/graphic_2d/native_buffer/buffer_common.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index 40604232f..96fa6bb4d 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -237,12 +237,12 @@ typedef struct OH_NativeBuffer_StaticMetadata { * @since 26.0.0 */ typedef enum OH_NativeBuffer_RoiMetadataSemanticLabelType { - /** + /** * Indicates an unspecified or unknown region. * @since 26.0.0 */ OH_ROI_METADATA_SEMANTIC_LABEL_TYPE_OTHER = 0, - /** + /** * Indicates that the ROI contains a human face. * @since 26.0.0 */ @@ -253,8 +253,8 @@ typedef enum OH_NativeBuffer_RoiMetadataSemanticLabelType { * @brief ROI metadata key for Semantic Label. * * Used in the Key-Value format of ROI parameters to specify the semantic label of the region. - * The string value is "slb". The configured value mapped to this key should be the string representation - * of the {@link OH_NativeBuffer_RoiMetadataSemanticLabelType} enumeration (e.g., "1" for OH_ROI_SEMANTIC_LABEL_TYPE_FACE). + * The string value is "slb". The configured value mapped to this key should be the string representation of the + * {@link OH_NativeBuffer_RoiMetadataSemanticLabelType} enumeration (e.g., "1" for OH_ROI_SEMANTIC_LABEL_TYPE_FACE). * * @since 26.0.0 */ @@ -262,7 +262,7 @@ extern const char *OH_ROI_METADATA_KEY_SEMANTIC_LABEL; /** * @brief ROI metadata key for Delta QP. - * + * * Used in the Key-Value format of ROI parameters to specify the quantization parameter offset. * The string value is "dqp". * From 5c5c9216109146f0d5c718ed4861223de321bf6f Mon Sep 17 00:00:00 2001 From: oh_hw_llm Date: Wed, 3 Jun 2026 22:06:24 +0800 Subject: [PATCH 05/44] =?UTF-8?q?=E6=94=AF=E6=8C=81=E7=94=9F=E6=88=90lite?= =?UTF-8?q?=20ndk?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: oh_hw_llm --- graphic/graphic_2d/native_drawing/BUILD.gn | 17 + .../native_drawing/lite/drawing_canvas_lite.h | 1184 +++++++++++++++++ .../lite/libnative_drawing_lite.ndk.json | 7 + ndk_targets.gni | 8 +- third_party/musl/ndk_musl_include/pthread.h | 6 + third_party/musl/ndk_script/BUILD.gn | 76 ++ third_party/musl/ndk_script/adapter/BUILD.gn | 12 + .../ndk_script/adapter/libc_lite.ndk.json | 29 + .../musl/ndk_script/copy_musl_sysroot_lite.sh | 31 + 9 files changed, 1369 insertions(+), 1 deletion(-) create mode 100644 graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h create mode 100644 graphic/graphic_2d/native_drawing/lite/libnative_drawing_lite.ndk.json create mode 100644 third_party/musl/ndk_script/adapter/libc_lite.ndk.json create mode 100644 third_party/musl/ndk_script/copy_musl_sysroot_lite.sh diff --git a/graphic/graphic_2d/native_drawing/BUILD.gn b/graphic/graphic_2d/native_drawing/BUILD.gn index 2e45e6e77..0028bd1d6 100644 --- a/graphic/graphic_2d/native_drawing/BUILD.gn +++ b/graphic/graphic_2d/native_drawing/BUILD.gn @@ -14,6 +14,13 @@ import("//build/ohos.gni") import("//build/ohos/ndk/ndk.gni") +ohos_ndk_headers("native_drawing_lite_header") { + dest_dir = "$ndk_lite_headers_out_dir/native_drawing" + sources = [ + "//interface/sdk_c/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h", + ] +} + ohos_ndk_headers("native_drawing_header") { dest_dir = "$ndk_headers_out_dir/native_drawing" sources = [ @@ -63,6 +70,16 @@ ohos_ndk_headers("native_drawing_header") { ] } +ohos_ndk_lite_library("libnative_drawing_ndk_lite") { + output_name = "native_drawing_lite" + output_extension = "so" + ndk_description_file = "./lite/libnative_drawing_lite.ndk.json" + system_capability = "SystemCapability.Graphic.Graphic2D.NativeDrawing" + system_capability_headers = [ + "native_drawing/lite/drawing_canvas_lite.h", + ] +} + ohos_ndk_library("libnative_drawing_ndk") { output_name = "native_drawing" output_extension = "so" diff --git a/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h b/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h new file mode 100644 index 000000000..f7953372f --- /dev/null +++ b/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h @@ -0,0 +1,1184 @@ +/* + * Copyright (c) 2021-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 Drawing + * @{ + * + * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. + * + * @since 8 + * @version 1.0 + */ +/** + * @file drawing_canvas.h + * + * @brief This file declares the functions related to the canvas in the drawing module. + * By default, the canvas has a black brush with anti-aliasing enabled and without any other style. This brush takes + * effect only when no brush or pen is proactively set in the canvas. + * + * @kit ArkGraphics2D + * @library libnative_drawing.so + * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing + * @since 8 + * @version 1.0 + */ + +#ifndef C_INCLUDE_DRAWING_H +#define C_INCLUDE_DRAWING_H + +#include "drawing_error_code.h" +#include "drawing_types.h" +#include "drawing_sampling_options.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** + * @brief Enumerates the constraint types of the source rectangle. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** + * The source rectangle must be completely contained in the image. + */ + STRICT_SRC_RECT_CONSTRAINT, + /** + * The source rectangle can be partly outside the image. + */ + FAST_SRC_RECT_CONSTRAINT, +} OH_Drawing_SrcRectConstraint; + +/** + * @brief Creates an **OH_Drawing_Canvas** object. + * + * @return Returns the pointer to the **OH_Drawing_Canvas** object created. + * @since 8 + * @version 1.0 + */ +OH_Drawing_Canvas* OH_Drawing_CanvasCreate(void); + +/** + * @brief Binds a pixel map to a canvas so that the content drawn on the canvas is output to the pixel map. (This + * process is called CPU rendering.) A canvas bound to a pixel map is a non-recording canvas. + * You should unbind the pixel map object by calling {@link OH_Drawing_PixelMapDissolve} after the canvas object is + * destroyed. + * + * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. + * @return Pointer to the created canvas object {@link OH_Drawing_Canvas}. If the returned object is NULL, the creation + * fails due to insufficient memory or an empty pixel map object. + * @since 20 + * @version 1.0 + */ +OH_Drawing_Canvas* OH_Drawing_CanvasCreateWithPixelMap(OH_Drawing_PixelMap* pixelMap); + +/** + * @brief Destroys an **OH_Drawing_Canvas** object and reclaims the memory occupied by the object. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasDestroy(OH_Drawing_Canvas* canvas); + +/** + * @brief Binds a bitmap to a canvas so that the content drawn on the canvas is output to the bitmap. (This process is + * called CPU rendering.) A canvas bound to a bitmap is a non-recording canvas. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param bitmap Pointer to an **OH_Drawing_Bitmap** object. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasBind(OH_Drawing_Canvas* canvas, OH_Drawing_Bitmap* bitmap); + +/** + * @brief Attaches a pen to a canvas so that the canvas can use the style and color of the pen to outline a shape. If + * the pen effect changes after this function is called, you must call the function again to use the new effect in the + * subsequent drawing. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param pen Pointer to an **OH_Drawing_Pen** object. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasAttachPen(OH_Drawing_Canvas* canvas, const OH_Drawing_Pen* pen); + +/** + * @brief Detaches the pen from a canvas so that the canvas can no longer use the style and color of the pen to outline + * a shape. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasDetachPen(OH_Drawing_Canvas* canvas); + +/** + * @brief Attaches a brush to a canvas so that the canvas can use the style and color of the brush to fill in a shape. + * If the brush effect changes after this function is called, you must call the function again to use the new effect in + * the subsequent drawing. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param brush Pointer to an **OH_Drawing_Brush** object. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasAttachBrush(OH_Drawing_Canvas* canvas, const OH_Drawing_Brush* brush); + +/** + * @brief Detaches the brush from a canvas so that the canvas can no longer use the previously set brush to fill in a + * shape. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasDetachBrush(OH_Drawing_Canvas* canvas); + +/** + * @brief Saves the current canvas status (canvas matrix) to the top of the stack. This function works with + * {@link OH_Drawing_CanvasRestore}. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasSave(OH_Drawing_Canvas* canvas); + +/** + * @brief Saves the matrix and cropping region, and allocates a bitmap for subsequent drawing. If you call + * {@link OH_Drawing_CanvasRestore}, changes made to the matrix and clipping region are discarded, + * and the bitmap is drawn. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param rect Pointer to the {@link OH_Drawing_Rect} object, which is used to limit the layer size. A null pointer + * means no limit. + * @param brush Pointer to an {@link OH_Drawing_Brush} object. The alpha value, filter effect, and blend mode of the + * brush are applied when the bitmap is drawn. If NULL is passed in, no effect is applied. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasSaveLayer(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, const OH_Drawing_Brush* brush); + +/** + * @brief Restores the canvas status (canvas matrix) saved on the top of the stack. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasRestore(OH_Drawing_Canvas* canvas); + +/** + * @brief Obtains the number of canvas statuses (canvas matrices) saved in the stack. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @return Returns a 32-bit value that describes the number of canvas statuses (canvas matrices). The initial number is + * **1**. + * @since 11 + * @version 1.0 + */ +uint32_t OH_Drawing_CanvasGetSaveCount(OH_Drawing_Canvas* canvas); + +/** + * @brief Restores to a given number of canvas statuses (canvas matrices). + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param saveCount Number of canvas statuses (canvas matrices). If the value is less than or equal to 1, the canvas is + * restored to the initial state. If the value is greater than the number of canvas statuses that have been saved, no + * operation is performed. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasRestoreToCount(OH_Drawing_Canvas* canvas, uint32_t saveCount); + +/** + * @brief Draws a line segment. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param x1 X coordinate of the start point of the line segment. + * @param y1 Y coordinate of the start point of the line segment. + * @param x2 X coordinate of the end point of the line segment. + * @param y2 Y coordinate of the end point of the line segment. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawLine(OH_Drawing_Canvas* canvas, float x1, float y1, float x2, float y2); + +/** + * @brief Draws a path. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param path Pointer to an **OH_Drawing_Path** object. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawPath(OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path); + +/** + * @brief Draws a PixelMap based on a mesh, where mesh vertices are evenly distributed across the PixelMap. (This API + * works with brushes but not pens.) + * + * @param cCanvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. + * @param meshWidth Number of columns in the mesh. The value is an integer greater than 0. + * @param meshHeight Number of rows in the mesh. The value is an integer greater than 0. + * @param vertices Pointer to the mesh vertex array. + * @param verticesSize Size of the mesh vertex array. The value must be ((meshWidth + 1) * (meshHeight + 1) + + * vertoffset) * 2. + * @param vertOffset Number of vertices to skip before drawing. The value is an integer greater than or equal to 0. + * @param colors Pointer to the mesh color array, which can be null. + * @param colorsSize Size of the mesh color array. If the array exists, the size must be (meshWidth + 1) * (meshHeight + + * 1) + colorOffset. + * @param colorOffset Number of colors to skip before drawing. The value is an integer greater than or equal to 0. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if any of the parameters, such as **cCanvas**, **pixelMap**, and **vertices* + * *, is empty or the input parameter does not meet the value rule. + * @since 23 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPixelMapMesh(OH_Drawing_Canvas* cCanvas, OH_Drawing_PixelMap* pixelMap, + uint32_t meshWidth, uint32_t meshHeight, const float* vertices, uint32_t verticesSize, uint32_t vertOffset, + const uint32_t* colors, uint32_t colorsSize, uint32_t colorOffset); + +/** + * @brief Splits a pixel map into nine sections using two horizontal and two vertical lines: four edge sections, four + * corner sections, and a central section. + * If the four corner sections are smaller than the target rectangle, they will be drawn in the target rectangle + * without scaling. Otherwise, they will be scaled to fit the target rectangle. + * Any remaining space will be filled by stretching or compressing the other five sections to cover the entire target + * rectangle. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. + * @param center Pointer to the {@link OH_Drawing_Rect} object, which indicates the central rectangle splitting the + * pixel map. It divides the image into nine sections by extending its four edges. + * @param dst Pointer to the {@link OH_Drawing_Rect} object, which indicates the target region on the canvas. + * @param mode Enumeration of filter modes. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **pixelMap**, or **dst** is NULL. + * @since 18 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPixelMapNine(OH_Drawing_Canvas* canvas, OH_Drawing_PixelMap* pixelMap, + const OH_Drawing_Rect* center, const OH_Drawing_Rect* dst, OH_Drawing_FilterMode mode); + +/** + * @brief Draws a portion of a pixel map onto a specified area of the canvas. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If one of **canvas**, **pixelMap**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. + * @param src Pointer to a rectangle on the pixel map. If NULL is passed in, it refers to the entire pixel map. + * @param dst Pointer to a rectangle on the canvas. + * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the + * default sampling options are used. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawPixelMapRect(OH_Drawing_Canvas* canvas, OH_Drawing_PixelMap* pixelMap, + const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions); + +/** + * @brief Draws a portion of a pixel map onto a specified area of the canvas. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. + * @param src Pointer to a rectangle on the pixel map. If NULL is passed in, it refers to the entire pixel map. + * @param dst Pointer to a rectangle on the canvas. + * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the + * default sampling options are used. + * @param constraint Constraint type. For details about the available options, see {@link OH_Drawing_SrcRectConstraint}. + * @return Execution result. + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **pixelMap**, or **dst** is NULL. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPixelMapRectConstraint(OH_Drawing_Canvas* canvas, + OH_Drawing_PixelMap* pixelMap, const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, + const OH_Drawing_SamplingOptions* samplingOptions, OH_Drawing_SrcRectConstraint constraint); + +/** + * @brief Draws a background filled with a brush. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param brush Pointer to an **OH_Drawing_Brush** object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawBackground(OH_Drawing_Canvas* canvas, const OH_Drawing_Brush* brush); + +/** + * @brief Draws a region. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **region** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param region Pointer to an **OH_Drawing_Region** object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawRegion(OH_Drawing_Canvas* canvas, const OH_Drawing_Region* region); + +/** + * @brief Enumerates the modes of drawing multiple points. The modes include discrete points, line segments, and open + * polygons. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** + * Draws each point separately. + */ + POINT_MODE_POINTS, + /** + * Draws every two points as a line segment. + */ + POINT_MODE_LINES, + /** + * Draws an array of points as an open polygon. + */ + POINT_MODE_POLYGON, +} OH_Drawing_PointMode; + +/** + * @brief Draws a point. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param point Pointer to the {@link OH_Drawing_Point2D} object. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **point** is NULL. + * @since 12 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPoint(OH_Drawing_Canvas* canvas, const OH_Drawing_Point2D* point); + +/** + * @brief Draws multiple points. You can draw a single point, a line segment, or an open polygon. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **point2D** is NULL, or **count** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is + * returned. If **mode** is not within the enumerated range, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param mode Mode for drawing multiple points. For details, see {@link OH_Drawing_PointMode}. + * @param count Number of vertices, that is, the number of vertices in the vertex array. + * @param point2D Pointer to an array holding the vertices. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawPoints(OH_Drawing_Canvas* canvas, OH_Drawing_PointMode mode, + uint32_t count, const OH_Drawing_Point2D* point2D); + +/** + * @brief Draws a bitmap. A bitmap, also referred to as a dot matrix image, a pixel map image, or a grid image, + * includes single points called pixels (image elements). + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param bitmap Pointer to an **OH_Drawing_Bitmap** object. + * @param left X coordinate of the upper left corner of the bitmap. + * @param top Y coordinate of the upper left corner of the bitmap. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawBitmap(OH_Drawing_Canvas* canvas, const OH_Drawing_Bitmap* bitmap, float left, float top); + +/** + * @brief Draws a portion of a bitmap onto a specified area of the canvas. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If one of **canvas**, **bitmap**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param bitmap Pointer to the {@link OH_Drawing_Bitmap} object. + * @param src Pointer to a rectangle on the bitmap. If NULL is passed in, it refers to the entire bitmap. + * @param dst Pointer to a rectangle on the canvas. + * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the + * default sampling options are used. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawBitmapRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Bitmap* bitmap, + const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions); + +/** + * @brief Draws a rectangle. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param rect Pointer to an **OH_Drawing_Rect** object. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect); + +/** + * @brief Draws a circle. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If + * either **canvas** or **point** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * If **radius** is less than or equal to 0, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param point Pointer to an **OH_Drawing_Point** object, which indicates the center of the circle. + * @param radius Radius of the circle. The value is invalid if it is less than or equal to 0. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawCircle(OH_Drawing_Canvas* canvas, const OH_Drawing_Point* point, float radius); + +/** + * @brief Fills the entire canvas with the specified color and blend mode. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param color Color, represented by a 32-bit (ARGB) variable. + * @param blendMode Blend mode. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas** is NULL. + * **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **blendMode** is not set to one of the enumerated values. + * @since 12 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawColor(OH_Drawing_Canvas* canvas, uint32_t color, + OH_Drawing_BlendMode blendMode); + +/** + * @brief Draws an oval. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If + * either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param rect Pointer to an **OH_Drawing_Rect** object. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawOval(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect); + +/** + * @brief Draws an arc. If the absolute value of the sweep angle exceeds 360 degrees, an ellipse is drawn. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param rect Pointer to an **OH_Drawing_Rect** object. + * @param startAngle Start angle. When the degree is 0, the start point is located at the right end of the oval. A + * positive number indicates that the start point is placed clockwise, and a negative number indicates that the start + * point is placed counterclockwise. + * @param sweepAngle Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value + * indicates a counterclockwise swipe. The valid range is from -360 degrees to 360 degrees. If the absolute value of + * the sweep angle exceeds 360 degrees, an ellipse is drawn. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawArc(OH_Drawing_Canvas* canvas, + const OH_Drawing_Rect* rect, float startAngle, float sweepAngle); + +/** + * @brief Draws an arc. It enables you to define the start angle, sweep angle, and whether the arc's endpoints should + * connect to its center. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param rect Pointer to the {@link OH_Drawing_Rect} object. + * @param startAngle Start angle, in degrees. The value is a floating point number. When the degree is 0, the start + * point is located at the right end of the oval. A positive number indicates that the start point is placed clockwise, + * and a negative number indicates that the start point is placed counterclockwise. + * @param sweepAngle Angle to sweep, in degrees. The value is a floating point number. A positive number indicates a + * clockwise sweep, and a negative value indicates a counterclockwise swipe. The swipe angle can exceed 360 degrees, + * and a complete ellipse is drawn. + * @param useCenter Whether the start point and end point of the arc are connected to its center. The value **true** + * means that they are connected to the center; the value **false** means the opposite. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **rect** is NULL. + * @since 18 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawArcWithCenter(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, + float startAngle, float sweepAngle, bool useCenter); + +/** + * @brief Draws a rounded rectangle. This API may return an error code. For details, call + * {@link OH_Drawing_ErrorCodeGet}. If either **canvas** or **roundRect** is NULL, + * **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param roundRect Pointer to an **OH_Drawing_RoundRect** object. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawRoundRect(OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* roundRect); + +/** + * @brief Draws two nested rounded rectangles. The outer rectangle boundary must contain the inner rectangle boundary. + * Otherwise, there is no drawing effect. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param outer Pointer to the {@link OH_Drawing_RoundRect} object, indicating the outer rounded rectangle. + * @param inner Pointer to the {@link OH_Drawing_RoundRect} object, indicating the inner rounded rectangle. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **outer**, or **inner** is NULL. + * @since 18 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawNestedRoundRect(OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* outer, + const OH_Drawing_RoundRect* inner); + +/** + * @brief Draws a single character. If the typeface of the current font does not support the character to draw, the + * system typeface is used to draw the character. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param str Pointer to the single character to draw. A string can be passed in, but only the first character in the + * string is parsed and drawn in UTF-8 encoding. + * @param font Pointer to the {@link OH_Drawing_Font} object. + * @param x X coordinate of the left point of the character baseline. + * @param y Y coordinate of the left point of the character baseline. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **canvas**, **str**, or **font** is NULL, + * or the length of **str** is **0**. + * @since 12 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawSingleCharacter(OH_Drawing_Canvas* canvas, const char* str, + const OH_Drawing_Font* font, float x, float y); + +/** + * @brief Draws a single character with font features. If the typeface of the current font does not support the + * character to draw, the system typeface is used to draw the character. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param str Pointer to the single character to draw. A string can be passed in, but only the first character in the + * string is parsed and drawn in UTF-8 encoding. + * @param font Pointer to the {@link OH_Drawing_Font} object. + * @param x X coordinate of the left point of the character baseline. + * @param y Y coordinate of the left point of the character baseline. + * @param fontFeatures Pointer to the {@link OH_Drawing_FontFeatures} object. If no font feature is set, the preset + * font feature in the TrueType fonts (TTF) file is used. + * @return Execution result. + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **canvas**, **str**, **font**, or ** + * fontFeatures** is NULL, or the length of **str** is **0**. + * @since 20 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawSingleCharacterWithFeatures(OH_Drawing_Canvas* canvas, const char* str, + const OH_Drawing_Font* font, float x, float y, OH_Drawing_FontFeatures* fontFeatures); + +/** + * @brief Draws a text blob. If the typeface used to construct **OH_Drawing_TextBlob** does not support a character, + * that character will not be drawn. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **textBlob** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param textBlob Pointer to an **OH_Drawing_TextBlob** object. + * @param x X coordinate of the left point of the text baseline. + * @param y Y coordinate of the left point of the text baseline. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawTextBlob(OH_Drawing_Canvas* canvas, const OH_Drawing_TextBlob* textBlob, float x, float y); + +/** + * @brief Draws the array of glyphs with specified font. Nothing is drawn if glyphCount is smaller than or equals to 0. + * + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param glyphIds Indicates an array of glyph IDs. + * @param glyphIdCount Indicates the size of glyphId array. + * @param glyphIdOffset Indicates the number of elements to skip before drawing in glyphIds array. + * @param positions Indicates an array of positions. + * @param positionCount Indicates the size of position array. + * @param positionOffset Indicates the number of elements to skip before drawing in positions array. + * @param glyphCount Indicates the number of glyphs to be drawn. + * @param font Indicates the font used for drawing. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if any of canvas, glyphIds, positions and font is nullptr. + * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if glyphIdOffset or positionOffset is less than 0, or if + * glyphIdCount is less than (glyphIdOffset + glyphCount) or positionCount is less than (positionOffset + glyphCount). + * @since 26.0.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawGlyphs(const OH_Drawing_Canvas* canvas, const int* glyphIds, + int glyphIdCount, int glyphIdOffset, const OH_Drawing_Point2D* positions, int positionCount, + int positionOffset, int glyphCount, const OH_Drawing_Font* font); + +/** + * @brief Enumerates the canvas clipping modes. + * + * @since 11 + * @version 1.0 + */ +typedef enum { + /** + * Clips a specified area. That is, the difference set is obtained. + */ + DIFFERENCE, + /** + * Retains a specified area. That is, the intersection is obtained. + */ + INTERSECT, +} OH_Drawing_CanvasClipOp; + +/** + * @brief Clips a rectangle. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param rect Pointer to an **OH_Drawing_Rect** object. + * @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}. + * @param doAntiAlias Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** + * means the opposite. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasClipRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, + OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias); + +/** + * @brief Clips a rounded rectangle. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **roundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param roundRect Pointer to an **OH_Drawing_RoundRect** object. + * @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}. + * @param doAntiAlias Whether to perform anti-aliasing. The value **true** means to perform anti-aliasing, and **false** + * means the opposite. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasClipRoundRect(OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* roundRect, + OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias); + +/** + * @brief Clips a path. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param path Pointer to an **OH_Drawing_Path** object. + * @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}. + * @param doAntiAlias Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** + * means the opposite. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasClipPath(OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path, + OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias); + +/** + * @brief Clips a rectangle. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param region Pointer to the {@link OH_Drawing_Region} object. + * @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **region** is NULL. + * **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **clipOp** is not set to one of the enumerated values. + * @since 12 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasClipRegion(OH_Drawing_Canvas* canvas, const OH_Drawing_Region* region, + OH_Drawing_CanvasClipOp clipOp); + +/** + * @brief Rotates a canvas by a given angle. A positive value indicates a clockwise rotation, and a negative value + * indicates a counterclockwise rotation. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param degrees Rotation angle. + * @param px X coordinate of the rotation point. + * @param py Y coordinate of the rotation point. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasRotate(OH_Drawing_Canvas* canvas, float degrees, float px, float py); + +/** + * @brief Translates a canvas by a given distance. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param dx Distance to translate on the X axis. + * @param dy Distance to translate on the Y axis. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasTranslate(OH_Drawing_Canvas* canvas, float dx, float dy); + +/** + * @brief Scales a canvas. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param sx Scale ratio on the X axis. + * @param sy Scale ratio on the Y axis. + * @since 11 + * @version 1.0 + */ +void OH_Drawing_CanvasScale(OH_Drawing_Canvas* canvas, float sx, float sy); + +/** + * @brief Skews a canvas. This function premultiplies the current canvas matrix by a skew transformation matrix and + * applies the resulting matrix to the canvas. The skew transformation matrix is as follows: + * |1 sx 0| + * |sy 1 0| + * |0 0 1| + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param sx Amount of tilt on the X axis. A positive number tilts the drawing rightwards along the positive direction + * of the Y axis, and a negative number tilts the drawing leftwards along the positive direction of the Y axis. + * @param sy Amount of tilt on the Y axis. A positive number tilts the drawing downwards along the positive direction + * of the X axis, and a negative number tilts the drawing upwards along the positive direction of the X axis. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasSkew(OH_Drawing_Canvas* canvas, float sx, float sy); + +/** + * @brief Obtains the canvas width. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @return Returns the width. + * @since 12 + * @version 1.0 + */ +int32_t OH_Drawing_CanvasGetWidth(OH_Drawing_Canvas* canvas); + +/** + * @brief Obtains the canvas height. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @return Returns the height. + * @since 12 + * @version 1.0 + */ +int32_t OH_Drawing_CanvasGetHeight(OH_Drawing_Canvas* canvas); + +/** + * @brief Obtains the bounds of the cropping region of the canvas. This function cannot be used for a canvas of the + * recording type. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param rect Pointer to the {@link OH_Drawing_Rect} object. You can call {@link OH_Drawing_RectCreate} to create a + * rectangle object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasGetLocalClipBounds(OH_Drawing_Canvas* canvas, OH_Drawing_Rect* rect); + +/** + * @brief Obtains the 3x3 matrix of a canvas. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param matrix Pointer to the {@link OH_Drawing_Matrix} object. You can call {@link OH_Drawing_MatrixCreate} to + * create a matrix object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasGetTotalMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* matrix); + +/** + * @brief Preconcats the existing matrix of the canvas with the passed-in matrix. The drawing operation triggered + * before this API is called is not affected. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param matrix Pointer to the {@link OH_Drawing_Matrix} object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasConcatMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* matrix); + +/** + * @brief Enumerates the shadow flags. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** + * There is no shadow flag. + */ + SHADOW_FLAGS_NONE, + /** + * The occluding object is transparent. + */ + SHADOW_FLAGS_TRANSPARENT_OCCLUDER, + /** + * No analysis on the shadows is required. + */ + SHADOW_FLAGS_GEOMETRIC_ONLY, + /** + * All the preceding shadow flags are used. + */ + SHADOW_FLAGS_ALL, +} OH_Drawing_CanvasShadowFlags; + +/** + * @brief Draws a spot shadow and uses a given path to outline the ambient shadow. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * If **flag** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param path Pointer to the {@link OH_Drawing_Path} object, which is used to generate shadows. + * @param planeParams Z-axis offset of an occluder relative to the canvas, based on its x and y coordinates. + * @param devLightPos Position of the light relative to the canvas. + * @param lightRadius Radius of the light source. The value must be greater than or equal to 0. + * @param ambientColor Ambient shadow color, which is represented by a 32-bit (ARGB) variable. + * @param spotColor Point shadow color, which is represented by a 32-bit (ARGB) variable. + * @param flag Enumeration of shadow flags. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawShadow(OH_Drawing_Canvas* canvas, OH_Drawing_Path* path, OH_Drawing_Point3D planeParams, + OH_Drawing_Point3D devLightPos, float lightRadius, uint32_t ambientColor, uint32_t spotColor, + OH_Drawing_CanvasShadowFlags flag); + +/** + * @brief Clears a canvas by using a given color. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param color Color, which is a 32-bit (ARGB) variable. + * @since 8 + * @version 1.0 + */ +void OH_Drawing_CanvasClear(OH_Drawing_Canvas* canvas, uint32_t color); + +/** + * @brief Sets the matrix status for a canvas. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param matrix Pointer to the {@link OH_Drawing_Matrix} object. You can call {@link OH_Drawing_MatrixCreate} to + * create a matrix object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasSetMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* matrix); + +/** + * @brief Resets the matrix of this canvas to an identity matrix. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasResetMatrix(OH_Drawing_Canvas* canvas); + +/** + * @brief Reset the clip status. + * + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if canvas is nullptr. + * @since 26.0.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasResetClip(OH_Drawing_Canvas* canvas); + +/** + * @brief Draws a portion of an image onto a specified area of the canvas. The area selected by the source rectangle is + * scaled and translated to the destination rectangle. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If one of **canvas**, **image**, **src**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param image Pointer to the {@link OH_Drawing_Image} object. + * @param src Pointer to the {@link OH_Drawing_Rect} object. + * @param dst Pointer to the {@link OH_Drawing_Rect} object. + * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the + * default sampling options are used. + * @param srcRectConstraint Constraint type. For details about the available options, see + * {@link OH_Drawing_SrcRectConstraint}. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawImageRectWithSrc(OH_Drawing_Canvas* canvas, const OH_Drawing_Image* image, + const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions, + OH_Drawing_SrcRectConstraint srcRectConstraint); + +/** + * @brief Draws an image onto a specified area of the canvas. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If one of **canvas**, **image**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param image Pointer to the {@link OH_Drawing_Image} object. + * @param rect Pointer to the {@link OH_Drawing_Rect} object. + * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the + * default sampling options are used. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawImageRect(OH_Drawing_Canvas* canvas, OH_Drawing_Image* image, + OH_Drawing_Rect* rect, OH_Drawing_SamplingOptions* samplingOptions); + +/** + * @brief Enumerates the modes of interpreting the geometry of a given vertex. + * + * @since 12 + * @version 1.0 + */ +typedef enum { + /** + * Draws a triangle list. Specifically, a list of isolated triangles are drawn using every three vertices. If the + * number of vertices is not a multiple of 3, the extra vertices will be ignored. + */ + VERTEX_MODE_TRIANGLES, + /** + * Draws a triangle strip. Specifically, the first triangle is drawn between the first 3 vertices, and all + * subsequent triangles use the previous 2 vertices plus the next additional vertex. + */ + VERTEX_MODE_TRIANGLES_STRIP, + /** + * Draws a triangle fan. A triangle fan is similar to a triangle strip, except that all the triangles share one + * vertex (the first vertex). + */ + VERTEX_MODE_TRIANGLE_FAN, +} OH_Drawing_VertexMode; + +/** + * @brief Draws a triangular grid described by a vertex array. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **positions** is NULL, **vertexCount** is less than 3, or **indexCount** is less than 3 but + * not 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * If either **vertexMmode** or **mode** is not set to one of the enumerated values, ** + * OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. + * + * @param canvas Pointer to an **OH_Drawing_Canvas** object. + * @param vertexMmode Mode for drawing vertices. For details about the available options, see + * {@link OH_Drawing_VertexMode}. + * @param vertexCount Number of elements in the vertex array. The value must be greater than or equal to 3. + * @param positions Pointer to the array that holds the position of every vertex. The array cannot be null and its + * length must be equal to the value of **vertexCount**. + * @param texs Pointer to the array that holds the texture space coordinate corresponding to each vertex. The array can + * be null. If the array is not null, its length must be equal to the value of **vertexCount**. + * @param colors Pointer to the array that holds the color corresponding to each vertex. It is used for interpolation + * in a triangle. The array can be null. If the array is not null, its length must be equal to the value of ** + * vertexCount**. + * @param indexCount Number of indices. The value can be 0 or a value greater than or equal to 3. + * @param indices Pointer to the array that holds the index of each vertex. The array can be null. If the array is not + * null, its length must be equal to the value of **indexCount**. + * @param mode Enumeration of blend modes. For details about the available options, see {@link OH_Drawing_BlendMode}. + * @since 12 + * @version 1.0 + */ +void OH_Drawing_CanvasDrawVertices(OH_Drawing_Canvas* canvas, OH_Drawing_VertexMode vertexMmode, + int32_t vertexCount, const OH_Drawing_Point2D* positions, const OH_Drawing_Point2D* texs, + const uint32_t* colors, int32_t indexCount, const uint16_t* indices, OH_Drawing_BlendMode mode); + +/** + * @brief Copies pixel data from a canvas to a specified address. This function cannot be used for a canvas of the + * recording type. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If one of **canvas**, **imageInfo**, or **dstPixels** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param imageInfo Pointer to the {@link OH_Drawing_Image_Info} object. + * @param dstPixels Pointer to the start address for storing the pixel data. + * @param dstRowBytes Number of bytes in each row of pixels. The value is invalid if it is less than or equal to 0. + * @param srcX X offset of the pixels on the canvas, in px. + * @param srcY Y offset of the pixels on the canvas, in px. + * @return Returns **true** if the pixel data is copied to the start address of the storage; returns **false** + * otherwise. + * @since 12 + * @version 1.0 + */ +bool OH_Drawing_CanvasReadPixels(OH_Drawing_Canvas* canvas, OH_Drawing_Image_Info* imageInfo, + void* dstPixels, uint32_t dstRowBytes, int32_t srcX, int32_t srcY); + +/** + * @brief Copies pixel data from a canvas to an image. This function cannot be used for a canvas of the recording type. + * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. + * If either **canvas** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param bitmap Pointer to the {@link OH_Drawing_Bitmap} object. + * @param srcX X offset of the pixels on the canvas, in px. + * @param srcY Y offset of the pixels on the canvas, in px. + * @return Returns **true** if the pixel data is copied to the image; returns **false** otherwise. + * @since 12 + * @version 1.0 + */ +bool OH_Drawing_CanvasReadPixelsToBitmap(OH_Drawing_Canvas* canvas, + OH_Drawing_Bitmap* bitmap, int32_t srcX, int32_t srcY); + +/** + * @brief Checks whether the region that can be drawn is empty after clipping. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param isClipEmpty Pointer to the variable that specifies whether the region is empty. The value **true** means that + * the region is empty, and **false** means the opposite. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **isClipEmpty** is NULL. + * @since 12 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasIsClipEmpty(OH_Drawing_Canvas* canvas, bool* isClipEmpty); + +/** + * @brief Obtains the image information of a canvas. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param imageInfo Pointer to the {@link OH_Drawing_Image_Info} object. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **imageInfo** is NULL. + * @since 12 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasGetImageInfo(OH_Drawing_Canvas* canvas, OH_Drawing_Image_Info* imageInfo); + +/** + * @brief Draws an **OH_Drawing_RecordCmd** object. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. Only the canvas of the recording type is supported. + * @param recordCmd Pointer to the {@link OH_Drawing_RecordCmd} object. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **recordCmd** is NULL. + * @since 13 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmd(OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd); + +/** + * @brief Draws an **OH_Drawing_RecordCmd** object. This API supports nesting. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. Only the canvas of the recording type is supported. + * @param recordCmd Pointer to the {@link OH_Drawing_RecordCmd} object. + * @return Operation code. + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **recordCmd** is NULL. + * @since 19 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmdNesting(OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd); + +/** + * @brief Checks whether the path is not intersecting with the canvas area. The canvas area includes its boundaries. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param path Pointer to the {@link OH_Drawing_Path} object. + * @param quickReject Pointer to the check result. The value **true** means that the path is not intersecting with the + * canvas area, and **false** means the opposite. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **path**, or **quickReject** is NULL. + * @since 18 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasQuickRejectPath(OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path, + bool* quickReject); + +/** + * @brief Checks whether the rectangle is not intersecting with the canvas area. The canvas area includes its + * boundaries. + * + * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. + * @param rect Pointer to the {@link OH_Drawing_Rect} object. + * @param quickReject Pointer to the check result. The value **true** means that the rectangle is not intersecting with + * the canvas area, and **false** means the opposite. + * @return Returns one of the following result codes: + * **OH_DRAWING_SUCCESS** if the operation is successful. + * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **rect**, or **quickReject** is NULL. + * @since 18 + * @version 1.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasQuickRejectRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, + bool* quickReject); + +/** + * @brief Checks if the current layer that drawn into the device is opaque. + * + * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. + * @param isOpaque Indicates if the canvas is opaque. + * @return Returns the error code. + * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. + * Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if canvas or isOpaque is nullptr. + * @since 26.0.0 + */ +OH_Drawing_ErrorCode OH_Drawing_CanvasIsOpaque(const OH_Drawing_Canvas* canvas, bool* isOpaque); + +#ifdef __cplusplus +} +#endif +/** @} */ +#endif \ No newline at end of file diff --git a/graphic/graphic_2d/native_drawing/lite/libnative_drawing_lite.ndk.json b/graphic/graphic_2d/native_drawing/lite/libnative_drawing_lite.ndk.json new file mode 100644 index 000000000..9ee38c9bf --- /dev/null +++ b/graphic/graphic_2d/native_drawing/lite/libnative_drawing_lite.ndk.json @@ -0,0 +1,7 @@ +[ + { "name": "OH_Drawing_BitmapCreate" }, + { + "first_introduced": "23", + "name": "OH_Drawing_IsFontSupportedFromBuffer" + } +] \ No newline at end of file diff --git a/ndk_targets.gni b/ndk_targets.gni index 61f38635f..81a4cf595 100644 --- a/ndk_targets.gni +++ b/ndk_targets.gni @@ -106,6 +106,8 @@ _ndk_library_targets = [ "//interface/sdk_c/graphic/graphic_2d/native_color_space_manager:native_color_space_manager_header", "//interface/sdk_c/graphic/graphic_2d/native_drawing:libnative_drawing_ndk", "//interface/sdk_c/graphic/graphic_2d/native_drawing:native_drawing_header", + "//interface/sdk_c/graphic/graphic_2d/native_drawing:native_drawing_lite_header", + "//interface/sdk_c/graphic/graphic_2d/native_drawing:libnative_drawing_ndk_lite", "//interface/sdk_c/graphic/graphic_2d/native_effect:libnative_effect_ndk", "//interface/sdk_c/graphic/graphic_2d/native_effect:native_effect_header", "//interface/sdk_c/IPCKit:libipc_capi", @@ -296,6 +298,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", @@ -304,6 +307,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 = [] @@ -341,7 +347,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 += diff --git a/third_party/musl/ndk_musl_include/pthread.h b/third_party/musl/ndk_musl_include/pthread.h index 456723755..8b2d9d41f 100644 --- a/third_party/musl/ndk_musl_include/pthread.h +++ b/third_party/musl/ndk_musl_include/pthread.h @@ -66,9 +66,15 @@ extern "C" { #define PTHREAD_PROCESS_SHARED 1 +#ifndef PTHREAD_MUTEX_INITIALIZER #define PTHREAD_MUTEX_INITIALIZER {{{0}}} +#endif +#ifndef PTHREAD_RWLOCK_INITIALIZER #define PTHREAD_RWLOCK_INITIALIZER {{{0}}} +#endif +#ifndef PTHREAD_COND_INITIALIZER #define PTHREAD_COND_INITIALIZER {{{0}}} +#endif #define PTHREAD_ONCE_INIT 0 diff --git a/third_party/musl/ndk_script/BUILD.gn b/third_party/musl/ndk_script/BUILD.gn index 2b30bf8db..2b42f43ec 100644 --- a/third_party/musl/ndk_script/BUILD.gn +++ b/third_party/musl/ndk_script/BUILD.gn @@ -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,54 @@ 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", + "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", + "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" diff --git a/third_party/musl/ndk_script/adapter/BUILD.gn b/third_party/musl/ndk_script/adapter/BUILD.gn index 34b5dc5f1..efb0ab71c 100644 --- a/third_party/musl/ndk_script/adapter/BUILD.gn +++ b/third_party/musl/ndk_script/adapter/BUILD.gn @@ -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", + ] +} \ No newline at end of file diff --git a/third_party/musl/ndk_script/adapter/libc_lite.ndk.json b/third_party/musl/ndk_script/adapter/libc_lite.ndk.json new file mode 100644 index 000000000..c1028407b --- /dev/null +++ b/third_party/musl/ndk_script/adapter/libc_lite.ndk.json @@ -0,0 +1,29 @@ +[ + { "name": "cargf" }, + { "name": "cargl" }, + { "name": "casin" }, + { "name": "casinf" }, + { "name": "casinh" }, + { "name": "casinhf" }, + { "name": "casinhl" }, + { "name": "casinl" }, + { "name": "catan" }, + { "name": "catanf" }, + { "name": "catanh" }, + { "name": "catanhf" }, + { "name": "catanhl" }, + { "name": "catanl" }, + { "name": "catclose" }, + { "name": "catgets" }, + { "name": "catopen" }, + { "name": "cbrt" }, + { "name": "cbrtf" }, + { "name": "cbrtl" }, + { "name": "ccos" }, + { "name": "ccosf" }, + { "name": "ccosh" }, + { "name": "ccoshf" }, + { "name": "ccoshl" }, + { "name": "ccosl" }, + { "name": "ceil" } +] diff --git a/third_party/musl/ndk_script/copy_musl_sysroot_lite.sh b/third_party/musl/ndk_script/copy_musl_sysroot_lite.sh new file mode 100644 index 000000000..5543e7953 --- /dev/null +++ b/third_party/musl/ndk_script/copy_musl_sysroot_lite.sh @@ -0,0 +1,31 @@ +#!/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 + +cp -rp ${SOURCE_DIR}/* ${OUT_DIR} \ No newline at end of file From 2ee162d9d3db68173b7b253d20790986585d05e9 Mon Sep 17 00:00:00 2001 From: oh_hw_llm Date: Wed, 3 Jun 2026 22:31:38 +0800 Subject: [PATCH 06/44] =?UTF-8?q?lite=20ndk=E6=89=93=E6=A1=A9=E8=B0=83?= =?UTF-8?q?=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: oh_hw_llm --- .../native_drawing/lite/drawing_canvas_lite.h | 1134 ----------------- 1 file changed, 1134 deletions(-) diff --git a/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h b/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h index f7953372f..3dd37ad23 100644 --- a/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h +++ b/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h @@ -39,1144 +39,10 @@ #ifndef C_INCLUDE_DRAWING_H #define C_INCLUDE_DRAWING_H -#include "drawing_error_code.h" -#include "drawing_types.h" -#include "drawing_sampling_options.h" - #ifdef __cplusplus extern "C" { #endif -/** - * @brief Enumerates the constraint types of the source rectangle. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** - * The source rectangle must be completely contained in the image. - */ - STRICT_SRC_RECT_CONSTRAINT, - /** - * The source rectangle can be partly outside the image. - */ - FAST_SRC_RECT_CONSTRAINT, -} OH_Drawing_SrcRectConstraint; - -/** - * @brief Creates an **OH_Drawing_Canvas** object. - * - * @return Returns the pointer to the **OH_Drawing_Canvas** object created. - * @since 8 - * @version 1.0 - */ -OH_Drawing_Canvas* OH_Drawing_CanvasCreate(void); - -/** - * @brief Binds a pixel map to a canvas so that the content drawn on the canvas is output to the pixel map. (This - * process is called CPU rendering.) A canvas bound to a pixel map is a non-recording canvas. - * You should unbind the pixel map object by calling {@link OH_Drawing_PixelMapDissolve} after the canvas object is - * destroyed. - * - * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. - * @return Pointer to the created canvas object {@link OH_Drawing_Canvas}. If the returned object is NULL, the creation - * fails due to insufficient memory or an empty pixel map object. - * @since 20 - * @version 1.0 - */ -OH_Drawing_Canvas* OH_Drawing_CanvasCreateWithPixelMap(OH_Drawing_PixelMap* pixelMap); - -/** - * @brief Destroys an **OH_Drawing_Canvas** object and reclaims the memory occupied by the object. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasDestroy(OH_Drawing_Canvas* canvas); - -/** - * @brief Binds a bitmap to a canvas so that the content drawn on the canvas is output to the bitmap. (This process is - * called CPU rendering.) A canvas bound to a bitmap is a non-recording canvas. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param bitmap Pointer to an **OH_Drawing_Bitmap** object. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasBind(OH_Drawing_Canvas* canvas, OH_Drawing_Bitmap* bitmap); - -/** - * @brief Attaches a pen to a canvas so that the canvas can use the style and color of the pen to outline a shape. If - * the pen effect changes after this function is called, you must call the function again to use the new effect in the - * subsequent drawing. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **pen** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param pen Pointer to an **OH_Drawing_Pen** object. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasAttachPen(OH_Drawing_Canvas* canvas, const OH_Drawing_Pen* pen); - -/** - * @brief Detaches the pen from a canvas so that the canvas can no longer use the style and color of the pen to outline - * a shape. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasDetachPen(OH_Drawing_Canvas* canvas); - -/** - * @brief Attaches a brush to a canvas so that the canvas can use the style and color of the brush to fill in a shape. - * If the brush effect changes after this function is called, you must call the function again to use the new effect in - * the subsequent drawing. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param brush Pointer to an **OH_Drawing_Brush** object. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasAttachBrush(OH_Drawing_Canvas* canvas, const OH_Drawing_Brush* brush); - -/** - * @brief Detaches the brush from a canvas so that the canvas can no longer use the previously set brush to fill in a - * shape. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasDetachBrush(OH_Drawing_Canvas* canvas); - -/** - * @brief Saves the current canvas status (canvas matrix) to the top of the stack. This function works with - * {@link OH_Drawing_CanvasRestore}. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasSave(OH_Drawing_Canvas* canvas); - -/** - * @brief Saves the matrix and cropping region, and allocates a bitmap for subsequent drawing. If you call - * {@link OH_Drawing_CanvasRestore}, changes made to the matrix and clipping region are discarded, - * and the bitmap is drawn. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param rect Pointer to the {@link OH_Drawing_Rect} object, which is used to limit the layer size. A null pointer - * means no limit. - * @param brush Pointer to an {@link OH_Drawing_Brush} object. The alpha value, filter effect, and blend mode of the - * brush are applied when the bitmap is drawn. If NULL is passed in, no effect is applied. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasSaveLayer(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, const OH_Drawing_Brush* brush); - -/** - * @brief Restores the canvas status (canvas matrix) saved on the top of the stack. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasRestore(OH_Drawing_Canvas* canvas); - -/** - * @brief Obtains the number of canvas statuses (canvas matrices) saved in the stack. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @return Returns a 32-bit value that describes the number of canvas statuses (canvas matrices). The initial number is - * **1**. - * @since 11 - * @version 1.0 - */ -uint32_t OH_Drawing_CanvasGetSaveCount(OH_Drawing_Canvas* canvas); - -/** - * @brief Restores to a given number of canvas statuses (canvas matrices). - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param saveCount Number of canvas statuses (canvas matrices). If the value is less than or equal to 1, the canvas is - * restored to the initial state. If the value is greater than the number of canvas statuses that have been saved, no - * operation is performed. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasRestoreToCount(OH_Drawing_Canvas* canvas, uint32_t saveCount); - -/** - * @brief Draws a line segment. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param x1 X coordinate of the start point of the line segment. - * @param y1 Y coordinate of the start point of the line segment. - * @param x2 X coordinate of the end point of the line segment. - * @param y2 Y coordinate of the end point of the line segment. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawLine(OH_Drawing_Canvas* canvas, float x1, float y1, float x2, float y2); - -/** - * @brief Draws a path. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param path Pointer to an **OH_Drawing_Path** object. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawPath(OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path); - -/** - * @brief Draws a PixelMap based on a mesh, where mesh vertices are evenly distributed across the PixelMap. (This API - * works with brushes but not pens.) - * - * @param cCanvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. - * @param meshWidth Number of columns in the mesh. The value is an integer greater than 0. - * @param meshHeight Number of rows in the mesh. The value is an integer greater than 0. - * @param vertices Pointer to the mesh vertex array. - * @param verticesSize Size of the mesh vertex array. The value must be ((meshWidth + 1) * (meshHeight + 1) + - * vertoffset) * 2. - * @param vertOffset Number of vertices to skip before drawing. The value is an integer greater than or equal to 0. - * @param colors Pointer to the mesh color array, which can be null. - * @param colorsSize Size of the mesh color array. If the array exists, the size must be (meshWidth + 1) * (meshHeight + - * 1) + colorOffset. - * @param colorOffset Number of colors to skip before drawing. The value is an integer greater than or equal to 0. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INCORRECT_PARAMETER** if any of the parameters, such as **cCanvas**, **pixelMap**, and **vertices* - * *, is empty or the input parameter does not meet the value rule. - * @since 23 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPixelMapMesh(OH_Drawing_Canvas* cCanvas, OH_Drawing_PixelMap* pixelMap, - uint32_t meshWidth, uint32_t meshHeight, const float* vertices, uint32_t verticesSize, uint32_t vertOffset, - const uint32_t* colors, uint32_t colorsSize, uint32_t colorOffset); - -/** - * @brief Splits a pixel map into nine sections using two horizontal and two vertical lines: four edge sections, four - * corner sections, and a central section. - * If the four corner sections are smaller than the target rectangle, they will be drawn in the target rectangle - * without scaling. Otherwise, they will be scaled to fit the target rectangle. - * Any remaining space will be filled by stretching or compressing the other five sections to cover the entire target - * rectangle. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. - * @param center Pointer to the {@link OH_Drawing_Rect} object, which indicates the central rectangle splitting the - * pixel map. It divides the image into nine sections by extending its four edges. - * @param dst Pointer to the {@link OH_Drawing_Rect} object, which indicates the target region on the canvas. - * @param mode Enumeration of filter modes. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **pixelMap**, or **dst** is NULL. - * @since 18 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPixelMapNine(OH_Drawing_Canvas* canvas, OH_Drawing_PixelMap* pixelMap, - const OH_Drawing_Rect* center, const OH_Drawing_Rect* dst, OH_Drawing_FilterMode mode); - -/** - * @brief Draws a portion of a pixel map onto a specified area of the canvas. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If one of **canvas**, **pixelMap**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. - * @param src Pointer to a rectangle on the pixel map. If NULL is passed in, it refers to the entire pixel map. - * @param dst Pointer to a rectangle on the canvas. - * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the - * default sampling options are used. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawPixelMapRect(OH_Drawing_Canvas* canvas, OH_Drawing_PixelMap* pixelMap, - const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions); - -/** - * @brief Draws a portion of a pixel map onto a specified area of the canvas. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param pixelMap Pointer to the {@link OH_Drawing_PixelMap} object. - * @param src Pointer to a rectangle on the pixel map. If NULL is passed in, it refers to the entire pixel map. - * @param dst Pointer to a rectangle on the canvas. - * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the - * default sampling options are used. - * @param constraint Constraint type. For details about the available options, see {@link OH_Drawing_SrcRectConstraint}. - * @return Execution result. - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **pixelMap**, or **dst** is NULL. - * @since 20 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPixelMapRectConstraint(OH_Drawing_Canvas* canvas, - OH_Drawing_PixelMap* pixelMap, const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, - const OH_Drawing_SamplingOptions* samplingOptions, OH_Drawing_SrcRectConstraint constraint); - -/** - * @brief Draws a background filled with a brush. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **brush** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param brush Pointer to an **OH_Drawing_Brush** object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawBackground(OH_Drawing_Canvas* canvas, const OH_Drawing_Brush* brush); - -/** - * @brief Draws a region. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **region** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param region Pointer to an **OH_Drawing_Region** object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawRegion(OH_Drawing_Canvas* canvas, const OH_Drawing_Region* region); - -/** - * @brief Enumerates the modes of drawing multiple points. The modes include discrete points, line segments, and open - * polygons. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** - * Draws each point separately. - */ - POINT_MODE_POINTS, - /** - * Draws every two points as a line segment. - */ - POINT_MODE_LINES, - /** - * Draws an array of points as an open polygon. - */ - POINT_MODE_POLYGON, -} OH_Drawing_PointMode; - -/** - * @brief Draws a point. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param point Pointer to the {@link OH_Drawing_Point2D} object. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **point** is NULL. - * @since 12 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawPoint(OH_Drawing_Canvas* canvas, const OH_Drawing_Point2D* point); - -/** - * @brief Draws multiple points. You can draw a single point, a line segment, or an open polygon. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **point2D** is NULL, or **count** is **0**, **OH_DRAWING_ERROR_INVALID_PARAMETER** is - * returned. If **mode** is not within the enumerated range, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param mode Mode for drawing multiple points. For details, see {@link OH_Drawing_PointMode}. - * @param count Number of vertices, that is, the number of vertices in the vertex array. - * @param point2D Pointer to an array holding the vertices. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawPoints(OH_Drawing_Canvas* canvas, OH_Drawing_PointMode mode, - uint32_t count, const OH_Drawing_Point2D* point2D); - -/** - * @brief Draws a bitmap. A bitmap, also referred to as a dot matrix image, a pixel map image, or a grid image, - * includes single points called pixels (image elements). - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param bitmap Pointer to an **OH_Drawing_Bitmap** object. - * @param left X coordinate of the upper left corner of the bitmap. - * @param top Y coordinate of the upper left corner of the bitmap. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawBitmap(OH_Drawing_Canvas* canvas, const OH_Drawing_Bitmap* bitmap, float left, float top); - -/** - * @brief Draws a portion of a bitmap onto a specified area of the canvas. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If one of **canvas**, **bitmap**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param bitmap Pointer to the {@link OH_Drawing_Bitmap} object. - * @param src Pointer to a rectangle on the bitmap. If NULL is passed in, it refers to the entire bitmap. - * @param dst Pointer to a rectangle on the canvas. - * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the - * default sampling options are used. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawBitmapRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Bitmap* bitmap, - const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions); - -/** - * @brief Draws a rectangle. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **OH_Drawing_Rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param rect Pointer to an **OH_Drawing_Rect** object. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect); - -/** - * @brief Draws a circle. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If - * either **canvas** or **point** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * If **radius** is less than or equal to 0, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param point Pointer to an **OH_Drawing_Point** object, which indicates the center of the circle. - * @param radius Radius of the circle. The value is invalid if it is less than or equal to 0. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawCircle(OH_Drawing_Canvas* canvas, const OH_Drawing_Point* point, float radius); - -/** - * @brief Fills the entire canvas with the specified color and blend mode. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param color Color, represented by a 32-bit (ARGB) variable. - * @param blendMode Blend mode. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas** is NULL. - * **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **blendMode** is not set to one of the enumerated values. - * @since 12 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawColor(OH_Drawing_Canvas* canvas, uint32_t color, - OH_Drawing_BlendMode blendMode); - -/** - * @brief Draws an oval. This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. If - * either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param rect Pointer to an **OH_Drawing_Rect** object. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawOval(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect); - -/** - * @brief Draws an arc. If the absolute value of the sweep angle exceeds 360 degrees, an ellipse is drawn. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param rect Pointer to an **OH_Drawing_Rect** object. - * @param startAngle Start angle. When the degree is 0, the start point is located at the right end of the oval. A - * positive number indicates that the start point is placed clockwise, and a negative number indicates that the start - * point is placed counterclockwise. - * @param sweepAngle Angle to sweep, in degrees. A positive number indicates a clockwise sweep, and a negative value - * indicates a counterclockwise swipe. The valid range is from -360 degrees to 360 degrees. If the absolute value of - * the sweep angle exceeds 360 degrees, an ellipse is drawn. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawArc(OH_Drawing_Canvas* canvas, - const OH_Drawing_Rect* rect, float startAngle, float sweepAngle); - -/** - * @brief Draws an arc. It enables you to define the start angle, sweep angle, and whether the arc's endpoints should - * connect to its center. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param rect Pointer to the {@link OH_Drawing_Rect} object. - * @param startAngle Start angle, in degrees. The value is a floating point number. When the degree is 0, the start - * point is located at the right end of the oval. A positive number indicates that the start point is placed clockwise, - * and a negative number indicates that the start point is placed counterclockwise. - * @param sweepAngle Angle to sweep, in degrees. The value is a floating point number. A positive number indicates a - * clockwise sweep, and a negative value indicates a counterclockwise swipe. The swipe angle can exceed 360 degrees, - * and a complete ellipse is drawn. - * @param useCenter Whether the start point and end point of the arc are connected to its center. The value **true** - * means that they are connected to the center; the value **false** means the opposite. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **rect** is NULL. - * @since 18 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawArcWithCenter(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, - float startAngle, float sweepAngle, bool useCenter); - -/** - * @brief Draws a rounded rectangle. This API may return an error code. For details, call - * {@link OH_Drawing_ErrorCodeGet}. If either **canvas** or **roundRect** is NULL, - * **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param roundRect Pointer to an **OH_Drawing_RoundRect** object. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawRoundRect(OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* roundRect); - -/** - * @brief Draws two nested rounded rectangles. The outer rectangle boundary must contain the inner rectangle boundary. - * Otherwise, there is no drawing effect. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param outer Pointer to the {@link OH_Drawing_RoundRect} object, indicating the outer rounded rectangle. - * @param inner Pointer to the {@link OH_Drawing_RoundRect} object, indicating the inner rounded rectangle. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **outer**, or **inner** is NULL. - * @since 18 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawNestedRoundRect(OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* outer, - const OH_Drawing_RoundRect* inner); - -/** - * @brief Draws a single character. If the typeface of the current font does not support the character to draw, the - * system typeface is used to draw the character. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param str Pointer to the single character to draw. A string can be passed in, but only the first character in the - * string is parsed and drawn in UTF-8 encoding. - * @param font Pointer to the {@link OH_Drawing_Font} object. - * @param x X coordinate of the left point of the character baseline. - * @param y Y coordinate of the left point of the character baseline. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **canvas**, **str**, or **font** is NULL, - * or the length of **str** is **0**. - * @since 12 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawSingleCharacter(OH_Drawing_Canvas* canvas, const char* str, - const OH_Drawing_Font* font, float x, float y); - -/** - * @brief Draws a single character with font features. If the typeface of the current font does not support the - * character to draw, the system typeface is used to draw the character. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param str Pointer to the single character to draw. A string can be passed in, but only the first character in the - * string is parsed and drawn in UTF-8 encoding. - * @param font Pointer to the {@link OH_Drawing_Font} object. - * @param x X coordinate of the left point of the character baseline. - * @param y Y coordinate of the left point of the character baseline. - * @param fontFeatures Pointer to the {@link OH_Drawing_FontFeatures} object. If no font feature is set, the preset - * font feature in the TrueType fonts (TTF) file is used. - * @return Execution result. - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if at least one of the parameters **canvas**, **str**, **font**, or ** - * fontFeatures** is NULL, or the length of **str** is **0**. - * @since 20 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawSingleCharacterWithFeatures(OH_Drawing_Canvas* canvas, const char* str, - const OH_Drawing_Font* font, float x, float y, OH_Drawing_FontFeatures* fontFeatures); - -/** - * @brief Draws a text blob. If the typeface used to construct **OH_Drawing_TextBlob** does not support a character, - * that character will not be drawn. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **textBlob** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param textBlob Pointer to an **OH_Drawing_TextBlob** object. - * @param x X coordinate of the left point of the text baseline. - * @param y Y coordinate of the left point of the text baseline. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawTextBlob(OH_Drawing_Canvas* canvas, const OH_Drawing_TextBlob* textBlob, float x, float y); - -/** - * @brief Draws the array of glyphs with specified font. Nothing is drawn if glyphCount is smaller than or equals to 0. - * - * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param glyphIds Indicates an array of glyph IDs. - * @param glyphIdCount Indicates the size of glyphId array. - * @param glyphIdOffset Indicates the number of elements to skip before drawing in glyphIds array. - * @param positions Indicates an array of positions. - * @param positionCount Indicates the size of position array. - * @param positionOffset Indicates the number of elements to skip before drawing in positions array. - * @param glyphCount Indicates the number of glyphs to be drawn. - * @param font Indicates the font used for drawing. - * @return Returns the error code. - * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. - * Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if any of canvas, glyphIds, positions and font is nullptr. - * Returns {@link OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE} if glyphIdOffset or positionOffset is less than 0, or if - * glyphIdCount is less than (glyphIdOffset + glyphCount) or positionCount is less than (positionOffset + glyphCount). - * @since 26.0.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawGlyphs(const OH_Drawing_Canvas* canvas, const int* glyphIds, - int glyphIdCount, int glyphIdOffset, const OH_Drawing_Point2D* positions, int positionCount, - int positionOffset, int glyphCount, const OH_Drawing_Font* font); - -/** - * @brief Enumerates the canvas clipping modes. - * - * @since 11 - * @version 1.0 - */ -typedef enum { - /** - * Clips a specified area. That is, the difference set is obtained. - */ - DIFFERENCE, - /** - * Retains a specified area. That is, the intersection is obtained. - */ - INTERSECT, -} OH_Drawing_CanvasClipOp; - -/** - * @brief Clips a rectangle. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param rect Pointer to an **OH_Drawing_Rect** object. - * @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}. - * @param doAntiAlias Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** - * means the opposite. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasClipRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, - OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias); - -/** - * @brief Clips a rounded rectangle. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **roundRect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param roundRect Pointer to an **OH_Drawing_RoundRect** object. - * @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}. - * @param doAntiAlias Whether to perform anti-aliasing. The value **true** means to perform anti-aliasing, and **false** - * means the opposite. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasClipRoundRect(OH_Drawing_Canvas* canvas, const OH_Drawing_RoundRect* roundRect, - OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias); - -/** - * @brief Clips a path. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * If **clipOp** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param path Pointer to an **OH_Drawing_Path** object. - * @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}. - * @param doAntiAlias Whether to enable anti-aliasing. The value **true** means to enable anti-aliasing, and **false** - * means the opposite. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasClipPath(OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path, - OH_Drawing_CanvasClipOp clipOp, bool doAntiAlias); - -/** - * @brief Clips a rectangle. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param region Pointer to the {@link OH_Drawing_Region} object. - * @param clipOp Clip mode. For details about the available options, see {@link OH_Drawing_CanvasClipOp}. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **region** is NULL. - * **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** if **clipOp** is not set to one of the enumerated values. - * @since 12 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasClipRegion(OH_Drawing_Canvas* canvas, const OH_Drawing_Region* region, - OH_Drawing_CanvasClipOp clipOp); - -/** - * @brief Rotates a canvas by a given angle. A positive value indicates a clockwise rotation, and a negative value - * indicates a counterclockwise rotation. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param degrees Rotation angle. - * @param px X coordinate of the rotation point. - * @param py Y coordinate of the rotation point. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasRotate(OH_Drawing_Canvas* canvas, float degrees, float px, float py); - -/** - * @brief Translates a canvas by a given distance. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param dx Distance to translate on the X axis. - * @param dy Distance to translate on the Y axis. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasTranslate(OH_Drawing_Canvas* canvas, float dx, float dy); - -/** - * @brief Scales a canvas. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param sx Scale ratio on the X axis. - * @param sy Scale ratio on the Y axis. - * @since 11 - * @version 1.0 - */ -void OH_Drawing_CanvasScale(OH_Drawing_Canvas* canvas, float sx, float sy); - -/** - * @brief Skews a canvas. This function premultiplies the current canvas matrix by a skew transformation matrix and - * applies the resulting matrix to the canvas. The skew transformation matrix is as follows: - * |1 sx 0| - * |sy 1 0| - * |0 0 1| - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param sx Amount of tilt on the X axis. A positive number tilts the drawing rightwards along the positive direction - * of the Y axis, and a negative number tilts the drawing leftwards along the positive direction of the Y axis. - * @param sy Amount of tilt on the Y axis. A positive number tilts the drawing downwards along the positive direction - * of the X axis, and a negative number tilts the drawing upwards along the positive direction of the X axis. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasSkew(OH_Drawing_Canvas* canvas, float sx, float sy); - -/** - * @brief Obtains the canvas width. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @return Returns the width. - * @since 12 - * @version 1.0 - */ -int32_t OH_Drawing_CanvasGetWidth(OH_Drawing_Canvas* canvas); - -/** - * @brief Obtains the canvas height. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @return Returns the height. - * @since 12 - * @version 1.0 - */ -int32_t OH_Drawing_CanvasGetHeight(OH_Drawing_Canvas* canvas); - -/** - * @brief Obtains the bounds of the cropping region of the canvas. This function cannot be used for a canvas of the - * recording type. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **rect** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param rect Pointer to the {@link OH_Drawing_Rect} object. You can call {@link OH_Drawing_RectCreate} to create a - * rectangle object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasGetLocalClipBounds(OH_Drawing_Canvas* canvas, OH_Drawing_Rect* rect); - -/** - * @brief Obtains the 3x3 matrix of a canvas. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param matrix Pointer to the {@link OH_Drawing_Matrix} object. You can call {@link OH_Drawing_MatrixCreate} to - * create a matrix object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasGetTotalMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* matrix); - -/** - * @brief Preconcats the existing matrix of the canvas with the passed-in matrix. The drawing operation triggered - * before this API is called is not affected. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param matrix Pointer to the {@link OH_Drawing_Matrix} object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasConcatMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* matrix); - -/** - * @brief Enumerates the shadow flags. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** - * There is no shadow flag. - */ - SHADOW_FLAGS_NONE, - /** - * The occluding object is transparent. - */ - SHADOW_FLAGS_TRANSPARENT_OCCLUDER, - /** - * No analysis on the shadows is required. - */ - SHADOW_FLAGS_GEOMETRIC_ONLY, - /** - * All the preceding shadow flags are used. - */ - SHADOW_FLAGS_ALL, -} OH_Drawing_CanvasShadowFlags; - -/** - * @brief Draws a spot shadow and uses a given path to outline the ambient shadow. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **path** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * If **flag** is not set to one of the enumerated values, **OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param path Pointer to the {@link OH_Drawing_Path} object, which is used to generate shadows. - * @param planeParams Z-axis offset of an occluder relative to the canvas, based on its x and y coordinates. - * @param devLightPos Position of the light relative to the canvas. - * @param lightRadius Radius of the light source. The value must be greater than or equal to 0. - * @param ambientColor Ambient shadow color, which is represented by a 32-bit (ARGB) variable. - * @param spotColor Point shadow color, which is represented by a 32-bit (ARGB) variable. - * @param flag Enumeration of shadow flags. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawShadow(OH_Drawing_Canvas* canvas, OH_Drawing_Path* path, OH_Drawing_Point3D planeParams, - OH_Drawing_Point3D devLightPos, float lightRadius, uint32_t ambientColor, uint32_t spotColor, - OH_Drawing_CanvasShadowFlags flag); - -/** - * @brief Clears a canvas by using a given color. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param color Color, which is a 32-bit (ARGB) variable. - * @since 8 - * @version 1.0 - */ -void OH_Drawing_CanvasClear(OH_Drawing_Canvas* canvas, uint32_t color); - -/** - * @brief Sets the matrix status for a canvas. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **matrix** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param matrix Pointer to the {@link OH_Drawing_Matrix} object. You can call {@link OH_Drawing_MatrixCreate} to - * create a matrix object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasSetMatrix(OH_Drawing_Canvas* canvas, OH_Drawing_Matrix* matrix); - -/** - * @brief Resets the matrix of this canvas to an identity matrix. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If **canvas** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasResetMatrix(OH_Drawing_Canvas* canvas); - -/** - * @brief Reset the clip status. - * - * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @return Returns the error code. - * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. - * Returns {@link OH_DRAWING_ERROR_INVALID_PARAMETER} if canvas is nullptr. - * @since 26.0.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasResetClip(OH_Drawing_Canvas* canvas); - -/** - * @brief Draws a portion of an image onto a specified area of the canvas. The area selected by the source rectangle is - * scaled and translated to the destination rectangle. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If one of **canvas**, **image**, **src**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param image Pointer to the {@link OH_Drawing_Image} object. - * @param src Pointer to the {@link OH_Drawing_Rect} object. - * @param dst Pointer to the {@link OH_Drawing_Rect} object. - * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the - * default sampling options are used. - * @param srcRectConstraint Constraint type. For details about the available options, see - * {@link OH_Drawing_SrcRectConstraint}. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawImageRectWithSrc(OH_Drawing_Canvas* canvas, const OH_Drawing_Image* image, - const OH_Drawing_Rect* src, const OH_Drawing_Rect* dst, const OH_Drawing_SamplingOptions* samplingOptions, - OH_Drawing_SrcRectConstraint srcRectConstraint); - -/** - * @brief Draws an image onto a specified area of the canvas. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If one of **canvas**, **image**, or **dst** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param image Pointer to the {@link OH_Drawing_Image} object. - * @param rect Pointer to the {@link OH_Drawing_Rect} object. - * @param samplingOptions Pointer to the {@link OH_Drawing_SamplingOptions} object. A null pointer means that the - * default sampling options are used. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawImageRect(OH_Drawing_Canvas* canvas, OH_Drawing_Image* image, - OH_Drawing_Rect* rect, OH_Drawing_SamplingOptions* samplingOptions); - -/** - * @brief Enumerates the modes of interpreting the geometry of a given vertex. - * - * @since 12 - * @version 1.0 - */ -typedef enum { - /** - * Draws a triangle list. Specifically, a list of isolated triangles are drawn using every three vertices. If the - * number of vertices is not a multiple of 3, the extra vertices will be ignored. - */ - VERTEX_MODE_TRIANGLES, - /** - * Draws a triangle strip. Specifically, the first triangle is drawn between the first 3 vertices, and all - * subsequent triangles use the previous 2 vertices plus the next additional vertex. - */ - VERTEX_MODE_TRIANGLES_STRIP, - /** - * Draws a triangle fan. A triangle fan is similar to a triangle strip, except that all the triangles share one - * vertex (the first vertex). - */ - VERTEX_MODE_TRIANGLE_FAN, -} OH_Drawing_VertexMode; - -/** - * @brief Draws a triangular grid described by a vertex array. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **positions** is NULL, **vertexCount** is less than 3, or **indexCount** is less than 3 but - * not 0, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * If either **vertexMmode** or **mode** is not set to one of the enumerated values, ** - * OH_DRAWING_ERROR_PARAMETER_OUT_OF_RANGE** is returned. - * - * @param canvas Pointer to an **OH_Drawing_Canvas** object. - * @param vertexMmode Mode for drawing vertices. For details about the available options, see - * {@link OH_Drawing_VertexMode}. - * @param vertexCount Number of elements in the vertex array. The value must be greater than or equal to 3. - * @param positions Pointer to the array that holds the position of every vertex. The array cannot be null and its - * length must be equal to the value of **vertexCount**. - * @param texs Pointer to the array that holds the texture space coordinate corresponding to each vertex. The array can - * be null. If the array is not null, its length must be equal to the value of **vertexCount**. - * @param colors Pointer to the array that holds the color corresponding to each vertex. It is used for interpolation - * in a triangle. The array can be null. If the array is not null, its length must be equal to the value of ** - * vertexCount**. - * @param indexCount Number of indices. The value can be 0 or a value greater than or equal to 3. - * @param indices Pointer to the array that holds the index of each vertex. The array can be null. If the array is not - * null, its length must be equal to the value of **indexCount**. - * @param mode Enumeration of blend modes. For details about the available options, see {@link OH_Drawing_BlendMode}. - * @since 12 - * @version 1.0 - */ -void OH_Drawing_CanvasDrawVertices(OH_Drawing_Canvas* canvas, OH_Drawing_VertexMode vertexMmode, - int32_t vertexCount, const OH_Drawing_Point2D* positions, const OH_Drawing_Point2D* texs, - const uint32_t* colors, int32_t indexCount, const uint16_t* indices, OH_Drawing_BlendMode mode); - -/** - * @brief Copies pixel data from a canvas to a specified address. This function cannot be used for a canvas of the - * recording type. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If one of **canvas**, **imageInfo**, or **dstPixels** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param imageInfo Pointer to the {@link OH_Drawing_Image_Info} object. - * @param dstPixels Pointer to the start address for storing the pixel data. - * @param dstRowBytes Number of bytes in each row of pixels. The value is invalid if it is less than or equal to 0. - * @param srcX X offset of the pixels on the canvas, in px. - * @param srcY Y offset of the pixels on the canvas, in px. - * @return Returns **true** if the pixel data is copied to the start address of the storage; returns **false** - * otherwise. - * @since 12 - * @version 1.0 - */ -bool OH_Drawing_CanvasReadPixels(OH_Drawing_Canvas* canvas, OH_Drawing_Image_Info* imageInfo, - void* dstPixels, uint32_t dstRowBytes, int32_t srcX, int32_t srcY); - -/** - * @brief Copies pixel data from a canvas to an image. This function cannot be used for a canvas of the recording type. - * This API may return an error code. For details, call {@link OH_Drawing_ErrorCodeGet}. - * If either **canvas** or **bitmap** is NULL, **OH_DRAWING_ERROR_INVALID_PARAMETER** is returned. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param bitmap Pointer to the {@link OH_Drawing_Bitmap} object. - * @param srcX X offset of the pixels on the canvas, in px. - * @param srcY Y offset of the pixels on the canvas, in px. - * @return Returns **true** if the pixel data is copied to the image; returns **false** otherwise. - * @since 12 - * @version 1.0 - */ -bool OH_Drawing_CanvasReadPixelsToBitmap(OH_Drawing_Canvas* canvas, - OH_Drawing_Bitmap* bitmap, int32_t srcX, int32_t srcY); - -/** - * @brief Checks whether the region that can be drawn is empty after clipping. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param isClipEmpty Pointer to the variable that specifies whether the region is empty. The value **true** means that - * the region is empty, and **false** means the opposite. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **isClipEmpty** is NULL. - * @since 12 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasIsClipEmpty(OH_Drawing_Canvas* canvas, bool* isClipEmpty); - -/** - * @brief Obtains the image information of a canvas. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param imageInfo Pointer to the {@link OH_Drawing_Image_Info} object. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **imageInfo** is NULL. - * @since 12 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasGetImageInfo(OH_Drawing_Canvas* canvas, OH_Drawing_Image_Info* imageInfo); - -/** - * @brief Draws an **OH_Drawing_RecordCmd** object. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. Only the canvas of the recording type is supported. - * @param recordCmd Pointer to the {@link OH_Drawing_RecordCmd} object. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **recordCmd** is NULL. - * @since 13 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmd(OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd); - -/** - * @brief Draws an **OH_Drawing_RecordCmd** object. This API supports nesting. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. Only the canvas of the recording type is supported. - * @param recordCmd Pointer to the {@link OH_Drawing_RecordCmd} object. - * @return Operation code. - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if either **canvas** or **recordCmd** is NULL. - * @since 19 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasDrawRecordCmdNesting(OH_Drawing_Canvas* canvas, OH_Drawing_RecordCmd* recordCmd); - -/** - * @brief Checks whether the path is not intersecting with the canvas area. The canvas area includes its boundaries. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param path Pointer to the {@link OH_Drawing_Path} object. - * @param quickReject Pointer to the check result. The value **true** means that the path is not intersecting with the - * canvas area, and **false** means the opposite. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **path**, or **quickReject** is NULL. - * @since 18 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasQuickRejectPath(OH_Drawing_Canvas* canvas, const OH_Drawing_Path* path, - bool* quickReject); - -/** - * @brief Checks whether the rectangle is not intersecting with the canvas area. The canvas area includes its - * boundaries. - * - * @param canvas Pointer to the {@link OH_Drawing_Canvas} object. - * @param rect Pointer to the {@link OH_Drawing_Rect} object. - * @param quickReject Pointer to the check result. The value **true** means that the rectangle is not intersecting with - * the canvas area, and **false** means the opposite. - * @return Returns one of the following result codes: - * **OH_DRAWING_SUCCESS** if the operation is successful. - * **OH_DRAWING_ERROR_INVALID_PARAMETER** if **canvas**, **rect**, or **quickReject** is NULL. - * @since 18 - * @version 1.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasQuickRejectRect(OH_Drawing_Canvas* canvas, const OH_Drawing_Rect* rect, - bool* quickReject); - -/** - * @brief Checks if the current layer that drawn into the device is opaque. - * - * @param canvas Indicates the pointer to an OH_Drawing_Canvas object. - * @param isOpaque Indicates if the canvas is opaque. - * @return Returns the error code. - * Returns {@link OH_DRAWING_SUCCESS} if the operation is successful. - * Returns {@link OH_DRAWING_ERROR_INCORRECT_PARAMETER} if canvas or isOpaque is nullptr. - * @since 26.0.0 - */ -OH_Drawing_ErrorCode OH_Drawing_CanvasIsOpaque(const OH_Drawing_Canvas* canvas, bool* isOpaque); - #ifdef __cplusplus } #endif From 68978a03de6bb8b78b31d0a53c161a07a99f3ada Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 5 Jun 2026 11:48:24 +0800 Subject: [PATCH 07/44] add roi string Signed-off-by: yangxiaoyu5 --- .../graphic_2d/native_buffer/buffer_common.h | 15 +- multimedia/av_codec/native_avcodec_base.h | 18 +- .../av_codec/native_avcodec_videobase.h | 190 ++++++++++++++++++ 3 files changed, 214 insertions(+), 9 deletions(-) create mode 100644 multimedia/av_codec/native_avcodec_videobase.h diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index 96fa6bb4d..617c50471 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -289,18 +289,25 @@ typedef enum OH_NativeBuffer_MetadataKey { * 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 and supports two formats for backward compatibility: - * 1. Legacy format: A single integer representing the quantization parameter offset (e.g., "=QpOffset"). - * 2. Key-Value format (Recommended): Comma-separated key-value pairs (e.g., "=dqp:-6,slb:1"). + * The "[=Params]" is optional. + * The format of "[=Params]" varies by version: + * 1. Prior to version 26.0.0: Only a single integer 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_NativeBuffer_RoiMetadataSemanticLabelType}. + * - "slb": Semantic label. The value must correspond to {@link OH_VideoEncoderRoiSemanticLabel}. + * * 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_VideoBase_AppendRoiString} to format and append + * ROI configurations safely instead of concatenating the string manually. + * * @since 22 */ OH_REGION_OF_INTEREST_METADATA diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 2f048f3b5..95ddff495 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1672,15 +1672,20 @@ 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) parameters. Value type is string in the format +* @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 and supports two formats for backward compatibility: - * 1. Legacy format: A single integer representing the quantization parameter offset (e.g., "=Offset"). - * 2. Key-Value format (Recommended): Comma-separated key-value pairs (e.g., "=dqp:-6,slb:1"). + * The "[=Params]" is optional. + * The format of "[=Params]" varies by version: + * 1. Prior to version 26.0.0: Only a single integer 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_NativeBuffer_RoiMetadataSemanticLabelType}. + * - "slb": Semantic label. The value must correspond to {@link OH_VideoEncoderRoiSemanticLabel}. + * * 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. @@ -1691,6 +1696,9 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES; * 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}. + * + * @note Since version 26.0.0, it is highly recommended to use {@link OH_VideoBase_AppendRoiString} to format + * and append ROI configurations safely instead of concatenating the string manually. * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 20 */ diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h new file mode 100644 index 000000000..f071672ca --- /dev/null +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -0,0 +1,190 @@ +/* + * 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 +#include +#include "native_avbuffer.h" +#include "native_avmemory.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_ENCODER_ROI_BOTTOM}). + * This is a mandatory key used when configuring ROI parameters. + * + * @since 26.0.0 + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_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_ENCODER_ROI_RIGHT}). + * This is a mandatory key used when configuring ROI parameters. + * + * @since 26.0.0 + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_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_ENCODER_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_ENCODER_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_ENCODER_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_ENCODER_ROI_RIGHT; + +/** + * @brief Key for describing the quantization parameter offset (delta-qp) 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. + * + * @since 26.0.0 + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_DELTA_QP; + +/** + * @brief Key for describing the semantic label (sem_label) of a single ROI, value type is int32_t. + * + * The value must correspond to {@link OH_VideoEncoderRoiSemanticLabel}. + * This is an optional key used when configuring ROI parameters. + * + * @since 26.0.0 + */ +extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_SEM_LABEL; + +/** + * @brief The semantic labels for Region of Interest (ROI) in video encoding. + * + * @syscap SystemCapability.Multimedia.Media.CodecBase + * @since 26.0.0 + */ +typedef enum OH_VideoEncoderRoiSemanticLabel { + /** + * Indicates an unspecified or unknown region. + * @since 26.0.0 + */ + VIDEO_ENCODER_ROI_SEM_LABEL_OTHER = 0, + + /** + * Indicates that the ROI contains a human face. + * @since 26.0.0 + */ + VIDEO_ENCODER_ROI_SEM_LABEL_FACE = 1 +} OH_VideoEncoderRoiSemanticLabel; + +/** + * @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, this function will allocate memory for a new string. + * If *roiStrInOut is not NULL, this function will reallocate the memory to append + * the new configuration safely. + * + * @note The caller takes ownership of the memory allocated for *roiStrInOut. + * To prevent memory leaks, the caller is fully responsible for freeing the + * final string using the standard free() function when it is no longer needed. + * + * @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 Returns AV_ERR_OK if the string is successfully formatted and appended. + * Returns AV_ERR_INVALID_VAL if the roiStrInOut pointer or format handle is NULL, + * or if the format lacks required ROI keys. + * Returns AV_ERR_NO_MEMORY if internal memory allocation or reallocation fails. + * @since 26.0.0 + */ +OH_AVErrCode OH_VideoBase_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 AV_ERR_OK if the operation is successful; returns a specific error code otherwise. + * @since 26.0.0 + */ +OH_AVErrCode OH_VideoBase_GetRoiCount(const char *roiStr, uint32_t *outCount); + +/** + * @brief Parses the ROI string and populates the caller-provided OH_AVFormat array. + * + * The caller is responsible for providing a properly sized pointer array and explicitly + * destroying the successfully created OH_AVFormat handles using OH_AVFormat_Destroy() + * to prevent memory leaks. + * + * @param roiStr The input ROI configuration string. + * @param outFormats [OUT] A pointer array allocated by the caller to receive the parsed OH_AVFormat handles. + * @param maxCapacity [IN] Indicates the maximum physical capacity of the outFormats array to prevent out-of-bounds writes. + * @param outCount [OUT] Returns the actual number of ROIs successfully parsed and populated into the array. + * @return AV_ERR_OK if the operation is successful; returns a specific error code otherwise. + * @since 26.0.0 + */ +OH_AVErrCode OH_VideoBase_ParseRoiString(const char *roiStr, OH_AVFormat **outFormats, uint32_t maxCapacity, uint32_t *outCount); + +#ifdef __cplusplus +} +#endif +#endif // NATIVE_AVCODEC_VIDEOBASE_H +/** @} */ \ No newline at end of file From bdc95f68e0d7d640f48e7607112db71fcc69b54d Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 5 Jun 2026 12:05:23 +0800 Subject: [PATCH 08/44] fix api json Signed-off-by: yangxiaoyu5 --- .../native_buffer/libnative_buffer.ndk.json | 8 ---- .../libnative_media_codecbase.ndk.json | 37 +++++++++++++++++++ 2 files changed, 37 insertions(+), 8 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/libnative_buffer.ndk.json b/graphic/graphic_2d/native_buffer/libnative_buffer.ndk.json index 1f7cb5104..1c3604260 100644 --- a/graphic/graphic_2d/native_buffer/libnative_buffer.ndk.json +++ b/graphic/graphic_2d/native_buffer/libnative_buffer.ndk.json @@ -40,13 +40,5 @@ { "first_introduced": "23", "name": "OH_NativeBuffer_MapAndGetConfig" - }, - { - "first_introduced": "26.0.0", - "name": "OH_ROI_METADATA_KEY_SEMANTIC_LABEL" - }, - { - "first_introduced": "26.0.0", - "name": "OH_ROI_METADATA_KEY_DELTA_QP" } ] \ No newline at end of file diff --git a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json index b8fb322f1..c5c39dd35 100644 --- a/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json +++ b/multimedia/av_codec/codec_base/libnative_media_codecbase.ndk.json @@ -850,5 +850,42 @@ { "first_introduced": "26.0.0", "name": "OH_MD_KEY_VIDEO_ENCODER_PREPROC_DROP_TO_FRAME_RATE" + }, + { + "first_introduced": "26.0.0", + "name": "OH_MD_KEY_VIDEO_ENCODER_ROI_TOP", + "type": "variable" + }, + { + "first_introduced": "26.0.0", + "name": "OH_MD_KEY_VIDEO_ENCODER_ROI_LEFT", + "type": "variable" + }, + { + "first_introduced": "26.0.0", + "name": "OH_MD_KEY_VIDEO_ENCODER_ROI_BOTTOM", + "type": "variable" + }, + { + "first_introduced": "26.0.0", + "name": "OH_MD_KEY_VIDEO_ENCODER_ROI_RIGHT", + "type": "variable" + }, + { + "first_introduced": "26.0.0", + "name": "OH_MD_KEY_VIDEO_ENCODER_ROI_DELTA_QP", + "type": "variable" + }, + { + "first_introduced": "26.0.0", + "name": "OH_VideoBase_AppendRoiString" + }, + { + "first_introduced": "26.0.0", + "name": "OH_VideoBase_GetRoiCount" + }, + { + "first_introduced": "26.0.0", + "name": "OH_VideoBase_ParseRoiString" } ] From 9b05e245dc9cf53f1361596cb97b4342cec3124f Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 5 Jun 2026 12:08:13 +0800 Subject: [PATCH 09/44] rm from buffer_common Signed-off-by: yangxiaoyu5 --- .../graphic_2d/native_buffer/buffer_common.h | 41 ------------------- 1 file changed, 41 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index 617c50471..db85cd952 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -229,47 +229,6 @@ typedef struct OH_NativeBuffer_StaticMetadata { OH_NativeBuffer_Cta861 cta861; } OH_NativeBuffer_StaticMetadata; -/** - * @brief Enumerates the semantic label types for Region of Interest (ROI). - * - * These types are used as the predefined values for the "slb" key in ROI parameters. - * - * @since 26.0.0 - */ -typedef enum OH_NativeBuffer_RoiMetadataSemanticLabelType { - /** - * Indicates an unspecified or unknown region. - * @since 26.0.0 - */ - OH_ROI_METADATA_SEMANTIC_LABEL_TYPE_OTHER = 0, - /** - * Indicates that the ROI contains a human face. - * @since 26.0.0 - */ - OH_ROI_METADATA_SEMANTIC_LABEL_TYPE_FACE = 1 -} OH_NativeBuffer_RoiMetadataSemanticLabelType; - -/** - * @brief ROI metadata key for Semantic Label. - * - * Used in the Key-Value format of ROI parameters to specify the semantic label of the region. - * The string value is "slb". The configured value mapped to this key should be the string representation of the - * {@link OH_NativeBuffer_RoiMetadataSemanticLabelType} enumeration (e.g., "1" for OH_ROI_SEMANTIC_LABEL_TYPE_FACE). - * - * @since 26.0.0 - */ -extern const char *OH_ROI_METADATA_KEY_SEMANTIC_LABEL; - -/** - * @brief ROI metadata key for Delta QP. - * - * Used in the Key-Value format of ROI parameters to specify the quantization parameter offset. - * The string value is "dqp". - * - * @since 26.0.0 - */ -extern const char *OH_ROI_METADATA_KEY_DELTA_QP; - /** * @brief Indicates the descriptive information of a native buffer, * such as HDR metadata, ROI metadata, etc. From 3d93b6e150dae4760ed74939d30c450c272241a9 Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 5 Jun 2026 12:13:35 +0800 Subject: [PATCH 10/44] fix videobase include problem Signed-off-by: yangxiaoyu5 --- multimedia/av_codec/native_avcodec_videobase.h | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h index f071672ca..fc8660640 100644 --- a/multimedia/av_codec/native_avcodec_videobase.h +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -36,9 +36,8 @@ #ifndef NATIVE_AVCODEC_VIDEOBASE_H #define NATIVE_AVCODEC_VIDEOBASE_H #include -#include -#include "native_avbuffer.h" -#include "native_avmemory.h" +#include "native_avformat.h" +#include "native_averrors.h" #ifdef __cplusplus extern "C" { #endif From 263c1b2884672c73603210d012179250bbea54e0 Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 5 Jun 2026 14:31:41 +0800 Subject: [PATCH 11/44] change module to video metadata Signed-off-by: yangxiaoyu5 --- multimedia/av_codec/native_avcodec_base.h | 1 + .../av_codec/native_avcodec_videobase.h | 36 +++++++++---------- 2 files changed, 19 insertions(+), 18 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 95ddff495..90f29ec00 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -39,6 +39,7 @@ #include #include #include "native_avbuffer.h" +#include "native_avcodec_videobase.h" #include "native_avmemory.h" #ifdef __cplusplus extern "C" { diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h index fc8660640..1004811d6 100644 --- a/multimedia/av_codec/native_avcodec_videobase.h +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -46,45 +46,45 @@ extern "C" { * @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_ENCODER_ROI_BOTTOM}). + * 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_ENCODER_ROI_TOP; +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_ENCODER_ROI_RIGHT}). + * 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_ENCODER_ROI_LEFT; +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_ENCODER_ROI_TOP}, {@link OH_MD_KEY_VIDEO_HEIGHT}]. + * 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_ENCODER_ROI_BOTTOM; +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_ENCODER_ROI_LEFT}, {@link OH_MD_KEY_VIDEO_WIDTH}]. + * 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_ENCODER_ROI_RIGHT; +extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_RIGHT; /** * @brief Key for describing the quantization parameter offset (delta-qp) of a single ROI, value type is int32_t. @@ -94,17 +94,17 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_RIGHT; * * @since 26.0.0 */ -extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_DELTA_QP; +extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_DELTA_QP; /** * @brief Key for describing the semantic label (sem_label) of a single ROI, value type is int32_t. * - * The value must correspond to {@link OH_VideoEncoderRoiSemanticLabel}. + * The value must correspond to {@link OH_VideoMetadataRoiSemanticLabel}. * This is an optional key used when configuring ROI parameters. * * @since 26.0.0 */ -extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_SEM_LABEL; +extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_SEM_LABEL; /** * @brief The semantic labels for Region of Interest (ROI) in video encoding. @@ -112,19 +112,19 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_SEM_LABEL; * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 26.0.0 */ -typedef enum OH_VideoEncoderRoiSemanticLabel { +typedef enum OH_VideoMetadataRoiSemanticLabel { /** * Indicates an unspecified or unknown region. * @since 26.0.0 */ - VIDEO_ENCODER_ROI_SEM_LABEL_OTHER = 0, + VIDEO_METADATA_ROI_SEM_LABEL_OTHER = 0, /** * Indicates that the ROI contains a human face. * @since 26.0.0 */ - VIDEO_ENCODER_ROI_SEM_LABEL_FACE = 1 -} OH_VideoEncoderRoiSemanticLabel; + VIDEO_METADATA_ROI_SEM_LABEL_FACE = 1 +} OH_VideoMetadataRoiSemanticLabel; /** * @brief Formats the region of interest (ROI) configuration from an OH_AVFormat handle @@ -152,7 +152,7 @@ typedef enum OH_VideoEncoderRoiSemanticLabel { * Returns AV_ERR_NO_MEMORY if internal memory allocation or reallocation fails. * @since 26.0.0 */ -OH_AVErrCode OH_VideoBase_AppendRoiString(char **roiStrInOut, OH_AVFormat *format); +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. @@ -164,7 +164,7 @@ OH_AVErrCode OH_VideoBase_AppendRoiString(char **roiStrInOut, OH_AVFormat *forma * @return AV_ERR_OK if the operation is successful; returns a specific error code otherwise. * @since 26.0.0 */ -OH_AVErrCode OH_VideoBase_GetRoiCount(const char *roiStr, uint32_t *outCount); +OH_AVErrCode OH_VideoMetadata_GetRoiCount(const char *roiStr, uint32_t *outCount); /** * @brief Parses the ROI string and populates the caller-provided OH_AVFormat array. @@ -180,7 +180,7 @@ OH_AVErrCode OH_VideoBase_GetRoiCount(const char *roiStr, uint32_t *outCount); * @return AV_ERR_OK if the operation is successful; returns a specific error code otherwise. * @since 26.0.0 */ -OH_AVErrCode OH_VideoBase_ParseRoiString(const char *roiStr, OH_AVFormat **outFormats, uint32_t maxCapacity, uint32_t *outCount); +OH_AVErrCode OH_VideoMetadata_ParseRoiString(const char *roiStr, OH_AVFormat **outFormats, uint32_t maxCapacity, uint32_t *outCount); #ifdef __cplusplus } From 8f1011c0a5bd6be7faec78624b675ae07a4369c4 Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 5 Jun 2026 15:53:24 +0800 Subject: [PATCH 12/44] fix format err Signed-off-by: yangxiaoyu5 --- .../graphic_2d/native_buffer/buffer_common.h | 4 +- .../av_codec/native_avcodec_videobase.h | 50 ++++++++++--------- 2 files changed, 28 insertions(+), 26 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index db85cd952..924a30791 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -264,8 +264,8 @@ typedef enum OH_NativeBuffer_MetadataKey { * 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_VideoBase_AppendRoiString} to format and append - * ROI configurations safely instead of concatenating the string manually. + * @note Since version 26.0.0, it is highly recommended to use {@link OH_VideoBase_AppendRoiString} to format + * and append ROI configurations safely instead of concatenating the string manually. * * @since 22 */ diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h index 1004811d6..743641304 100644 --- a/multimedia/av_codec/native_avcodec_videobase.h +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -18,7 +18,7 @@ * * @brief The CodecBase module provides variables, properties, and functions * for audio and video muxer, demuxer, and basic encoding and decoding functions. - * + * * @since 9 */ /** @@ -26,7 +26,7 @@ * * @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 @@ -44,51 +44,51 @@ extern "C" { /** * @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 (delta-qp) 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. * @@ -115,39 +115,40 @@ extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_SEM_LABEL; typedef enum OH_VideoMetadataRoiSemanticLabel { /** * Indicates an unspecified or unknown region. + * * @since 26.0.0 */ VIDEO_METADATA_ROI_SEM_LABEL_OTHER = 0, - /** * Indicates that the ROI contains a human face. + * * @since 26.0.0 */ VIDEO_METADATA_ROI_SEM_LABEL_FACE = 1 } OH_VideoMetadataRoiSemanticLabel; /** - * @brief Formats the region of interest (ROI) configuration from an OH_AVFormat handle + * @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 + * 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, this function will allocate memory for a new string. - * If *roiStrInOut is not NULL, this function will reallocate the memory to append + * If *roiStrInOut is not NULL, this function will reallocate the memory to append * the new configuration safely. * - * @note The caller takes ownership of the memory allocated for *roiStrInOut. - * To prevent memory leaks, the caller is fully responsible for freeing the + * @note The caller takes ownership of the memory allocated for *roiStrInOut. + * To prevent memory leaks, the caller is fully responsible for freeing the * final string using the standard free() function when it is no longer needed. * * @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. + * @param format The OH_AVFormat handle containing the ROI parameters to be appended. * Must not be NULL. * @return Returns AV_ERR_OK if the string is successfully formatted and appended. - * Returns AV_ERR_INVALID_VAL if the roiStrInOut pointer or format handle is NULL, + * Returns AV_ERR_INVALID_VAL if the roiStrInOut pointer or format handle is NULL, * or if the format lacks required ROI keys. * Returns AV_ERR_NO_MEMORY if internal memory allocation or reallocation fails. * @since 26.0.0 @@ -156,7 +157,7 @@ OH_AVErrCode OH_VideoMetadata_AppendRoiString(char **roiStrInOut, OH_AVFormat *f /** * @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 + * * 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. @@ -169,8 +170,8 @@ OH_AVErrCode OH_VideoMetadata_GetRoiCount(const char *roiStr, uint32_t *outCount /** * @brief Parses the ROI string and populates the caller-provided OH_AVFormat array. * - * The caller is responsible for providing a properly sized pointer array and explicitly - * destroying the successfully created OH_AVFormat handles using OH_AVFormat_Destroy() + * The caller is responsible for providing a properly sized pointer array and explicitly + * destroying the successfully created OH_AVFormat handles using OH_AVFormat_Destroy() * to prevent memory leaks. * * @param roiStr The input ROI configuration string. @@ -180,7 +181,8 @@ OH_AVErrCode OH_VideoMetadata_GetRoiCount(const char *roiStr, uint32_t *outCount * @return AV_ERR_OK if the operation is successful; returns a specific error code otherwise. * @since 26.0.0 */ -OH_AVErrCode OH_VideoMetadata_ParseRoiString(const char *roiStr, OH_AVFormat **outFormats, uint32_t maxCapacity, uint32_t *outCount); +OH_AVErrCode OH_VideoMetadata_ParseRoiString(const char *roiStr, OH_AVFormat **outFormats, uint32_t maxCapacity, + uint32_t *outCount); #ifdef __cplusplus } From f109ee2d70a64ec93f1445ac998253490fc3037b Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 5 Jun 2026 15:55:21 +0800 Subject: [PATCH 13/44] fix format err Signed-off-by: yangxiaoyu5 --- multimedia/av_codec/native_avcodec_videobase.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h index 743641304..08d590684 100644 --- a/multimedia/av_codec/native_avcodec_videobase.h +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -176,7 +176,8 @@ OH_AVErrCode OH_VideoMetadata_GetRoiCount(const char *roiStr, uint32_t *outCount * * @param roiStr The input ROI configuration string. * @param outFormats [OUT] A pointer array allocated by the caller to receive the parsed OH_AVFormat handles. - * @param maxCapacity [IN] Indicates the maximum physical capacity of the outFormats array to prevent out-of-bounds writes. + * @param maxCapacity [IN] Indicates the maximum physical capacity of the outFormats array to prevent + * out-of-bounds writes. * @param outCount [OUT] Returns the actual number of ROIs successfully parsed and populated into the array. * @return AV_ERR_OK if the operation is successful; returns a specific error code otherwise. * @since 26.0.0 From 08271b1c3019cbeb0868f72cd6cf67bfc57b02ad Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 5 Jun 2026 16:28:14 +0800 Subject: [PATCH 14/44] fix format err Signed-off-by: yangxiaoyu5 --- multimedia/av_codec/native_avcodec_videobase.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h index 08d590684..2a168d978 100644 --- a/multimedia/av_codec/native_avcodec_videobase.h +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -24,7 +24,7 @@ /** * @file native_avcodec_videobase.h * - * @brief Declare the Native API used for basic video encoding and decoding functions, + * @brief Declare the Native API used for basic video encoding and decoding functions, * as well as video-specific configurations and parameters. * * @kit AVCodecKit @@ -80,7 +80,7 @@ extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_BOTTOM; * * 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. + * This is a mandatory key used when configuring ROI parameters. * * @since 26.0.0 */ From 419708e56e12c240f01b257ec498335060330940 Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 5 Jun 2026 18:07:45 +0800 Subject: [PATCH 15/44] update enum Signed-off-by: yangxiaoyu5 --- multimedia/av_codec/native_avcodec_base.h | 1 - multimedia/av_codec/native_avcodec_videobase.h | 4 ++-- 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 8bc0edec2..0bfa5d34f 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -39,7 +39,6 @@ #include #include #include "native_avbuffer.h" -#include "native_avcodec_videobase.h" #include "native_avmemory.h" #ifdef __cplusplus extern "C" { diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h index 2a168d978..d5f3b1bbd 100644 --- a/multimedia/av_codec/native_avcodec_videobase.h +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -118,13 +118,13 @@ typedef enum OH_VideoMetadataRoiSemanticLabel { * * @since 26.0.0 */ - VIDEO_METADATA_ROI_SEM_LABEL_OTHER = 0, + OH_VIDEO_METADATA_ROI_SEM_LABEL_OTHER = 0, /** * Indicates that the ROI contains a human face. * * @since 26.0.0 */ - VIDEO_METADATA_ROI_SEM_LABEL_FACE = 1 + OH_VIDEO_METADATA_ROI_SEM_LABEL_FACE = 1 } OH_VideoMetadataRoiSemanticLabel; /** From 7fcfd4f8687caa9b5b2c8ade791d5f1657477d8e Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Mon, 8 Jun 2026 17:50:40 +0800 Subject: [PATCH 16/44] fix review suggestions Signed-off-by: yangxiaoyu5 --- .../graphic_2d/native_buffer/buffer_common.h | 4 +- multimedia/av_codec/native_avcodec_base.h | 4 +- .../av_codec/native_avcodec_videobase.h | 43 +++++++++++-------- 3 files changed, 29 insertions(+), 22 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index 924a30791..d27b5e03f 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -256,7 +256,7 @@ typedef enum OH_NativeBuffer_MetadataKey { * 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_VideoEncoderRoiSemanticLabel}. + * - "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 @@ -264,7 +264,7 @@ typedef enum OH_NativeBuffer_MetadataKey { * 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_VideoBase_AppendRoiString} to format + * @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 diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 0bfa5d34f..928090bd3 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1682,7 +1682,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES; * 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_VideoEncoderRoiSemanticLabel}. + * - "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 @@ -1695,7 +1695,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES; * In surface mode, it is used in {@link OH_VideoEncoder_OnNeedInputParameter}. * In buffer mode, it is configured via {@link OH_AVBuffer_SetParameter}. * - * @note Since version 26.0.0, it is highly recommended to use {@link OH_VideoBase_AppendRoiString} to format + * @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. * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 20 diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h index d5f3b1bbd..822a94ec3 100644 --- a/multimedia/av_codec/native_avcodec_videobase.h +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -87,20 +87,22 @@ extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_BOTTOM; extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_RIGHT; /** - * @brief Key for describing the quantization parameter offset (delta-qp) of a single ROI, value type is int32_t. + * @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 (sem_label) of a single ROI, value type is int32_t. + * @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 */ @@ -109,7 +111,6 @@ extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_SEM_LABEL; /** * @brief The semantic labels for Region of Interest (ROI) in video encoding. * - * @syscap SystemCapability.Multimedia.Media.CodecBase * @since 26.0.0 */ typedef enum OH_VideoMetadataRoiSemanticLabel { @@ -134,14 +135,13 @@ typedef enum OH_VideoMetadataRoiSemanticLabel { * 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, this function will allocate memory for a new string. - * If *roiStrInOut is not NULL, this function will reallocate the memory to append - * the new configuration safely. + * 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. - * To prevent memory leaks, the caller is fully responsible for freeing the - * final string using the standard free() function when it is no longer needed. + * 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. @@ -157,12 +157,14 @@ OH_AVErrCode OH_VideoMetadata_AppendRoiString(char **roiStrInOut, OH_AVFormat *f /** * @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 + * + * 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 AV_ERR_OK if the operation is successful; returns a specific error code otherwise. + * @return Returns AV_ERR_OK if the operation is successful. + * Returns 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); @@ -170,19 +172,24 @@ OH_AVErrCode OH_VideoMetadata_GetRoiCount(const char *roiStr, uint32_t *outCount /** * @brief Parses the ROI string and populates the caller-provided OH_AVFormat array. * - * The caller is responsible for providing a properly sized pointer array and explicitly - * destroying the successfully created OH_AVFormat handles using OH_AVFormat_Destroy() - * to prevent memory leaks. + * @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 outFormats [OUT] A pointer array allocated by the caller to receive the parsed OH_AVFormat handles. - * @param maxCapacity [IN] Indicates the maximum physical capacity of the outFormats array to prevent + * @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 AV_ERR_OK if the operation is successful; returns a specific error code otherwise. + * @return Returns AV_ERR_OK if the operation is successful. + * Returns 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 **outFormats, uint32_t maxCapacity, +OH_AVErrCode OH_VideoMetadata_ParseRoiString(const char *roiStr, OH_AVFormat **outOwnedFormats, uint32_t maxCapacity, uint32_t *outCount); #ifdef __cplusplus From 6d16be342bc00087f41d1103e10bd2b18fc3ad97 Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Tue, 9 Jun 2026 09:41:22 +0800 Subject: [PATCH 17/44] add free Signed-off-by: yangxiaoyu5 --- multimedia/av_codec/native_avcodec_videobase.h | 1 + 1 file changed, 1 insertion(+) diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h index 822a94ec3..e2a54140d 100644 --- a/multimedia/av_codec/native_avcodec_videobase.h +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -151,6 +151,7 @@ typedef enum OH_VideoMetadataRoiSemanticLabel { * Returns AV_ERR_INVALID_VAL if the roiStrInOut pointer or format handle is NULL, * or if the format lacks required ROI keys. * Returns 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); From 6974fe6dd69f92bef86d8d05f60254974cb3ea9d Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 16:17:32 +0800 Subject: [PATCH 18/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: opencode (qwen3.6-plus) Change-Id: I1273a3fdd276b9b3bf7ad35c3f4a69e573952bae --- arkui/ace_engine/native/native_animate.h | 1546 ++++++++++++---------- 1 file changed, 835 insertions(+), 711 deletions(-) diff --git a/arkui/ace_engine/native/native_animate.h b/arkui/ace_engine/native/native_animate.h index 2c9beee8e..96f6805ee 100644 --- a/arkui/ace_engine/native/native_animate.h +++ b/arkui/ace_engine/native/native_animate.h @@ -25,7 +25,8 @@ /** * @file native_animate.h * - * @brief Defines a set of animation APIs of ArkUI on the native side. + * @brief Defines a set of animation APIs of ArkUI on the native side. The APIs in **native_animate.h** must be called + * in the main thread. * * @library libace_ndk.z.so * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -54,11 +55,17 @@ extern "C" { * @since 12 */ typedef struct { - /** Expected minimum frame rate. */ + /** + * Expected minimum frame rate, in fps. + */ uint32_t min; - /** Expected maximum frame rate. */ + /** + * Expected maximum frame rate, in fps. + */ uint32_t max; - /** Expected optimal frame rate. */ + /** + * Expected optimal frame rate, in fps. + */ uint32_t expected; } ArkUI_ExpectedFrameRateRange; @@ -68,11 +75,17 @@ typedef struct { * @since 12 */ typedef struct { - /** Type of the onFinish callback. */ + /** + * Callback type for when the animation playback is complete. + */ ArkUI_FinishCallbackType type; - /** Callback invoked when the animation playback is complete. */ + /** + * Invoked when the animation playback is complete. + */ void (*callback)(void* userData); - /** Custom type. */ + /** + * Custom data passed upon animation end callback. + */ void* userData; } ArkUI_AnimateCompleteCallback; @@ -133,61 +146,61 @@ typedef struct ArkUI_AnimatorEvent ArkUI_AnimatorEvent; typedef struct ArkUI_AnimatorOnFrameEvent ArkUI_AnimatorOnFrameEvent; /** - * @brief Defines the transition effect. - * - * @since 12 - */ + * @brief Defines the transition parameter object for transition property configuration. + * + * @since 12 + */ typedef struct ArkUI_TransitionEffect ArkUI_TransitionEffect; /** - * @brief Implements the native animation APIs provided by ArkUI. - * - * @version 1 - * @since 12 - */ + * @brief Declares the native animation APIs provided by ArkUI. + * + * @version 1 + * @since 12 + */ typedef struct { /** * @brief Defines an explicit animation. * * @note Make sure the component attributes to be set in the event closure have been set before. * - * @param context Indicates a UIContext instance. - * @param option Indicates the pointer to an animation configuration. - * @param update Indicates the animation closure. The system automatically inserts a transition animation for the - * state change caused by the closure. - * @param complete Indicates the callback to be invoked when the animation playback is complete. - * @return Returns the error 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. + * @param context **UIContext** instance. + * @param option Defines the animation configuration. + * @param update Closure function for the animation. The system automatically inserts the transition animation if + * the state changes in the closure function. + *
Note: Make sure the component attributes to be set in the closure function have been set before. + * @param complete Callback invoked when the animation playback is complete. + * @return 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. */ int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update, ArkUI_AnimateCompleteCallback* complete); /** - * @brief Sets the keyframe animation. + * @brief Defines a keyframe animation. * - * - * @param context Indicates a UIContext instance. - * @param option Indicates the keyframe animation parameters. - * @return Returns the error 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. + * @param context **UIContext** instance. + * @param option Keyframe animation parameter. + * @return 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. */ int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option); /** * @brief Creates an animator object. * - * @param context Indicates a UIContext instance. - * @param option Indicates the animator parameters. - * @return Returns the pointer to the animator object; returns NULL if a function parameter error occurs. + * @param context **UIContext** instance. + * @param option Animator parameter. + * @return Returns the pointer to the animator object; returns **NULL** if a parameter error occurs. */ ArkUI_AnimatorHandle (*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option); /** * @brief Disposes of an animator object. * - * @param animatorHandle Indicates the target animator object. + * @param animatorHandle Animator object. */ void (*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle); } ArkUI_NativeAnimateAPI_1; @@ -195,7 +208,7 @@ typedef struct { /** * @brief Creates an animation configuration. * -* @return Returns the pointer to the created animation configuration. +* @return Pointer to the created animation configuration. * @since 12 */ ArkUI_AnimateOption* OH_ArkUI_AnimateOption_Create(); @@ -203,7 +216,8 @@ ArkUI_AnimateOption* OH_ArkUI_AnimateOption_Create(); /** * @brief Disposes of an animation configuration. * -* @param option Indicates the pointer to an animation configuration. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. * @since 12 */ void OH_ArkUI_AnimateOption_Dispose(ArkUI_AnimateOption* option); @@ -211,26 +225,29 @@ void OH_ArkUI_AnimateOption_Dispose(ArkUI_AnimateOption* option); /** * @brief Obtains the animation duration, in milliseconds. * -* @param option Indicates the pointer to an animation configuration. -* @return Returns the duration. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **0** is returned. +* @return Animation duration, in milliseconds. If **option** is invalid, **0** is returned. * @since 12 */ uint32_t OH_ArkUI_AnimateOption_GetDuration(ArkUI_AnimateOption* option); /** -* @brief Obtains the animation playback speed. +* @brief Obtains the playback speed of an animation. * -* @param option Indicates the pointer to an animation configuration. -* @return Returns the animation playback speed. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **0.0** is returned. +* @return Animation playback speed. Value range: [0, +∞). If **option** is invalid, **0.0** is returned. * @since 12 */ float OH_ArkUI_AnimateOption_GetTempo(ArkUI_AnimateOption* option); /** -* @brief Obtains the animation curve. +* @brief Obtains an animation curve. * -* @param option Indicates the pointer to an animation configuration. -* @return Returns the animated curve.If Null is returned, it means option is an invalid value. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **-1** is returned. +* @return Animation curve. If **option** is invalid,**-1** is returned. * @since 12 */ ArkUI_AnimationCurve OH_ArkUI_AnimateOption_GetCurve(ArkUI_AnimateOption* option); @@ -238,8 +255,9 @@ ArkUI_AnimationCurve OH_ArkUI_AnimateOption_GetCurve(ArkUI_AnimateOption* option /** * @brief Obtains the animation delay, in milliseconds. * -* @param option Indicates the pointer to an animation configuration. -* @return Returns the animation delay. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **0** is returned. +* @return Delay of animation playback. If **option** is invalid, **0** is returned. * @since 12 */ int32_t OH_ArkUI_AnimateOption_GetDelay(ArkUI_AnimateOption* option); @@ -247,17 +265,19 @@ int32_t OH_ArkUI_AnimateOption_GetDelay(ArkUI_AnimateOption* option); /** * @brief Obtains the number of times that an animation is played. * -* @param option Indicates the pointer to an animation configuration. -* @return Returns the number of times that the animation is played. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **0** is returned. +* @return Number of times that the animation is played. If **option** is invalid, **0** is returned. * @since 12 */ int32_t OH_ArkUI_AnimateOption_GetIterations(ArkUI_AnimateOption* option); /** -* @brief Obtains the animation playback mode. +* @brief Obtains the playback mode of an animation. * -* @param option Indicates the pointer to an animation configuration. -* @return Returns the animation playback mode. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **-1** is returned. +* @return Animation playback mode. If **option** is invalid,**-1** is returned. * @since 12 */ ArkUI_AnimationPlayMode OH_ArkUI_AnimateOption_GetPlayMode(ArkUI_AnimateOption* option); @@ -265,44 +285,60 @@ ArkUI_AnimationPlayMode OH_ArkUI_AnimateOption_GetPlayMode(ArkUI_AnimateOption* /** * @brief Obtains the expected frame rate range of an animation. * -* @param option Indicates the pointer to an animation configuration. -* @return Returns the expected frame rate range. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **NULL** is returned. +* @return Expected frame rate range of the animation, in fps. If **option** is invalid, **NULL** is returned. * @since 12 */ ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimateOption_GetExpectedFrameRateRange(ArkUI_AnimateOption* option); /** -* @brief Sets the animation duration. +* @brief Sets the animation duration, in milliseconds. * -* @param option Indicates the pointer to an animation configuration. -* @param value Indicates the duration, in milliseconds. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation duration, in milliseconds. Value range: [0, +∞). +*
If the value is less than 0, **0** is used. * @since 12 */ void OH_ArkUI_AnimateOption_SetDuration(ArkUI_AnimateOption* option, int32_t value); /** -* @brief Sets the animation playback speed. +* @brief Sets the playback speed of an animation. * -* @param option Indicates the pointer to an animation configuration. -* @param value Indicates the animation playback speed. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation playback speed. Value range: [0, +∞). +*
**NOTE** +*
If the value is less than 0, the default value **1** is used. * @since 12 */ void OH_ArkUI_AnimateOption_SetTempo(ArkUI_AnimateOption* option, float value); /** -* @brief Sets the animation curve. +* @brief Animation curve. * -* @param option Indicates the pointer to an animation configuration. -* @param value Indicates the animated curve. Default value:ARKUI_CURVE_LINEAR. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use +* {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. +*
If the value is abnormal, the setting is invalid. * @since 12 */ void OH_ArkUI_AnimateOption_SetCurve(ArkUI_AnimateOption* option, ArkUI_AnimationCurve value); /** -* @brief Sets the animation delay. +* @brief Sets the animation delay, in milliseconds. * -* @param option Indicates the pointer to an animation configuration. -* @param value Indicates the animation delay. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation +* delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A +* value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute value +* of **value** is less than the actual animation duration, the animation starts its first frame from the state at +* the absolute value. If the absolute value of **value** is greater than or equal to the actual animation duration, +* the animation starts its first frame from the end state. The actual animation duration is equal to the duration +* of a single animation multiplied by the number of animation playback times. * @since 12 */ void OH_ArkUI_AnimateOption_SetDelay(ArkUI_AnimateOption* option, int32_t value); @@ -310,902 +346,990 @@ void OH_ArkUI_AnimateOption_SetDelay(ArkUI_AnimateOption* option, int32_t value) /** * @brief Sets the number of times that an animation is played. * -* @param option Indicates the pointer to an animation configuration. -* @param value Indicates the number of times that the animation is played. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, +* the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number +* of times. Default value: **1** (played once). +*
If the value is less than -1, the operation is invalid. * @since 12 */ void OH_ArkUI_AnimateOption_SetIterations(ArkUI_AnimateOption* option, int32_t value); /** -* @brief Sets the animation playback mode. +* @brief Sets the playback mode for an animation. * -* @param option Indicates the pointer to an animation configuration. -* @param value Indicates the animation playback mode. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation playback mode. Default value: {@link ARKUI_ANIMATION_PLAY_MODE_NORMAL}. +*
If the value is abnormal, the operation is invalid. * @since 12 */ void OH_ArkUI_AnimateOption_SetPlayMode(ArkUI_AnimateOption* option, ArkUI_AnimationPlayMode value); /** -* @brief Sets the expected frame rate range of an animation. +* @brief Defines a struct for the expected frame rate range of the animation. * -* @param option Indicates the pointer to an animation configuration. -* @param value Indicates the expected frame rate range. +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Expected frame rate range of the animation, in fps. +*
If **value** is set to **NULL**, the operation is invalid. * @since 12 */ void OH_ArkUI_AnimateOption_SetExpectedFrameRateRange(ArkUI_AnimateOption* option, ArkUI_ExpectedFrameRateRange* value); /** -* @brief Sets the animation curve for the animation of an animator. +* @brief Sets the animation curve for an animation. * * @note This method is better than the value set by OH_ArkUI_AnimateOption_SetCurve. -* @param option Indicates the animator parameters. -* @param value Indicates the animation curve settings. +* @param option Animator animation parameters. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation curve parameters. +*
If **value** is set to **NULL**, the operation is invalid. * @since 12 */ void OH_ArkUI_AnimateOption_SetICurve(ArkUI_AnimateOption* option, ArkUI_CurveHandle value); /** -* @brief Obtains the animation curve of the animation of an animator. +* @brief Obtains the animation curve of an animation. * -* @param option Indicates the animator parameters. -* @return Returns the animation curve of the specified animation. -* If Null is returned, it means option is an invalid value. +* @param option Animator animation parameters. +*
If **option** is set to **NULL**, **NULL** is returned. +* @return Animation curve parameters. Returns **NULL** if the option parameter is invalid. * @since 12 */ ArkUI_CurveHandle OH_ArkUI_AnimateOption_GetICurve(ArkUI_AnimateOption* option); /** - * @brief Obtains the keyframe animation parameters. - * - * @param size Indicates the number of keyframe animation states. - * @return Returns the keyframe animation parameter object; returns NULL if the value of size is less than - * 0. - * @since 12 - */ + * @brief Creates a keyframe animation parameter object. + * + * @param size Number of keyframe animation states. + *
Returns **NULL** if the value of **size** is less than 0. + * @return Keyframe animation parameter object. If the value of **size** is less than 0 or if **option** is abnormal, ** + * NULL** is returned. + * @since 12 + */ ArkUI_KeyframeAnimateOption* OH_ArkUI_KeyframeAnimateOption_Create(int32_t size); /** - * @brief Disposes of the keyframe animation parameter object. - * - * @param option Indicates the keyframe animation parameter object. - * @since 12 - */ + * @brief Disposes of a keyframe animation parameter object. + * + * @param option Keyframe animation parameter object. + *
If **option** is set to **NULL**, the operation is invalid. + * @since 12 + */ void OH_ArkUI_KeyframeAnimateOption_Dispose(ArkUI_KeyframeAnimateOption* option); /** - * @brief Sets the overall delay of a keyframe animation, in milliseconds. By default, the keyframe animation is played - * without delay. - * - * @param option Indicates the keyframe animation parameters. - * @param value Indicates the delay, in milliseconds. - * @return Returns the error 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 12 - */ + * @brief Sets the overall delay of a keyframe animation, in milliseconds. By default, the keyframe animation starts + * without any delay. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation + * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A + * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute + * value of **value** is less than the actual animation duration, the animation starts its first frame from the + * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation + * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the + * duration of a single animation multiplied by the number of animation playback times. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetDelay(ArkUI_KeyframeAnimateOption* option, int32_t value); /** - * @brief Sets the number of times that the keyframe animation is played. By default, the animation is played once. - * The value -1 indicates that the animation is played for an unlimited number of times. The value 0 - * indicates that there is no animation. - * - * @param option Indicates the keyframe animation parameters. - * @param value Indicates the number of times that the animation is played. - * @return Returns the error 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 12 - */ + * @brief Sets the number of times that the keyframe animation is played. By default, the animation is played once. The + * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that + * no animation is played. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, + * the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number + * of times. Default value: **1**, indicating that the animation is played once. + *
If the value is less than **-1**, the operation is invalid, and the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetIterations(ArkUI_KeyframeAnimateOption* option, int32_t value); /** - * @brief Sets the callback invoked when the keyframe animation playback is complete. This API is called after the - * keyframe animation has played for the specified number of times. - * - * @param option Indicates the keyframe animation parameters. - * @param userData Indicates the pointer to a custom object. - * @param onFinish Indicates the callback. - * @return Returns the error 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 12 - */ + * @brief Sets the callback invoked when the keyframe animation playback is complete. This function is called after the + * {@link keyframe animation} has played for the specified number of times. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param userData Pointer to a custom object. + *
Abnormal value processing is not involved. + * @param onFinish Indicates the callback. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback( ArkUI_KeyframeAnimateOption* option, void* userData, void (*onFinish)(void* userData)); /** - * @brief Sets the expected frame rate range of a keyframe animation. - * - * @param option Indicates the pointer to a keyframe animation configuration. - * @param frameRate Indicates the expected frame rate range. - * @return Returns the error 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 19 - */ + * @brief Sets the expected frame rate for a keyframe animation. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param frameRate Expected frame rate for the keyframe animation. + *
If **frameRate** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 19 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetExpectedFrameRate( ArkUI_KeyframeAnimateOption* option, ArkUI_ExpectedFrameRateRange* frameRate); /** - * @brief Sets the duration of a keyframe animation, in milliseconds. - * - * @param option Indicates the keyframe animation parameters. - * @param value Indicates the duration to set, in milliseconds. - * @param index Indicates a state index. - * @return Returns the error 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 12 - */ + * @brief Sets the duration of a keyframe animation, in milliseconds. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Keyframe animation duration, in ms. The default value is 1000 ms. Value range: [0, +∞). + *
If the value is less than 0, **0** is used. + * @param index Index of the keyframe state segment. + *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetDuration(ArkUI_KeyframeAnimateOption* option, int32_t value, int32_t index); /** - * @brief Sets the animation curve for a specific keyframe in a keyframe animation. - * - * @note Because the springMotion, responsiveSpringMotion, and interpolatingSpring curves do not - * have effective duration settings, they are not supported. - * @param option Indicates the keyframe animation parameters. - * @param value Indicates the animation curve to set. Default value:EASE_IN_OUT. - * @param index Indicates a state index. - * @return Returns the error 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 12 - */ + * @brief Sets the animation curve for a specific keyframe animation segment. + * + * @note Because the springMotion, responsiveSpringMotion, and interpolatingSpring curves do not + * have effective duration settings, they are not supported. + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation curve to set. Default value: {@link ARKUI_CURVE_EASE_IN_OUT}. + * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of + * keyframe animation states. + *
If the value of **index** is less than 0 or out of range, the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetCurve( ArkUI_KeyframeAnimateOption* option, ArkUI_CurveHandle value, int32_t index); /** - * @brief Sets the closure function of the state at the time of the keyframe, that is, the state to be reached at the - * time of the keyframe. - * - * @param option Indicates the keyframe animation parameters. - * @param event Indicates a closure function. - * @param userData Indicates the pointer to a custom object. - * @param index Indicates a state index. - * @return Returns the error 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 12 - */ + * @brief Sets the closure function of the state at the time of the keyframe, that is, the state to be reached at the + * time of the keyframe. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param event Indicates a closure function. + * @param userData Pointer to a user-defined object. + *
Abnormal value processing is not involved. + * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of + * keyframe animation states. + *
If the value of **index** is less than 0 or out of range, the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnEventCallback( ArkUI_KeyframeAnimateOption* option, void* userData, void (*event)(void* userData), int32_t index); /** - * @brief Obtains the overall delay of a keyframe animation - * - * @param option Indicates the keyframe animation parameters. - * @return Returns the overall delay. - * @since 12 - */ + * @brief Obtains the overall delay of a keyframe animation, in milliseconds. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @return Overall delay, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_GetDelay(ArkUI_KeyframeAnimateOption* option); /** - * @brief Obtains the number of times that a keyframe animation is played. - * - * @param option Indicates the keyframe animation parameters. - * @return Returns the number of times that the animation is played. - * @since 12 - */ + * @brief Obtains the number of times that a keyframe animation is played. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_GetIterations(ArkUI_KeyframeAnimateOption* option); /** - * @brief Obtains the expected frame rate range of a keyframe animation configuration. - * - * @param option Indicates the pointer to a keyframe animation configuration. - * @return Returns the expected frame rate range of the keyframe animation. - * @since 19 - */ + * @brief Obtains the expected frame rate from keyframe animation parameters. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **NULL** is returned. + * @return Returns the expected frame rate obtained. If **option** is invalid, **NULL** is returned. + * @since 19 + */ ArkUI_ExpectedFrameRateRange* OH_ArkUI_KeyframeAnimateOption_GetExpectedFrameRate(ArkUI_KeyframeAnimateOption* option); /** - * @brief Obtains the duration of a specific state in a keyframe animation. - * - * @param option Indicates the keyframe animation parameters. - * @param index Indicates a state index. - * @return Returns the duration. The unit is millisecond. - * @since 12 - */ + * @brief Obtains the duration of a specific state in a keyframe animation, in milliseconds. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @param index Index of the keyframe state segment. + *
If the value of **index** is less than 0, **0** is returned. + * @return Duration, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_GetDuration(ArkUI_KeyframeAnimateOption* option, int32_t index); /** - * @brief Obtains the animation curve of a specific state in a keyframe animation. - * - * @param option Indicates the keyframe animation parameters. - * @param index Indicates a state index. - * @return Returns the animated curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Obtains the animation curve of a specific state in a keyframe animation. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **NULL** is returned. + * @param index Index of the keyframe state segment. + *
If the value of **index** is less than 0, **NULL** is returned. + * @return Animation curve. If the parameter is abnormal, **NULL** is returned. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_KeyframeAnimateOption_GetCurve(ArkUI_KeyframeAnimateOption* option, int32_t index); /** - * @brief Creates an animator parameter object. - * - * @note When keyframeSize is greater than 0, the animation interpolation start point is 0, and the animation - * interpolation end point is 1; no setting is allowed. - * @param keyframeSize Indicates the number of keyframes. - * @return Returns the pointer to the animator parameter object. - * returns NULL if the value of size is less than 0. - * @since 12 - */ + * @brief Creates an **AnimatorOption** object. + * + * @note When keyframeSize is greater than 0, the animation interpolation start point is 0, and the animation + * interpolation end point is 1; no setting is allowed. + * @param keyframeSize Number of keyframes. + *
If the value of **keyframeSize** is less than 0, **NULL** is returned. + * @return Pointer to the animator parameter object. If the value of **size** is less than 0 or if **option** is + * abnormal, **NULL** is returned. + * @since 12 + */ ArkUI_AnimatorOption* OH_ArkUI_AnimatorOption_Create(int32_t keyframeSize); /** - * @brief Disposes of an animator parameter object. - * - * @param option Indicates the target animator parameter object. - * @since 12 - */ + * @brief Disposes of an **AnimatorOption** object. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the operation is invalid. + * @since 12 + */ void OH_ArkUI_AnimatorOption_Dispose(ArkUI_AnimatorOption* option); /** - * @brief Sets the duration for the animation of an animator, in milliseconds. - * - * @param option Indicates the target animator parameter object. - * @param value Indicates the playback duration, in milliseconds. - * @return Returns the error 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 12 - */ + * @brief Sets the duration of an animator animation, in milliseconds. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Playback duration, in ms. The default value is 0 ms. Value range: [0, +∞). + *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetDuration(ArkUI_AnimatorOption* option, int32_t value); /** - * @brief Sets the delay for playing the animation of an animator, in milliseconds. - * - * @param option Indicates an animator parameter object. - * @param value Indicates the delay to set, in milliseconds. - * @return Returns the error 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 12 - */ + * @brief Sets the delay time of the animator playback, in milliseconds. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation + * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A + * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute + * value of **value** is less than the actual animation duration, the animation starts its first frame from the + * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation + * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the + * duration of a single animation multiplied by the number of animation playback times. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetDelay(ArkUI_AnimatorOption* option, int32_t value); /** - * @brief Sets the number of times that the animation of an animator is played. The value 0 means not to play the - * animation, and -1 means to play the animation for an unlimited number of times. - * - * @note If this parameter is set to a negative value other than -1, the value is invalid. In this case, the - * animation is played once. - * @param option Indicates an animator parameter object. - * @param value Indicates the number of times that the animation is played. - * @return Returns the error 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 12 - */ + * @brief Sets the number of times that an animator animation is played. By default, the animation is played once. The + * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that + * no animation is played. + * + * @note If this parameter is set to a negative value other than -1, the value is invalid. In this case, the + * animation is played once. + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Value range: [-1, +∞). If this parameter is set to **0**, the animation is not played. If this + * parameter is set to **-1**, the animation is played for an infinite number of times. Default value: **1** ( + * played once). + *
If the value is less than -1, the operation is invalid. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetIterations(ArkUI_AnimatorOption* option, int32_t value); /** - * @brief Sets whether the animation of an animator is restored to the initial state after being executed. - * - * @param option Indicates an animator parameter object. - * @param value Indicates whether to restore the animation to the initial state after the animation is executed. - * @return Returns the error 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 12 - */ + * @brief Sets the status of the component before and after the animator animation execution. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Status of the component before and after the animator animation execution. Default value: + * {@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}. + *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetFill(ArkUI_AnimatorOption* option, ArkUI_AnimationFillMode value); /** - * @brief Sets the playback direction for the animation of an animator. - * - * @param option Indicates an animator parameter object. - * @param value Indicates the animation playback direction. - * @return Returns the error 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 12 - */ + * @brief Set the playback direction. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation playback direction. + *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetDirection(ArkUI_AnimatorOption* option, ArkUI_AnimationDirection value); /** - * @brief Sets the interpolation curve for the animation of an animator. - * - * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, - * and customCurve curves are not supported. - * - * @param option Indicates an animator parameter object. - * @param value Indicates the target interpolation curve. Default value:ARKUI_CURVE_LINEAR. - * @return Returns the error 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 12 - */ + * @brief Sets the interpolation curve for the animation of an animator. + * + * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, + * and customCurve curves are not supported. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use + * {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. + *
If **value** is set to **NULL**, the default curve {@link ARKUI_CURVE_LINEAR} is used. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value); /** - * @brief Sets the interpolation start point for the animation of an animator. - * @note This API does not take effect when the animation is a keyframe animation. - * - * @param option Indicates an animator parameter object. - * @param value Indicates the interpolation start point to set. - * @return Returns the error 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 12 - */ + * @brief Sets the interpolation start point of an animation. + * + * @note This API does not take effect when the animation is a keyframe animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation start point of the animation. Value range: (-∞, +∞). + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetBegin(ArkUI_AnimatorOption* option, float value); /** - * @brief Sets the interpolation end point for the animation of an animator. - * @note This API does not take effect when the animation is a keyframe animation. - * - * @param option Indicates an animator parameter object. - * @param value Indicates the interpolation end point to set. - * @return Returns the error 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 12 - */ + * @brief Sets the interpolation end point for the animation of an animator. + * + * @note This API does not take effect when the animation is a keyframe animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation end point of the animation. Value range: (-∞, +∞). + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetEnd(ArkUI_AnimatorOption* option, float value); /** - * @brief Sets the expected frame rate range for the animation of an animator. - * - * @param option Indicates an animator parameter object. - * @param value Indicates the expected frame rate range to set. - * @return Returns the error 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 12 - */ + * @brief Sets the expected frame rate range of an animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Expected frame rate range. + *
If **value** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange( ArkUI_AnimatorOption* option, ArkUI_ExpectedFrameRateRange* value); /** - * @brief Sets the keyframe parameters for the animation of an animator. - * - * @param option Indicates an animator parameter object. - * @param time Indicates the keyframe time. Value range: [0,1]. - * @param value Indicates the keyframe value. - * @param index Indicates the keyframe index. - * @return Returns the error 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 12 - */ + * @brief Sets the keyframe parameters of an animator animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param time Keyframe time. Value range: [0, 1]. The value must be in ascending order. Default value: evenly + * distributed by index (for example, **0.0** for the first frame, **0.5** for the second frame, and **1.0** for + * the third frame). + *
If the value of **time** is less than 0 or greater than 1, the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Keyframe value. Value range: (-∞, +∞). + * @param index Keyframe index. + *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetKeyframe( ArkUI_AnimatorOption* option, float time, float value, int32_t index); /** - * @brief Sets the keyframe curve type for the animation of an animator. - * - * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, - * and customCurve curves are not supported. - * - * @param option Indicates an animator parameter object. - * @param value Indicates the target interpolation curve. - * @param index Indicates the keyframe index. - * @return Returns the error 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 12 - */ + * @brief Sets the keyframe curve type for the animation of an animator. + * + * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, + * and customCurve curves are not supported. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation curve. Default value: **NULL**, indicating linear interpolation. + * @param index Keyframe index. + *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetKeyframeCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value, int32_t index); /** - * @brief Obtains the duration for playing an animation. - * - * @param option Indicates the animator parameters. - * @return Returns the duration for playing the animation, in milliseconds. - * @since 12 - */ + * @brief Obtains the duration for playing an animation. + * + * @param option Animator animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @return Duration for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_GetDuration(ArkUI_AnimatorOption* option); /** - * @brief Obtains the delay for playing the animation of an animator. - * - * @param option Indicates the animator parameters. - * @return Returns the delay for playing the animation, in milliseconds. - * @since 12 - */ + * @brief Obtains the delay for playing an animation. + * + * @param option Animator animation parameters. If **option** is set to **NULL**, **0** is returned. + * @return Delay for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_GetDelay(ArkUI_AnimatorOption* option); /** - * @brief Obtains the number of times that an animation is played. - * - * @param option Animator animation parameter. - * @return Returns the number of times that the animation is played. - * @since 12 - */ + * @brief Obtains the number of times that an animator animation is played. + * + * @param option Animator parameters. If **option** is set to **NULL**, **0** is returned. + * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_GetIterations(ArkUI_AnimatorOption* option); /** - * @brief Obtains whether the animator animation is restored to the initial state after being executed. - * - * @param option Indicates the animator parameters. - * @return Returns whether the animator animation is restored to the initial state after being executed. - * @since 12 - */ + * @brief Obtains the status of the component before and after the animator animation execution. + * + * @param option Animator animation parameters. + * @return Status of the component before and after the animator animation execution. If **option** is invalid,**-1** + * is returned. + * @since 12 + */ ArkUI_AnimationFillMode OH_ArkUI_AnimatorOption_GetFill(ArkUI_AnimatorOption* option); /** - * @brief Obtains the playback direction of an animation. - * - * @param option Indicates the animator parameters. - * @return Returns the animation playback direction. - * @since 12 - */ + * @brief Obtains the playback direction of an animator animation. + * + * @param option Animator animation parameters. + * @return Animation playback direction. If **option** is invalid,**-1** is returned. + * @since 12 + */ ArkUI_AnimationDirection OH_ArkUI_AnimatorOption_GetDirection(ArkUI_AnimatorOption* option); /** - * @brief Obtains the interpolation curve of the animation of an animator. - * - * @param option Indicates the animator parameters. - * @return Returns the interpolation curve of the animation. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Obtains the interpolation curve of the animation of an animator. + * + * @param option Animator animation parameters. + * @return Interpolation curve. If **option** is invalid, **NULL** is returned. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetCurve(ArkUI_AnimatorOption* option); /** - * @brief Obtains the interpolation start point of an animation. - * - * @param option Indicates the animator parameters. - * @return Returns the interpolation start point of the animation. - * @since 12 - */ + * @brief Obtains the interpolation start point of an animation. + * + * @param option Animator animation parameters. + * @return Interpolation start point of the animation. If **option** is invalid, **0.0** is returned. + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetBegin(ArkUI_AnimatorOption* option); /** - * @brief Obtains the interpolation end point of an animation. - * - * @param option Indicates the animator parameters. - * @return Returns the interpolation end point of the animation. - * @since 12 - */ + * @brief Obtains the interpolation end point of an animation. + * + * @param option Animator animation parameters. + * @return Interpolation end point of the animation. If **option** is invalid, **0.0** is returned. + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetEnd(ArkUI_AnimatorOption* option); /** - * @brief Obtains the expected frame rate range of an animation. - * - * @param option Indicates the animator parameters. - * @return Returns the pointer to the expected frame rate range object. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Obtains the expected frame rate range of an animator animation. + * + * @param option Animator animation parameters. + * @return Pointer to the expected frame rate range object. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimatorOption_GetExpectedFrameRateRange(ArkUI_AnimatorOption* option); /** - * @brief Obtains the keyframe time of an animation. - * - * @param option Indicates an animator parameter object. - * @param index Indicates the keyframe index. - * @return Returns the keyframe time. - * @since 12 - */ + * @brief Obtains the keyframe time of the animator playback, in milliseconds. + * + * @param option Animator parameters. + * @param index Keyframe index. + * @return Keyframe time, in milliseconds. + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetKeyframeTime(ArkUI_AnimatorOption* option, int32_t index); /** - * @brief Obtains the keyframe value of an animation. - * - * @param option Indicates an animator parameter object. - * @param index Indicates the keyframe index. - * @return Returns the keyframe value. - * @since 12 - */ + * @brief Obtains the keyframe value of an animation. + * + * @param option Animator parameters. + * @param index Keyframe index. + * @return Keyframe value. + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetKeyframeValue(ArkUI_AnimatorOption* option, int32_t index); /** - * @brief Obtains the interpolation curve for a keyframe in the animation of an animator. - * - * @param option Indicates an animator parameter object. - * @param index Indicates the keyframe index. - * @return Returns the interpolation curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Obtains the interpolation curve for a keyframe in the animation of an animator. + * + * @param option Animator parameters. + * @param index Keyframe index. + * @return Interpolation curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetKeyframeCurve(ArkUI_AnimatorOption* option, int32_t index); /** - * @brief Obtains the custom object in an animation event object. - * - * @param event Indicates an animation event object. - * @return Returns the custom object. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Obtains the user-defined object in an animation event object. + * + * @param event Animation event object. + * @return User-defined object. + * @since 12 + */ void* OH_ArkUI_AnimatorEvent_GetUserData(ArkUI_AnimatorEvent* event); /** - * @brief Obtains the custom object in an animation event object. - * - * @param event Indicates an animation event object. - * @return Returns the custom object. - * @since 12 - */ + * @brief Obtains the user-defined object in the frame event of an animation. + * + * @param event Animation event object. + * @return User-defined object. + * @since 12 + */ void* OH_ArkUI_AnimatorOnFrameEvent_GetUserData(ArkUI_AnimatorOnFrameEvent* event); /** - * @brief Obtains the current progress in an animation event object. - * - * @param event Indicates an animation event object. - * @return Returns the animation progress. - * @since 12 - */ + * @brief Obtains the interpolation result in the animation frame callback event object. + * + * @param event Animation event object. + * @return Animation interpolation result. + *
**NOTE** + *
During the animation, the interpolation result changes between the interpolation start point + * {@link OH_ArkUI_AnimatorOption_SetBegin} and the interpolation end point {@link OH_ArkUI_AnimatorOption_SetEnd} + * based on the animation parameters. + * @since 12 + */ float OH_ArkUI_AnimatorOnFrameEvent_GetValue(ArkUI_AnimatorOnFrameEvent* event); /** - * @brief Sets the callback invoked when the animator receives a frame. - * - * @param option Indicates an animator parameter object. - * @param userData Indicates the custom parameter. - * @param callback Indicates the callback to set. - * @return Returns the error 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 12 - */ + * @brief Sets the callback invoked when the animator receives a frame. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnFrameCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorOnFrameEvent* event)); /** - * @brief Sets the callback invoked when the animation playback is complete. - * - * @param option Indicates an animator parameter object. - * @param userData Indicates the custom parameter. - * @param callback Indicates the callback to set. - * @return Returns the error 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 12 - */ + * @brief Sets the callback invoked when the animation playback is complete. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnFinishCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); /** - * @brief Sets the callback invoked when the animation playback is canceled. - * - * @param option Indicates an animator parameter object. - * @param userData Indicates the custom parameter. - * @param callback Indicates the callback to set. - * @return Returns the error 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 12 - */ + * @brief Sets the callback invoked when the animation playback is canceled. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnCancelCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); /** - * @brief Sets the callback invoked when the animation playback is repeated. - * - * @param option Indicates an animator parameter object. - * @param userData Indicates the custom parameter. - * @param callback Indicates the callback to set. - * @return Returns the error 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 12 - */ + * @brief Sets the callback invoked when the animation playback is repeated. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); /** - * @brief Resets the animation of an animator. - * - * @param animatorHandle Indicates an animator object. - * @param option Indicates the animator parameters. - * @return Returns the error 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 12 - */ + * @brief Resets the animation of an animator. + * + * @param animatorHandle Animator object. + * @param option Animator animation parameters. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_ResetAnimatorOption( ArkUI_AnimatorHandle animatorHandle, ArkUI_AnimatorOption* option); /** - * @brief Starts the animation of an animator. - * - * @param animatorHandle Indicates an animator object. - * @return Returns the error 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 12 - */ + * @brief Starts the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Play(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Ends the animation of an animator. - * - * @param animatorHandle Indicates an animator object. - * @return Returns the error 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 12 - */ + * @brief Ends the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Finish(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Pauses the animation of an animator. - * - * @param animatorHandle Indicates an animator object. - * @return Returns the error 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 12 - */ + * @brief Pauses the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Pause(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Cancels the animation of an animator. - * - * @param animatorHandle Indicates an animator object. - * @return Returns the error 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 12 - */ + * @brief Cancels the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Cancel(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Plays the animation of an animator in reverse order. - * - * @param animatorHandle Indicates an animator object. - * @return Returns the error 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 12 - */ + * @brief Plays this animation in reverse order. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Reverse(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Implements initialization for the interpolation curve, which is used to create an interpolation curve based on - * the input parameter. - * - * @param curve Indicates the curve type. - * @return Returns the pointer to the interpolation object of the curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Implements initialization for the interpolation curve, which is used to create an interpolation curve based + * on the input parameter. + * + * @param curve Curve type. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType(ArkUI_AnimationCurve curve); /** - * @brief Creates a step curve. - * - * @param count Indicates the number of steps. The value must be a positive integer. Value range: [1, +∞). - * @param end Indicates whether jumping occurs when the interpolation ends. - * true: Jumping occurs when the interpolation ends. false: Jumping occurs when the interpolation starts. - * @return Returns the pointer to the interpolation object of the curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a step curve. + * + * @param count Number of steps. The value must be a positive integer. Value range: [1, +∞). + *
If the value of **count** is abnormal, the operation is invalid. + * @param end Whether the step change occurs at the start or end of each interval. **true**: The step change occurs at + * the end of each interval. **false**: The step change occurs at the start of each interval. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve(int32_t count, bool end); /** - * @brief Creates a cubic Bezier curve. - * - * - * @param x1 Indicates the X coordinate of the first point on the Bezier curve. Value range: [0, 1]. - * A value less than 0 is handed as 0. A value greater than 1 is handed as 1. - * @param y1 Indicates the Y coordinate of the first point on the Bezier curve. - * @param x2 Indicates the X coordinate of the second point on the Bezier curve. Value range: [0, 1]. - * A value less than 0 is handed as 0. A value greater than 1 is handed as 1. - * @param y2 Indicates the Y coordinate of the second point on the Bezier curve. - * @return Returns the pointer to the interpolation object of the curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a cubic Bezier curve. + * + * @param x1 X-coordinate of the first point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated + * as **0**. A value greater than 1 is treated as **1**. + * @param y1 Y-coordinate of the first point on the Bezier curve. + * @param x2 X-coordinate of the second point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated + * as **0**. A value greater than 1 is treated as **1**. + * @param y2 Y-coordinate of the second point on the Bezier curve. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve(float x1, float y1, float x2, float y2); /** - * @brief Creates a spring curve. The curve shape is subject to the spring parameters, and the animation duration is - * subject to the duration parameter in animation and animateTo. - * - * @param velocity Indicates the initial velocity of the spring. It is applied by external factors to the spring - * animation, designed to help ensure the smooth transition from the previous motion state. The velocity is the - * normalized velocity, and its value is equal to the actual velocity at the beginning of the animation divided by the - * animation attribute change value. - * @param mass Indicates the mass, which influences the inertia in the spring system. The greater the mass, the greater - * the amplitude of the oscillation, and the slower the speed of restoring to the equilibrium position. - * @param stiffness Indicates the stiffness. It is the degree to which an object deforms by resisting the force applied. - * In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the - * speed of restoring to the equilibrium position. - * @param damping Indicates the damping. It is used to describe the oscillation and attenuation of the system after - * being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller - * the oscillation amplitude. - * @return Returns the pointer to the interpolation object of the curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a spring curve. The curve shape is determined by the spring parameters, and the animation duration is + * controlled by the **duration** parameter in {@link animation} and {@link animateTo}. + * + * @param velocity Initial velocity. It is applied by external factors to the spring animation, designed to help + * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its + * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute + * change value. + * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of + * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the + * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. In an + * elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the + * speed of restoring to the equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. + * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the + * oscillation amplitude. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve(float velocity, float mass, float stiffness, float damping); /** - * @brief Creates a spring animation curve. If multiple spring animations are applied to the same attribute of an - * object, each animation replaces their predecessor and inherits the velocity. - * @note The animation duration is subject to the curve parameters, rather than the duration parameter in - * animation or animateTo. - * - * @param response Indicates the duration of one complete oscillation. - * @param dampingFraction Indicates the damping coefficient. - * > 0 and < 1: underdamped. In this case, the spring overshoots the equilibrium position. - * 1: critically damped. - * > 1: overdamped. In this case, the spring approaches equilibrium gradually. - * @param overlapDuration Indicates the duration for animations to overlap. When animations overlap, the response - * values of these animations will - * transit smoothly over this duration if they are different. - * @return Returns the pointer to the interpolation object of the curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a spring animation curve. If multiple spring animations are applied to the same attribute of an + * object, each animation replaces their predecessor and inherits the velocity. + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * @param response Duration of one complete oscillation. Value range: (0, +∞). + *
If the value is less than or equal to 0, **0.55** is used. + * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the + * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium + * gradually. Value range: (0, +∞). + *
If the value is less than or equal to 0, **0.825** is used. + * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** + * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). + *
If the value is less than 0, **0** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion(float response, float dampingFraction, float overlapDuration); /** - * @brief Creates a responsive spring animation curve. It is a special case of springMotion, with the only - * difference in the default values. It can be used together with springMotion. - * @note The animation duration is subject to the curve parameters, rather than the duration parameter in - * animation or animateTo. - * - * @param response Indicates the duration of one complete oscillation. - * @param dampingFraction Indicates the damping coefficient. - * > 0 and < 1: underdamped. In this case, the spring overshoots the equilibrium position. - * 1: critically damped. - * > 1: overdamped. In this case, the spring approaches equilibrium gradually. - * @param overlapDuration Indicates the duration for animations to overlap. When animations overlap, the - * response values of these animations will - * transit smoothly over this duration if they are different. - * @return Returns the pointer to the interpolation object of the curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a responsive spring animation curve. It is a special case of **springMotion**, with the only + * difference in the default values. It can be used together with **springMotion**. + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * @param response Duration of one complete oscillation. Value range: (0, +∞). + *
If the value is less than or equal to 0, **0.15** is used. + * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the + * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium + * gradually. Value range: [0, +∞). + *
If the value is less than 0, **0.86** is used. + * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** + * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). + *
If the value is less than 0, **0.25** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion( float response, float dampingFraction, float overlapDuration); /** - * @brief Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based on - * the curve. - * @note The animation duration is subject to the curve parameters, rather than the duration parameter in - * animation or animateTo. - * - * - * @param velocity Indicates the initial velocity of the spring. It is applied by external factors to the spring - * animation, esigned to help ensure the smooth transition from the previous motion state. The velocity is the - * normalized velocity, and its value is equal to the actual velocity - * at the beginning of the animation divided by the animation attribute change value. - * @param mass Indicates the mass, which influences the inertia in the spring system. - * The greater the mass, the greater the amplitude of the oscillation, and the slower the speed of restoring to the - * equilibrium position. - * @param stiffness Indicates the stiffness. It is the degree to which an object deforms by resisting the force applied. - * In an elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the - * speed of restoring to the equilibrium position. - * @param damping Indicates the damping. It is used to describe the oscillation and attenuation of the system after - * being disturbed. The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller - * the oscillation amplitude. - * @return Returns the pointer to the interpolation object of the curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based on + * the curve. + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * + * @param velocity Initial velocity. It is applied by external factors to the spring animation, designed to help + * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its + * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute + * change value. + * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of + * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the + * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. The greater + * the stiffness, the stronger the ability to resist deformation, and the faster the speed of restoring to the + * equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. + * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the + * oscillation amplitude. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring(float velocity, float mass, float stiffness, float damping); /** - * @brief Creates a custom curve. - * - * @param userData Indicates the custom data. - * @param interpolate Indicates the custom interpolation callback. fraction indicates the input x value for - * interpolation when the animation starts; value range: [0,1]. - * The return value is the y value of the curve; value range: [0,1]. - * If fraction is 0, the return value 0 corresponds to the animation start point; any other return - * value means that the animation jumps at the start point. - * If fraction is 1, the return value 1 corresponds to the animation end point; any other return - * value means that the end value of the animation is not the value of the state variable, - * which will result in an effect of transition from that end value to the value of the state variable. - * @return Returns the pointer to the interpolation object of the curve. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a custom curve. + * + * @param userData Pointer to user-defined data. + * @param interpolate Indicates the custom interpolation callback. fraction indicates the input x value for + * interpolation when the animation starts; value range: [0,1]. + * The return value is the y value of the curve; value range: [0,1]. + * If fraction is 0, the return value 0 corresponds to the animation start point; any other + * return + * value means that the animation jumps at the start point. + * If fraction is 1, the return value 1 corresponds to the animation end point; any other + * return + * value means that the end value of the animation is not the value of the state variable, + * which will result in an effect of transition from that end value to the value of the state variable. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve( void* userData, float (*interpolate)(float fraction, void* userdata)); /** - * @brief Disposes of a custom curve. - * - * @param curveHandle Indicates the pointer to the interpolation object of the curve. - * @since 12 - */ + * @brief Disposes of a custom curve. + * + * @param curveHandle Pointer to the interpolation object of the curve. + * @since 12 + */ void OH_ArkUI_Curve_DisposeCurve(ArkUI_CurveHandle curveHandle); /** - * @brief Creates an opacity object for component transition. - * - * @note If the value specified is less than 0, the value 0 is used. If the value specified is greater than 1, - * the value 1 is used. - * @param opacity Indicates the opacity. Value range: [0, 1]. - * @return Returns the created opacity object for component transition. - * @since 12 - */ + * @brief Creates an opacity effect object for component transitions. + * + * @note If the value specified is less than 0, the value 0 is used. If the value specified is greater than 1, + * the value 1 is used. + * @param opacity Opacity. Value range: [0, 1]. The default value is **1**. A value less than 0 is treated as 0. A + * value greater than 1 is treated as 1. The value **1** means fully opaque, and **0** means fully transparent. + * @return Opacity effect object for component transitions. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateOpacityTransitionEffect(float opacity); /** - * @brief Creates a translation object for component transition. - * - * @param translate Indicates the translation settings for component transition. - * @return Returns the translation object created for component transition. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a translation effect object for component transitions. + * + * @param translate Translation parameter object for component transitions. + * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateTranslationTransitionEffect(ArkUI_TranslationOptions* translate); /** - * @brief Creates a scaling object for component transition. - * - * @param scale Indicates the scaling settings for component transition. - * @return Returns the scaling object created for component transition. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a scaling effect object for component transitions. + * + * @param scale Scaling parameter object for component transitions. + * @return Scaling effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateScaleTransitionEffect(ArkUI_ScaleOptions* scale); /** - * @brief Creates a rotation object for component transition. - * - * @param rotate Indicates the rotation settings for component transition. - * @return Returns the rotation object created for component transition. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a rotation effect object for component transition. + * + * @param rotate Rotation parameter object for component transitions. + * @return Rotation effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateRotationTransitionEffect(ArkUI_RotationOptions* rotate); /** - * @brief Creates a movement object for component transition. - * - * @param edge Indicates the movement type. - * @return Returns the movement object created for component transition. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates a movement transition effect object for the component. + * + * @param edge Movement transition type. + * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateMovementTransitionEffect(ArkUI_TransitionEdge edge); /** - * @brief Creates an asymmetric transition effect. - * - * @note If the asymmetric function is not used for TransitionEffect, the transition effect takes effect - * for both appearance and disappearance of the component. - * @param appear Indicates the transition effect for appearance. - * @param disappear Indicates the transition effect for disappearance. - * @return Returns the asymmetric transition effect. - * Returns NULL if a parameter error occurs. - * @since 12 - */ + * @brief Creates an asymmetric transition effect. + * + * @note If the asymmetric function is not used for TransitionEffect, the transition effect takes effect + * for both appearance and disappearance of the component. + * @param appear Transition effect for appearance. + * @param disappear Transition effect for disappearance. + * @return Asymmetric transition effect. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateAsymmetricTransitionEffect( ArkUI_TransitionEffect* appear, ArkUI_TransitionEffect* disappear); /** - * @brief Disposes of a transition effect. - * - * @param effect Indicates the transition effect to dispose of. - * @since 12 - */ + * @brief Disposes of a transition effect. + * + * @param effect Pointer to the transition effect to be disposed. + * @since 12 + */ void OH_ArkUI_TransitionEffect_Dispose(ArkUI_TransitionEffect* effect); /** - * @brief Sets a combination of transition effects. - * - * @param firstEffect Indicates the transition effect options. - * @param secondEffect Indicates the combination of transition effects. - * @return Returns the error 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 12 - */ + * @brief Sets a combination of transition effects. + * + * @param firstEffect Transition effect. + * @param secondEffect Combination of transition effects. + * @return 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 12 + */ int32_t OH_ArkUI_TransitionEffect_Combine( ArkUI_TransitionEffect* firstEffect, ArkUI_TransitionEffect* secondEffect); /** - * @brief Sets transition effect animation settings. - * - * @note If combine is used for combining transition effects, the animation settings of a transition effect are - * applicable to the one following it. - * @param effect Indicates the transition effect options. - * @param animation Indicates the animation settings. - * @return Returns the error 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 12 - */ + * @brief Sets transition effect animation settings. + * + * @note If combine is used for combining transition effects, the animation settings of a transition effect are + * applicable to the one following it. + * @param effect Transition effect. + * @param animation Animation settings. + * @return 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 12 + */ int32_t OH_ArkUI_TransitionEffect_SetAnimation( ArkUI_TransitionEffect* effect, ArkUI_AnimateOption* animation); #ifdef __cplusplus From 5dfe34d746cb9dc64c9b6ac9b87212f2e4d59e3b Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 16:19:05 +0800 Subject: [PATCH 19/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] Change-Id: I8f12d862358bc65f466c84816a42673841d8fe30 --- .../arkui/ace_engine/native/native_animate.h | 1340 +++++++++++++++++ 1 file changed, 1340 insertions(+) create mode 100644 zh-cn/arkui/ace_engine/native/native_animate.h diff --git a/zh-cn/arkui/ace_engine/native/native_animate.h b/zh-cn/arkui/ace_engine/native/native_animate.h new file mode 100644 index 000000000..96f6805ee --- /dev/null +++ b/zh-cn/arkui/ace_engine/native/native_animate.h @@ -0,0 +1,1340 @@ +/* + * Copyright (c) 2024 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 animation callbacks of ArkUI on the native side. + * + * @since 12 + */ + +/** + * @file native_animate.h + * + * @brief Defines a set of animation APIs of ArkUI on the native side. The APIs in **native_animate.h** must be called + * in the main thread. + * + * @library libace_ndk.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @kit ArkUI + * @since 12 + */ + +#ifndef ARKUI_NATIVE_ANIMATE_H +#define ARKUI_NATIVE_ANIMATE_H + +#ifdef __cplusplus +#include +#else +#include +#endif + +#include "native_type.h" + +#ifdef __cplusplus +extern "C" { +#endif + +/** +* @brief Defines the expected frame rate range of the animation. +* +* @since 12 +*/ +typedef struct { + /** + * Expected minimum frame rate, in fps. + */ + uint32_t min; + /** + * Expected maximum frame rate, in fps. + */ + uint32_t max; + /** + * Expected optimal frame rate, in fps. + */ + uint32_t expected; +} ArkUI_ExpectedFrameRateRange; + +/** +* @brief Defines the callback type for when the animation playback is complete. +* +* @since 12 +*/ +typedef struct { + /** + * Callback type for when the animation playback is complete. + */ + ArkUI_FinishCallbackType type; + /** + * Invoked when the animation playback is complete. + */ + void (*callback)(void* userData); + /** + * Custom data passed upon animation end callback. + */ + void* userData; +} ArkUI_AnimateCompleteCallback; + +/** +* @brief Defines the animation configuration. +* +* @since 12 +*/ +typedef struct ArkUI_AnimateOption ArkUI_AnimateOption; + +/** +* @brief Defines an interpolation curve. +* +* @since 12 +*/ +typedef struct ArkUI_Curve ArkUI_Curve; + +/** + * @brief Defines the pointer to an interpolation curve. + * + * @since 12 + */ +typedef struct ArkUI_Curve* ArkUI_CurveHandle; + +/** + * @brief Defines the keyframe animation parameter object. + * + * @since 12 + */ +typedef struct ArkUI_KeyframeAnimateOption ArkUI_KeyframeAnimateOption; + +/** + * @brief Defines the animator parameter object. + * + * @since 12 + */ +typedef struct ArkUI_AnimatorOption ArkUI_AnimatorOption; + +/** + * @brief Defines the pointer to an animator object. + * + * @since 12 + */ +typedef struct ArkUI_Animator* ArkUI_AnimatorHandle; + +/** +* @brief Defines the animator callback event object. +* +* @since 12 +*/ +typedef struct ArkUI_AnimatorEvent ArkUI_AnimatorEvent; + +/** +* @brief Defines the callback object when the animator receives a frame. +* +* @since 12 +*/ +typedef struct ArkUI_AnimatorOnFrameEvent ArkUI_AnimatorOnFrameEvent; + +/** + * @brief Defines the transition parameter object for transition property configuration. + * + * @since 12 + */ +typedef struct ArkUI_TransitionEffect ArkUI_TransitionEffect; + +/** + * @brief Declares the native animation APIs provided by ArkUI. + * + * @version 1 + * @since 12 + */ +typedef struct { + /** + * @brief Defines an explicit animation. + * + * @note Make sure the component attributes to be set in the event closure have been set before. + * + * @param context **UIContext** instance. + * @param option Defines the animation configuration. + * @param update Closure function for the animation. The system automatically inserts the transition animation if + * the state changes in the closure function. + *
Note: Make sure the component attributes to be set in the closure function have been set before. + * @param complete Callback invoked when the animation playback is complete. + * @return 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. + */ + int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update, + ArkUI_AnimateCompleteCallback* complete); + + /** + * @brief Defines a keyframe animation. + * + * @param context **UIContext** instance. + * @param option Keyframe animation parameter. + * @return 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. + */ + int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option); + + /** + * @brief Creates an animator object. + * + * @param context **UIContext** instance. + * @param option Animator parameter. + * @return Returns the pointer to the animator object; returns **NULL** if a parameter error occurs. + */ + ArkUI_AnimatorHandle (*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option); + + /** + * @brief Disposes of an animator object. + * + * @param animatorHandle Animator object. + */ + void (*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle); +} ArkUI_NativeAnimateAPI_1; + +/** +* @brief Creates an animation configuration. +* +* @return Pointer to the created animation configuration. +* @since 12 +*/ +ArkUI_AnimateOption* OH_ArkUI_AnimateOption_Create(); + +/** +* @brief Disposes of an animation configuration. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @since 12 +*/ +void OH_ArkUI_AnimateOption_Dispose(ArkUI_AnimateOption* option); + +/** +* @brief Obtains the animation duration, in milliseconds. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **0** is returned. +* @return Animation duration, in milliseconds. If **option** is invalid, **0** is returned. +* @since 12 +*/ +uint32_t OH_ArkUI_AnimateOption_GetDuration(ArkUI_AnimateOption* option); + +/** +* @brief Obtains the playback speed of an animation. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **0.0** is returned. +* @return Animation playback speed. Value range: [0, +∞). If **option** is invalid, **0.0** is returned. +* @since 12 +*/ +float OH_ArkUI_AnimateOption_GetTempo(ArkUI_AnimateOption* option); + +/** +* @brief Obtains an animation curve. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **-1** is returned. +* @return Animation curve. If **option** is invalid,**-1** is returned. +* @since 12 +*/ +ArkUI_AnimationCurve OH_ArkUI_AnimateOption_GetCurve(ArkUI_AnimateOption* option); + +/** +* @brief Obtains the animation delay, in milliseconds. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **0** is returned. +* @return Delay of animation playback. If **option** is invalid, **0** is returned. +* @since 12 +*/ +int32_t OH_ArkUI_AnimateOption_GetDelay(ArkUI_AnimateOption* option); + +/** +* @brief Obtains the number of times that an animation is played. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **0** is returned. +* @return Number of times that the animation is played. If **option** is invalid, **0** is returned. +* @since 12 +*/ +int32_t OH_ArkUI_AnimateOption_GetIterations(ArkUI_AnimateOption* option); + +/** +* @brief Obtains the playback mode of an animation. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **-1** is returned. +* @return Animation playback mode. If **option** is invalid,**-1** is returned. +* @since 12 +*/ +ArkUI_AnimationPlayMode OH_ArkUI_AnimateOption_GetPlayMode(ArkUI_AnimateOption* option); + +/** +* @brief Obtains the expected frame rate range of an animation. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, **NULL** is returned. +* @return Expected frame rate range of the animation, in fps. If **option** is invalid, **NULL** is returned. +* @since 12 +*/ +ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimateOption_GetExpectedFrameRateRange(ArkUI_AnimateOption* option); + +/** +* @brief Sets the animation duration, in milliseconds. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation duration, in milliseconds. Value range: [0, +∞). +*
If the value is less than 0, **0** is used. +* @since 12 +*/ +void OH_ArkUI_AnimateOption_SetDuration(ArkUI_AnimateOption* option, int32_t value); + +/** +* @brief Sets the playback speed of an animation. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation playback speed. Value range: [0, +∞). +*
**NOTE** +*
If the value is less than 0, the default value **1** is used. +* @since 12 +*/ +void OH_ArkUI_AnimateOption_SetTempo(ArkUI_AnimateOption* option, float value); + +/** +* @brief Animation curve. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use +* {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. +*
If the value is abnormal, the setting is invalid. +* @since 12 +*/ +void OH_ArkUI_AnimateOption_SetCurve(ArkUI_AnimateOption* option, ArkUI_AnimationCurve value); + +/** +* @brief Sets the animation delay, in milliseconds. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation +* delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A +* value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute value +* of **value** is less than the actual animation duration, the animation starts its first frame from the state at +* the absolute value. If the absolute value of **value** is greater than or equal to the actual animation duration, +* the animation starts its first frame from the end state. The actual animation duration is equal to the duration +* of a single animation multiplied by the number of animation playback times. +* @since 12 +*/ +void OH_ArkUI_AnimateOption_SetDelay(ArkUI_AnimateOption* option, int32_t value); + +/** +* @brief Sets the number of times that an animation is played. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, +* the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number +* of times. Default value: **1** (played once). +*
If the value is less than -1, the operation is invalid. +* @since 12 +*/ +void OH_ArkUI_AnimateOption_SetIterations(ArkUI_AnimateOption* option, int32_t value); + +/** +* @brief Sets the playback mode for an animation. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation playback mode. Default value: {@link ARKUI_ANIMATION_PLAY_MODE_NORMAL}. +*
If the value is abnormal, the operation is invalid. +* @since 12 +*/ +void OH_ArkUI_AnimateOption_SetPlayMode(ArkUI_AnimateOption* option, ArkUI_AnimationPlayMode value); + +/** +* @brief Defines a struct for the expected frame rate range of the animation. +* +* @param option Pointer to an animation configuration. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Expected frame rate range of the animation, in fps. +*
If **value** is set to **NULL**, the operation is invalid. +* @since 12 +*/ +void OH_ArkUI_AnimateOption_SetExpectedFrameRateRange(ArkUI_AnimateOption* option, ArkUI_ExpectedFrameRateRange* value); + +/** +* @brief Sets the animation curve for an animation. +* +* @note This method is better than the value set by OH_ArkUI_AnimateOption_SetCurve. +* @param option Animator animation parameters. +*
If **option** is set to **NULL**, the operation is invalid. +* @param value Animation curve parameters. +*
If **value** is set to **NULL**, the operation is invalid. +* @since 12 +*/ +void OH_ArkUI_AnimateOption_SetICurve(ArkUI_AnimateOption* option, ArkUI_CurveHandle value); + +/** +* @brief Obtains the animation curve of an animation. +* +* @param option Animator animation parameters. +*
If **option** is set to **NULL**, **NULL** is returned. +* @return Animation curve parameters. Returns **NULL** if the option parameter is invalid. +* @since 12 +*/ +ArkUI_CurveHandle OH_ArkUI_AnimateOption_GetICurve(ArkUI_AnimateOption* option); + +/** + * @brief Creates a keyframe animation parameter object. + * + * @param size Number of keyframe animation states. + *
Returns **NULL** if the value of **size** is less than 0. + * @return Keyframe animation parameter object. If the value of **size** is less than 0 or if **option** is abnormal, ** + * NULL** is returned. + * @since 12 + */ +ArkUI_KeyframeAnimateOption* OH_ArkUI_KeyframeAnimateOption_Create(int32_t size); + +/** + * @brief Disposes of a keyframe animation parameter object. + * + * @param option Keyframe animation parameter object. + *
If **option** is set to **NULL**, the operation is invalid. + * @since 12 + */ +void OH_ArkUI_KeyframeAnimateOption_Dispose(ArkUI_KeyframeAnimateOption* option); + +/** + * @brief Sets the overall delay of a keyframe animation, in milliseconds. By default, the keyframe animation starts + * without any delay. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation + * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A + * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute + * value of **value** is less than the actual animation duration, the animation starts its first frame from the + * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation + * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the + * duration of a single animation multiplied by the number of animation playback times. + * @return 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 12 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_SetDelay(ArkUI_KeyframeAnimateOption* option, int32_t value); + +/** + * @brief Sets the number of times that the keyframe animation is played. By default, the animation is played once. The + * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that + * no animation is played. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, + * the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number + * of times. Default value: **1**, indicating that the animation is played once. + *
If the value is less than **-1**, the operation is invalid, and the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_SetIterations(ArkUI_KeyframeAnimateOption* option, int32_t value); + +/** + * @brief Sets the callback invoked when the keyframe animation playback is complete. This function is called after the + * {@link keyframe animation} has played for the specified number of times. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param userData Pointer to a custom object. + *
Abnormal value processing is not involved. + * @param onFinish Indicates the callback. + * @return 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 12 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback( + ArkUI_KeyframeAnimateOption* option, void* userData, void (*onFinish)(void* userData)); + +/** + * @brief Sets the expected frame rate for a keyframe animation. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param frameRate Expected frame rate for the keyframe animation. + *
If **frameRate** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 19 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_SetExpectedFrameRate( + ArkUI_KeyframeAnimateOption* option, ArkUI_ExpectedFrameRateRange* frameRate); + +/** + * @brief Sets the duration of a keyframe animation, in milliseconds. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Keyframe animation duration, in ms. The default value is 1000 ms. Value range: [0, +∞). + *
If the value is less than 0, **0** is used. + * @param index Index of the keyframe state segment. + *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_SetDuration(ArkUI_KeyframeAnimateOption* option, int32_t value, int32_t index); + +/** + * @brief Sets the animation curve for a specific keyframe animation segment. + * + * @note Because the springMotion, responsiveSpringMotion, and interpolatingSpring curves do not + * have effective duration settings, they are not supported. + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation curve to set. Default value: {@link ARKUI_CURVE_EASE_IN_OUT}. + * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of + * keyframe animation states. + *
If the value of **index** is less than 0 or out of range, the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_SetCurve( + ArkUI_KeyframeAnimateOption* option, ArkUI_CurveHandle value, int32_t index); + +/** + * @brief Sets the closure function of the state at the time of the keyframe, that is, the state to be reached at the + * time of the keyframe. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param event Indicates a closure function. + * @param userData Pointer to a user-defined object. + *
Abnormal value processing is not involved. + * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of + * keyframe animation states. + *
If the value of **index** is less than 0 or out of range, the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnEventCallback( + ArkUI_KeyframeAnimateOption* option, void* userData, void (*event)(void* userData), int32_t index); + +/** + * @brief Obtains the overall delay of a keyframe animation, in milliseconds. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @return Overall delay, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_GetDelay(ArkUI_KeyframeAnimateOption* option); + +/** + * @brief Obtains the number of times that a keyframe animation is played. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. + * @since 12 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_GetIterations(ArkUI_KeyframeAnimateOption* option); + +/** + * @brief Obtains the expected frame rate from keyframe animation parameters. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **NULL** is returned. + * @return Returns the expected frame rate obtained. If **option** is invalid, **NULL** is returned. + * @since 19 + */ +ArkUI_ExpectedFrameRateRange* OH_ArkUI_KeyframeAnimateOption_GetExpectedFrameRate(ArkUI_KeyframeAnimateOption* option); + +/** + * @brief Obtains the duration of a specific state in a keyframe animation, in milliseconds. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @param index Index of the keyframe state segment. + *
If the value of **index** is less than 0, **0** is returned. + * @return Duration, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ +int32_t OH_ArkUI_KeyframeAnimateOption_GetDuration(ArkUI_KeyframeAnimateOption* option, int32_t index); + +/** + * @brief Obtains the animation curve of a specific state in a keyframe animation. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **NULL** is returned. + * @param index Index of the keyframe state segment. + *
If the value of **index** is less than 0, **NULL** is returned. + * @return Animation curve. If the parameter is abnormal, **NULL** is returned. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_KeyframeAnimateOption_GetCurve(ArkUI_KeyframeAnimateOption* option, int32_t index); + +/** + * @brief Creates an **AnimatorOption** object. + * + * @note When keyframeSize is greater than 0, the animation interpolation start point is 0, and the animation + * interpolation end point is 1; no setting is allowed. + * @param keyframeSize Number of keyframes. + *
If the value of **keyframeSize** is less than 0, **NULL** is returned. + * @return Pointer to the animator parameter object. If the value of **size** is less than 0 or if **option** is + * abnormal, **NULL** is returned. + * @since 12 + */ +ArkUI_AnimatorOption* OH_ArkUI_AnimatorOption_Create(int32_t keyframeSize); + +/** + * @brief Disposes of an **AnimatorOption** object. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the operation is invalid. + * @since 12 + */ +void OH_ArkUI_AnimatorOption_Dispose(ArkUI_AnimatorOption* option); + +/** + * @brief Sets the duration of an animator animation, in milliseconds. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Playback duration, in ms. The default value is 0 ms. Value range: [0, +∞). + *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetDuration(ArkUI_AnimatorOption* option, int32_t value); + +/** + * @brief Sets the delay time of the animator playback, in milliseconds. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation + * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A + * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute + * value of **value** is less than the actual animation duration, the animation starts its first frame from the + * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation + * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the + * duration of a single animation multiplied by the number of animation playback times. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetDelay(ArkUI_AnimatorOption* option, int32_t value); + +/** + * @brief Sets the number of times that an animator animation is played. By default, the animation is played once. The + * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that + * no animation is played. + * + * @note If this parameter is set to a negative value other than -1, the value is invalid. In this case, the + * animation is played once. + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Value range: [-1, +∞). If this parameter is set to **0**, the animation is not played. If this + * parameter is set to **-1**, the animation is played for an infinite number of times. Default value: **1** ( + * played once). + *
If the value is less than -1, the operation is invalid. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetIterations(ArkUI_AnimatorOption* option, int32_t value); + +/** + * @brief Sets the status of the component before and after the animator animation execution. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Status of the component before and after the animator animation execution. Default value: + * {@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}. + *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetFill(ArkUI_AnimatorOption* option, ArkUI_AnimationFillMode value); + +/** + * @brief Set the playback direction. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation playback direction. + *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetDirection(ArkUI_AnimatorOption* option, ArkUI_AnimationDirection value); + +/** + * @brief Sets the interpolation curve for the animation of an animator. + * + * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, + * and customCurve curves are not supported. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use + * {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. + *
If **value** is set to **NULL**, the default curve {@link ARKUI_CURVE_LINEAR} is used. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value); + +/** + * @brief Sets the interpolation start point of an animation. + * + * @note This API does not take effect when the animation is a keyframe animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation start point of the animation. Value range: (-∞, +∞). + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetBegin(ArkUI_AnimatorOption* option, float value); + +/** + * @brief Sets the interpolation end point for the animation of an animator. + * + * @note This API does not take effect when the animation is a keyframe animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation end point of the animation. Value range: (-∞, +∞). + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetEnd(ArkUI_AnimatorOption* option, float value); + +/** + * @brief Sets the expected frame rate range of an animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Expected frame rate range. + *
If **value** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange( + ArkUI_AnimatorOption* option, ArkUI_ExpectedFrameRateRange* value); + +/** + * @brief Sets the keyframe parameters of an animator animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param time Keyframe time. Value range: [0, 1]. The value must be in ascending order. Default value: evenly + * distributed by index (for example, **0.0** for the first frame, **0.5** for the second frame, and **1.0** for + * the third frame). + *
If the value of **time** is less than 0 or greater than 1, the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Keyframe value. Value range: (-∞, +∞). + * @param index Keyframe index. + *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetKeyframe( + ArkUI_AnimatorOption* option, float time, float value, int32_t index); + +/** + * @brief Sets the keyframe curve type for the animation of an animator. + * + * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, + * and customCurve curves are not supported. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation curve. Default value: **NULL**, indicating linear interpolation. + * @param index Keyframe index. + *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_SetKeyframeCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value, int32_t index); +/** + * @brief Obtains the duration for playing an animation. + * + * @param option Animator animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @return Duration for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ +int32_t OH_ArkUI_AnimatorOption_GetDuration(ArkUI_AnimatorOption* option); + +/** + * @brief Obtains the delay for playing an animation. + * + * @param option Animator animation parameters. If **option** is set to **NULL**, **0** is returned. + * @return Delay for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ +int32_t OH_ArkUI_AnimatorOption_GetDelay(ArkUI_AnimatorOption* option); + +/** + * @brief Obtains the number of times that an animator animation is played. + * + * @param option Animator parameters. If **option** is set to **NULL**, **0** is returned. + * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. + * @since 12 + */ +int32_t OH_ArkUI_AnimatorOption_GetIterations(ArkUI_AnimatorOption* option); + +/** + * @brief Obtains the status of the component before and after the animator animation execution. + * + * @param option Animator animation parameters. + * @return Status of the component before and after the animator animation execution. If **option** is invalid,**-1** + * is returned. + * @since 12 + */ +ArkUI_AnimationFillMode OH_ArkUI_AnimatorOption_GetFill(ArkUI_AnimatorOption* option); + +/** + * @brief Obtains the playback direction of an animator animation. + * + * @param option Animator animation parameters. + * @return Animation playback direction. If **option** is invalid,**-1** is returned. + * @since 12 + */ +ArkUI_AnimationDirection OH_ArkUI_AnimatorOption_GetDirection(ArkUI_AnimatorOption* option); + +/** + * @brief Obtains the interpolation curve of the animation of an animator. + * + * @param option Animator animation parameters. + * @return Interpolation curve. If **option** is invalid, **NULL** is returned. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetCurve(ArkUI_AnimatorOption* option); + +/** + * @brief Obtains the interpolation start point of an animation. + * + * @param option Animator animation parameters. + * @return Interpolation start point of the animation. If **option** is invalid, **0.0** is returned. + * @since 12 + */ +float OH_ArkUI_AnimatorOption_GetBegin(ArkUI_AnimatorOption* option); + +/** + * @brief Obtains the interpolation end point of an animation. + * + * @param option Animator animation parameters. + * @return Interpolation end point of the animation. If **option** is invalid, **0.0** is returned. + * @since 12 + */ +float OH_ArkUI_AnimatorOption_GetEnd(ArkUI_AnimatorOption* option); + +/** + * @brief Obtains the expected frame rate range of an animator animation. + * + * @param option Animator animation parameters. + * @return Pointer to the expected frame rate range object. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimatorOption_GetExpectedFrameRateRange(ArkUI_AnimatorOption* option); + +/** + * @brief Obtains the keyframe time of the animator playback, in milliseconds. + * + * @param option Animator parameters. + * @param index Keyframe index. + * @return Keyframe time, in milliseconds. + * @since 12 + */ +float OH_ArkUI_AnimatorOption_GetKeyframeTime(ArkUI_AnimatorOption* option, int32_t index); + +/** + * @brief Obtains the keyframe value of an animation. + * + * @param option Animator parameters. + * @param index Keyframe index. + * @return Keyframe value. + * @since 12 + */ +float OH_ArkUI_AnimatorOption_GetKeyframeValue(ArkUI_AnimatorOption* option, int32_t index); + +/** + * @brief Obtains the interpolation curve for a keyframe in the animation of an animator. + * + * @param option Animator parameters. + * @param index Keyframe index. + * @return Interpolation curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetKeyframeCurve(ArkUI_AnimatorOption* option, int32_t index); + +/** + * @brief Obtains the user-defined object in an animation event object. + * + * @param event Animation event object. + * @return User-defined object. + * @since 12 + */ +void* OH_ArkUI_AnimatorEvent_GetUserData(ArkUI_AnimatorEvent* event); + +/** + * @brief Obtains the user-defined object in the frame event of an animation. + * + * @param event Animation event object. + * @return User-defined object. + * @since 12 + */ +void* OH_ArkUI_AnimatorOnFrameEvent_GetUserData(ArkUI_AnimatorOnFrameEvent* event); + +/** + * @brief Obtains the interpolation result in the animation frame callback event object. + * + * @param event Animation event object. + * @return Animation interpolation result. + *
**NOTE** + *
During the animation, the interpolation result changes between the interpolation start point + * {@link OH_ArkUI_AnimatorOption_SetBegin} and the interpolation end point {@link OH_ArkUI_AnimatorOption_SetEnd} + * based on the animation parameters. + * @since 12 + */ +float OH_ArkUI_AnimatorOnFrameEvent_GetValue(ArkUI_AnimatorOnFrameEvent* event); + +/** + * @brief Sets the callback invoked when the animator receives a frame. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_RegisterOnFrameCallback( + ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorOnFrameEvent* event)); + +/** + * @brief Sets the callback invoked when the animation playback is complete. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_RegisterOnFinishCallback( + ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); + +/** + * @brief Sets the callback invoked when the animation playback is canceled. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_RegisterOnCancelCallback( + ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); + +/** + * @brief Sets the callback invoked when the animation playback is repeated. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ +int32_t OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback( + ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); + +/** + * @brief Resets the animation of an animator. + * + * @param animatorHandle Animator object. + * @param option Animator animation parameters. + * @return 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 12 + */ +int32_t OH_ArkUI_Animator_ResetAnimatorOption( + ArkUI_AnimatorHandle animatorHandle, ArkUI_AnimatorOption* option); + +/** + * @brief Starts the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ +int32_t OH_ArkUI_Animator_Play(ArkUI_AnimatorHandle animatorHandle); + +/** + * @brief Ends the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ +int32_t OH_ArkUI_Animator_Finish(ArkUI_AnimatorHandle animatorHandle); + +/** + * @brief Pauses the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ +int32_t OH_ArkUI_Animator_Pause(ArkUI_AnimatorHandle animatorHandle); + +/** + * @brief Cancels the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ +int32_t OH_ArkUI_Animator_Cancel(ArkUI_AnimatorHandle animatorHandle); + +/** + * @brief Plays this animation in reverse order. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ +int32_t OH_ArkUI_Animator_Reverse(ArkUI_AnimatorHandle animatorHandle); + +/** + * @brief Implements initialization for the interpolation curve, which is used to create an interpolation curve based + * on the input parameter. + * + * @param curve Curve type. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType(ArkUI_AnimationCurve curve); + +/** + * @brief Creates a step curve. + * + * @param count Number of steps. The value must be a positive integer. Value range: [1, +∞). + *
If the value of **count** is abnormal, the operation is invalid. + * @param end Whether the step change occurs at the start or end of each interval. **true**: The step change occurs at + * the end of each interval. **false**: The step change occurs at the start of each interval. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve(int32_t count, bool end); + +/** + * @brief Creates a cubic Bezier curve. + * + * @param x1 X-coordinate of the first point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated + * as **0**. A value greater than 1 is treated as **1**. + * @param y1 Y-coordinate of the first point on the Bezier curve. + * @param x2 X-coordinate of the second point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated + * as **0**. A value greater than 1 is treated as **1**. + * @param y2 Y-coordinate of the second point on the Bezier curve. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve(float x1, float y1, float x2, float y2); + +/** + * @brief Creates a spring curve. The curve shape is determined by the spring parameters, and the animation duration is + * controlled by the **duration** parameter in {@link animation} and {@link animateTo}. + * + * @param velocity Initial velocity. It is applied by external factors to the spring animation, designed to help + * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its + * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute + * change value. + * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of + * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the + * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. In an + * elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the + * speed of restoring to the equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. + * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the + * oscillation amplitude. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve(float velocity, float mass, float stiffness, float damping); + +/** + * @brief Creates a spring animation curve. If multiple spring animations are applied to the same attribute of an + * object, each animation replaces their predecessor and inherits the velocity. + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * @param response Duration of one complete oscillation. Value range: (0, +∞). + *
If the value is less than or equal to 0, **0.55** is used. + * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the + * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium + * gradually. Value range: (0, +∞). + *
If the value is less than or equal to 0, **0.825** is used. + * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** + * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). + *
If the value is less than 0, **0** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion(float response, float dampingFraction, float overlapDuration); + +/** + * @brief Creates a responsive spring animation curve. It is a special case of **springMotion**, with the only + * difference in the default values. It can be used together with **springMotion**. + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * @param response Duration of one complete oscillation. Value range: (0, +∞). + *
If the value is less than or equal to 0, **0.15** is used. + * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the + * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium + * gradually. Value range: [0, +∞). + *
If the value is less than 0, **0.86** is used. + * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** + * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). + *
If the value is less than 0, **0.25** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion( + float response, float dampingFraction, float overlapDuration); + +/** + * @brief Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based on + * the curve. + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * + * @param velocity Initial velocity. It is applied by external factors to the spring animation, designed to help + * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its + * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute + * change value. + * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of + * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the + * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. The greater + * the stiffness, the stronger the ability to resist deformation, and the faster the speed of restoring to the + * equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. + * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the + * oscillation amplitude. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring(float velocity, float mass, float stiffness, float damping); + +/** + * @brief Creates a custom curve. + * + * @param userData Pointer to user-defined data. + * @param interpolate Indicates the custom interpolation callback. fraction indicates the input x value for + * interpolation when the animation starts; value range: [0,1]. + * The return value is the y value of the curve; value range: [0,1]. + * If fraction is 0, the return value 0 corresponds to the animation start point; any other + * return + * value means that the animation jumps at the start point. + * If fraction is 1, the return value 1 corresponds to the animation end point; any other + * return + * value means that the end value of the animation is not the value of the state variable, + * which will result in an effect of transition from that end value to the value of the state variable. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve( + void* userData, float (*interpolate)(float fraction, void* userdata)); + +/** + * @brief Disposes of a custom curve. + * + * @param curveHandle Pointer to the interpolation object of the curve. + * @since 12 + */ +void OH_ArkUI_Curve_DisposeCurve(ArkUI_CurveHandle curveHandle); + +/** + * @brief Creates an opacity effect object for component transitions. + * + * @note If the value specified is less than 0, the value 0 is used. If the value specified is greater than 1, + * the value 1 is used. + * @param opacity Opacity. Value range: [0, 1]. The default value is **1**. A value less than 0 is treated as 0. A + * value greater than 1 is treated as 1. The value **1** means fully opaque, and **0** means fully transparent. + * @return Opacity effect object for component transitions. + * @since 12 + */ +ArkUI_TransitionEffect* OH_ArkUI_CreateOpacityTransitionEffect(float opacity); + +/** + * @brief Creates a translation effect object for component transitions. + * + * @param translate Translation parameter object for component transitions. + * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_TransitionEffect* OH_ArkUI_CreateTranslationTransitionEffect(ArkUI_TranslationOptions* translate); + +/** + * @brief Creates a scaling effect object for component transitions. + * + * @param scale Scaling parameter object for component transitions. + * @return Scaling effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_TransitionEffect* OH_ArkUI_CreateScaleTransitionEffect(ArkUI_ScaleOptions* scale); + +/** + * @brief Creates a rotation effect object for component transition. + * + * @param rotate Rotation parameter object for component transitions. + * @return Rotation effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_TransitionEffect* OH_ArkUI_CreateRotationTransitionEffect(ArkUI_RotationOptions* rotate); + +/** + * @brief Creates a movement transition effect object for the component. + * + * @param edge Movement transition type. + * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_TransitionEffect* OH_ArkUI_CreateMovementTransitionEffect(ArkUI_TransitionEdge edge); + +/** + * @brief Creates an asymmetric transition effect. + * + * @note If the asymmetric function is not used for TransitionEffect, the transition effect takes effect + * for both appearance and disappearance of the component. + * @param appear Transition effect for appearance. + * @param disappear Transition effect for disappearance. + * @return Asymmetric transition effect. Returns **NULL** if a parameter error occurs. + * @since 12 + */ +ArkUI_TransitionEffect* OH_ArkUI_CreateAsymmetricTransitionEffect( + ArkUI_TransitionEffect* appear, ArkUI_TransitionEffect* disappear); + +/** + * @brief Disposes of a transition effect. + * + * @param effect Pointer to the transition effect to be disposed. + * @since 12 + */ +void OH_ArkUI_TransitionEffect_Dispose(ArkUI_TransitionEffect* effect); + +/** + * @brief Sets a combination of transition effects. + * + * @param firstEffect Transition effect. + * @param secondEffect Combination of transition effects. + * @return 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 12 + */ +int32_t OH_ArkUI_TransitionEffect_Combine( + ArkUI_TransitionEffect* firstEffect, ArkUI_TransitionEffect* secondEffect); + +/** + * @brief Sets transition effect animation settings. + * + * @note If combine is used for combining transition effects, the animation settings of a transition effect are + * applicable to the one following it. + * @param effect Transition effect. + * @param animation Animation settings. + * @return 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 12 + */ +int32_t OH_ArkUI_TransitionEffect_SetAnimation( + ArkUI_TransitionEffect* effect, ArkUI_AnimateOption* animation); +#ifdef __cplusplus +}; +#endif + +#endif // ARKUI_NATIVE_ANIMATE_H +/** @} */ \ No newline at end of file From abf8a33c77763e1f277e299839139b09d468c2fd Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 16:50:30 +0800 Subject: [PATCH 20/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: opencode (qwen3.6-plus) Change-Id: Ie20a7655ecb649802456aef5ee31818d7714eea7 --- .../arkui/ace_engine/native/native_animate.h | 1776 ++++++++--------- 1 file changed, 850 insertions(+), 926 deletions(-) diff --git a/zh-cn/arkui/ace_engine/native/native_animate.h b/zh-cn/arkui/ace_engine/native/native_animate.h index 96f6805ee..c3927cb92 100644 --- a/zh-cn/arkui/ace_engine/native/native_animate.h +++ b/zh-cn/arkui/ace_engine/native/native_animate.h @@ -25,8 +25,7 @@ /** * @file native_animate.h * - * @brief Defines a set of animation APIs of ArkUI on the native side. The APIs in **native_animate.h** must be called - * in the main thread. + * @brief 提供ArkUI在Native侧的动画接口定义集合。native_animate.h中的接口需要在主线程上调用。 * * @library libace_ndk.z.so * @syscap SystemCapability.ArkUI.ArkUI.Full @@ -50,1286 +49,1211 @@ extern "C" { #endif /** -* @brief Defines the expected frame rate range of the animation. -* -* @since 12 -*/ + * @brief 设置动画的期望帧率。 + * + * @since 12 + */ typedef struct { /** - * Expected minimum frame rate, in fps. + * 期望的最小帧率,单位为帧/秒(fps)。 */ uint32_t min; /** - * Expected maximum frame rate, in fps. + * 期望的最大帧率,单位为帧/秒(fps)。 */ uint32_t max; /** - * Expected optimal frame rate, in fps. + * 期望的最优帧率,单位为帧/秒(fps)。 */ uint32_t expected; } ArkUI_ExpectedFrameRateRange; /** -* @brief Defines the callback type for when the animation playback is complete. -* -* @since 12 -*/ + * @brief 动画播放结束回调类型。 + * + * @since 12 + */ typedef struct { /** - * Callback type for when the animation playback is complete. + * 在动画中定义结束回调的类型。 */ ArkUI_FinishCallbackType type; /** - * Invoked when the animation playback is complete. + * 动画播放结束回调。 */ void (*callback)(void* userData); /** - * Custom data passed upon animation end callback. + * 用于动画结束回调,传递用户自定义数据。 */ void* userData; } ArkUI_AnimateCompleteCallback; /** -* @brief Defines the animation configuration. -* -* @since 12 -*/ + * @brief 设置动画效果相关参数。 + * + * @since 12 + */ typedef struct ArkUI_AnimateOption ArkUI_AnimateOption; /** -* @brief Defines an interpolation curve. -* -* @since 12 -*/ + * @brief 提供曲线的插值对象定义。 + * + * @since 12 + */ typedef struct ArkUI_Curve ArkUI_Curve; /** - * @brief Defines the pointer to an interpolation curve. + * @brief 定义曲线的插值对象指针定义。 * * @since 12 */ typedef struct ArkUI_Curve* ArkUI_CurveHandle; /** - * @brief Defines the keyframe animation parameter object. + * @brief 定义关键帧动画参数对象。 * * @since 12 */ typedef struct ArkUI_KeyframeAnimateOption ArkUI_KeyframeAnimateOption; /** - * @brief Defines the animator parameter object. + * @brief 定义animator动画参数对象。 * * @since 12 */ typedef struct ArkUI_AnimatorOption ArkUI_AnimatorOption; /** - * @brief Defines the pointer to an animator object. + * @brief 定义animator动画对象指针。 * * @since 12 */ typedef struct ArkUI_Animator* ArkUI_AnimatorHandle; /** -* @brief Defines the animator callback event object. -* -* @since 12 -*/ + * @brief 定义animator回调事件对象。 + * + * @since 12 + */ typedef struct ArkUI_AnimatorEvent ArkUI_AnimatorEvent; /** -* @brief Defines the callback object when the animator receives a frame. -* -* @since 12 -*/ + * @brief 定义animator接收到帧时回调对象。 + * + * @since 12 + */ typedef struct ArkUI_AnimatorOnFrameEvent ArkUI_AnimatorOnFrameEvent; /** - * @brief Defines the transition parameter object for transition property configuration. - * - * @since 12 - */ + * @brief 定义transition属性配置转场参数对象。 + * + * @since 12 + */ typedef struct ArkUI_TransitionEffect ArkUI_TransitionEffect; /** - * @brief Declares the native animation APIs provided by ArkUI. - * - * @version 1 - * @since 12 - */ + * @brief ArkUI提供的Native侧动画接口集合。 + * + * @version 1 + * @since 12 + */ typedef struct { /** - * @brief Defines an explicit animation. - * - * @note Make sure the component attributes to be set in the event closure have been set before. - * - * @param context **UIContext** instance. - * @param option Defines the animation configuration. - * @param update Closure function for the animation. The system automatically inserts the transition animation if - * the state changes in the closure function. - *
Note: Make sure the component attributes to be set in the closure function have been set before. - * @param complete Callback invoked when the animation playback is complete. - * @return 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. - */ + * @brief 显式动画接口。 + * + * @note Make sure the component attributes to be set in the event closure have been set before. + * + * @param context UIContext实例。 + * @param option 设置动画效果相关参数。 + * @param update 指定动效的闭包函数,在闭包函数中导致的状态变化系统会自动插入过渡动画。 + *
**说明**:在闭包函数中要设置的组件属性,必须在其之前设置过。 + * @param complete 设置动画播放完成回调参数。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + */ int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update, ArkUI_AnimateCompleteCallback* complete); /** - * @brief Defines a keyframe animation. - * - * @param context **UIContext** instance. - * @param option Keyframe animation parameter. - * @return 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. - */ + * @brief 关键帧动画接口。 + * + * @param context UIContext实例。 + * @param option 关键帧动画参数。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + */ int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option); /** - * @brief Creates an animator object. - * - * @param context **UIContext** instance. - * @param option Animator parameter. - * @return Returns the pointer to the animator object; returns **NULL** if a parameter error occurs. - */ + * @brief 创建animator动画对象。 + * + * @param context UIContext实例。 + * @param option animator动画参数。 + * @return animator动画对象指针。函数参数异常时返回NULL。 + */ ArkUI_AnimatorHandle (*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option); /** - * @brief Disposes of an animator object. - * - * @param animatorHandle Animator object. - */ + * @brief 销毁animator动画对象。 + * + * @param animatorHandle animator动画对象。 + */ void (*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle); } ArkUI_NativeAnimateAPI_1; /** -* @brief Creates an animation configuration. -* -* @return Pointer to the created animation configuration. -* @since 12 -*/ + * @brief 创建动画效果参数。 + * + * @return 新的动画效果参数指针。 + * @since 12 + */ ArkUI_AnimateOption* OH_ArkUI_AnimateOption_Create(); /** -* @brief Disposes of an animation configuration. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @since 12 -*/ + * @brief 销毁动画效果参数指针。 + * + * @param option 动画效果参数。 + *
option为NULL时,操作无效。 + * @since 12 + */ void OH_ArkUI_AnimateOption_Dispose(ArkUI_AnimateOption* option); /** -* @brief Obtains the animation duration, in milliseconds. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **0** is returned. -* @return Animation duration, in milliseconds. If **option** is invalid, **0** is returned. -* @since 12 -*/ + * @brief 获取动画持续时间,单位为ms(毫秒)。 + * + * @param option 动画效果参数。 + *
option为NULL时,返回0。 + * @return 动画持续时间,单位为ms(毫秒)。option异常时返回0。 + * @since 12 + */ uint32_t OH_ArkUI_AnimateOption_GetDuration(ArkUI_AnimateOption* option); /** -* @brief Obtains the playback speed of an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **0.0** is returned. -* @return Animation playback speed. Value range: [0, +∞). If **option** is invalid, **0.0** is returned. -* @since 12 -*/ + * @brief 获取动画播放速度。 + * + * @param option 动画效果参数。 + *
option为NULL时,返回0.0。 + * @return 动画播放速度。取值范围:[0, +∞)。option异常时返回0.0。 + * @since 12 + */ float OH_ArkUI_AnimateOption_GetTempo(ArkUI_AnimateOption* option); /** -* @brief Obtains an animation curve. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **-1** is returned. -* @return Animation curve. If **option** is invalid,**-1** is returned. -* @since 12 -*/ + * @brief 获取动画曲线。 + * + * @param option 动画效果参数。 + *
option为NULL时,返回-1。 + * @return 动画曲线。option异常时返回-1。 + * @since 12 + */ ArkUI_AnimationCurve OH_ArkUI_AnimateOption_GetCurve(ArkUI_AnimateOption* option); /** -* @brief Obtains the animation delay, in milliseconds. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **0** is returned. -* @return Delay of animation playback. If **option** is invalid, **0** is returned. -* @since 12 -*/ + * @brief 获取动画延迟播放时间,单位为ms(毫秒)。 + * + * @param option 动画效果参数。 + *
option为NULL时,返回0。 + * @return 动画延迟播放时间。option异常时返回0。 + * @since 12 + */ int32_t OH_ArkUI_AnimateOption_GetDelay(ArkUI_AnimateOption* option); /** -* @brief Obtains the number of times that an animation is played. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **0** is returned. -* @return Number of times that the animation is played. If **option** is invalid, **0** is returned. -* @since 12 -*/ + * @brief 获取动画播放次数。 + * + * @param option 动画效果参数。 + *
option为NULL时,返回0。 + * @return 动画播放次数。option异常时返回0。 + * @since 12 + */ int32_t OH_ArkUI_AnimateOption_GetIterations(ArkUI_AnimateOption* option); /** -* @brief Obtains the playback mode of an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **-1** is returned. -* @return Animation playback mode. If **option** is invalid,**-1** is returned. -* @since 12 -*/ + * @brief 获取动画播放模式。 + * + * @param option 动画效果参数。 + *
option为NULL时,返回-1。 + * @return 动画播放模式。option异常时返回-1。 + * @since 12 + */ ArkUI_AnimationPlayMode OH_ArkUI_AnimateOption_GetPlayMode(ArkUI_AnimateOption* option); /** -* @brief Obtains the expected frame rate range of an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **NULL** is returned. -* @return Expected frame rate range of the animation, in fps. If **option** is invalid, **NULL** is returned. -* @since 12 -*/ + * @brief 获取动画的期望帧率。 + * + * @param option 动画效果参数。 + *
option为NULL时,返回NULL。 + * @return 动画的期望帧率,单位为帧/秒(fps)。option异常时返回NULL。 + * @since 12 + */ ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimateOption_GetExpectedFrameRateRange(ArkUI_AnimateOption* option); /** -* @brief Sets the animation duration, in milliseconds. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation duration, in milliseconds. Value range: [0, +∞). -*
If the value is less than 0, **0** is used. -* @since 12 -*/ + * @brief 设置动画持续时间,单位为ms(毫秒)。 + * + * @param option 动画效果参数。 + *
option为NULL时,操作无效。 + * @param value 动画持续时间,单位为ms(毫秒)。取值范围:[0, +∞)。 + *
value小于0时,按0处理。 + * @since 12 + */ void OH_ArkUI_AnimateOption_SetDuration(ArkUI_AnimateOption* option, int32_t value); /** -* @brief Sets the playback speed of an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation playback speed. Value range: [0, +∞). -*
**NOTE** -*
If the value is less than 0, the default value **1** is used. -* @since 12 -*/ + * @brief 设置动画播放速度。 + * + * @param option 动画效果参数。 + *
option为NULL时,操作无效。 + * @param value 动画播放速度。取值范围:[0, +∞)。 + * **说明:** + * 传入小于0的数值,会默认设置为1。 + * @since 12 + */ void OH_ArkUI_AnimateOption_SetTempo(ArkUI_AnimateOption* option, float value); /** -* @brief Animation curve. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use -* {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. -*
If the value is abnormal, the setting is invalid. -* @since 12 -*/ + * @brief 设置动画曲线。 + * + * @param option 动画效果参数。 + *
option为NULL时,操作无效。 + * @param value 动画曲线。默认值:{@link ARKUI_CURVE_LINEAR},建议使用{@link ARKUI_CURVE_EASE_IN_OUT}获得更平滑的动画效果。 + *
value值异常时,设置无效。 + * @since 12 + */ void OH_ArkUI_AnimateOption_SetCurve(ArkUI_AnimateOption* option, ArkUI_AnimationCurve value); /** -* @brief Sets the animation delay, in milliseconds. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation -* delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A -* value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute value -* of **value** is less than the actual animation duration, the animation starts its first frame from the state at -* the absolute value. If the absolute value of **value** is greater than or equal to the actual animation duration, -* the animation starts its first frame from the end state. The actual animation duration is equal to the duration -* of a single animation multiplied by the number of animation playback times. -* @since 12 -*/ + * @brief 设置动画延迟播放时间,单位为ms(毫秒)。 + * + * @param option 动画效果参数。 + *
option为NULL时,操作无效。 + * @param value 动画延迟播放时间,单位为ms(毫秒)。取值范围:(-∞, +∞)。默认值:0,表示不延迟。value大于0时表示延迟播放,小于0表示提前播放。value小于0时,如果value的绝对值小于实际动画时长, + * 动画将在开始后第一帧直接运动到value绝对值的时刻的状态;如果value的绝对值大于等于实际动画时长,动画将在开始后第一帧直接运动到终点状态。其中实际动画时长等于单次动画时长乘以动画播放次数。 + * @since 12 + */ void OH_ArkUI_AnimateOption_SetDelay(ArkUI_AnimateOption* option, int32_t value); /** -* @brief Sets the number of times that an animation is played. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, -* the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number -* of times. Default value: **1** (played once). -*
If the value is less than -1, the operation is invalid. -* @since 12 -*/ + * @brief 设置动画播放次数。 + * + * @param option 动画效果参数。 + *
option为NULL时,操作无效。 + * @param value 动画播放次数。取值范围:[-1, +∞),其中设置为0时不播放,-1表示无限次播放。默认值:1(播放一次)。 + *
value小于-1时,操作无效。 + * @since 12 + */ void OH_ArkUI_AnimateOption_SetIterations(ArkUI_AnimateOption* option, int32_t value); /** -* @brief Sets the playback mode for an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation playback mode. Default value: {@link ARKUI_ANIMATION_PLAY_MODE_NORMAL}. -*
If the value is abnormal, the operation is invalid. -* @since 12 -*/ + * @brief 设置动画播放模式。 + * + * @param option 动画效果参数。 + *
option为NULL时,操作无效。 + * @param value 动画播放模式。默认值:{@link ARKUI_ANIMATION_PLAY_MODE_NORMAL}。 + *
value值异常时,操作无效。 + * @since 12 + */ void OH_ArkUI_AnimateOption_SetPlayMode(ArkUI_AnimateOption* option, ArkUI_AnimationPlayMode value); /** -* @brief Defines a struct for the expected frame rate range of the animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Expected frame rate range of the animation, in fps. -*
If **value** is set to **NULL**, the operation is invalid. -* @since 12 -*/ + * @brief 设置动画的期望帧率。 + * + * @param option 动画效果参数。 + *
option为NULL时,操作无效。 + * @param value 动画的期望帧率,单位为帧/秒(fps)。 + *
value为NULL时,操作无效。 + * @since 12 + */ void OH_ArkUI_AnimateOption_SetExpectedFrameRateRange(ArkUI_AnimateOption* option, ArkUI_ExpectedFrameRateRange* value); /** -* @brief Sets the animation curve for an animation. -* -* @note This method is better than the value set by OH_ArkUI_AnimateOption_SetCurve. -* @param option Animator animation parameters. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation curve parameters. -*
If **value** is set to **NULL**, the operation is invalid. -* @since 12 -*/ + * @brief 设置动画的动画曲线。 + * + * @note This method is better than the value set by OH_ArkUI_AnimateOption_SetCurve. + * @param option 设置动画效果相关参数。 + *
option为NULL时,操作无效。 + * @param value 动画曲线参数。 + *
value为NULL时,操作无效。 + * @since 12 + */ void OH_ArkUI_AnimateOption_SetICurve(ArkUI_AnimateOption* option, ArkUI_CurveHandle value); /** -* @brief Obtains the animation curve of an animation. -* -* @param option Animator animation parameters. -*
If **option** is set to **NULL**, **NULL** is returned. -* @return Animation curve parameters. Returns **NULL** if the option parameter is invalid. -* @since 12 -*/ + * @brief 获取动画的动画曲线。 + * + * @param option 设置动画效果相关参数。 + *
option为NULL时,返回NULL。 + * @return 动画的动画曲线。参数option异常时返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_AnimateOption_GetICurve(ArkUI_AnimateOption* option); /** - * @brief Creates a keyframe animation parameter object. - * - * @param size Number of keyframe animation states. - *
Returns **NULL** if the value of **size** is less than 0. - * @return Keyframe animation parameter object. If the value of **size** is less than 0 or if **option** is abnormal, ** - * NULL** is returned. - * @since 12 - */ + * @brief 创建关键帧动画参数。 + * + * @param size 关键帧动画状态数。 + *
size小于0时返回NULL。 + * @return 关键帧动画参数对象。size小于0时返回NULL,option异常时返回NULL。 + * @since 12 + */ ArkUI_KeyframeAnimateOption* OH_ArkUI_KeyframeAnimateOption_Create(int32_t size); /** - * @brief Disposes of a keyframe animation parameter object. - * - * @param option Keyframe animation parameter object. - *
If **option** is set to **NULL**, the operation is invalid. - * @since 12 - */ + * @brief 销毁关键帧动画参数。 + * + * @param option 关键帧动画参数对象。 + *
option为NULL时,操作无效。 + * @since 12 + */ void OH_ArkUI_KeyframeAnimateOption_Dispose(ArkUI_KeyframeAnimateOption* option); /** - * @brief Sets the overall delay of a keyframe animation, in milliseconds. By default, the keyframe animation starts - * without any delay. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation - * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A - * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute - * value of **value** is less than the actual animation duration, the animation starts its first frame from the - * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation - * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the - * duration of a single animation multiplied by the number of animation playback times. - * @return 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 12 - */ + * @brief 设置关键帧动画的整体延时时间,单位为ms(毫秒),默认不延时播放。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 动画延迟播放时间,单位为ms(毫秒)。取值范围:(-∞, +∞)。默认值:0,表示不延迟。value大于0为延迟播放,value小于0表示提前播放。对于value小于0的情况: + * 当value的绝对值小于实际动画时长,动画将在开始后第一帧直接运动到value绝对值的时刻的状态;当value的绝对值大于等于实际动画时长,动画将在开始后第一帧直接运动到终点状态。 + * 其中实际动画时长等于单次动画时长乘以动画播放次数。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetDelay(ArkUI_KeyframeAnimateOption* option, int32_t value); /** - * @brief Sets the number of times that the keyframe animation is played. By default, the animation is played once. The - * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that - * no animation is played. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, - * the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number - * of times. Default value: **1**, indicating that the animation is played once. - *
If the value is less than **-1**, the operation is invalid, and the error code - * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置关键帧动画的动画播放次数。默认播放一次,设置为-1时表示无限次播放,设置为0时表示无动画效果。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 动画播放次数。取值范围:[-1, +∞),其中设置为0时不播放,-1表示无限次播放。默认值:1,表示播放一次。 + *
value小于-1时,操作无效,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetIterations(ArkUI_KeyframeAnimateOption* option, int32_t value); /** - * @brief Sets the callback invoked when the keyframe animation playback is complete. This function is called after the - * {@link keyframe animation} has played for the specified number of times. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param userData Pointer to a custom object. - *
Abnormal value processing is not involved. - * @param onFinish Indicates the callback. - * @return 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 12 - */ + * @brief 设置关键帧动画播放完成回调。当关键帧动画{@link ArkUI_KeyframeAnimateOption}所有次数播放完成后调用。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param userData 用户自定义对象指针。 + *
不涉及异常值处理。 + * @param onFinish Indicates the callback. + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback( ArkUI_KeyframeAnimateOption* option, void* userData, void (*onFinish)(void* userData)); /** - * @brief Sets the expected frame rate for a keyframe animation. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param frameRate Expected frame rate for the keyframe animation. - *
If **frameRate** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 19 - */ + * @brief 设置关键帧动画期望帧率。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param frameRate 关键帧动画的期望帧率。 + *
frameRate为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 19 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetExpectedFrameRate( ArkUI_KeyframeAnimateOption* option, ArkUI_ExpectedFrameRateRange* frameRate); /** - * @brief Sets the duration of a keyframe animation, in milliseconds. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Keyframe animation duration, in ms. The default value is 1000 ms. Value range: [0, +∞). - *
If the value is less than 0, **0** is used. - * @param index Index of the keyframe state segment. - *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置关键帧动画某段关键帧动画的持续时间,单位为ms(毫秒)。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 关键帧动画的持续时间,单位为ms(毫秒),默认值1000ms。取值范围:[0, +∞)。 + *
value小于0时,按0处理。 + * @param index 状态索引值。 + *
index小于0时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetDuration(ArkUI_KeyframeAnimateOption* option, int32_t value, int32_t index); /** - * @brief Sets the animation curve for a specific keyframe animation segment. - * - * @note Because the springMotion, responsiveSpringMotion, and interpolatingSpring curves do not - * have effective duration settings, they are not supported. - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Animation curve to set. Default value: {@link ARKUI_CURVE_EASE_IN_OUT}. - * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of - * keyframe animation states. - *
If the value of **index** is less than 0 or out of range, the error code - * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置关键帧动画某段关键帧使用的动画曲线。 + * + * @note Because the springMotion, responsiveSpringMotion, and interpolatingSpring curves do not + * have effective duration settings, they are not supported. + * @param option 关键帧动画参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 该关键帧使用的动画曲线。默认值:{@link ARKUI_CURVE_EASE_IN_OUT}。 + * @param index 状态索引值。取值范围:[0, size-1],其中size为关键帧动画状态数。 + *
index小于0或index超出范围时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetCurve( ArkUI_KeyframeAnimateOption* option, ArkUI_CurveHandle value, int32_t index); /** - * @brief Sets the closure function of the state at the time of the keyframe, that is, the state to be reached at the - * time of the keyframe. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param event Indicates a closure function. - * @param userData Pointer to a user-defined object. - *
Abnormal value processing is not involved. - * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of - * keyframe animation states. - *
If the value of **index** is less than 0 or out of range, the error code - * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置关键帧时刻状态的闭包函数,即在该关键帧时刻要达到的状态。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param event Indicates a closure function. + * @param userData 用户定义对象指针。 + *
不涉及异常值处理。 + * @param index 状态索引值。取值范围:[0, size-1],其中size为关键帧动画状态数。 + *
index小于0或index超出范围时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnEventCallback( ArkUI_KeyframeAnimateOption* option, void* userData, void (*event)(void* userData), int32_t index); /** - * @brief Obtains the overall delay of a keyframe animation, in milliseconds. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **0** is returned. - * @return Overall delay, in milliseconds. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief 获取关键帧整体延时时间,单位为ms(毫秒)。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回0。 + * @return 整体延时时间,单位为ms(毫秒)。option异常时返回0。 + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_GetDelay(ArkUI_KeyframeAnimateOption* option); /** - * @brief Obtains the number of times that a keyframe animation is played. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **0** is returned. - * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief 获取关键帧动画播放次数。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回0。 + * @return 动画播放次数。option异常时返回0。 + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_GetIterations(ArkUI_KeyframeAnimateOption* option); /** - * @brief Obtains the expected frame rate from keyframe animation parameters. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **NULL** is returned. - * @return Returns the expected frame rate obtained. If **option** is invalid, **NULL** is returned. - * @since 19 - */ + * @brief 获取关键帧动画参数的期望帧率。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回NULL。 + * @return 关键帧动画参数的期望帧率。option异常时返回NULL。 + * @since 19 + */ ArkUI_ExpectedFrameRateRange* OH_ArkUI_KeyframeAnimateOption_GetExpectedFrameRate(ArkUI_KeyframeAnimateOption* option); /** - * @brief Obtains the duration of a specific state in a keyframe animation, in milliseconds. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **0** is returned. - * @param index Index of the keyframe state segment. - *
If the value of **index** is less than 0, **0** is returned. - * @return Duration, in milliseconds. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief 获取关键帧动画某段状态持续时间,单位为ms(毫秒)。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回0。 + * @param index 状态索引值。 + *
index小于0时,返回0。 + * @return 持续时间,单位为ms(毫秒)。option异常时返回0。 + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_GetDuration(ArkUI_KeyframeAnimateOption* option, int32_t index); /** - * @brief Obtains the animation curve of a specific state in a keyframe animation. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **NULL** is returned. - * @param index Index of the keyframe state segment. - *
If the value of **index** is less than 0, **NULL** is returned. - * @return Animation curve. If the parameter is abnormal, **NULL** is returned. - * @since 12 - */ + * @brief 获取关键帧动画某段状态动画曲线。 + * + * @param option 关键帧动画参数。 + *
option为NULL时,返回NULL。 + * @param index 状态索引值。 + *
index小于0时,返回NULL。 + * @return 动画曲线。参数异常时返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_KeyframeAnimateOption_GetCurve(ArkUI_KeyframeAnimateOption* option, int32_t index); /** - * @brief Creates an **AnimatorOption** object. - * - * @note When keyframeSize is greater than 0, the animation interpolation start point is 0, and the animation - * interpolation end point is 1; no setting is allowed. - * @param keyframeSize Number of keyframes. - *
If the value of **keyframeSize** is less than 0, **NULL** is returned. - * @return Pointer to the animator parameter object. If the value of **size** is less than 0 or if **option** is - * abnormal, **NULL** is returned. - * @since 12 - */ + * @brief 创建animator动画对象参数。 + * + * @note When keyframeSize is greater than 0, the animation interpolation start point is 0, and the animation + * interpolation end point is 1; no setting is allowed. + * @param keyframeSize 关键帧个数。 + *
keyframeSize小于0时返回NULL。 + * @return animator动画对象参数指针。size小于0时返回NULL,option异常时返回NULL。 + * @since 12 + */ ArkUI_AnimatorOption* OH_ArkUI_AnimatorOption_Create(int32_t keyframeSize); /** - * @brief Disposes of an **AnimatorOption** object. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the operation is invalid. - * @since 12 - */ + * @brief 销毁animator动画对象参数。 + * + * @param option animator动画对象参数。 + *
option为NULL时,操作无效。 + * @since 12 + */ void OH_ArkUI_AnimatorOption_Dispose(ArkUI_AnimatorOption* option); /** - * @brief Sets the duration of an animator animation, in milliseconds. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Playback duration, in ms. The default value is 0 ms. Value range: [0, +∞). - *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置animator动画播放的时长,单位毫秒。 + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 播放的时长,单位为ms(毫秒),默认值0ms。取值范围:[0, +∞)。 + *
value小于0时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetDuration(ArkUI_AnimatorOption* option, int32_t value); /** - * @brief Sets the delay time of the animator playback, in milliseconds. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation - * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A - * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute - * value of **value** is less than the actual animation duration, the animation starts its first frame from the - * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation - * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the - * duration of a single animation multiplied by the number of animation playback times. - * @return 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 12 - */ + * @brief 设置animator动画延时播放的时间,单位为ms(毫秒)。 + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 动画延迟播放时间,单位为ms(毫秒)。取值范围:(-∞, +∞)。默认值:0,表示不延迟。value大于0为延迟播放,value小于0表示提前播放。对于value小于0的情况: + * 当value的绝对值小于实际动画时长,动画将在开始后第一帧直接运动到value绝对值的时刻的状态;当value的绝对值大于等于实际动画时长,动画将在开始后第一帧直接运动到终点状态。 + * 其中实际动画时长等于单次动画时长乘以动画播放次数。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetDelay(ArkUI_AnimatorOption* option, int32_t value); /** - * @brief Sets the number of times that an animator animation is played. By default, the animation is played once. The - * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that - * no animation is played. - * - * @note If this parameter is set to a negative value other than -1, the value is invalid. In this case, the - * animation is played once. - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Value range: [-1, +∞). If this parameter is set to **0**, the animation is not played. If this - * parameter is set to **-1**, the animation is played for an infinite number of times. Default value: **1** ( - * played once). - *
If the value is less than -1, the operation is invalid. - * @return 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 12 - */ + * @brief 设置animator动画播放次数。默认播放一次,设置为-1时表示无限次播放,设置为0时表示无动画效果。 + * + * @note If this parameter is set to a negative value other than -1, the value is invalid. In this case, the + * animation is played once. + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 取值范围:[-1, +∞),其中设置为0时不播放,-1表示无限次播放。默认值:1(播放一次)。 + *
value小于-1时,操作无效。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetIterations(ArkUI_AnimatorOption* option, int32_t value); /** - * @brief Sets the status of the component before and after the animator animation execution. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Status of the component before and after the animator animation execution. Default value: - * {@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}. - *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置animator动画执行时组件在动画开始前和结束后的状态。 + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 动画执行时组件在动画开始前和结束后的状态。默认值:{@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}。 + *
value小于0时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetFill(ArkUI_AnimatorOption* option, ArkUI_AnimationFillMode value); /** - * @brief Set the playback direction. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Animation playback direction. - *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置animator动画播放方向。 + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 动画播放方向。 + *
value小于0时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetDirection(ArkUI_AnimatorOption* option, ArkUI_AnimationDirection value); /** - * @brief Sets the interpolation curve for the animation of an animator. - * - * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, - * and customCurve curves are not supported. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Interpolation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use - * {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. - *
If **value** is set to **NULL**, the default curve {@link ARKUI_CURVE_LINEAR} is used. - * @return 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 12 - */ + * @brief 设置animator动画插值曲线。 + * + * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, + * and customCurve curves are not supported. + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 动画插值曲线。默认值:{@link ARKUI_CURVE_LINEAR},建议使用{@link ARKUI_CURVE_EASE_IN_OUT}获得更平滑的动画效果。 + *
value为NULL时,使用默认曲线{@link ARKUI_CURVE_LINEAR}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value); /** - * @brief Sets the interpolation start point of an animation. - * - * @note This API does not take effect when the animation is a keyframe animation. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Interpolation start point of the animation. Value range: (-∞, +∞). - * @return 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 12 - */ + * @brief 设置animator动画插值起点。 + * + * @note This API does not take effect when the animation is a keyframe animation. + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 动画插值起点。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetBegin(ArkUI_AnimatorOption* option, float value); /** - * @brief Sets the interpolation end point for the animation of an animator. - * - * @note This API does not take effect when the animation is a keyframe animation. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Interpolation end point of the animation. Value range: (-∞, +∞). - * @return 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 12 - */ + * @brief 设置animator动画插值终点。 + * + * @note This API does not take effect when the animation is a keyframe animation. + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 动画插值终点。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetEnd(ArkUI_AnimatorOption* option, float value); /** - * @brief Sets the expected frame rate range of an animation. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Expected frame rate range. - *
If **value** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置animator动画期望的帧率范围。 + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 期望的帧率范围对象。 + *
value为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange( ArkUI_AnimatorOption* option, ArkUI_ExpectedFrameRateRange* value); /** - * @brief Sets the keyframe parameters of an animator animation. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param time Keyframe time. Value range: [0, 1]. The value must be in ascending order. Default value: evenly - * distributed by index (for example, **0.0** for the first frame, **0.5** for the second frame, and **1.0** for - * the third frame). - *
If the value of **time** is less than 0 or greater than 1, the error code - * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Keyframe value. Value range: (-∞, +∞). - * @param index Keyframe index. - *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置animator动画关键帧参数。 + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param time 关键帧时间。取值范围:[0, 1], 必须是递增。默认值:按索引均匀分布(如第1帧为0.0,第2帧为0.5,第3帧为1.0)。 + *
time小于0或time大于1时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 关键帧数值。取值范围:(-∞, +∞)。 + * @param index 关键帧的索引值。 + *
index小于0时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetKeyframe( ArkUI_AnimatorOption* option, float time, float value, int32_t index); /** - * @brief Sets the keyframe curve type for the animation of an animator. - * - * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, - * and customCurve curves are not supported. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Interpolation curve. Default value: **NULL**, indicating linear interpolation. - * @param index Keyframe index. - *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief 设置animator动画关键帧曲线类型。 + * + * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, + * and customCurve curves are not supported. + * + * @param option animator动画对象参数。 + *
option为NULL时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @param value 动画插值曲线。默认值:NULL,表示线性插值。 + * @param index 关键帧的索引值。 + *
index小于0时,返回错误码{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_SetKeyframeCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value, int32_t index); + /** - * @brief Obtains the duration for playing an animation. - * - * @param option Animator animation parameters. - *
If **option** is set to **NULL**, **0** is returned. - * @return Duration for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief 获取animator动画播放的时长。 + * + * @param option animator动画参数。 + *
option为NULL时,返回0。 + * @return 动画播放的时长,单位毫秒。option异常时返回0。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_GetDuration(ArkUI_AnimatorOption* option); /** - * @brief Obtains the delay for playing an animation. - * - * @param option Animator animation parameters. If **option** is set to **NULL**, **0** is returned. - * @return Delay for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief 获取animator动画延时播放时长。 + * + * @param option animator动画参数。option为NULL时,返回0。 + * @return 动画延时播放时长,单位毫秒。option异常时返回0。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_GetDelay(ArkUI_AnimatorOption* option); /** - * @brief Obtains the number of times that an animator animation is played. - * - * @param option Animator parameters. If **option** is set to **NULL**, **0** is returned. - * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief 获取animator动画播放次数。 + * + * @param option animator动画动画参数。option为NULL时,返回0。 + * @return 动画播放次数。option异常时返回0。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_GetIterations(ArkUI_AnimatorOption* option); /** - * @brief Obtains the status of the component before and after the animator animation execution. - * - * @param option Animator animation parameters. - * @return Status of the component before and after the animator animation execution. If **option** is invalid,**-1** - * is returned. - * @since 12 - */ + * @brief 获取animator动画执行时组件在动画开始前和结束后的状态。 + * + * @param option animator动画参数。 + * @return 动画执行时组件在动画开始前和结束后的状态。option异常时返回-1。 + * @since 12 + */ ArkUI_AnimationFillMode OH_ArkUI_AnimatorOption_GetFill(ArkUI_AnimatorOption* option); /** - * @brief Obtains the playback direction of an animator animation. - * - * @param option Animator animation parameters. - * @return Animation playback direction. If **option** is invalid,**-1** is returned. - * @since 12 - */ + * @brief 获取animator动画播放方向。 + * + * @param option animator动画参数。 + * @return 动画播放方向。option异常时返回-1。 + * @since 12 + */ ArkUI_AnimationDirection OH_ArkUI_AnimatorOption_GetDirection(ArkUI_AnimatorOption* option); /** - * @brief Obtains the interpolation curve of the animation of an animator. - * - * @param option Animator animation parameters. - * @return Interpolation curve. If **option** is invalid, **NULL** is returned. - * @since 12 - */ + * @brief 获取animator动画插值曲线。 + * + * @param option animator动画参数。 + * @return 动画插值曲线。option异常时返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetCurve(ArkUI_AnimatorOption* option); /** - * @brief Obtains the interpolation start point of an animation. - * - * @param option Animator animation parameters. - * @return Interpolation start point of the animation. If **option** is invalid, **0.0** is returned. - * @since 12 - */ + * @brief 获取animator动画插值起点。 + * + * @param option animator动画参数。 + * @return 动画插值起点。option异常时返回0.0。 + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetBegin(ArkUI_AnimatorOption* option); /** - * @brief Obtains the interpolation end point of an animation. - * - * @param option Animator animation parameters. - * @return Interpolation end point of the animation. If **option** is invalid, **0.0** is returned. - * @since 12 - */ + * @brief 获取animator动画插值终点。 + * + * @param option animator动画参数。 + * @return 动画插值终点。option异常时返回0.0。 + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetEnd(ArkUI_AnimatorOption* option); /** - * @brief Obtains the expected frame rate range of an animator animation. - * - * @param option Animator animation parameters. - * @return Pointer to the expected frame rate range object. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 获取animator动画期望的帧率范围。 + * + * @param option animator动画参数。 + * @return 期望的帧率范围对象指针。函数参数异常时返回NULL。 + * @since 12 + */ ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimatorOption_GetExpectedFrameRateRange(ArkUI_AnimatorOption* option); /** - * @brief Obtains the keyframe time of the animator playback, in milliseconds. - * - * @param option Animator parameters. - * @param index Keyframe index. - * @return Keyframe time, in milliseconds. - * @since 12 - */ + * @brief 获取animator动画关键帧时间,单位为ms(毫秒)。 + * + * @param option animator动画对象参数。 + * @param index 关键帧的索引值。 + * @return 关键帧时间,单位为ms(毫秒)。 + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetKeyframeTime(ArkUI_AnimatorOption* option, int32_t index); /** - * @brief Obtains the keyframe value of an animation. - * - * @param option Animator parameters. - * @param index Keyframe index. - * @return Keyframe value. - * @since 12 - */ + * @brief 获取animator动画关键帧数值。 + * + * @param option animator动画对象参数。 + * @param index 关键帧的索引值。 + * @return 关键帧数值。 + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetKeyframeValue(ArkUI_AnimatorOption* option, int32_t index); /** - * @brief Obtains the interpolation curve for a keyframe in the animation of an animator. - * - * @param option Animator parameters. - * @param index Keyframe index. - * @return Interpolation curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 获取animator动画关键帧动画插值曲线。 + * + * @param option animator动画对象参数。 + * @param index 关键帧的索引值。 + * @return 动画插值曲线。函数参数异常时返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetKeyframeCurve(ArkUI_AnimatorOption* option, int32_t index); /** - * @brief Obtains the user-defined object in an animation event object. - * - * @param event Animation event object. - * @return User-defined object. - * @since 12 - */ + * @brief 获取动画事件对象中的用户自定义对象。 + * + * @param event 动画事件对象。 + * @return 用户自定义对象。 + * @since 12 + */ void* OH_ArkUI_AnimatorEvent_GetUserData(ArkUI_AnimatorEvent* event); /** - * @brief Obtains the user-defined object in the frame event of an animation. - * - * @param event Animation event object. - * @return User-defined object. - * @since 12 - */ + * @brief 获取动画的帧事件中的用户自定义对象。 + * + * @param event 动画事件对象。 + * @return 用户自定义对象。 + * @since 12 + */ void* OH_ArkUI_AnimatorOnFrameEvent_GetUserData(ArkUI_AnimatorOnFrameEvent* event); /** - * @brief Obtains the interpolation result in the animation frame callback event object. - * - * @param event Animation event object. - * @return Animation interpolation result. - *
**NOTE** - *
During the animation, the interpolation result changes between the interpolation start point - * {@link OH_ArkUI_AnimatorOption_SetBegin} and the interpolation end point {@link OH_ArkUI_AnimatorOption_SetEnd} - * based on the animation parameters. - * @since 12 - */ + * @brief 获取动画帧回调事件对象中的插值结果。 + * + * @param event 动画事件对象。 + * @return 动画插值结果。 + * **说明:** + * 在动画过程中,插值结果根据动画参数在插值起点{@link OH_ArkUI_AnimatorOption_SetBegin}和插值终点{@link OH_ArkUI_AnimatorOption_SetEnd}间变化。 + * @since 12 + */ float OH_ArkUI_AnimatorOnFrameEvent_GetValue(ArkUI_AnimatorOnFrameEvent* event); /** - * @brief Sets the callback invoked when the animator receives a frame. - * - * @param option Animator animation parameters. - * @param userData User-defined parameter. - * @param callback Indicates the callback to set. - * @return 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 12 - */ + * @brief 设置animator动画接收到帧时回调。 + * + * @param option animator动画参数。 + * @param userData 用户自定义参数。 + * @param callback Indicates the callback to set. + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnFrameCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorOnFrameEvent* event)); /** - * @brief Sets the callback invoked when the animation playback is complete. - * - * @param option Animator animation parameters. - * @param userData User-defined parameter. - * @param callback Indicates the callback to set. - * @return 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 12 - */ + * @brief 设置animator动画完成时回调。 + * + * @param option animator动画参数。 + * @param userData 用户自定义参数。 + * @param callback Indicates the callback to set. + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnFinishCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); /** - * @brief Sets the callback invoked when the animation playback is canceled. - * - * @param option Animator animation parameters. - * @param userData User-defined parameter. - * @param callback Indicates the callback to set. - * @return 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 12 - */ + * @brief 设置animator动画被取消时回调。 + * + * @param option animator动画参数。 + * @param userData 用户自定义参数。 + * @param callback Indicates the callback to set. + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnCancelCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); /** - * @brief Sets the callback invoked when the animation playback is repeated. - * - * @param option Animator animation parameters. - * @param userData User-defined parameter. - * @param callback Indicates the callback to set. - * @return 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 12 - */ + * @brief 设置animator动画重复时回调。 + * + * @param option animator动画参数。 + * @param userData 用户自定义参数。 + * @param callback Indicates the callback to set. + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); /** - * @brief Resets the animation of an animator. - * - * @param animatorHandle Animator object. - * @param option Animator animation parameters. - * @return 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 12 - */ + * @brief 重置animator动画。 + * + * @param animatorHandle animator动画对象。 + * @param option animator动画参数。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_Animator_ResetAnimatorOption( ArkUI_AnimatorHandle animatorHandle, ArkUI_AnimatorOption* option); /** - * @brief Starts the animation of an animator. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief 启动animator动画。 + * + * @param animatorHandle animator动画对象。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_Animator_Play(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Ends the animation of an animator. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief 结束animator动画。 + * + * @param animatorHandle animator动画对象。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_Animator_Finish(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Pauses the animation of an animator. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief 暂停animator动画。 + * + * @param animatorHandle animator动画对象。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_Animator_Pause(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Cancels the animation of an animator. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief 取消animator动画。 + * + * @param animatorHandle animator动画对象。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_Animator_Cancel(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Plays this animation in reverse order. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief 以相反的顺序播放animator动画。 + * + * @param animatorHandle animator动画对象。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_Animator_Reverse(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Implements initialization for the interpolation curve, which is used to create an interpolation curve based - * on the input parameter. - * - * @param curve Curve type. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 插值曲线的初始化函数,可以根据入参创建一个插值曲线对象。 + * + * @param curve 曲线类型。 + * @return 曲线的插值对象指针。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType(ArkUI_AnimationCurve curve); /** - * @brief Creates a step curve. - * - * @param count Number of steps. The value must be a positive integer. Value range: [1, +∞). - *
If the value of **count** is abnormal, the operation is invalid. - * @param end Whether the step change occurs at the start or end of each interval. **true**: The step change occurs at - * the end of each interval. **false**: The step change occurs at the start of each interval. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 构造阶梯曲线对象。 + * + * @param count 阶梯的数量,需要为正整数,取值范围:[1, +∞)。 + *
count值异常时,操作无效。 + * @param end 在每个间隔的起点或是终点发生阶跃变化。true:在终点发生阶跃变化。false:在起点发生阶跃变化。 + * @return 曲线的插值对象指针。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve(int32_t count, bool end); /** - * @brief Creates a cubic Bezier curve. - * - * @param x1 X-coordinate of the first point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated - * as **0**. A value greater than 1 is treated as **1**. - * @param y1 Y-coordinate of the first point on the Bezier curve. - * @param x2 X-coordinate of the second point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated - * as **0**. A value greater than 1 is treated as **1**. - * @param y2 Y-coordinate of the second point on the Bezier curve. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 构造三阶贝塞尔曲线对象。 + * + * @param x1 确定贝塞尔曲线第一点横坐标,取值范围:[0, 1]。设置的值小于0时,按0处理;设置的值大于1时,按1处理。 + * @param y1 确定贝塞尔曲线第一点纵坐标。 + * @param x2 确定贝塞尔曲线第二点横坐标,取值范围:[0, 1]。设置的值小于0时,按0处理;设置的值大于1时,按1处理。 + * @param y2 确定贝塞尔曲线第二点纵坐标。 + * @return 曲线的插值对象指针。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve(float x1, float y1, float x2, float y2); /** - * @brief Creates a spring curve. The curve shape is determined by the spring parameters, and the animation duration is - * controlled by the **duration** parameter in {@link animation} and {@link animateTo}. - * - * @param velocity Initial velocity. It is applied by external factors to the spring animation, designed to help - * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its - * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute - * change value. - * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of - * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the - * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. In an - * elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the - * speed of restoring to the equilibrium position. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. - * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the - * oscillation amplitude. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 构造弹簧曲线对象,曲线形状由弹簧参数决定,动画时长受{@link animation}、{@link animateTo}中的duration参数控制。 + * + * @param velocity 初始速度。是由外部因素对弹性动效产生的影响参数,其目的是保证对象从之前的运动状态平滑的过渡到弹性动效。该速度是归一化速度,其值等于动画开始时的实际速度除以动画属性改变值。 + * @param mass 质量。弹性系统的受力对象,会对弹性系统产生惯性影响。质量越大,震荡的幅度越大,恢复到平衡位置的速度越慢。取值范围:[0, +∞)。 + *
value小于等于0时,按1处理。 + * @param stiffness 刚度。是物体抵抗施加的力而形变的程度。在弹性系统中,刚度越大,抵抗变形的能力越强,恢复到平衡位置的速度就越快。取值范围:[0, +∞)。 + *
value小于等于0时,按1处理。 + * @param damping 阻尼。用于描述系统在受到扰动后震荡及衰减的情形。阻尼越大,弹性运动的震荡次数越少、震荡幅度越小。取值范围:[0, +∞)。 + *
value小于等于0时,按1处理。 + * @return 曲线的插值对象指针。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve(float velocity, float mass, float stiffness, float damping); /** - * @brief Creates a spring animation curve. If multiple spring animations are applied to the same attribute of an - * object, each animation replaces their predecessor and inherits the velocity. - * - * @note The animation duration is subject to the curve parameters, rather than the duration parameter in - * animation or animateTo. - * - * @param response Duration of one complete oscillation. Value range: (0, +∞). - *
If the value is less than or equal to 0, **0.55** is used. - * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the - * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium - * gradually. Value range: (0, +∞). - *
If the value is less than or equal to 0, **0.825** is used. - * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** - * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). - *
If the value is less than 0, **0** is used. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 构造弹性动画曲线对象。如果对同一对象的同一属性进行多个弹性动画,每个动画会替换掉前一个动画,并继承之前的速度。 + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * @param response 弹簧自然振动周期,决定弹簧复位的速度。取值范围:(0, +∞)。 + *
参数小于等于0时,按0.55处理。 + * @param dampingFraction 阻尼系数。大于0小于1的值为欠阻尼,运动过程中会超出目标值;等于1为临界阻尼;大于1为过阻尼,运动过程中逐渐趋于目标值。取值范围:(0, +∞)。 + *
参数小于等于0时,按0.825处理。 + * @param overlapDuration 弹性动画衔接时长。发生动画继承时,如果前后两个弹性动画response不一致,response参数会在overlapDuration时间内平滑过渡。取值范围:[0, +∞)。 + *
参数小于0时,按0处理。 + * @return 曲线的插值对象指针。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion(float response, float dampingFraction, float overlapDuration); /** - * @brief Creates a responsive spring animation curve. It is a special case of **springMotion**, with the only - * difference in the default values. It can be used together with **springMotion**. - * - * @note The animation duration is subject to the curve parameters, rather than the duration parameter in - * animation or animateTo. - * - * @param response Duration of one complete oscillation. Value range: (0, +∞). - *
If the value is less than or equal to 0, **0.15** is used. - * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the - * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium - * gradually. Value range: [0, +∞). - *
If the value is less than 0, **0.86** is used. - * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** - * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). - *
If the value is less than 0, **0.25** is used. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 构造弹性跟手动画曲线对象,是springMotion的一种特例,仅默认参数不同,可与springMotion混合使用。 + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * @param response 弹簧自然振动周期,决定弹簧复位的速度。取值范围:(0, +∞)。 + *
参数小于等于0时,按0.15处理。 + * @param dampingFraction 阻尼系数。大于0小于1的值为欠阻尼,运动过程中会超出目标值;等于1为临界阻尼;大于1为过阻尼,运动过程中逐渐趋于目标值。取值范围:[0, +∞)。 + *
参数小于0时,按0.86处理。 + * @param overlapDuration 弹性动画衔接时长。发生动画继承时,如果前后两个弹性动画response不一致,response参数会在overlapDuration时间内平滑过渡。取值范围:[0, +∞)。 + *
参数小于0时,按0.25处理。 + * @return 曲线的插值对象指针。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion( float response, float dampingFraction, float overlapDuration); /** - * @brief Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based on - * the curve. - * - * @note The animation duration is subject to the curve parameters, rather than the duration parameter in - * animation or animateTo. - * - * - * @param velocity Initial velocity. It is applied by external factors to the spring animation, designed to help - * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its - * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute - * change value. - * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of - * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the - * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. The greater - * the stiffness, the stronger the ability to resist deformation, and the faster the speed of restoring to the - * equilibrium position. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. - * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the - * oscillation amplitude. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 构造插值器弹簧曲线对象,生成一条从0到1的动画曲线,实际动画值根据曲线进行插值计算。 + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * + * @param velocity 初始速度。外部因素对弹性动效产生的影响参数,目的是保证对象从之前的运动状态平滑地过渡到弹性动效。该速度是归一化速度,其值等于动画开始时的实际速度除以动画属性改变值。 + * @param mass 质量。弹性系统的受力对象,会对弹性系统产生惯性影响。质量越大,震荡的幅度越大,恢复到平衡位置的速度越慢。取值范围:[0, +∞)。 + *
value小于等于0时,按1处理。 + * @param stiffness 刚度。表示物体抵抗施加的力而形变的程度。刚度越大,抵抗变形的能力越强,恢复到平衡位置的速度越快。取值范围:[0, +∞)。 + *
value小于等于0时,按1处理。 + * @param damping 阻尼。用于描述系统在受到扰动后震荡及衰减的情形。阻尼越大,弹性运动的震荡次数越少、震荡幅度越小。取值范围:[0, +∞)。 + *
value小于等于0时,按1处理。 + * @return 曲线的插值对象指针。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring(float velocity, float mass, float stiffness, float damping); /** - * @brief Creates a custom curve. - * - * @param userData Pointer to user-defined data. - * @param interpolate Indicates the custom interpolation callback. fraction indicates the input x value for - * interpolation when the animation starts; value range: [0,1]. - * The return value is the y value of the curve; value range: [0,1]. - * If fraction is 0, the return value 0 corresponds to the animation start point; any other - * return - * value means that the animation jumps at the start point. - * If fraction is 1, the return value 1 corresponds to the animation end point; any other - * return - * value means that the end value of the animation is not the value of the state variable, - * which will result in an effect of transition from that end value to the value of the state variable. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 构造自定义曲线对象。 + * + * @param userData 用户自定义数据。 + * @param interpolate Indicates the custom interpolation callback. fraction indicates the input x value for + * interpolation when the animation starts; value range: [0,1]. + * The return value is the y value of the curve; value range: [0,1]. + * If fraction is 0, the return value 0 corresponds to the animation start point; any other + * return + * value means that the animation jumps at the start point. + * If fraction is 1, the return value 1 corresponds to the animation end point; any other + * return + * value means that the end value of the animation is not the value of the state variable, + * which will result in an effect of transition from that end value to the value of the state variable. + * @return 曲线的插值对象指针。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve( void* userData, float (*interpolate)(float fraction, void* userdata)); /** - * @brief Disposes of a custom curve. - * - * @param curveHandle Pointer to the interpolation object of the curve. - * @since 12 - */ + * @brief 销毁自定义曲线对象。 + * + * @param curveHandle 曲线的插值对象指针。 + * @since 12 + */ void OH_ArkUI_Curve_DisposeCurve(ArkUI_CurveHandle curveHandle); /** - * @brief Creates an opacity effect object for component transitions. - * - * @note If the value specified is less than 0, the value 0 is used. If the value specified is greater than 1, - * the value 1 is used. - * @param opacity Opacity. Value range: [0, 1]. The default value is **1**. A value less than 0 is treated as 0. A - * value greater than 1 is treated as 1. The value **1** means fully opaque, and **0** means fully transparent. - * @return Opacity effect object for component transitions. - * @since 12 - */ + * @brief 创建组件转场时的透明度效果对象。 + * + * @note If the value specified is less than 0, the value 0 is used. If the value specified is greater than 1, + * the value 1 is used. + * @param opacity 透明度,取值范围为[0, 1]。默认值为1。设置小于0的非法值按0处理,大于1的非法值按1处理,1表示不透明,0表示完全透明。 + * @return 组件转场时的透明度效果对象。 + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateOpacityTransitionEffect(float opacity); /** - * @brief Creates a translation effect object for component transitions. - * - * @param translate Translation parameter object for component transitions. - * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 创建组件转场时的平移效果对象。 + * + * @param translate 组件转场时的平移参数对象。 + * @return 组件转场时的平移效果对象。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateTranslationTransitionEffect(ArkUI_TranslationOptions* translate); /** - * @brief Creates a scaling effect object for component transitions. - * - * @param scale Scaling parameter object for component transitions. - * @return Scaling effect object for component transitions. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 创建组件转场时的缩放效果对象。 + * + * @param scale 组件转场时的缩放参数对象。 + * @return 组件转场时的缩放效果对象。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateScaleTransitionEffect(ArkUI_ScaleOptions* scale); /** - * @brief Creates a rotation effect object for component transition. - * - * @param rotate Rotation parameter object for component transitions. - * @return Rotation effect object for component transitions. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 创建组件转场时的旋转效果对象。 + * + * @param rotate 组件转场时的旋转参数对象。 + * @return 组件转场时的旋转效果对象。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateRotationTransitionEffect(ArkUI_RotationOptions* rotate); /** - * @brief Creates a movement transition effect object for the component. - * - * @param edge Movement transition type. - * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 创建组件平移效果对象。 + * + * @param edge 平移类型。 + * @return 组件转场时的平移效果对象。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateMovementTransitionEffect(ArkUI_TransitionEdge edge); /** - * @brief Creates an asymmetric transition effect. - * - * @note If the asymmetric function is not used for TransitionEffect, the transition effect takes effect - * for both appearance and disappearance of the component. - * @param appear Transition effect for appearance. - * @param disappear Transition effect for disappearance. - * @return Asymmetric transition effect. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief 创建非对称的转场效果对象。 + * + * @note If the asymmetric function is not used for TransitionEffect, the transition effect takes effect + * for both appearance and disappearance of the component. + * @param appear 出现的转场效果。 + * @param disappear 消失的转场效果。 + * @return 非对称的转场效果对象。如果参数异常返回NULL。 + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateAsymmetricTransitionEffect( ArkUI_TransitionEffect* appear, ArkUI_TransitionEffect* disappear); /** - * @brief Disposes of a transition effect. - * - * @param effect Pointer to the transition effect to be disposed. - * @since 12 - */ + * @brief 销毁转场效果对象。 + * + * @param effect 转场效果对象。 + * @since 12 + */ void OH_ArkUI_TransitionEffect_Dispose(ArkUI_TransitionEffect* effect); /** - * @brief Sets a combination of transition effects. - * - * @param firstEffect Transition effect. - * @param secondEffect Combination of transition effects. - * @return 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 12 - */ + * @brief 设置转场效果链式组合,以形成包含多种转场效果的TransitionEffect。 + * + * @param firstEffect 转场效果。 + * @param secondEffect 需要链式转场效果。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_TransitionEffect_Combine( ArkUI_TransitionEffect* firstEffect, ArkUI_TransitionEffect* secondEffect); /** - * @brief Sets transition effect animation settings. - * - * @note If combine is used for combining transition effects, the animation settings of a transition effect are - * applicable to the one following it. - * @param effect Transition effect. - * @param animation Animation settings. - * @return 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 12 - */ + * @brief 设置转场效果动画参数。 + * + * @note If combine is used for combining transition effects, the animation settings of a transition effect are + * applicable to the one following it. + * @param effect 转场效果。 + * @param animation 属性显示动画效果相关参数。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 12 + */ int32_t OH_ArkUI_TransitionEffect_SetAnimation( ArkUI_TransitionEffect* effect, ArkUI_AnimateOption* animation); #ifdef __cplusplus From 9d71d1e096fc9564b2177048b1ca9083f2754ad9 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Thu, 11 Jun 2026 16:04:59 +0800 Subject: [PATCH 21/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: opencode (qwen3.6-plus) Change-Id: I13a01fbb313f86e55e8b13520f2b4440ce161441 --- arkui/ace_engine/native/native_animate.h | 1822 +++++++++++----------- 1 file changed, 911 insertions(+), 911 deletions(-) diff --git a/arkui/ace_engine/native/native_animate.h b/arkui/ace_engine/native/native_animate.h index 96f6805ee..a01a5c491 100644 --- a/arkui/ace_engine/native/native_animate.h +++ b/arkui/ace_engine/native/native_animate.h @@ -50,10 +50,10 @@ extern "C" { #endif /** -* @brief Defines the expected frame rate range of the animation. -* -* @since 12 -*/ + * @brief Defines the expected frame rate range of the animation. + * + * @since 12 + */ typedef struct { /** * Expected minimum frame rate, in fps. @@ -70,10 +70,10 @@ typedef struct { } ArkUI_ExpectedFrameRateRange; /** -* @brief Defines the callback type for when the animation playback is complete. -* -* @since 12 -*/ + * @brief Defines the callback type for when the animation playback is complete. + * + * @since 12 + */ typedef struct { /** * Callback type for when the animation playback is complete. @@ -90,17 +90,17 @@ typedef struct { } ArkUI_AnimateCompleteCallback; /** -* @brief Defines the animation configuration. -* -* @since 12 -*/ + * @brief Defines the animation configuration. + * + * @since 12 + */ typedef struct ArkUI_AnimateOption ArkUI_AnimateOption; /** -* @brief Defines an interpolation curve. -* -* @since 12 -*/ + * @brief Defines an interpolation curve. + * + * @since 12 + */ typedef struct ArkUI_Curve ArkUI_Curve; /** @@ -132,1204 +132,1204 @@ typedef struct ArkUI_AnimatorOption ArkUI_AnimatorOption; typedef struct ArkUI_Animator* ArkUI_AnimatorHandle; /** -* @brief Defines the animator callback event object. -* -* @since 12 -*/ + * @brief Defines the animator callback event object. + * + * @since 12 + */ typedef struct ArkUI_AnimatorEvent ArkUI_AnimatorEvent; /** -* @brief Defines the callback object when the animator receives a frame. -* -* @since 12 -*/ + * @brief Defines the callback object when the animator receives a frame. + * + * @since 12 + */ typedef struct ArkUI_AnimatorOnFrameEvent ArkUI_AnimatorOnFrameEvent; /** - * @brief Defines the transition parameter object for transition property configuration. - * - * @since 12 - */ + * @brief Defines the transition parameter object for transition property configuration. + * + * @since 12 + */ typedef struct ArkUI_TransitionEffect ArkUI_TransitionEffect; /** - * @brief Declares the native animation APIs provided by ArkUI. - * - * @version 1 - * @since 12 - */ + * @brief Declares the native animation APIs provided by ArkUI. + * + * @version 1 + * @since 12 + */ typedef struct { /** - * @brief Defines an explicit animation. - * - * @note Make sure the component attributes to be set in the event closure have been set before. - * - * @param context **UIContext** instance. - * @param option Defines the animation configuration. - * @param update Closure function for the animation. The system automatically inserts the transition animation if - * the state changes in the closure function. - *
Note: Make sure the component attributes to be set in the closure function have been set before. - * @param complete Callback invoked when the animation playback is complete. - * @return 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. - */ + * @brief Defines an explicit animation. + * + * @note Make sure the component attributes to be set in the event closure have been set before. + * + * @param context **UIContext** instance. + * @param option Defines the animation configuration. + * @param update Closure function for the animation. The system automatically inserts the transition animation if + * the state changes in the closure function. + *
Note: Make sure the component attributes to be set in the closure function have been set before. + * @param complete Callback invoked when the animation playback is complete. + * @return 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. + */ int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update, ArkUI_AnimateCompleteCallback* complete); /** - * @brief Defines a keyframe animation. - * - * @param context **UIContext** instance. - * @param option Keyframe animation parameter. - * @return 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. - */ + * @brief Defines a keyframe animation. + * + * @param context **UIContext** instance. + * @param option Keyframe animation parameter. + * @return 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. + */ int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option); /** - * @brief Creates an animator object. - * - * @param context **UIContext** instance. - * @param option Animator parameter. - * @return Returns the pointer to the animator object; returns **NULL** if a parameter error occurs. - */ + * @brief Creates an animator object. + * + * @param context **UIContext** instance. + * @param option Animator parameter. + * @return Returns the pointer to the animator object; returns **NULL** if a parameter error occurs. + */ ArkUI_AnimatorHandle (*createAnimator)(ArkUI_ContextHandle context, ArkUI_AnimatorOption* option); /** - * @brief Disposes of an animator object. - * - * @param animatorHandle Animator object. - */ + * @brief Disposes of an animator object. + * + * @param animatorHandle Animator object. + */ void (*disposeAnimator)(ArkUI_AnimatorHandle animatorHandle); } ArkUI_NativeAnimateAPI_1; /** -* @brief Creates an animation configuration. -* -* @return Pointer to the created animation configuration. -* @since 12 -*/ + * @brief Creates an animation configuration. + * + * @return Pointer to the created animation configuration. + * @since 12 + */ ArkUI_AnimateOption* OH_ArkUI_AnimateOption_Create(); /** -* @brief Disposes of an animation configuration. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @since 12 -*/ + * @brief Disposes of an animation configuration. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, the operation is invalid. + * @since 12 + */ void OH_ArkUI_AnimateOption_Dispose(ArkUI_AnimateOption* option); /** -* @brief Obtains the animation duration, in milliseconds. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **0** is returned. -* @return Animation duration, in milliseconds. If **option** is invalid, **0** is returned. -* @since 12 -*/ + * @brief Obtains the animation duration, in milliseconds. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, **0** is returned. + * @return Animation duration, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ uint32_t OH_ArkUI_AnimateOption_GetDuration(ArkUI_AnimateOption* option); /** -* @brief Obtains the playback speed of an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **0.0** is returned. -* @return Animation playback speed. Value range: [0, +∞). If **option** is invalid, **0.0** is returned. -* @since 12 -*/ + * @brief Obtains the playback speed of an animation. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, **0.0** is returned. + * @return Animation playback speed. Value range: [0, +∞). If **option** is invalid, **0.0** is returned. + * @since 12 + */ float OH_ArkUI_AnimateOption_GetTempo(ArkUI_AnimateOption* option); /** -* @brief Obtains an animation curve. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **-1** is returned. -* @return Animation curve. If **option** is invalid,**-1** is returned. -* @since 12 -*/ + * @brief Obtains an animation curve. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, **-1** is returned. + * @return Animation curve. If **option** is invalid,**-1** is returned. + * @since 12 + */ ArkUI_AnimationCurve OH_ArkUI_AnimateOption_GetCurve(ArkUI_AnimateOption* option); /** -* @brief Obtains the animation delay, in milliseconds. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **0** is returned. -* @return Delay of animation playback. If **option** is invalid, **0** is returned. -* @since 12 -*/ + * @brief Obtains the animation delay, in milliseconds. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, **0** is returned. + * @return Delay of animation playback. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_AnimateOption_GetDelay(ArkUI_AnimateOption* option); /** -* @brief Obtains the number of times that an animation is played. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **0** is returned. -* @return Number of times that the animation is played. If **option** is invalid, **0** is returned. -* @since 12 -*/ + * @brief Obtains the number of times that an animation is played. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, **0** is returned. + * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_AnimateOption_GetIterations(ArkUI_AnimateOption* option); /** -* @brief Obtains the playback mode of an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **-1** is returned. -* @return Animation playback mode. If **option** is invalid,**-1** is returned. -* @since 12 -*/ + * @brief Obtains the playback mode of an animation. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, **-1** is returned. + * @return Animation playback mode. If **option** is invalid,**-1** is returned. + * @since 12 + */ ArkUI_AnimationPlayMode OH_ArkUI_AnimateOption_GetPlayMode(ArkUI_AnimateOption* option); /** -* @brief Obtains the expected frame rate range of an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, **NULL** is returned. -* @return Expected frame rate range of the animation, in fps. If **option** is invalid, **NULL** is returned. -* @since 12 -*/ + * @brief Obtains the expected frame rate range of an animation. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, **NULL** is returned. + * @return Expected frame rate range of the animation, in fps. If **option** is invalid, **NULL** is returned. + * @since 12 + */ ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimateOption_GetExpectedFrameRateRange(ArkUI_AnimateOption* option); /** -* @brief Sets the animation duration, in milliseconds. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation duration, in milliseconds. Value range: [0, +∞). -*
If the value is less than 0, **0** is used. -* @since 12 -*/ + * @brief Sets the animation duration, in milliseconds. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, the operation is invalid. + * @param value Animation duration, in milliseconds. Value range: [0, +∞). + *
If the value is less than 0, **0** is used. + * @since 12 + */ void OH_ArkUI_AnimateOption_SetDuration(ArkUI_AnimateOption* option, int32_t value); /** -* @brief Sets the playback speed of an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation playback speed. Value range: [0, +∞). -*
**NOTE** -*
If the value is less than 0, the default value **1** is used. -* @since 12 -*/ + * @brief Sets the playback speed of an animation. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, the operation is invalid. + * @param value Animation playback speed. Value range: [0, +∞). + *
**NOTE** + *
If the value is less than 0, the default value **1** is used. + * @since 12 + */ void OH_ArkUI_AnimateOption_SetTempo(ArkUI_AnimateOption* option, float value); /** -* @brief Animation curve. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use -* {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. -*
If the value is abnormal, the setting is invalid. -* @since 12 -*/ + * @brief Animation curve. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, the operation is invalid. + * @param value Animation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use + * {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. + *
If the value is abnormal, the setting is invalid. + * @since 12 + */ void OH_ArkUI_AnimateOption_SetCurve(ArkUI_AnimateOption* option, ArkUI_AnimationCurve value); /** -* @brief Sets the animation delay, in milliseconds. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation -* delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A -* value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute value -* of **value** is less than the actual animation duration, the animation starts its first frame from the state at -* the absolute value. If the absolute value of **value** is greater than or equal to the actual animation duration, -* the animation starts its first frame from the end state. The actual animation duration is equal to the duration -* of a single animation multiplied by the number of animation playback times. -* @since 12 -*/ + * @brief Sets the animation delay, in milliseconds. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, the operation is invalid. + * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation + * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A + * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute value + * of **value** is less than the actual animation duration, the animation starts its first frame from the state at + * the absolute value. If the absolute value of **value** is greater than or equal to the actual animation duration, + * the animation starts its first frame from the end state. The actual animation duration is equal to the duration + * of a single animation multiplied by the number of animation playback times. + * @since 12 + */ void OH_ArkUI_AnimateOption_SetDelay(ArkUI_AnimateOption* option, int32_t value); /** -* @brief Sets the number of times that an animation is played. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, -* the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number -* of times. Default value: **1** (played once). -*
If the value is less than -1, the operation is invalid. -* @since 12 -*/ + * @brief Sets the number of times that an animation is played. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, the operation is invalid. + * @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, + * the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number + * of times. Default value: **1** (played once). + *
If the value is less than -1, the operation is invalid. + * @since 12 + */ void OH_ArkUI_AnimateOption_SetIterations(ArkUI_AnimateOption* option, int32_t value); /** -* @brief Sets the playback mode for an animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation playback mode. Default value: {@link ARKUI_ANIMATION_PLAY_MODE_NORMAL}. -*
If the value is abnormal, the operation is invalid. -* @since 12 -*/ + * @brief Sets the playback mode for an animation. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, the operation is invalid. + * @param value Animation playback mode. Default value: {@link ARKUI_ANIMATION_PLAY_MODE_NORMAL}. + *
If the value is abnormal, the operation is invalid. + * @since 12 + */ void OH_ArkUI_AnimateOption_SetPlayMode(ArkUI_AnimateOption* option, ArkUI_AnimationPlayMode value); /** -* @brief Defines a struct for the expected frame rate range of the animation. -* -* @param option Pointer to an animation configuration. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Expected frame rate range of the animation, in fps. -*
If **value** is set to **NULL**, the operation is invalid. -* @since 12 -*/ + * @brief Defines a struct for the expected frame rate range of the animation. + * + * @param option Pointer to an animation configuration. + *
If **option** is set to **NULL**, the operation is invalid. + * @param value Expected frame rate range of the animation, in fps. + *
If **value** is set to **NULL**, the operation is invalid. + * @since 12 + */ void OH_ArkUI_AnimateOption_SetExpectedFrameRateRange(ArkUI_AnimateOption* option, ArkUI_ExpectedFrameRateRange* value); /** -* @brief Sets the animation curve for an animation. -* -* @note This method is better than the value set by OH_ArkUI_AnimateOption_SetCurve. -* @param option Animator animation parameters. -*
If **option** is set to **NULL**, the operation is invalid. -* @param value Animation curve parameters. -*
If **value** is set to **NULL**, the operation is invalid. -* @since 12 -*/ + * @brief Sets the animation curve for an animation. + * + * @note This method is better than the value set by OH_ArkUI_AnimateOption_SetCurve. + * @param option Animator animation parameters. + *
If **option** is set to **NULL**, the operation is invalid. + * @param value Animation curve parameters. + *
If **value** is set to **NULL**, the operation is invalid. + * @since 12 + */ void OH_ArkUI_AnimateOption_SetICurve(ArkUI_AnimateOption* option, ArkUI_CurveHandle value); /** -* @brief Obtains the animation curve of an animation. -* -* @param option Animator animation parameters. -*
If **option** is set to **NULL**, **NULL** is returned. -* @return Animation curve parameters. Returns **NULL** if the option parameter is invalid. -* @since 12 -*/ + * @brief Obtains the animation curve of an animation. + * + * @param option Animator animation parameters. + *
If **option** is set to **NULL**, **NULL** is returned. + * @return Animation curve parameters. Returns **NULL** if the option parameter is invalid. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_AnimateOption_GetICurve(ArkUI_AnimateOption* option); /** - * @brief Creates a keyframe animation parameter object. - * - * @param size Number of keyframe animation states. - *
Returns **NULL** if the value of **size** is less than 0. - * @return Keyframe animation parameter object. If the value of **size** is less than 0 or if **option** is abnormal, ** - * NULL** is returned. - * @since 12 - */ + * @brief Creates a keyframe animation parameter object. + * + * @param size Number of keyframe animation states. + *
Returns **NULL** if the value of **size** is less than 0. + * @return Keyframe animation parameter object. If the value of **size** is less than 0 or if **option** is abnormal, ** + * NULL** is returned. + * @since 12 + */ ArkUI_KeyframeAnimateOption* OH_ArkUI_KeyframeAnimateOption_Create(int32_t size); /** - * @brief Disposes of a keyframe animation parameter object. - * - * @param option Keyframe animation parameter object. - *
If **option** is set to **NULL**, the operation is invalid. - * @since 12 - */ + * @brief Disposes of a keyframe animation parameter object. + * + * @param option Keyframe animation parameter object. + *
If **option** is set to **NULL**, the operation is invalid. + * @since 12 + */ void OH_ArkUI_KeyframeAnimateOption_Dispose(ArkUI_KeyframeAnimateOption* option); /** - * @brief Sets the overall delay of a keyframe animation, in milliseconds. By default, the keyframe animation starts - * without any delay. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation - * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A - * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute - * value of **value** is less than the actual animation duration, the animation starts its first frame from the - * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation - * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the - * duration of a single animation multiplied by the number of animation playback times. - * @return 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 12 - */ + * @brief Sets the overall delay of a keyframe animation, in milliseconds. By default, the keyframe animation starts + * without any delay. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation + * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A + * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute + * value of **value** is less than the actual animation duration, the animation starts its first frame from the + * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation + * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the + * duration of a single animation multiplied by the number of animation playback times. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetDelay(ArkUI_KeyframeAnimateOption* option, int32_t value); /** - * @brief Sets the number of times that the keyframe animation is played. By default, the animation is played once. The - * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that - * no animation is played. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, - * the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number - * of times. Default value: **1**, indicating that the animation is played once. - *
If the value is less than **-1**, the operation is invalid, and the error code - * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief Sets the number of times that the keyframe animation is played. By default, the animation is played once. The + * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that + * no animation is played. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Number of times that the animation is played. Value range: [-1, +∞). If this parameter is set to **0**, + * the animation is not played. If this parameter is set to **-1**, the animation is played for an infinite number + * of times. Default value: **1**, indicating that the animation is played once. + *
If the value is less than **-1**, the operation is invalid, and the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetIterations(ArkUI_KeyframeAnimateOption* option, int32_t value); /** - * @brief Sets the callback invoked when the keyframe animation playback is complete. This function is called after the - * {@link keyframe animation} has played for the specified number of times. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param userData Pointer to a custom object. - *
Abnormal value processing is not involved. - * @param onFinish Indicates the callback. - * @return 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 12 - */ + * @brief Sets the callback invoked when the keyframe animation playback is complete. This function is called after the + * {@link keyframe animation} has played for the specified number of times. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param userData Pointer to a custom object. + *
Abnormal value processing is not involved. + * @param onFinish Indicates the callback. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback( ArkUI_KeyframeAnimateOption* option, void* userData, void (*onFinish)(void* userData)); /** - * @brief Sets the expected frame rate for a keyframe animation. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param frameRate Expected frame rate for the keyframe animation. - *
If **frameRate** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 19 - */ + * @brief Sets the expected frame rate for a keyframe animation. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param frameRate Expected frame rate for the keyframe animation. + *
If **frameRate** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 19 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetExpectedFrameRate( ArkUI_KeyframeAnimateOption* option, ArkUI_ExpectedFrameRateRange* frameRate); /** - * @brief Sets the duration of a keyframe animation, in milliseconds. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @brief Sets the duration of a keyframe animation, in milliseconds. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. * @param value Keyframe animation duration, in ms. The default value is 1000 ms. Value range: [0, +∞). - *
If the value is less than 0, **0** is used. - * @param index Index of the keyframe state segment. - *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + *
If the value is less than 0, **0** is used. + * @param index Index of the keyframe state segment. + *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetDuration(ArkUI_KeyframeAnimateOption* option, int32_t value, int32_t index); /** - * @brief Sets the animation curve for a specific keyframe animation segment. - * - * @note Because the springMotion, responsiveSpringMotion, and interpolatingSpring curves do not - * have effective duration settings, they are not supported. - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Animation curve to set. Default value: {@link ARKUI_CURVE_EASE_IN_OUT}. - * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of - * keyframe animation states. - *
If the value of **index** is less than 0 or out of range, the error code - * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief Sets the animation curve for a specific keyframe animation segment. + * + * @note Because the springMotion, responsiveSpringMotion, and interpolatingSpring curves do not + * have effective duration settings, they are not supported. + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation curve to set. Default value: {@link ARKUI_CURVE_EASE_IN_OUT}. + * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of + * keyframe animation states. + *
If the value of **index** is less than 0 or out of range, the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_SetCurve( ArkUI_KeyframeAnimateOption* option, ArkUI_CurveHandle value, int32_t index); /** - * @brief Sets the closure function of the state at the time of the keyframe, that is, the state to be reached at the - * time of the keyframe. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param event Indicates a closure function. - * @param userData Pointer to a user-defined object. - *
Abnormal value processing is not involved. - * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of - * keyframe animation states. - *
If the value of **index** is less than 0 or out of range, the error code - * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief Sets the closure function of the state at the time of the keyframe, that is, the state to be reached at the + * time of the keyframe. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param event Indicates a closure function. + * @param userData Pointer to a user-defined object. + *
Abnormal value processing is not involved. + * @param index Index of the keyframe state segment. Value range: [0, size – 1], where **size** indicates the number of + * keyframe animation states. + *
If the value of **index** is less than 0 or out of range, the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnEventCallback( ArkUI_KeyframeAnimateOption* option, void* userData, void (*event)(void* userData), int32_t index); /** - * @brief Obtains the overall delay of a keyframe animation, in milliseconds. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **0** is returned. - * @return Overall delay, in milliseconds. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief Obtains the overall delay of a keyframe animation, in milliseconds. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @return Overall delay, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_GetDelay(ArkUI_KeyframeAnimateOption* option); /** - * @brief Obtains the number of times that a keyframe animation is played. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **0** is returned. - * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief Obtains the number of times that a keyframe animation is played. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_GetIterations(ArkUI_KeyframeAnimateOption* option); /** - * @brief Obtains the expected frame rate from keyframe animation parameters. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **NULL** is returned. - * @return Returns the expected frame rate obtained. If **option** is invalid, **NULL** is returned. - * @since 19 - */ + * @brief Obtains the expected frame rate from keyframe animation parameters. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **NULL** is returned. + * @return Returns the expected frame rate obtained. If **option** is invalid, **NULL** is returned. + * @since 19 + */ ArkUI_ExpectedFrameRateRange* OH_ArkUI_KeyframeAnimateOption_GetExpectedFrameRate(ArkUI_KeyframeAnimateOption* option); /** - * @brief Obtains the duration of a specific state in a keyframe animation, in milliseconds. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **0** is returned. - * @param index Index of the keyframe state segment. - *
If the value of **index** is less than 0, **0** is returned. - * @return Duration, in milliseconds. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief Obtains the duration of a specific state in a keyframe animation, in milliseconds. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @param index Index of the keyframe state segment. + *
If the value of **index** is less than 0, **0** is returned. + * @return Duration, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_KeyframeAnimateOption_GetDuration(ArkUI_KeyframeAnimateOption* option, int32_t index); /** - * @brief Obtains the animation curve of a specific state in a keyframe animation. - * - * @param option Keyframe animation parameters. - *
If **option** is set to **NULL**, **NULL** is returned. - * @param index Index of the keyframe state segment. - *
If the value of **index** is less than 0, **NULL** is returned. - * @return Animation curve. If the parameter is abnormal, **NULL** is returned. - * @since 12 - */ + * @brief Obtains the animation curve of a specific state in a keyframe animation. + * + * @param option Keyframe animation parameters. + *
If **option** is set to **NULL**, **NULL** is returned. + * @param index Index of the keyframe state segment. + *
If the value of **index** is less than 0, **NULL** is returned. + * @return Animation curve. If the parameter is abnormal, **NULL** is returned. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_KeyframeAnimateOption_GetCurve(ArkUI_KeyframeAnimateOption* option, int32_t index); /** - * @brief Creates an **AnimatorOption** object. - * - * @note When keyframeSize is greater than 0, the animation interpolation start point is 0, and the animation - * interpolation end point is 1; no setting is allowed. - * @param keyframeSize Number of keyframes. - *
If the value of **keyframeSize** is less than 0, **NULL** is returned. - * @return Pointer to the animator parameter object. If the value of **size** is less than 0 or if **option** is - * abnormal, **NULL** is returned. - * @since 12 - */ + * @brief Creates an **AnimatorOption** object. + * + * @note When keyframeSize is greater than 0, the animation interpolation start point is 0, and the animation + * interpolation end point is 1; no setting is allowed. + * @param keyframeSize Number of keyframes. + *
If the value of **keyframeSize** is less than 0, **NULL** is returned. + * @return Pointer to the animator parameter object. If the value of **size** is less than 0 or if **option** is + * abnormal, **NULL** is returned. + * @since 12 + */ ArkUI_AnimatorOption* OH_ArkUI_AnimatorOption_Create(int32_t keyframeSize); /** - * @brief Disposes of an **AnimatorOption** object. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the operation is invalid. - * @since 12 - */ + * @brief Disposes of an **AnimatorOption** object. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the operation is invalid. + * @since 12 + */ void OH_ArkUI_AnimatorOption_Dispose(ArkUI_AnimatorOption* option); /** - * @brief Sets the duration of an animator animation, in milliseconds. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Playback duration, in ms. The default value is 0 ms. Value range: [0, +∞). - *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief Sets the duration of an animator animation, in milliseconds. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Playback duration, in ms. The default value is 0 ms. Value range: [0, +∞). + *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetDuration(ArkUI_AnimatorOption* option, int32_t value); /** - * @brief Sets the delay time of the animator playback, in milliseconds. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation - * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A - * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute - * value of **value** is less than the actual animation duration, the animation starts its first frame from the - * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation - * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the - * duration of a single animation multiplied by the number of animation playback times. - * @return 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 12 - */ + * @brief Sets the delay time of the animator playback, in milliseconds. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation delay, in milliseconds. Value range: (-∞, +∞). Default value: **0**, indicating no animation + * delay. A value greater than 0 means to begin the animation after the specified amount of time has elapsed. A + * value less than 0 means to begin the animation in advance. If **value** is less than **0** and the absolute + * value of **value** is less than the actual animation duration, the animation starts its first frame from the + * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation + * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the + * duration of a single animation multiplied by the number of animation playback times. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetDelay(ArkUI_AnimatorOption* option, int32_t value); /** - * @brief Sets the number of times that an animator animation is played. By default, the animation is played once. The - * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that - * no animation is played. - * - * @note If this parameter is set to a negative value other than -1, the value is invalid. In this case, the - * animation is played once. - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Value range: [-1, +∞). If this parameter is set to **0**, the animation is not played. If this - * parameter is set to **-1**, the animation is played for an infinite number of times. Default value: **1** ( - * played once). - *
If the value is less than -1, the operation is invalid. - * @return 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 12 - */ + * @brief Sets the number of times that an animator animation is played. By default, the animation is played once. The + * value **-1** indicates that the animation is played for an unlimited number of times. The value **0** indicates that + * no animation is played. + * + * @note If this parameter is set to a negative value other than -1, the value is invalid. In this case, the + * animation is played once. + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Value range: [-1, +∞). If this parameter is set to **0**, the animation is not played. If this + * parameter is set to **-1**, the animation is played for an infinite number of times. Default value: **1** ( + * played once). + *
If the value is less than -1, the operation is invalid. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetIterations(ArkUI_AnimatorOption* option, int32_t value); /** - * @brief Sets the status of the component before and after the animator animation execution. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Status of the component before and after the animator animation execution. Default value: - * {@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}. - *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief Sets the status of the component before and after the animator animation execution. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Status of the component before and after the animator animation execution. Default value: + * {@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}. + *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetFill(ArkUI_AnimatorOption* option, ArkUI_AnimationFillMode value); /** - * @brief Set the playback direction. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Animation playback direction. - *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief Set the playback direction. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Animation playback direction. + *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetDirection(ArkUI_AnimatorOption* option, ArkUI_AnimationDirection value); /** - * @brief Sets the interpolation curve for the animation of an animator. - * - * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, - * and customCurve curves are not supported. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Interpolation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use - * {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. - *
If **value** is set to **NULL**, the default curve {@link ARKUI_CURVE_LINEAR} is used. - * @return 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 12 - */ + * @brief Sets the interpolation curve for the animation of an animator. + * + * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, + * and customCurve curves are not supported. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use + * {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. + *
If **value** is set to **NULL**, the default curve {@link ARKUI_CURVE_LINEAR} is used. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value); /** - * @brief Sets the interpolation start point of an animation. - * - * @note This API does not take effect when the animation is a keyframe animation. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Interpolation start point of the animation. Value range: (-∞, +∞). - * @return 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 12 - */ + * @brief Sets the interpolation start point of an animation. + * + * @note This API does not take effect when the animation is a keyframe animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation start point of the animation. Value range: (-∞, +∞). + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetBegin(ArkUI_AnimatorOption* option, float value); /** - * @brief Sets the interpolation end point for the animation of an animator. - * - * @note This API does not take effect when the animation is a keyframe animation. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Interpolation end point of the animation. Value range: (-∞, +∞). - * @return 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 12 - */ + * @brief Sets the interpolation end point for the animation of an animator. + * + * @note This API does not take effect when the animation is a keyframe animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation end point of the animation. Value range: (-∞, +∞). + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetEnd(ArkUI_AnimatorOption* option, float value); /** - * @brief Sets the expected frame rate range of an animation. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Expected frame rate range. - *
If **value** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief Sets the expected frame rate range of an animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Expected frame rate range. + *
If **value** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange( ArkUI_AnimatorOption* option, ArkUI_ExpectedFrameRateRange* value); /** - * @brief Sets the keyframe parameters of an animator animation. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param time Keyframe time. Value range: [0, 1]. The value must be in ascending order. Default value: evenly - * distributed by index (for example, **0.0** for the first frame, **0.5** for the second frame, and **1.0** for - * the third frame). - *
If the value of **time** is less than 0 or greater than 1, the error code - * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Keyframe value. Value range: (-∞, +∞). - * @param index Keyframe index. - *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief Sets the keyframe parameters of an animator animation. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param time Keyframe time. Value range: [0, 1]. The value must be in ascending order. Default value: evenly + * distributed by index (for example, **0.0** for the first frame, **0.5** for the second frame, and **1.0** for + * the third frame). + *
If the value of **time** is less than 0 or greater than 1, the error code + * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Keyframe value. Value range: (-∞, +∞). + * @param index Keyframe index. + *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetKeyframe( ArkUI_AnimatorOption* option, float time, float value, int32_t index); /** - * @brief Sets the keyframe curve type for the animation of an animator. - * - * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, - * and customCurve curves are not supported. - * - * @param option Animator parameters. - *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @param value Interpolation curve. Default value: **NULL**, indicating linear interpolation. - * @param index Keyframe index. - *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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 12 - */ + * @brief Sets the keyframe curve type for the animation of an animator. + * + * @note springCurve, springMotion, responsiveSpringMotion, interpolatingSpring, + * and customCurve curves are not supported. + * + * @param option Animator parameters. + *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @param value Interpolation curve. Default value: **NULL**, indicating linear interpolation. + * @param index Keyframe index. + *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_SetKeyframeCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value, int32_t index); /** - * @brief Obtains the duration for playing an animation. - * - * @param option Animator animation parameters. - *
If **option** is set to **NULL**, **0** is returned. - * @return Duration for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief Obtains the duration for playing an animation. + * + * @param option Animator animation parameters. + *
If **option** is set to **NULL**, **0** is returned. + * @return Duration for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_GetDuration(ArkUI_AnimatorOption* option); /** - * @brief Obtains the delay for playing an animation. - * - * @param option Animator animation parameters. If **option** is set to **NULL**, **0** is returned. - * @return Delay for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief Obtains the delay for playing an animation. + * + * @param option Animator animation parameters. If **option** is set to **NULL**, **0** is returned. + * @return Delay for playing the animation, in milliseconds. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_GetDelay(ArkUI_AnimatorOption* option); /** - * @brief Obtains the number of times that an animator animation is played. - * - * @param option Animator parameters. If **option** is set to **NULL**, **0** is returned. - * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. - * @since 12 - */ + * @brief Obtains the number of times that an animator animation is played. + * + * @param option Animator parameters. If **option** is set to **NULL**, **0** is returned. + * @return Number of times that the animation is played. If **option** is invalid, **0** is returned. + * @since 12 + */ int32_t OH_ArkUI_AnimatorOption_GetIterations(ArkUI_AnimatorOption* option); /** - * @brief Obtains the status of the component before and after the animator animation execution. - * - * @param option Animator animation parameters. - * @return Status of the component before and after the animator animation execution. If **option** is invalid,**-1** - * is returned. - * @since 12 - */ + * @brief Obtains the status of the component before and after the animator animation execution. + * + * @param option Animator animation parameters. + * @return Status of the component before and after the animator animation execution. If **option** is invalid,**-1** + * is returned. + * @since 12 + */ ArkUI_AnimationFillMode OH_ArkUI_AnimatorOption_GetFill(ArkUI_AnimatorOption* option); /** - * @brief Obtains the playback direction of an animator animation. - * - * @param option Animator animation parameters. - * @return Animation playback direction. If **option** is invalid,**-1** is returned. - * @since 12 - */ + * @brief Obtains the playback direction of an animator animation. + * + * @param option Animator animation parameters. + * @return Animation playback direction. If **option** is invalid,**-1** is returned. + * @since 12 + */ ArkUI_AnimationDirection OH_ArkUI_AnimatorOption_GetDirection(ArkUI_AnimatorOption* option); /** - * @brief Obtains the interpolation curve of the animation of an animator. - * - * @param option Animator animation parameters. - * @return Interpolation curve. If **option** is invalid, **NULL** is returned. - * @since 12 - */ + * @brief Obtains the interpolation curve of the animation of an animator. + * + * @param option Animator animation parameters. + * @return Interpolation curve. If **option** is invalid, **NULL** is returned. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetCurve(ArkUI_AnimatorOption* option); /** - * @brief Obtains the interpolation start point of an animation. - * - * @param option Animator animation parameters. - * @return Interpolation start point of the animation. If **option** is invalid, **0.0** is returned. - * @since 12 - */ + * @brief Obtains the interpolation start point of an animation. + * + * @param option Animator animation parameters. + * @return Interpolation start point of the animation. If **option** is invalid, **0.0** is returned. + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetBegin(ArkUI_AnimatorOption* option); /** - * @brief Obtains the interpolation end point of an animation. - * - * @param option Animator animation parameters. - * @return Interpolation end point of the animation. If **option** is invalid, **0.0** is returned. - * @since 12 - */ + * @brief Obtains the interpolation end point of an animation. + * + * @param option Animator animation parameters. + * @return Interpolation end point of the animation. If **option** is invalid, **0.0** is returned. + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetEnd(ArkUI_AnimatorOption* option); /** - * @brief Obtains the expected frame rate range of an animator animation. - * - * @param option Animator animation parameters. - * @return Pointer to the expected frame rate range object. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Obtains the expected frame rate range of an animator animation. + * + * @param option Animator animation parameters. + * @return Pointer to the expected frame rate range object. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_ExpectedFrameRateRange* OH_ArkUI_AnimatorOption_GetExpectedFrameRateRange(ArkUI_AnimatorOption* option); /** - * @brief Obtains the keyframe time of the animator playback, in milliseconds. - * - * @param option Animator parameters. - * @param index Keyframe index. - * @return Keyframe time, in milliseconds. - * @since 12 - */ + * @brief Obtains the keyframe time of the animator playback, in milliseconds. + * + * @param option Animator parameters. + * @param index Keyframe index. + * @return Keyframe time, in milliseconds. + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetKeyframeTime(ArkUI_AnimatorOption* option, int32_t index); /** - * @brief Obtains the keyframe value of an animation. - * - * @param option Animator parameters. - * @param index Keyframe index. - * @return Keyframe value. - * @since 12 - */ + * @brief Obtains the keyframe value of an animation. + * + * @param option Animator parameters. + * @param index Keyframe index. + * @return Keyframe value. + * @since 12 + */ float OH_ArkUI_AnimatorOption_GetKeyframeValue(ArkUI_AnimatorOption* option, int32_t index); /** - * @brief Obtains the interpolation curve for a keyframe in the animation of an animator. - * - * @param option Animator parameters. - * @param index Keyframe index. - * @return Interpolation curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Obtains the interpolation curve for a keyframe in the animation of an animator. + * + * @param option Animator parameters. + * @param index Keyframe index. + * @return Interpolation curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_AnimatorOption_GetKeyframeCurve(ArkUI_AnimatorOption* option, int32_t index); /** - * @brief Obtains the user-defined object in an animation event object. - * - * @param event Animation event object. - * @return User-defined object. - * @since 12 - */ + * @brief Obtains the user-defined object in an animation event object. + * + * @param event Animation event object. + * @return User-defined object. + * @since 12 + */ void* OH_ArkUI_AnimatorEvent_GetUserData(ArkUI_AnimatorEvent* event); /** - * @brief Obtains the user-defined object in the frame event of an animation. - * - * @param event Animation event object. - * @return User-defined object. - * @since 12 - */ + * @brief Obtains the user-defined object in the frame event of an animation. + * + * @param event Animation event object. + * @return User-defined object. + * @since 12 + */ void* OH_ArkUI_AnimatorOnFrameEvent_GetUserData(ArkUI_AnimatorOnFrameEvent* event); /** - * @brief Obtains the interpolation result in the animation frame callback event object. - * - * @param event Animation event object. - * @return Animation interpolation result. - *
**NOTE** - *
During the animation, the interpolation result changes between the interpolation start point - * {@link OH_ArkUI_AnimatorOption_SetBegin} and the interpolation end point {@link OH_ArkUI_AnimatorOption_SetEnd} - * based on the animation parameters. - * @since 12 - */ + * @brief Obtains the interpolation result in the animation frame callback event object. + * + * @param event Animation event object. + * @return Animation interpolation result. + *
**NOTE** + *
During the animation, the interpolation result changes between the interpolation start point + * {@link OH_ArkUI_AnimatorOption_SetBegin} and the interpolation end point {@link OH_ArkUI_AnimatorOption_SetEnd} + * based on the animation parameters. + * @since 12 + */ float OH_ArkUI_AnimatorOnFrameEvent_GetValue(ArkUI_AnimatorOnFrameEvent* event); /** - * @brief Sets the callback invoked when the animator receives a frame. - * - * @param option Animator animation parameters. - * @param userData User-defined parameter. - * @param callback Indicates the callback to set. - * @return 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 12 - */ + * @brief Sets the callback invoked when the animator receives a frame. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnFrameCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorOnFrameEvent* event)); /** - * @brief Sets the callback invoked when the animation playback is complete. - * - * @param option Animator animation parameters. - * @param userData User-defined parameter. - * @param callback Indicates the callback to set. - * @return 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 12 - */ + * @brief Sets the callback invoked when the animation playback is complete. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnFinishCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); /** - * @brief Sets the callback invoked when the animation playback is canceled. - * - * @param option Animator animation parameters. - * @param userData User-defined parameter. - * @param callback Indicates the callback to set. - * @return 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 12 - */ + * @brief Sets the callback invoked when the animation playback is canceled. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnCancelCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); /** - * @brief Sets the callback invoked when the animation playback is repeated. - * - * @param option Animator animation parameters. - * @param userData User-defined parameter. - * @param callback Indicates the callback to set. - * @return 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 12 - */ + * @brief Sets the callback invoked when the animation playback is repeated. + * + * @param option Animator animation parameters. + * @param userData User-defined parameter. + * @param callback Indicates the callback to set. + * @return 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 12 + */ int32_t OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback( ArkUI_AnimatorOption* option, void* userData, void (*callback)(ArkUI_AnimatorEvent* event)); /** - * @brief Resets the animation of an animator. - * - * @param animatorHandle Animator object. - * @param option Animator animation parameters. - * @return 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 12 - */ + * @brief Resets the animation of an animator. + * + * @param animatorHandle Animator object. + * @param option Animator animation parameters. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_ResetAnimatorOption( ArkUI_AnimatorHandle animatorHandle, ArkUI_AnimatorOption* option); /** - * @brief Starts the animation of an animator. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief Starts the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Play(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Ends the animation of an animator. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief Ends the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Finish(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Pauses the animation of an animator. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief Pauses the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Pause(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Cancels the animation of an animator. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief Cancels the animation of an animator. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Cancel(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Plays this animation in reverse order. - * - * @param animatorHandle Animator object. - * @return 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 12 - */ + * @brief Plays this animation in reverse order. + * + * @param animatorHandle Animator object. + * @return 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 12 + */ int32_t OH_ArkUI_Animator_Reverse(ArkUI_AnimatorHandle animatorHandle); /** - * @brief Implements initialization for the interpolation curve, which is used to create an interpolation curve based - * on the input parameter. - * - * @param curve Curve type. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Implements initialization for the interpolation curve, which is used to create an interpolation curve based + * on the input parameter. + * + * @param curve Curve type. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCurveByType(ArkUI_AnimationCurve curve); /** - * @brief Creates a step curve. - * - * @param count Number of steps. The value must be a positive integer. Value range: [1, +∞). - *
If the value of **count** is abnormal, the operation is invalid. - * @param end Whether the step change occurs at the start or end of each interval. **true**: The step change occurs at - * the end of each interval. **false**: The step change occurs at the start of each interval. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates a step curve. + * + * @param count Number of steps. The value must be a positive integer. Value range: [1, +∞). + *
If the value of **count** is abnormal, the operation is invalid. + * @param end Whether the step change occurs at the start or end of each interval. **true**: The step change occurs at + * the end of each interval. **false**: The step change occurs at the start of each interval. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateStepsCurve(int32_t count, bool end); /** - * @brief Creates a cubic Bezier curve. - * - * @param x1 X-coordinate of the first point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated - * as **0**. A value greater than 1 is treated as **1**. - * @param y1 Y-coordinate of the first point on the Bezier curve. - * @param x2 X-coordinate of the second point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated - * as **0**. A value greater than 1 is treated as **1**. - * @param y2 Y-coordinate of the second point on the Bezier curve. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates a cubic Bezier curve. + * + * @param x1 X-coordinate of the first point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated + * as **0**. A value greater than 1 is treated as **1**. + * @param y1 Y-coordinate of the first point on the Bezier curve. + * @param x2 X-coordinate of the second point on the Bezier curve. Value range: [0, 1]. A value less than 0 is treated + * as **0**. A value greater than 1 is treated as **1**. + * @param y2 Y-coordinate of the second point on the Bezier curve. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCubicBezierCurve(float x1, float y1, float x2, float y2); /** - * @brief Creates a spring curve. The curve shape is determined by the spring parameters, and the animation duration is - * controlled by the **duration** parameter in {@link animation} and {@link animateTo}. - * + * @brief Creates a spring curve. The curve shape is determined by the spring parameters, and the animation duration is + * controlled by the **duration** parameter in {@link animation} and {@link animateTo}. + * * @param velocity Initial velocity. It is applied by external factors to the spring animation, designed to help - * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its - * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute - * change value. - * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of - * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the - * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. In an - * elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the - * speed of restoring to the equilibrium position. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. - * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the - * oscillation amplitude. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its + * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute + * change value. + * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of + * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the + * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. In an + * elastic system, the greater the stiffness, the stronger the ability to resist deformation, and the faster the + * speed of restoring to the equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. + * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the + * oscillation amplitude. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringCurve(float velocity, float mass, float stiffness, float damping); /** - * @brief Creates a spring animation curve. If multiple spring animations are applied to the same attribute of an - * object, each animation replaces their predecessor and inherits the velocity. - * - * @note The animation duration is subject to the curve parameters, rather than the duration parameter in - * animation or animateTo. - * - * @param response Duration of one complete oscillation. Value range: (0, +∞). - *
If the value is less than or equal to 0, **0.55** is used. - * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the - * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium - * gradually. Value range: (0, +∞). - *
If the value is less than or equal to 0, **0.825** is used. - * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** - * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). - *
If the value is less than 0, **0** is used. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates a spring animation curve. If multiple spring animations are applied to the same attribute of an + * object, each animation replaces their predecessor and inherits the velocity. + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * @param response Duration of one complete oscillation. Value range: (0, +∞). + *
If the value is less than or equal to 0, **0.55** is used. + * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the + * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium + * gradually. Value range: (0, +∞). + *
If the value is less than or equal to 0, **0.825** is used. + * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** + * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). + *
If the value is less than 0, **0** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateSpringMotion(float response, float dampingFraction, float overlapDuration); /** - * @brief Creates a responsive spring animation curve. It is a special case of **springMotion**, with the only - * difference in the default values. It can be used together with **springMotion**. - * - * @note The animation duration is subject to the curve parameters, rather than the duration parameter in - * animation or animateTo. - * - * @param response Duration of one complete oscillation. Value range: (0, +∞). - *
If the value is less than or equal to 0, **0.15** is used. - * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the - * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium - * gradually. Value range: [0, +∞). - *
If the value is less than 0, **0.86** is used. - * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** - * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). - *
If the value is less than 0, **0.25** is used. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates a responsive spring animation curve. It is a special case of **springMotion**, with the only + * difference in the default values. It can be used together with **springMotion**. + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * @param response Duration of one complete oscillation. Value range: (0, +∞). + *
If the value is less than or equal to 0, **0.15** is used. + * @param dampingFraction Damping coefficient. > 0 and < 1: underdamped. In this case, the spring overshoots the + * equilibrium position. **1**: critically damped. > 1: overdamped. In this case, the spring approaches equilibrium + * gradually. Value range: [0, +∞). + *
If the value is less than 0, **0.86** is used. + * @param overlapDuration Duration for animations to overlap, in seconds. When animations overlap, the **response** + * values of these animations will transit smoothly over this duration if they are different. Value range: [0, +∞). + *
If the value is less than 0, **0.25** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateResponsiveSpringMotion( float response, float dampingFraction, float overlapDuration); /** - * @brief Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based on - * the curve. - * - * @note The animation duration is subject to the curve parameters, rather than the duration parameter in - * animation or animateTo. - * - * + * @brief Creates an interpolating spring curve animated from 0 to 1. The actual animation value is calculated based on + * the curve. + * + * @note The animation duration is subject to the curve parameters, rather than the duration parameter in + * animation or animateTo. + * + * * @param velocity Initial velocity. It is applied by external factors to the spring animation, designed to help - * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its - * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute - * change value. - * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of - * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the - * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. The greater - * the stiffness, the stronger the ability to resist deformation, and the faster the speed of restoring to the - * equilibrium position. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. - * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the - * oscillation amplitude. Value range: [0, +∞). - *
If the value is less than or equal to 0, **1** is used. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * ensure the smooth transition from the previous motion state. The velocity is the normalized velocity, and its + * value is equal to the actual velocity at the beginning of the animation divided by the animation attribute + * change value. + * @param mass Mass. It describes the inertia of the object in the elastic system, affecting the amplitude of + * oscillation and the speed of return to equilibrium. The greater the mass, the greater the amplitude of the + * oscillation, and the slower the speed of restoring to the equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param stiffness Stiffness. It is the degree to which an object deforms by resisting the force applied. The greater + * the stiffness, the stronger the ability to resist deformation, and the faster the speed of restoring to the + * equilibrium position. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @param damping Damping. It is used to describe the oscillation and attenuation of the system after being disturbed. + * The larger the damping, the smaller the number of oscillations of elastic motion, and the smaller the + * oscillation amplitude. Value range: [0, +∞). + *
If the value is less than or equal to 0, **1** is used. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateInterpolatingSpring(float velocity, float mass, float stiffness, float damping); /** - * @brief Creates a custom curve. - * - * @param userData Pointer to user-defined data. - * @param interpolate Indicates the custom interpolation callback. fraction indicates the input x value for - * interpolation when the animation starts; value range: [0,1]. - * The return value is the y value of the curve; value range: [0,1]. - * If fraction is 0, the return value 0 corresponds to the animation start point; any other - * return - * value means that the animation jumps at the start point. - * If fraction is 1, the return value 1 corresponds to the animation end point; any other - * return - * value means that the end value of the animation is not the value of the state variable, - * which will result in an effect of transition from that end value to the value of the state variable. - * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates a custom curve. + * + * @param userData Pointer to user-defined data. + * @param interpolate Indicates the custom interpolation callback. fraction indicates the input x value for + * interpolation when the animation starts; value range: [0,1]. + * The return value is the y value of the curve; value range: [0,1]. + * If fraction is 0, the return value 0 corresponds to the animation start point; any other + * return + * value means that the animation jumps at the start point. + * If fraction is 1, the return value 1 corresponds to the animation end point; any other + * return + * value means that the end value of the animation is not the value of the state variable, + * which will result in an effect of transition from that end value to the value of the state variable. + * @return Pointer to the interpolation object of the curve. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_CurveHandle OH_ArkUI_Curve_CreateCustomCurve( void* userData, float (*interpolate)(float fraction, void* userdata)); /** - * @brief Disposes of a custom curve. - * - * @param curveHandle Pointer to the interpolation object of the curve. - * @since 12 - */ + * @brief Disposes of a custom curve. + * + * @param curveHandle Pointer to the interpolation object of the curve. + * @since 12 + */ void OH_ArkUI_Curve_DisposeCurve(ArkUI_CurveHandle curveHandle); /** - * @brief Creates an opacity effect object for component transitions. - * - * @note If the value specified is less than 0, the value 0 is used. If the value specified is greater than 1, - * the value 1 is used. - * @param opacity Opacity. Value range: [0, 1]. The default value is **1**. A value less than 0 is treated as 0. A - * value greater than 1 is treated as 1. The value **1** means fully opaque, and **0** means fully transparent. - * @return Opacity effect object for component transitions. - * @since 12 - */ + * @brief Creates an opacity effect object for component transitions. + * + * @note If the value specified is less than 0, the value 0 is used. If the value specified is greater than 1, + * the value 1 is used. + * @param opacity Opacity. Value range: [0, 1]. The default value is **1**. A value less than 0 is treated as 0. A + * value greater than 1 is treated as 1. The value **1** means fully opaque, and **0** means fully transparent. + * @return Opacity effect object for component transitions. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateOpacityTransitionEffect(float opacity); /** - * @brief Creates a translation effect object for component transitions. - * - * @param translate Translation parameter object for component transitions. - * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates a translation effect object for component transitions. + * + * @param translate Translation parameter object for component transitions. + * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateTranslationTransitionEffect(ArkUI_TranslationOptions* translate); /** - * @brief Creates a scaling effect object for component transitions. - * - * @param scale Scaling parameter object for component transitions. - * @return Scaling effect object for component transitions. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates a scaling effect object for component transitions. + * + * @param scale Scaling parameter object for component transitions. + * @return Scaling effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateScaleTransitionEffect(ArkUI_ScaleOptions* scale); /** - * @brief Creates a rotation effect object for component transition. - * - * @param rotate Rotation parameter object for component transitions. - * @return Rotation effect object for component transitions. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates a rotation effect object for component transition. + * + * @param rotate Rotation parameter object for component transitions. + * @return Rotation effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateRotationTransitionEffect(ArkUI_RotationOptions* rotate); /** - * @brief Creates a movement transition effect object for the component. - * - * @param edge Movement transition type. - * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates a movement transition effect object for the component. + * + * @param edge Movement transition type. + * @return Translation effect object for component transitions. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateMovementTransitionEffect(ArkUI_TransitionEdge edge); /** - * @brief Creates an asymmetric transition effect. - * - * @note If the asymmetric function is not used for TransitionEffect, the transition effect takes effect - * for both appearance and disappearance of the component. - * @param appear Transition effect for appearance. - * @param disappear Transition effect for disappearance. - * @return Asymmetric transition effect. Returns **NULL** if a parameter error occurs. - * @since 12 - */ + * @brief Creates an asymmetric transition effect. + * + * @note If the asymmetric function is not used for TransitionEffect, the transition effect takes effect + * for both appearance and disappearance of the component. + * @param appear Transition effect for appearance. + * @param disappear Transition effect for disappearance. + * @return Asymmetric transition effect. Returns **NULL** if a parameter error occurs. + * @since 12 + */ ArkUI_TransitionEffect* OH_ArkUI_CreateAsymmetricTransitionEffect( ArkUI_TransitionEffect* appear, ArkUI_TransitionEffect* disappear); /** - * @brief Disposes of a transition effect. - * - * @param effect Pointer to the transition effect to be disposed. - * @since 12 - */ + * @brief Disposes of a transition effect. + * + * @param effect Pointer to the transition effect to be disposed. + * @since 12 + */ void OH_ArkUI_TransitionEffect_Dispose(ArkUI_TransitionEffect* effect); /** - * @brief Sets a combination of transition effects. - * - * @param firstEffect Transition effect. - * @param secondEffect Combination of transition effects. - * @return 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 12 - */ + * @brief Sets a combination of transition effects. + * + * @param firstEffect Transition effect. + * @param secondEffect Combination of transition effects. + * @return 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 12 + */ int32_t OH_ArkUI_TransitionEffect_Combine( ArkUI_TransitionEffect* firstEffect, ArkUI_TransitionEffect* secondEffect); /** - * @brief Sets transition effect animation settings. - * - * @note If combine is used for combining transition effects, the animation settings of a transition effect are - * applicable to the one following it. - * @param effect Transition effect. - * @param animation Animation settings. - * @return 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 12 - */ + * @brief Sets transition effect animation settings. + * + * @note If combine is used for combining transition effects, the animation settings of a transition effect are + * applicable to the one following it. + * @param effect Transition effect. + * @param animation Animation settings. + * @return 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 12 + */ int32_t OH_ArkUI_TransitionEffect_SetAnimation( ArkUI_TransitionEffect* effect, ArkUI_AnimateOption* animation); #ifdef __cplusplus From aa25f5e3c76174e136c55147c2481955caf7c5b6 Mon Sep 17 00:00:00 2001 From: yang-xiaoyu5 Date: Thu, 11 Jun 2026 19:49:23 +0800 Subject: [PATCH 22/44] opt common format Signed-off-by: yang-xiaoyu5 --- .../graphic_2d/native_buffer/buffer_common.h | 4 +- multimedia/av_codec/native_avcodec_base.h | 7 ++- .../av_codec/native_avcodec_videobase.h | 46 ++++++++++--------- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/graphic/graphic_2d/native_buffer/buffer_common.h b/graphic/graphic_2d/native_buffer/buffer_common.h index d27b5e03f..832955f26 100644 --- a/graphic/graphic_2d/native_buffer/buffer_common.h +++ b/graphic/graphic_2d/native_buffer/buffer_common.h @@ -250,7 +250,7 @@ typedef enum OH_NativeBuffer_MetadataKey { * 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 integer representing the + * 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"). @@ -265,7 +265,7 @@ typedef enum OH_NativeBuffer_MetadataKey { * 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. + * and append ROI configurations safely instead of concatenating the string manually. * * @since 22 */ diff --git a/multimedia/av_codec/native_avcodec_base.h b/multimedia/av_codec/native_avcodec_base.h index 928090bd3..75743da05 100644 --- a/multimedia/av_codec/native_avcodec_base.h +++ b/multimedia/av_codec/native_avcodec_base.h @@ -1670,13 +1670,13 @@ 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) parameters. Value type is string in the format + * @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 integer representing the + * 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"). @@ -1696,8 +1696,7 @@ extern const char *OH_MD_KEY_VIDEO_ENCODER_MAX_B_FRAMES; * In buffer mode, it is configured via {@link OH_AVBuffer_SetParameter}. * * @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. - * @syscap SystemCapability.Multimedia.Media.CodecBase + * and append ROI configurations safely instead of concatenating the string manually. * @since 20 */ extern const char *OH_MD_KEY_VIDEO_ENCODER_ROI_PARAMS; diff --git a/multimedia/av_codec/native_avcodec_videobase.h b/multimedia/av_codec/native_avcodec_videobase.h index e2a54140d..cef2b7cd7 100644 --- a/multimedia/av_codec/native_avcodec_videobase.h +++ b/multimedia/av_codec/native_avcodec_videobase.h @@ -115,13 +115,13 @@ extern const char *OH_MD_KEY_VIDEO_METADATA_ROI_SEM_LABEL; */ typedef enum OH_VideoMetadataRoiSemanticLabel { /** - * Indicates an unspecified or unknown region. + * @brief Indicates an unspecified or unknown region. * * @since 26.0.0 */ OH_VIDEO_METADATA_ROI_SEM_LABEL_OTHER = 0, /** - * Indicates that the ROI contains a human face. + * @brief Indicates that the ROI contains a human face. * * @since 26.0.0 */ @@ -139,18 +139,18 @@ typedef enum OH_VideoMetadataRoiSemanticLabel { * 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. + * 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 Returns AV_ERR_OK if the string is successfully formatted and appended. - * Returns AV_ERR_INVALID_VAL if the roiStrInOut pointer or format handle is NULL, - * or if the format lacks required ROI keys. - * Returns AV_ERR_NO_MEMORY if internal memory allocation or reallocation fails. + * 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. + *
Returns {@link AV_ERR_OK} if the string is successfully formatted and appended. + *
Returns {@link AV_ERR_INVALID_VAL} if the roiStrInOut pointer or format handle is NULL, + * or if the format lacks required ROI keys. + *
Returns {@link AV_ERR_NO_MEMORY} if internal memory allocation or reallocation fails. * @release free {roiStrInOut} * @since 26.0.0 */ @@ -164,8 +164,9 @@ OH_AVErrCode OH_VideoMetadata_AppendRoiString(char **roiStrInOut, OH_AVFormat *f * * @param roiStr The input ROI configuration string. * @param outCount [OUT] Returns the number of valid ROI regions parsed from the string. - * @return Returns AV_ERR_OK if the operation is successful. - * Returns AV_ERR_INVALID_VAL if the roiStr or outCount pointer is NULL. + * @return Result code. + *
Returns {@link AV_ERR_OK} if the operation is successful. + *
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); @@ -174,19 +175,20 @@ 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. + * 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. + * 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. + * out-of-bounds writes. * @param outCount [OUT] Returns the actual number of ROIs successfully parsed and populated into the array. - * @return Returns AV_ERR_OK if the operation is successful. - * Returns AV_ERR_INVALID_VAL if roiStr, outOwnedFormats, or outCount is NULL. + * @return Result code. + *
Returns {@link AV_ERR_OK} if the operation is successful. + *
Returns {@link AV_ERR_INVALID_VAL} if roiStr, outOwnedFormats, or outCount is NULL. * @release media_foundation/OH_AVFormat_Destroy {outOwnedFormats} * @since 26.0.0 */ From e7aaccb62b1c2603e8c0da48cb4738a3b0ac5654 Mon Sep 17 00:00:00 2001 From: wanxiaoqing Date: Thu, 11 Jun 2026 20:33:20 +0800 Subject: [PATCH 23/44] =?UTF-8?q?=E8=A1=A5=E5=85=85=E5=A4=B4=E6=96=87?= =?UTF-8?q?=E4=BB=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wanxiaoqing --- distributeddatamgr/udmf/include/uds.h | 1 + 1 file changed, 1 insertion(+) diff --git a/distributeddatamgr/udmf/include/uds.h b/distributeddatamgr/udmf/include/uds.h index 226ba4f60..00ace38ae 100644 --- a/distributeddatamgr/udmf/include/uds.h +++ b/distributeddatamgr/udmf/include/uds.h @@ -40,6 +40,7 @@ #ifndef UDS_H #define UDS_H +#include #include "multimedia/image_framework/image/pixelmap_native.h" #ifdef __cplusplus From e9c94d48da2fb9792f0d9209dd0a1e6a9ea14335 Mon Sep 17 00:00:00 2001 From: silverbullet1412 Date: Tue, 9 Jun 2026 17:00:33 +0800 Subject: [PATCH 24/44] =?UTF-8?q?CAPI=E5=A4=B4=E6=96=87=E4=BB=B6=E6=8B=86?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: silverbullet1412 Change-Id: I54e65e54202c0b715ace7ecf7ed67b9b15817f83 --- arkui/ace_engine/native/BUILD.gn | 3 + arkui/ace_engine/native/native_type.h | 583 +----------------- .../ace_engine/native/node_attributes/image.h | 355 +++++++++++ .../native/node_attributes/image_animator.h | 215 +++++++ .../native/node_attributes/picker.h | 427 +++++++++++++ .../kit_sub_system/c_file_kit_sub_system.json | 3 + 6 files changed, 1011 insertions(+), 575 deletions(-) create mode 100644 arkui/ace_engine/native/node_attributes/image.h create mode 100644 arkui/ace_engine/native/node_attributes/image_animator.h create mode 100644 arkui/ace_engine/native/node_attributes/picker.h diff --git a/arkui/ace_engine/native/BUILD.gn b/arkui/ace_engine/native/BUILD.gn index 1ab2052a3..a21b0d0e3 100644 --- a/arkui/ace_engine/native/BUILD.gn +++ b/arkui/ace_engine/native/BUILD.gn @@ -71,7 +71,10 @@ if (!is_arkui_x) { "arkui/native_type.h", "arkui/native_type_visual.h", "arkui/node_attributes/navigation_router/navigation_router.h", + "arkui/node_attributes/image.h", + "arkui/node_attributes/image_animator.h", "arkui/node_attributes/node_attr_custom.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", diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 227828c4f..6314fd9dc 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -44,6 +44,9 @@ #include "node_attributes/navigation_router/navigation_router.h" #include "node_attributes/swiper/swiper.h" #include "node_types/native_type_common.h" +#include "node_attributes/image_animator.h" +#include "node_attributes/image.h" +#include "node_attributes/picker.h" #ifdef __cplusplus extern "C" { @@ -134,59 +137,6 @@ typedef struct { uint32_t columnSpan; } ArkUI_GridItemRect; -/** - * @brief Enumerates the selected indicator type of picker. - * - * @since 23 - */ -typedef enum { - /** background. */ - ARKUI_PICKER_INDICATOR_BACKGROUND = 0, - /** divider. */ - ARKUI_PICKER_INDICATOR_DIVIDER = 1, -} ArkUI_PickerIndicatorType; - -/** - * @brief Style parameters of background indicator. - * - * @since 23 - */ -typedef struct { - /** background color, 0xARGB format for example 0xFF1122FF */ - uint32_t backgroundColor; - /** radius of the top left corner. */ - float topLeftRadius; - /** radius of the top right corner */ - float topRightRadius; - /** radius of the bottom left corner */ - float bottomLeftRadius; - /** radius of the bottom right corner. */ - float bottomRightRadius; -} ArkUI_PickerIndicatorBackground; - -/** - * @brief Style parameters of divider indicator. - * - * @since 23 - */ -typedef struct { - /** stroke width */ - float strokeWidth; - /** divider color, 0xARGB format for example 0xFF1122FF */ - uint32_t dividerColor; - /** the distance between the divider and the beginning of the side of the picker (unit: vp). */ - float startMargin; - /** the distance between the divider and the end of the side of the picker (unit: vp). */ - float endMargin; -} ArkUI_PickerIndicatorDivider; - -/** - * @brief Definition of indicator style. - * - * @since 23 - */ -typedef struct ArkUI_PickerIndicatorStyle ArkUI_PickerIndicatorStyle; - /** * @brief Defines the Grid layout options. * @@ -265,13 +215,6 @@ typedef struct ArkUI_BarrierOption ArkUI_BarrierOption; */ typedef struct ArkUI_ListChildrenMainSize ArkUI_ListChildrenMainSize; -/** - * @brief Defines the image frame. - * - * @since 12 -*/ -typedef struct ArkUI_ImageAnimatorFrameInfo ArkUI_ImageAnimatorFrameInfo; - /** * @brief Defines the accessibility state for the component. * @@ -420,22 +363,6 @@ typedef enum { ARKUI_ALIGNMENT_BOTTOM_END, } ArkUI_Alignment; -/** - * @brief Enumerates the image repeat patterns. - * - * @since 12 - */ -typedef enum { - /** The image is not repeatedly drawn. */ - ARKUI_IMAGE_REPEAT_NONE = 0, - /** The image is repeatedly drawn only along the x-axis. */ - ARKUI_IMAGE_REPEAT_X, - /** The image is repeatedly drawn only along the y-axis. */ - ARKUI_IMAGE_REPEAT_Y, - /** The image is repeatedly drawn along both axes. */ - ARKUI_IMAGE_REPEAT_XY, -} ArkUI_ImageRepeat; - /** * @brief Enumerates the font styles. * @@ -742,63 +669,6 @@ typedef enum { ARKUI_COPY_OPTIONS_CROSS_DEVICE, } ArkUI_CopyOptions; - -/** - * @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. */ - ARKUI_DATEPICKER_MODE_DATE = 0, - /** A mode that displays the date in months and years. */ - ARKUI_DATEPICKER_YEAR_AND_MONTH = 1, - /** A mode that displays the date in months and days of the month. */ - ARKUI_DATEPICKER_MONTH_AND_DAY = 2, -} ArkUI_DatePickerMode; - -/** - * @brief Enumerates the types of the text picker. - * - * @since 12 - */ -typedef enum { - /** Single-column text picker. */ - ARKUI_TEXTPICKER_RANGETYPE_SINGLE = 0, - /** Multi-column text picker. */ - ARKUI_TEXTPICKER_RANGETYPE_MULTI, - /** Single-column text picker with image resources. */ - ARKUI_TEXTPICKER_RANGETYPE_RANGE_CONTENT, - /** Interconnected multi-column text picker. */ - ARKUI_TEXTPICKER_RANGETYPE_CASCADE_RANGE_CONTENT, -} ArkUI_TextPickerRangeType; - -/** - * @brief Defines the input structure of the single-column text picker with image resources. - * - * @since 12 - */ -typedef struct { - /** Image resource. */ - const char* icon; - /** Text information. */ - const char* text; -} ARKUI_TextPickerRangeContent; - -/** - * @brief Defines the input structure of the interconnected multi-column text picker. - * - * @since 12 - */ -typedef struct { - /** Text information. */ - const char* text; - /** Interconnected data. */ - const ARKUI_TextPickerRangeContent* children; - /** Size of the interconnected data array. */ - int32_t size; -} ARKUI_TextPickerCascadeRangeContent; - /** * @brief Enumerates the effects used at the edges of the component when the boundary of the scrollable content is * reached. @@ -1198,23 +1068,6 @@ typedef enum { ArkUI_CHECKBOX_SHAPE_ROUNDED_SQUARE, } ArkUI_CheckboxShape; - -/** - * @brief Defines the image size. - * - * @since 12 - */ -typedef enum { - /** The original image aspect ratio is retained. */ - 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. */ - ARKUI_IMAGE_SIZE_COVER, - /** The image is scaled with its aspect ratio retained for the content to be completely displayed within the display - * boundaries. */ - ARKUI_IMAGE_SIZE_CONTAIN, -} ArkUI_ImageSize; - /** * @brief Enumerates the adaptive color modes. * @@ -1321,110 +1174,6 @@ typedef enum { ARKUI_IMAGE_SPAN_ALIGNMENT_FOLLOW_PARAGRAPH, } ArkUI_ImageSpanAlignment; -/** - * @brief Defines how the image is resized to fit its container. - *ImageSpanAlignment - * @since 12 - */ -typedef enum { - /** The image is scaled with its aspect ratio retained for the content to be completely displayed within the - * display boundaries. */ - 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. */ - ARKUI_OBJECT_FIT_COVER, - /** The image is scaled automatically to fit the display area. */ - ARKUI_OBJECT_FIT_AUTO, - /** The image is scaled to fill the display area, and its aspect ratio is not retained. */ - ARKUI_OBJECT_FIT_FILL, - /** The image content is displayed with its aspect ratio retained. The size is smaller than or equal to the - * original size. */ - ARKUI_OBJECT_FIT_SCALE_DOWN, - /** The original size is retained. */ - ARKUI_OBJECT_FIT_NONE, - /** Not resized, the image is aligned with the start edge of the top of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_START, - /** Not resized, the image is horizontally centered at the top of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP, - /** Not resized, the image is aligned with the end edge at the top of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_TOP_END, - /** Not resized, the image is vertically centered on the start edge of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_START, - /** Not resized, the image is horizontally and vertically centered in the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_CENTER, - /** Not resized, the image is vertically centered on the end edge of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_END, - /** Not resized, the image is aligned with the start edge at the bottom of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_START, - /** Not resized, the image is horizontally centered at the bottom of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM, - /** Not resized, the image is aligned with the end edge at the bottom of the container. */ - ARKUI_OBJECT_FIT_NONE_AND_ALIGN_BOTTOM_END, - /** - * Not resized, and is used in conjunction with NODE_IMAGE_IMAGE_MATRIX. - * - * @since 21 - */ - ARKUI_OBJECT_FIT_NONE_MATRIX, -} ArkUI_ObjectFit; - -/** - * @brief Enumerates the image interpolation effect. - * - * @since 12 - */ -typedef enum { - /** No image interpolation. */ - ARKUI_IMAGE_INTERPOLATION_NONE = 0, - /** Low quality interpolation. */ - ARKUI_IMAGE_INTERPOLATION_LOW, - /** Medium quality interpolation. */ - ARKUI_IMAGE_INTERPOLATION_MEDIUM, - /** High quality interpolation. This mode produces scaled images of the highest possible quality. */ - ARKUI_IMAGE_INTERPOLATION_HIGH, -} ArkUI_ImageInterpolation; - -/** - * @brief Enumerates the image dynamic range mode. - * - * @since 21 - */ -typedef enum { - /** high dynamic range mode. */ - ARKUI_DYNAMIC_RANGE_MODE_HIGH = 0, - /** constraint dynamic range mode. */ - ARKUI_DYNAMIC_RANGE_MODE_CONSTRAINT, - /** standard dynamic range mode. */ - ARKUI_DYNAMIC_RANGE_MODE_STANDARD, -} ArkUI_DynamicRangeMode; - -/** - * @brief Enumerates the image rotate orientation. - * - * @since 21 - */ -typedef enum { - /** Use EXIF metadata for display orientation, with support for rotation and mirroring. */ - ARKUI_ORIENTATION_AUTO = 0, - /** Display original pixel data without transformation. */ - ARKUI_ORIENTATION_UP, - /** Display the image after rotating it 90 degrees clockwise. */ - ARKUI_ORIENTATION_RIGHT, - /** Display the image after rotating it 180 degrees clockwise. */ - ARKUI_ORIENTATION_DOWN, - /** Display the image after rotating it 270 degrees clockwise. */ - ARKUI_ORIENTATION_LEFT, - /** Display the image after flipping it horizontally. */ - ARKUI_ORIENTATION_UP_MIRRORED, - /** Display the image after flipping it horizontally and then rotating it 90 degrees clockwise. */ - ARKUI_ORIENTATION_RIGHT_MIRRORED, - /** Display the image after flipping it vertically. */ - ARKUI_ORIENTATION_DOWN_MIRRORED, - /** Display the image after flipping it horizontally and then rotating it 270 degrees clockwise. */ - ARKUI_ORIENTATION_LEFT_MIRRORED, -} ArkUI_ImageRotateOrientation; - - /** * @brief Enumerates the modes in which components are laid out along the main axis of the container. * @@ -1517,22 +1266,6 @@ typedef enum { ARKUI_FLEX_WRAP_WRAP_REVERSE, } ArkUI_FlexWrap; -/** - * @brief Enumerates the alignment modes between the calendar picker and the entry component. - * - * @since 12 - */ -typedef enum { - /** Left aligned. */ - ARKUI_CALENDAR_ALIGNMENT_START = 0, - /** Center aligned. */ - ARKUI_CALENDAR_ALIGNMENT_CENTER, - /** Right aligned. */ - ARKUI_CALENDAR_ALIGNMENT_END, -} ArkUI_CalendarAlignment; - - - /** * @brief Defines the gradient color stop structure. * @@ -1597,18 +1330,6 @@ typedef enum { ARKUI_ELLIPSIS_MODE_MULTILINE_CENTER, } ArkUI_EllipsisMode; -/** - * @brief Enumerates the image rendering modes. - * - * @since 12 - */ -typedef enum { - /** Render image pixels as they are in the original source image. */ - ARKUI_IMAGE_RENDER_MODE_ORIGINAL = 0, - /** Render image pixels to create a monochrome template image. */ - ARKUI_IMAGE_RENDER_MODE_TEMPLATE, -} ArkUI_ImageRenderMode; - /** * @brief Defines a mask area. * @@ -2187,22 +1908,6 @@ typedef enum { ARKUI_ERROR_CODE_PARAM_ERROR = 100023, } ArkUI_ErrorCode; -/** - * @brief Defines the playback status for the image animator. - * - * @since 12 -*/ -typedef enum { - /** The animation is in the initial state. */ - ARKUI_ANIMATION_STATUS_INITIAL, - /** The animation is being played. */ - ARKUI_ANIMATION_STATUS_RUNNING, - /** The animation is paused. */ - ARKUI_ANIMATION_STATUS_PAUSED, - /** The animation is stopped. */ - ARKUI_ANIMATION_STATUS_STOPPED, -} ArkUI_AnimationStatus; - /** * @brief Defines the state type for the accessibility checkbox. * @@ -2541,20 +2246,6 @@ typedef enum { */ typedef struct ArkUI_SystemFontStyleEvent ArkUI_SystemFontStyleEvent; -/** - * @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 Defines a two-dimensional point struct, with coordinates stored as float type. * @@ -2573,11 +2264,11 @@ typedef struct { #include "native_type_visual.h" - /** - * @brief Defines the options for selection operation. - * - * @since 23 - */ +/** + * @brief Defines the options for selection operation. + * + * @since 23 + */ typedef struct ArkUI_SelectionOptions ArkUI_SelectionOptions; /** @@ -3865,131 +3556,6 @@ float OH_ArkUI_CustomSpanDrawInfo_GetLineBottom(ArkUI_CustomSpanDrawInfo* info); */ float OH_ArkUI_CustomSpanDrawInfo_GetBaseline(ArkUI_CustomSpanDrawInfo* info); -/** - * @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); - /** * @brief Create accessibility state. * @@ -4406,120 +3972,6 @@ void OH_ArkUI_CrossLanguageOption_SetAttributeSettingStatus(ArkUI_CrossLanguageO */ bool OH_ArkUI_CrossLanguageOption_GetAttributeSettingStatus(ArkUI_CrossLanguageOption* option); -/** - * @brief Creates a TextPickerRangeContent instance. - * - * @param length The length of the picker array. Value range: [1, +∞). - * @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 nullptr if length is not in [1, +∞). - * 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 nullptr, 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 icon. If nullptr, this function has no effect. - * @param index Index of the item to set. Valid values are greater than or equal to 0 and less than the - * length argument passed to {@link OH_ArkUI_TextPickerRangeContentArray_Create}. Otherwise this function - * does nothing. - * @note If an icon was already set at index, 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 nullptr, 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 text. If nullptr, this function has no effect. - * @param index Index of the item to set. Valid values are greater than or equal to 0 and less than the - * length argument passed to {@link OH_ArkUI_TextPickerRangeContentArray_Create}. Otherwise this function - * does nothing. - * @note If text was already set at index, 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 nullptr, this function has no effect. - * @note After this call, handle 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: [1, +∞). - * @return Returns a pointer to the first sibling node when length is in [1, +∞); returns nullptr - * otherwise. The sibling count used for bounds checks equals length. - * @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 nullptr, - * this function has no effect. - * @param text Null-terminated C string. The content is copied; the caller keeps ownership of text. If - * nullptr, this function has no effect. - * @param index Index of the sibling to set. Valid values are greater than or equal to 0 and less than the - * length argument passed to {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create}. Otherwise this - * function does nothing. - * @note If text was already set at index, 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 nullptr, - * this function has no effect. - * @param child Pointer returned by {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create} for the child column. - * If nullptr, this function has no effect. If a subtree already exists at index, it is destroyed - * with {@link OH_ArkUI_TextCascadePickerRangeContentArray_Destroy} before the new child is stored. - * While child stays attached under the parent, the caller must not call - * {@link OH_ArkUI_TextCascadePickerRangeContentArray_Destroy} on child. - * @param index Index of the sibling that owns the subtree. Valid values are greater than or equal to 0 and less - * than the length 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 nullptr, this function has no effect. - * @note After this call, handle 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 child while - * it is still stored in a parent's {@code children}. - * @since 19 - */ -void OH_ArkUI_TextCascadePickerRangeContentArray_Destroy(ArkUI_TextCascadePickerRangeContentArray* handle); /** * @brief Create an object for the EmbeddedComponent option. @@ -7536,25 +6988,6 @@ ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_SetStyledPlaceholder( ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_ScrollToVisible( const OH_ArkUI_TextEditorStyledStringController* controller, int32_t start, int32_t end); -/** - * @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); - /** * @brief Set the parameters of background style. * diff --git a/arkui/ace_engine/native/node_attributes/image.h b/arkui/ace_engine/native/node_attributes/image.h new file mode 100644 index 000000000..60ea6e4a2 --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/image.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 +/** @} */ diff --git a/arkui/ace_engine/native/node_attributes/image_animator.h b/arkui/ace_engine/native/node_attributes/image_animator.h new file mode 100644 index 000000000..d35543f88 --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/image_animator.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 + +#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 +/** @} */ diff --git a/arkui/ace_engine/native/node_attributes/picker.h b/arkui/ace_engine/native/node_attributes/picker.h new file mode 100644 index 000000000..f5a74361f --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/picker.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 + +#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 0xFF1122FF + * + * @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 0xFF1122FF + * + * @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 nullptr if length is not in [1, +infinity). + * 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 nullptr, 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 icon. If nullptr, this function has no effect. + * @param index Index of the item to set. Valid values are greater than or equal to 0 and less than the + * length argument passed to {@link OH_ArkUI_TextPickerRangeContentArray_Create}. Otherwise this function + * does nothing. + * @note If an icon was already set at index, 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 nullptr, 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 text. If nullptr, this function has no effect. + * @param index Index of the item to set. Valid values are greater than or equal to 0 and less than the + * length argument passed to {@link OH_ArkUI_TextPickerRangeContentArray_Create}. Otherwise this function + * does nothing. + * @note If text was already set at index, 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 nullptr, this function has no effect. + * @note After this call, handle 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: [1, +infinity). + * @return Returns a pointer to the first sibling node when length is in [1, +infinity); returns + * nullptr otherwise. The sibling count used for bounds checks equals length. + * @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 nullptr, + * this function has no effect. + * @param text Null-terminated C string. The content is copied; the caller keeps ownership of text. If + * nullptr, this function has no effect. + * @param index Index of the sibling to set. Valid values are greater than or equal to 0 and less than the + * length argument passed to {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create}. Otherwise this + * function does nothing. + * @note If text was already set at index, 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 nullptr, + * this function has no effect. + * @param child Pointer returned by {@link OH_ArkUI_TextCascadePickerRangeContentArray_Create} for the child column. + * If nullptr, this function has no effect. If a subtree already exists at index, it is destroyed + * with {@link OH_ArkUI_TextCascadePickerRangeContentArray_Destroy} before the new child is stored. + * While child stays attached under the parent, the caller must not call + * {@link OH_ArkUI_TextCascadePickerRangeContentArray_Destroy} on child. + * @param index Index of the sibling that owns the subtree. Valid values are greater than or equal to 0 and less + * than the length 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 nullptr, this function has no effect. + * @note After this call, handle 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 child 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 +/** @} */ diff --git a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json index 7f74328fd..674a8e0ab 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json +++ b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json @@ -33,7 +33,10 @@ { "filePath": "arkui/ace_engine/native/native_material.h", "kitName": "ArkUI", "subSystem": "ArkUI开发框架" }, { "filePath": "arkui/ace_engine/native/native_node.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/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/node_attr_custom.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开发框架" }, From 5d3140a6b1b41b9007e409af24e1fcdac1fe60a3 Mon Sep 17 00:00:00 2001 From: oh_hw_llm Date: Fri, 5 Jun 2026 12:47:19 +0800 Subject: [PATCH 25/44] Description: lite ndk IssueNo: https://gitcode.com/openharmony/build/issues/4563?ref=&did=4073130#tid-4073130 Feature Or Bugfix: Feature Binary Source: No Signed-off-by: oh_hw_llm --- graphic/graphic_2d/native_drawing/BUILD.gn | 17 ---- .../native_drawing/lite/drawing_canvas_lite.h | 50 ---------- .../lite/libnative_drawing_lite.ndk.json | 7 -- ndk_targets.gni | 2 - third_party/musl/ndk_musl_include/pthread.h | 6 -- third_party/musl/ndk_script/BUILD.gn | 2 + .../ndk_script/adapter/libc_lite.ndk.json | 92 +++++++++++++------ .../musl/ndk_script/copy_musl_sysroot_lite.sh | 27 +++++- 8 files changed, 93 insertions(+), 110 deletions(-) delete mode 100644 graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h delete mode 100644 graphic/graphic_2d/native_drawing/lite/libnative_drawing_lite.ndk.json mode change 100644 => 100755 third_party/musl/ndk_script/copy_musl_sysroot_lite.sh diff --git a/graphic/graphic_2d/native_drawing/BUILD.gn b/graphic/graphic_2d/native_drawing/BUILD.gn index 0028bd1d6..2e45e6e77 100644 --- a/graphic/graphic_2d/native_drawing/BUILD.gn +++ b/graphic/graphic_2d/native_drawing/BUILD.gn @@ -14,13 +14,6 @@ import("//build/ohos.gni") import("//build/ohos/ndk/ndk.gni") -ohos_ndk_headers("native_drawing_lite_header") { - dest_dir = "$ndk_lite_headers_out_dir/native_drawing" - sources = [ - "//interface/sdk_c/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h", - ] -} - ohos_ndk_headers("native_drawing_header") { dest_dir = "$ndk_headers_out_dir/native_drawing" sources = [ @@ -70,16 +63,6 @@ ohos_ndk_headers("native_drawing_header") { ] } -ohos_ndk_lite_library("libnative_drawing_ndk_lite") { - output_name = "native_drawing_lite" - output_extension = "so" - ndk_description_file = "./lite/libnative_drawing_lite.ndk.json" - system_capability = "SystemCapability.Graphic.Graphic2D.NativeDrawing" - system_capability_headers = [ - "native_drawing/lite/drawing_canvas_lite.h", - ] -} - ohos_ndk_library("libnative_drawing_ndk") { output_name = "native_drawing" output_extension = "so" diff --git a/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h b/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h deleted file mode 100644 index 3dd37ad23..000000000 --- a/graphic/graphic_2d/native_drawing/lite/drawing_canvas_lite.h +++ /dev/null @@ -1,50 +0,0 @@ -/* - * Copyright (c) 2021-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 Drawing - * @{ - * - * @brief Provides functions such as 2D graphics rendering, text drawing, and image display. - * - * @since 8 - * @version 1.0 - */ -/** - * @file drawing_canvas.h - * - * @brief This file declares the functions related to the canvas in the drawing module. - * By default, the canvas has a black brush with anti-aliasing enabled and without any other style. This brush takes - * effect only when no brush or pen is proactively set in the canvas. - * - * @kit ArkGraphics2D - * @library libnative_drawing.so - * @syscap SystemCapability.Graphic.Graphic2D.NativeDrawing - * @since 8 - * @version 1.0 - */ - -#ifndef C_INCLUDE_DRAWING_H -#define C_INCLUDE_DRAWING_H - -#ifdef __cplusplus -extern "C" { -#endif - -#ifdef __cplusplus -} -#endif -/** @} */ -#endif \ No newline at end of file diff --git a/graphic/graphic_2d/native_drawing/lite/libnative_drawing_lite.ndk.json b/graphic/graphic_2d/native_drawing/lite/libnative_drawing_lite.ndk.json deleted file mode 100644 index 9ee38c9bf..000000000 --- a/graphic/graphic_2d/native_drawing/lite/libnative_drawing_lite.ndk.json +++ /dev/null @@ -1,7 +0,0 @@ -[ - { "name": "OH_Drawing_BitmapCreate" }, - { - "first_introduced": "23", - "name": "OH_Drawing_IsFontSupportedFromBuffer" - } -] \ No newline at end of file diff --git a/ndk_targets.gni b/ndk_targets.gni index 81a4cf595..5a4f54e6d 100644 --- a/ndk_targets.gni +++ b/ndk_targets.gni @@ -106,8 +106,6 @@ _ndk_library_targets = [ "//interface/sdk_c/graphic/graphic_2d/native_color_space_manager:native_color_space_manager_header", "//interface/sdk_c/graphic/graphic_2d/native_drawing:libnative_drawing_ndk", "//interface/sdk_c/graphic/graphic_2d/native_drawing:native_drawing_header", - "//interface/sdk_c/graphic/graphic_2d/native_drawing:native_drawing_lite_header", - "//interface/sdk_c/graphic/graphic_2d/native_drawing:libnative_drawing_ndk_lite", "//interface/sdk_c/graphic/graphic_2d/native_effect:libnative_effect_ndk", "//interface/sdk_c/graphic/graphic_2d/native_effect:native_effect_header", "//interface/sdk_c/IPCKit:libipc_capi", diff --git a/third_party/musl/ndk_musl_include/pthread.h b/third_party/musl/ndk_musl_include/pthread.h index 8b2d9d41f..456723755 100644 --- a/third_party/musl/ndk_musl_include/pthread.h +++ b/third_party/musl/ndk_musl_include/pthread.h @@ -66,15 +66,9 @@ extern "C" { #define PTHREAD_PROCESS_SHARED 1 -#ifndef PTHREAD_MUTEX_INITIALIZER #define PTHREAD_MUTEX_INITIALIZER {{{0}}} -#endif -#ifndef PTHREAD_RWLOCK_INITIALIZER #define PTHREAD_RWLOCK_INITIALIZER {{{0}}} -#endif -#ifndef PTHREAD_COND_INITIALIZER #define PTHREAD_COND_INITIALIZER {{{0}}} -#endif #define PTHREAD_ONCE_INIT 0 diff --git a/third_party/musl/ndk_script/BUILD.gn b/third_party/musl/ndk_script/BUILD.gn index 2b42f43ec..692777929 100644 --- a/third_party/musl/ndk_script/BUILD.gn +++ b/third_party/musl/ndk_script/BUILD.gn @@ -442,6 +442,7 @@ ohos_copy("musl_bits_riscv32") { "alltypes.h", "posix.h", "signal.h", + "stat.h", "stdint.h", "fcntl.h", "errno.h", @@ -466,6 +467,7 @@ ohos_copy("musl_bits_cortex_m") { "alltypes.h", "posix.h", "signal.h", + "stat.h", "stdint.h", "fcntl.h", "errno.h", diff --git a/third_party/musl/ndk_script/adapter/libc_lite.ndk.json b/third_party/musl/ndk_script/adapter/libc_lite.ndk.json index c1028407b..1b87ad06b 100644 --- a/third_party/musl/ndk_script/adapter/libc_lite.ndk.json +++ b/third_party/musl/ndk_script/adapter/libc_lite.ndk.json @@ -1,29 +1,67 @@ [ - { "name": "cargf" }, - { "name": "cargl" }, - { "name": "casin" }, - { "name": "casinf" }, - { "name": "casinh" }, - { "name": "casinhf" }, - { "name": "casinhl" }, - { "name": "casinl" }, - { "name": "catan" }, - { "name": "catanf" }, - { "name": "catanh" }, - { "name": "catanhf" }, - { "name": "catanhl" }, - { "name": "catanl" }, - { "name": "catclose" }, - { "name": "catgets" }, - { "name": "catopen" }, - { "name": "cbrt" }, - { "name": "cbrtf" }, - { "name": "cbrtl" }, - { "name": "ccos" }, - { "name": "ccosf" }, - { "name": "ccosh" }, - { "name": "ccoshf" }, - { "name": "ccoshl" }, - { "name": "ccosl" }, - { "name": "ceil" } + { "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"} ] diff --git a/third_party/musl/ndk_script/copy_musl_sysroot_lite.sh b/third_party/musl/ndk_script/copy_musl_sysroot_lite.sh old mode 100644 new mode 100755 index 5543e7953..98c36ce4a --- a/third_party/musl/ndk_script/copy_musl_sysroot_lite.sh +++ b/third_party/musl/ndk_script/copy_musl_sysroot_lite.sh @@ -28,4 +28,29 @@ if [ ! -d "${OUT_DIR}" ];then mkdir -p ${OUT_DIR} fi -cp -rp ${SOURCE_DIR}/* ${OUT_DIR} \ No newline at end of file +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} From f2b786b94a815c80dcde73ed60e1aa509110b133 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Fri, 12 Jun 2026 15:44:48 +0800 Subject: [PATCH 26/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] Change-Id: I1306fc711f3474cd4f5b6bfabfcb30a49e5ec086 --- arkui/ace_engine/native/native_animate.h | 226 +++++++++++++---------- 1 file changed, 129 insertions(+), 97 deletions(-) diff --git a/arkui/ace_engine/native/native_animate.h b/arkui/ace_engine/native/native_animate.h index a01a5c491..6118db38b 100644 --- a/arkui/ace_engine/native/native_animate.h +++ b/arkui/ace_engine/native/native_animate.h @@ -170,9 +170,10 @@ typedef struct { * the state changes in the closure function. *
Note: Make sure the component attributes to be set in the closure function have been set before. * @param complete Callback invoked when the animation playback is complete. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
*/ int32_t (*animateTo)(ArkUI_ContextHandle context, ArkUI_AnimateOption* option, ArkUI_ContextCallback* update, ArkUI_AnimateCompleteCallback* complete); @@ -182,9 +183,10 @@ typedef struct { * * @param context **UIContext** instance. * @param option Keyframe animation parameter. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
*/ int32_t (*keyframeAnimateTo)(ArkUI_ContextHandle context, ArkUI_KeyframeAnimateOption* option); @@ -433,9 +435,10 @@ void OH_ArkUI_KeyframeAnimateOption_Dispose(ArkUI_KeyframeAnimateOption* option) * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the * duration of a single animation multiplied by the number of animation playback times. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_KeyframeAnimateOption_SetDelay(ArkUI_KeyframeAnimateOption* option, int32_t value); @@ -452,9 +455,10 @@ int32_t OH_ArkUI_KeyframeAnimateOption_SetDelay(ArkUI_KeyframeAnimateOption* opt * of times. Default value: **1**, indicating that the animation is played once. *
If the value is less than **-1**, the operation is invalid, and the error code * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_KeyframeAnimateOption_SetIterations(ArkUI_KeyframeAnimateOption* option, int32_t value); @@ -468,9 +472,10 @@ int32_t OH_ArkUI_KeyframeAnimateOption_SetIterations(ArkUI_KeyframeAnimateOption * @param userData Pointer to a custom object. *
Abnormal value processing is not involved. * @param onFinish Indicates the callback. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback( @@ -483,9 +488,10 @@ int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnFinishCallback( *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. * @param frameRate Expected frame rate for the keyframe animation. *
If **frameRate** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 19 */ int32_t OH_ArkUI_KeyframeAnimateOption_SetExpectedFrameRate( @@ -500,9 +506,10 @@ int32_t OH_ArkUI_KeyframeAnimateOption_SetExpectedFrameRate( *
If the value is less than 0, **0** is used. * @param index Index of the keyframe state segment. *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_KeyframeAnimateOption_SetDuration(ArkUI_KeyframeAnimateOption* option, int32_t value, int32_t index); @@ -519,9 +526,10 @@ int32_t OH_ArkUI_KeyframeAnimateOption_SetDuration(ArkUI_KeyframeAnimateOption* * keyframe animation states. *
If the value of **index** is less than 0 or out of range, the error code * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_KeyframeAnimateOption_SetCurve( @@ -540,9 +548,10 @@ int32_t OH_ArkUI_KeyframeAnimateOption_SetCurve( * keyframe animation states. *
If the value of **index** is less than 0 or out of range, the error code * {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_KeyframeAnimateOption_RegisterOnEventCallback( @@ -631,9 +640,10 @@ void OH_ArkUI_AnimatorOption_Dispose(ArkUI_AnimatorOption* option); *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. * @param value Playback duration, in ms. The default value is 0 ms. Value range: [0, +∞). *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetDuration(ArkUI_AnimatorOption* option, int32_t value); @@ -650,9 +660,10 @@ int32_t OH_ArkUI_AnimatorOption_SetDuration(ArkUI_AnimatorOption* option, int32_ * state at the absolute value. If the absolute value of **value** is greater than or equal to the actual animation * duration, the animation starts its first frame from the end state. The actual animation duration is equal to the * duration of a single animation multiplied by the number of animation playback times. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetDelay(ArkUI_AnimatorOption* option, int32_t value); @@ -670,9 +681,10 @@ int32_t OH_ArkUI_AnimatorOption_SetDelay(ArkUI_AnimatorOption* option, int32_t v * parameter is set to **-1**, the animation is played for an infinite number of times. Default value: **1** ( * played once). *
If the value is less than -1, the operation is invalid. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetIterations(ArkUI_AnimatorOption* option, int32_t value); @@ -685,9 +697,10 @@ int32_t OH_ArkUI_AnimatorOption_SetIterations(ArkUI_AnimatorOption* option, int3 * @param value Status of the component before and after the animator animation execution. Default value: * {@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}. *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetFill(ArkUI_AnimatorOption* option, ArkUI_AnimationFillMode value); @@ -699,9 +712,10 @@ int32_t OH_ArkUI_AnimatorOption_SetFill(ArkUI_AnimatorOption* option, ArkUI_Anim *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. * @param value Animation playback direction. *
If the value is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetDirection(ArkUI_AnimatorOption* option, ArkUI_AnimationDirection value); @@ -717,9 +731,10 @@ int32_t OH_ArkUI_AnimatorOption_SetDirection(ArkUI_AnimatorOption* option, ArkUI * @param value Interpolation curve. Default value: {@link ARKUI_CURVE_LINEAR}. You are advised to use * {@link ARKUI_CURVE_EASE_IN_OUT} to obtain a smoother animation effect. *
If **value** is set to **NULL**, the default curve {@link ARKUI_CURVE_LINEAR} is used. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value); @@ -732,9 +747,10 @@ int32_t OH_ArkUI_AnimatorOption_SetCurve(ArkUI_AnimatorOption* option, ArkUI_Cur * @param option Animator parameters. *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. * @param value Interpolation start point of the animation. Value range: (-∞, +∞). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetBegin(ArkUI_AnimatorOption* option, float value); @@ -747,9 +763,10 @@ int32_t OH_ArkUI_AnimatorOption_SetBegin(ArkUI_AnimatorOption* option, float val * @param option Animator parameters. *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. * @param value Interpolation end point of the animation. Value range: (-∞, +∞). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetEnd(ArkUI_AnimatorOption* option, float value); @@ -761,9 +778,10 @@ int32_t OH_ArkUI_AnimatorOption_SetEnd(ArkUI_AnimatorOption* option, float value *
If **option** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. * @param value Expected frame rate range. *
If **value** is set to **NULL**, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange( @@ -782,9 +800,10 @@ int32_t OH_ArkUI_AnimatorOption_SetExpectedFrameRateRange( * @param value Keyframe value. Value range: (-∞, +∞). * @param index Keyframe index. *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetKeyframe( @@ -801,9 +820,10 @@ int32_t OH_ArkUI_AnimatorOption_SetKeyframe( * @param value Interpolation curve. Default value: **NULL**, indicating linear interpolation. * @param index Keyframe index. *
If the value of **index** is less than 0, the error code {@link ARKUI_ERROR_CODE_PARAM_INVALID} is returned. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_SetKeyframeCurve(ArkUI_AnimatorOption* option, ArkUI_CurveHandle value, int32_t index); @@ -957,9 +977,10 @@ float OH_ArkUI_AnimatorOnFrameEvent_GetValue(ArkUI_AnimatorOnFrameEvent* event); * @param option Animator animation parameters. * @param userData User-defined parameter. * @param callback Indicates the callback to set. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_RegisterOnFrameCallback( @@ -971,9 +992,10 @@ int32_t OH_ArkUI_AnimatorOption_RegisterOnFrameCallback( * @param option Animator animation parameters. * @param userData User-defined parameter. * @param callback Indicates the callback to set. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_RegisterOnFinishCallback( @@ -985,9 +1007,10 @@ int32_t OH_ArkUI_AnimatorOption_RegisterOnFinishCallback( * @param option Animator animation parameters. * @param userData User-defined parameter. * @param callback Indicates the callback to set. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_RegisterOnCancelCallback( @@ -999,9 +1022,10 @@ int32_t OH_ArkUI_AnimatorOption_RegisterOnCancelCallback( * @param option Animator animation parameters. * @param userData User-defined parameter. * @param callback Indicates the callback to set. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback( @@ -1012,9 +1036,10 @@ int32_t OH_ArkUI_AnimatorOption_RegisterOnRepeatCallback( * * @param animatorHandle Animator object. * @param option Animator animation parameters. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_Animator_ResetAnimatorOption( @@ -1024,9 +1049,10 @@ int32_t OH_ArkUI_Animator_ResetAnimatorOption( * @brief Starts the animation of an animator. * * @param animatorHandle Animator object. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_Animator_Play(ArkUI_AnimatorHandle animatorHandle); @@ -1035,9 +1061,10 @@ int32_t OH_ArkUI_Animator_Play(ArkUI_AnimatorHandle animatorHandle); * @brief Ends the animation of an animator. * * @param animatorHandle Animator object. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_Animator_Finish(ArkUI_AnimatorHandle animatorHandle); @@ -1046,9 +1073,10 @@ int32_t OH_ArkUI_Animator_Finish(ArkUI_AnimatorHandle animatorHandle); * @brief Pauses the animation of an animator. * * @param animatorHandle Animator object. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_Animator_Pause(ArkUI_AnimatorHandle animatorHandle); @@ -1057,9 +1085,10 @@ int32_t OH_ArkUI_Animator_Pause(ArkUI_AnimatorHandle animatorHandle); * @brief Cancels the animation of an animator. * * @param animatorHandle Animator object. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_Animator_Cancel(ArkUI_AnimatorHandle animatorHandle); @@ -1068,9 +1097,10 @@ int32_t OH_ArkUI_Animator_Cancel(ArkUI_AnimatorHandle animatorHandle); * @brief Plays this animation in reverse order. * * @param animatorHandle Animator object. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_Animator_Reverse(ArkUI_AnimatorHandle animatorHandle); @@ -1310,9 +1340,10 @@ void OH_ArkUI_TransitionEffect_Dispose(ArkUI_TransitionEffect* effect); * * @param firstEffect Transition effect. * @param secondEffect Combination of transition effects. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_TransitionEffect_Combine( @@ -1325,9 +1356,10 @@ int32_t OH_ArkUI_TransitionEffect_Combine( * applicable to the one following it. * @param effect Transition effect. * @param animation Animation settings. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 12 */ int32_t OH_ArkUI_TransitionEffect_SetAnimation( @@ -1337,4 +1369,4 @@ int32_t OH_ArkUI_TransitionEffect_SetAnimation( #endif #endif // ARKUI_NATIVE_ANIMATE_H -/** @} */ \ No newline at end of file +/** @} */ From 715902ffb14a1221c07cc97280bf6f35a07fb4be Mon Sep 17 00:00:00 2001 From: zcr0917 Date: Thu, 7 May 2026 14:28:48 +0800 Subject: [PATCH 27/44] add automotive camera position description Signed-off-by: zcr0917 --- multimedia/camera_framework/camera.h | 97 +++++++++++++++++++++ multimedia/camera_framework/camera.ndk.json | 4 + multimedia/camera_framework/camera_device.h | 11 +++ 3 files changed, 112 insertions(+) diff --git a/multimedia/camera_framework/camera.h b/multimedia/camera_framework/camera.h index 02072c3fb..77984ee56 100644 --- a/multimedia/camera_framework/camera.h +++ b/multimedia/camera_framework/camera.h @@ -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. * diff --git a/multimedia/camera_framework/camera.ndk.json b/multimedia/camera_framework/camera.ndk.json index 312e6d108..8da319904 100644 --- a/multimedia/camera_framework/camera.ndk.json +++ b/multimedia/camera_framework/camera.ndk.json @@ -1138,5 +1138,9 @@ { "first_introduced": "26.0.0", "name": "OH_MetadataObjectExt_Destroy" + }, + { + "first_introduced": "26.0.0", + "name": "OH_CameraDevice_GetAutomotiveCameraPosition" } ] diff --git a/multimedia/camera_framework/camera_device.h b/multimedia/camera_framework/camera_device.h index a8f7477aa..603eadf93 100644 --- a/multimedia/camera_framework/camera_device.h +++ b/multimedia/camera_framework/camera_device.h @@ -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 From 2cf0fc8b5eb07ebb1b2333e40c532b1c32f32e1e Mon Sep 17 00:00:00 2001 From: tzcurtain Date: Tue, 9 Jun 2026 15:05:04 +0800 Subject: [PATCH 28/44] =?UTF-8?q?=E6=96=87=E6=9C=ACnode=5Ftype=E6=8B=86?= =?UTF-8?q?=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: tzcurtain Co-Authored-By: Agent --- arkui/ace_engine/native/BUILD.gn | 8 + arkui/ace_engine/native/native_type.h | 1859 +---------------- .../native/node_attributes/custom_span.h | 184 ++ .../native/node_attributes/image_span.h | 72 + .../native/node_attributes/progress.h | 158 ++ .../native/node_attributes/rich_editor.h | 262 +++ .../ace_engine/native/node_attributes/text.h | 486 +++++ .../native/node_attributes/text_area.h | 71 + .../native/node_attributes/text_common.h | 699 +++++++ .../native/node_attributes/text_input.h | 240 +++ .../kit_sub_system/c_file_kit_sub_system.json | 8 + 11 files changed, 2196 insertions(+), 1851 deletions(-) create mode 100644 arkui/ace_engine/native/node_attributes/custom_span.h create mode 100644 arkui/ace_engine/native/node_attributes/image_span.h create mode 100644 arkui/ace_engine/native/node_attributes/progress.h create mode 100644 arkui/ace_engine/native/node_attributes/rich_editor.h create mode 100644 arkui/ace_engine/native/node_attributes/text.h create mode 100644 arkui/ace_engine/native/node_attributes/text_area.h create mode 100644 arkui/ace_engine/native/node_attributes/text_common.h create mode 100644 arkui/ace_engine/native/node_attributes/text_input.h diff --git a/arkui/ace_engine/native/BUILD.gn b/arkui/ace_engine/native/BUILD.gn index d8619fa3e..91a07a9b7 100644 --- a/arkui/ace_engine/native/BUILD.gn +++ b/arkui/ace_engine/native/BUILD.gn @@ -80,6 +80,14 @@ if (!is_arkui_x) { "arkui/node_attributes/swiper/swiper.h", "arkui/node_types/native_type_common.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", diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 7297a3ff5..7d44e2ea8 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -53,6 +53,14 @@ #include "node_attributes/image_animator.h" #include "node_attributes/image.h" #include "node_attributes/picker.h" +#include "node_attributes/text_common.h" +#include "node_attributes/text.h" +#include "node_attributes/text_input.h" +#include "node_attributes/text_area.h" +#include "node_attributes/rich_editor.h" +#include "node_attributes/image_span.h" +#include "node_attributes/custom_span.h" +#include "node_attributes/progress.h" #ifdef __cplusplus extern "C" { @@ -185,13 +193,6 @@ struct ArkUI_Context; */ typedef struct ArkUI_Context* ArkUI_ContextHandle; -/** -* @brief Define the data objects of styled string supported by text components. -* -* @since 14 -*/ -typedef struct ArkUI_StyledString_Descriptor ArkUI_StyledString_Descriptor; - /** * @brief specifies the alignment rules for subcomponents set in relative containers. * @@ -256,13 +257,6 @@ typedef struct ArkUI_HostWindowInfo ArkUI_HostWindowInfo; */ typedef struct ArkUI_ActiveChildrenInfo ArkUI_ActiveChildrenInfo; -/** - * @brief Set the linear progress indicator style. - * - * @since 15 - */ -typedef struct ArkUI_ProgressLinearStyleOption ArkUI_ProgressLinearStyleOption; - /** * @brief The cross-language option. * @@ -284,20 +278,6 @@ typedef struct ArkUI_PositionEdges ArkUI_PositionEdges; */ typedef struct ArkUI_PixelRoundPolicy ArkUI_PixelRoundPolicy; -/** - * @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 Defines the selected drag preview style configuration. * @since 23 @@ -355,282 +335,6 @@ typedef enum { ARKUI_ALIGNMENT_BOTTOM_END, } ArkUI_Alignment; -/** - * @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 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 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 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; - -/** - * @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 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 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 Enumerates the text copy and paste modes. * @@ -891,36 +595,6 @@ typedef enum { ARKUI_ACCESSIBILITY_MODE_DISABLED_FOR_DESCENDANTS, } ArkUI_AccessibilityMode; -/** - * @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 Defines how the adaptive height is determined for the text. - * - * @since 12 - */ -typedef enum { - /** Prioritize the maxLines settings. */ - ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MAX_LINES_FIRST = 0, - /** Prioritize the minFontSize 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 nested scrolling options. * @@ -1114,44 +788,6 @@ typedef enum { ARKUI_HORIZONTAL_ALIGNMENT_END, } ArkUI_HorizontalAlignment; -/** - * @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 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; - /** * @brief Enumerates the modes in which components are laid out along the main axis of the container. * @@ -1258,56 +894,6 @@ typedef struct { int size; } ArkUI_ColorStop; - - -/** - * @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 - * NORMAL. */ - ARKUI_WORD_BREAK_BREAK_ALL, - /** This option has the same effect as BREAK_ALL 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 NORMAL. */ - 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 NORMAL. - * @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 a mask area. * @@ -1446,196 +1032,6 @@ typedef enum { ARKUI_BUTTON_ROUNDED_RECTANGLE = 8 } ArkUI_ButtonType; -/** - * @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; - -/** - * @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 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 Define the pattern of element arrangement in the main axis direction of the Swiper component. * @@ -1940,27 +1336,6 @@ typedef enum { ARKUI_ACCESSIBILITY_ACTION_PASTE = 1 << 4, } ArkUI_AccessibilityActionType; -/** - * @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 defines the enumerated value of the extended security zone. * @@ -3407,133 +2782,6 @@ int32_t OH_ArkUI_ListChildrenMainSizeOption_UpdateSize(ArkUI_ListChildrenMainSiz */ float OH_ArkUI_ListChildrenMainSizeOption_GetMainSize(ArkUI_ListChildrenMainSize* option, int32_t index); -/** - * @brief Creates measurement information for this custom span. - * - * @return Returns a CustomSpanMeasureInfo instance. - *
If the result returns nullptr, there may be out of memory. - * @since 12 -*/ -ArkUI_CustomSpanMeasureInfo* OH_ArkUI_CustomSpanMeasureInfo_Create(void); - -/** - * @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, 0.0f is returned. - *
Possible causes: Parameter verification failed, the parameter should not be nullptr. - * @since 12 -*/ -float OH_ArkUI_CustomSpanMeasureInfo_GetFontSize(ArkUI_CustomSpanMeasureInfo* info); - -/** - * @brief Creates measurement metrics for this custom span. - * - * @return Returns a CustomSpanMetrics instance. - *
If the result returns nullptr, there may be out of memory. - * @since 12 -*/ -ArkUI_CustomSpanMetrics* OH_ArkUI_CustomSpanMetrics_Create(void); - -/** - * @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 CustomSpanMetrics 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. - *
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 CustomSpanMetrics 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. - *
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 Creates drawing information for this custom span. - * - * @return Returns a CustomSpanDrawInfo instance. - *
If the result returns nullptr, there may be out of memory. - * @since 12 -*/ -ArkUI_CustomSpanDrawInfo* OH_ArkUI_CustomSpanDrawInfo_Create(void); - -/** - * @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, 0.0f is returned. - *
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, 0.0f is returned. - *
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, 0.0f is returned. - *
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, 0.0f is returned. - *
Possible causes: Parameter verification failed, the parameter should not be nullptr. - * @since 12 -*/ -float OH_ArkUI_CustomSpanDrawInfo_GetBaseline(ArkUI_CustomSpanDrawInfo* info); - /** * @brief Create accessibility state. * @@ -3823,98 +3071,6 @@ ArkUI_NodeHandle OH_ArkUI_ActiveChildrenInfo_GetNodeByIndex(ArkUI_ActiveChildren */ int32_t OH_ArkUI_ActiveChildrenInfo_GetCount(ArkUI_ActiveChildrenInfo* handle); -/** - * @brief Create linear progress indicator style information. - * - * @return Returns a ProgressLinearStyleOption instance. - *
If the result returns nullptr, there may be out of memory. - * @since 15 - */ -ArkUI_ProgressLinearStyleOption* OH_ArkUI_ProgressLinearStyleOption_Create(void); - -/** - * @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 a cross-language option instance. * @@ -4185,80 +3341,6 @@ void OH_ArkUI_PixelRoundPolicy_SetEnd(ArkUI_PixelRoundPolicy* policy, ArkUI_Pixe */ int32_t OH_ArkUI_PixelRoundPolicy_GetEnd(ArkUI_PixelRoundPolicy* policy, ArkUI_PixelRoundCalcPolicy* value); -/** - * @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 Defines the text menu item for edit menu item. - * - * @since 22 - */ -typedef struct ArkUI_TextMenuItem ArkUI_TextMenuItem; -/** - * @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 Set text menu item title. * @@ -4380,13 +3462,6 @@ ArkUI_ErrorCode OH_ArkUI_TextMenuItem_SetId(ArkUI_TextMenuItem* item, int32_t id */ ArkUI_ErrorCode OH_ArkUI_TextMenuItem_GetId(const ArkUI_TextMenuItem* item, int32_t* id); -/** - * @brief Defines text menu item array. - * - * @since 22 - */ -typedef struct ArkUI_TextMenuItemArray ArkUI_TextMenuItemArray; - /** * @brief Get the size of text menu items. * @@ -4450,184 +3525,6 @@ ArkUI_ErrorCode OH_ArkUI_TextMenuItemArray_Erase(ArkUI_TextMenuItemArray* items, */ ArkUI_ErrorCode OH_ArkUI_TextMenuItemArray_Clear(ArkUI_TextMenuItemArray* items); -/** - * @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; -/** - * @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); - -/** - * 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 Set the event to be called when text menu create. * @@ -4669,229 +3566,6 @@ ArkUI_ErrorCode OH_ArkUI_TextEditMenuOptions_RegisterOnPrepareMenuCallback( ArkUI_ErrorCode OH_ArkUI_TextEditMenuOptions_RegisterOnMenuItemClickCallback( ArkUI_TextEditMenuOptions* editMenuOptions, void* userData, ArkUI_TextMenuItemClickCallback cb); -/** - * @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 Defines the configuration of text entity recognition. - * - * @since 24 - */ -typedef struct OH_ArkUI_TextDataDetectorConfig OH_ArkUI_TextDataDetectorConfig; - -/** - * @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 Enumerates line break policies. - * - * @since 24 - */ -typedef enum { - /** - * Greedy mode.
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.
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.
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 Enumerates raw input event types. * @@ -4912,22 +3586,6 @@ typedef enum { ARKUI_RAW_INPUT_EVENT_TYPE_MOUSE = 1, } ArkUI_RawInputEventType; -/** - * @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 Sets the recognition types of a configuration object for selected text recognition. * @@ -5073,254 +3731,6 @@ void OH_ArkUI_SelectionOptions_SetMenuPolicy( */ ArkUI_MenuPolicy OH_ArkUI_SelectionOptions_GetMenuPolicy(ArkUI_SelectionOptions* options); -/** - * @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 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 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 Create a configuration object for selected drag preview style. * @return A pointer to the configuration object. @@ -5353,23 +3763,6 @@ void OH_ArkUI_SelectedDragPreviewStyle_SetColor( uint32_t OH_ArkUI_SelectedDragPreviewStyle_GetColor( ArkUI_SelectedDragPreviewStyle* config); -/** - * @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); - /** * @brief Sets the decoration type of the decorative line style. * @@ -5472,23 +3865,6 @@ ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_SetThicknessScale( ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_GetThicknessScale(OH_ArkUI_DecorationStyleOptions* options, float* thicknessScale); -/** - * @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 Sets the types of the text entity recognition configuration. * @@ -5617,27 +3993,6 @@ ArkUI_ErrorCode OH_ArkUI_TextDataDetectorConfig_SetEnablePreviewMenu( ArkUI_ErrorCode OH_ArkUI_TextDataDetectorConfig_GetEnablePreviewMenu( OH_ArkUI_TextDataDetectorConfig* config, bool* enablePreviewMenu); -/** - * @brief Defines controller for text. - * @since 26.0.0 - */ -typedef struct OH_ArkUI_TextController OH_ArkUI_TextController; - -/** - * @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 Text controller. - * @since 26.0.0 - */ -void OH_ArkUI_TextController_Destroy(OH_ArkUI_TextController* controller); - /** * @brief Set the StyledString of the text. * @@ -5651,23 +4006,6 @@ void OH_ArkUI_TextController_Destroy(OH_ArkUI_TextController* controller); ArkUI_ErrorCode OH_ArkUI_TextController_SetStyledString( OH_ArkUI_TextController* controller, ArkUI_StyledString_Descriptor* descriptor); -/** - * @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 Sets the text for the placeholder text options used when there is no input. * @@ -5835,23 +4173,6 @@ ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_SetFontColor( ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_GetFontColor(OH_ArkUI_TextEditorPlaceholderOptions* options, uint32_t* fontColor); -/** - * @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 Sets the caret offset using the styled string controller. * @@ -5964,23 +4285,6 @@ ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_GetCaretRect( ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_DeleteBackward( 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 Sets the text alignment mode in the paragraph style. * @@ -6232,23 +4536,6 @@ ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetTextDirection(OH_ArkUI_Text ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_SetTypingParagraphStyle( OH_ArkUI_TextEditorStyledStringController* controller, 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 Sets the font color of the text style. * @@ -6625,23 +4912,6 @@ ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_SetTypingStyle( ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_GetTypingStyle( OH_ArkUI_TextEditorStyledStringController* controller, 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); - /** * @brief Sets the span type of the text selection menu in the text editor. * @@ -6955,119 +5225,6 @@ ArkUI_ErrorCode OH_ArkUI_PickerIndicatorStyle_ConfigureBackground(ArkUI_PickerIn ArkUI_ErrorCode OH_ArkUI_PickerIndicatorStyle_ConfigureDivider(ArkUI_PickerIndicatorStyle* style, ArkUI_PickerIndicatorDivider* divider); -/** - * @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 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); - /** * @brief Enumerates the tree operating status for the cross-language option. * diff --git a/arkui/ace_engine/native/node_attributes/custom_span.h b/arkui/ace_engine/native/node_attributes/custom_span.h new file mode 100644 index 000000000..f3ca32d36 --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/custom_span.h @@ -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 + +#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, 0.0f is returned. + *
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 CustomSpanMetrics 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. + *
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 CustomSpanMetrics 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. + *
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, 0.0f is returned. + *
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, 0.0f is returned. + *
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, 0.0f is returned. + *
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, 0.0f is returned. + *
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 CustomSpanMeasureInfo instance. + *
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 CustomSpanMetrics instance. + *
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 CustomSpanDrawInfo instance. + *
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 +/** @} */ diff --git a/arkui/ace_engine/native/node_attributes/image_span.h b/arkui/ace_engine/native/node_attributes/image_span.h new file mode 100644 index 000000000..49f0aea13 --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/image_span.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 + +#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 +/** @} */ diff --git a/arkui/ace_engine/native/node_attributes/progress.h b/arkui/ace_engine/native/node_attributes/progress.h new file mode 100644 index 000000000..0e7ab0f93 --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/progress.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 +#include + +#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 ProgressLinearStyleOption instance. + *
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 +/** @} */ diff --git a/arkui/ace_engine/native/node_attributes/rich_editor.h b/arkui/ace_engine/native/node_attributes/rich_editor.h new file mode 100644 index 000000000..b461bf9a7 --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/rich_editor.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 +#include +#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 +/** @} */ diff --git a/arkui/ace_engine/native/node_attributes/text.h b/arkui/ace_engine/native/node_attributes/text.h new file mode 100644 index 000000000..92e6c2ff8 --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/text.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 +#include +#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 maxLines settings. */ + ARKUI_TEXT_HEIGHT_ADAPTIVE_POLICY_MAX_LINES_FIRST = 0, + /** Prioritize the minFontSize 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 Text 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 +/** @} */ diff --git a/arkui/ace_engine/native/node_attributes/text_area.h b/arkui/ace_engine/native/node_attributes/text_area.h new file mode 100644 index 000000000..8219e0fd6 --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/text_area.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 + +#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 +/** @} */ diff --git a/arkui/ace_engine/native/node_attributes/text_common.h b/arkui/ace_engine/native/node_attributes/text_common.h new file mode 100644 index 000000000..a876399e8 --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/text_common.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 +#include + +#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 + * NORMAL. */ + ARKUI_WORD_BREAK_BREAK_ALL, + /** This option has the same effect as BREAK_ALL 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 NORMAL. */ + 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 NORMAL. + * @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.
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.
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.
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 +/** @} */ diff --git a/arkui/ace_engine/native/node_attributes/text_input.h b/arkui/ace_engine/native/node_attributes/text_input.h new file mode 100644 index 000000000..58a348c3d --- /dev/null +++ b/arkui/ace_engine/native/node_attributes/text_input.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 + +#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 +/** @} */ diff --git a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json index e12f5ceee..f12655137 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json +++ b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json @@ -40,6 +40,14 @@ { "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_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_types/native_type_common.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开发框架" }, From b93fe623dbd1a9ce8e7988e38d9090e34a7f4f47 Mon Sep 17 00:00:00 2001 From: l00916518 Date: Fri, 12 Jun 2026 15:35:21 +0800 Subject: [PATCH 29/44] =?UTF-8?q?api=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: l00916518 Co-Authored-By:Agent 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] --- arkui/ace_engine/native/BUILD.gn | 2 +- arkui/ace_engine/native/native_node.h | 4 ++-- .../{node_attr_custom.h => custom_attributes.h} | 2 +- .../coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) rename arkui/ace_engine/native/node_attributes/{node_attr_custom.h => custom_attributes.h} (98%) diff --git a/arkui/ace_engine/native/BUILD.gn b/arkui/ace_engine/native/BUILD.gn index d8619fa3e..00f13e16b 100644 --- a/arkui/ace_engine/native/BUILD.gn +++ b/arkui/ace_engine/native/BUILD.gn @@ -73,7 +73,7 @@ if (!is_arkui_x) { "arkui/node_attributes/navigation_router/navigation_router.h", "arkui/node_attributes/image.h", "arkui/node_attributes/image_animator.h", - "arkui/node_attributes/node_attr_custom.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", diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 550635be7..1ab848ba1 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -40,6 +40,8 @@ #include "native_type.h" #include "ui_input_event.h" +#include "node_attributes/custom_attributes.h" + #ifdef __cplusplus #include #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. * diff --git a/arkui/ace_engine/native/node_attributes/node_attr_custom.h b/arkui/ace_engine/native/node_attributes/custom_attributes.h similarity index 98% rename from arkui/ace_engine/native/node_attributes/node_attr_custom.h rename to arkui/ace_engine/native/node_attributes/custom_attributes.h index 105aa5693..d962f2770 100644 --- a/arkui/ace_engine/native/node_attributes/node_attr_custom.h +++ b/arkui/ace_engine/native/node_attributes/custom_attributes.h @@ -23,7 +23,7 @@ */ /** - * @file node_attr_custom.h + * @file custom_attributes.h * * @brief Provides custom node event definitions for NativeNode APIs. * diff --git a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json index e12f5ceee..3c86c5133 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json +++ b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json @@ -35,7 +35,7 @@ { "filePath": "arkui/ace_engine/native/node_attributes/navigation_router/navigation_router.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/node_attr_custom.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开发框架" }, From 62b341b248445418e24834bff69509d61ab50f24 Mon Sep 17 00:00:00 2001 From: yangxiaoyu5 Date: Fri, 12 Jun 2026 16:46:22 +0800 Subject: [PATCH 30/44] add vidoebase to gn Signed-off-by: yangxiaoyu5 --- multimedia/av_codec/codec_base/BUILD.gn | 2 ++ 1 file changed, 2 insertions(+) diff --git a/multimedia/av_codec/codec_base/BUILD.gn b/multimedia/av_codec/codec_base/BUILD.gn index 30ff2ef20..6cf5a0960 100644 --- a/multimedia/av_codec/codec_base/BUILD.gn +++ b/multimedia/av_codec/codec_base/BUILD.gn @@ -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", ] From d2c65b7d4c2cc04cc8a454f2976234cb818f8b7a Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 09:58:08 +0800 Subject: [PATCH 31/44] visual MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: opencode (qwen3.6-plus) Change-Id: I5202d6ba79ffdaed6f6e6a90a4753b51bd8a790a --- arkui/ace_engine/native/native_type_visual.h | 114 ++++++++++++++----- 1 file changed, 83 insertions(+), 31 deletions(-) diff --git a/arkui/ace_engine/native/native_type_visual.h b/arkui/ace_engine/native/native_type_visual.h index 210ba6dcb..a4d249c0f 100644 --- a/arkui/ace_engine/native/native_type_visual.h +++ b/arkui/ace_engine/native/native_type_visual.h @@ -45,41 +45,57 @@ extern "C" { /** - * @brief Defines the matrix4 object. + * @brief Defines a fourth-order matrix object. * * @since 24 */ typedef struct ArkUI_Matrix4 ArkUI_Matrix4; /** - * @brief Enumerates the shadow types. + * @brief Enumerates shadow types. * * @since 12 */ typedef enum { - /** Color. */ + /** + * Color shadow. + */ ARKUI_SHADOW_TYPE_COLOR = 0, - /** Blur. */ + /** + * Blur shadow. + */ ARKUI_SHADOW_TYPE_BLUR } ArkUI_ShadowType; /** - * @brief Enumerates the shadow styles. + * @brief Enumerates shadow styles. * * @since 12 */ typedef enum { - /** Mini shadow. */ + /** + * Mini shadow.
!{@link defaultxs} + */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0, - /** Little shadow. */ + /** + * Small shadow.
!{@link defaultsm} + */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM, - /** Medium shadow. */ + /** + * Medium shadow.
!{@link defaultmd} + */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD, - /** Large shadow. */ + /** + * Large shadow.
!{@link defaultlg} + */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG, - /** Floating small shadow. */ + /** + * Floating small shadow.
!{@link floatingsm} + */ ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM, - /** Floating medium shadow. */ + /** + * Floating medium shadow.
!{@link floatingmd} + */ ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD, } ArkUI_ShadowStyle; @@ -89,49 +105,85 @@ typedef enum { * @since 12 */ typedef enum { - /** The animation speed keeps unchanged. */ + /** + * The animation speed keeps unchanged. + */ ARKUI_CURVE_LINEAR = 0, - /** The animation starts slowly, accelerates, and then slows down towards the end. */ + /** + * The animation starts slowly, accelerates, and then slows down towards the end. + */ ARKUI_CURVE_EASE, - /** The animation starts at a low speed and then picks up speed until the end. */ + /** + * The animation starts at a low speed and then picks up speed until the end. + */ ARKUI_CURVE_EASE_IN, - /** The animation ends at a low speed. */ + /** + * The animation ends at a low speed. + */ ARKUI_CURVE_EASE_OUT, - /** The animation starts and ends at a low speed. */ + /** + * The animation starts and ends at a low speed, providing a smooth and natural transition. + */ ARKUI_CURVE_EASE_IN_OUT, - /** The animation uses the standard curve */ + /** + * The animation uses the standard curve + */ ARKUI_CURVE_FAST_OUT_SLOW_IN, - /** The animation uses the deceleration curve. */ + /** + * The animation uses the deceleration curve. + */ ARKUI_CURVE_LINEAR_OUT_SLOW_IN, - /** The animation uses the acceleration curve. */ + /** + * The animation uses the acceleration curve. + */ ARKUI_CURVE_FAST_OUT_LINEAR_IN, - /** The animation uses the extreme deceleration curve. */ + /** + * The animation uses the extreme deceleration curve. + */ ARKUI_CURVE_EXTREME_DECELERATION, - /** The animation uses the sharp curve. */ + /** + * The animation uses the sharp curve. + */ ARKUI_CURVE_SHARP, - /** The animation uses the rhythm curve. */ + /** + * The animation uses the rhythm curve. + */ ARKUI_CURVE_RHYTHM, - /** The animation uses the smooth curve. */ + /** + * The animation uses the smooth curve. + */ ARKUI_CURVE_SMOOTH, - /** The animation uses the friction curve */ + /** + * The animation uses the friction curve + */ ARKUI_CURVE_FRICTION, } ArkUI_AnimationCurve; /** - * @brief Enumerates the animation playback modes. + * @brief Enumerates the animation playback directions. * * @since 12 */ typedef enum { - /** The animation is played forwards. */ + /** + * The animation is played forwards. + */ ARKUI_ANIMATION_PLAY_MODE_NORMAL = 0, - /** The animation is played reversely. */ + /** + * The animation is played backwards. + */ ARKUI_ANIMATION_PLAY_MODE_REVERSE, - /** The animation is played normally for an odd number of times (1, 3, 5...) and reversely for an even number - * of times (2, 4, 6...). */ + /** + * The animation plays in alternating loop mode. When the animation is played for an odd number of times, the + * playback is in forward direction. When the animation is played for an even number of times, the playback is in + * reverse direction. + */ ARKUI_ANIMATION_PLAY_MODE_ALTERNATE, - /** The animation is played reversely for an odd number of times (1, 3, 5...) and normally for an even number - * of times (2, 4, 6...). */ + /** + * The animation plays in reverse alternating loop mode. When the animation is played for an odd number of times, + * the playback is in reverse direction. When the animation is played for an even number of times, the playback is + * in forward direction. + */ ARKUI_ANIMATION_PLAY_MODE_ALTERNATE_REVERSE, } ArkUI_AnimationPlayMode; From bafa2b86d75a782d83460c836563a27fab68e32f Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 10:37:49 +0800 Subject: [PATCH 32/44] fix Signed-off-by: wangmiaoliang Change-Id: If6aa1b1e85fff5369bc49e2d3a068c49eff3c151 --- .../ace_engine/native/native_type_visual.h | 1702 +++++++++++++++++ 1 file changed, 1702 insertions(+) create mode 100644 zh-cn/arkui/ace_engine/native/native_type_visual.h diff --git a/zh-cn/arkui/ace_engine/native/native_type_visual.h b/zh-cn/arkui/ace_engine/native/native_type_visual.h new file mode 100644 index 000000000..b51614280 --- /dev/null +++ b/zh-cn/arkui/ace_engine/native/native_type_visual.h @@ -0,0 +1,1702 @@ +/* + * 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 visual effect capabilities of ArkUI on the native side. + * + * @since 12 + */ + +/** + * @file native_type_visual.h + * + * @brief Defines the visual effect types for the native module. + * + * @library libace_ndk.z.so + * @syscap SystemCapability.ArkUI.ArkUI.Full + * @kit ArkUI + * @since 12 + */ + +#ifndef ARKUI_NATIVE_TYPE_VISUAL_H +#define ARKUI_NATIVE_TYPE_VISUAL_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @brief 定义四阶矩阵对象。 + * + * @since 24 + */ +typedef struct ArkUI_Matrix4 ArkUI_Matrix4; + +/** + * @brief 定义阴影类型枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 彩色阴影。 + */ + ARKUI_SHADOW_TYPE_COLOR = 0, + /** + * 模糊阴影。 + */ + ARKUI_SHADOW_TYPE_BLUR +} ArkUI_ShadowType; + +/** + * @brief 阴影效果枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 超小阴影。 + * !{@link defaultxs} + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0, + /** + * 小阴影。 + * !{@link defaultsm} + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM, + /** + * 中阴影。 + * !{@link defaultmd} + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD, + /** + * 大阴影。 + * !{@link defaultlg} + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG, + /** + * 浮动小阴影。 + * !{@link floatingsm} + */ + ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM, + /** + * 浮动中阴影。 + * !{@link floatingmd} + */ + ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD, +} ArkUI_ShadowStyle; + +/** + * @brief 动画曲线枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 动画从头到尾的速度都是相同。 + */ + ARKUI_CURVE_LINEAR = 0, + /** + * 动画以低速开始,然后加快,在结束前变慢。 + */ + ARKUI_CURVE_EASE, + /** + * 动画以低速开始。 + */ + ARKUI_CURVE_EASE_IN, + /** + * 动画以低速结束。 + */ + ARKUI_CURVE_EASE_OUT, + /** + * 动画以低速开始和结束,提供平滑自然的动画过渡效果。 + */ + ARKUI_CURVE_EASE_IN_OUT, + /** + * 动画标准曲线。 + */ + ARKUI_CURVE_FAST_OUT_SLOW_IN, + /** + * 动画减速曲线。 + */ + ARKUI_CURVE_LINEAR_OUT_SLOW_IN, + /** + * 动画加速曲线。 + */ + ARKUI_CURVE_FAST_OUT_LINEAR_IN, + /** + * 动画急缓曲线。 + */ + ARKUI_CURVE_EXTREME_DECELERATION, + /** + * 动画锐利曲线。 + */ + ARKUI_CURVE_SHARP, + /** + * 动画节奏曲线。 + */ + ARKUI_CURVE_RHYTHM, + /** + * 动画平滑曲线。 + */ + ARKUI_CURVE_SMOOTH, + /** + * 动画阻尼曲线。 + */ + ARKUI_CURVE_FRICTION, +} ArkUI_AnimationCurve; + +/** + * @brief 定义动画播放模式。 + * + * @since 12 + */ +typedef enum { + /** + * 动画正向播放。 + */ + ARKUI_ANIMATION_PLAY_MODE_NORMAL = 0, + /** + * 动画反向播放。 + */ + ARKUI_ANIMATION_PLAY_MODE_REVERSE, + /** + * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 + */ + ARKUI_ANIMATION_PLAY_MODE_ALTERNATE, + /** + * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 + */ + ARKUI_ANIMATION_PLAY_MODE_ALTERNATE_REVERSE, +} ArkUI_AnimationPlayMode; + +/** + * @brief 定义背景模糊样式。 + * + * @since 12 + */ +typedef enum { + /** + * 轻薄材质模糊。 + * !{@link thin} + */ + ARKUI_BLUR_STYLE_THIN = 0, + /** + * 普通厚度材质模糊。 + * !{@link regular} + */ + ARKUI_BLUR_STYLE_REGULAR, + /** + * 厚材质模糊。 + * !{@link thick} + */ + ARKUI_BLUR_STYLE_THICK, + /** + * 近距景深模糊。 + * !{@link backgroundthin} + */ + ARKUI_BLUR_STYLE_BACKGROUND_THIN, + /** + * 中距景深模糊。 + * !{@link backgroundregular} + */ + ARKUI_BLUR_STYLE_BACKGROUND_REGULAR, + /** + * 远距景深模糊。 + * !{@link backgroundthick} + */ + ARKUI_BLUR_STYLE_BACKGROUND_THICK, + /** + * 超远距景深模糊。 + * !{@link backgroundultrathick} + */ + ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK, + /** + * 关闭模糊。 + * !{@link none} + */ + ARKUI_BLUR_STYLE_NONE, + /** + * 组件超轻薄材质模糊。 + * !{@link componentultrathin} + */ + ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN, + /** + * 组件轻薄材质模糊。 + * !{@link componentthin} + */ + ARKUI_BLUR_STYLE_COMPONENT_THIN, + /** + * 组件普通材质模糊。 + * !{@link componentregular} + */ + ARKUI_BLUR_STYLE_COMPONENT_REGULAR, + /** + * 组件厚材质模糊。 + * !{@link componentthick} + */ + ARKUI_BLUR_STYLE_COMPONENT_THICK, + /** + * 组件超厚材质模糊。 + * !{@link componentultrathick} + */ + ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK, +} ArkUI_BlurStyle; + +/** + * @brief 定义背景模糊激活策略。 + * + * @since 19 + */ +typedef enum { + /** + * 跟随窗口焦点状态变化,窗口非焦点状态不激活,窗口焦点状态激活。 + */ + ARKUI_BLUR_STYLE_ACTIVE_POLICY_FOLLOWS_WINDOW_ACTIVE_STATE = 0, + /** + * 始终激活。 + */ + ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_ACTIVE, + /** + * 始终不激活。 + */ + ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_INACTIVE, +} ArkUI_BlurStyleActivePolicy; + +/** + * @brief 混合模式枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 将上层图像直接覆盖到下层图像上,不进行任何混合操作。 + */ + ARKUI_BLEND_MODE_NONE = 0, + /** + * 将源像素覆盖的目标像素清除为完全透明。 + */ + ARKUI_BLEND_MODE_CLEAR, + /** + * r = s,只显示源像素。 + */ + ARKUI_BLEND_MODE_SRC, + /** + * r = d,只显示目标像素。 + */ + ARKUI_BLEND_MODE_DST, + /** + * r = s + (1 - sa) * d,将源像素按照透明度进行混合,覆盖在目标像素上。 + */ + ARKUI_BLEND_MODE_SRC_OVER, + /** + * r = d + (1 - da) * s,将目标像素按照透明度进行混合,覆盖在源像素上。 + */ + ARKUI_BLEND_MODE_DST_OVER, + /** + * r = s * da,只显示源像素中与目标像素重叠的部分。 + */ + ARKUI_BLEND_MODE_SRC_IN, + /** + * r = d * sa,只显示目标像素中与源像素重叠的部分。 + */ + ARKUI_BLEND_MODE_DST_IN, + /** + * r = s * (1 - da),只显示源像素中与目标像素不重叠的部分。 + */ + ARKUI_BLEND_MODE_SRC_OUT, + /** + * r = d * (1 - sa),只显示目标像素中与源像素不重叠的部分。 + */ + ARKUI_BLEND_MODE_DST_OUT, + /** + * r = s * da + d * (1 - sa),在源像素和目标像素重叠的地方绘制源像素,在源像素和目标像素不重叠的地方绘制目标像素。 + */ + ARKUI_BLEND_MODE_SRC_ATOP, + /** + * r = d * sa + s * (1 - da),在源像素和目标像素重叠的地方绘制目标像素,在源像素和目标像素不重叠的地方绘制源像素。 + */ + ARKUI_BLEND_MODE_DST_ATOP, + /** + * r = s * (1 - da) + d * (1 - sa),只显示源像素与目标像素不重叠的部分。 + */ + ARKUI_BLEND_MODE_XOR, + /** + * r = min(s + d, 1),将源像素值与目标像素值相加,并将结果作为新的像素值。 + */ + ARKUI_BLEND_MODE_PLUS, + /** + * r = s * d,将源像素与目标像素进行乘法运算,并将结果作为新的像素值。 + */ + ARKUI_BLEND_MODE_MODULATE, + /** + * r = s + d - s * d,将两个图像的像素值相加,然后减去它们的乘积来实现混合。 + */ + ARKUI_BLEND_MODE_SCREEN, + /** + * 根据目标像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 + */ + ARKUI_BLEND_MODE_OVERLAY, + /** + * rc = s + d - max(s * da, d * sa), ra = kSrcOver,当两个颜色重叠时,较暗的颜色会覆盖较亮的颜色。 + */ + ARKUI_BLEND_MODE_DARKEN, + /** + * rc = s + d - min(s * da, d * sa), ra = kSrcOver,将源图像和目标图像中的像素进行比较,选取两者中较亮的像素作为最终的混合结果。 + */ + ARKUI_BLEND_MODE_LIGHTEN, + /** + * 使目标像素变得更亮来反映源像素。 + */ + ARKUI_BLEND_MODE_COLOR_DODGE, + /** + * 使目标像素变得更暗来反映源像素。 + */ + ARKUI_BLEND_MODE_COLOR_BURN, + /** + * 根据源像素的值来决定目标像素变得更亮或者更暗。根据源像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 + */ + ARKUI_BLEND_MODE_HARD_LIGHT, + /** + * 根据源像素来决定使用LIGHTEN混合模式还是DARKEN混合模式。 + */ + ARKUI_BLEND_MODE_SOFT_LIGHT, + /** + * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生高对比度的效果。 + */ + ARKUI_BLEND_MODE_DIFFERENCE, + /** + * rc = s + d - two(s * d), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生柔和的效果。 + */ + ARKUI_BLEND_MODE_EXCLUSION, + /** + * r = s * (1 - da) + d * (1 - sa) + s * d,将源图像与目标图像进行乘法混合,得到一张新的图像。 + */ + ARKUI_BLEND_MODE_MULTIPLY, + /** + * 保留源图像的亮度和饱和度,但会使用目标图像的色调来替换源图像的色调。 + */ + ARKUI_BLEND_MODE_HUE, + /** + * 保留目标像素的亮度和色调,但会使用源像素的饱和度来替换目标像素的饱和度。 + */ + ARKUI_BLEND_MODE_SATURATION, + /** + * 保留源像素的饱和度和色调,但会使用目标像素的亮度来替换源像素的亮度。 + */ + ARKUI_BLEND_MODE_COLOR, + /** + * 保留目标像素的色调和饱和度,但会用源像素的亮度替换目标像素的亮度。 + */ + ARKUI_BLEND_MODE_LUMINOSITY, +} ArkUI_BlendMode; + +/** + * @brief 前景和阴影颜色的枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 前景色为控件背景色的反色。 + */ + ARKUI_COLOR_STRATEGY_INVERT = 0, + /** + * 控件背景阴影色为控件背景阴影区域的平均色。 + */ + ARKUI_COLOR_STRATEGY_AVERAGE, + /** + * 控件背景阴影色为控件背景阴影区域的主色。 + */ + ARKUI_COLOR_STRATEGY_PRIMARY, +} ArkUI_ColorStrategy; + +/** + * @brief 遮罩类型枚举。遮罩是一种用于限制组件显示区域的手段,它利用特定的形状对组件内容进行裁剪,从而实现只有遮罩区域内的内容才可见的效果。 + * + * @since 12 + */ +typedef enum { + /** + * 矩形类型。 + */ + ARKUI_MASK_TYPE_RECTANGLE = 0, + /** + * 圆形。 + */ + ARKUI_MASK_TYPE_CIRCLE, + /** + * 椭圆形类型。 + */ + ARKUI_MASK_TYPE_ELLIPSE, + /** + * 路径类型。 + */ + ARKUI_MASK_TYPE_PATH, + /** + * 进度类型。 + */ + ARKUI_MASK_TYPE_PROGRESS, +} ArkUI_MaskType; + +/** + * @brief 裁剪类型枚举。 + * + * @since 12 + */ +typedef enum { + /** + * 矩形类型。 + */ + ARKUI_CLIP_TYPE_RECTANGLE = 0, + /** + * 圆形。 + */ + ARKUI_CLIP_TYPE_CIRCLE, + /** + * 椭圆形类型。 + */ + ARKUI_CLIP_TYPE_ELLIPSE, + /** + * 路径类型。 + */ + ARKUI_CLIP_TYPE_PATH, +} ArkUI_ClipType; + +/** + * @brief 自定义形状。 + * + * @since 12 + */ +typedef enum { + /** + * 矩形类型。 + */ + ARKUI_SHAPE_TYPE_RECTANGLE = 0, + /** + * 圆形。 + */ + ARKUI_SHAPE_TYPE_CIRCLE, + /** + * 椭圆形类型。 + */ + ARKUI_SHAPE_TYPE_ELLIPSE, + /** + * 路径类型。 + */ + ARKUI_SHAPE_TYPE_PATH, +} ArkUI_ShapeType; + +/** + * @brief 定义渐变方向结构。 + * + * @since 12 + */ +typedef enum { + /** + * 向左渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT = 0, + /** + * 向上渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_TOP, + /** + * 向右渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT, + /** + * 向下渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_BOTTOM, + /** + * 向左上渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_TOP, + /** + * 向左下渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_BOTTOM, + /** + * 向右上渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_TOP, + /** + * 向右下渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_BOTTOM, + /** + * 不渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_NONE, + /** + * 自定义渐变方向. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, +} ArkUI_LinearGradientDirection; + +/** + * @brief 定义转场从边缘滑入和滑出的效果。 + * + * @since 12 + */ +typedef enum { + /** + * 转场从窗口的上边缘滑入和滑出。 + */ + ARKUI_TRANSITION_EDGE_TOP = 0, + /** + * 转场从窗口的下边缘滑入和滑出。 + */ + ARKUI_TRANSITION_EDGE_BOTTOM, + /** + * 转场从窗口的左边缘滑入和滑出。 + */ + ARKUI_TRANSITION_EDGE_START, + /** + * 转场从窗口的右边缘滑入和滑出。 + */ + ARKUI_TRANSITION_EDGE_END, +} ArkUI_TransitionEdge; + +/** + * @brief 指定的混合模式应用于视图的内容选项. + * + * @since 12 + */ +typedef enum { + /** + * 在目标图像上按顺序混合视图的内容. + */ + BLEND_APPLY_TYPE_FAST = 0, + /** + * 将此组件和子组件内容绘制到离屏画布上,然后整体进行混合. + */ + BLEND_APPLY_TYPE_OFFSCREEN, +} ArkUI_BlendApplyType; + +/** + * @brief 在动画中定义{@link OH_ArkUI_AnimatorOption_RegisterOnFinishCallback}回调的类型。 + * + * @since 12 + */ +typedef enum { + /** + * 当整个动画结束并立即删除时,将触发回调。 + */ + ARKUI_FINISH_CALLBACK_REMOVED = 0, + /** + * 当动画在逻辑上处于下降状态,但可能仍处于其长尾状态时,将触发回调。长尾状态是指动画即将完全停止前的残余变化过程,此时动画的数值变化已非常微小,接近目标值。 + */ + ARKUI_FINISH_CALLBACK_LOGICALLY, +} ArkUI_FinishCallbackType; + +/** + * @brief 定义动画终态内容大小与位置的枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 保持动画终态的内容大小,并且内容始终与组件保持中心对齐。 + */ + ARKUI_RENDER_FIT_CENTER = 0, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持顶部中心对齐。 + */ + ARKUI_RENDER_FIT_TOP, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持底部中心对齐。 + */ + ARKUI_RENDER_FIT_BOTTOM, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持左侧对齐。 + */ + ARKUI_RENDER_FIT_LEFT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持右侧对齐。 + */ + ARKUI_RENDER_FIT_RIGHT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持左上角对齐。 + */ + ARKUI_RENDER_FIT_TOP_LEFT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持右上角对齐。 + */ + ARKUI_RENDER_FIT_TOP_RIGHT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持左下角对齐。 + */ + ARKUI_RENDER_FIT_BOTTOM_LEFT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持右下角对齐。 + */ + ARKUI_RENDER_FIT_BOTTOM_RIGHT, + /** + * 不考虑动画终态内容的宽高比,并且内容始终缩放到组件的大小。 + */ + ARKUI_RENDER_FIT_RESIZE_FILL, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内,且与组件保持中心对齐。 + */ + ARKUI_RENDER_FIT_RESIZE_CONTAIN, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持左侧对齐,当组件高方向有剩余时,内容与组件保持顶部对齐。 + */ + ARKUI_RENDER_FIT_RESIZE_CONTAIN_TOP_LEFT, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持右侧对齐,当组件高方向有剩余时,内容与组件保持底部对齐。 + */ + ARKUI_RENDER_FIT_RESIZE_CONTAIN_BOTTOM_RIGHT, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容两边都大于或等于组件两边,且与组件保持中心对齐,显示内容的中间部分。 + */ + ARKUI_RENDER_FIT_RESIZE_COVER, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持左侧对齐,显示内容的左侧部分。当内容高方向有剩余时,内容与组件保持顶部对齐,显示内容的顶侧部分。 + */ + ARKUI_RENDER_FIT_RESIZE_COVER_TOP_LEFT, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持右侧对齐,显示内容的右侧部分。当内容高方向有剩余时,内容与组件保持底部对齐,显示内容的底侧部分。 + */ + ARKUI_RENDER_FIT_RESIZE_COVER_BOTTOM_RIGHT +} ArkUI_RenderFit; + +/** + * @brief 定义帧动画组件在动画开始前和结束后的状态。 + * + * @since 12 +*/ +typedef enum { + /** + * 动画未执行时不会将任何样式应用于目标,动画播放完成之后恢复初始默认状态。 + */ + ARKUI_ANIMATION_FILL_MODE_NONE, + /** + * 目标将保留动画执行期间最后一个关键帧的状态。 + */ + ARKUI_ANIMATION_FILL_MODE_FORWARDS, + /** + * 动画将在应用于目标时立即应用第一个关键帧中定义的值,并在{@link delay}期间保留此值。 + */ + ARKUI_ANIMATION_FILL_MODE_BACKWARDS, + /** + * 动画将遵循{@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}和{@link ARKUI_ANIMATION_FILL_MODE_BACKWARDS}的规则,从而在两个方向上扩展动画属性。 + */ + ARKUI_ANIMATION_FILL_MODE_BOTH, +} ArkUI_AnimationFillMode; + +/** + * @brief 定义动画播放模式。 + * + * @since 12 + */ +typedef enum { + /** + * 动画正向循环播放。 + */ + ARKUI_ANIMATION_DIRECTION_NORMAL = 0, + /** + * 动画反向循环播放。 + */ + ARKUI_ANIMATION_DIRECTION_REVERSE, + /** + * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 + */ + ARKUI_ANIMATION_DIRECTION_ALTERNATE, + /** + * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 + */ + ARKUI_ANIMATION_DIRECTION_ALTERNATE_REVERSE, +} ArkUI_AnimationDirection; + +/** + * @brief 定义组件转场时的平移效果对象。 + * + * @since 12 + */ +typedef struct { + /** + * 横向的平移距离,单位为vp。 + */ + float x; + /** + * 纵向的平移距离,单位为vp。 + */ + float y; + /** + * 深度方向的平移距离,单位为vp。 + */ + float z; +} ArkUI_TranslationOptions; + +/** + * @brief 定义组件转场时的缩放效果对象。 + * + * @since 12 + */ +typedef struct { + /** + * x轴的缩放倍数。x>1时以x轴方向放大,01时以y轴方向放大,0新建的{@link ArkUI_MotionPathOptions}对象中,路径动画的运动路径path值为空字符串,路径动画起点进度from值为0,路径动画终点进度to值为1, + * 组件是否沿路径旋转rotatable值为false。 + * @since 23 + */ +ArkUI_MotionPathOptions* OH_ArkUI_MotionPathOptions_Create(); + +/** + * @brief 销毁路径动画的运动路径配置项。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @since 23 + */ +void OH_ArkUI_MotionPathOptions_Dispose(ArkUI_MotionPathOptions* options); + +/** + * @brief 设置路径动画的运动路径。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param svgPath 路径动画的运动路径字符串。 + *
该路径支持使用"start"和"end"作为起点和终点的占位符,例如:"Mstart.x start.y L50 50 Lend.x end.y Z"。路径字符串格式请参考{@link 绘制路径}。若设置为空字符串, + * 等效于未设置路径动画。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* options, const char* svgPath); + +/** + * @brief 获取路径动画的运动路径配置项中存储的运动路径字符串。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param svgPathBuffer 存储运动路径字符串的缓冲区指针。 + * @param bufferSize svgPathBuffer参数的缓冲区大小。 + * @param writeLength 返回{@link ARKUI_ERROR_CODE_NO_ERROR}时,表示实际写入缓冲区的字符串长度。 + *
返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}时,表示如果为入参异常,writeLength不会被赋值,如果为拷贝异常,writeLength为可容纳目标字符串的最小缓冲区大小。 + *
返回{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR}时,表示可容纳目标字符串的最小缓冲区大小。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + *
{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} 缓冲区大小不足。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions* options, char* svgPathBuffer, + const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief 设置路径动画起点进度。进度指已移动路径长度与总路径长度的比值。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param from 路径动画的起点进度,取值范围为[0.0, 1.0],且需满足from小于或等于终点进度to,否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 + *
to的含义参考{@link OH_ArkUI_MotionPathOptions_SetTo}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} from超出[0.0, 1.0]范围,或from大于终点进度to。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* options, const float from); + +/** + * @brief 获取路径动画的运动路径配置项中的路径动画起点进度。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param from 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中起点进度值的指针。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions* options, float* from); + +/** + * @brief 设置路径动画终点进度。进度指已移动路径长度与总路径长度的比值。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param to 路径动画的终点进度,取值范围为[0.0, 1.0],且需满足to大或等于起点进度from;否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 + *
from的含义参考{@link OH_ArkUI_MotionPathOptions_SetFrom}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} to超出[0.0, 1.0]范围,或to小于起点进度from。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* options, const float to); + +/** + * @brief 获取路径动画的运动路径配置项中的路径动画终点进度。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param to 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中终点进度值的指针。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* options, float* to); + +/** + * @brief 设置组件是否沿运动路径旋转。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param rotatable 组件是否沿路径旋转。true表示组件沿路径旋转;false表示组件不沿路径旋转。默认值:false。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* options, const bool rotatable); + +/** + * @brief 获取组件是否沿运动路径旋转。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param rotatable 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中rotatable参数值的指针,表示组件是否沿路径旋转。 + *
true表示组件沿路径旋转;false表示组件不沿路径旋转。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetRotatable(const ArkUI_MotionPathOptions* options, bool* rotatable); + +/** + * @brief Create a shadow options object. + * When the object is no longer in use, invoke {@link OH_ArkUI_ShadowOptions_Destroy} to destroy it. + * + * @return A pointer to the shadow options object. + * @since 24 + */ +OH_ArkUI_ShadowOptions* OH_ArkUI_ShadowOptions_Create(); + +/** + * @brief Destroys the shadow options object. + * + * @param options Pointer to the object to be destroyed. + * @since 24 + */ +void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); + +/** + * @brief 定义阴影选项对象。 + * + * @since 24 + */ +typedef struct OH_ArkUI_ShadowOptions OH_ArkUI_ShadowOptions; + +/** + * @brief 创建一个阴影选项对象。当该对象不再使用时,请调用{@link OH_ArkUI_ShadowOptions_Destroy}销毁。 + * + * @return 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @since 24 + */ +OH_ArkUI_ShadowOptions* OH_ArkUI_ShadowOptions_Create(); + +/** + * @brief 销毁阴影选项对象。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @since 24 + */ +void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); + +/** + * @brief 设置阴影选项的模糊半径。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param radius 阴影的模糊半径,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options, float radius); + +/** + * @brief 获取阴影选项的模糊半径。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param radius 阴影的模糊半径,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options, float* radius); + +/** + * @brief 设置阴影选项的阴影类型。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param type 阴影类型{@link ArkUI_ShadowType}。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType type); + +/** + * @brief 获取阴影选项的阴影类型。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param type 阴影类型{@link ArkUI_ShadowType}。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType* type); + +/** + * @brief 设置阴影选项的阴影颜色。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param color 阴影颜色,0xARGB格式。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, uint32_t color); + +/** + * @brief 获取阴影选项的阴影颜色。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param color 阴影颜色,0xARGB格式。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, uint32_t* color); + +/** + * @brief 设置阴影在x轴上的偏移量。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetX 阴影在x轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* options, float offsetX); + +/** + * @brief 获取阴影在x轴上的偏移量。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetX 阴影在x轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* options, float* offsetX); + +/** + * @brief 设置阴影在y轴上的偏移量。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetY 阴影在y轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* options, float offsetY); + +/** + * @brief 获取阴影在y轴上的偏移量。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetY 阴影在y轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* options, float* offsetY); + +/** + * @brief 设置是否用阴影填充组件内部。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。默认值为false。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, bool isFill); + +/** + * @brief 获取是否用阴影填充组件内部。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetFill(OH_ArkUI_ShadowOptions* options, bool* isFill); + +/** + * @brief 定义矩阵缩放的缩放对象。 + * + * @since 24 + */ +typedef struct ArkUI_Matrix4ScaleOptions ArkUI_Matrix4ScaleOptions; + +/** + * @brief 创建指向矩阵运算的缩放参数对象的指针。在新创建的对象中,x、y和z轴方向的缩放系数默认值,为1。变换中心点的x轴坐标centerX、变换中心点的y轴坐标centerY取默认值,为0。 + * + * @return 返回指向新创建的{@link ArkUI_Matrix4ScaleOptions}的指针。 + * @since 24 + */ +ArkUI_Matrix4ScaleOptions* OH_ArkUI_Matrix4ScaleOptions_Create(); + +/** + * @brief 销毁指向矩阵运算的缩放参数对象的指针。 + * + * @param options 指向要销毁的{@link ArkUI_Matrix4ScaleOptions}对象的指针。 + * @since 24 + */ +void OH_ArkUI_Matrix4ScaleOptions_Dispose(ArkUI_Matrix4ScaleOptions* options); + +/** + * @brief 设置矩阵运算的缩放参数对象x方向的缩放因子。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleX x方向的缩放因子。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetX(ArkUI_Matrix4ScaleOptions* options, const float scaleX); + +/** + * @brief 获取矩阵运算的缩放参数对象x方向的缩放因子。如果从未设置x的值,则x方向的缩放因子默认值为1。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleX x方向的缩放因子。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetX(const ArkUI_Matrix4ScaleOptions* options, float* scaleX); + +/** + * @brief 设置矩阵运算的缩放参数对象y方向的缩放因子。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleY y方向的缩放因子。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetY(ArkUI_Matrix4ScaleOptions* options, const float scaleY); + +/** + * @brief 获取矩阵运算的缩放参数对象y方向的缩放因子。如果从未设置y的值,则y方向的缩放因子默认值为1。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleY y方向的缩放因子。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetY(const ArkUI_Matrix4ScaleOptions* options, float* scaleY); + +/** + * @brief 设置矩阵运算的缩放参数对象z方向的缩放因子。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleZ z方向的缩放因子。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetZ(ArkUI_Matrix4ScaleOptions* options, const float scaleZ); + +/** + * @brief 获取矩阵运算的缩放参数对象z方向的缩放因子。如果从未设置z的值,则z方向的缩放因子默认值为1。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleZ z方向的缩放因子。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetZ(const ArkUI_Matrix4ScaleOptions* options, float* scaleZ); + +/** + * @brief 设置矩阵运算的缩放参数对象变换中心点的x轴坐标。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerX 变换中心点的x轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterX(ArkUI_Matrix4ScaleOptions* options, const float centerX); + +/** + * @brief 获取矩阵运算的缩放参数对象变换中心点的x轴坐标。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerX 变换中心点的x轴坐标。单位为px。默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterX(const ArkUI_Matrix4ScaleOptions* options, float* centerX); + +/** + * @brief 设置矩阵运算的缩放参数对象变换中心点的y轴坐标。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerY 变换中心点的y轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterY(ArkUI_Matrix4ScaleOptions* options, const float centerY); + +/** + * @brief 获取矩阵运算的缩放参数对象变换中心点的y轴坐标。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerY 变换中心点的y轴坐标。单位为px。默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterY(const ArkUI_Matrix4ScaleOptions* options, float* centerY); + +/** + * @brief 定义矩阵旋转的旋转对象。 + * + * @since 24 + */ +typedef struct ArkUI_Matrix4RotationOptions ArkUI_Matrix4RotationOptions; + +/** + * @brief 创建矩阵运算的旋转参数对象的指针。在新创建的对象中,单次矩阵变换中心点相对于组件变换中心点的x轴偏移值centerX、单次矩阵变换中心点相对于组件变换中心点的y轴偏移值centerY、旋转角度angle的默认值,为0。 + * 如果未指定x、y、z方向的方向向量中的任何一个,则等同于x=0、y=0、z=1,表示绕z轴旋转。一旦指定了x、y、z方向的方向向量中的任意一个,其余未指定的值等同于0。 + * + * @return 返回指向新创建的{@link ArkUI_Matrix4RotationOptions}的指针 + * @since 24 + */ +ArkUI_Matrix4RotationOptions* OH_ArkUI_Matrix4RotationOptions_Create(); + +/** + * @brief 销毁指向矩阵运算的旋转参数对象的指针。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @since 24 + */ +void OH_ArkUI_Matrix4RotationOptions_Dispose(ArkUI_Matrix4RotationOptions* options); + +/** + * @brief 设置矩阵运算的旋转参数对象x方向的方向向量。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param x x轴方向的方向向量的值。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetX(ArkUI_Matrix4RotationOptions* options, const float x); + +/** + * @brief 获取矩阵运算的旋转参数对象x方向的方向向量。如果从未设置过x值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param x x轴方向的方向向量的值。如果从未设置x的值,其值将未定义。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetX(const ArkUI_Matrix4RotationOptions* options, float* x); + +/** + * @brief 设置矩阵运算的旋转参数对象y方向的方向向量。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param y y轴方向的方向向量的值。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetY(ArkUI_Matrix4RotationOptions* options, const float y); + +/** + * @brief 获取矩阵运算的旋转参数对象y方向的方向向量。如果从未设置过y值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param y y轴方向的方向向量的值。如果从未设置y的值,其值将未定义。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetY(const ArkUI_Matrix4RotationOptions* options, float* y); + +/** + * @brief 设置矩阵运算的旋转参数对象z方向的方向向量。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param z z轴方向的方向向量的值。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetZ(ArkUI_Matrix4RotationOptions* options, const float z); + +/** + * @brief 获取矩阵运算的旋转参数对象z方向的方向向量。如果从未设置过z值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param z z轴方向的方向向量的值。如果从未设置z的值,其值将未定义。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetZ(const ArkUI_Matrix4RotationOptions* options, float* z); + +/** + * @brief 设置矩阵运算的旋转参数对象中旋转角度的值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param angle 旋转角度的值。取值范围:(-∞, +∞)。单位为度。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetAngle(ArkUI_Matrix4RotationOptions* options, const float angle); + +/** + * @brief 获取矩阵运算的旋转参数对象中旋转角度的值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param angle 旋转角度的值。单位为度。如果从未设置angle的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetAngle(const ArkUI_Matrix4RotationOptions* options, float* angle); + +/** + * @brief 设置单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterX(ArkUI_Matrix4RotationOptions* options, const float centerX); + +/** + * @brief 获取单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。单位为px。如果从未设置centerX的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterX(const ArkUI_Matrix4RotationOptions* options, float* centerX); + +/** + * @brief 设置单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterY(ArkUI_Matrix4RotationOptions* options, const float centerY); + +/** + * @brief 获取单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。单位为px。如果从未设置centerY的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterY(const ArkUI_Matrix4RotationOptions* options, float* centerY); + +/** + * @brief 定义矩阵平移的平移对象。 + * + * @since 24 + */ +typedef struct ArkUI_Matrix4TranslationOptions ArkUI_Matrix4TranslationOptions; + +/** + * @brief 创建指向矩阵运算的平移对象的指针。在新创建的对象中,x轴的平移距离x、y轴的平移距离y和z轴的平移距离z的默认值为0。 + * + * @return 返回指向新创建的{@link ArkUI_Matrix4TranslationOptions}的指针。 + * @since 24 + */ +ArkUI_Matrix4TranslationOptions* OH_ArkUI_Matrix4TranslationOptions_Create(); + +/** + * @brief 销毁指向矩阵运算的平移对象的指针。 + * + * @param options 指向要销毁的{@link ArkUI_Matrix4TranslationOptions}对象的指针。 + * @since 24 + */ +void OH_ArkUI_Matrix4TranslationOptions_Dispose(ArkUI_Matrix4TranslationOptions* options); + +/** + * @brief 设置矩阵运算的平移对象x轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param x x轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置x的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetX(ArkUI_Matrix4TranslationOptions* options, const float x); + +/** + * @brief 获取矩阵运算的平移对象x轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param x x轴方向的平移值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4TranslationOptions* options, float* x); + +/** + * @brief 设置矩阵运算的平移对象y轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param y y轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置y的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetY(ArkUI_Matrix4TranslationOptions* options, const float y); + +/** + * @brief 获取矩阵运算的平移对象y轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param y y轴方向的平移值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetY(const ArkUI_Matrix4TranslationOptions* options, float* y); + +/** + * @brief 设置矩阵运算的平移对象z轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param z z轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置z的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetZ(ArkUI_Matrix4TranslationOptions* options, const float z); + +/** + * @brief 获取矩阵运算的平移对象z轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param z z轴方向的平移值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetZ(const ArkUI_Matrix4TranslationOptions* options, float* z); + +/** + * @brief 创建一个单位四阶矩阵对象。 + * + * @return 返回指向创建的单位四阶矩阵对象的指针。 + * @since 24 + */ +ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateIdentity(); + +/** + * @brief 通过指定矩阵的每个元素来创建一个四阶矩阵对象。 + * + * @param elements 指向预期矩阵元素数据的数组指针。数组长度应大于或等于16。该参数不可为空指针。 + * @return 返回新创建的四阶矩阵对象。如果elements指针为空,函数将返回空值。 + * @since 24 + */ +ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateByElements(const float* elements); + +/** + * @brief 销毁矩阵对象的指针。 + * + * @param matrix 指向要销毁的四阶矩阵对象的指针。 + * @since 24 + */ +void OH_ArkUI_Matrix4_Dispose(ArkUI_Matrix4* matrix); + +/** + * @brief 创建四阶矩阵对象的副本。用于对同一个矩阵进行操作以此获取不同矩阵对象。 + * + * @param matrix 指向原始四阶矩阵对象的指针。 + * @return 返回新创建的四阶矩阵对象。 + * @since 24 + */ +ArkUI_Matrix4* OH_ArkUI_Matrix4_Copy(const ArkUI_Matrix4* matrix); + +/** + * @brief 对输入矩阵执行逆矩阵变换。 + * + * @param matrix 指向要逆矩阵变换的四阶矩阵对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Invert(ArkUI_Matrix4* matrix); + +/** + * @brief 将另一个矩阵与原始矩阵合并,并将结果矩阵存储在oriMatrix中。结果矩阵相当于先应用oriMatrix的变换,然后再应用anotherMatrix的变换。此函数将修改oriMatrix对象。 + * + * @param oriMatrix 指向原始四阶矩阵对象的指针。 + * @param anotherMatrix 指向要合并的另一个矩阵对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Combine(ArkUI_Matrix4* oriMatrix, const ArkUI_Matrix4* anotherMatrix); + +/** + * @brief 对原始矩阵应用平移变换以获取平移后的矩阵。每次平移变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 + * + * @param matrix 指向待平移四阶矩阵对象的指针。 + * @param translate 指向平移对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Translate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4TranslationOptions* translate); + +/** + * @brief 对原始矩阵应用缩放变换以获取缩放后的矩阵。每次缩放变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 + * + * @param matrix 指向待缩放四阶矩阵对象的指针。 + * @param scale 指向缩放对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Scale(ArkUI_Matrix4* matrix, const ArkUI_Matrix4ScaleOptions* scale); + +/** + * @brief 对原始矩阵应用旋转变换以获取旋转后的矩阵。每次旋转变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 + * + * @param matrix 指向待旋转四阶矩阵对象的指针。 + * @param rotate 指向旋转对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Rotate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4RotationOptions* rotate); + +/** + * @brief 对原始矩阵应用倾斜变换以获取倾斜后的矩阵。每次倾斜变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 + * + * @param matrix 指向待倾斜四阶矩阵对象的指针。 + * @param skewX x方向的倾斜系数。 + * @param skewY y方向的倾斜系数。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Skew(ArkUI_Matrix4* matrix, const float skewX, const float skewY); + +/** + * @brief 计算一个点经过矩阵变换后的新坐标位置。 + * + * @param matrix 指向四阶矩阵对象的指针。 + * @param oriPoint 指向原始坐标点的指针。 + * @param result 指向结果点的指针。不能为空。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_TransformPoint(const ArkUI_Matrix4* matrix, const ArkUI_PointF* oriPoint, ArkUI_PointF* result); + +/** + * @brief 将一个多边形的顶点坐标映射到另一个多边形的顶点坐标,并计算所需的矩阵。 + * + * @param matrix 指向四阶矩阵对象的指针,用于存放结果矩阵。 + * @param src 指向原始多边形坐标点数组的指针。数组长度应至少为pointCount。 + * @param dst 指向映射后多边形坐标点数组的指针。数组长度应至少为pointCount。 + * @param pointCount 多边形点的数量,必须是0、1、2、3或4中的一个值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_SetPolyToPoly(ArkUI_Matrix4* matrix, const ArkUI_PointF* src, const ArkUI_PointF* dst, const uint32_t pointCount); + +/** + * @brief 获取四阶矩阵的16个元素。 + * + * @param matrix 指向四阶矩阵对象的指针。 + * @param result 指向可容纳16个浮点数的数组的指针。不能为空。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_GetElements(const ArkUI_Matrix4* matrix, float* result); + +#ifdef __cplusplus +} +#endif + +#endif // ARKUI_NATIVE_TYPE_VISUAL_H +/** @} */ From 6303cc55d847c5c0912c48a5057b6833fa280aa5 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 11:04:31 +0800 Subject: [PATCH 33/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: opencode (qwen3.6-plus) Change-Id: Ibc2a6009a1d12382c401b037cd78ee96f97fb5e9 --- arkui/ace_engine/native/native_type_visual.h | 587 ++++++++++++------ .../ace_engine/native/native_type_visual.h | 158 ----- 2 files changed, 411 insertions(+), 334 deletions(-) diff --git a/arkui/ace_engine/native/native_type_visual.h b/arkui/ace_engine/native/native_type_visual.h index a4d249c0f..fc2c307bb 100644 --- a/arkui/ace_engine/native/native_type_visual.h +++ b/arkui/ace_engine/native/native_type_visual.h @@ -193,31 +193,57 @@ typedef enum { * @since 12 */ typedef enum { - /** Thin material. */ + /** + * Thin material.
!{@link thin} + */ ARKUI_BLUR_STYLE_THIN = 0, - /** Regular material. */ + /** + * Regular material.
!{@link regular} + */ ARKUI_BLUR_STYLE_REGULAR, - /** Thick material. */ + /** + * Thick material.
!{@link thick} + */ ARKUI_BLUR_STYLE_THICK, - /** Material that creates the minimum depth of field effect. */ + /** + * Material that creates the minimum depth of field effect.
!{@link backgroundthin} + */ ARKUI_BLUR_STYLE_BACKGROUND_THIN, - /** Material that creates a medium shallow depth of field effect. */ + /** + * Material that creates a medium shallow depth of field effect.
!{@link backgroundregular} + */ ARKUI_BLUR_STYLE_BACKGROUND_REGULAR, - /** Material that creates a high shallow depth of field effect. */ + /** + * Material that creates a high shallow depth of field effect.
!{@link backgroundthick} + */ ARKUI_BLUR_STYLE_BACKGROUND_THICK, - /** Material that creates the maximum depth of field effect. */ + /** + * Material that creates the maximum depth of field effect.
!{@link backgroundultrathick} + */ ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK, - /** No blur. */ + /** + * No blur.
!{@link none} + */ ARKUI_BLUR_STYLE_NONE, - /** Component ultra-thin material. */ + /** + * Component ultra-thin material.
!{@link componentultrathin} + */ ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN, - /** Component thin material. */ + /** + * Component thin material.
!{@link componentthin} + */ ARKUI_BLUR_STYLE_COMPONENT_THIN, - /** Component regular material. */ + /** + * Component regular material.
!{@link componentregular} + */ ARKUI_BLUR_STYLE_COMPONENT_REGULAR, - /** Component thick material. */ + /** + * Component thick material.
!{@link componentthick} + */ ARKUI_BLUR_STYLE_COMPONENT_THICK, - /** Component ultra-thick material. */ + /** + * Component ultra-thick material.
!{@link componentultrathick} + */ ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK, } ArkUI_BlurStyle; @@ -227,12 +253,18 @@ typedef enum { * @since 19 */ typedef enum { - /** The blur effect changes according to the window's focus state; - * it is inactive when the window is not in focus and active when the window is in focus. */ + /** + * The blur effect changes according to the window's focus state; + * it is inactive when the window is not in focus and active when the window is in focus. + */ ARKUI_BLUR_STYLE_ACTIVE_POLICY_FOLLOWS_WINDOW_ACTIVE_STATE = 0, - /** The blur effect is always active. */ + /** + * The blur effect is always active. + */ ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_ACTIVE, - /** The blur effect is always inactive. */ + /** + * The blur effect is always inactive. + */ ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_INACTIVE, } ArkUI_BlurStyleActivePolicy; @@ -242,80 +274,135 @@ typedef enum { * @since 12 */ typedef enum { - /** The top image is superimposed on the bottom image without any blending. */ + /** + * The top image is superimposed on the bottom image without any blending. + */ ARKUI_BLEND_MODE_NONE = 0, - /** The target pixels covered by the source pixels are erased by being turned to completely transparent. */ + /** + * The target pixels covered by the source pixels are erased by being turned to completely transparent. + */ ARKUI_BLEND_MODE_CLEAR, - /** r = s: Only the source pixels are displayed. */ + /** + * r = s: Only the source pixels are displayed. + */ ARKUI_BLEND_MODE_SRC, - /** r = d: Only the target pixels are displayed. */ + /** + * r = d: Only the target pixels are displayed. + */ ARKUI_BLEND_MODE_DST, - /** r = s + (1 - sa) * d: The source pixels are blended based on opacity and cover the target pixels. */ + /** + * r = s + (1 - sa) * d: The source pixels are blended based on opacity and cover the target pixels. + */ ARKUI_BLEND_MODE_SRC_OVER, - /** r = d + (1 - da) * s: The target pixels are blended based on opacity and cover on the source pixels. */ + /** + * r = d + (1 - da) * s: The target pixels are blended based on opacity and cover on the source pixels. + */ ARKUI_BLEND_MODE_DST_OVER, - /** r = s * da: Only the part of the source pixels that overlap with the target pixels is displayed. */ + /** + * r = s * da: Only the part of the source pixels that overlap with the target pixels is displayed. + */ ARKUI_BLEND_MODE_SRC_IN, - /** r = d * sa: Only the part of the target pixels that overlap with the source pixels is displayed. */ + /** + * r = d * sa: Only the part of the target pixels that overlap with the source pixels is displayed. + */ ARKUI_BLEND_MODE_DST_IN, - /** r = s * (1 - da): Only the part of the source pixels that do not overlap with the target pixels is displayed. */ + /** + * r = s * (1 - da): Only the part of the source pixels that do not overlap with the target pixels is displayed. + */ ARKUI_BLEND_MODE_SRC_OUT, - /** r = d * (1 - sa): Only the part of the target pixels that do not overlap with the source pixels is displayed. */ + /** + * r = d * (1 - sa): Only the part of the target pixels that do not overlap with the source pixels is displayed. + */ ARKUI_BLEND_MODE_DST_OUT, - /** r = s * da + d * (1 - sa): The part of the source pixels that overlap with the target pixels is displayed and - * the part of the target pixels that do not overlap with the source pixels are displayed. + /** + * r = s * da + d * (1 - sa): The part of the source pixels that overlap with the target pixels is displayed and + * the part of the target pixels that do not overlap with the source pixels are displayed. */ ARKUI_BLEND_MODE_SRC_ATOP, - /** r = d * sa + s * (1 - da): The part of the target pixels that overlap with the source pixels and the part of - * the source pixels that do not overlap with the target pixels are displayed. + /** + * r = d * sa + s * (1 - da): The part of the target pixels that overlap with the source pixels and the part of + * the source pixels that do not overlap with the target pixels are displayed. */ ARKUI_BLEND_MODE_DST_ATOP, - /** r = s * (1 - da) + d * (1 - sa): Only the non-overlapping part between the source pixels and the target pixels - * is displayed. */ + /** + * r = s * (1 - da) + d * (1 - sa): Only the non-overlapping part between the source pixels and the target pixels + * is displayed. + */ ARKUI_BLEND_MODE_XOR, - /** r = min(s + d, 1): New pixels resulting from adding the source pixels to the target pixels are displayed. */ + /** + * r = min(s + d, 1): New pixels resulting from adding the source pixels to the target pixels are displayed. + */ ARKUI_BLEND_MODE_PLUS, - /** r = s * d: New pixels resulting from multiplying the source pixels with the target pixels are displayed. */ + /** + * r = s * d: New pixels resulting from multiplying the source pixels with the target pixels are displayed. + */ ARKUI_BLEND_MODE_MODULATE, - /** r = s + d - s * d: Pixels are blended by adding the source pixels to the target pixels and subtracting the - * product of their multiplication. */ + /** + * r = s + d - s * d: Pixels are blended by adding the source pixels to the target pixels and subtracting the + * product of their multiplication. + */ ARKUI_BLEND_MODE_SCREEN, - /** The MULTIPLY or SCREEN mode is used based on the target pixels. */ + /** + * The MULTIPLY or SCREEN mode is used based on the target pixels. + */ ARKUI_BLEND_MODE_OVERLAY, - /** rc = s + d - max(s * da, d * sa), ra = kSrcOver: When two colors overlap, whichever is darker is used. */ + /** + * rc = s + d - max(s * da, d * sa), ra = kSrcOver: When two colors overlap, whichever is darker is used. + */ ARKUI_BLEND_MODE_DARKEN, - /** rc = s + d - min(s * da, d * sa), ra = - kSrcOver: The final pixels are composed of the lightest values of pixels. */ + /** + * rc = s + d - min(s * da, d * sa), ra = kSrcOver: The final pixels are composed of the lightest values of pixels. + */ ARKUI_BLEND_MODE_LIGHTEN, - /** The colors of the target pixels are lightened to reflect the source pixels. */ + /** + * The colors of the target pixels are lightened to reflect the source pixels. + */ ARKUI_BLEND_MODE_COLOR_DODGE, - /** The colors of the target pixels are darkened to reflect the source pixels. */ + /** + * The colors of the target pixels are darkened to reflect the source pixels. + */ ARKUI_BLEND_MODE_COLOR_BURN, - /** The MULTIPLY or SCREEN mode is used, depending on the source pixels. */ + /** + * The MULTIPLY or SCREEN mode is used, depending on the source pixels. + */ ARKUI_BLEND_MODE_HARD_LIGHT, - /** The LIGHTEN or DARKEN mode is used, depending on the source pixels. */ + /** + * The LIGHTEN or DARKEN mode is used, depending on the source pixels. + */ ARKUI_BLEND_MODE_SOFT_LIGHT, - /** rc = s + d - 2 * (min(s * da, d * sa)), ra = - kSrcOver: The final pixel is the result of subtracting the darker of the two pixels (source and target) from - the lighter one. */ + /** + * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver: The final pixel is the result of subtracting the darker of the two pixels (source and target) from + * the lighter one. + */ ARKUI_BLEND_MODE_DIFFERENCE, - /** rc = s + d - two(s * d), ra = kSrcOver: The final pixel is similar to DIFFERENCE, but with less contrast. + /** + * rc = s + d - two(s * d), ra = kSrcOver: The final pixel is similar to DIFFERENCE, but with less contrast. */ ARKUI_BLEND_MODE_EXCLUSION, - /** r = s * (1 - da) + d * (1 - sa) + s * d: The final pixel is the result of multiplying the source pixel - * by the target pixel. */ + /** + * r = s * (1 - da) + d * (1 - sa) + s * d: The final pixel is the result of multiplying the source pixel + * by the target pixel. + */ ARKUI_BLEND_MODE_MULTIPLY, - /** The resultant image is created with the luminance and saturation of the source image and the hue of the target - * image. */ + /** + * The resultant image is created with the luminance and saturation of the source image and the hue of the target + * image. + */ ARKUI_BLEND_MODE_HUE, - /** The resultant image is created with the luminance and hue of the target image and the saturation of the source - * image. */ + /** + * The resultant image is created with the luminance and hue of the target image and the saturation of the source + * image. + */ ARKUI_BLEND_MODE_SATURATION, - /** The resultant image is created with the saturation and hue of the source image and the luminance of the target - * image. */ + /** + * The resultant image is created with the saturation and hue of the source image and the luminance of the target + * image. + */ ARKUI_BLEND_MODE_COLOR, - /** The resultant image is created with the saturation and hue of the target image and the luminance of the source - * image. */ + /** + * The resultant image is created with the saturation and hue of the target image and the luminance of the source + * image. + */ ARKUI_BLEND_MODE_LUMINOSITY, } ArkUI_BlendMode; @@ -325,11 +412,17 @@ typedef enum { * @since 12 */ typedef enum { - /** The foreground colors are the inverse of the component background colors. */ + /** + * The foreground colors are the inverse of the component background colors. + */ ARKUI_COLOR_STRATEGY_INVERT = 0, - /** The shadow colors of the component are the average color obtained from the component background shadow area. */ + /** + * The shadow colors of the component are the average color obtained from the component background shadow area. + */ ARKUI_COLOR_STRATEGY_AVERAGE, - /** The shadow colors of the component are the primary color obtained from the component background shadow area. */ + /** + * The shadow colors of the component are the primary color obtained from the component background shadow area. + */ ARKUI_COLOR_STRATEGY_PRIMARY, } ArkUI_ColorStrategy; @@ -339,15 +432,25 @@ typedef enum { * @since 12 */ typedef enum { - /** Rectangle. */ + /** + * Rectangle. + */ ARKUI_MASK_TYPE_RECTANGLE = 0, - /** Circle. */ + /** + * Circle. + */ ARKUI_MASK_TYPE_CIRCLE, - /** Ellipse. */ + /** + * Ellipse. + */ ARKUI_MASK_TYPE_ELLIPSE, - /** Path. */ + /** + * Path. + */ ARKUI_MASK_TYPE_PATH, - /** Progress indicator. */ + /** + * Progress indicator. + */ ARKUI_MASK_TYPE_PROGRESS, } ArkUI_MaskType; @@ -357,13 +460,21 @@ typedef enum { * @since 12 */ typedef enum { - /** Rectangle. */ + /** + * Rectangle. + */ ARKUI_CLIP_TYPE_RECTANGLE = 0, - /** Circle. */ + /** + * Circle. + */ ARKUI_CLIP_TYPE_CIRCLE, - /** Ellipse. */ + /** + * Ellipse. + */ ARKUI_CLIP_TYPE_ELLIPSE, - /** Path. */ + /** + * Path. + */ ARKUI_CLIP_TYPE_PATH, } ArkUI_ClipType; @@ -373,13 +484,21 @@ typedef enum { * @since 12 */ typedef enum { - /** Rectangle. */ + /** + * Rectangle. + */ ARKUI_SHAPE_TYPE_RECTANGLE = 0, - /** Circle. */ + /** + * Circle. + */ ARKUI_SHAPE_TYPE_CIRCLE, - /** Ellipse. */ + /** + * Ellipse. + */ ARKUI_SHAPE_TYPE_ELLIPSE, - /** Path. */ + /** + * Path. + */ ARKUI_SHAPE_TYPE_PATH, } ArkUI_ShapeType; @@ -389,25 +508,45 @@ typedef enum { * @since 12 */ typedef enum { - /** From right to left. */ + /** + * From right to left. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT = 0, - /** From bottom to top. */ + /** + * From bottom to top. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_TOP, - /** From left to right. */ + /** + * From left to right. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT, - /** From top to bottom. */ + /** + * From top to bottom. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_BOTTOM, - /** From lower right to upper left. */ + /** + * From lower right to upper left. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_TOP, - /** From upper right to lower left. */ + /** + * From upper right to lower left. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_BOTTOM, - /** From lower left to upper right. */ + /** + * From lower left to upper right. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_TOP, - /** From upper left to lower right. */ + /** + * From upper left to lower right. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_BOTTOM, - /** No gradient. */ + /** + * No gradient. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_NONE, - /** Custom direction. */ + /** + * Custom direction. + */ ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, } ArkUI_LinearGradientDirection; @@ -417,13 +556,21 @@ typedef enum { * @since 12 */ typedef enum { - /** Top edge of the window. */ + /** + * Top edge of the window. + */ ARKUI_TRANSITION_EDGE_TOP = 0, - /** Bottom edge of the window. */ + /** + * Bottom edge of the window. + */ ARKUI_TRANSITION_EDGE_BOTTOM, - /** Left edge of the window. */ + /** + * Left edge of the window. + */ ARKUI_TRANSITION_EDGE_START, - /** Right edge of the window. */ + /** + * Right edge of the window. + */ ARKUI_TRANSITION_EDGE_END, } ArkUI_TransitionEdge; @@ -433,10 +580,14 @@ typedef enum { * @since 12 */ typedef enum { - /** The content of the view is blended in sequence on the target image. */ + /** + * The content of the view is blended in sequence on the target image. + */ BLEND_APPLY_TYPE_FAST = 0, - /** The content of the component and its child components are drawn on the offscreen canvas, and then blended with - * the existing content on the canvas. */ + /** + * The content of the component and its child components are drawn on the offscreen canvas, and then blended with + * the existing content on the canvas. + */ BLEND_APPLY_TYPE_OFFSCREEN, } ArkUI_BlendApplyType; @@ -446,10 +597,14 @@ typedef enum { * @since 12 */ typedef enum { - /** The callback is invoked when the entire animation is removed once it has finished. */ + /** + * The callback is invoked when the entire animation is removed once it has finished. + */ ARKUI_FINISH_CALLBACK_REMOVED = 0, - /** The callback is invoked when the animation logically enters the falling state, though it may still be in its - * long tail state. */ + /** + * The callback is invoked when the animation logically enters the falling state, though it may still be in its + * long tail state. + */ ARKUI_FINISH_CALLBACK_LOGICALLY, } ArkUI_FinishCallbackType; @@ -459,70 +614,102 @@ typedef enum { * @since 12 */ typedef enum { - /** Maintains the content size of the animation's final state, - * and the content is always centered with the component.*/ + /** + * Maintains the content size of the animation's final state, + * and the content is always centered with the component. + */ ARKUI_RENDER_FIT_CENTER = 0, - /** Maintains the content size of the animation's final state, - * and the content is always aligned with the top center of the component. */ + /** + * Maintains the content size of the animation's final state, + * and the content is always aligned with the top center of the component. + */ ARKUI_RENDER_FIT_TOP, - /** Maintains the content size of the animation's final state, - * and the content is always aligned with the bottom center of the component. */ + /** + * Maintains the content size of the animation's final state, + * and the content is always aligned with the bottom center of the component. + */ ARKUI_RENDER_FIT_BOTTOM, - /** Maintains the content size of the animation's final state, - * and the content is always aligned to the left of the component. */ + /** + * Maintains the content size of the animation's final state, + * and the content is always aligned to the left of the component. + */ ARKUI_RENDER_FIT_LEFT, - /** Maintains the content size of the animation's final state, - * and the content is always right-aligned with the component. */ + /** + * Maintains the content size of the animation's final state, + * and the content is always right-aligned with the component. + */ ARKUI_RENDER_FIT_RIGHT, - /** Maintains the content size of the animation's final state, - * and the content is always aligned with the top left corner of the component. */ + /** + * Maintains the content size of the animation's final state, + * and the content is always aligned with the top left corner of the component. + */ ARKUI_RENDER_FIT_TOP_LEFT, - /** Keep the content size of the animation final state, - * and the content is always aligned with the upper right corner of the component. */ + /** + * Keep the content size of the animation final state, + * and the content is always aligned with the upper right corner of the component. + */ ARKUI_RENDER_FIT_TOP_RIGHT, - /** Keep the content size of the animation final state, - * and the content always aligns with the lower-left corner of the component. */ + /** + * Keep the content size of the animation final state, + * and the content always aligns with the lower-left corner of the component. + */ ARKUI_RENDER_FIT_BOTTOM_LEFT, - /** Keep the content size of the animation final state, - *and the content always aligns with the lower-right corner of the component. */ + /** + * Keep the content size of the animation final state, + * and the content always aligns with the lower-right corner of the component. + */ ARKUI_RENDER_FIT_BOTTOM_RIGHT, - /** The aspect ratio of the animation's final state content is not considered, - *and the content is always scaled to the size of the component. */ + /** + * The aspect ratio of the animation's final state content is not considered, + * and the content is always scaled to the size of the component. + */ ARKUI_RENDER_FIT_RESIZE_FILL, - /** Reduce or enlarge the aspect ratio of the animation final state content, - * so that the content is fully displayed in the component, - * and keep the center aligned with the component. */ + /** + * Reduce or enlarge the aspect ratio of the animation final state content, + * so that the content is fully displayed in the component, + * and keep the center aligned with the component. + */ ARKUI_RENDER_FIT_RESIZE_CONTAIN, - /** Keep the aspect ratio of the animation final state content to reduce or enlarge, - * so that the content is fully displayed in the component. - * When there is left over in the broad direction of the component, - * the content is aligned to the left of the component, - * and when there is left over in the high direction of the component, - * the content is aligned to the top of the component. */ + /** + * Keep the aspect ratio of the animation final state content to reduce or enlarge, + * so that the content is fully displayed in the component. + * When there is left over in the broad direction of the component, + * the content is aligned to the left of the component, + * and when there is left over in the high direction of the component, + * the content is aligned to the top of the component. + */ ARKUI_RENDER_FIT_RESIZE_CONTAIN_TOP_LEFT, - /** Keep the aspect ratio of the animation final state content to reduce or enlarge, - * so that the content is fully displayed in the component. - * When there is left in the wide direction of the component, - * the content is aligned with the component on the right. - * When there is left in the high direction of the component, - * the content is aligned with the component on the bottom. */ + /** + * Keep the aspect ratio of the animation final state content to reduce or enlarge, + * so that the content is fully displayed in the component. + * When there is left in the wide direction of the component, + * the content is aligned with the component on the right. + * When there is left in the high direction of the component, + * the content is aligned with the component on the bottom. + */ ARKUI_RENDER_FIT_RESIZE_CONTAIN_BOTTOM_RIGHT, - /** Keep the aspect ratio of the animation final state content reduced or enlarged, - * so that both sides of the content are greater than or equal to both sides of the component, - * and keep the center aligned with the component to display the middle part of the content. */ + /** + * Keep the aspect ratio of the animation final state content reduced or enlarged, + * so that both sides of the content are greater than or equal to both sides of the component, + * and keep the center aligned with the component to display the middle part of the content. + */ ARKUI_RENDER_FIT_RESIZE_COVER, - /** Keep the aspect ratio of the final content of the animation reduced or enlarged - * so that both sides of the content are exactly greater than or equal to both sides of the component. - * When the content width is left, the content is aligned to the left of the component, - * and the left portion of the content is displayed. When the content is left in the high direction, - * the content and the component remain top aligned, showing the top side of the content. */ + /** + * Keep the aspect ratio of the final content of the animation reduced or enlarged + * so that both sides of the content are exactly greater than or equal to both sides of the component. + * When the content width is left, the content is aligned to the left of the component, + * and the left portion of the content is displayed. When the content is left in the high direction, + * the content and the component remain top aligned, showing the top side of the content. + */ ARKUI_RENDER_FIT_RESIZE_COVER_TOP_LEFT, - /** Keep the aspect ratio of the final content of the animation reduced or enlarged so - * that both sides of the content are exactly greater than or equal to both sides of the component. - * When the content width is left, the content and the component remain right aligned, - * and the right part of the content is displayed. When the content is left in the high direction, - * the content and the component remain aligned at the bottom, - * and the bottom part of the content is displayed. */ + /** + * Keep the aspect ratio of the final content of the animation reduced or enlarged so + * that both sides of the content are exactly greater than or equal to both sides of the component. + * When the content width is left, the content and the component remain right aligned, + * and the right part of the content is displayed. When the content is left in the high direction, + * the content and the component remain aligned at the bottom, + * and the bottom part of the content is displayed. + */ ARKUI_RENDER_FIT_RESIZE_COVER_BOTTOM_RIGHT } ArkUI_RenderFit; @@ -532,17 +719,25 @@ typedef enum { * @since 12 */ typedef enum { - /** Before execution, the animation does not apply any styles to the target component. - * After execution, the animation restores the target component to its default state. */ + /** + * Before execution, the animation does not apply any styles to the target component. + * After execution, the animation restores the target component to its default state. + */ ARKUI_ANIMATION_FILL_MODE_NONE, - /** The target component retains the state set by the last keyframe encountered - * during execution of the animation. */ + /** + * The target component retains the state set by the last keyframe encountered + * during execution of the animation. + */ ARKUI_ANIMATION_FILL_MODE_FORWARDS, - /** The animation applies the values defined in the first relevant keyframe once it is applied to - * the target component, and retains the values during the period set by delay. */ + /** + * The animation applies the values defined in the first relevant keyframe once it is applied to + * the target component, and retains the values during the period set by delay. + */ ARKUI_ANIMATION_FILL_MODE_BACKWARDS, - /** The animation follows the rules for both Forwards and Backwards, - * extending the animation attributes in both directions. */ + /** + * The animation follows the rules for both Forwards and Backwards, + * extending the animation attributes in both directions. + */ ARKUI_ANIMATION_FILL_MODE_BOTH, } ArkUI_AnimationFillMode; @@ -552,17 +747,25 @@ typedef enum { * @since 12 */ typedef enum { - /** The animation plays in forward loop mode. */ + /** + * The animation plays in forward loop mode. + */ ARKUI_ANIMATION_DIRECTION_NORMAL = 0, - /** The animation plays in reverse loop mode. */ + /** + * The animation plays in reverse loop mode. + */ ARKUI_ANIMATION_DIRECTION_REVERSE, - /** The animation plays in alternating loop mode. When the animation is played for an odd number of times, the - * playback is in forward direction. When the animation is played for an even number of times, the playback is in - * reverse direction. */ + /** + * The animation plays in alternating loop mode. When the animation is played for an odd number of times, the + * playback is in forward direction. When the animation is played for an even number of times, the playback is in + * reverse direction. + */ ARKUI_ANIMATION_DIRECTION_ALTERNATE, - /** The animation plays in reverse alternating loop mode. When the animation is played for an odd number of times, - * the playback is in reverse direction. When the animation is played for an even number of times, the playback is - * in forward direction. */ + /** + * The animation plays in reverse alternating loop mode. When the animation is played for an odd number of times, + * the playback is in reverse direction. When the animation is played for an even number of times, the playback is + * in forward direction. + */ ARKUI_ANIMATION_DIRECTION_ALTERNATE_REVERSE, } ArkUI_AnimationDirection; @@ -572,11 +775,17 @@ typedef enum { * @since 12 */ typedef struct { - /** Translation distance along the x-axis. */ + /** + * Translation distance along the x-axis. + */ float x; - /** Translation distance along the y-axis. */ + /** + * Translation distance along the y-axis. + */ float y; - /** Translation distance along the z-axis. */ + /** + * Translation distance along the z-axis. + */ float z; } ArkUI_TranslationOptions; @@ -586,15 +795,25 @@ typedef struct { * @since 12 */ typedef struct { - /** Scale ratio along the x-axis. */ + /** + * Scale ratio along the x-axis. + */ float x; - /** Scale ratio along the y-axis. */ + /** + * Scale ratio along the y-axis. + */ float y; - /** Scale factor along the z-axis (not effective for the current 2D graphics). */ + /** + * Scale factor along the z-axis (not effective for the current 2D graphics). + */ float z; - /** X coordinate of the center point. */ + /** + * X coordinate of the center point. + */ float centerX; - /** Y coordinate of the center point. */ + /** + * Y coordinate of the center point. + */ float centerY; } ArkUI_ScaleOptions; @@ -604,21 +823,37 @@ typedef struct { * @since 12 */ typedef struct { - /** X-component of the rotation vector. */ + /** + * X-component of the rotation vector. + */ float x; - /** Y-component of the rotation vector. */ + /** + * Y-component of the rotation vector. + */ float y; - /** Z-component of the rotation vector. */ + /** + * Z-component of the rotation vector. + */ float z; - /** Rotation angle. */ + /** + * Rotation angle. + */ float angle; - /** X coordinate of the center point. */ + /** + * X coordinate of the center point. + */ float centerX; - /** Y coordinate of the center point. */ + /** + * Y coordinate of the center point. + */ float centerY; - /** Z-axis anchor, that is, the z-component of the 3D rotation center point. */ + /** + * Z-axis anchor, that is, the z-component of the 3D rotation center point. + */ float centerZ; - /** Distance from the user to the z=0 plane. */ + /** + * Distance from the user to the z=0 plane. + */ float perspective; } ArkUI_RotationOptions; diff --git a/zh-cn/arkui/ace_engine/native/native_type_visual.h b/zh-cn/arkui/ace_engine/native/native_type_visual.h index b51614280..b3d6445eb 100644 --- a/zh-cn/arkui/ace_engine/native/native_type_visual.h +++ b/zh-cn/arkui/ace_engine/native/native_type_visual.h @@ -818,164 +818,6 @@ typedef struct { float perspective; } ArkUI_RotationOptions; -/** - * @brief Defines shadow options. - * - * @since 24 - */ -typedef struct OH_ArkUI_ShadowOptions OH_ArkUI_ShadowOptions; - -/** - * @brief 定义路径动画的运动路径配置项。 - * - * @since 23 - */ -typedef struct ArkUI_MotionPathOptions ArkUI_MotionPathOptions; - -/** - * @brief 创建路径动画的运动路径配置项。 - * - * @return 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - *
新建的{@link ArkUI_MotionPathOptions}对象中,路径动画的运动路径path值为空字符串,路径动画起点进度from值为0,路径动画终点进度to值为1, - * 组件是否沿路径旋转rotatable值为false。 - * @since 23 - */ -ArkUI_MotionPathOptions* OH_ArkUI_MotionPathOptions_Create(); - -/** - * @brief 销毁路径动画的运动路径配置项。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @since 23 - */ -void OH_ArkUI_MotionPathOptions_Dispose(ArkUI_MotionPathOptions* options); - -/** - * @brief 设置路径动画的运动路径。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param svgPath 路径动画的运动路径字符串。 - *
该路径支持使用"start"和"end"作为起点和终点的占位符,例如:"Mstart.x start.y L50 50 Lend.x end.y Z"。路径字符串格式请参考{@link 绘制路径}。若设置为空字符串, - * 等效于未设置路径动画。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ -ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* options, const char* svgPath); - -/** - * @brief 获取路径动画的运动路径配置项中存储的运动路径字符串。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param svgPathBuffer 存储运动路径字符串的缓冲区指针。 - * @param bufferSize svgPathBuffer参数的缓冲区大小。 - * @param writeLength 返回{@link ARKUI_ERROR_CODE_NO_ERROR}时,表示实际写入缓冲区的字符串长度。 - *
返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}时,表示如果为入参异常,writeLength不会被赋值,如果为拷贝异常,writeLength为可容纳目标字符串的最小缓冲区大小。 - *
返回{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR}时,表示可容纳目标字符串的最小缓冲区大小。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - *
{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} 缓冲区大小不足。 - * @since 23 - */ -ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions* options, char* svgPathBuffer, - const int32_t bufferSize, int32_t* writeLength); - -/** - * @brief 设置路径动画起点进度。进度指已移动路径长度与总路径长度的比值。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param from 路径动画的起点进度,取值范围为[0.0, 1.0],且需满足from小于或等于终点进度to,否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 - *
to的含义参考{@link OH_ArkUI_MotionPathOptions_SetTo}。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} from超出[0.0, 1.0]范围,或from大于终点进度to。 - * @since 23 - */ -ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* options, const float from); - -/** - * @brief 获取路径动画的运动路径配置项中的路径动画起点进度。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param from 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中起点进度值的指针。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ -ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions* options, float* from); - -/** - * @brief 设置路径动画终点进度。进度指已移动路径长度与总路径长度的比值。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param to 路径动画的终点进度,取值范围为[0.0, 1.0],且需满足to大或等于起点进度from;否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 - *
from的含义参考{@link OH_ArkUI_MotionPathOptions_SetFrom}。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} to超出[0.0, 1.0]范围,或to小于起点进度from。 - * @since 23 - */ -ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* options, const float to); - -/** - * @brief 获取路径动画的运动路径配置项中的路径动画终点进度。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param to 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中终点进度值的指针。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ -ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* options, float* to); - -/** - * @brief 设置组件是否沿运动路径旋转。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param rotatable 组件是否沿路径旋转。true表示组件沿路径旋转;false表示组件不沿路径旋转。默认值:false。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ -ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* options, const bool rotatable); - -/** - * @brief 获取组件是否沿运动路径旋转。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param rotatable 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中rotatable参数值的指针,表示组件是否沿路径旋转。 - *
true表示组件沿路径旋转;false表示组件不沿路径旋转。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ -ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetRotatable(const ArkUI_MotionPathOptions* options, bool* rotatable); - -/** - * @brief Create a shadow options object. - * When the object is no longer in use, invoke {@link OH_ArkUI_ShadowOptions_Destroy} to destroy it. - * - * @return A pointer to the shadow options object. - * @since 24 - */ -OH_ArkUI_ShadowOptions* OH_ArkUI_ShadowOptions_Create(); - -/** - * @brief Destroys the shadow options object. - * - * @param options Pointer to the object to be destroyed. - * @since 24 - */ -void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); - /** * @brief 定义阴影选项对象。 * From f02d332311d2297cbd2f2cd1b0b9d5d4c4389874 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 11:12:38 +0800 Subject: [PATCH 34/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] Change-Id: I00a8b4a2d93eefbe2019ebcf31940bc95398640d --- .../ace_engine/native/native_type_visual.h | 3243 +++++++++-------- 1 file changed, 1734 insertions(+), 1509 deletions(-) diff --git a/zh-cn/arkui/ace_engine/native/native_type_visual.h b/zh-cn/arkui/ace_engine/native/native_type_visual.h index b3d6445eb..6783ee899 100644 --- a/zh-cn/arkui/ace_engine/native/native_type_visual.h +++ b/zh-cn/arkui/ace_engine/native/native_type_visual.h @@ -33,1512 +33,1737 @@ * @since 12 */ -#ifndef ARKUI_NATIVE_TYPE_VISUAL_H -#define ARKUI_NATIVE_TYPE_VISUAL_H - -#include -#include - -#ifdef __cplusplus -extern "C" { -#endif - - -/** - * @brief 定义四阶矩阵对象。 - * - * @since 24 - */ -typedef struct ArkUI_Matrix4 ArkUI_Matrix4; - -/** - * @brief 定义阴影类型枚举值。 - * - * @since 12 - */ -typedef enum { - /** - * 彩色阴影。 - */ - ARKUI_SHADOW_TYPE_COLOR = 0, - /** - * 模糊阴影。 - */ - ARKUI_SHADOW_TYPE_BLUR -} ArkUI_ShadowType; - -/** - * @brief 阴影效果枚举值。 - * - * @since 12 - */ -typedef enum { - /** - * 超小阴影。 - * !{@link defaultxs} - */ - ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0, - /** - * 小阴影。 - * !{@link defaultsm} - */ - ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM, - /** - * 中阴影。 - * !{@link defaultmd} - */ - ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD, - /** - * 大阴影。 - * !{@link defaultlg} - */ - ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG, - /** - * 浮动小阴影。 - * !{@link floatingsm} - */ - ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM, - /** - * 浮动中阴影。 - * !{@link floatingmd} - */ - ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD, -} ArkUI_ShadowStyle; - -/** - * @brief 动画曲线枚举值。 - * - * @since 12 - */ -typedef enum { - /** - * 动画从头到尾的速度都是相同。 - */ - ARKUI_CURVE_LINEAR = 0, - /** - * 动画以低速开始,然后加快,在结束前变慢。 - */ - ARKUI_CURVE_EASE, - /** - * 动画以低速开始。 - */ - ARKUI_CURVE_EASE_IN, - /** - * 动画以低速结束。 - */ - ARKUI_CURVE_EASE_OUT, - /** - * 动画以低速开始和结束,提供平滑自然的动画过渡效果。 - */ - ARKUI_CURVE_EASE_IN_OUT, - /** - * 动画标准曲线。 - */ - ARKUI_CURVE_FAST_OUT_SLOW_IN, - /** - * 动画减速曲线。 - */ - ARKUI_CURVE_LINEAR_OUT_SLOW_IN, - /** - * 动画加速曲线。 - */ - ARKUI_CURVE_FAST_OUT_LINEAR_IN, - /** - * 动画急缓曲线。 - */ - ARKUI_CURVE_EXTREME_DECELERATION, - /** - * 动画锐利曲线。 - */ - ARKUI_CURVE_SHARP, - /** - * 动画节奏曲线。 - */ - ARKUI_CURVE_RHYTHM, - /** - * 动画平滑曲线。 - */ - ARKUI_CURVE_SMOOTH, - /** - * 动画阻尼曲线。 - */ - ARKUI_CURVE_FRICTION, -} ArkUI_AnimationCurve; - -/** - * @brief 定义动画播放模式。 - * - * @since 12 - */ -typedef enum { - /** - * 动画正向播放。 - */ - ARKUI_ANIMATION_PLAY_MODE_NORMAL = 0, - /** - * 动画反向播放。 - */ - ARKUI_ANIMATION_PLAY_MODE_REVERSE, - /** - * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 - */ - ARKUI_ANIMATION_PLAY_MODE_ALTERNATE, - /** - * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 - */ - ARKUI_ANIMATION_PLAY_MODE_ALTERNATE_REVERSE, -} ArkUI_AnimationPlayMode; - -/** - * @brief 定义背景模糊样式。 - * - * @since 12 - */ -typedef enum { - /** - * 轻薄材质模糊。 - * !{@link thin} - */ - ARKUI_BLUR_STYLE_THIN = 0, - /** - * 普通厚度材质模糊。 - * !{@link regular} - */ - ARKUI_BLUR_STYLE_REGULAR, - /** - * 厚材质模糊。 - * !{@link thick} - */ - ARKUI_BLUR_STYLE_THICK, - /** - * 近距景深模糊。 - * !{@link backgroundthin} - */ - ARKUI_BLUR_STYLE_BACKGROUND_THIN, - /** - * 中距景深模糊。 - * !{@link backgroundregular} - */ - ARKUI_BLUR_STYLE_BACKGROUND_REGULAR, - /** - * 远距景深模糊。 - * !{@link backgroundthick} - */ - ARKUI_BLUR_STYLE_BACKGROUND_THICK, - /** - * 超远距景深模糊。 - * !{@link backgroundultrathick} - */ - ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK, - /** - * 关闭模糊。 - * !{@link none} - */ - ARKUI_BLUR_STYLE_NONE, - /** - * 组件超轻薄材质模糊。 - * !{@link componentultrathin} - */ - ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN, - /** - * 组件轻薄材质模糊。 - * !{@link componentthin} - */ - ARKUI_BLUR_STYLE_COMPONENT_THIN, - /** - * 组件普通材质模糊。 - * !{@link componentregular} - */ - ARKUI_BLUR_STYLE_COMPONENT_REGULAR, - /** - * 组件厚材质模糊。 - * !{@link componentthick} - */ - ARKUI_BLUR_STYLE_COMPONENT_THICK, - /** - * 组件超厚材质模糊。 - * !{@link componentultrathick} - */ - ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK, -} ArkUI_BlurStyle; - -/** - * @brief 定义背景模糊激活策略。 - * - * @since 19 - */ -typedef enum { - /** - * 跟随窗口焦点状态变化,窗口非焦点状态不激活,窗口焦点状态激活。 - */ - ARKUI_BLUR_STYLE_ACTIVE_POLICY_FOLLOWS_WINDOW_ACTIVE_STATE = 0, - /** - * 始终激活。 - */ - ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_ACTIVE, - /** - * 始终不激活。 - */ - ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_INACTIVE, -} ArkUI_BlurStyleActivePolicy; - -/** - * @brief 混合模式枚举值。 - * - * @since 12 - */ -typedef enum { - /** - * 将上层图像直接覆盖到下层图像上,不进行任何混合操作。 - */ - ARKUI_BLEND_MODE_NONE = 0, - /** - * 将源像素覆盖的目标像素清除为完全透明。 - */ - ARKUI_BLEND_MODE_CLEAR, - /** - * r = s,只显示源像素。 - */ - ARKUI_BLEND_MODE_SRC, - /** - * r = d,只显示目标像素。 - */ - ARKUI_BLEND_MODE_DST, - /** - * r = s + (1 - sa) * d,将源像素按照透明度进行混合,覆盖在目标像素上。 - */ - ARKUI_BLEND_MODE_SRC_OVER, - /** - * r = d + (1 - da) * s,将目标像素按照透明度进行混合,覆盖在源像素上。 - */ - ARKUI_BLEND_MODE_DST_OVER, - /** - * r = s * da,只显示源像素中与目标像素重叠的部分。 - */ - ARKUI_BLEND_MODE_SRC_IN, - /** - * r = d * sa,只显示目标像素中与源像素重叠的部分。 - */ - ARKUI_BLEND_MODE_DST_IN, - /** - * r = s * (1 - da),只显示源像素中与目标像素不重叠的部分。 - */ - ARKUI_BLEND_MODE_SRC_OUT, - /** - * r = d * (1 - sa),只显示目标像素中与源像素不重叠的部分。 - */ - ARKUI_BLEND_MODE_DST_OUT, - /** - * r = s * da + d * (1 - sa),在源像素和目标像素重叠的地方绘制源像素,在源像素和目标像素不重叠的地方绘制目标像素。 - */ - ARKUI_BLEND_MODE_SRC_ATOP, - /** - * r = d * sa + s * (1 - da),在源像素和目标像素重叠的地方绘制目标像素,在源像素和目标像素不重叠的地方绘制源像素。 - */ - ARKUI_BLEND_MODE_DST_ATOP, - /** - * r = s * (1 - da) + d * (1 - sa),只显示源像素与目标像素不重叠的部分。 - */ - ARKUI_BLEND_MODE_XOR, - /** - * r = min(s + d, 1),将源像素值与目标像素值相加,并将结果作为新的像素值。 - */ - ARKUI_BLEND_MODE_PLUS, - /** - * r = s * d,将源像素与目标像素进行乘法运算,并将结果作为新的像素值。 - */ - ARKUI_BLEND_MODE_MODULATE, - /** - * r = s + d - s * d,将两个图像的像素值相加,然后减去它们的乘积来实现混合。 - */ - ARKUI_BLEND_MODE_SCREEN, - /** - * 根据目标像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 - */ - ARKUI_BLEND_MODE_OVERLAY, - /** - * rc = s + d - max(s * da, d * sa), ra = kSrcOver,当两个颜色重叠时,较暗的颜色会覆盖较亮的颜色。 - */ - ARKUI_BLEND_MODE_DARKEN, - /** - * rc = s + d - min(s * da, d * sa), ra = kSrcOver,将源图像和目标图像中的像素进行比较,选取两者中较亮的像素作为最终的混合结果。 - */ - ARKUI_BLEND_MODE_LIGHTEN, - /** - * 使目标像素变得更亮来反映源像素。 - */ - ARKUI_BLEND_MODE_COLOR_DODGE, - /** - * 使目标像素变得更暗来反映源像素。 - */ - ARKUI_BLEND_MODE_COLOR_BURN, - /** - * 根据源像素的值来决定目标像素变得更亮或者更暗。根据源像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 - */ - ARKUI_BLEND_MODE_HARD_LIGHT, - /** - * 根据源像素来决定使用LIGHTEN混合模式还是DARKEN混合模式。 - */ - ARKUI_BLEND_MODE_SOFT_LIGHT, - /** - * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生高对比度的效果。 - */ - ARKUI_BLEND_MODE_DIFFERENCE, - /** - * rc = s + d - two(s * d), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生柔和的效果。 - */ - ARKUI_BLEND_MODE_EXCLUSION, - /** - * r = s * (1 - da) + d * (1 - sa) + s * d,将源图像与目标图像进行乘法混合,得到一张新的图像。 - */ - ARKUI_BLEND_MODE_MULTIPLY, - /** - * 保留源图像的亮度和饱和度,但会使用目标图像的色调来替换源图像的色调。 - */ - ARKUI_BLEND_MODE_HUE, - /** - * 保留目标像素的亮度和色调,但会使用源像素的饱和度来替换目标像素的饱和度。 - */ - ARKUI_BLEND_MODE_SATURATION, - /** - * 保留源像素的饱和度和色调,但会使用目标像素的亮度来替换源像素的亮度。 - */ - ARKUI_BLEND_MODE_COLOR, - /** - * 保留目标像素的色调和饱和度,但会用源像素的亮度替换目标像素的亮度。 - */ - ARKUI_BLEND_MODE_LUMINOSITY, -} ArkUI_BlendMode; - -/** - * @brief 前景和阴影颜色的枚举值。 - * - * @since 12 - */ -typedef enum { - /** - * 前景色为控件背景色的反色。 - */ - ARKUI_COLOR_STRATEGY_INVERT = 0, - /** - * 控件背景阴影色为控件背景阴影区域的平均色。 - */ - ARKUI_COLOR_STRATEGY_AVERAGE, - /** - * 控件背景阴影色为控件背景阴影区域的主色。 - */ - ARKUI_COLOR_STRATEGY_PRIMARY, -} ArkUI_ColorStrategy; - -/** - * @brief 遮罩类型枚举。遮罩是一种用于限制组件显示区域的手段,它利用特定的形状对组件内容进行裁剪,从而实现只有遮罩区域内的内容才可见的效果。 - * - * @since 12 - */ -typedef enum { - /** - * 矩形类型。 - */ - ARKUI_MASK_TYPE_RECTANGLE = 0, - /** - * 圆形。 - */ - ARKUI_MASK_TYPE_CIRCLE, - /** - * 椭圆形类型。 - */ - ARKUI_MASK_TYPE_ELLIPSE, - /** - * 路径类型。 - */ - ARKUI_MASK_TYPE_PATH, - /** - * 进度类型。 - */ - ARKUI_MASK_TYPE_PROGRESS, -} ArkUI_MaskType; - -/** - * @brief 裁剪类型枚举。 - * - * @since 12 - */ -typedef enum { - /** - * 矩形类型。 - */ - ARKUI_CLIP_TYPE_RECTANGLE = 0, - /** - * 圆形。 - */ - ARKUI_CLIP_TYPE_CIRCLE, - /** - * 椭圆形类型。 - */ - ARKUI_CLIP_TYPE_ELLIPSE, - /** - * 路径类型。 - */ - ARKUI_CLIP_TYPE_PATH, -} ArkUI_ClipType; - -/** - * @brief 自定义形状。 - * - * @since 12 - */ -typedef enum { - /** - * 矩形类型。 - */ - ARKUI_SHAPE_TYPE_RECTANGLE = 0, - /** - * 圆形。 - */ - ARKUI_SHAPE_TYPE_CIRCLE, - /** - * 椭圆形类型。 - */ - ARKUI_SHAPE_TYPE_ELLIPSE, - /** - * 路径类型。 - */ - ARKUI_SHAPE_TYPE_PATH, -} ArkUI_ShapeType; - -/** - * @brief 定义渐变方向结构。 - * - * @since 12 - */ -typedef enum { - /** - * 向左渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT = 0, - /** - * 向上渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_TOP, - /** - * 向右渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT, - /** - * 向下渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_BOTTOM, - /** - * 向左上渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_TOP, - /** - * 向左下渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_BOTTOM, - /** - * 向右上渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_TOP, - /** - * 向右下渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_BOTTOM, - /** - * 不渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_NONE, - /** - * 自定义渐变方向. - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, -} ArkUI_LinearGradientDirection; - -/** - * @brief 定义转场从边缘滑入和滑出的效果。 - * - * @since 12 - */ -typedef enum { - /** - * 转场从窗口的上边缘滑入和滑出。 - */ - ARKUI_TRANSITION_EDGE_TOP = 0, - /** - * 转场从窗口的下边缘滑入和滑出。 - */ - ARKUI_TRANSITION_EDGE_BOTTOM, - /** - * 转场从窗口的左边缘滑入和滑出。 - */ - ARKUI_TRANSITION_EDGE_START, - /** - * 转场从窗口的右边缘滑入和滑出。 - */ - ARKUI_TRANSITION_EDGE_END, -} ArkUI_TransitionEdge; - -/** - * @brief 指定的混合模式应用于视图的内容选项. - * - * @since 12 - */ -typedef enum { - /** - * 在目标图像上按顺序混合视图的内容. - */ - BLEND_APPLY_TYPE_FAST = 0, - /** - * 将此组件和子组件内容绘制到离屏画布上,然后整体进行混合. - */ - BLEND_APPLY_TYPE_OFFSCREEN, -} ArkUI_BlendApplyType; - -/** - * @brief 在动画中定义{@link OH_ArkUI_AnimatorOption_RegisterOnFinishCallback}回调的类型。 - * - * @since 12 - */ -typedef enum { - /** - * 当整个动画结束并立即删除时,将触发回调。 - */ - ARKUI_FINISH_CALLBACK_REMOVED = 0, - /** - * 当动画在逻辑上处于下降状态,但可能仍处于其长尾状态时,将触发回调。长尾状态是指动画即将完全停止前的残余变化过程,此时动画的数值变化已非常微小,接近目标值。 - */ - ARKUI_FINISH_CALLBACK_LOGICALLY, -} ArkUI_FinishCallbackType; - -/** - * @brief 定义动画终态内容大小与位置的枚举值。 - * - * @since 12 - */ -typedef enum { - /** - * 保持动画终态的内容大小,并且内容始终与组件保持中心对齐。 - */ - ARKUI_RENDER_FIT_CENTER = 0, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持顶部中心对齐。 - */ - ARKUI_RENDER_FIT_TOP, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持底部中心对齐。 - */ - ARKUI_RENDER_FIT_BOTTOM, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持左侧对齐。 - */ - ARKUI_RENDER_FIT_LEFT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持右侧对齐。 - */ - ARKUI_RENDER_FIT_RIGHT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持左上角对齐。 - */ - ARKUI_RENDER_FIT_TOP_LEFT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持右上角对齐。 - */ - ARKUI_RENDER_FIT_TOP_RIGHT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持左下角对齐。 - */ - ARKUI_RENDER_FIT_BOTTOM_LEFT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持右下角对齐。 - */ - ARKUI_RENDER_FIT_BOTTOM_RIGHT, - /** - * 不考虑动画终态内容的宽高比,并且内容始终缩放到组件的大小。 - */ - ARKUI_RENDER_FIT_RESIZE_FILL, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内,且与组件保持中心对齐。 - */ - ARKUI_RENDER_FIT_RESIZE_CONTAIN, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持左侧对齐,当组件高方向有剩余时,内容与组件保持顶部对齐。 - */ - ARKUI_RENDER_FIT_RESIZE_CONTAIN_TOP_LEFT, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持右侧对齐,当组件高方向有剩余时,内容与组件保持底部对齐。 - */ - ARKUI_RENDER_FIT_RESIZE_CONTAIN_BOTTOM_RIGHT, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容两边都大于或等于组件两边,且与组件保持中心对齐,显示内容的中间部分。 - */ - ARKUI_RENDER_FIT_RESIZE_COVER, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持左侧对齐,显示内容的左侧部分。当内容高方向有剩余时,内容与组件保持顶部对齐,显示内容的顶侧部分。 - */ - ARKUI_RENDER_FIT_RESIZE_COVER_TOP_LEFT, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持右侧对齐,显示内容的右侧部分。当内容高方向有剩余时,内容与组件保持底部对齐,显示内容的底侧部分。 - */ - ARKUI_RENDER_FIT_RESIZE_COVER_BOTTOM_RIGHT -} ArkUI_RenderFit; - -/** - * @brief 定义帧动画组件在动画开始前和结束后的状态。 - * - * @since 12 -*/ -typedef enum { - /** - * 动画未执行时不会将任何样式应用于目标,动画播放完成之后恢复初始默认状态。 - */ - ARKUI_ANIMATION_FILL_MODE_NONE, - /** - * 目标将保留动画执行期间最后一个关键帧的状态。 - */ - ARKUI_ANIMATION_FILL_MODE_FORWARDS, - /** - * 动画将在应用于目标时立即应用第一个关键帧中定义的值,并在{@link delay}期间保留此值。 - */ - ARKUI_ANIMATION_FILL_MODE_BACKWARDS, - /** - * 动画将遵循{@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}和{@link ARKUI_ANIMATION_FILL_MODE_BACKWARDS}的规则,从而在两个方向上扩展动画属性。 - */ - ARKUI_ANIMATION_FILL_MODE_BOTH, -} ArkUI_AnimationFillMode; - -/** - * @brief 定义动画播放模式。 - * - * @since 12 - */ -typedef enum { - /** - * 动画正向循环播放。 - */ - ARKUI_ANIMATION_DIRECTION_NORMAL = 0, - /** - * 动画反向循环播放。 - */ - ARKUI_ANIMATION_DIRECTION_REVERSE, - /** - * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 - */ - ARKUI_ANIMATION_DIRECTION_ALTERNATE, - /** - * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 - */ - ARKUI_ANIMATION_DIRECTION_ALTERNATE_REVERSE, -} ArkUI_AnimationDirection; - -/** - * @brief 定义组件转场时的平移效果对象。 - * - * @since 12 - */ -typedef struct { - /** - * 横向的平移距离,单位为vp。 - */ - float x; - /** - * 纵向的平移距离,单位为vp。 - */ - float y; - /** - * 深度方向的平移距离,单位为vp。 - */ - float z; -} ArkUI_TranslationOptions; - -/** - * @brief 定义组件转场时的缩放效果对象。 - * - * @since 12 - */ -typedef struct { - /** - * x轴的缩放倍数。x>1时以x轴方向放大,01时以y轴方向放大,0若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options, float radius); - -/** - * @brief 获取阴影选项的模糊半径。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param radius 阴影的模糊半径,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options, float* radius); - -/** - * @brief 设置阴影选项的阴影类型。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param type 阴影类型{@link ArkUI_ShadowType}。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType type); - -/** - * @brief 获取阴影选项的阴影类型。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param type 阴影类型{@link ArkUI_ShadowType}。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType* type); - -/** - * @brief 设置阴影选项的阴影颜色。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param color 阴影颜色,0xARGB格式。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, uint32_t color); - -/** - * @brief 获取阴影选项的阴影颜色。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param color 阴影颜色,0xARGB格式。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, uint32_t* color); - -/** - * @brief 设置阴影在x轴上的偏移量。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param offsetX 阴影在x轴上的偏移量,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* options, float offsetX); - -/** - * @brief 获取阴影在x轴上的偏移量。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param offsetX 阴影在x轴上的偏移量,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* options, float* offsetX); - -/** - * @brief 设置阴影在y轴上的偏移量。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param offsetY 阴影在y轴上的偏移量,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* options, float offsetY); - -/** - * @brief 获取阴影在y轴上的偏移量。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param offsetY 阴影在y轴上的偏移量,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* options, float* offsetY); - -/** - * @brief 设置是否用阴影填充组件内部。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。默认值为false。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, bool isFill); - -/** - * @brief 获取是否用阴影填充组件内部。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetFill(OH_ArkUI_ShadowOptions* options, bool* isFill); - -/** - * @brief 定义矩阵缩放的缩放对象。 - * - * @since 24 - */ -typedef struct ArkUI_Matrix4ScaleOptions ArkUI_Matrix4ScaleOptions; - -/** - * @brief 创建指向矩阵运算的缩放参数对象的指针。在新创建的对象中,x、y和z轴方向的缩放系数默认值,为1。变换中心点的x轴坐标centerX、变换中心点的y轴坐标centerY取默认值,为0。 - * - * @return 返回指向新创建的{@link ArkUI_Matrix4ScaleOptions}的指针。 - * @since 24 - */ -ArkUI_Matrix4ScaleOptions* OH_ArkUI_Matrix4ScaleOptions_Create(); - -/** - * @brief 销毁指向矩阵运算的缩放参数对象的指针。 - * - * @param options 指向要销毁的{@link ArkUI_Matrix4ScaleOptions}对象的指针。 - * @since 24 - */ -void OH_ArkUI_Matrix4ScaleOptions_Dispose(ArkUI_Matrix4ScaleOptions* options); - -/** - * @brief 设置矩阵运算的缩放参数对象x方向的缩放因子。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleX x方向的缩放因子。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetX(ArkUI_Matrix4ScaleOptions* options, const float scaleX); - -/** - * @brief 获取矩阵运算的缩放参数对象x方向的缩放因子。如果从未设置x的值,则x方向的缩放因子默认值为1。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleX x方向的缩放因子。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetX(const ArkUI_Matrix4ScaleOptions* options, float* scaleX); - -/** - * @brief 设置矩阵运算的缩放参数对象y方向的缩放因子。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleY y方向的缩放因子。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetY(ArkUI_Matrix4ScaleOptions* options, const float scaleY); - -/** - * @brief 获取矩阵运算的缩放参数对象y方向的缩放因子。如果从未设置y的值,则y方向的缩放因子默认值为1。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleY y方向的缩放因子。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetY(const ArkUI_Matrix4ScaleOptions* options, float* scaleY); - -/** - * @brief 设置矩阵运算的缩放参数对象z方向的缩放因子。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleZ z方向的缩放因子。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetZ(ArkUI_Matrix4ScaleOptions* options, const float scaleZ); - -/** - * @brief 获取矩阵运算的缩放参数对象z方向的缩放因子。如果从未设置z的值,则z方向的缩放因子默认值为1。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleZ z方向的缩放因子。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetZ(const ArkUI_Matrix4ScaleOptions* options, float* scaleZ); - -/** - * @brief 设置矩阵运算的缩放参数对象变换中心点的x轴坐标。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param centerX 变换中心点的x轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterX(ArkUI_Matrix4ScaleOptions* options, const float centerX); - -/** - * @brief 获取矩阵运算的缩放参数对象变换中心点的x轴坐标。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param centerX 变换中心点的x轴坐标。单位为px。默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterX(const ArkUI_Matrix4ScaleOptions* options, float* centerX); - -/** - * @brief 设置矩阵运算的缩放参数对象变换中心点的y轴坐标。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param centerY 变换中心点的y轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterY(ArkUI_Matrix4ScaleOptions* options, const float centerY); - -/** - * @brief 获取矩阵运算的缩放参数对象变换中心点的y轴坐标。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param centerY 变换中心点的y轴坐标。单位为px。默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterY(const ArkUI_Matrix4ScaleOptions* options, float* centerY); - -/** - * @brief 定义矩阵旋转的旋转对象。 - * - * @since 24 - */ -typedef struct ArkUI_Matrix4RotationOptions ArkUI_Matrix4RotationOptions; - -/** - * @brief 创建矩阵运算的旋转参数对象的指针。在新创建的对象中,单次矩阵变换中心点相对于组件变换中心点的x轴偏移值centerX、单次矩阵变换中心点相对于组件变换中心点的y轴偏移值centerY、旋转角度angle的默认值,为0。 - * 如果未指定x、y、z方向的方向向量中的任何一个,则等同于x=0、y=0、z=1,表示绕z轴旋转。一旦指定了x、y、z方向的方向向量中的任意一个,其余未指定的值等同于0。 - * - * @return 返回指向新创建的{@link ArkUI_Matrix4RotationOptions}的指针 - * @since 24 - */ -ArkUI_Matrix4RotationOptions* OH_ArkUI_Matrix4RotationOptions_Create(); - -/** - * @brief 销毁指向矩阵运算的旋转参数对象的指针。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @since 24 - */ -void OH_ArkUI_Matrix4RotationOptions_Dispose(ArkUI_Matrix4RotationOptions* options); - -/** - * @brief 设置矩阵运算的旋转参数对象x方向的方向向量。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param x x轴方向的方向向量的值。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetX(ArkUI_Matrix4RotationOptions* options, const float x); - -/** - * @brief 获取矩阵运算的旋转参数对象x方向的方向向量。如果从未设置过x值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param x x轴方向的方向向量的值。如果从未设置x的值,其值将未定义。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetX(const ArkUI_Matrix4RotationOptions* options, float* x); - -/** - * @brief 设置矩阵运算的旋转参数对象y方向的方向向量。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param y y轴方向的方向向量的值。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetY(ArkUI_Matrix4RotationOptions* options, const float y); - -/** - * @brief 获取矩阵运算的旋转参数对象y方向的方向向量。如果从未设置过y值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param y y轴方向的方向向量的值。如果从未设置y的值,其值将未定义。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetY(const ArkUI_Matrix4RotationOptions* options, float* y); - -/** - * @brief 设置矩阵运算的旋转参数对象z方向的方向向量。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param z z轴方向的方向向量的值。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetZ(ArkUI_Matrix4RotationOptions* options, const float z); - -/** - * @brief 获取矩阵运算的旋转参数对象z方向的方向向量。如果从未设置过z值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param z z轴方向的方向向量的值。如果从未设置z的值,其值将未定义。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetZ(const ArkUI_Matrix4RotationOptions* options, float* z); - -/** - * @brief 设置矩阵运算的旋转参数对象中旋转角度的值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param angle 旋转角度的值。取值范围:(-∞, +∞)。单位为度。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetAngle(ArkUI_Matrix4RotationOptions* options, const float angle); - -/** - * @brief 获取矩阵运算的旋转参数对象中旋转角度的值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param angle 旋转角度的值。单位为度。如果从未设置angle的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetAngle(const ArkUI_Matrix4RotationOptions* options, float* angle); - -/** - * @brief 设置单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterX(ArkUI_Matrix4RotationOptions* options, const float centerX); - -/** - * @brief 获取单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。单位为px。如果从未设置centerX的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterX(const ArkUI_Matrix4RotationOptions* options, float* centerX); - -/** - * @brief 设置单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterY(ArkUI_Matrix4RotationOptions* options, const float centerY); - -/** - * @brief 获取单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。单位为px。如果从未设置centerY的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterY(const ArkUI_Matrix4RotationOptions* options, float* centerY); - -/** - * @brief 定义矩阵平移的平移对象。 - * - * @since 24 - */ -typedef struct ArkUI_Matrix4TranslationOptions ArkUI_Matrix4TranslationOptions; - -/** - * @brief 创建指向矩阵运算的平移对象的指针。在新创建的对象中,x轴的平移距离x、y轴的平移距离y和z轴的平移距离z的默认值为0。 - * - * @return 返回指向新创建的{@link ArkUI_Matrix4TranslationOptions}的指针。 - * @since 24 - */ -ArkUI_Matrix4TranslationOptions* OH_ArkUI_Matrix4TranslationOptions_Create(); - -/** - * @brief 销毁指向矩阵运算的平移对象的指针。 - * - * @param options 指向要销毁的{@link ArkUI_Matrix4TranslationOptions}对象的指针。 - * @since 24 - */ -void OH_ArkUI_Matrix4TranslationOptions_Dispose(ArkUI_Matrix4TranslationOptions* options); - -/** - * @brief 设置矩阵运算的平移对象x轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param x x轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置x的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetX(ArkUI_Matrix4TranslationOptions* options, const float x); - -/** - * @brief 获取矩阵运算的平移对象x轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param x x轴方向的平移值。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4TranslationOptions* options, float* x); - -/** - * @brief 设置矩阵运算的平移对象y轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param y y轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置y的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetY(ArkUI_Matrix4TranslationOptions* options, const float y); - -/** - * @brief 获取矩阵运算的平移对象y轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param y y轴方向的平移值。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetY(const ArkUI_Matrix4TranslationOptions* options, float* y); - -/** - * @brief 设置矩阵运算的平移对象z轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param z z轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置z的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetZ(ArkUI_Matrix4TranslationOptions* options, const float z); - -/** - * @brief 获取矩阵运算的平移对象z轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param z z轴方向的平移值。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetZ(const ArkUI_Matrix4TranslationOptions* options, float* z); - -/** - * @brief 创建一个单位四阶矩阵对象。 - * - * @return 返回指向创建的单位四阶矩阵对象的指针。 - * @since 24 - */ -ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateIdentity(); - -/** - * @brief 通过指定矩阵的每个元素来创建一个四阶矩阵对象。 - * - * @param elements 指向预期矩阵元素数据的数组指针。数组长度应大于或等于16。该参数不可为空指针。 - * @return 返回新创建的四阶矩阵对象。如果elements指针为空,函数将返回空值。 - * @since 24 - */ -ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateByElements(const float* elements); - -/** - * @brief 销毁矩阵对象的指针。 - * - * @param matrix 指向要销毁的四阶矩阵对象的指针。 - * @since 24 - */ -void OH_ArkUI_Matrix4_Dispose(ArkUI_Matrix4* matrix); - -/** - * @brief 创建四阶矩阵对象的副本。用于对同一个矩阵进行操作以此获取不同矩阵对象。 - * - * @param matrix 指向原始四阶矩阵对象的指针。 - * @return 返回新创建的四阶矩阵对象。 - * @since 24 - */ -ArkUI_Matrix4* OH_ArkUI_Matrix4_Copy(const ArkUI_Matrix4* matrix); - -/** - * @brief 对输入矩阵执行逆矩阵变换。 - * - * @param matrix 指向要逆矩阵变换的四阶矩阵对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4_Invert(ArkUI_Matrix4* matrix); - -/** - * @brief 将另一个矩阵与原始矩阵合并,并将结果矩阵存储在oriMatrix中。结果矩阵相当于先应用oriMatrix的变换,然后再应用anotherMatrix的变换。此函数将修改oriMatrix对象。 - * - * @param oriMatrix 指向原始四阶矩阵对象的指针。 - * @param anotherMatrix 指向要合并的另一个矩阵对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4_Combine(ArkUI_Matrix4* oriMatrix, const ArkUI_Matrix4* anotherMatrix); - -/** - * @brief 对原始矩阵应用平移变换以获取平移后的矩阵。每次平移变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 - * - * @param matrix 指向待平移四阶矩阵对象的指针。 - * @param translate 指向平移对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4_Translate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4TranslationOptions* translate); - -/** - * @brief 对原始矩阵应用缩放变换以获取缩放后的矩阵。每次缩放变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 - * - * @param matrix 指向待缩放四阶矩阵对象的指针。 - * @param scale 指向缩放对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4_Scale(ArkUI_Matrix4* matrix, const ArkUI_Matrix4ScaleOptions* scale); - -/** - * @brief 对原始矩阵应用旋转变换以获取旋转后的矩阵。每次旋转变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 - * - * @param matrix 指向待旋转四阶矩阵对象的指针。 - * @param rotate 指向旋转对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4_Rotate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4RotationOptions* rotate); - -/** - * @brief 对原始矩阵应用倾斜变换以获取倾斜后的矩阵。每次倾斜变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 - * - * @param matrix 指向待倾斜四阶矩阵对象的指针。 - * @param skewX x方向的倾斜系数。 - * @param skewY y方向的倾斜系数。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4_Skew(ArkUI_Matrix4* matrix, const float skewX, const float skewY); - -/** - * @brief 计算一个点经过矩阵变换后的新坐标位置。 - * - * @param matrix 指向四阶矩阵对象的指针。 - * @param oriPoint 指向原始坐标点的指针。 - * @param result 指向结果点的指针。不能为空。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4_TransformPoint(const ArkUI_Matrix4* matrix, const ArkUI_PointF* oriPoint, ArkUI_PointF* result); - -/** - * @brief 将一个多边形的顶点坐标映射到另一个多边形的顶点坐标,并计算所需的矩阵。 - * - * @param matrix 指向四阶矩阵对象的指针,用于存放结果矩阵。 - * @param src 指向原始多边形坐标点数组的指针。数组长度应至少为pointCount。 - * @param dst 指向映射后多边形坐标点数组的指针。数组长度应至少为pointCount。 - * @param pointCount 多边形点的数量,必须是0、1、2、3或4中的一个值。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4_SetPolyToPoly(ArkUI_Matrix4* matrix, const ArkUI_PointF* src, const ArkUI_PointF* dst, const uint32_t pointCount); - -/** - * @brief 获取四阶矩阵的16个元素。 - * - * @param matrix 指向四阶矩阵对象的指针。 - * @param result 指向可容纳16个浮点数的数组的指针。不能为空。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ -ArkUI_ErrorCode OH_ArkUI_Matrix4_GetElements(const ArkUI_Matrix4* matrix, float* result); - -#ifdef __cplusplus -} -#endif - -#endif // ARKUI_NATIVE_TYPE_VISUAL_H -/** @} */ + #ifndef ARKUI_NATIVE_TYPE_VISUAL_H + #define ARKUI_NATIVE_TYPE_VISUAL_H + + #include + #include + + #ifdef __cplusplus + extern "C" { + #endif + + + /** + * @brief Defines a fourth-order matrix object. + * + * @since 24 + */ + typedef struct ArkUI_Matrix4 ArkUI_Matrix4; + + /** + * @brief Enumerates shadow types. + * + * @since 12 + */ + typedef enum { + /** + * Color shadow. + */ + ARKUI_SHADOW_TYPE_COLOR = 0, + /** + * Blur shadow. + */ + ARKUI_SHADOW_TYPE_BLUR + } ArkUI_ShadowType; + + /** + * @brief Enumerates shadow styles. + * + * @since 12 + */ + typedef enum { + /** + * Mini shadow.
!{@link defaultxs} + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0, + /** + * Small shadow.
!{@link defaultsm} + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM, + /** + * Medium shadow.
!{@link defaultmd} + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD, + /** + * Large shadow.
!{@link defaultlg} + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG, + /** + * Floating small shadow.
!{@link floatingsm} + */ + ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM, + /** + * Floating medium shadow.
!{@link floatingmd} + */ + ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD, + } ArkUI_ShadowStyle; + + /** + * @brief Enumerates the animation curves. + * + * @since 12 + */ + typedef enum { + /** + * The animation speed keeps unchanged. + */ + ARKUI_CURVE_LINEAR = 0, + /** + * The animation starts slowly, accelerates, and then slows down towards the end. + */ + ARKUI_CURVE_EASE, + /** + * The animation starts at a low speed and then picks up speed until the end. + */ + ARKUI_CURVE_EASE_IN, + /** + * The animation ends at a low speed. + */ + ARKUI_CURVE_EASE_OUT, + /** + * The animation starts and ends at a low speed, providing a smooth and natural transition. + */ + ARKUI_CURVE_EASE_IN_OUT, + /** + * The animation uses the standard curve + */ + ARKUI_CURVE_FAST_OUT_SLOW_IN, + /** + * The animation uses the deceleration curve. + */ + ARKUI_CURVE_LINEAR_OUT_SLOW_IN, + /** + * The animation uses the acceleration curve. + */ + ARKUI_CURVE_FAST_OUT_LINEAR_IN, + /** + * The animation uses the extreme deceleration curve. + */ + ARKUI_CURVE_EXTREME_DECELERATION, + /** + * The animation uses the sharp curve. + */ + ARKUI_CURVE_SHARP, + /** + * The animation uses the rhythm curve. + */ + ARKUI_CURVE_RHYTHM, + /** + * The animation uses the smooth curve. + */ + ARKUI_CURVE_SMOOTH, + /** + * The animation uses the friction curve + */ + ARKUI_CURVE_FRICTION, + } ArkUI_AnimationCurve; + + /** + * @brief Enumerates the animation playback directions. + * + * @since 12 + */ + typedef enum { + /** + * The animation is played forwards. + */ + ARKUI_ANIMATION_PLAY_MODE_NORMAL = 0, + /** + * The animation is played backwards. + */ + ARKUI_ANIMATION_PLAY_MODE_REVERSE, + /** + * The animation plays in alternating loop mode. When the animation is played for an odd number of times, the + * playback is in forward direction. When the animation is played for an even number of times, the playback is in + * reverse direction. + */ + ARKUI_ANIMATION_PLAY_MODE_ALTERNATE, + /** + * The animation plays in reverse alternating loop mode. When the animation is played for an odd number of times, + * the playback is in reverse direction. When the animation is played for an even number of times, the playback is + * in forward direction. + */ + ARKUI_ANIMATION_PLAY_MODE_ALTERNATE_REVERSE, + } ArkUI_AnimationPlayMode; + + /** + * @brief Enumerates the blur styles. + * + * @since 12 + */ + typedef enum { + /** + * Thin material.
!{@link thin} + */ + ARKUI_BLUR_STYLE_THIN = 0, + /** + * Regular material.
!{@link regular} + */ + ARKUI_BLUR_STYLE_REGULAR, + /** + * Thick material.
!{@link thick} + */ + ARKUI_BLUR_STYLE_THICK, + /** + * Material that creates the minimum depth of field effect.
!{@link backgroundthin} + */ + ARKUI_BLUR_STYLE_BACKGROUND_THIN, + /** + * Material that creates a medium shallow depth of field effect.
!{@link backgroundregular} + */ + ARKUI_BLUR_STYLE_BACKGROUND_REGULAR, + /** + * Material that creates a high shallow depth of field effect.
!{@link backgroundthick} + */ + ARKUI_BLUR_STYLE_BACKGROUND_THICK, + /** + * Material that creates the maximum depth of field effect.
!{@link backgroundultrathick} + */ + ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK, + /** + * No blur.
!{@link none} + */ + ARKUI_BLUR_STYLE_NONE, + /** + * Component ultra-thin material.
!{@link componentultrathin} + */ + ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN, + /** + * Component thin material.
!{@link componentthin} + */ + ARKUI_BLUR_STYLE_COMPONENT_THIN, + /** + * Component regular material.
!{@link componentregular} + */ + ARKUI_BLUR_STYLE_COMPONENT_REGULAR, + /** + * Component thick material.
!{@link componentthick} + */ + ARKUI_BLUR_STYLE_COMPONENT_THICK, + /** + * Component ultra-thick material.
!{@link componentultrathick} + */ + ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK, + } ArkUI_BlurStyle; + + /** + * @brief Enumerates the activation policies for the background blur effect. + * + * @since 19 + */ + typedef enum { + /** + * The blur effect changes according to the window's focus state; + * it is inactive when the window is not in focus and active when the window is in focus. + */ + ARKUI_BLUR_STYLE_ACTIVE_POLICY_FOLLOWS_WINDOW_ACTIVE_STATE = 0, + /** + * The blur effect is always active. + */ + ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_ACTIVE, + /** + * The blur effect is always inactive. + */ + ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_INACTIVE, + } ArkUI_BlurStyleActivePolicy; + + /** + * @brief Enumerates the blend modes. + * + * @since 12 + */ + typedef enum { + /** + * The top image is superimposed on the bottom image without any blending. + */ + ARKUI_BLEND_MODE_NONE = 0, + /** + * The target pixels covered by the source pixels are erased by being turned to completely transparent. + */ + ARKUI_BLEND_MODE_CLEAR, + /** + * r = s: Only the source pixels are displayed. + */ + ARKUI_BLEND_MODE_SRC, + /** + * r = d: Only the target pixels are displayed. + */ + ARKUI_BLEND_MODE_DST, + /** + * r = s + (1 - sa) * d: The source pixels are blended based on opacity and cover the target pixels. + */ + ARKUI_BLEND_MODE_SRC_OVER, + /** + * r = d + (1 - da) * s: The target pixels are blended based on opacity and cover on the source pixels. + */ + ARKUI_BLEND_MODE_DST_OVER, + /** + * r = s * da: Only the part of the source pixels that overlap with the target pixels is displayed. + */ + ARKUI_BLEND_MODE_SRC_IN, + /** + * r = d * sa: Only the part of the target pixels that overlap with the source pixels is displayed. + */ + ARKUI_BLEND_MODE_DST_IN, + /** + * r = s * (1 - da): Only the part of the source pixels that do not overlap with the target pixels is displayed. + */ + ARKUI_BLEND_MODE_SRC_OUT, + /** + * r = d * (1 - sa): Only the part of the target pixels that do not overlap with the source pixels is displayed. + */ + ARKUI_BLEND_MODE_DST_OUT, + /** + * r = s * da + d * (1 - sa): The part of the source pixels that overlap with the target pixels is displayed and + * the part of the target pixels that do not overlap with the source pixels are displayed. + */ + ARKUI_BLEND_MODE_SRC_ATOP, + /** + * r = d * sa + s * (1 - da): The part of the target pixels that overlap with the source pixels and the part of + * the source pixels that do not overlap with the target pixels are displayed. + */ + ARKUI_BLEND_MODE_DST_ATOP, + /** + * r = s * (1 - da) + d * (1 - sa): Only the non-overlapping part between the source pixels and the target pixels + * is displayed. + */ + ARKUI_BLEND_MODE_XOR, + /** + * r = min(s + d, 1): New pixels resulting from adding the source pixels to the target pixels are displayed. + */ + ARKUI_BLEND_MODE_PLUS, + /** + * r = s * d: New pixels resulting from multiplying the source pixels with the target pixels are displayed. + */ + ARKUI_BLEND_MODE_MODULATE, + /** + * r = s + d - s * d: Pixels are blended by adding the source pixels to the target pixels and subtracting the + * product of their multiplication. + */ + ARKUI_BLEND_MODE_SCREEN, + /** + * The MULTIPLY or SCREEN mode is used based on the target pixels. + */ + ARKUI_BLEND_MODE_OVERLAY, + /** + * rc = s + d - max(s * da, d * sa), ra = kSrcOver: When two colors overlap, whichever is darker is used. + */ + ARKUI_BLEND_MODE_DARKEN, + /** + * rc = s + d - min(s * da, d * sa), ra = kSrcOver: The final pixels are composed of the lightest values of pixels. + */ + ARKUI_BLEND_MODE_LIGHTEN, + /** + * The colors of the target pixels are lightened to reflect the source pixels. + */ + ARKUI_BLEND_MODE_COLOR_DODGE, + /** + * The colors of the target pixels are darkened to reflect the source pixels. + */ + ARKUI_BLEND_MODE_COLOR_BURN, + /** + * The MULTIPLY or SCREEN mode is used, depending on the source pixels. + */ + ARKUI_BLEND_MODE_HARD_LIGHT, + /** + * The LIGHTEN or DARKEN mode is used, depending on the source pixels. + */ + ARKUI_BLEND_MODE_SOFT_LIGHT, + /** + * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver: The final pixel is the result of subtracting the darker of the two pixels (source and target) from + * the lighter one. + */ + ARKUI_BLEND_MODE_DIFFERENCE, + /** + * rc = s + d - two(s * d), ra = kSrcOver: The final pixel is similar to DIFFERENCE, but with less contrast. + */ + ARKUI_BLEND_MODE_EXCLUSION, + /** + * r = s * (1 - da) + d * (1 - sa) + s * d: The final pixel is the result of multiplying the source pixel + * by the target pixel. + */ + ARKUI_BLEND_MODE_MULTIPLY, + /** + * The resultant image is created with the luminance and saturation of the source image and the hue of the target + * image. + */ + ARKUI_BLEND_MODE_HUE, + /** + * The resultant image is created with the luminance and hue of the target image and the saturation of the source + * image. + */ + ARKUI_BLEND_MODE_SATURATION, + /** + * The resultant image is created with the saturation and hue of the source image and the luminance of the target + * image. + */ + ARKUI_BLEND_MODE_COLOR, + /** + * The resultant image is created with the saturation and hue of the target image and the luminance of the source + * image. + */ + ARKUI_BLEND_MODE_LUMINOSITY, + } ArkUI_BlendMode; + + /** + * @brief Enumerates the foreground colors. + * + * @since 12 + */ + typedef enum { + /** + * The foreground colors are the inverse of the component background colors. + */ + ARKUI_COLOR_STRATEGY_INVERT = 0, + /** + * The shadow colors of the component are the average color obtained from the component background shadow area. + */ + ARKUI_COLOR_STRATEGY_AVERAGE, + /** + * The shadow colors of the component are the primary color obtained from the component background shadow area. + */ + ARKUI_COLOR_STRATEGY_PRIMARY, + } ArkUI_ColorStrategy; + + /** + * @brief Enumerates the mask types. + * + * @since 12 + */ + typedef enum { + /** + * Rectangle. + */ + ARKUI_MASK_TYPE_RECTANGLE = 0, + /** + * Circle. + */ + ARKUI_MASK_TYPE_CIRCLE, + /** + * Ellipse. + */ + ARKUI_MASK_TYPE_ELLIPSE, + /** + * Path. + */ + ARKUI_MASK_TYPE_PATH, + /** + * Progress indicator. + */ + ARKUI_MASK_TYPE_PROGRESS, + } ArkUI_MaskType; + + /** + * @brief Enumerates the clipping region types. + * + * @since 12 + */ + typedef enum { + /** + * Rectangle. + */ + ARKUI_CLIP_TYPE_RECTANGLE = 0, + /** + * Circle. + */ + ARKUI_CLIP_TYPE_CIRCLE, + /** + * Ellipse. + */ + ARKUI_CLIP_TYPE_ELLIPSE, + /** + * Path. + */ + ARKUI_CLIP_TYPE_PATH, + } ArkUI_ClipType; + + /** + * @brief Enumerates the custom shapes. + * + * @since 12 + */ + typedef enum { + /** + * Rectangle. + */ + ARKUI_SHAPE_TYPE_RECTANGLE = 0, + /** + * Circle. + */ + ARKUI_SHAPE_TYPE_CIRCLE, + /** + * Ellipse. + */ + ARKUI_SHAPE_TYPE_ELLIPSE, + /** + * Path. + */ + ARKUI_SHAPE_TYPE_PATH, + } ArkUI_ShapeType; + + /** + * @brief Enumerates the gradient directions. + * + * @since 12 + */ + typedef enum { + /** + * From right to left. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT = 0, + /** + * From bottom to top. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_TOP, + /** + * From left to right. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT, + /** + * From top to bottom. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_BOTTOM, + /** + * From lower right to upper left. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_TOP, + /** + * From upper right to lower left. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_BOTTOM, + /** + * From lower left to upper right. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_TOP, + /** + * From upper left to lower right. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_BOTTOM, + /** + * No gradient. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_NONE, + /** + * Custom direction. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, + } ArkUI_LinearGradientDirection; + + /** + * @brief Enumerates the slide-in and slide-out positions of the component from the screen edge during transition. + * + * @since 12 + */ + typedef enum { + /** + * Top edge of the window. + */ + ARKUI_TRANSITION_EDGE_TOP = 0, + /** + * Bottom edge of the window. + */ + ARKUI_TRANSITION_EDGE_BOTTOM, + /** + * Left edge of the window. + */ + ARKUI_TRANSITION_EDGE_START, + /** + * Right edge of the window. + */ + ARKUI_TRANSITION_EDGE_END, + } ArkUI_TransitionEdge; + + /** + * @brief Defines how the specified blend mode is applied. + * + * @since 12 + */ + typedef enum { + /** + * The content of the view is blended in sequence on the target image. + */ + BLEND_APPLY_TYPE_FAST = 0, + /** + * The content of the component and its child components are drawn on the offscreen canvas, and then blended with + * the existing content on the canvas. + */ + BLEND_APPLY_TYPE_OFFSCREEN, + } ArkUI_BlendApplyType; + + /** + * @brief Enumerates the animation onFinish callback types. + * + * @since 12 + */ + typedef enum { + /** + * The callback is invoked when the entire animation is removed once it has finished. + */ + ARKUI_FINISH_CALLBACK_REMOVED = 0, + /** + * The callback is invoked when the animation logically enters the falling state, though it may still be in its + * long tail state. + */ + ARKUI_FINISH_CALLBACK_LOGICALLY, + } ArkUI_FinishCallbackType; + + /** + * @brief Enumerates the render fit. + * + * @since 12 + */ + typedef enum { + /** + * Maintains the content size of the animation's final state, + * and the content is always centered with the component. + */ + ARKUI_RENDER_FIT_CENTER = 0, + /** + * Maintains the content size of the animation's final state, + * and the content is always aligned with the top center of the component. + */ + ARKUI_RENDER_FIT_TOP, + /** + * Maintains the content size of the animation's final state, + * and the content is always aligned with the bottom center of the component. + */ + ARKUI_RENDER_FIT_BOTTOM, + /** + * Maintains the content size of the animation's final state, + * and the content is always aligned to the left of the component. + */ + ARKUI_RENDER_FIT_LEFT, + /** + * Maintains the content size of the animation's final state, + * and the content is always right-aligned with the component. + */ + ARKUI_RENDER_FIT_RIGHT, + /** + * Maintains the content size of the animation's final state, + * and the content is always aligned with the top left corner of the component. + */ + ARKUI_RENDER_FIT_TOP_LEFT, + /** + * Keep the content size of the animation final state, + * and the content is always aligned with the upper right corner of the component. + */ + ARKUI_RENDER_FIT_TOP_RIGHT, + /** + * Keep the content size of the animation final state, + * and the content always aligns with the lower-left corner of the component. + */ + ARKUI_RENDER_FIT_BOTTOM_LEFT, + /** + * Keep the content size of the animation final state, + * and the content always aligns with the lower-right corner of the component. + */ + ARKUI_RENDER_FIT_BOTTOM_RIGHT, + /** + * The aspect ratio of the animation's final state content is not considered, + * and the content is always scaled to the size of the component. + */ + ARKUI_RENDER_FIT_RESIZE_FILL, + /** + * Reduce or enlarge the aspect ratio of the animation final state content, + * so that the content is fully displayed in the component, + * and keep the center aligned with the component. + */ + ARKUI_RENDER_FIT_RESIZE_CONTAIN, + /** + * Keep the aspect ratio of the animation final state content to reduce or enlarge, + * so that the content is fully displayed in the component. + * When there is left over in the broad direction of the component, + * the content is aligned to the left of the component, + * and when there is left over in the high direction of the component, + * the content is aligned to the top of the component. + */ + ARKUI_RENDER_FIT_RESIZE_CONTAIN_TOP_LEFT, + /** + * Keep the aspect ratio of the animation final state content to reduce or enlarge, + * so that the content is fully displayed in the component. + * When there is left in the wide direction of the component, + * the content is aligned with the component on the right. + * When there is left in the high direction of the component, + * the content is aligned with the component on the bottom. + */ + ARKUI_RENDER_FIT_RESIZE_CONTAIN_BOTTOM_RIGHT, + /** + * Keep the aspect ratio of the animation final state content reduced or enlarged, + * so that both sides of the content are greater than or equal to both sides of the component, + * and keep the center aligned with the component to display the middle part of the content. + */ + ARKUI_RENDER_FIT_RESIZE_COVER, + /** + * Keep the aspect ratio of the final content of the animation reduced or enlarged + * so that both sides of the content are exactly greater than or equal to both sides of the component. + * When the content width is left, the content is aligned to the left of the component, + * and the left portion of the content is displayed. When the content is left in the high direction, + * the content and the component remain top aligned, showing the top side of the content. + */ + ARKUI_RENDER_FIT_RESIZE_COVER_TOP_LEFT, + /** + * Keep the aspect ratio of the final content of the animation reduced or enlarged so + * that both sides of the content are exactly greater than or equal to both sides of the component. + * When the content width is left, the content and the component remain right aligned, + * and the right part of the content is displayed. When the content is left in the high direction, + * the content and the component remain aligned at the bottom, + * and the bottom part of the content is displayed. + */ + ARKUI_RENDER_FIT_RESIZE_COVER_BOTTOM_RIGHT + } ArkUI_RenderFit; + + /** + * @brief Defines the status before and after execution of the animation in the current playback direction. + * + * @since 12 + */ + typedef enum { + /** + * Before execution, the animation does not apply any styles to the target component. + * After execution, the animation restores the target component to its default state. + */ + ARKUI_ANIMATION_FILL_MODE_NONE, + /** + * The target component retains the state set by the last keyframe encountered + * during execution of the animation. + */ + ARKUI_ANIMATION_FILL_MODE_FORWARDS, + /** + * The animation applies the values defined in the first relevant keyframe once it is applied to + * the target component, and retains the values during the period set by delay. + */ + ARKUI_ANIMATION_FILL_MODE_BACKWARDS, + /** + * The animation follows the rules for both Forwards and Backwards, + * extending the animation attributes in both directions. + */ + ARKUI_ANIMATION_FILL_MODE_BOTH, + } ArkUI_AnimationFillMode; + + /** + * @brief Enumerates the animation playback modes. + * + * @since 12 + */ + typedef enum { + /** + * The animation plays in forward loop mode. + */ + ARKUI_ANIMATION_DIRECTION_NORMAL = 0, + /** + * The animation plays in reverse loop mode. + */ + ARKUI_ANIMATION_DIRECTION_REVERSE, + /** + * The animation plays in alternating loop mode. When the animation is played for an odd number of times, the + * playback is in forward direction. When the animation is played for an even number of times, the playback is in + * reverse direction. + */ + ARKUI_ANIMATION_DIRECTION_ALTERNATE, + /** + * The animation plays in reverse alternating loop mode. When the animation is played for an odd number of times, + * the playback is in reverse direction. When the animation is played for an even number of times, the playback is + * in forward direction. + */ + ARKUI_ANIMATION_DIRECTION_ALTERNATE_REVERSE, + } ArkUI_AnimationDirection; + + /** + * @brief Defines the translation options for component transition. + * + * @since 12 + */ + typedef struct { + /** + * Translation distance along the x-axis. + */ + float x; + /** + * Translation distance along the y-axis. + */ + float y; + /** + * Translation distance along the z-axis. + */ + float z; + } ArkUI_TranslationOptions; + + /** + * @brief Defines the scaling options for component transition. + * + * @since 12 + */ + typedef struct { + /** + * Scale ratio along the x-axis. + */ + float x; + /** + * Scale ratio along the y-axis. + */ + float y; + /** + * Scale factor along the z-axis (not effective for the current 2D graphics). + */ + float z; + /** + * X coordinate of the center point. + */ + float centerX; + /** + * Y coordinate of the center point. + */ + float centerY; + } ArkUI_ScaleOptions; + + /** + * @brief Defines the rotation options for component transition. + * + * @since 12 + */ + typedef struct { + /** + * X-component of the rotation vector. + */ + float x; + /** + * Y-component of the rotation vector. + */ + float y; + /** + * Z-component of the rotation vector. + */ + float z; + /** + * Rotation angle. + */ + float angle; + /** + * X coordinate of the center point. + */ + float centerX; + /** + * Y coordinate of the center point. + */ + float centerY; + /** + * Z-axis anchor, that is, the z-component of the 3D rotation center point. + */ + float centerZ; + /** + * Distance from the user to the z=0 plane. + */ + float perspective; + } ArkUI_RotationOptions; + + /** + * @brief Defines shadow options. + * + * @since 24 + */ + typedef struct OH_ArkUI_ShadowOptions OH_ArkUI_ShadowOptions; + + /** + * @brief Defines the motion path options for path animation. + * + * @since 23 + */ + typedef struct ArkUI_MotionPathOptions ArkUI_MotionPathOptions; + + /** + * @brief Create an object of the motion path options for path animation. + * In the newly created ArkUI_MotionPathOptions, the "path" value is an empty string, the "from" value is 0, + * the "to" value is 1, and the "rotatable" value is false. + * + * @return A pointer to the ArkUI_MotionPathOptions. + * @since 23 + */ + ArkUI_MotionPathOptions* OH_ArkUI_MotionPathOptions_Create(); + + /** + * @brief Dispose the ArkUI_MotionPathOptions object. + * + * @param options Pointer to the ArkUI_MotionPathOptions object to be disposed. + * @since 23 + */ + void OH_ArkUI_MotionPathOptions_Dispose(ArkUI_MotionPathOptions* options); + + /** + * @brief Sets the the motion path for the animation using an SVG path string. The path supports using "start" and + * "end" as placeholders for the starting and ending points, for example: + * "Mstart.x start.y L50 50 Lend.x end.y Z". Refer to the SVG path format for the path string. + * When set to an empty string, it is equivalent to not setting a path animation. + * + * @param options Pointer to the ArkUI_MotionPathOptions object. + * @param svgPath The motion path for the path animation. + * @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 exception occurs. + * @since 23 + */ + ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* options, const char* svgPath); + + /** + * @brief Gets the motion path string in the ArkUI_MotionPathOptions object. + * + * @param options Pointer to the ArkUI_MotionPathOptions object. + * @param svgPathBuffer Buffer pointer to the motion path string. + * @param bufferSize The buffer size of the svgPathBuffer parameter. + * @param writeLength Indicates the string length actually written to the buffer + * when returning {@link ARKUI_ERROR_CODE_NO_ERROR}. + * Indicates the minimum buffer size that can accommodate the target + * when {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} is returned. + * @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 exception occurs. + * Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the buffer size is less than the minimum buffer size. + * @since 23 + */ + ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions* options, char* svgPathBuffer, + const int32_t bufferSize, int32_t* writeLength); + + /** + * @brief Sets the starting progress in the ArkUI_MotionPathOptions. Progress refers to the ratio of the length of the + * path that has been traveled to the total length of the entire path. The value range is [0.0, 1.0], and the + * "from" value should be less than or equal to the "to" value; otherwise, an ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE + * error code will be returned. + * + * @param options Pointer to the ArkUI_MotionPathOptions object. + * @param from The starting progress in the ArkUI_MotionPathOptions. + * @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 exception occurs. + * Returns {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if the "from" value is out of range or the "from" value + * is greater than the "to" value. + * @since 23 + */ + ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* options, const float from); + + /** + * @brief Gets the starting progress in the ArkUI_MotionPathOptions object. + * + * @param options Pointer to the ArkUI_MotionPathOptions object. + * @param from The starting progress in the ArkUI_MotionPathOptions. + * @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 exception occurs. + * @since 23 + */ + ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions* options, float* from); + + /** + * @brief Sets the endpoint progress in the ArkUI_MotionPathOptions. Progress refers to the ratio of the length of the + * path that has been traveled to the total length of the entire path. The value range is [0.0, 1.0], and the + * "from" value should be less than or equal to the "to" value; otherwise, an ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE + * error code will be returned. + * + * @param options Pointer to the ArkUI_MotionPathOptions object. + * @param to The endpoint progress in the ArkUI_MotionPathOptions. + * @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 exception occurs. + * Returns {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if the "to" value is out of range or the "to" value + * is less than the "from" value. + * @since 23 + */ + ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* options, const float to); + + /** + * @brief Gets the endpoint progress in the ArkUI_MotionPathOptions object. + * + * @param options Pointer to the ArkUI_MotionPathOptions object. + * @param to The endpoint progress in the ArkUI_MotionPathOptions. + * @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 exception occurs. + * @since 23 + */ + ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* options, float* to); + + /** + * @brief Sets the rotatable parameter in the ArkUI_MotionPathOptions. It indicates whether to rotate along the path. + * True means rotating along the path, while false means not rotating along the path. + * + * @param options Pointer to the ArkUI_MotionPathOptions object. + * @param rotatable The rotatable parameter in the ArkUI_MotionPathOptions. + * @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 exception occurs. + * @since 23 + */ + ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* options, const bool rotatable); + + /** + * @brief Gets the rotatable parameter in the ArkUI_MotionPathOptions. + * + * @param options Pointer to the ArkUI_MotionPathOptions object. + * @param rotatable The rotatable parameter in the ArkUI_MotionPathOptions. + * @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 exception occurs. + * @since 23 + */ + ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetRotatable(const ArkUI_MotionPathOptions* options, bool* rotatable); + + /** + * @brief Create a shadow options object. + * When the object is no longer in use, invoke {@link OH_ArkUI_ShadowOptions_Destroy} to destroy it. + * + * @return A pointer to the shadow options object. + * @since 24 + */ + OH_ArkUI_ShadowOptions* OH_ArkUI_ShadowOptions_Create(); + + /** + * @brief Destroys the shadow options object. + * + * @param options Pointer to the object to be destroyed. + * @since 24 + */ + void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); + + /** + * @brief Sets blur radius of the shadow options. + * + * @param options shadow options. + * @param radius blur radius of the shadow. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options, float radius); + + /** + * @brief Gets blur radius of the shadow options. + * + * @param options shadow options. + * @param radius blur radius of the shadow. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options, float* radius); + + /** + * @brief Set shadow type of the shadow options. + * + * @param options shadow options. + * @param type shadow type. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType type); + + /** + * @brief Get shadow type of the shadow options. + * + * @param options shadow options. + * @param type shadow type. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType* type); + + /** + * @brief Set shadow color of the shadow options. + * + * @param options shadow options. + * @param color shadow color. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, uint32_t color); + + /** + * @brief Get shadow color of the shadow options. + * + * @param options shadow options. + * @param color shadow color. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, uint32_t* color); + + /** + * @brief Set offset of the shadow along the x-axis. + * + * @param options shadow options. + * @param offsetX offset of the shadow along the x-axis. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* options, float offsetX); + + /** + * @brief Get offset of the shadow along the x-axis. + * + * @param options shadow options. + * @param offsetX offset of the shadow along the x-axis. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* options, float* offsetX); + + /** + * @brief Set offset of the shadow along the y-axis. + * + * @param options shadow options. + * @param offsetY offset of the shadow along the y-axis. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* options, float offsetY); + + /** + * @brief Get offset of the shadow along the y-axis. + * + * @param options shadow options. + * @param offsetY offset of the shadow along the y-axis. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* options, float* offsetY); + + /** + * @brief Set whether to fill the inside of the component with shadow. + * + * @param options shadow options. + * @param isFill whether to fill the inside of the component with shadow. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, bool isFill); + + /** + * @brief Get whether to fill the inside of the component with shadow. + * + * @param options shadow options. + * @param isFill whether to fill the inside of the component with shadow. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetFill(OH_ArkUI_ShadowOptions* options, bool* isFill); + + /** + * @brief Defines the scale options for matrix scaling. + * + * @since 24 + */ + typedef struct ArkUI_Matrix4ScaleOptions ArkUI_Matrix4ScaleOptions; + + /** + * @brief Create an object of ArkUI_Matrix4ScaleOptions. + * In the newly created options, the default values for the scaling coefficients in the x, y and z directions + * are 1, and the default values for centerX, centerY are 0. + * + * @return Returns a pointer to the newly created ArkUI_Matrix4ScaleOptions. + * @since 24 + */ + ArkUI_Matrix4ScaleOptions* OH_ArkUI_Matrix4ScaleOptions_Create(); + + /** + * @brief Disposes the ArkUI_Matrix4ScaleOptions object. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions instance to be destroyed. + * @since 24 + */ + void OH_ArkUI_Matrix4ScaleOptions_Dispose(ArkUI_Matrix4ScaleOptions* options); + + /** + * @brief Set the scaling factor in the x direction in ArkUI_Matrix4ScaleOptions. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param scaleX The scaling factor in the x direction. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetX(ArkUI_Matrix4ScaleOptions* options, const float scaleX); + + /** + * @brief Get the scaling factor in the x direction in ArkUI_Matrix4ScaleOptions. + * If the value of x is never set, its default value is 1. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param scaleX The scaling factor in the x direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetX(const ArkUI_Matrix4ScaleOptions* options, float* scaleX); + + /** + * @brief Set the scaling factor in the y direction in ArkUI_Matrix4ScaleOptions. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param scaleY The scaling factor in the y direction. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetY(ArkUI_Matrix4ScaleOptions* options, const float scaleY); + + /** + * @brief Get the scaling factor in the y direction in ArkUI_Matrix4ScaleOptions. + * If the value of y is never set, its default value is 1. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param scaleY The scaling factor in the y direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetY(const ArkUI_Matrix4ScaleOptions* options, float* scaleY); + + /** + * @brief Set the scaling factor in the z direction in ArkUI_Matrix4ScaleOptions. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param scaleZ The scaling factor in the z direction. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetZ(ArkUI_Matrix4ScaleOptions* options, const float scaleZ); + + /** + * @brief Get the scaling factor in the z direction in ArkUI_Matrix4ScaleOptions. + * If the value of z is never set, its default value is 1. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param scaleZ The scaling factor in the z direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetZ(const ArkUI_Matrix4ScaleOptions* options, float* scaleZ); + + /** + * @brief Set x offset relative to the transformation center. 0 means no additional x-direction offset from the + * transformation center. The unit is px. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param centerX The x offset relative to the transformation center. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterX(ArkUI_Matrix4ScaleOptions* options, const float centerX); + + /** + * @brief Get the value of centerX from the options, which represents the x-direction offset relative to the + * transformation center. The unit is px. If the value of centerX is never set, its default value is 0. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param centerX The x-direction offset relative to the transformation center. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterX(const ArkUI_Matrix4ScaleOptions* options, float* centerX); + + /** + * @brief Set y offset relative to the transformation center. 0 means no additional y-direction offset from the + * transformation center. The unit is px. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param centerY The y offset relative to the transformation center. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterY(ArkUI_Matrix4ScaleOptions* options, const float centerY); + + /** + * @brief Get the value of centerY from the options, which represents the y-direction offset relative to the + * transformation center. The unit is px. If the value of centerY is never set, its default value is 0. + * + * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. + * @param centerY The y-direction offset relative to the transformation center. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterY(const ArkUI_Matrix4ScaleOptions* options, float* centerY); + + /** + * @brief Defines the rotation options for matrix rotating. + * + * @since 24 + */ + typedef struct ArkUI_Matrix4RotationOptions ArkUI_Matrix4RotationOptions; + + /** + * @brief Create an object of ArkUI_Matrix4RotationOptions. + * In the newly created options, the x, y, and z values in the direction vector specifying the rotation axis + * are undetermined; The default values for centerX, centerY are 0; The default value for angle is 0. + * If none of x, y, z are specified, it is equivalent to x=0, y=0, z=1, which means rotation around the z-axis. + * Once any one of x, y, z is specified, the remaining unspecified values are equivalent to 0. + * + * @return Returns a pointer to the newly created ArkUI_Matrix4RotationOptions. + * @since 24 + */ + ArkUI_Matrix4RotationOptions* OH_ArkUI_Matrix4RotationOptions_Create(); + + /** + * @brief Disposes the ArkUI_Matrix4RotationOptions object. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions instance to be destroyed. + * @since 24 + */ + void OH_ArkUI_Matrix4RotationOptions_Dispose(ArkUI_Matrix4RotationOptions* options); + + /** + * @brief Set the value of the direction vector for the x-axis direction in ArkUI_Matrix4RotationOptions. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param x The value of the direction vector for the x-axis direction. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetX(ArkUI_Matrix4RotationOptions* options, const float x); + + /** + * @brief Get the value of the direction vector for the x-axis direction in ArkUI_Matrix4RotationOptions. + * If the value of x is never set, its value will be undefined, so the function will return + * ARKUI_ERROR_CODE_PARAM_INVALID. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param x The value of the direction vector for the x-axis direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetX(const ArkUI_Matrix4RotationOptions* options, float* x); + + /** + * @brief Set the value of the direction vector for the y-axis direction in ArkUI_Matrix4RotationOptions. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param y The value of the direction vector for the y-axis direction. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetY(ArkUI_Matrix4RotationOptions* options, const float y); + + /** + * @brief Get the value of the direction vector for the y-axis direction in ArkUI_Matrix4RotationOptions. + * If the value of y is never set, its value will be undefined, so the function will return + * ARKUI_ERROR_CODE_PARAM_INVALID. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param y The value of the direction vector for the y-axis direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetY(const ArkUI_Matrix4RotationOptions* options, float* y); + + /** + * @brief Set the value of the direction vector for the z-axis direction in ArkUI_Matrix4RotationOptions. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param z The value of the direction vector for the z-axis direction. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetZ(ArkUI_Matrix4RotationOptions* options, const float z); + + /** + * @brief Get the value of the direction vector for the z-axis direction in ArkUI_Matrix4RotationOptions. + * If the value of z is never set, its value will be undefined, so the function will return + * ARKUI_ERROR_CODE_PARAM_INVALID. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param z The value of the direction vector for the z-axis direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetZ(const ArkUI_Matrix4RotationOptions* options, float* z); + + /** + * @brief Set the value of the rotation angle in ArkUI_Matrix4RotationOptions. The unit is degree. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param angle The value of the rotation angle in ArkUI_Matrix4RotationOptions. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetAngle(ArkUI_Matrix4RotationOptions* options, const float angle); + + /** + * @brief Get the value of the rotation angle in ArkUI_Matrix4RotationOptions. The unit is degree. + * If the value of angle is never set, its default value is 0. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param angle The value of the rotation angle in ArkUI_Matrix4RotationOptions. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetAngle(const ArkUI_Matrix4RotationOptions* options, float* angle); + + /** + * @brief Set x offset relative to the transformation center. 0 means no additional x-direction offset from the + * transformation center. The unit is px. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param centerX The x offset relative to the transformation center. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterX(ArkUI_Matrix4RotationOptions* options, const float centerX); + + /** + * @brief Get the value of centerX from the options, which represents the x-direction offset relative to the + * transformation center. The unit is px. If the value of centerX is never set, its default value is 0. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param centerX The x-direction offset relative to the transformation center. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterX(const ArkUI_Matrix4RotationOptions* options, float* centerX); + + /** + * @brief Set y offset relative to the transformation center. 0 means no additional y-direction offset from the + * transformation center. The unit is px. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param centerY The y offset relative to the transformation center. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterY(ArkUI_Matrix4RotationOptions* options, const float centerY); + + /** + * @brief Get the value of centerY from the options, which represents the y-direction offset relative to the + * transformation center. The unit is px. If the value of centerY is never set, its default value is 0. + * + * @param options Pointer to the ArkUI_Matrix4RotationOptions object. + * @param centerY The y-direction offset relative to the transformation center. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterY(const ArkUI_Matrix4RotationOptions* options, float* centerY); + + /** + * @brief Defines the translation options for matrix translating. + * + * @since 24 + */ + typedef struct ArkUI_Matrix4TranslationOptions ArkUI_Matrix4TranslationOptions; + + /** + * @brief Create an object of ArkUI_Matrix4TranslationOptions. + * In the newly created options, the default values for x, y and z are 0. + * + * @return Returns a pointer to the newly created ArkUI_Matrix4TranslationOptions. + * @since 24 + */ + ArkUI_Matrix4TranslationOptions* OH_ArkUI_Matrix4TranslationOptions_Create(); + + /** + * @brief Disposes the ArkUI_Matrix4TranslationOptions object. + * + * @param options Pointer to the ArkUI_Matrix4TranslationOptions instance to be destroyed. + * @since 24 + */ + void OH_ArkUI_Matrix4TranslationOptions_Dispose(ArkUI_Matrix4TranslationOptions* options); + + /** + * @brief Set the translation value in the x-axis direction. The unit is px. + * If the value of x is never set, its default value is 0. + * + * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. + * @param x The translation value in the x-axis direction. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetX(ArkUI_Matrix4TranslationOptions* options, const float x); + + /** + * @brief Get the translation value in the x-axis direction from ArkUI_Matrix4TranslationOptions. + * + * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. + * @param x The translation value in the x-axis direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4TranslationOptions* options, float* x); + + /** + * @brief Set the translation value in the y-axis direction. The unit is px. + * If the value of y is never set, its default value is 0. + * + * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. + * @param y The translation value in the y-axis direction. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetY(ArkUI_Matrix4TranslationOptions* options, const float y); + + /** + * @brief Get the translation value in the y-axis direction from ArkUI_Matrix4TranslationOptions. + * + * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. + * @param y The translation value in the y-axis direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetY(const ArkUI_Matrix4TranslationOptions* options, float* y); + + /** + * @brief Set the translation value in the z-axis direction. The unit is px. + * If the value of z is never set, its default value is 0. + * + * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. + * @param z The translation value in the z-axis direction. Value range: (-∞, +∞). + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetZ(ArkUI_Matrix4TranslationOptions* options, const float z); + + /** + * @brief Get the translation value in the z-axis direction from ArkUI_Matrix4TranslationOptions. + * + * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. + * @param z The translation value in the z-axis direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetZ(const ArkUI_Matrix4TranslationOptions* options, float* z); + + /** + * @brief Create an identity matrix4 object. + * + * @return Returns the created identity matrix4 object. + * @since 24 + */ + ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateIdentity(); + + /** + * @brief Specify each element of the matrix to create a matrix4 object. + * + * @param elements Pointer to the array of expected matrix element data. The length of array should be greater than + * or equal to 16. The parameter must not be null. + * @return Returns the newly created matrix4 object. + * If the pointer of elements is null, the function will return null. + * @since 24 + */ + ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateByElements(const float* elements); + + /** + * @brief Disposes a matrix4 object. + * + * @param matrix Pointer to the matrix4 object to be disposed. + * @since 24 + */ + void OH_ArkUI_Matrix4_Dispose(ArkUI_Matrix4* matrix); + + /** + * @brief Create a copy of the matrix4 object. + * + * @param matrix Pointer to the original matrix4 object. + * @return Returns the newly created matrix4 object. + * @since 24 + */ + ArkUI_Matrix4* OH_ArkUI_Matrix4_Copy(const ArkUI_Matrix4* matrix); + + /** + * @brief Perform an inverse matrix transformation on the input matrix. + * If the matrix is invertible, this function will modify the input matrix; otherwise, the matrix will remain + * unchanged and an error code will be returned. + * + * @param matrix Pointer to the matrix4 object to be inverted. + * @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 the matrix is not invertible. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4_Invert(ArkUI_Matrix4* matrix); + + /** + * @brief Combine another matrix with the original matrix, and storing the resulting matrix in oriMatrix. + * The resulting matrix is equivalent to first applying the transformation of oriMatrix and then applying + * the transformation of anotherMatrix. This function will alter the oriMatrix object. + * + * @param oriMatrix Pointer to the original matrix4 object. + * @param anotherMatrix Pointer to another matrix object to be combined. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4_Combine(ArkUI_Matrix4* oriMatrix, const ArkUI_Matrix4* anotherMatrix); + + /** + * @brief Apply a tranlation transformation to the original matrix to obtain the translated matrix. Each translation + * transformation is applied cumulatively. This function will alter the input matrix object. + * + * @param matrix Pointer to the matrix4 object to be translated. + * @param translate Pointer to the translation options. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4_Translate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4TranslationOptions* translate); + + /** + * @brief Apply a scale transformation to the original matrix to obtain the scaled matrix. Each scale + * transformation is applied cumulatively. This function will alter the input matrix object. + * + * @param matrix Pointer to the matrix4 object to be scaled. + * @param scale Pointer to the scale options. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4_Scale(ArkUI_Matrix4* matrix, const ArkUI_Matrix4ScaleOptions* scale); + + /** + * @brief Apply a rotation transformation to the original matrix to obtain the rotated matrix. Each rotation + * transformation is applied cumulatively. This function will alter the input matrix object. + * + * @param matrix Pointer to the matrix4 object to be rotated. + * @param rotate Pointer to the rotation options. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4_Rotate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4RotationOptions* rotate); + + /** + * @brief Apply a skew transformation to the original matrix to obtain the skewed matrix. Each skew + * transformation is applied cumulatively. This function will alter the input matrix object. + * + * @param matrix Pointer to the matrix4 object to be skewed. It must not be null. + * @param skewX Skew coefficient in the x direction. + * @param skewY Skew coefficient in the y direction. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4_Skew(ArkUI_Matrix4* matrix, const float skewX, const float skewY); + + /** + * @brief Calculate the new coordinate position of a point after it has been transformed by a matrix. + * The calculated transformed coordinate point will be filled into the ArkUI_PointF structure + * pointed to by result. + * + * @param matrix Pointer to the matrix4 object. + * @param oriPoint Pointer to the original coordinate point. + * @param result Pointer to the result point. It must not be null. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4_TransformPoint(const ArkUI_Matrix4* matrix, const ArkUI_PointF* oriPoint, ArkUI_PointF* result); + + /** + * @brief Map the vertex coordinates of one polygon to the vertex coordinates of another polygon, and calculate the required + * matrix. The resulting matrix will be filled into the object pointed to by matrix. + * + * @param matrix Pointer to the original matrix4 object. The result matrix will be filled into the object pointed to by it. + * It must not be null. + * @param src Pointer to the array of original polygon coordinate points. The array should be at least as long as pointCount. + * @param dst Pointer to the array of polygon coordinate points after mapping. The array should be at least as long as pointCount. + * @param pointCount The number of polygon points, which must be one of the values 0, 1, 2, 3, or 4. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4_SetPolyToPoly(ArkUI_Matrix4* matrix, const ArkUI_PointF* src, const ArkUI_PointF* dst, const uint32_t pointCount); + + /** + * @brief Obtain the 16 elements of the matrix and fill them into the array pointed to by result. + * The array pointed to by result must have space for 16 float elements. + * + * @param matrix Pointer to the original matrix4 object. + * @param result Pointer to an array that can hold 16 floating-point numbers. It must not be null. + * @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 exception occurs. + * @since 24 + */ + ArkUI_ErrorCode OH_ArkUI_Matrix4_GetElements(const ArkUI_Matrix4* matrix, float* result); + + #ifdef __cplusplus + } + #endif + + #endif // ARKUI_NATIVE_TYPE_VISUAL_H + /** @} */ + \ No newline at end of file From 75e21c667b18459cb4a786830baf70c2499d745c Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 11:37:48 +0800 Subject: [PATCH 35/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: opencode (qwen3.6-plus) Change-Id: Ia7796c1c6cfd8ded9494e59879dde595785218e5 --- arkui/ace_engine/native/native_type_visual.h | 860 +++++++++--------- .../ace_engine/native/native_type_visual.h | 845 ++++++++--------- 2 files changed, 837 insertions(+), 868 deletions(-) diff --git a/arkui/ace_engine/native/native_type_visual.h b/arkui/ace_engine/native/native_type_visual.h index fc2c307bb..ff7760ebf 100644 --- a/arkui/ace_engine/native/native_type_visual.h +++ b/arkui/ace_engine/native/native_type_visual.h @@ -872,890 +872,910 @@ typedef struct OH_ArkUI_ShadowOptions OH_ArkUI_ShadowOptions; typedef struct ArkUI_MotionPathOptions ArkUI_MotionPathOptions; /** - * @brief Create an object of the motion path options for path animation. - * In the newly created ArkUI_MotionPathOptions, the "path" value is an empty string, the "from" value is 0, - * the "to" value is 1, and the "rotatable" value is false. + * @brief Create a motion path option for path animation. * - * @return A pointer to the ArkUI_MotionPathOptions. + * @return Pointer to {@link ArkUI_MotionPathOptions}. + *
In the newly created {@link ArkUI_MotionPathOptions} object, **path** (motion path) is an empty string, ** + * from** (start progress) is **0**, **to** (end progress) is **1**, and **rotatable** (whether the component + * rotates along the path) is **false**. * @since 23 */ ArkUI_MotionPathOptions* OH_ArkUI_MotionPathOptions_Create(); /** - * @brief Dispose the ArkUI_MotionPathOptions object. + * @brief Destroys a motion path option of path animation. * - * @param options Pointer to the ArkUI_MotionPathOptions object to be disposed. + * @param options Pointer to {@link ArkUI_MotionPathOptions}. * @since 23 */ void OH_ArkUI_MotionPathOptions_Dispose(ArkUI_MotionPathOptions* options); /** - * @brief Sets the the motion path for the animation using an SVG path string. The path supports using "start" and - * "end" as placeholders for the starting and ending points, for example: - * "Mstart.x start.y L50 50 Lend.x end.y Z". Refer to the SVG path format for the path string. - * When set to an empty string, it is equivalent to not setting a path animation. + * @brief Sets the motion path for the animation using an SVG path string. The path supports using **start** and + * **end** as placeholders for the starting and ending points, for example: + * **Mstart.x start.y L50 50 Lend.x end.y Z**. For details about the path string format, see {@link Path}. If this + * parameter is set to an empty string, it is equivalent to not setting a path animation. * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param svgPath The motion path for the path animation. + * @param options Pointer to {@link ArkUI_MotionPathOptions}. + * @param svgPath Motion path string for the path animation. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* options, const char* svgPath); /** - * @brief Gets the motion path string in the ArkUI_MotionPathOptions object. + * @brief Obtains the motion path string stored in the motion path option. * - * @param options Pointer to the ArkUI_MotionPathOptions object. + * @param options Pointer to {@link ArkUI_MotionPathOptions}. * @param svgPathBuffer Buffer pointer to the motion path string. - * @param bufferSize The buffer size of the svgPathBuffer parameter. - * @param writeLength Indicates the string length actually written to the buffer - * when returning {@link ARKUI_ERROR_CODE_NO_ERROR}. - * Indicates the minimum buffer size that can accommodate the target - * when {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} is returned. + * @param bufferSize Buffer size of the **svgPathBuffer** parameter. + * @param writeLength Indicates the string length actually written to the buffer when {@link ARKUI_ERROR_CODE_NO_ERROR} + * is returned. Indicates the minimum buffer size that can accommodate the target string when + * {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} is returned. * @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 exception occurs. - * Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the buffer size is less than the minimum buffer size. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + *
{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the buffer size is less than the minimum buffer size. * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions* options, char* svgPathBuffer, const int32_t bufferSize, int32_t* writeLength); /** - * @brief Sets the starting progress in the ArkUI_MotionPathOptions. Progress refers to the ratio of the length of the - * path that has been traveled to the total length of the entire path. The value range is [0.0, 1.0], and the - * "from" value should be less than or equal to the "to" value; otherwise, an ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE - * error code will be returned. + * @brief Sets the start progress of the motion path. Progress refers to the ratio of the length of the path that has + * been traveled to the total length of the entire path. * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param from The starting progress in the ArkUI_MotionPathOptions. + * @param options Pointer to {@link ArkUI_MotionPathOptions}. + * @param from Start progress of the motion path. The value ranges from **0.0** to **1.0**. The value of **from** must + * be less than or equal to that of **to**; otherwise, {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} is returned. + * For details about the meaning of **to**, see {@link OH_ArkUI_MotionPathOptions_SetTo}. * @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 exception occurs. - * Returns {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if the "from" value is out of range or the "from" value - * is greater than the "to" value. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if **from** is out of the range [0.0, 1.0] or **from** is + * greater than **to**. * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* options, const float from); /** - * @brief Gets the starting progress in the ArkUI_MotionPathOptions object. + * @brief Obtains the start progress of the motion path from the motion path option. * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param from The starting progress in the ArkUI_MotionPathOptions. + * @param options Pointer to {@link ArkUI_MotionPathOptions}. + * @param from Pointer to the variable used to receive the start progress of the motion path. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions* options, float* from); /** - * @brief Sets the endpoint progress in the ArkUI_MotionPathOptions. Progress refers to the ratio of the length of the - * path that has been traveled to the total length of the entire path. The value range is [0.0, 1.0], and the - * "from" value should be less than or equal to the "to" value; otherwise, an ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE - * error code will be returned. + * @brief Sets the end progress of the motion path. Progress refers to the ratio of the length of the path that has + * been traveled to the total length of the entire path. * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param to The endpoint progress in the ArkUI_MotionPathOptions. + * @param options Pointer to {@link ArkUI_MotionPathOptions}. + * @param to End progress of the motion path. The value ranges from **0.0** to **1.0**. The value of **to** must be + * greater than or equal to that of **from**; otherwise, {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} is returned. + * For details about the meaning of **from**, see {@link OH_ArkUI_MotionPathOptions_SetFrom}. * @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 exception occurs. - * Returns {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if the "to" value is out of range or the "to" value - * is less than the "from" value. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if **to** is out of the range [0.0, 1.0] or **to** is less than + * **from**. * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* options, const float to); /** - * @brief Gets the endpoint progress in the ArkUI_MotionPathOptions object. + * @brief Obtains the end progress of the motion path from the motion path option. * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param to The endpoint progress in the ArkUI_MotionPathOptions. + * @param options Pointer to {@link ArkUI_MotionPathOptions}. + * @param to Pointer to the variable used to receive the end progress of the motion path. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* options, float* to); /** - * @brief Sets the rotatable parameter in the ArkUI_MotionPathOptions. It indicates whether to rotate along the path. - * True means rotating along the path, while false means not rotating along the path. + * @brief Sets whether the component rotates along the motion path. * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param rotatable The rotatable parameter in the ArkUI_MotionPathOptions. + * @param options Pointer to {@link ArkUI_MotionPathOptions}. + * @param rotatable Whether the component rotates along the path. The value **true** means that the component rotates + * along the path, and **false** means that the component does not rotate along the path. The default value is + * **false**. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* options, const bool rotatable); /** - * @brief Gets the rotatable parameter in the ArkUI_MotionPathOptions. + * @brief Obtains whether the component rotates along the motion path. * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param rotatable The rotatable parameter in the ArkUI_MotionPathOptions. + * @param options Pointer to {@link ArkUI_MotionPathOptions}. + * @param rotatable Pointer to the variable used to receive the value of **rotatable**, which indicates whether the + * component rotates along the path. The value **true** means that the component rotates along the path, and + * **false** means that the component does not rotate along the path. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetRotatable(const ArkUI_MotionPathOptions* options, bool* rotatable); /** - * @brief Create a shadow options object. - * When the object is no longer in use, invoke {@link OH_ArkUI_ShadowOptions_Destroy} to destroy it. + * @brief Creates a shadow option object. When the object is no longer in use, call + * {@link OH_ArkUI_ShadowOptions_Destroy} to destroy it. * - * @return A pointer to the shadow options object. + * @return Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @since 24 */ OH_ArkUI_ShadowOptions* OH_ArkUI_ShadowOptions_Create(); /** - * @brief Destroys the shadow options object. + * @brief Destroys the shadow option object. * - * @param options Pointer to the object to be destroyed. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @since 24 */ void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); /** - * @brief Sets blur radius of the shadow options. + * @brief Sets the blur radius for the shadow options. * - * @param options shadow options. - * @param radius blur radius of the shadow. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param radius Blur radius of the shadow, in vp. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options, float radius); /** - * @brief Gets blur radius of the shadow options. + * @brief Obtains the blur radius of the shadow options. * - * @param options shadow options. - * @param radius blur radius of the shadow. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param radius Pointer to the variable used to receive the blur radius of the shadow, in vp. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options, float* radius); /** - * @brief Set shadow type of the shadow options. + * @brief Sets the shadow type for the shadow options. * - * @param options shadow options. - * @param type shadow type. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param type Shadow type. For details, see {@link ArkUI_ShadowType}. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType type); /** - * @brief Get shadow type of the shadow options. + * @brief Obtains the shadow type of the shadow options. * - * @param options shadow options. - * @param type shadow type. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param type Pointer to the variable used to receive the shadow type. For details, see {@link ArkUI_ShadowType}. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType* type); /** - * @brief Set shadow color of the shadow options. + * @brief Sets the shadow color for the shadow options. * - * @param options shadow options. - * @param color shadow color. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param color Shadow color, in 0xARGB format. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, uint32_t color); /** - * @brief Get shadow color of the shadow options. + * @brief Obtains the shadow color of the shadow options. * - * @param options shadow options. - * @param color shadow color. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param color Pointer to the variable used to receive the shadow color, in 0xARGB format. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, uint32_t* color); /** - * @brief Set offset of the shadow along the x-axis. + * @brief Sets the offset of the shadow along the x-axis. * - * @param options shadow options. - * @param offsetX offset of the shadow along the x-axis. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param offsetX Offset of the shadow along the x-axis, in vp. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* options, float offsetX); /** - * @brief Get offset of the shadow along the x-axis. + * @brief Obtains the offset of the shadow along the x-axis. * - * @param options shadow options. - * @param offsetX offset of the shadow along the x-axis. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param offsetX Pointer to the variable used to receive the offset of the shadow along the x-axis, in vp. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* options, float* offsetX); /** - * @brief Set offset of the shadow along the y-axis. + * @brief Sets the offset of the shadow along the y-axis. * - * @param options shadow options. - * @param offsetY offset of the shadow along the y-axis. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param offsetY Offset of the shadow along the y-axis, in vp. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* options, float offsetY); /** - * @brief Get offset of the shadow along the y-axis. + * @brief Obtains the offset of the shadow along the y-axis. * - * @param options shadow options. - * @param offsetY offset of the shadow along the y-axis. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param offsetY Pointer to the variable used to receive the offset of the shadow along the y-axis, in vp. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* options, float* offsetY); /** - * @brief Set whether to fill the inside of the component with shadow. + * @brief Sets whether to fill the inside of the component with shadow. * - * @param options shadow options. - * @param isFill whether to fill the inside of the component with shadow. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param isFill Whether to fill the inside of the component with shadow. The value **true** means to fill the inside + * of the component with shadow, and **false** means not to fill the inside of the component with shadow. The + * default value is **false**. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, bool isFill); /** - * @brief Get whether to fill the inside of the component with shadow. + * @brief Obtains whether to fill the inside of the component with shadow. * - * @param options shadow options. - * @param isFill whether to fill the inside of the component with shadow. + * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. + * @param isFill Pointer to the variable used to receive whether to fill the inside of the component with shadow. The + * value **true** means to fill the inside of the component with shadow, and **false** means not to fill the inside + * of the component with shadow. * @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 exception occurs. + *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetFill(OH_ArkUI_ShadowOptions* options, bool* isFill); /** - * @brief Defines the scale options for matrix scaling. + * @brief Defines a matrix scaling object. * * @since 24 */ typedef struct ArkUI_Matrix4ScaleOptions ArkUI_Matrix4ScaleOptions; /** - * @brief Create an object of ArkUI_Matrix4ScaleOptions. - * In the newly created options, the default values for the scaling coefficients in the x, y and z directions - * are 1, and the default values for centerX, centerY are 0. + * @brief Creates a pointer to the scaling parameter object for matrix operations. In the newly created object, the + * default scaling coefficients in the x, y, and z directions are 1. The default values of **centerX** and **centerY** + * of the transformation center point are 0. * - * @return Returns a pointer to the newly created ArkUI_Matrix4ScaleOptions. + * @return Pointer to the new {@link ArkUI_Matrix4ScaleOptions} object. * @since 24 */ ArkUI_Matrix4ScaleOptions* OH_ArkUI_Matrix4ScaleOptions_Create(); /** - * @brief Disposes the ArkUI_Matrix4ScaleOptions object. + * @brief Disposes of the pointer to the scaling parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions instance to be destroyed. + * @param options Pointer to the {@link ArkUI_Matrix4ScaleOptions} object to be destroyed. * @since 24 */ void OH_ArkUI_Matrix4ScaleOptions_Dispose(ArkUI_Matrix4ScaleOptions* options); /** - * @brief Set the scaling factor in the x direction in ArkUI_Matrix4ScaleOptions. + * @brief Sets the scaling factor in the x direction of the scaling parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleX The scaling factor in the x direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param scaleX Scaling factor in the x direction. The value range is (-∞, +∞). + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetX(ArkUI_Matrix4ScaleOptions* options, const float scaleX); /** - * @brief Get the scaling factor in the x direction in ArkUI_Matrix4ScaleOptions. - * If the value of x is never set, its default value is 1. + * @brief Obtains the scaling factor in the x direction of the scaling parameter object for matrix operations. If the + * value of x is not set, the default value of the scaling factor in the x direction is 1. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleX The scaling factor in the x direction. - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param scaleX Pointer to the scaling factor in the x direction. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetX(const ArkUI_Matrix4ScaleOptions* options, float* scaleX); /** - * @brief Set the scaling factor in the y direction in ArkUI_Matrix4ScaleOptions. + * @brief Sets the scaling factor in the y direction of the scaling parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleY The scaling factor in the y direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param scaleY Scaling factor in the y direction. The value range is (-∞, +∞). + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetY(ArkUI_Matrix4ScaleOptions* options, const float scaleY); /** - * @brief Get the scaling factor in the y direction in ArkUI_Matrix4ScaleOptions. - * If the value of y is never set, its default value is 1. + * @brief Obtains the scaling factor in the y direction of the scaling parameter object for matrix operations. If the + * value of y is not set, the default value of the scaling factor in the y direction is 1. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleY The scaling factor in the y direction. - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param scaleY Pointer to the scaling factor in the y direction. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetY(const ArkUI_Matrix4ScaleOptions* options, float* scaleY); /** - * @brief Set the scaling factor in the z direction in ArkUI_Matrix4ScaleOptions. + * @brief Sets the scaling factor in the z direction of the scaling parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleZ The scaling factor in the z direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param scaleZ Scaling factor in the z direction. The value range is (-∞, +∞). + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetZ(ArkUI_Matrix4ScaleOptions* options, const float scaleZ); /** - * @brief Get the scaling factor in the z direction in ArkUI_Matrix4ScaleOptions. - * If the value of z is never set, its default value is 1. + * @brief Obtains the scaling factor in the z direction of the scaling parameter object for matrix operations. If the + * value of z is not set, the default value of the scaling factor in the z direction is 1. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleZ The scaling factor in the z direction. - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param scaleZ Pointer to the scaling factor in the z direction. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetZ(const ArkUI_Matrix4ScaleOptions* options, float* scaleZ); /** - * @brief Set x offset relative to the transformation center. 0 means no additional x-direction offset from the - * transformation center. The unit is px. + * @brief Sets the x coordinate of the transformation center point of the scaling parameter object for matrix + * operations. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param centerX The x offset relative to the transformation center. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param centerX X-coordinate of the transformation center point. The value range is (-∞, +∞). **0** indicates that + * there is no x-axis offset based on the transformation center. The unit is px. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterX(ArkUI_Matrix4ScaleOptions* options, const float centerX); /** - * @brief Get the value of centerX from the options, which represents the x-direction offset relative to the - * transformation center. The unit is px. If the value of centerX is never set, its default value is 0. + * @brief Obtains the x coordinate of the transformation center point of the scaling parameter object for matrix + * operations. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param centerX The x-direction offset relative to the transformation center. - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param centerX Pointer to the X-coordinate of the transformation center point. The unit is px. The default value is * + * **0**. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterX(const ArkUI_Matrix4ScaleOptions* options, float* centerX); /** - * @brief Set y offset relative to the transformation center. 0 means no additional y-direction offset from the - * transformation center. The unit is px. + * @brief Sets the y coordinate of the transformation center point of the scaling parameter object for matrix + * operations. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param centerY The y offset relative to the transformation center. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param centerY Y-coordinate of the transformation center point. The value range is (-∞, +∞). **0** indicates that + * there is no y-axis offset based on the transformation center. The unit is px. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterY(ArkUI_Matrix4ScaleOptions* options, const float centerY); /** - * @brief Get the value of centerY from the options, which represents the y-direction offset relative to the - * transformation center. The unit is px. If the value of centerY is never set, its default value is 0. + * @brief Obtains the y coordinate of the transformation center point of the scaling parameter object for matrix + * operations. * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param centerY The y-direction offset relative to the transformation center. - * @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 exception occurs. + * @param options Pointer to the scaling parameter object for matrix operations. + * @param centerY Pointer to the Y-coordinate of the transformation center point. The unit is px. The default value is * + * **0**. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterY(const ArkUI_Matrix4ScaleOptions* options, float* centerY); /** - * @brief Defines the rotation options for matrix rotating. + * @brief Defines a matrix rotation object. * * @since 24 */ typedef struct ArkUI_Matrix4RotationOptions ArkUI_Matrix4RotationOptions; /** - * @brief Create an object of ArkUI_Matrix4RotationOptions. - * In the newly created options, the x, y, and z values in the direction vector specifying the rotation axis - * are undetermined; The default values for centerX, centerY are 0; The default value for angle is 0. - * If none of x, y, z are specified, it is equivalent to x=0, y=0, z=1, which means rotation around the z-axis. - * Once any one of x, y, z is specified, the remaining unspecified values are equivalent to 0. + * @brief Creates a pointer to the rotation parameter object for matrix operations. In the newly created object, the + * default value of an x-axis offset (**centerX**) of a single matrix transformation center point relative to a + * component transformation center point, the default value of a y-axis offset (**centerY**) of the single matrix + * transformation center point relative to the component transformation center point, and the default value of a + * rotation angle (**angle**) are 0. If none of the direction vectors in the x, y, and z directions is specified, the + * value is equivalent to x=0, y=0, and z=1, indicating rotation around the z-axis. Once any of the direction vectors + * in the x, y, and z directions is specified, the unspecified values are equivalent to 0. * - * @return Returns a pointer to the newly created ArkUI_Matrix4RotationOptions. + * @return Pointer to the new {@link ArkUI_Matrix4RotationOptions} object. * @since 24 */ ArkUI_Matrix4RotationOptions* OH_ArkUI_Matrix4RotationOptions_Create(); /** - * @brief Disposes the ArkUI_Matrix4RotationOptions object. + * @brief Disposes of the pointer to the rotation parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions instance to be destroyed. + * @param options Pointer to the rotation parameter object for matrix operations. * @since 24 */ void OH_ArkUI_Matrix4RotationOptions_Dispose(ArkUI_Matrix4RotationOptions* options); /** - * @brief Set the value of the direction vector for the x-axis direction in ArkUI_Matrix4RotationOptions. + * @brief Sets the direction vector in the x direction of the rotation parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param x The value of the direction vector for the x-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param x Value of the direction vector in the x direction. The value range is (-∞, +∞). + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetX(ArkUI_Matrix4RotationOptions* options, const float x); /** - * @brief Get the value of the direction vector for the x-axis direction in ArkUI_Matrix4RotationOptions. - * If the value of x is never set, its value will be undefined, so the function will return - * ARKUI_ERROR_CODE_PARAM_INVALID. + * @brief Obtains the direction vector in the x direction of the rotation parameter object for matrix operations. If + * the value of x has never been set, the value is undefined. In this case, {@link ARKUI_ERROR_CODE_PARAM_INVALID} is + * returned. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param x The value of the direction vector for the x-axis direction. - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param x Pointer to the value of the direction vector in the x direction. If the value of x has never been set, the + * value is undefined. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetX(const ArkUI_Matrix4RotationOptions* options, float* x); /** - * @brief Set the value of the direction vector for the y-axis direction in ArkUI_Matrix4RotationOptions. + * @brief Sets the direction vector in the y direction of the rotation parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param y The value of the direction vector for the y-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param y Value of the direction vector in the y direction. The value range is (-∞, +∞). + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetY(ArkUI_Matrix4RotationOptions* options, const float y); /** - * @brief Get the value of the direction vector for the y-axis direction in ArkUI_Matrix4RotationOptions. - * If the value of y is never set, its value will be undefined, so the function will return - * ARKUI_ERROR_CODE_PARAM_INVALID. + * @brief Obtains the direction vector in the y direction of the rotation parameter object for matrix operations. If + * the value of y has never been set, the value is undefined. In this case, {@link ARKUI_ERROR_CODE_PARAM_INVALID} is + * returned. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param y The value of the direction vector for the y-axis direction. - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param y Pointer to the value of the direction vector in the y direction. If the value of y has never been set, the + * value is undefined. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetY(const ArkUI_Matrix4RotationOptions* options, float* y); /** - * @brief Set the value of the direction vector for the z-axis direction in ArkUI_Matrix4RotationOptions. + * @brief Sets the direction vector in the z direction of the rotation parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param z The value of the direction vector for the z-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param z Value of the direction vector in the z direction. The value range is (-∞, +∞). + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetZ(ArkUI_Matrix4RotationOptions* options, const float z); /** - * @brief Get the value of the direction vector for the z-axis direction in ArkUI_Matrix4RotationOptions. - * If the value of z is never set, its value will be undefined, so the function will return - * ARKUI_ERROR_CODE_PARAM_INVALID. + * @brief Obtains the direction vector in the z direction of the rotation parameter object for matrix operations. If + * the value of z has never been set, the value is undefined. In this case, {@link ARKUI_ERROR_CODE_PARAM_INVALID} is + * returned. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param z The value of the direction vector for the z-axis direction. - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param z Pointer to the value of the direction vector in the z direction. If the value of z has never been set, the + * value is undefined. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetZ(const ArkUI_Matrix4RotationOptions* options, float* z); /** - * @brief Set the value of the rotation angle in ArkUI_Matrix4RotationOptions. The unit is degree. + * @brief Sets the rotation angle in the rotation parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param angle The value of the rotation angle in ArkUI_Matrix4RotationOptions. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param angle Value of the rotation angle. The value range is (-∞, +∞). The unit is degree. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetAngle(ArkUI_Matrix4RotationOptions* options, const float angle); /** - * @brief Get the value of the rotation angle in ArkUI_Matrix4RotationOptions. The unit is degree. - * If the value of angle is never set, its default value is 0. + * @brief Obtains the rotation angle in the rotation parameter object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param angle The value of the rotation angle in ArkUI_Matrix4RotationOptions. - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param angle Pointer to the value of the rotation angle. The unit is degree. If the angle has never been set, the + * default value is **0**. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetAngle(const ArkUI_Matrix4RotationOptions* options, float* angle); /** - * @brief Set x offset relative to the transformation center. 0 means no additional x-direction offset from the - * transformation center. The unit is px. + * @brief Sets the x-axis offset of a single matrix transformation center point relative to a component transformation + * center point. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param centerX The x offset relative to the transformation center. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param centerX X-axis offset of a single matrix transformation center point relative to a component transformation + * center point. The value range is (-∞, +∞). **0** indicates that there is no x-axis offset based on the + * transformation center. The unit is px. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterX(ArkUI_Matrix4RotationOptions* options, const float centerX); /** - * @brief Get the value of centerX from the options, which represents the x-direction offset relative to the - * transformation center. The unit is px. If the value of centerX is never set, its default value is 0. + * @brief Obtains the x-axis offset of a single matrix transformation center point relative to a component + * transformation center point. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param centerX The x-direction offset relative to the transformation center. - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param centerX Pointer to the x-axis offset of a single matrix transformation center point relative to a component + * transformation center point. The unit is px. If **centerX** has never been set, the default value is **0**. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterX(const ArkUI_Matrix4RotationOptions* options, float* centerX); /** - * @brief Set y offset relative to the transformation center. 0 means no additional y-direction offset from the - * transformation center. The unit is px. + * @brief Sets the y-axis offset of a single matrix transformation center point relative to a component transformation + * center point. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param centerY The y offset relative to the transformation center. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param centerY Y-axis offset of a single matrix transformation center point relative to a component transformation + * center point. The value range is (-∞, +∞). **0** indicates that there is no y-axis offset based on the + * transformation center. The unit is px. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterY(ArkUI_Matrix4RotationOptions* options, const float centerY); /** - * @brief Get the value of centerY from the options, which represents the y-direction offset relative to the - * transformation center. The unit is px. If the value of centerY is never set, its default value is 0. + * @brief Obtains the y-axis offset of a single matrix transformation center point relative to a component + * transformation center point. * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param centerY The y-direction offset relative to the transformation center. - * @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 exception occurs. + * @param options Pointer to the rotation parameter object for matrix operations. + * @param centerY Pointer to the y-axis offset of a single matrix transformation center point relative to a component + * transformation center point. The unit is px. If **centerY** has never been set, the default value is **0**. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterY(const ArkUI_Matrix4RotationOptions* options, float* centerY); /** - * @brief Defines the translation options for matrix translating. + * @brief Defines a matrix translation object. * * @since 24 */ typedef struct ArkUI_Matrix4TranslationOptions ArkUI_Matrix4TranslationOptions; /** - * @brief Create an object of ArkUI_Matrix4TranslationOptions. - * In the newly created options, the default values for x, y and z are 0. + * @brief Creates a pointer to a translation object for matrix operations. In the newly created object, the default + * translation distances on the x, y, and z axes are 0. * - * @return Returns a pointer to the newly created ArkUI_Matrix4TranslationOptions. + * @return Pointer to the new {@link ArkUI_Matrix4TranslationOptions} object. * @since 24 */ ArkUI_Matrix4TranslationOptions* OH_ArkUI_Matrix4TranslationOptions_Create(); /** - * @brief Disposes the ArkUI_Matrix4TranslationOptions object. + * @brief Disposes of a pointer to a translation object for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions instance to be destroyed. + * @param options Pointer to the {@link ArkUI_Matrix4TranslationOptions} object to be disposed. * @since 24 */ void OH_ArkUI_Matrix4TranslationOptions_Dispose(ArkUI_Matrix4TranslationOptions* options); /** - * @brief Set the translation value in the x-axis direction. The unit is px. - * If the value of x is never set, its default value is 0. + * @brief Sets the translation value of a translation object on the x-axis for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param x The translation value in the x-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the translation parameter object for matrix operations. + * @param x Translation value on the x-axis. The value range is (-∞, +∞). The unit is px. If the value of x has never + * been set, the default value is **0**. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetX(ArkUI_Matrix4TranslationOptions* options, const float x); /** - * @brief Get the translation value in the x-axis direction from ArkUI_Matrix4TranslationOptions. + * @brief Obtains the translation value of a translation object on the x-axis for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param x The translation value in the x-axis direction. - * @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 exception occurs. + * @param options Pointer to the translation parameter object for matrix operations. + * @param x Pointer to the translation value on the x-axis. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4TranslationOptions* options, float* x); /** - * @brief Set the translation value in the y-axis direction. The unit is px. - * If the value of y is never set, its default value is 0. + * @brief Sets the translation value of a translation object on the y-axis for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param y The translation value in the y-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the translation parameter object for matrix operations. + * @param y Translation value on the y-axis. The value range is (-∞, +∞). The unit is px. If the value of y has never + * been set, the default value is **0**. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetY(ArkUI_Matrix4TranslationOptions* options, const float y); /** - * @brief Get the translation value in the y-axis direction from ArkUI_Matrix4TranslationOptions. + * @brief Obtains the translation value of a translation object on the y-axis for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param y The translation value in the y-axis direction. - * @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 exception occurs. + * @param options Pointer to the translation parameter object for matrix operations. + * @param y Pointer to the translation value on the y-axis. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetY(const ArkUI_Matrix4TranslationOptions* options, float* y); /** - * @brief Set the translation value in the z-axis direction. The unit is px. - * If the value of z is never set, its default value is 0. + * @brief Sets the translation value of a translation object on the z-axis for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param z The translation value in the z-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options Pointer to the translation parameter object for matrix operations. + * @param z Translation value on the z-axis. The value range is (-∞, +∞). The unit is px. If the value of z has never + * been set, the default value is **0**. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetZ(ArkUI_Matrix4TranslationOptions* options, const float z); /** - * @brief Get the translation value in the z-axis direction from ArkUI_Matrix4TranslationOptions. + * @brief Obtains the translation value of a translation object on the z-axis for matrix operations. * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param z The translation value in the z-axis direction. - * @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 exception occurs. + * @param options Pointer to the translation parameter object for matrix operations. + * @param z Pointer to the translation value on the z-axis. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetZ(const ArkUI_Matrix4TranslationOptions* options, float* z); /** - * @brief Create an identity matrix4 object. + * @brief Creates a fourth-order identity matrix object. * - * @return Returns the created identity matrix4 object. + * @return Pointer to the created fourth-order identity matrix object. * @since 24 */ ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateIdentity(); /** - * @brief Specify each element of the matrix to create a matrix4 object. + * @brief Creates a fourth-order matrix object by specifying each element of the matrix. * - * @param elements Pointer to the array of expected matrix element data. The length of array should be greater than - * or equal to 16. The parameter must not be null. - * @return Returns the newly created matrix4 object. - * If the pointer of elements is null, the function will return null. + * @param elements Pointer to the array of expected matrix element data. The array length must be greater than or equal + * to 16. This parameter cannot be set to a null pointer. + * @return Pointer to the created fourth-order matrix object. If the **elements** pointer is a null pointer, a null + * value is returned. * @since 24 */ ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateByElements(const float* elements); /** - * @brief Disposes a matrix4 object. + * @brief Disposes of a fourth-order matrix object. * - * @param matrix Pointer to the matrix4 object to be disposed. + * @param matrix Pointer to the fourth-order matrix object to be disposed. * @since 24 */ void OH_ArkUI_Matrix4_Dispose(ArkUI_Matrix4* matrix); /** - * @brief Create a copy of the matrix4 object. + * @brief Creates a copy of a fourth-order matrix object. It is used to perform operations on the same matrix to obtain + * different matrix objects. * - * @param matrix Pointer to the original matrix4 object. - * @return Returns the newly created matrix4 object. + * @param matrix Pointer to the original fourth-order matrix object. + * @return Pointer to the created fourth-order matrix object. * @since 24 */ ArkUI_Matrix4* OH_ArkUI_Matrix4_Copy(const ArkUI_Matrix4* matrix); /** - * @brief Perform an inverse matrix transformation on the input matrix. - * If the matrix is invertible, this function will modify the input matrix; otherwise, the matrix will remain - * unchanged and an error code will be returned. + * @brief Performs an inverse matrix transformation on the input matrix. * - * @param matrix Pointer to the matrix4 object to be inverted. - * @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 the matrix is not invertible. + * @param matrix Pointer to the fourth-order matrix object to be inverted. + * @return Result code. + *
Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. + *
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if the matrix is not invertible. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Invert(ArkUI_Matrix4* matrix); /** - * @brief Combine another matrix with the original matrix, and storing the resulting matrix in oriMatrix. - * The resulting matrix is equivalent to first applying the transformation of oriMatrix and then applying - * the transformation of anotherMatrix. This function will alter the oriMatrix object. + * @brief Combines another matrix with the original matrix and stores the resulting matrix in **oriMatrix**. The + * resulting matrix is equivalent to first applying the transformation of **oriMatrix** and then applying the + * transformation of **anotherMatrix**. This function modifies the **oriMatrix** object. * - * @param oriMatrix Pointer to the original matrix4 object. + * @param oriMatrix Pointer to the original fourth-order matrix object. * @param anotherMatrix Pointer to another matrix object to be combined. - * @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 exception occurs. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Combine(ArkUI_Matrix4* oriMatrix, const ArkUI_Matrix4* anotherMatrix); /** - * @brief Apply a tranlation transformation to the original matrix to obtain the translated matrix. Each translation - * transformation is applied cumulatively. This function will alter the input matrix object. + * @brief Applies a translation transformation to the original matrix to obtain the translated matrix. Each translation + * transformation is cumulative on the previous matrix. The input matrix object is modified after the + * transformation. * - * @param matrix Pointer to the matrix4 object to be translated. - * @param translate Pointer to the translation options. - * @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 exception occurs. + * @param matrix Pointer to the fourth-order matrix object to be translated. + * @param translate Pointer to the translation object. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Translate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4TranslationOptions* translate); /** - * @brief Apply a scale transformation to the original matrix to obtain the scaled matrix. Each scale - * transformation is applied cumulatively. This function will alter the input matrix object. + * @brief Applies a scaling transformation to the original matrix to obtain the scaled matrix. Each scaling + * transformation is cumulative on the previous matrix. This function modifies the input matrix object. * - * @param matrix Pointer to the matrix4 object to be scaled. - * @param scale Pointer to the scale options. - * @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 exception occurs. + * @param matrix Pointer to the fourth-order matrix object to be scaled. + * @param scale Pointer to the scaling object. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Scale(ArkUI_Matrix4* matrix, const ArkUI_Matrix4ScaleOptions* scale); /** - * @brief Apply a rotation transformation to the original matrix to obtain the rotated matrix. Each rotation - * transformation is applied cumulatively. This function will alter the input matrix object. + * @brief Applies a rotation transformation to the original matrix to obtain the rotated matrix. Each rotation + * transformation is cumulative on the previous matrix. This function modifies the input matrix object. * - * @param matrix Pointer to the matrix4 object to be rotated. - * @param rotate Pointer to the rotation options. - * @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 exception occurs. + * @param matrix Pointer to the fourth-order matrix object to be rotated. + * @param rotate Pointer to the rotation object. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Rotate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4RotationOptions* rotate); /** - * @brief Apply a skew transformation to the original matrix to obtain the skewed matrix. Each skew - * transformation is applied cumulatively. This function will alter the input matrix object. + * @brief Applies a skew transformation to the original matrix to obtain the skewed matrix. Each skew transformation is + * cumulative on the previous matrix. The input matrix object is modified after the transformation. * - * @param matrix Pointer to the matrix4 object to be skewed. It must not be null. + * @param matrix Pointer to the fourth-order matrix object to be skewed. * @param skewX Skew coefficient in the x direction. * @param skewY Skew coefficient in the y direction. - * @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 exception occurs. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Skew(ArkUI_Matrix4* matrix, const float skewX, const float skewY); /** - * @brief Calculate the new coordinate position of a point after it has been transformed by a matrix. - * The calculated transformed coordinate point will be filled into the ArkUI_PointF structure - * pointed to by result. + * @brief Calculates the new coordinate position of a point after it is transformed by a matrix. * - * @param matrix Pointer to the matrix4 object. + * @param matrix Pointer to the fourth-order matrix object. * @param oriPoint Pointer to the original coordinate point. - * @param result Pointer to the result point. It must not be null. - * @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 exception occurs. + * @param result Pointer to the result point. This parameter cannot be set to a null pointer. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_TransformPoint(const ArkUI_Matrix4* matrix, const ArkUI_PointF* oriPoint, ArkUI_PointF* result); /** - * @brief Map the vertex coordinates of one polygon to the vertex coordinates of another polygon, and calculate the required - * matrix. The resulting matrix will be filled into the object pointed to by matrix. - * - * @param matrix Pointer to the original matrix4 object. The result matrix will be filled into the object pointed to by it. - * It must not be null. - * @param src Pointer to the array of original polygon coordinate points. The array should be at least as long as pointCount. - * @param dst Pointer to the array of polygon coordinate points after mapping. The array should be at least as long as pointCount. - * @param pointCount The number of polygon points, which must be one of the values 0, 1, 2, 3, or 4. - * @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 exception occurs. + * @brief Maps the vertex coordinates of one polygon to the vertex coordinates of another polygon and calculates the + * required matrix. + * + * @param matrix Pointer to the fourth-order matrix object, which is used to store the result matrix. + * @param src Pointer to the array of original polygon coordinate points. The array length must be at least + * **pointCount**. + * @param dst Pointer to the array of mapped polygon coordinate points. The array length must be at least **pointCount**. + * @param pointCount Number of polygon points, which must be one of the values 0, 1, 2, 3, or 4. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_SetPolyToPoly(ArkUI_Matrix4* matrix, const ArkUI_PointF* src, const ArkUI_PointF* dst, const uint32_t pointCount); /** - * @brief Obtain the 16 elements of the matrix and fill them into the array pointed to by result. - * The array pointed to by result must have space for 16 float elements. + * @brief Obtains the 16 elements of the fourth-order matrix. * - * @param matrix Pointer to the original matrix4 object. - * @param result Pointer to an array that can hold 16 floating-point numbers. It must not be null. - * @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 exception occurs. + * @param matrix Pointer to the fourth-order matrix object. + * @param result Pointer to an array that can hold 16 floating-point numbers. This parameter cannot be set to a null + * pointer. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_GetElements(const ArkUI_Matrix4* matrix, float* result); diff --git a/zh-cn/arkui/ace_engine/native/native_type_visual.h b/zh-cn/arkui/ace_engine/native/native_type_visual.h index 6783ee899..73557421b 100644 --- a/zh-cn/arkui/ace_engine/native/native_type_visual.h +++ b/zh-cn/arkui/ace_engine/native/native_type_visual.h @@ -818,205 +818,196 @@ } ArkUI_ScaleOptions; /** - * @brief Defines the rotation options for component transition. + * @brief 定义组件转场时的旋转效果对象。 * * @since 12 */ typedef struct { /** - * X-component of the rotation vector. + * 横向的旋转向量分量。 */ float x; /** - * Y-component of the rotation vector. + * 纵向的旋转向量分量。 */ float y; /** - * Z-component of the rotation vector. + * 竖向的旋转向量分量。 */ float z; /** - * Rotation angle. + * 旋转角度。取值范围:(-∞, +∞)。取值为正时相对于旋转轴方向顺时针转动,取值为负时相对于旋转轴方向逆时针转动。 */ float angle; /** - * X coordinate of the center point. + * 变换中心点x轴坐标。表示组件变换中心点(即锚点)的x方向坐标,单位为vp。 */ float centerX; /** - * Y coordinate of the center point. + * 变换中心点y轴坐标。表示组件变换中心点(即锚点)的y方向坐标,单位为vp。 */ float centerY; /** - * Z-axis anchor, that is, the z-component of the 3D rotation center point. + * z轴锚点,即3D旋转中心点的z轴分量,单位为px。 */ float centerZ; /** - * Distance from the user to the z=0 plane. + * 视距,即视点到z=0平面的距离,单位为px。 */ float perspective; } ArkUI_RotationOptions; /** - * @brief Defines shadow options. + * @brief 定义阴影选项对象。 * * @since 24 */ typedef struct OH_ArkUI_ShadowOptions OH_ArkUI_ShadowOptions; /** - * @brief Defines the motion path options for path animation. + * @brief 定义路径动画的运动路径配置项。 * * @since 23 */ typedef struct ArkUI_MotionPathOptions ArkUI_MotionPathOptions; /** - * @brief Create an object of the motion path options for path animation. - * In the newly created ArkUI_MotionPathOptions, the "path" value is an empty string, the "from" value is 0, - * the "to" value is 1, and the "rotatable" value is false. + * @brief 创建路径动画的运动路径配置项。 * - * @return A pointer to the ArkUI_MotionPathOptions. + * @return 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + *
新建的{@link ArkUI_MotionPathOptions}对象中,路径动画的运动路径path值为空字符串,路径动画起点进度from值为0,路径动画终点进度to值为1, + * 组件是否沿路径旋转rotatable值为false。 * @since 23 */ ArkUI_MotionPathOptions* OH_ArkUI_MotionPathOptions_Create(); /** - * @brief Dispose the ArkUI_MotionPathOptions object. + * @brief 销毁路径动画的运动路径配置项。 * - * @param options Pointer to the ArkUI_MotionPathOptions object to be disposed. + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 * @since 23 */ void OH_ArkUI_MotionPathOptions_Dispose(ArkUI_MotionPathOptions* options); /** - * @brief Sets the the motion path for the animation using an SVG path string. The path supports using "start" and - * "end" as placeholders for the starting and ending points, for example: - * "Mstart.x start.y L50 50 Lend.x end.y Z". Refer to the SVG path format for the path string. - * When set to an empty string, it is equivalent to not setting a path animation. + * @brief 设置路径动画的运动路径。 * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param svgPath The motion path for the path animation. - * @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 exception occurs. + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param svgPath 路径动画的运动路径字符串。 + *
该路径支持使用"start"和"end"作为起点和终点的占位符,例如:"Mstart.x start.y L50 50 Lend.x end.y Z"。路径字符串格式请参考{@link 绘制路径}。若设置为空字符串, + * 等效于未设置路径动画。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* options, const char* svgPath); /** - * @brief Gets the motion path string in the ArkUI_MotionPathOptions object. + * @brief 获取路径动画的运动路径配置项中存储的运动路径字符串。 * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param svgPathBuffer Buffer pointer to the motion path string. - * @param bufferSize The buffer size of the svgPathBuffer parameter. - * @param writeLength Indicates the string length actually written to the buffer - * when returning {@link ARKUI_ERROR_CODE_NO_ERROR}. - * Indicates the minimum buffer size that can accommodate the target - * when {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} is returned. - * @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 exception occurs. - * Returns {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the buffer size is less than the minimum buffer size. + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param svgPathBuffer 存储运动路径字符串的缓冲区指针。 + * @param bufferSize svgPathBuffer参数的缓冲区大小。 + * @param writeLength 返回{@link ARKUI_ERROR_CODE_NO_ERROR}时,表示实际写入缓冲区的字符串长度。 + *
返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}时,表示如果为入参异常,writeLength不会被赋值,如果为拷贝异常,writeLength为可容纳目标字符串的最小缓冲区大小。 + *
返回{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR}时,表示可容纳目标字符串的最小缓冲区大小。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + *
{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} 缓冲区大小不足。 * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions* options, char* svgPathBuffer, const int32_t bufferSize, int32_t* writeLength); /** - * @brief Sets the starting progress in the ArkUI_MotionPathOptions. Progress refers to the ratio of the length of the - * path that has been traveled to the total length of the entire path. The value range is [0.0, 1.0], and the - * "from" value should be less than or equal to the "to" value; otherwise, an ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE - * error code will be returned. + * @brief 设置路径动画起点进度。进度指已移动路径长度与总路径长度的比值。 * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param from The starting progress in the ArkUI_MotionPathOptions. - * @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 exception occurs. - * Returns {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if the "from" value is out of range or the "from" value - * is greater than the "to" value. + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param from 路径动画的起点进度,取值范围为[0.0, 1.0],且需满足from小于或等于终点进度to,否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 + *
to的含义参考{@link OH_ArkUI_MotionPathOptions_SetTo}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} from超出[0.0, 1.0]范围,或from大于终点进度to。 * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* options, const float from); /** - * @brief Gets the starting progress in the ArkUI_MotionPathOptions object. + * @brief 获取路径动画的运动路径配置项中的路径动画起点进度。 * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param from The starting progress in the ArkUI_MotionPathOptions. - * @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 exception occurs. + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param from 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中起点进度值的指针。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions* options, float* from); /** - * @brief Sets the endpoint progress in the ArkUI_MotionPathOptions. Progress refers to the ratio of the length of the - * path that has been traveled to the total length of the entire path. The value range is [0.0, 1.0], and the - * "from" value should be less than or equal to the "to" value; otherwise, an ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE - * error code will be returned. + * @brief 设置路径动画终点进度。进度指已移动路径长度与总路径长度的比值。 * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param to The endpoint progress in the ArkUI_MotionPathOptions. - * @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 exception occurs. - * Returns {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if the "to" value is out of range or the "to" value - * is less than the "from" value. + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param to 路径动画的终点进度,取值范围为[0.0, 1.0],且需满足to大或等于起点进度from;否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 + *
from的含义参考{@link OH_ArkUI_MotionPathOptions_SetFrom}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} to超出[0.0, 1.0]范围,或to小于起点进度from。 * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* options, const float to); /** - * @brief Gets the endpoint progress in the ArkUI_MotionPathOptions object. + * @brief 获取路径动画的运动路径配置项中的路径动画终点进度。 * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param to The endpoint progress in the ArkUI_MotionPathOptions. - * @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 exception occurs. + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param to 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中终点进度值的指针。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* options, float* to); /** - * @brief Sets the rotatable parameter in the ArkUI_MotionPathOptions. It indicates whether to rotate along the path. - * True means rotating along the path, while false means not rotating along the path. + * @brief 设置组件是否沿运动路径旋转。 * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param rotatable The rotatable parameter in the ArkUI_MotionPathOptions. - * @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 exception occurs. + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param rotatable 组件是否沿路径旋转。true表示组件沿路径旋转;false表示组件不沿路径旋转。默认值:false。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* options, const bool rotatable); /** - * @brief Gets the rotatable parameter in the ArkUI_MotionPathOptions. + * @brief 获取组件是否沿运动路径旋转。 * - * @param options Pointer to the ArkUI_MotionPathOptions object. - * @param rotatable The rotatable parameter in the ArkUI_MotionPathOptions. - * @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 exception occurs. + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param rotatable 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中rotatable参数值的指针,表示组件是否沿路径旋转。 + *
true表示组件沿路径旋转;false表示组件不沿路径旋转。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 * @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetRotatable(const ArkUI_MotionPathOptions* options, bool* rotatable); /** - * @brief Create a shadow options object. - * When the object is no longer in use, invoke {@link OH_ArkUI_ShadowOptions_Destroy} to destroy it. + * @brief 创建一个阴影选项对象。当该对象不再使用时,请调用{@link OH_ArkUI_ShadowOptions_Destroy}销毁。 * - * @return A pointer to the shadow options object. + * @return 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 * @since 24 */ OH_ArkUI_ShadowOptions* OH_ArkUI_ShadowOptions_Create(); /** - * @brief Destroys the shadow options object. + * @brief 销毁阴影选项对象。 * * @param options Pointer to the object to be destroyed. * @since 24 @@ -1024,516 +1015,491 @@ void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); /** - * @brief Sets blur radius of the shadow options. + * @brief 设置阴影选项的模糊半径。 * - * @param options shadow options. - * @param radius blur radius of the shadow. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param radius 阴影的模糊半径,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options, float radius); /** - * @brief Gets blur radius of the shadow options. + * @brief 获取阴影选项的模糊半径。 * - * @param options shadow options. - * @param radius blur radius of the shadow. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param radius 阴影的模糊半径,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options, float* radius); /** - * @brief Set shadow type of the shadow options. + * @brief 设置阴影选项的阴影类型。 * - * @param options shadow options. - * @param type shadow type. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param type 阴影类型{@link ArkUI_ShadowType}。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType type); /** - * @brief Get shadow type of the shadow options. + * @brief 获取阴影选项的阴影类型。 * - * @param options shadow options. - * @param type shadow type. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param type 阴影类型{@link ArkUI_ShadowType}。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType* type); /** - * @brief Set shadow color of the shadow options. + * @brief 设置阴影选项的阴影颜色。 * - * @param options shadow options. - * @param color shadow color. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param color 阴影颜色,0xARGB格式。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, uint32_t color); /** - * @brief Get shadow color of the shadow options. + * @brief 获取阴影选项的阴影颜色。 * - * @param options shadow options. - * @param color shadow color. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param color 阴影颜色,0xARGB格式。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, uint32_t* color); /** - * @brief Set offset of the shadow along the x-axis. + * @brief 设置阴影在x轴上的偏移量。 * - * @param options shadow options. - * @param offsetX offset of the shadow along the x-axis. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetX 阴影在x轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* options, float offsetX); /** - * @brief Get offset of the shadow along the x-axis. + * @brief 获取阴影在x轴上的偏移量。 * - * @param options shadow options. - * @param offsetX offset of the shadow along the x-axis. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetX 阴影在x轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* options, float* offsetX); /** - * @brief Set offset of the shadow along the y-axis. + * @brief 设置阴影在y轴上的偏移量。 * - * @param options shadow options. - * @param offsetY offset of the shadow along the y-axis. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetY 阴影在y轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* options, float offsetY); /** - * @brief Get offset of the shadow along the y-axis. + * @brief 获取阴影在y轴上的偏移量。 * - * @param options shadow options. - * @param offsetY offset of the shadow along the y-axis. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetY 阴影在y轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* options, float* offsetY); /** - * @brief Set whether to fill the inside of the component with shadow. + * @brief 设置是否用阴影填充组件内部。 * - * @param options shadow options. - * @param isFill whether to fill the inside of the component with shadow. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。默认值为false。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, bool isFill); /** - * @brief Get whether to fill the inside of the component with shadow. + * @brief 获取是否用阴影填充组件内部。 * - * @param options shadow options. - * @param isFill whether to fill the inside of the component with shadow. - * @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 exception occurs. + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetFill(OH_ArkUI_ShadowOptions* options, bool* isFill); /** - * @brief Defines the scale options for matrix scaling. + * @brief 定义矩阵缩放的缩放对象。 * * @since 24 */ typedef struct ArkUI_Matrix4ScaleOptions ArkUI_Matrix4ScaleOptions; /** - * @brief Create an object of ArkUI_Matrix4ScaleOptions. - * In the newly created options, the default values for the scaling coefficients in the x, y and z directions - * are 1, and the default values for centerX, centerY are 0. + * @brief 创建指向矩阵运算的缩放参数对象的指针。在新创建的对象中,x、y和z轴方向的缩放系数默认值,为1。变换中心点的x轴坐标centerX、变换中心点的y轴坐标centerY取默认值,为0。 * - * @return Returns a pointer to the newly created ArkUI_Matrix4ScaleOptions. + * @return 返回指向新创建的{@link ArkUI_Matrix4ScaleOptions}的指针。 * @since 24 */ ArkUI_Matrix4ScaleOptions* OH_ArkUI_Matrix4ScaleOptions_Create(); /** - * @brief Disposes the ArkUI_Matrix4ScaleOptions object. + * @brief 销毁指向矩阵运算的缩放参数对象的指针。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions instance to be destroyed. + * @param options 指向要销毁的{@link ArkUI_Matrix4ScaleOptions}对象的指针。 * @since 24 */ void OH_ArkUI_Matrix4ScaleOptions_Dispose(ArkUI_Matrix4ScaleOptions* options); /** - * @brief Set the scaling factor in the x direction in ArkUI_Matrix4ScaleOptions. + * @brief 设置矩阵运算的缩放参数对象x方向的缩放因子。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleX The scaling factor in the x direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleX x方向的缩放因子。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetX(ArkUI_Matrix4ScaleOptions* options, const float scaleX); /** - * @brief Get the scaling factor in the x direction in ArkUI_Matrix4ScaleOptions. - * If the value of x is never set, its default value is 1. + * @brief 获取矩阵运算的缩放参数对象x方向的缩放因子。如果从未设置x的值,则x方向的缩放因子默认值为1。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleX The scaling factor in the x direction. - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleX x方向的缩放因子。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetX(const ArkUI_Matrix4ScaleOptions* options, float* scaleX); /** - * @brief Set the scaling factor in the y direction in ArkUI_Matrix4ScaleOptions. + * @brief 设置矩阵运算的缩放参数对象y方向的缩放因子。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleY The scaling factor in the y direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleY y方向的缩放因子。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetY(ArkUI_Matrix4ScaleOptions* options, const float scaleY); /** - * @brief Get the scaling factor in the y direction in ArkUI_Matrix4ScaleOptions. - * If the value of y is never set, its default value is 1. + * @brief 获取矩阵运算的缩放参数对象y方向的缩放因子。如果从未设置y的值,则y方向的缩放因子默认值为1。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleY The scaling factor in the y direction. - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleY y方向的缩放因子。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetY(const ArkUI_Matrix4ScaleOptions* options, float* scaleY); /** - * @brief Set the scaling factor in the z direction in ArkUI_Matrix4ScaleOptions. + * @brief 设置矩阵运算的缩放参数对象z方向的缩放因子。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleZ The scaling factor in the z direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleZ z方向的缩放因子。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetZ(ArkUI_Matrix4ScaleOptions* options, const float scaleZ); /** - * @brief Get the scaling factor in the z direction in ArkUI_Matrix4ScaleOptions. - * If the value of z is never set, its default value is 1. + * @brief 获取矩阵运算的缩放参数对象z方向的缩放因子。如果从未设置z的值,则z方向的缩放因子默认值为1。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param scaleZ The scaling factor in the z direction. - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleZ z方向的缩放因子。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetZ(const ArkUI_Matrix4ScaleOptions* options, float* scaleZ); /** - * @brief Set x offset relative to the transformation center. 0 means no additional x-direction offset from the - * transformation center. The unit is px. + * @brief 设置矩阵运算的缩放参数对象变换中心点的x轴坐标。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param centerX The x offset relative to the transformation center. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerX 变换中心点的x轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterX(ArkUI_Matrix4ScaleOptions* options, const float centerX); /** - * @brief Get the value of centerX from the options, which represents the x-direction offset relative to the - * transformation center. The unit is px. If the value of centerX is never set, its default value is 0. + * @brief 获取矩阵运算的缩放参数对象变换中心点的x轴坐标。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param centerX The x-direction offset relative to the transformation center. - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerX 变换中心点的x轴坐标。单位为px。默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterX(const ArkUI_Matrix4ScaleOptions* options, float* centerX); /** - * @brief Set y offset relative to the transformation center. 0 means no additional y-direction offset from the - * transformation center. The unit is px. + * @brief 设置矩阵运算的缩放参数对象变换中心点的y轴坐标。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param centerY The y offset relative to the transformation center. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerY 变换中心点的y轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterY(ArkUI_Matrix4ScaleOptions* options, const float centerY); /** - * @brief Get the value of centerY from the options, which represents the y-direction offset relative to the - * transformation center. The unit is px. If the value of centerY is never set, its default value is 0. + * @brief 获取矩阵运算的缩放参数对象变换中心点的y轴坐标。 * - * @param options Pointer to the ArkUI_Matrix4ScaleOptions object. - * @param centerY The y-direction offset relative to the transformation center. - * @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 exception occurs. + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerY 变换中心点的y轴坐标。单位为px。默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterY(const ArkUI_Matrix4ScaleOptions* options, float* centerY); /** - * @brief Defines the rotation options for matrix rotating. + * @brief 定义矩阵旋转的旋转对象。 * * @since 24 */ typedef struct ArkUI_Matrix4RotationOptions ArkUI_Matrix4RotationOptions; /** - * @brief Create an object of ArkUI_Matrix4RotationOptions. - * In the newly created options, the x, y, and z values in the direction vector specifying the rotation axis - * are undetermined; The default values for centerX, centerY are 0; The default value for angle is 0. - * If none of x, y, z are specified, it is equivalent to x=0, y=0, z=1, which means rotation around the z-axis. - * Once any one of x, y, z is specified, the remaining unspecified values are equivalent to 0. + * @brief 创建矩阵运算的旋转参数对象的指针。在新创建的对象中,单次矩阵变换中心点相对于组件变换中心点的x轴偏移值centerX、单次矩阵变换中心点相对于组件变换中心点的y轴偏移值centerY、旋转角度angle的默认值,为0。 + * 如果未指定x、y、z方向的方向向量中的任何一个,则等同于x=0、y=0、z=1,表示绕z轴旋转。一旦指定了x、y、z方向的方向向量中的任意一个,其余未指定的值等同于0。 * - * @return Returns a pointer to the newly created ArkUI_Matrix4RotationOptions. + * @return 返回指向新创建的{@link ArkUI_Matrix4RotationOptions}的指针 * @since 24 */ ArkUI_Matrix4RotationOptions* OH_ArkUI_Matrix4RotationOptions_Create(); /** - * @brief Disposes the ArkUI_Matrix4RotationOptions object. + * @brief 销毁指向矩阵运算的旋转参数对象的指针。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions instance to be destroyed. + * @param options 指向矩阵运算的旋转参数对象的指针。 * @since 24 */ void OH_ArkUI_Matrix4RotationOptions_Dispose(ArkUI_Matrix4RotationOptions* options); /** - * @brief Set the value of the direction vector for the x-axis direction in ArkUI_Matrix4RotationOptions. + * @brief 设置矩阵运算的旋转参数对象x方向的方向向量。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param x The value of the direction vector for the x-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param x x轴方向的方向向量的值。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetX(ArkUI_Matrix4RotationOptions* options, const float x); /** - * @brief Get the value of the direction vector for the x-axis direction in ArkUI_Matrix4RotationOptions. - * If the value of x is never set, its value will be undefined, so the function will return - * ARKUI_ERROR_CODE_PARAM_INVALID. + * @brief 获取矩阵运算的旋转参数对象x方向的方向向量。如果从未设置过x值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param x The value of the direction vector for the x-axis direction. - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param x x轴方向的方向向量的值。如果从未设置x的值,其值将未定义。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetX(const ArkUI_Matrix4RotationOptions* options, float* x); /** - * @brief Set the value of the direction vector for the y-axis direction in ArkUI_Matrix4RotationOptions. + * @brief 设置矩阵运算的旋转参数对象y方向的方向向量。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param y The value of the direction vector for the y-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param y y轴方向的方向向量的值。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetY(ArkUI_Matrix4RotationOptions* options, const float y); /** - * @brief Get the value of the direction vector for the y-axis direction in ArkUI_Matrix4RotationOptions. - * If the value of y is never set, its value will be undefined, so the function will return - * ARKUI_ERROR_CODE_PARAM_INVALID. + * @brief 获取矩阵运算的旋转参数对象y方向的方向向量。如果从未设置过y值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param y The value of the direction vector for the y-axis direction. - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param y y轴方向的方向向量的值。如果从未设置y的值,其值将未定义。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetY(const ArkUI_Matrix4RotationOptions* options, float* y); /** - * @brief Set the value of the direction vector for the z-axis direction in ArkUI_Matrix4RotationOptions. + * @brief 设置矩阵运算的旋转参数对象z方向的方向向量。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param z The value of the direction vector for the z-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param z z轴方向的方向向量的值。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetZ(ArkUI_Matrix4RotationOptions* options, const float z); /** - * @brief Get the value of the direction vector for the z-axis direction in ArkUI_Matrix4RotationOptions. - * If the value of z is never set, its value will be undefined, so the function will return - * ARKUI_ERROR_CODE_PARAM_INVALID. + * @brief 获取矩阵运算的旋转参数对象z方向的方向向量。如果从未设置过z值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param z The value of the direction vector for the z-axis direction. - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param z z轴方向的方向向量的值。如果从未设置z的值,其值将未定义。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetZ(const ArkUI_Matrix4RotationOptions* options, float* z); /** - * @brief Set the value of the rotation angle in ArkUI_Matrix4RotationOptions. The unit is degree. + * @brief 设置矩阵运算的旋转参数对象中旋转角度的值。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param angle The value of the rotation angle in ArkUI_Matrix4RotationOptions. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param angle 旋转角度的值。取值范围:(-∞, +∞)。单位为度。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetAngle(ArkUI_Matrix4RotationOptions* options, const float angle); /** - * @brief Get the value of the rotation angle in ArkUI_Matrix4RotationOptions. The unit is degree. - * If the value of angle is never set, its default value is 0. + * @brief 获取矩阵运算的旋转参数对象中旋转角度的值。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param angle The value of the rotation angle in ArkUI_Matrix4RotationOptions. - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param angle 旋转角度的值。单位为度。如果从未设置angle的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetAngle(const ArkUI_Matrix4RotationOptions* options, float* angle); /** - * @brief Set x offset relative to the transformation center. 0 means no additional x-direction offset from the - * transformation center. The unit is px. + * @brief 设置单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param centerX The x offset relative to the transformation center. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterX(ArkUI_Matrix4RotationOptions* options, const float centerX); /** - * @brief Get the value of centerX from the options, which represents the x-direction offset relative to the - * transformation center. The unit is px. If the value of centerX is never set, its default value is 0. + * @brief 获取单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param centerX The x-direction offset relative to the transformation center. - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。单位为px。如果从未设置centerX的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterX(const ArkUI_Matrix4RotationOptions* options, float* centerX); /** - * @brief Set y offset relative to the transformation center. 0 means no additional y-direction offset from the - * transformation center. The unit is px. + * @brief 设置单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param centerY The y offset relative to the transformation center. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterY(ArkUI_Matrix4RotationOptions* options, const float centerY); /** - * @brief Get the value of centerY from the options, which represents the y-direction offset relative to the - * transformation center. The unit is px. If the value of centerY is never set, its default value is 0. + * @brief 获取单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 * - * @param options Pointer to the ArkUI_Matrix4RotationOptions object. - * @param centerY The y-direction offset relative to the transformation center. - * @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 exception occurs. + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。单位为px。如果从未设置centerY的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterY(const ArkUI_Matrix4RotationOptions* options, float* centerY); /** - * @brief Defines the translation options for matrix translating. + * @brief 定义矩阵平移的平移对象。 * * @since 24 */ typedef struct ArkUI_Matrix4TranslationOptions ArkUI_Matrix4TranslationOptions; /** - * @brief Create an object of ArkUI_Matrix4TranslationOptions. - * In the newly created options, the default values for x, y and z are 0. + * @brief 创建指向矩阵运算的平移对象的指针。在新创建的对象中,x轴的平移距离x、y轴的平移距离y和z轴的平移距离z的默认值为0。 * - * @return Returns a pointer to the newly created ArkUI_Matrix4TranslationOptions. + * @return 返回指向新创建的{@link ArkUI_Matrix4TranslationOptions}的指针。 * @since 24 */ ArkUI_Matrix4TranslationOptions* OH_ArkUI_Matrix4TranslationOptions_Create(); /** - * @brief Disposes the ArkUI_Matrix4TranslationOptions object. + * @brief 销毁指向矩阵运算的平移对象的指针。 * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions instance to be destroyed. + * @param options 指向要销毁的{@link ArkUI_Matrix4TranslationOptions}对象的指针。 * @since 24 */ void OH_ArkUI_Matrix4TranslationOptions_Dispose(ArkUI_Matrix4TranslationOptions* options); /** - * @brief Set the translation value in the x-axis direction. The unit is px. - * If the value of x is never set, its default value is 0. + * @brief 设置矩阵运算的平移对象x轴方向的平移值。 * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param x The translation value in the x-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param x x轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置x的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetX(ArkUI_Matrix4TranslationOptions* options, const float x); @@ -1551,211 +1517,194 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4TranslationOptions* options, float* x); /** - * @brief Set the translation value in the y-axis direction. The unit is px. - * If the value of y is never set, its default value is 0. + * @brief 设置矩阵运算的平移对象y轴方向的平移值。 * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param y The translation value in the y-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param y y轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置y的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetY(ArkUI_Matrix4TranslationOptions* options, const float y); /** - * @brief Get the translation value in the y-axis direction from ArkUI_Matrix4TranslationOptions. + * @brief 获取矩阵运算的平移对象y轴方向的平移值。 * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param y The translation value in the y-axis direction. - * @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 exception occurs. + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param y y轴方向的平移值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetY(const ArkUI_Matrix4TranslationOptions* options, float* y); /** - * @brief Set the translation value in the z-axis direction. The unit is px. - * If the value of z is never set, its default value is 0. + * @brief 设置矩阵运算的平移对象z轴方向的平移值。 * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param z The translation value in the z-axis direction. Value range: (-∞, +∞). - * @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 exception occurs. + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param z z轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置z的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetZ(ArkUI_Matrix4TranslationOptions* options, const float z); /** - * @brief Get the translation value in the z-axis direction from ArkUI_Matrix4TranslationOptions. + * @brief 获取矩阵运算的平移对象z轴方向的平移值。 * - * @param options Pointer to the ArkUI_Matrix4TranslationOptions object. - * @param z The translation value in the z-axis direction. - * @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 exception occurs. + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param z z轴方向的平移值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetZ(const ArkUI_Matrix4TranslationOptions* options, float* z); /** - * @brief Create an identity matrix4 object. + * @brief 创建一个单位四阶矩阵对象。 * - * @return Returns the created identity matrix4 object. + * @return 返回指向创建的单位四阶矩阵对象的指针。 * @since 24 */ ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateIdentity(); /** - * @brief Specify each element of the matrix to create a matrix4 object. + * @brief 通过指定矩阵的每个元素来创建一个四阶矩阵对象。 * - * @param elements Pointer to the array of expected matrix element data. The length of array should be greater than - * or equal to 16. The parameter must not be null. - * @return Returns the newly created matrix4 object. - * If the pointer of elements is null, the function will return null. + * @param elements 指向预期矩阵元素数据的数组指针。数组长度应大于或等于16。该参数不可为空指针。 + * @return 返回新创建的四阶矩阵对象。如果elements指针为空,函数将返回空值。 * @since 24 */ ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateByElements(const float* elements); /** - * @brief Disposes a matrix4 object. + * @brief 销毁矩阵对象的指针。 * - * @param matrix Pointer to the matrix4 object to be disposed. + * @param matrix 指向要销毁的四阶矩阵对象的指针。 * @since 24 */ void OH_ArkUI_Matrix4_Dispose(ArkUI_Matrix4* matrix); /** - * @brief Create a copy of the matrix4 object. + * @brief 创建四阶矩阵对象的副本。用于对同一个矩阵进行操作以此获取不同矩阵对象。 * - * @param matrix Pointer to the original matrix4 object. - * @return Returns the newly created matrix4 object. + * @param matrix 指向原始四阶矩阵对象的指针。 + * @return 返回新创建的四阶矩阵对象。 * @since 24 */ ArkUI_Matrix4* OH_ArkUI_Matrix4_Copy(const ArkUI_Matrix4* matrix); /** - * @brief Perform an inverse matrix transformation on the input matrix. - * If the matrix is invertible, this function will modify the input matrix; otherwise, the matrix will remain - * unchanged and an error code will be returned. + * @brief 对输入矩阵执行逆矩阵变换。 * - * @param matrix Pointer to the matrix4 object to be inverted. - * @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 the matrix is not invertible. + * @param matrix 指向要逆矩阵变换的四阶矩阵对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Invert(ArkUI_Matrix4* matrix); /** - * @brief Combine another matrix with the original matrix, and storing the resulting matrix in oriMatrix. - * The resulting matrix is equivalent to first applying the transformation of oriMatrix and then applying - * the transformation of anotherMatrix. This function will alter the oriMatrix object. + * @brief 将另一个矩阵与原始矩阵合并,并将结果矩阵存储在oriMatrix中。结果矩阵相当于先应用oriMatrix的变换,然后再应用anotherMatrix的变换。此函数将修改oriMatrix对象。 * - * @param oriMatrix Pointer to the original matrix4 object. - * @param anotherMatrix Pointer to another matrix object to be combined. - * @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 exception occurs. + * @param oriMatrix 指向原始四阶矩阵对象的指针。 + * @param anotherMatrix 指向要合并的另一个矩阵对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Combine(ArkUI_Matrix4* oriMatrix, const ArkUI_Matrix4* anotherMatrix); /** - * @brief Apply a tranlation transformation to the original matrix to obtain the translated matrix. Each translation - * transformation is applied cumulatively. This function will alter the input matrix object. + * @brief 对原始矩阵应用平移变换以获取平移后的矩阵。每次平移变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 * - * @param matrix Pointer to the matrix4 object to be translated. - * @param translate Pointer to the translation options. - * @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 exception occurs. + * @param matrix 指向待平移四阶矩阵对象的指针。 + * @param translate 指向平移对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Translate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4TranslationOptions* translate); /** - * @brief Apply a scale transformation to the original matrix to obtain the scaled matrix. Each scale - * transformation is applied cumulatively. This function will alter the input matrix object. + * @brief 对原始矩阵应用缩放变换以获取缩放后的矩阵。每次缩放变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 * - * @param matrix Pointer to the matrix4 object to be scaled. - * @param scale Pointer to the scale options. - * @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 exception occurs. + * @param matrix 指向待缩放四阶矩阵对象的指针。 + * @param scale 指向缩放对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Scale(ArkUI_Matrix4* matrix, const ArkUI_Matrix4ScaleOptions* scale); /** - * @brief Apply a rotation transformation to the original matrix to obtain the rotated matrix. Each rotation - * transformation is applied cumulatively. This function will alter the input matrix object. + * @brief 对原始矩阵应用旋转变换以获取旋转后的矩阵。每次旋转变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 * - * @param matrix Pointer to the matrix4 object to be rotated. - * @param rotate Pointer to the rotation options. - * @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 exception occurs. + * @param matrix 指向待旋转四阶矩阵对象的指针。 + * @param rotate 指向旋转对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Rotate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4RotationOptions* rotate); /** - * @brief Apply a skew transformation to the original matrix to obtain the skewed matrix. Each skew - * transformation is applied cumulatively. This function will alter the input matrix object. + * @brief 对原始矩阵应用倾斜变换以获取倾斜后的矩阵。每次倾斜变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 * - * @param matrix Pointer to the matrix4 object to be skewed. It must not be null. - * @param skewX Skew coefficient in the x direction. - * @param skewY Skew coefficient in the y direction. - * @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 exception occurs. + * @param matrix 指向待倾斜四阶矩阵对象的指针。 + * @param skewX x方向的倾斜系数。 + * @param skewY y方向的倾斜系数。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Skew(ArkUI_Matrix4* matrix, const float skewX, const float skewY); /** - * @brief Calculate the new coordinate position of a point after it has been transformed by a matrix. - * The calculated transformed coordinate point will be filled into the ArkUI_PointF structure - * pointed to by result. + * @brief 计算一个点经过矩阵变换后的新坐标位置。 * - * @param matrix Pointer to the matrix4 object. - * @param oriPoint Pointer to the original coordinate point. - * @param result Pointer to the result point. It must not be null. - * @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 exception occurs. + * @param matrix 指向四阶矩阵对象的指针。 + * @param oriPoint 指向原始坐标点的指针。 + * @param result 指向结果点的指针。不能为空。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_TransformPoint(const ArkUI_Matrix4* matrix, const ArkUI_PointF* oriPoint, ArkUI_PointF* result); /** - * @brief Map the vertex coordinates of one polygon to the vertex coordinates of another polygon, and calculate the required - * matrix. The resulting matrix will be filled into the object pointed to by matrix. + * @brief 将一个多边形的顶点坐标映射到另一个多边形的顶点坐标,并计算所需的矩阵。 * - * @param matrix Pointer to the original matrix4 object. The result matrix will be filled into the object pointed to by it. - * It must not be null. - * @param src Pointer to the array of original polygon coordinate points. The array should be at least as long as pointCount. - * @param dst Pointer to the array of polygon coordinate points after mapping. The array should be at least as long as pointCount. - * @param pointCount The number of polygon points, which must be one of the values 0, 1, 2, 3, or 4. - * @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 exception occurs. + * @param matrix 指向四阶矩阵对象的指针,用于存放结果矩阵。 + * @param src 指向原始多边形坐标点数组的指针。数组长度应至少为pointCount。 + * @param dst 指向映射后多边形坐标点数组的指针。数组长度应至少为pointCount。 + * @param pointCount 多边形点的数量,必须是0、1、2、3或4中的一个值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_SetPolyToPoly(ArkUI_Matrix4* matrix, const ArkUI_PointF* src, const ArkUI_PointF* dst, const uint32_t pointCount); /** - * @brief Obtain the 16 elements of the matrix and fill them into the array pointed to by result. - * The array pointed to by result must have space for 16 float elements. + * @brief 获取四阶矩阵的16个元素。 * - * @param matrix Pointer to the original matrix4 object. - * @param result Pointer to an array that can hold 16 floating-point numbers. It must not be null. - * @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 exception occurs. + * @param matrix 指向四阶矩阵对象的指针。 + * @param result 指向可容纳16个浮点数的数组的指针。不能为空。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_GetElements(const ArkUI_Matrix4* matrix, float* result); From 8d7fd0770b88638bd54ce7c27619a7019454c172 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 13:58:39 +0800 Subject: [PATCH 36/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: opencode (qwen3.6-plus) Change-Id: I7a0c01751f92b28603b968a0234b1e01442a4762 --- .../ace_engine/native/native_type_visual.h | 407 ++++++++---------- 1 file changed, 184 insertions(+), 223 deletions(-) diff --git a/zh-cn/arkui/ace_engine/native/native_type_visual.h b/zh-cn/arkui/ace_engine/native/native_type_visual.h index 73557421b..30fa1fa95 100644 --- a/zh-cn/arkui/ace_engine/native/native_type_visual.h +++ b/zh-cn/arkui/ace_engine/native/native_type_visual.h @@ -45,774 +45,735 @@ /** - * @brief Defines a fourth-order matrix object. + * @brief 定义四阶矩阵对象。 * * @since 24 */ typedef struct ArkUI_Matrix4 ArkUI_Matrix4; /** - * @brief Enumerates shadow types. + * @brief 定义阴影类型枚举值。 * * @since 12 */ typedef enum { /** - * Color shadow. + * 彩色阴影。 */ ARKUI_SHADOW_TYPE_COLOR = 0, /** - * Blur shadow. + * 模糊阴影。 */ ARKUI_SHADOW_TYPE_BLUR } ArkUI_ShadowType; /** - * @brief Enumerates shadow styles. + * @brief 阴影效果枚举值。 * * @since 12 */ typedef enum { /** - * Mini shadow.
!{@link defaultxs} + * 超小阴影。 + * !{@link defaultxs} */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0, /** - * Small shadow.
!{@link defaultsm} + * 小阴影。 + * !{@link defaultsm} */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM, /** - * Medium shadow.
!{@link defaultmd} + * 中阴影。 + * !{@link defaultmd} */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD, /** - * Large shadow.
!{@link defaultlg} + * 大阴影。 + * !{@link defaultlg} */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG, /** - * Floating small shadow.
!{@link floatingsm} + * 浮动小阴影。 + * !{@link floatingsm} */ ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM, /** - * Floating medium shadow.
!{@link floatingmd} + * 浮动中阴影。 + * !{@link floatingmd} */ ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD, } ArkUI_ShadowStyle; /** - * @brief Enumerates the animation curves. + * @brief 动画曲线枚举值。 * * @since 12 */ typedef enum { /** - * The animation speed keeps unchanged. + * 动画从头到尾的速度都是相同。 */ ARKUI_CURVE_LINEAR = 0, /** - * The animation starts slowly, accelerates, and then slows down towards the end. + * 动画以低速开始,然后加快,在结束前变慢。 */ ARKUI_CURVE_EASE, /** - * The animation starts at a low speed and then picks up speed until the end. + * 动画以低速开始。 */ ARKUI_CURVE_EASE_IN, /** - * The animation ends at a low speed. + * 动画以低速结束。 */ ARKUI_CURVE_EASE_OUT, /** - * The animation starts and ends at a low speed, providing a smooth and natural transition. + * 动画以低速开始和结束,提供平滑自然的动画过渡效果。 */ ARKUI_CURVE_EASE_IN_OUT, /** - * The animation uses the standard curve + * 动画标准曲线。 */ ARKUI_CURVE_FAST_OUT_SLOW_IN, /** - * The animation uses the deceleration curve. + * 动画减速曲线。 */ ARKUI_CURVE_LINEAR_OUT_SLOW_IN, /** - * The animation uses the acceleration curve. + * 动画加速曲线。 */ ARKUI_CURVE_FAST_OUT_LINEAR_IN, /** - * The animation uses the extreme deceleration curve. + * 动画急缓曲线。 */ ARKUI_CURVE_EXTREME_DECELERATION, /** - * The animation uses the sharp curve. + * 动画锐利曲线。 */ ARKUI_CURVE_SHARP, /** - * The animation uses the rhythm curve. + * 动画节奏曲线。 */ ARKUI_CURVE_RHYTHM, /** - * The animation uses the smooth curve. + * 动画平滑曲线。 */ ARKUI_CURVE_SMOOTH, /** - * The animation uses the friction curve + * 动画阻尼曲线。 */ ARKUI_CURVE_FRICTION, } ArkUI_AnimationCurve; /** - * @brief Enumerates the animation playback directions. + * @brief 定义动画播放模式。 * * @since 12 */ typedef enum { /** - * The animation is played forwards. + * 动画正向播放。 */ ARKUI_ANIMATION_PLAY_MODE_NORMAL = 0, /** - * The animation is played backwards. + * 动画反向播放。 */ ARKUI_ANIMATION_PLAY_MODE_REVERSE, /** - * The animation plays in alternating loop mode. When the animation is played for an odd number of times, the - * playback is in forward direction. When the animation is played for an even number of times, the playback is in - * reverse direction. + * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 */ ARKUI_ANIMATION_PLAY_MODE_ALTERNATE, /** - * The animation plays in reverse alternating loop mode. When the animation is played for an odd number of times, - * the playback is in reverse direction. When the animation is played for an even number of times, the playback is - * in forward direction. + * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 */ ARKUI_ANIMATION_PLAY_MODE_ALTERNATE_REVERSE, } ArkUI_AnimationPlayMode; /** - * @brief Enumerates the blur styles. + * @brief 定义背景模糊样式。 * * @since 12 */ typedef enum { /** - * Thin material.
!{@link thin} + * 轻薄材质模糊。 + * !{@link thin} */ ARKUI_BLUR_STYLE_THIN = 0, /** - * Regular material.
!{@link regular} + * 普通厚度材质模糊。 + * !{@link regular} */ ARKUI_BLUR_STYLE_REGULAR, /** - * Thick material.
!{@link thick} + * 厚材质模糊。 + * !{@link thick} */ ARKUI_BLUR_STYLE_THICK, /** - * Material that creates the minimum depth of field effect.
!{@link backgroundthin} + * 近距景深模糊。 + * !{@link backgroundthin} */ ARKUI_BLUR_STYLE_BACKGROUND_THIN, /** - * Material that creates a medium shallow depth of field effect.
!{@link backgroundregular} + * 中距景深模糊。 + * !{@link backgroundregular} */ ARKUI_BLUR_STYLE_BACKGROUND_REGULAR, /** - * Material that creates a high shallow depth of field effect.
!{@link backgroundthick} + * 远距景深模糊。 + * !{@link backgroundthick} */ ARKUI_BLUR_STYLE_BACKGROUND_THICK, /** - * Material that creates the maximum depth of field effect.
!{@link backgroundultrathick} + * 超远距景深模糊。 + * !{@link backgroundultrathick} */ ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK, /** - * No blur.
!{@link none} + * 关闭模糊。 + * !{@link none} */ ARKUI_BLUR_STYLE_NONE, /** - * Component ultra-thin material.
!{@link componentultrathin} + * 组件超轻薄材质模糊。 + * !{@link componentultrathin} */ ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN, /** - * Component thin material.
!{@link componentthin} + * 组件轻薄材质模糊。 + * !{@link componentthin} */ ARKUI_BLUR_STYLE_COMPONENT_THIN, /** - * Component regular material.
!{@link componentregular} + * 组件普通材质模糊。 + * !{@link componentregular} */ ARKUI_BLUR_STYLE_COMPONENT_REGULAR, /** - * Component thick material.
!{@link componentthick} + * 组件厚材质模糊。 + * !{@link componentthick} */ ARKUI_BLUR_STYLE_COMPONENT_THICK, /** - * Component ultra-thick material.
!{@link componentultrathick} + * 组件超厚材质模糊。 + * !{@link componentultrathick} */ ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK, } ArkUI_BlurStyle; /** - * @brief Enumerates the activation policies for the background blur effect. + * @brief 定义背景模糊激活策略。 * * @since 19 */ typedef enum { /** - * The blur effect changes according to the window's focus state; - * it is inactive when the window is not in focus and active when the window is in focus. + * 跟随窗口焦点状态变化,窗口非焦点状态不激活,窗口焦点状态激活。 */ ARKUI_BLUR_STYLE_ACTIVE_POLICY_FOLLOWS_WINDOW_ACTIVE_STATE = 0, /** - * The blur effect is always active. + * 始终激活。 */ ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_ACTIVE, /** - * The blur effect is always inactive. + * 始终不激活。 */ ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_INACTIVE, } ArkUI_BlurStyleActivePolicy; /** - * @brief Enumerates the blend modes. + * @brief 混合模式枚举值。 * * @since 12 */ typedef enum { /** - * The top image is superimposed on the bottom image without any blending. + * 将上层图像直接覆盖到下层图像上,不进行任何混合操作。 */ ARKUI_BLEND_MODE_NONE = 0, /** - * The target pixels covered by the source pixels are erased by being turned to completely transparent. + * 将源像素覆盖的目标像素清除为完全透明。 */ ARKUI_BLEND_MODE_CLEAR, /** - * r = s: Only the source pixels are displayed. + * r = s,只显示源像素。 */ ARKUI_BLEND_MODE_SRC, /** - * r = d: Only the target pixels are displayed. + * r = d,只显示目标像素。 */ ARKUI_BLEND_MODE_DST, /** - * r = s + (1 - sa) * d: The source pixels are blended based on opacity and cover the target pixels. + * r = s + (1 - sa) * d,将源像素按照透明度进行混合,覆盖在目标像素上。 */ ARKUI_BLEND_MODE_SRC_OVER, /** - * r = d + (1 - da) * s: The target pixels are blended based on opacity and cover on the source pixels. + * r = d + (1 - da) * s,将目标像素按照透明度进行混合,覆盖在源像素上。 */ ARKUI_BLEND_MODE_DST_OVER, /** - * r = s * da: Only the part of the source pixels that overlap with the target pixels is displayed. + * r = s * da,只显示源像素中与目标像素重叠的部分。 */ ARKUI_BLEND_MODE_SRC_IN, /** - * r = d * sa: Only the part of the target pixels that overlap with the source pixels is displayed. + * r = d * sa,只显示目标像素中与源像素重叠的部分。 */ ARKUI_BLEND_MODE_DST_IN, /** - * r = s * (1 - da): Only the part of the source pixels that do not overlap with the target pixels is displayed. + * r = s * (1 - da),只显示源像素中与目标像素不重叠的部分。 */ ARKUI_BLEND_MODE_SRC_OUT, /** - * r = d * (1 - sa): Only the part of the target pixels that do not overlap with the source pixels is displayed. + * r = d * (1 - sa),只显示目标像素中与源像素不重叠的部分。 */ ARKUI_BLEND_MODE_DST_OUT, /** - * r = s * da + d * (1 - sa): The part of the source pixels that overlap with the target pixels is displayed and - * the part of the target pixels that do not overlap with the source pixels are displayed. + * r = s * da + d * (1 - sa),在源像素和目标像素重叠的地方绘制源像素,在源像素和目标像素不重叠的地方绘制目标像素。 */ ARKUI_BLEND_MODE_SRC_ATOP, /** - * r = d * sa + s * (1 - da): The part of the target pixels that overlap with the source pixels and the part of - * the source pixels that do not overlap with the target pixels are displayed. + * r = d * sa + s * (1 - da),在源像素和目标像素重叠的地方绘制目标像素,在源像素和目标像素不重叠的地方绘制源像素。 */ ARKUI_BLEND_MODE_DST_ATOP, /** - * r = s * (1 - da) + d * (1 - sa): Only the non-overlapping part between the source pixels and the target pixels - * is displayed. + * r = s * (1 - da) + d * (1 - sa),只显示源像素与目标像素不重叠的部分。 */ ARKUI_BLEND_MODE_XOR, /** - * r = min(s + d, 1): New pixels resulting from adding the source pixels to the target pixels are displayed. + * r = min(s + d, 1),将源像素值与目标像素值相加,并将结果作为新的像素值。 */ ARKUI_BLEND_MODE_PLUS, /** - * r = s * d: New pixels resulting from multiplying the source pixels with the target pixels are displayed. + * r = s * d,将源像素与目标像素进行乘法运算,并将结果作为新的像素值。 */ ARKUI_BLEND_MODE_MODULATE, /** - * r = s + d - s * d: Pixels are blended by adding the source pixels to the target pixels and subtracting the - * product of their multiplication. + * r = s + d - s * d,将两个图像的像素值相加,然后减去它们的乘积来实现混合。 */ ARKUI_BLEND_MODE_SCREEN, /** - * The MULTIPLY or SCREEN mode is used based on the target pixels. + * 根据目标像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 */ ARKUI_BLEND_MODE_OVERLAY, /** - * rc = s + d - max(s * da, d * sa), ra = kSrcOver: When two colors overlap, whichever is darker is used. + * rc = s + d - max(s * da, d * sa), ra = kSrcOver,当两个颜色重叠时,较暗的颜色会覆盖较亮的颜色。 */ ARKUI_BLEND_MODE_DARKEN, /** - * rc = s + d - min(s * da, d * sa), ra = kSrcOver: The final pixels are composed of the lightest values of pixels. + * rc = s + d - min(s * da, d * sa), ra = kSrcOver,将源图像和目标图像中的像素进行比较,选取两者中较亮的像素作为最终的混合结果。 */ ARKUI_BLEND_MODE_LIGHTEN, /** - * The colors of the target pixels are lightened to reflect the source pixels. + * 使目标像素变得更亮来反映源像素。 */ ARKUI_BLEND_MODE_COLOR_DODGE, /** - * The colors of the target pixels are darkened to reflect the source pixels. + * 使目标像素变得更暗来反映源像素。 */ ARKUI_BLEND_MODE_COLOR_BURN, /** - * The MULTIPLY or SCREEN mode is used, depending on the source pixels. + * 根据源像素的值来决定目标像素变得更亮或者更暗。根据源像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 */ ARKUI_BLEND_MODE_HARD_LIGHT, /** - * The LIGHTEN or DARKEN mode is used, depending on the source pixels. + * 根据源像素来决定使用LIGHTEN混合模式还是DARKEN混合模式。 */ ARKUI_BLEND_MODE_SOFT_LIGHT, /** - * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver: The final pixel is the result of subtracting the darker of the two pixels (source and target) from - * the lighter one. + * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生高对比度的效果。 */ ARKUI_BLEND_MODE_DIFFERENCE, /** - * rc = s + d - two(s * d), ra = kSrcOver: The final pixel is similar to DIFFERENCE, but with less contrast. + * rc = s + d - two(s * d), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生柔和的效果。 */ ARKUI_BLEND_MODE_EXCLUSION, /** - * r = s * (1 - da) + d * (1 - sa) + s * d: The final pixel is the result of multiplying the source pixel - * by the target pixel. + * r = s * (1 - da) + d * (1 - sa) + s * d,将源图像与目标图像进行乘法混合,得到一张新的图像。 */ ARKUI_BLEND_MODE_MULTIPLY, /** - * The resultant image is created with the luminance and saturation of the source image and the hue of the target - * image. + * 保留源图像的亮度和饱和度,但会使用目标图像的色调来替换源图像的色调。 */ ARKUI_BLEND_MODE_HUE, /** - * The resultant image is created with the luminance and hue of the target image and the saturation of the source - * image. + * 保留目标像素的亮度和色调,但会使用源像素的饱和度来替换目标像素的饱和度。 */ ARKUI_BLEND_MODE_SATURATION, /** - * The resultant image is created with the saturation and hue of the source image and the luminance of the target - * image. + * 保留源像素的饱和度和色调,但会使用目标像素的亮度来替换源像素的亮度。 */ ARKUI_BLEND_MODE_COLOR, /** - * The resultant image is created with the saturation and hue of the target image and the luminance of the source - * image. + * 保留目标像素的色调和饱和度,但会用源像素的亮度替换目标像素的亮度。 */ ARKUI_BLEND_MODE_LUMINOSITY, } ArkUI_BlendMode; /** - * @brief Enumerates the foreground colors. + * @brief 前景和阴影颜色的枚举值。 * * @since 12 */ typedef enum { /** - * The foreground colors are the inverse of the component background colors. + * 前景色为控件背景色的反色。 */ ARKUI_COLOR_STRATEGY_INVERT = 0, /** - * The shadow colors of the component are the average color obtained from the component background shadow area. + * 控件背景阴影色为控件背景阴影区域的平均色。 */ ARKUI_COLOR_STRATEGY_AVERAGE, /** - * The shadow colors of the component are the primary color obtained from the component background shadow area. + * 控件背景阴影色为控件背景阴影区域的主色。 */ ARKUI_COLOR_STRATEGY_PRIMARY, } ArkUI_ColorStrategy; /** - * @brief Enumerates the mask types. + * @brief 遮罩类型枚举。遮罩是一种用于限制组件显示区域的手段,它利用特定的形状对组件内容进行裁剪,从而实现只有遮罩区域内的内容才可见的效果。 * * @since 12 */ typedef enum { /** - * Rectangle. + * 矩形类型。 */ ARKUI_MASK_TYPE_RECTANGLE = 0, /** - * Circle. + * 圆形。 */ ARKUI_MASK_TYPE_CIRCLE, /** - * Ellipse. + * 椭圆形类型。 */ ARKUI_MASK_TYPE_ELLIPSE, /** - * Path. + * 路径类型。 */ ARKUI_MASK_TYPE_PATH, /** - * Progress indicator. + * 进度类型。 */ ARKUI_MASK_TYPE_PROGRESS, } ArkUI_MaskType; /** - * @brief Enumerates the clipping region types. + * @brief 裁剪类型枚举。 * * @since 12 */ typedef enum { /** - * Rectangle. + * 矩形类型。 */ ARKUI_CLIP_TYPE_RECTANGLE = 0, /** - * Circle. + * 圆形。 */ ARKUI_CLIP_TYPE_CIRCLE, /** - * Ellipse. + * 椭圆形类型。 */ ARKUI_CLIP_TYPE_ELLIPSE, /** - * Path. + * 路径类型。 */ ARKUI_CLIP_TYPE_PATH, } ArkUI_ClipType; /** - * @brief Enumerates the custom shapes. + * @brief 自定义形状。 * * @since 12 */ typedef enum { /** - * Rectangle. + * 矩形类型。 */ ARKUI_SHAPE_TYPE_RECTANGLE = 0, /** - * Circle. + * 圆形。 */ ARKUI_SHAPE_TYPE_CIRCLE, /** - * Ellipse. + * 椭圆形类型。 */ ARKUI_SHAPE_TYPE_ELLIPSE, /** - * Path. + * 路径类型。 */ ARKUI_SHAPE_TYPE_PATH, } ArkUI_ShapeType; /** - * @brief Enumerates the gradient directions. + * @brief 定义渐变方向结构。 * * @since 12 */ typedef enum { /** - * From right to left. + * 向左渐变。 */ ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT = 0, /** - * From bottom to top. + * 向上渐变。 */ ARKUI_LINEAR_GRADIENT_DIRECTION_TOP, /** - * From left to right. + * 向右渐变。 */ ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT, /** - * From top to bottom. + * 向下渐变。 */ ARKUI_LINEAR_GRADIENT_DIRECTION_BOTTOM, /** - * From lower right to upper left. + * 向左上渐变。 */ ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_TOP, /** - * From upper right to lower left. + * 向左下渐变。 */ ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_BOTTOM, /** - * From lower left to upper right. + * 向右上渐变。 */ ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_TOP, /** - * From upper left to lower right. + * 向右下渐变。 */ ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_BOTTOM, /** - * No gradient. + * 不渐变。 */ ARKUI_LINEAR_GRADIENT_DIRECTION_NONE, /** - * Custom direction. + * 自定义渐变方向. */ ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, } ArkUI_LinearGradientDirection; /** - * @brief Enumerates the slide-in and slide-out positions of the component from the screen edge during transition. + * @brief 定义转场从边缘滑入和滑出的效果。 * * @since 12 */ typedef enum { /** - * Top edge of the window. + * 转场从窗口的上边缘滑入和滑出。 */ ARKUI_TRANSITION_EDGE_TOP = 0, /** - * Bottom edge of the window. + * 转场从窗口的下边缘滑入和滑出。 */ ARKUI_TRANSITION_EDGE_BOTTOM, /** - * Left edge of the window. + * 转场从窗口的左边缘滑入和滑出。 */ ARKUI_TRANSITION_EDGE_START, /** - * Right edge of the window. + * 转场从窗口的右边缘滑入和滑出。 */ ARKUI_TRANSITION_EDGE_END, } ArkUI_TransitionEdge; /** - * @brief Defines how the specified blend mode is applied. + * @brief 指定的混合模式应用于视图的内容选项. * * @since 12 */ typedef enum { /** - * The content of the view is blended in sequence on the target image. + * 在目标图像上按顺序混合视图的内容. */ BLEND_APPLY_TYPE_FAST = 0, /** - * The content of the component and its child components are drawn on the offscreen canvas, and then blended with - * the existing content on the canvas. + * 将此组件和子组件内容绘制到离屏画布上,然后整体进行混合. */ BLEND_APPLY_TYPE_OFFSCREEN, } ArkUI_BlendApplyType; /** - * @brief Enumerates the animation onFinish callback types. + * @brief 在动画中定义{@link OH_ArkUI_AnimatorOption_RegisterOnFinishCallback}回调的类型。 * * @since 12 */ typedef enum { /** - * The callback is invoked when the entire animation is removed once it has finished. + * 当整个动画结束并立即删除时,将触发回调。 */ ARKUI_FINISH_CALLBACK_REMOVED = 0, /** - * The callback is invoked when the animation logically enters the falling state, though it may still be in its - * long tail state. + * 当动画在逻辑上处于下降状态,但可能仍处于其长尾状态时,将触发回调。长尾状态是指动画即将完全停止前的残余变化过程,此时动画的数值变化已非常微小,接近目标值。 */ ARKUI_FINISH_CALLBACK_LOGICALLY, } ArkUI_FinishCallbackType; /** - * @brief Enumerates the render fit. + * @brief 定义动画终态内容大小与位置的枚举值。 * * @since 12 */ typedef enum { /** - * Maintains the content size of the animation's final state, - * and the content is always centered with the component. + * 保持动画终态的内容大小,并且内容始终与组件保持中心对齐。 */ ARKUI_RENDER_FIT_CENTER = 0, /** - * Maintains the content size of the animation's final state, - * and the content is always aligned with the top center of the component. + * 保持动画终态的内容大小,并且内容始终与组件保持顶部中心对齐。 */ ARKUI_RENDER_FIT_TOP, /** - * Maintains the content size of the animation's final state, - * and the content is always aligned with the bottom center of the component. + * 保持动画终态的内容大小,并且内容始终与组件保持底部中心对齐。 */ ARKUI_RENDER_FIT_BOTTOM, /** - * Maintains the content size of the animation's final state, - * and the content is always aligned to the left of the component. + * 保持动画终态的内容大小,并且内容始终与组件保持左侧对齐。 */ ARKUI_RENDER_FIT_LEFT, /** - * Maintains the content size of the animation's final state, - * and the content is always right-aligned with the component. + * 保持动画终态的内容大小,并且内容始终与组件保持右侧对齐。 */ ARKUI_RENDER_FIT_RIGHT, /** - * Maintains the content size of the animation's final state, - * and the content is always aligned with the top left corner of the component. + * 保持动画终态的内容大小,并且内容始终与组件保持左上角对齐。 */ ARKUI_RENDER_FIT_TOP_LEFT, /** - * Keep the content size of the animation final state, - * and the content is always aligned with the upper right corner of the component. + * 保持动画终态的内容大小,并且内容始终与组件保持右上角对齐。 */ ARKUI_RENDER_FIT_TOP_RIGHT, /** - * Keep the content size of the animation final state, - * and the content always aligns with the lower-left corner of the component. + * 保持动画终态的内容大小,并且内容始终与组件保持左下角对齐。 */ ARKUI_RENDER_FIT_BOTTOM_LEFT, /** - * Keep the content size of the animation final state, - * and the content always aligns with the lower-right corner of the component. + * 保持动画终态的内容大小,并且内容始终与组件保持右下角对齐。 */ ARKUI_RENDER_FIT_BOTTOM_RIGHT, /** - * The aspect ratio of the animation's final state content is not considered, - * and the content is always scaled to the size of the component. + * 不考虑动画终态内容的宽高比,并且内容始终缩放到组件的大小。 */ ARKUI_RENDER_FIT_RESIZE_FILL, /** - * Reduce or enlarge the aspect ratio of the animation final state content, - * so that the content is fully displayed in the component, - * and keep the center aligned with the component. + * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内,且与组件保持中心对齐。 */ ARKUI_RENDER_FIT_RESIZE_CONTAIN, /** - * Keep the aspect ratio of the animation final state content to reduce or enlarge, - * so that the content is fully displayed in the component. - * When there is left over in the broad direction of the component, - * the content is aligned to the left of the component, - * and when there is left over in the high direction of the component, - * the content is aligned to the top of the component. + * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持左侧对齐,当组件高方向有剩余时,内容与组件保持顶部对齐。 */ ARKUI_RENDER_FIT_RESIZE_CONTAIN_TOP_LEFT, /** - * Keep the aspect ratio of the animation final state content to reduce or enlarge, - * so that the content is fully displayed in the component. - * When there is left in the wide direction of the component, - * the content is aligned with the component on the right. - * When there is left in the high direction of the component, - * the content is aligned with the component on the bottom. + * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持右侧对齐,当组件高方向有剩余时,内容与组件保持底部对齐。 */ ARKUI_RENDER_FIT_RESIZE_CONTAIN_BOTTOM_RIGHT, /** - * Keep the aspect ratio of the animation final state content reduced or enlarged, - * so that both sides of the content are greater than or equal to both sides of the component, - * and keep the center aligned with the component to display the middle part of the content. + * 保持动画终态内容的宽高比进行缩小或放大,使内容两边都大于或等于组件两边,且与组件保持中心对齐,显示内容的中间部分。 */ ARKUI_RENDER_FIT_RESIZE_COVER, /** - * Keep the aspect ratio of the final content of the animation reduced or enlarged - * so that both sides of the content are exactly greater than or equal to both sides of the component. - * When the content width is left, the content is aligned to the left of the component, - * and the left portion of the content is displayed. When the content is left in the high direction, - * the content and the component remain top aligned, showing the top side of the content. + * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持左侧对齐,显示内容的左侧部分。当内容高方向有剩余时,内容与组件保持顶部对齐,显示内容的顶侧部分。 */ ARKUI_RENDER_FIT_RESIZE_COVER_TOP_LEFT, /** - * Keep the aspect ratio of the final content of the animation reduced or enlarged so - * that both sides of the content are exactly greater than or equal to both sides of the component. - * When the content width is left, the content and the component remain right aligned, - * and the right part of the content is displayed. When the content is left in the high direction, - * the content and the component remain aligned at the bottom, - * and the bottom part of the content is displayed. + * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持右侧对齐,显示内容的右侧部分。当内容高方向有剩余时,内容与组件保持底部对齐,显示内容的底侧部分。 */ ARKUI_RENDER_FIT_RESIZE_COVER_BOTTOM_RIGHT } ArkUI_RenderFit; /** - * @brief Defines the status before and after execution of the animation in the current playback direction. + * @brief 定义帧动画组件在动画开始前和结束后的状态。 * * @since 12 */ typedef enum { /** - * Before execution, the animation does not apply any styles to the target component. - * After execution, the animation restores the target component to its default state. + * 动画未执行时不会将任何样式应用于目标,动画播放完成之后恢复初始默认状态。 */ ARKUI_ANIMATION_FILL_MODE_NONE, /** - * The target component retains the state set by the last keyframe encountered - * during execution of the animation. + * 目标将保留动画执行期间最后一个关键帧的状态。 */ ARKUI_ANIMATION_FILL_MODE_FORWARDS, /** - * The animation applies the values defined in the first relevant keyframe once it is applied to - * the target component, and retains the values during the period set by delay. + * 动画将在应用于目标时立即应用第一个关键帧中定义的值,并在{@link delay}期间保留此值。 */ ARKUI_ANIMATION_FILL_MODE_BACKWARDS, /** - * The animation follows the rules for both Forwards and Backwards, - * extending the animation attributes in both directions. + * 动画将遵循{@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}和{@link ARKUI_ANIMATION_FILL_MODE_BACKWARDS}的规则,从而在两个方向上扩展动画属性。 */ ARKUI_ANIMATION_FILL_MODE_BOTH, } ArkUI_AnimationFillMode; /** - * @brief Enumerates the animation playback modes. + * @brief 定义动画播放模式。 * * @since 12 */ typedef enum { /** - * The animation plays in forward loop mode. + * 动画正向循环播放。 */ ARKUI_ANIMATION_DIRECTION_NORMAL = 0, /** - * The animation plays in reverse loop mode. + * 动画反向循环播放。 */ ARKUI_ANIMATION_DIRECTION_REVERSE, /** - * The animation plays in alternating loop mode. When the animation is played for an odd number of times, the - * playback is in forward direction. When the animation is played for an even number of times, the playback is in - * reverse direction. + * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 */ ARKUI_ANIMATION_DIRECTION_ALTERNATE, /** - * The animation plays in reverse alternating loop mode. When the animation is played for an odd number of times, - * the playback is in reverse direction. When the animation is played for an even number of times, the playback is - * in forward direction. + * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 */ ARKUI_ANIMATION_DIRECTION_ALTERNATE_REVERSE, } ArkUI_AnimationDirection; /** - * @brief Defines the translation options for component transition. + * @brief 定义组件转场时的平移效果对象。 * * @since 12 */ typedef struct { /** - * Translation distance along the x-axis. + * 横向的平移距离,单位为vp。 */ float x; /** - * Translation distance along the y-axis. + * 纵向的平移距离,单位为vp。 */ float y; /** - * Translation distance along the z-axis. + * 深度方向的平移距离,单位为vp。 */ float z; } ArkUI_TranslationOptions; /** - * @brief Defines the scaling options for component transition. + * @brief 定义组件转场时的缩放效果对象。 * * @since 12 */ typedef struct { /** - * Scale ratio along the x-axis. + * x轴的缩放倍数。x>1时以x轴方向放大,01时以y轴方向放大,0如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4TranslationOptions* options, float* x); From f0e06905915f74c68e0d4ee614c14dee8b044a0d Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 14:17:53 +0800 Subject: [PATCH 37/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: opencode (qwen3.6-plus) Change-Id: Ie8f5a62a481087d3b030703923fabf54eccbc074 --- arkui/ace_engine/native/native_type_visual.h | 132 +++++++++---------- 1 file changed, 65 insertions(+), 67 deletions(-) diff --git a/arkui/ace_engine/native/native_type_visual.h b/arkui/ace_engine/native/native_type_visual.h index ff7760ebf..277c3044c 100644 --- a/arkui/ace_engine/native/native_type_visual.h +++ b/arkui/ace_engine/native/native_type_visual.h @@ -898,7 +898,7 @@ void OH_ArkUI_MotionPathOptions_Dispose(ArkUI_MotionPathOptions* options); * * @param options Pointer to {@link ArkUI_MotionPathOptions}. * @param svgPath Motion path string for the path animation. - * @return Returns the result code. + * @return Result code. *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 @@ -914,7 +914,7 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* opti * @param writeLength Indicates the string length actually written to the buffer when {@link ARKUI_ERROR_CODE_NO_ERROR} * is returned. Indicates the minimum buffer size that can accommodate the target string when * {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} is returned. - * @return Returns the result code. + * @return Result code. *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. *
{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the buffer size is less than the minimum buffer size. @@ -931,7 +931,7 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions * @param from Start progress of the motion path. The value ranges from **0.0** to **1.0**. The value of **from** must * be less than or equal to that of **to**; otherwise, {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} is returned. * For details about the meaning of **to**, see {@link OH_ArkUI_MotionPathOptions_SetTo}. - * @return Returns the result code. + * @return Result code. *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if **from** is out of the range [0.0, 1.0] or **from** is @@ -945,7 +945,7 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* opti * * @param options Pointer to {@link ArkUI_MotionPathOptions}. * @param from Pointer to the variable used to receive the start progress of the motion path. - * @return Returns the result code. + * @return Result code. *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 @@ -960,7 +960,7 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions * @param to End progress of the motion path. The value ranges from **0.0** to **1.0**. The value of **to** must be * greater than or equal to that of **from**; otherwise, {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} is returned. * For details about the meaning of **from**, see {@link OH_ArkUI_MotionPathOptions_SetFrom}. - * @return Returns the result code. + * @return Result code. *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if **to** is out of the range [0.0, 1.0] or **to** is less than @@ -974,7 +974,7 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* option * * @param options Pointer to {@link ArkUI_MotionPathOptions}. * @param to Pointer to the variable used to receive the end progress of the motion path. - * @return Returns the result code. + * @return Result code. *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 @@ -988,7 +988,7 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* * @param rotatable Whether the component rotates along the path. The value **true** means that the component rotates * along the path, and **false** means that the component does not rotate along the path. The default value is * **false**. - * @return Returns the result code. + * @return Result code. *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 @@ -1002,7 +1002,7 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* * @param rotatable Pointer to the variable used to receive the value of **rotatable**, which indicates whether the * component rotates along the path. The value **true** means that the component rotates along the path, and * **false** means that the component does not rotate along the path. - * @return Returns the result code. + * @return Result code. *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. * @since 23 @@ -1031,21 +1031,21 @@ void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param radius Blur radius of the shadow, in vp. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options, float radius); /** - * @brief Obtains the blur radius of the shadow options. + * @brief Obtains the blur radius for the shadow options. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param radius Pointer to the variable used to receive the blur radius of the shadow, in vp. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param radius Pointer to the blur radius of the shadow, in vp. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options, float* radius); @@ -1054,22 +1054,22 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options * @brief Sets the shadow type for the shadow options. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param type Shadow type. For details, see {@link ArkUI_ShadowType}. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param type Shadow type ({@link ArkUI_ShadowType}). + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType type); /** - * @brief Obtains the shadow type of the shadow options. + * @brief Obtains the shadow type for the shadow options. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param type Pointer to the variable used to receive the shadow type. For details, see {@link ArkUI_ShadowType}. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param type Shadow type ({@link ArkUI_ShadowType}). + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType* type); @@ -1079,97 +1079,95 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param color Shadow color, in 0xARGB format. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, uint32_t color); /** - * @brief Obtains the shadow color of the shadow options. + * @brief Obtains the shadow color for the shadow options. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param color Pointer to the variable used to receive the shadow color, in 0xARGB format. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param color Pointer to the shadow color, in 0xARGB format. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, uint32_t* color); /** - * @brief Sets the offset of the shadow along the x-axis. + * @brief Sets the shadow offset on the x-axis. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param offsetX Offset of the shadow along the x-axis, in vp. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param offsetX Shadow offset on the x-axis, in vp. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* options, float offsetX); /** - * @brief Obtains the offset of the shadow along the x-axis. + * @brief Obtains the shadow offset on the x-axis. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param offsetX Pointer to the variable used to receive the offset of the shadow along the x-axis, in vp. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param offsetX Pointer to the shadow offset on the x-axis, in vp. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* options, float* offsetX); /** - * @brief Sets the offset of the shadow along the y-axis. + * @brief Sets the shadow offset on the y-axis. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param offsetY Offset of the shadow along the y-axis, in vp. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param offsetY Shadow offset on the y-axis, in vp. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* options, float offsetY); /** - * @brief Obtains the offset of the shadow along the y-axis. + * @brief Obtains the shadow offset on the y-axis. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param offsetY Pointer to the variable used to receive the offset of the shadow along the y-axis, in vp. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param offsetY Pointer to the shadow offset on the y-axis, in vp. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* options, float* offsetY); /** - * @brief Sets whether to fill the inside of the component with shadow. + * @brief Sets whether to fill a component with a shadow. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param isFill Whether to fill the inside of the component with shadow. The value **true** means to fill the inside - * of the component with shadow, and **false** means not to fill the inside of the component with shadow. The - * default value is **false**. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param isFill Whether to fill a component with a shadow. **true** means to fill a component with a shadow, and ** + * false** means the opposite. The default value is **false**. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, bool isFill); /** - * @brief Obtains whether to fill the inside of the component with shadow. + * @brief Obtains whether a component is filled with a shadow. * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. - * @param isFill Pointer to the variable used to receive whether to fill the inside of the component with shadow. The - * value **true** means to fill the inside of the component with shadow, and **false** means not to fill the inside - * of the component with shadow. - * @return Returns the result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @param isFill Pointer to the **isFill** parameter indicating whether a component is filled with a shadow. **true** + * means that a component is filled with a shadow, and **false** means the opposite. + * @return 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 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetFill(OH_ArkUI_ShadowOptions* options, bool* isFill); From 555b3a6ad3830d6ed194c01362d6a1415b528db4 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Wed, 10 Jun 2026 15:52:06 +0800 Subject: [PATCH 38/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[100%] 👌 AI Adopted[100%] 🧑 Human[0%] Co-authored-by: opencode (qwen3.6-plus) Change-Id: Ibc923f38869a9cb9cd8d4e6c448f5d14da7c0af9 --- arkui/ace_engine/native/native_type_visual.h | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/arkui/ace_engine/native/native_type_visual.h b/arkui/ace_engine/native/native_type_visual.h index 277c3044c..dd3a3fd6c 100644 --- a/arkui/ace_engine/native/native_type_visual.h +++ b/arkui/ace_engine/native/native_type_visual.h @@ -407,7 +407,7 @@ typedef enum { } ArkUI_BlendMode; /** - * @brief Enumerates the foreground colors. + * @brief Enumerates foreground and shadow colors. * * @since 12 */ @@ -427,7 +427,8 @@ typedef enum { } ArkUI_ColorStrategy; /** - * @brief Enumerates the mask types. + * @brief Enumerates the mask types. A mask is a means to limit the display area of a component. It uses a specific + * shape to crop the component content so that only the content in the mask area is visible. * * @since 12 */ @@ -479,7 +480,7 @@ typedef enum { } ArkUI_ClipType; /** - * @brief Enumerates the custom shapes. + * @brief Enumerates custom shape types. * * @since 12 */ @@ -592,7 +593,7 @@ typedef enum { } ArkUI_BlendApplyType; /** - * @brief Enumerates the animation onFinish callback types. + * @brief Enumerates the callback types for {@link OH_ArkUI_AnimatorOption_RegisterOnFinishCallback} in an animation. * * @since 12 */ @@ -609,7 +610,7 @@ typedef enum { } ArkUI_FinishCallbackType; /** - * @brief Enumerates the render fit. + * @brief Enumerates the sizing and positioning behaviors of animated content in its final state. * * @since 12 */ From 06fa7f29fccd016f5ee2997a0b0fea37fe4ae596 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Thu, 11 Jun 2026 16:24:20 +0800 Subject: [PATCH 39/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] Change-Id: Ibce361f0744148be9cd04d98292165fc7a2afb9e --- arkui/ace_engine/native/native_type_visual.h | 38 +++++++++---------- .../ace_engine/native/native_type_visual.h | 19 ---------- 2 files changed, 19 insertions(+), 38 deletions(-) diff --git a/arkui/ace_engine/native/native_type_visual.h b/arkui/ace_engine/native/native_type_visual.h index dd3a3fd6c..b2da41d74 100644 --- a/arkui/ace_engine/native/native_type_visual.h +++ b/arkui/ace_engine/native/native_type_visual.h @@ -74,27 +74,27 @@ typedef enum { */ typedef enum { /** - * Mini shadow.
!{@link defaultxs} + * Mini shadow.
*/ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0, /** - * Small shadow.
!{@link defaultsm} + * Small shadow.
*/ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM, /** - * Medium shadow.
!{@link defaultmd} + * Medium shadow.
*/ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD, /** - * Large shadow.
!{@link defaultlg} + * Large shadow.
*/ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG, /** - * Floating small shadow.
!{@link floatingsm} + * Floating small shadow.
*/ ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM, /** - * Floating medium shadow.
!{@link floatingmd} + * Floating medium shadow.
*/ ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD, } ArkUI_ShadowStyle; @@ -194,55 +194,55 @@ typedef enum { */ typedef enum { /** - * Thin material.
!{@link thin} + * Thin material.
*/ ARKUI_BLUR_STYLE_THIN = 0, /** - * Regular material.
!{@link regular} + * Regular material.
*/ ARKUI_BLUR_STYLE_REGULAR, /** - * Thick material.
!{@link thick} + * Thick material.
*/ ARKUI_BLUR_STYLE_THICK, /** - * Material that creates the minimum depth of field effect.
!{@link backgroundthin} + * Material that creates the minimum depth of field effect.
*/ ARKUI_BLUR_STYLE_BACKGROUND_THIN, /** - * Material that creates a medium shallow depth of field effect.
!{@link backgroundregular} + * Material that creates a medium shallow depth of field effect.
*/ ARKUI_BLUR_STYLE_BACKGROUND_REGULAR, /** - * Material that creates a high shallow depth of field effect.
!{@link backgroundthick} + * Material that creates a high shallow depth of field effect.
*/ ARKUI_BLUR_STYLE_BACKGROUND_THICK, /** - * Material that creates the maximum depth of field effect.
!{@link backgroundultrathick} + * Material that creates the maximum depth of field effect.
*/ ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK, /** - * No blur.
!{@link none} + * No blur.
*/ ARKUI_BLUR_STYLE_NONE, /** - * Component ultra-thin material.
!{@link componentultrathin} + * Component ultra-thin material.
*/ ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN, /** - * Component thin material.
!{@link componentthin} + * Component thin material.
*/ ARKUI_BLUR_STYLE_COMPONENT_THIN, /** - * Component regular material.
!{@link componentregular} + * Component regular material.
*/ ARKUI_BLUR_STYLE_COMPONENT_REGULAR, /** - * Component thick material.
!{@link componentthick} + * Component thick material.
*/ ARKUI_BLUR_STYLE_COMPONENT_THICK, /** - * Component ultra-thick material.
!{@link componentultrathick} + * Component ultra-thick material.
*/ ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK, } ArkUI_BlurStyle; diff --git a/zh-cn/arkui/ace_engine/native/native_type_visual.h b/zh-cn/arkui/ace_engine/native/native_type_visual.h index 30fa1fa95..1b7c2ce4c 100644 --- a/zh-cn/arkui/ace_engine/native/native_type_visual.h +++ b/zh-cn/arkui/ace_engine/native/native_type_visual.h @@ -75,32 +75,26 @@ typedef enum { /** * 超小阴影。 - * !{@link defaultxs} */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0, /** * 小阴影。 - * !{@link defaultsm} */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM, /** * 中阴影。 - * !{@link defaultmd} */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD, /** * 大阴影。 - * !{@link defaultlg} */ ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG, /** * 浮动小阴影。 - * !{@link floatingsm} */ ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM, /** * 浮动中阴影。 - * !{@link floatingmd} */ ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD, } ArkUI_ShadowStyle; @@ -197,67 +191,54 @@ typedef enum { /** * 轻薄材质模糊。 - * !{@link thin} */ ARKUI_BLUR_STYLE_THIN = 0, /** * 普通厚度材质模糊。 - * !{@link regular} */ ARKUI_BLUR_STYLE_REGULAR, /** * 厚材质模糊。 - * !{@link thick} */ ARKUI_BLUR_STYLE_THICK, /** * 近距景深模糊。 - * !{@link backgroundthin} */ ARKUI_BLUR_STYLE_BACKGROUND_THIN, /** * 中距景深模糊。 - * !{@link backgroundregular} */ ARKUI_BLUR_STYLE_BACKGROUND_REGULAR, /** * 远距景深模糊。 - * !{@link backgroundthick} */ ARKUI_BLUR_STYLE_BACKGROUND_THICK, /** * 超远距景深模糊。 - * !{@link backgroundultrathick} */ ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK, /** * 关闭模糊。 - * !{@link none} */ ARKUI_BLUR_STYLE_NONE, /** * 组件超轻薄材质模糊。 - * !{@link componentultrathin} */ ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN, /** * 组件轻薄材质模糊。 - * !{@link componentthin} */ ARKUI_BLUR_STYLE_COMPONENT_THIN, /** * 组件普通材质模糊。 - * !{@link componentregular} */ ARKUI_BLUR_STYLE_COMPONENT_REGULAR, /** * 组件厚材质模糊。 - * !{@link componentthick} */ ARKUI_BLUR_STYLE_COMPONENT_THICK, /** * 组件超厚材质模糊。 - * !{@link componentultrathick} */ ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK, } ArkUI_BlurStyle; From e2a560310828fb0aef2232a60adf4420559cd451 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Fri, 12 Jun 2026 15:49:09 +0800 Subject: [PATCH 40/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] Change-Id: Ia9e077c94490ab97867062604fec926afe800898 --- arkui/ace_engine/native/native_type_visual.h | 425 +++++++++++-------- 1 file changed, 249 insertions(+), 176 deletions(-) diff --git a/arkui/ace_engine/native/native_type_visual.h b/arkui/ace_engine/native/native_type_visual.h index b2da41d74..1581e8abb 100644 --- a/arkui/ace_engine/native/native_type_visual.h +++ b/arkui/ace_engine/native/native_type_visual.h @@ -858,6 +858,22 @@ typedef struct { float perspective; } ArkUI_RotationOptions; +/** + * @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 shadow options. * @@ -899,9 +915,10 @@ void OH_ArkUI_MotionPathOptions_Dispose(ArkUI_MotionPathOptions* options); * * @param options Pointer to {@link ArkUI_MotionPathOptions}. * @param svgPath Motion path string for the path animation. - * @return Result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* options, const char* svgPath); @@ -915,10 +932,11 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* opti * @param writeLength Indicates the string length actually written to the buffer when {@link ARKUI_ERROR_CODE_NO_ERROR} * is returned. Indicates the minimum buffer size that can accommodate the target string when * {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} is returned. - * @return Result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. - *
{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the buffer size is less than the minimum buffer size. + * @return
    . + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
  • {@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} if the buffer size is less than the minimum buffer size.
  • + *
* @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions* options, char* svgPathBuffer, @@ -932,11 +950,12 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions * @param from Start progress of the motion path. The value ranges from **0.0** to **1.0**. The value of **from** must * be less than or equal to that of **to**; otherwise, {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} is returned. * For details about the meaning of **to**, see {@link OH_ArkUI_MotionPathOptions_SetTo}. - * @return Result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. - *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if **from** is out of the range [0.0, 1.0] or **from** is - * greater than **to**. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if **from** is out of the range [0.0, 1.0] or **from** is + * greater than **to**.
  • + *
* @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* options, const float from); @@ -946,9 +965,10 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* opti * * @param options Pointer to {@link ArkUI_MotionPathOptions}. * @param from Pointer to the variable used to receive the start progress of the motion path. - * @return Result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions* options, float* from); @@ -961,11 +981,12 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions * @param to End progress of the motion path. The value ranges from **0.0** to **1.0**. The value of **to** must be * greater than or equal to that of **from**; otherwise, {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} is returned. * For details about the meaning of **from**, see {@link OH_ArkUI_MotionPathOptions_SetFrom}. - * @return Result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. - *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if **to** is out of the range [0.0, 1.0] or **to** is less than - * **from**. + * @return
    . + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} if **to** is out of the range [0.0, 1.0] or **to** is less than + * **from**.
  • + *
* @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* options, const float to); @@ -975,9 +996,10 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* option * * @param options Pointer to {@link ArkUI_MotionPathOptions}. * @param to Pointer to the variable used to receive the end progress of the motion path. - * @return Result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* options, float* to); @@ -989,9 +1011,10 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* * @param rotatable Whether the component rotates along the path. The value **true** means that the component rotates * along the path, and **false** means that the component does not rotate along the path. The default value is * **false**. - * @return Result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* options, const bool rotatable); @@ -1003,9 +1026,10 @@ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* * @param rotatable Pointer to the variable used to receive the value of **rotatable**, which indicates whether the * component rotates along the path. The value **true** means that the component rotates along the path, and * **false** means that the component does not rotate along the path. - * @return Result code. - *
{@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 23 */ ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetRotatable(const ArkUI_MotionPathOptions* options, bool* rotatable); @@ -1032,9 +1056,10 @@ void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param radius Blur radius of the shadow, in vp. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options, float radius); @@ -1044,9 +1069,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param radius Pointer to the blur radius of the shadow, in vp. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options, float* radius); @@ -1056,9 +1082,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param type Shadow type ({@link ArkUI_ShadowType}). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType type); @@ -1068,9 +1095,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param type Shadow type ({@link ArkUI_ShadowType}). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType* type); @@ -1080,9 +1108,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param color Shadow color, in 0xARGB format. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, uint32_t color); @@ -1092,9 +1121,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param color Pointer to the shadow color, in 0xARGB format. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, uint32_t* color); @@ -1104,9 +1134,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param offsetX Shadow offset on the x-axis, in vp. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* options, float offsetX); @@ -1116,9 +1147,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* option * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param offsetX Pointer to the shadow offset on the x-axis, in vp. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* options, float* offsetX); @@ -1128,9 +1160,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* option * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param offsetY Shadow offset on the y-axis, in vp. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* options, float offsetY); @@ -1140,9 +1173,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* option * * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param offsetY Pointer to the shadow offset on the y-axis, in vp. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* options, float* offsetY); @@ -1153,9 +1187,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* option * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param isFill Whether to fill a component with a shadow. **true** means to fill a component with a shadow, and ** * false** means the opposite. The default value is **false**. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, bool isFill); @@ -1166,9 +1201,10 @@ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, * @param options Pointer to the {@link OH_ArkUI_ShadowOptions} object. * @param isFill Pointer to the **isFill** parameter indicating whether a component is filled with a shadow. **true** * means that a component is filled with a shadow, and **false** means the opposite. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetFill(OH_ArkUI_ShadowOptions* options, bool* isFill); @@ -1203,9 +1239,10 @@ void OH_ArkUI_Matrix4ScaleOptions_Dispose(ArkUI_Matrix4ScaleOptions* options); * * @param options Pointer to the scaling parameter object for matrix operations. * @param scaleX Scaling factor in the x direction. The value range is (-∞, +∞). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetX(ArkUI_Matrix4ScaleOptions* options, const float scaleX); @@ -1216,9 +1253,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetX(ArkUI_Matrix4ScaleOptions* opt * * @param options Pointer to the scaling parameter object for matrix operations. * @param scaleX Pointer to the scaling factor in the x direction. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetX(const ArkUI_Matrix4ScaleOptions* options, float* scaleX); @@ -1228,9 +1266,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetX(const ArkUI_Matrix4ScaleOption * * @param options Pointer to the scaling parameter object for matrix operations. * @param scaleY Scaling factor in the y direction. The value range is (-∞, +∞). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetY(ArkUI_Matrix4ScaleOptions* options, const float scaleY); @@ -1241,9 +1280,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetY(ArkUI_Matrix4ScaleOptions* opt * * @param options Pointer to the scaling parameter object for matrix operations. * @param scaleY Pointer to the scaling factor in the y direction. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetY(const ArkUI_Matrix4ScaleOptions* options, float* scaleY); @@ -1253,9 +1293,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetY(const ArkUI_Matrix4ScaleOption * * @param options Pointer to the scaling parameter object for matrix operations. * @param scaleZ Scaling factor in the z direction. The value range is (-∞, +∞). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetZ(ArkUI_Matrix4ScaleOptions* options, const float scaleZ); @@ -1266,9 +1307,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetZ(ArkUI_Matrix4ScaleOptions* opt * * @param options Pointer to the scaling parameter object for matrix operations. * @param scaleZ Pointer to the scaling factor in the z direction. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetZ(const ArkUI_Matrix4ScaleOptions* options, float* scaleZ); @@ -1280,9 +1322,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetZ(const ArkUI_Matrix4ScaleOption * @param options Pointer to the scaling parameter object for matrix operations. * @param centerX X-coordinate of the transformation center point. The value range is (-∞, +∞). **0** indicates that * there is no x-axis offset based on the transformation center. The unit is px. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterX(ArkUI_Matrix4ScaleOptions* options, const float centerX); @@ -1294,9 +1337,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterX(ArkUI_Matrix4ScaleOption * @param options Pointer to the scaling parameter object for matrix operations. * @param centerX Pointer to the X-coordinate of the transformation center point. The unit is px. The default value is * * **0**. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterX(const ArkUI_Matrix4ScaleOptions* options, float* centerX); @@ -1308,9 +1352,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterX(const ArkUI_Matrix4Scale * @param options Pointer to the scaling parameter object for matrix operations. * @param centerY Y-coordinate of the transformation center point. The value range is (-∞, +∞). **0** indicates that * there is no y-axis offset based on the transformation center. The unit is px. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterY(ArkUI_Matrix4ScaleOptions* options, const float centerY); @@ -1322,9 +1367,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterY(ArkUI_Matrix4ScaleOption * @param options Pointer to the scaling parameter object for matrix operations. * @param centerY Pointer to the Y-coordinate of the transformation center point. The unit is px. The default value is * * **0**. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterY(const ArkUI_Matrix4ScaleOptions* options, float* centerY); @@ -1363,9 +1409,10 @@ void OH_ArkUI_Matrix4RotationOptions_Dispose(ArkUI_Matrix4RotationOptions* optio * * @param options Pointer to the rotation parameter object for matrix operations. * @param x Value of the direction vector in the x direction. The value range is (-∞, +∞). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetX(ArkUI_Matrix4RotationOptions* options, const float x); @@ -1378,9 +1425,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetX(ArkUI_Matrix4RotationOption * @param options Pointer to the rotation parameter object for matrix operations. * @param x Pointer to the value of the direction vector in the x direction. If the value of x has never been set, the * value is undefined. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetX(const ArkUI_Matrix4RotationOptions* options, float* x); @@ -1390,9 +1438,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetX(const ArkUI_Matrix4Rotation * * @param options Pointer to the rotation parameter object for matrix operations. * @param y Value of the direction vector in the y direction. The value range is (-∞, +∞). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetY(ArkUI_Matrix4RotationOptions* options, const float y); @@ -1405,9 +1454,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetY(ArkUI_Matrix4RotationOption * @param options Pointer to the rotation parameter object for matrix operations. * @param y Pointer to the value of the direction vector in the y direction. If the value of y has never been set, the * value is undefined. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetY(const ArkUI_Matrix4RotationOptions* options, float* y); @@ -1417,9 +1467,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetY(const ArkUI_Matrix4Rotation * * @param options Pointer to the rotation parameter object for matrix operations. * @param z Value of the direction vector in the z direction. The value range is (-∞, +∞). - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetZ(ArkUI_Matrix4RotationOptions* options, const float z); @@ -1432,9 +1483,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetZ(ArkUI_Matrix4RotationOption * @param options Pointer to the rotation parameter object for matrix operations. * @param z Pointer to the value of the direction vector in the z direction. If the value of z has never been set, the * value is undefined. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetZ(const ArkUI_Matrix4RotationOptions* options, float* z); @@ -1444,9 +1496,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetZ(const ArkUI_Matrix4Rotation * * @param options Pointer to the rotation parameter object for matrix operations. * @param angle Value of the rotation angle. The value range is (-∞, +∞). The unit is degree. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetAngle(ArkUI_Matrix4RotationOptions* options, const float angle); @@ -1457,9 +1510,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetAngle(ArkUI_Matrix4RotationOp * @param options Pointer to the rotation parameter object for matrix operations. * @param angle Pointer to the value of the rotation angle. The unit is degree. If the angle has never been set, the * default value is **0**. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetAngle(const ArkUI_Matrix4RotationOptions* options, float* angle); @@ -1472,9 +1526,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetAngle(const ArkUI_Matrix4Rota * @param centerX X-axis offset of a single matrix transformation center point relative to a component transformation * center point. The value range is (-∞, +∞). **0** indicates that there is no x-axis offset based on the * transformation center. The unit is px. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterX(ArkUI_Matrix4RotationOptions* options, const float centerX); @@ -1486,9 +1541,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterX(ArkUI_Matrix4Rotation * @param options Pointer to the rotation parameter object for matrix operations. * @param centerX Pointer to the x-axis offset of a single matrix transformation center point relative to a component * transformation center point. The unit is px. If **centerX** has never been set, the default value is **0**. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterX(const ArkUI_Matrix4RotationOptions* options, float* centerX); @@ -1501,9 +1557,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterX(const ArkUI_Matrix4Ro * @param centerY Y-axis offset of a single matrix transformation center point relative to a component transformation * center point. The value range is (-∞, +∞). **0** indicates that there is no y-axis offset based on the * transformation center. The unit is px. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterY(ArkUI_Matrix4RotationOptions* options, const float centerY); @@ -1515,9 +1572,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterY(ArkUI_Matrix4Rotation * @param options Pointer to the rotation parameter object for matrix operations. * @param centerY Pointer to the y-axis offset of a single matrix transformation center point relative to a component * transformation center point. The unit is px. If **centerY** has never been set, the default value is **0**. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
curs. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterY(const ArkUI_Matrix4RotationOptions* options, float* centerY); @@ -1552,9 +1610,10 @@ void OH_ArkUI_Matrix4TranslationOptions_Dispose(ArkUI_Matrix4TranslationOptions* * @param options Pointer to the translation parameter object for matrix operations. * @param x Translation value on the x-axis. The value range is (-∞, +∞). The unit is px. If the value of x has never * been set, the default value is **0**. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetX(ArkUI_Matrix4TranslationOptions* options, const float x); @@ -1564,9 +1623,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetX(ArkUI_Matrix4Translation * * @param options Pointer to the translation parameter object for matrix operations. * @param x Pointer to the translation value on the x-axis. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4TranslationOptions* options, float* x); @@ -1577,9 +1637,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4Trans * @param options Pointer to the translation parameter object for matrix operations. * @param y Translation value on the y-axis. The value range is (-∞, +∞). The unit is px. If the value of y has never * been set, the default value is **0**. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetY(ArkUI_Matrix4TranslationOptions* options, const float y); @@ -1589,9 +1650,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetY(ArkUI_Matrix4Translation * * @param options Pointer to the translation parameter object for matrix operations. * @param y Pointer to the translation value on the y-axis. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetY(const ArkUI_Matrix4TranslationOptions* options, float* y); @@ -1602,9 +1664,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetY(const ArkUI_Matrix4Trans * @param options Pointer to the translation parameter object for matrix operations. * @param z Translation value on the z-axis. The value range is (-∞, +∞). The unit is px. If the value of z has never * been set, the default value is **0**. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
. * @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetZ(ArkUI_Matrix4TranslationOptions* options, const float z); @@ -1614,9 +1677,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetZ(ArkUI_Matrix4Translation * * @param options Pointer to the translation parameter object for matrix operations. * @param z Pointer to the translation value on the z-axis. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetZ(const ArkUI_Matrix4TranslationOptions* options, float* z); @@ -1662,9 +1726,10 @@ ArkUI_Matrix4* OH_ArkUI_Matrix4_Copy(const ArkUI_Matrix4* matrix); * @brief Performs an inverse matrix transformation on the input matrix. * * @param matrix Pointer to the fourth-order matrix object to be inverted. - * @return Result code. - *
Returns {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful. - *
Returns {@link ARKUI_ERROR_CODE_PARAM_INVALID} if the matrix is not invertible. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Invert(ArkUI_Matrix4* matrix); @@ -1676,9 +1741,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4_Invert(ArkUI_Matrix4* matrix); * * @param oriMatrix Pointer to the original fourth-order matrix object. * @param anotherMatrix Pointer to another matrix object to be combined. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Combine(ArkUI_Matrix4* oriMatrix, const ArkUI_Matrix4* anotherMatrix); @@ -1690,9 +1756,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4_Combine(ArkUI_Matrix4* oriMatrix, const ArkUI_M * * @param matrix Pointer to the fourth-order matrix object to be translated. * @param translate Pointer to the translation object. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Translate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4TranslationOptions* translate); @@ -1703,9 +1770,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4_Translate(ArkUI_Matrix4* matrix, const ArkUI_Ma * * @param matrix Pointer to the fourth-order matrix object to be scaled. * @param scale Pointer to the scaling object. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Scale(ArkUI_Matrix4* matrix, const ArkUI_Matrix4ScaleOptions* scale); @@ -1716,9 +1784,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4_Scale(ArkUI_Matrix4* matrix, const ArkUI_Matrix * * @param matrix Pointer to the fourth-order matrix object to be rotated. * @param rotate Pointer to the rotation object. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Rotate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4RotationOptions* rotate); @@ -1730,9 +1799,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4_Rotate(ArkUI_Matrix4* matrix, const ArkUI_Matri * @param matrix Pointer to the fourth-order matrix object to be skewed. * @param skewX Skew coefficient in the x direction. * @param skewY Skew coefficient in the y direction. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_Skew(ArkUI_Matrix4* matrix, const float skewX, const float skewY); @@ -1743,9 +1813,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4_Skew(ArkUI_Matrix4* matrix, const float skewX, * @param matrix Pointer to the fourth-order matrix object. * @param oriPoint Pointer to the original coordinate point. * @param result Pointer to the result point. This parameter cannot be set to a null pointer. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_TransformPoint(const ArkUI_Matrix4* matrix, const ArkUI_PointF* oriPoint, ArkUI_PointF* result); @@ -1759,9 +1830,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4_TransformPoint(const ArkUI_Matrix4* matrix, con * **pointCount**. * @param dst Pointer to the array of mapped polygon coordinate points. The array length must be at least **pointCount**. * @param pointCount Number of polygon points, which must be one of the values 0, 1, 2, 3, or 4. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_SetPolyToPoly(ArkUI_Matrix4* matrix, const ArkUI_PointF* src, const ArkUI_PointF* dst, const uint32_t pointCount); @@ -1772,9 +1844,10 @@ ArkUI_ErrorCode OH_ArkUI_Matrix4_SetPolyToPoly(ArkUI_Matrix4* matrix, const ArkU * @param matrix Pointer to the fourth-order matrix object. * @param result Pointer to an array that can hold 16 floating-point numbers. This parameter cannot be set to a null * pointer. - * @return 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. + * @return
    + *
  • {@link ARKUI_ERROR_CODE_NO_ERROR} if the operation is successful.
  • + *
  • {@link ARKUI_ERROR_CODE_PARAM_INVALID} if a parameter exception occurs.
  • + *
* @since 24 */ ArkUI_ErrorCode OH_ArkUI_Matrix4_GetElements(const ArkUI_Matrix4* matrix, float* result); From 030c5689c2277cf245a23ddf721099cff618c7ef Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Fri, 12 Jun 2026 16:15:50 +0800 Subject: [PATCH 41/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] Change-Id: Idbb61041ca00bf6ee343feb9de3dc176097ca4eb --- .../ace_engine/native/native_type_visual.h | 3247 ++++++++--------- 1 file changed, 1623 insertions(+), 1624 deletions(-) diff --git a/zh-cn/arkui/ace_engine/native/native_type_visual.h b/zh-cn/arkui/ace_engine/native/native_type_visual.h index 1b7c2ce4c..0110560a8 100644 --- a/zh-cn/arkui/ace_engine/native/native_type_visual.h +++ b/zh-cn/arkui/ace_engine/native/native_type_visual.h @@ -33,1628 +33,1627 @@ * @since 12 */ - #ifndef ARKUI_NATIVE_TYPE_VISUAL_H - #define ARKUI_NATIVE_TYPE_VISUAL_H - - #include - #include - - #ifdef __cplusplus - extern "C" { - #endif - - - /** - * @brief 定义四阶矩阵对象。 - * - * @since 24 - */ - typedef struct ArkUI_Matrix4 ArkUI_Matrix4; - - /** - * @brief 定义阴影类型枚举值。 - * - * @since 12 - */ - typedef enum { - /** - * 彩色阴影。 - */ - ARKUI_SHADOW_TYPE_COLOR = 0, - /** - * 模糊阴影。 - */ - ARKUI_SHADOW_TYPE_BLUR - } ArkUI_ShadowType; - - /** - * @brief 阴影效果枚举值。 - * - * @since 12 - */ - typedef enum { - /** - * 超小阴影。 - */ - ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0, - /** - * 小阴影。 - */ - ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM, - /** - * 中阴影。 - */ - ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD, - /** - * 大阴影。 - */ - ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG, - /** - * 浮动小阴影。 - */ - ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM, - /** - * 浮动中阴影。 - */ - ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD, - } ArkUI_ShadowStyle; - - /** - * @brief 动画曲线枚举值。 - * - * @since 12 - */ - typedef enum { - /** - * 动画从头到尾的速度都是相同。 - */ - ARKUI_CURVE_LINEAR = 0, - /** - * 动画以低速开始,然后加快,在结束前变慢。 - */ - ARKUI_CURVE_EASE, - /** - * 动画以低速开始。 - */ - ARKUI_CURVE_EASE_IN, - /** - * 动画以低速结束。 - */ - ARKUI_CURVE_EASE_OUT, - /** - * 动画以低速开始和结束,提供平滑自然的动画过渡效果。 - */ - ARKUI_CURVE_EASE_IN_OUT, - /** - * 动画标准曲线。 - */ - ARKUI_CURVE_FAST_OUT_SLOW_IN, - /** - * 动画减速曲线。 - */ - ARKUI_CURVE_LINEAR_OUT_SLOW_IN, - /** - * 动画加速曲线。 - */ - ARKUI_CURVE_FAST_OUT_LINEAR_IN, - /** - * 动画急缓曲线。 - */ - ARKUI_CURVE_EXTREME_DECELERATION, - /** - * 动画锐利曲线。 - */ - ARKUI_CURVE_SHARP, - /** - * 动画节奏曲线。 - */ - ARKUI_CURVE_RHYTHM, - /** - * 动画平滑曲线。 - */ - ARKUI_CURVE_SMOOTH, - /** - * 动画阻尼曲线。 - */ - ARKUI_CURVE_FRICTION, - } ArkUI_AnimationCurve; - - /** - * @brief 定义动画播放模式。 - * - * @since 12 - */ - typedef enum { - /** - * 动画正向播放。 - */ - ARKUI_ANIMATION_PLAY_MODE_NORMAL = 0, - /** - * 动画反向播放。 - */ - ARKUI_ANIMATION_PLAY_MODE_REVERSE, - /** - * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 - */ - ARKUI_ANIMATION_PLAY_MODE_ALTERNATE, - /** - * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 - */ - ARKUI_ANIMATION_PLAY_MODE_ALTERNATE_REVERSE, - } ArkUI_AnimationPlayMode; - - /** - * @brief 定义背景模糊样式。 - * - * @since 12 - */ - typedef enum { - /** - * 轻薄材质模糊。 - */ - ARKUI_BLUR_STYLE_THIN = 0, - /** - * 普通厚度材质模糊。 - */ - ARKUI_BLUR_STYLE_REGULAR, - /** - * 厚材质模糊。 - */ - ARKUI_BLUR_STYLE_THICK, - /** - * 近距景深模糊。 - */ - ARKUI_BLUR_STYLE_BACKGROUND_THIN, - /** - * 中距景深模糊。 - */ - ARKUI_BLUR_STYLE_BACKGROUND_REGULAR, - /** - * 远距景深模糊。 - */ - ARKUI_BLUR_STYLE_BACKGROUND_THICK, - /** - * 超远距景深模糊。 - */ - ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK, - /** - * 关闭模糊。 - */ - ARKUI_BLUR_STYLE_NONE, - /** - * 组件超轻薄材质模糊。 - */ - ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN, - /** - * 组件轻薄材质模糊。 - */ - ARKUI_BLUR_STYLE_COMPONENT_THIN, - /** - * 组件普通材质模糊。 - */ - ARKUI_BLUR_STYLE_COMPONENT_REGULAR, - /** - * 组件厚材质模糊。 - */ - ARKUI_BLUR_STYLE_COMPONENT_THICK, - /** - * 组件超厚材质模糊。 - */ - ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK, - } ArkUI_BlurStyle; - - /** - * @brief 定义背景模糊激活策略。 - * - * @since 19 - */ - typedef enum { - /** - * 跟随窗口焦点状态变化,窗口非焦点状态不激活,窗口焦点状态激活。 - */ - ARKUI_BLUR_STYLE_ACTIVE_POLICY_FOLLOWS_WINDOW_ACTIVE_STATE = 0, - /** - * 始终激活。 - */ - ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_ACTIVE, - /** - * 始终不激活。 - */ - ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_INACTIVE, - } ArkUI_BlurStyleActivePolicy; - - /** - * @brief 混合模式枚举值。 - * - * @since 12 - */ - typedef enum { - /** - * 将上层图像直接覆盖到下层图像上,不进行任何混合操作。 - */ - ARKUI_BLEND_MODE_NONE = 0, - /** - * 将源像素覆盖的目标像素清除为完全透明。 - */ - ARKUI_BLEND_MODE_CLEAR, - /** - * r = s,只显示源像素。 - */ - ARKUI_BLEND_MODE_SRC, - /** - * r = d,只显示目标像素。 - */ - ARKUI_BLEND_MODE_DST, - /** - * r = s + (1 - sa) * d,将源像素按照透明度进行混合,覆盖在目标像素上。 - */ - ARKUI_BLEND_MODE_SRC_OVER, - /** - * r = d + (1 - da) * s,将目标像素按照透明度进行混合,覆盖在源像素上。 - */ - ARKUI_BLEND_MODE_DST_OVER, - /** - * r = s * da,只显示源像素中与目标像素重叠的部分。 - */ - ARKUI_BLEND_MODE_SRC_IN, - /** - * r = d * sa,只显示目标像素中与源像素重叠的部分。 - */ - ARKUI_BLEND_MODE_DST_IN, - /** - * r = s * (1 - da),只显示源像素中与目标像素不重叠的部分。 - */ - ARKUI_BLEND_MODE_SRC_OUT, - /** - * r = d * (1 - sa),只显示目标像素中与源像素不重叠的部分。 - */ - ARKUI_BLEND_MODE_DST_OUT, - /** - * r = s * da + d * (1 - sa),在源像素和目标像素重叠的地方绘制源像素,在源像素和目标像素不重叠的地方绘制目标像素。 - */ - ARKUI_BLEND_MODE_SRC_ATOP, - /** - * r = d * sa + s * (1 - da),在源像素和目标像素重叠的地方绘制目标像素,在源像素和目标像素不重叠的地方绘制源像素。 - */ - ARKUI_BLEND_MODE_DST_ATOP, - /** - * r = s * (1 - da) + d * (1 - sa),只显示源像素与目标像素不重叠的部分。 - */ - ARKUI_BLEND_MODE_XOR, - /** - * r = min(s + d, 1),将源像素值与目标像素值相加,并将结果作为新的像素值。 - */ - ARKUI_BLEND_MODE_PLUS, - /** - * r = s * d,将源像素与目标像素进行乘法运算,并将结果作为新的像素值。 - */ - ARKUI_BLEND_MODE_MODULATE, - /** - * r = s + d - s * d,将两个图像的像素值相加,然后减去它们的乘积来实现混合。 - */ - ARKUI_BLEND_MODE_SCREEN, - /** - * 根据目标像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 - */ - ARKUI_BLEND_MODE_OVERLAY, - /** - * rc = s + d - max(s * da, d * sa), ra = kSrcOver,当两个颜色重叠时,较暗的颜色会覆盖较亮的颜色。 - */ - ARKUI_BLEND_MODE_DARKEN, - /** - * rc = s + d - min(s * da, d * sa), ra = kSrcOver,将源图像和目标图像中的像素进行比较,选取两者中较亮的像素作为最终的混合结果。 - */ - ARKUI_BLEND_MODE_LIGHTEN, - /** - * 使目标像素变得更亮来反映源像素。 - */ - ARKUI_BLEND_MODE_COLOR_DODGE, - /** - * 使目标像素变得更暗来反映源像素。 - */ - ARKUI_BLEND_MODE_COLOR_BURN, - /** - * 根据源像素的值来决定目标像素变得更亮或者更暗。根据源像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 - */ - ARKUI_BLEND_MODE_HARD_LIGHT, - /** - * 根据源像素来决定使用LIGHTEN混合模式还是DARKEN混合模式。 - */ - ARKUI_BLEND_MODE_SOFT_LIGHT, - /** - * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生高对比度的效果。 - */ - ARKUI_BLEND_MODE_DIFFERENCE, - /** - * rc = s + d - two(s * d), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生柔和的效果。 - */ - ARKUI_BLEND_MODE_EXCLUSION, - /** - * r = s * (1 - da) + d * (1 - sa) + s * d,将源图像与目标图像进行乘法混合,得到一张新的图像。 - */ - ARKUI_BLEND_MODE_MULTIPLY, - /** - * 保留源图像的亮度和饱和度,但会使用目标图像的色调来替换源图像的色调。 - */ - ARKUI_BLEND_MODE_HUE, - /** - * 保留目标像素的亮度和色调,但会使用源像素的饱和度来替换目标像素的饱和度。 - */ - ARKUI_BLEND_MODE_SATURATION, - /** - * 保留源像素的饱和度和色调,但会使用目标像素的亮度来替换源像素的亮度。 - */ - ARKUI_BLEND_MODE_COLOR, - /** - * 保留目标像素的色调和饱和度,但会用源像素的亮度替换目标像素的亮度。 - */ - ARKUI_BLEND_MODE_LUMINOSITY, - } ArkUI_BlendMode; - - /** - * @brief 前景和阴影颜色的枚举值。 - * - * @since 12 - */ - typedef enum { - /** - * 前景色为控件背景色的反色。 - */ - ARKUI_COLOR_STRATEGY_INVERT = 0, - /** - * 控件背景阴影色为控件背景阴影区域的平均色。 - */ - ARKUI_COLOR_STRATEGY_AVERAGE, - /** - * 控件背景阴影色为控件背景阴影区域的主色。 - */ - ARKUI_COLOR_STRATEGY_PRIMARY, - } ArkUI_ColorStrategy; - - /** - * @brief 遮罩类型枚举。遮罩是一种用于限制组件显示区域的手段,它利用特定的形状对组件内容进行裁剪,从而实现只有遮罩区域内的内容才可见的效果。 - * - * @since 12 - */ - typedef enum { - /** - * 矩形类型。 - */ - ARKUI_MASK_TYPE_RECTANGLE = 0, - /** - * 圆形。 - */ - ARKUI_MASK_TYPE_CIRCLE, - /** - * 椭圆形类型。 - */ - ARKUI_MASK_TYPE_ELLIPSE, - /** - * 路径类型。 - */ - ARKUI_MASK_TYPE_PATH, - /** - * 进度类型。 - */ - ARKUI_MASK_TYPE_PROGRESS, - } ArkUI_MaskType; - - /** - * @brief 裁剪类型枚举。 - * - * @since 12 - */ - typedef enum { - /** - * 矩形类型。 - */ - ARKUI_CLIP_TYPE_RECTANGLE = 0, - /** - * 圆形。 - */ - ARKUI_CLIP_TYPE_CIRCLE, - /** - * 椭圆形类型。 - */ - ARKUI_CLIP_TYPE_ELLIPSE, - /** - * 路径类型。 - */ - ARKUI_CLIP_TYPE_PATH, - } ArkUI_ClipType; - - /** - * @brief 自定义形状。 - * - * @since 12 - */ - typedef enum { - /** - * 矩形类型。 - */ - ARKUI_SHAPE_TYPE_RECTANGLE = 0, - /** - * 圆形。 - */ - ARKUI_SHAPE_TYPE_CIRCLE, - /** - * 椭圆形类型。 - */ - ARKUI_SHAPE_TYPE_ELLIPSE, - /** - * 路径类型。 - */ - ARKUI_SHAPE_TYPE_PATH, - } ArkUI_ShapeType; - - /** - * @brief 定义渐变方向结构。 - * - * @since 12 - */ - typedef enum { - /** - * 向左渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT = 0, - /** - * 向上渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_TOP, - /** - * 向右渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT, - /** - * 向下渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_BOTTOM, - /** - * 向左上渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_TOP, - /** - * 向左下渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_BOTTOM, - /** - * 向右上渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_TOP, - /** - * 向右下渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_BOTTOM, - /** - * 不渐变。 - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_NONE, - /** - * 自定义渐变方向. - */ - ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, - } ArkUI_LinearGradientDirection; - - /** - * @brief 定义转场从边缘滑入和滑出的效果。 - * - * @since 12 - */ - typedef enum { - /** - * 转场从窗口的上边缘滑入和滑出。 - */ - ARKUI_TRANSITION_EDGE_TOP = 0, - /** - * 转场从窗口的下边缘滑入和滑出。 - */ - ARKUI_TRANSITION_EDGE_BOTTOM, - /** - * 转场从窗口的左边缘滑入和滑出。 - */ - ARKUI_TRANSITION_EDGE_START, - /** - * 转场从窗口的右边缘滑入和滑出。 - */ - ARKUI_TRANSITION_EDGE_END, - } ArkUI_TransitionEdge; - - /** - * @brief 指定的混合模式应用于视图的内容选项. - * - * @since 12 - */ - typedef enum { - /** - * 在目标图像上按顺序混合视图的内容. - */ - BLEND_APPLY_TYPE_FAST = 0, - /** - * 将此组件和子组件内容绘制到离屏画布上,然后整体进行混合. - */ - BLEND_APPLY_TYPE_OFFSCREEN, - } ArkUI_BlendApplyType; - - /** - * @brief 在动画中定义{@link OH_ArkUI_AnimatorOption_RegisterOnFinishCallback}回调的类型。 - * - * @since 12 - */ - typedef enum { - /** - * 当整个动画结束并立即删除时,将触发回调。 - */ - ARKUI_FINISH_CALLBACK_REMOVED = 0, - /** - * 当动画在逻辑上处于下降状态,但可能仍处于其长尾状态时,将触发回调。长尾状态是指动画即将完全停止前的残余变化过程,此时动画的数值变化已非常微小,接近目标值。 - */ - ARKUI_FINISH_CALLBACK_LOGICALLY, - } ArkUI_FinishCallbackType; - - /** - * @brief 定义动画终态内容大小与位置的枚举值。 - * - * @since 12 - */ - typedef enum { - /** - * 保持动画终态的内容大小,并且内容始终与组件保持中心对齐。 - */ - ARKUI_RENDER_FIT_CENTER = 0, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持顶部中心对齐。 - */ - ARKUI_RENDER_FIT_TOP, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持底部中心对齐。 - */ - ARKUI_RENDER_FIT_BOTTOM, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持左侧对齐。 - */ - ARKUI_RENDER_FIT_LEFT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持右侧对齐。 - */ - ARKUI_RENDER_FIT_RIGHT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持左上角对齐。 - */ - ARKUI_RENDER_FIT_TOP_LEFT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持右上角对齐。 - */ - ARKUI_RENDER_FIT_TOP_RIGHT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持左下角对齐。 - */ - ARKUI_RENDER_FIT_BOTTOM_LEFT, - /** - * 保持动画终态的内容大小,并且内容始终与组件保持右下角对齐。 - */ - ARKUI_RENDER_FIT_BOTTOM_RIGHT, - /** - * 不考虑动画终态内容的宽高比,并且内容始终缩放到组件的大小。 - */ - ARKUI_RENDER_FIT_RESIZE_FILL, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内,且与组件保持中心对齐。 - */ - ARKUI_RENDER_FIT_RESIZE_CONTAIN, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持左侧对齐,当组件高方向有剩余时,内容与组件保持顶部对齐。 - */ - ARKUI_RENDER_FIT_RESIZE_CONTAIN_TOP_LEFT, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持右侧对齐,当组件高方向有剩余时,内容与组件保持底部对齐。 - */ - ARKUI_RENDER_FIT_RESIZE_CONTAIN_BOTTOM_RIGHT, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容两边都大于或等于组件两边,且与组件保持中心对齐,显示内容的中间部分。 - */ - ARKUI_RENDER_FIT_RESIZE_COVER, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持左侧对齐,显示内容的左侧部分。当内容高方向有剩余时,内容与组件保持顶部对齐,显示内容的顶侧部分。 - */ - ARKUI_RENDER_FIT_RESIZE_COVER_TOP_LEFT, - /** - * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持右侧对齐,显示内容的右侧部分。当内容高方向有剩余时,内容与组件保持底部对齐,显示内容的底侧部分。 - */ - ARKUI_RENDER_FIT_RESIZE_COVER_BOTTOM_RIGHT - } ArkUI_RenderFit; - - /** - * @brief 定义帧动画组件在动画开始前和结束后的状态。 - * - * @since 12 +#ifndef ARKUI_NATIVE_TYPE_VISUAL_H +#define ARKUI_NATIVE_TYPE_VISUAL_H + +#include +#include + +#ifdef __cplusplus +extern "C" { +#endif + + +/** + * @brief 定义四阶矩阵对象。 + * + * @since 24 */ - typedef enum { - /** - * 动画未执行时不会将任何样式应用于目标,动画播放完成之后恢复初始默认状态。 - */ - ARKUI_ANIMATION_FILL_MODE_NONE, - /** - * 目标将保留动画执行期间最后一个关键帧的状态。 - */ - ARKUI_ANIMATION_FILL_MODE_FORWARDS, - /** - * 动画将在应用于目标时立即应用第一个关键帧中定义的值,并在{@link delay}期间保留此值。 - */ - ARKUI_ANIMATION_FILL_MODE_BACKWARDS, - /** - * 动画将遵循{@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}和{@link ARKUI_ANIMATION_FILL_MODE_BACKWARDS}的规则,从而在两个方向上扩展动画属性。 - */ - ARKUI_ANIMATION_FILL_MODE_BOTH, - } ArkUI_AnimationFillMode; - - /** - * @brief 定义动画播放模式。 - * - * @since 12 - */ - typedef enum { - /** - * 动画正向循环播放。 - */ - ARKUI_ANIMATION_DIRECTION_NORMAL = 0, - /** - * 动画反向循环播放。 - */ - ARKUI_ANIMATION_DIRECTION_REVERSE, - /** - * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 - */ - ARKUI_ANIMATION_DIRECTION_ALTERNATE, - /** - * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 - */ - ARKUI_ANIMATION_DIRECTION_ALTERNATE_REVERSE, - } ArkUI_AnimationDirection; - - /** - * @brief 定义组件转场时的平移效果对象。 - * - * @since 12 - */ - typedef struct { - /** - * 横向的平移距离,单位为vp。 - */ - float x; - /** - * 纵向的平移距离,单位为vp。 - */ - float y; - /** - * 深度方向的平移距离,单位为vp。 - */ - float z; - } ArkUI_TranslationOptions; - - /** - * @brief 定义组件转场时的缩放效果对象。 - * - * @since 12 - */ - typedef struct { - /** - * x轴的缩放倍数。x>1时以x轴方向放大,01时以y轴方向放大,0新建的{@link ArkUI_MotionPathOptions}对象中,路径动画的运动路径path值为空字符串,路径动画起点进度from值为0,路径动画终点进度to值为1, - * 组件是否沿路径旋转rotatable值为false。 - * @since 23 - */ - ArkUI_MotionPathOptions* OH_ArkUI_MotionPathOptions_Create(); - - /** - * @brief 销毁路径动画的运动路径配置项。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @since 23 - */ - void OH_ArkUI_MotionPathOptions_Dispose(ArkUI_MotionPathOptions* options); - - /** - * @brief 设置路径动画的运动路径。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param svgPath 路径动画的运动路径字符串。 - *
该路径支持使用"start"和"end"作为起点和终点的占位符,例如:"Mstart.x start.y L50 50 Lend.x end.y Z"。路径字符串格式请参考{@link 绘制路径}。若设置为空字符串, - * 等效于未设置路径动画。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ - ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* options, const char* svgPath); - - /** - * @brief 获取路径动画的运动路径配置项中存储的运动路径字符串。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param svgPathBuffer 存储运动路径字符串的缓冲区指针。 - * @param bufferSize svgPathBuffer参数的缓冲区大小。 - * @param writeLength 返回{@link ARKUI_ERROR_CODE_NO_ERROR}时,表示实际写入缓冲区的字符串长度。 - *
返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}时,表示如果为入参异常,writeLength不会被赋值,如果为拷贝异常,writeLength为可容纳目标字符串的最小缓冲区大小。 - *
返回{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR}时,表示可容纳目标字符串的最小缓冲区大小。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - *
{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} 缓冲区大小不足。 - * @since 23 - */ - ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions* options, char* svgPathBuffer, - const int32_t bufferSize, int32_t* writeLength); - - /** - * @brief 设置路径动画起点进度。进度指已移动路径长度与总路径长度的比值。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param from 路径动画的起点进度,取值范围为[0.0, 1.0],且需满足from小于或等于终点进度to,否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 - *
to的含义参考{@link OH_ArkUI_MotionPathOptions_SetTo}。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} from超出[0.0, 1.0]范围,或from大于终点进度to。 - * @since 23 - */ - ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* options, const float from); - - /** - * @brief 获取路径动画的运动路径配置项中的路径动画起点进度。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param from 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中起点进度值的指针。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ - ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions* options, float* from); - - /** - * @brief 设置路径动画终点进度。进度指已移动路径长度与总路径长度的比值。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param to 路径动画的终点进度,取值范围为[0.0, 1.0],且需满足to大或等于起点进度from;否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 - *
from的含义参考{@link OH_ArkUI_MotionPathOptions_SetFrom}。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} to超出[0.0, 1.0]范围,或to小于起点进度from。 - * @since 23 - */ - ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* options, const float to); - - /** - * @brief 获取路径动画的运动路径配置项中的路径动画终点进度。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param to 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中终点进度值的指针。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ - ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* options, float* to); - - /** - * @brief 设置组件是否沿运动路径旋转。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param rotatable 组件是否沿路径旋转。true表示组件沿路径旋转;false表示组件不沿路径旋转。默认值:false。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ - ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* options, const bool rotatable); - - /** - * @brief 获取组件是否沿运动路径旋转。 - * - * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 - * @param rotatable 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中rotatable参数值的指针,表示组件是否沿路径旋转。 - *
true表示组件沿路径旋转;false表示组件不沿路径旋转。 - * @return 错误码。 - *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 - *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 - * @since 23 - */ - ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetRotatable(const ArkUI_MotionPathOptions* options, bool* rotatable); - - /** - * @brief 创建一个阴影选项对象。当该对象不再使用时,请调用{@link OH_ArkUI_ShadowOptions_Destroy}销毁。 - * - * @return 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @since 24 - */ - OH_ArkUI_ShadowOptions* OH_ArkUI_ShadowOptions_Create(); - - /** - * @brief 销毁阴影选项对象。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @since 24 - */ - void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); - - /** - * @brief 设置阴影选项的模糊半径。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param radius 阴影的模糊半径,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options, float radius); - - /** - * @brief 获取阴影选项的模糊半径。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param radius 阴影的模糊半径,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options, float* radius); - - /** - * @brief 设置阴影选项的阴影类型。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param type 阴影类型{@link ArkUI_ShadowType}。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType type); - - /** - * @brief 获取阴影选项的阴影类型。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param type 阴影类型{@link ArkUI_ShadowType}。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType* type); - - /** - * @brief 设置阴影选项的阴影颜色。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param color 阴影颜色,0xARGB格式。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, uint32_t color); - - /** - * @brief 获取阴影选项的阴影颜色。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param color 阴影颜色,0xARGB格式。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, uint32_t* color); - - /** - * @brief 设置阴影在x轴上的偏移量。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param offsetX 阴影在x轴上的偏移量,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* options, float offsetX); - - /** - * @brief 获取阴影在x轴上的偏移量。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param offsetX 阴影在x轴上的偏移量,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* options, float* offsetX); - - /** - * @brief 设置阴影在y轴上的偏移量。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param offsetY 阴影在y轴上的偏移量,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* options, float offsetY); - - /** - * @brief 获取阴影在y轴上的偏移量。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param offsetY 阴影在y轴上的偏移量,单位为vp。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* options, float* offsetY); - - /** - * @brief 设置是否用阴影填充组件内部。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。默认值为false。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, bool isFill); - - /** - * @brief 获取是否用阴影填充组件内部。 - * - * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 - * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。 - * @return 返回结果码。 - *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetFill(OH_ArkUI_ShadowOptions* options, bool* isFill); - - /** - * @brief 定义矩阵缩放的缩放对象。 - * - * @since 24 - */ - typedef struct ArkUI_Matrix4ScaleOptions ArkUI_Matrix4ScaleOptions; - - /** - * @brief 创建指向矩阵运算的缩放参数对象的指针。在新创建的对象中,x、y和z轴方向的缩放系数默认值,为1。变换中心点的x轴坐标centerX、变换中心点的y轴坐标centerY取默认值,为0。 - * - * @return 返回指向新创建的{@link ArkUI_Matrix4ScaleOptions}的指针。 - * @since 24 - */ - ArkUI_Matrix4ScaleOptions* OH_ArkUI_Matrix4ScaleOptions_Create(); - - /** - * @brief 销毁指向矩阵运算的缩放参数对象的指针。 - * - * @param options 指向要销毁的{@link ArkUI_Matrix4ScaleOptions}对象的指针。 - * @since 24 - */ - void OH_ArkUI_Matrix4ScaleOptions_Dispose(ArkUI_Matrix4ScaleOptions* options); - - /** - * @brief 设置矩阵运算的缩放参数对象x方向的缩放因子。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleX x方向的缩放因子。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetX(ArkUI_Matrix4ScaleOptions* options, const float scaleX); - - /** - * @brief 获取矩阵运算的缩放参数对象x方向的缩放因子。如果从未设置x的值,则x方向的缩放因子默认值为1。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleX x方向的缩放因子。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetX(const ArkUI_Matrix4ScaleOptions* options, float* scaleX); - - /** - * @brief 设置矩阵运算的缩放参数对象y方向的缩放因子。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleY y方向的缩放因子。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetY(ArkUI_Matrix4ScaleOptions* options, const float scaleY); - - /** - * @brief 获取矩阵运算的缩放参数对象y方向的缩放因子。如果从未设置y的值,则y方向的缩放因子默认值为1。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleY y方向的缩放因子。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetY(const ArkUI_Matrix4ScaleOptions* options, float* scaleY); - - /** - * @brief 设置矩阵运算的缩放参数对象z方向的缩放因子。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleZ z方向的缩放因子。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetZ(ArkUI_Matrix4ScaleOptions* options, const float scaleZ); - - /** - * @brief 获取矩阵运算的缩放参数对象z方向的缩放因子。如果从未设置z的值,则z方向的缩放因子默认值为1。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param scaleZ z方向的缩放因子。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetZ(const ArkUI_Matrix4ScaleOptions* options, float* scaleZ); - - /** - * @brief 设置矩阵运算的缩放参数对象变换中心点的x轴坐标。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param centerX 变换中心点的x轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterX(ArkUI_Matrix4ScaleOptions* options, const float centerX); - - /** - * @brief 获取矩阵运算的缩放参数对象变换中心点的x轴坐标。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param centerX 变换中心点的x轴坐标。单位为px。默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterX(const ArkUI_Matrix4ScaleOptions* options, float* centerX); - - /** - * @brief 设置矩阵运算的缩放参数对象变换中心点的y轴坐标。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param centerY 变换中心点的y轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterY(ArkUI_Matrix4ScaleOptions* options, const float centerY); - - /** - * @brief 获取矩阵运算的缩放参数对象变换中心点的y轴坐标。 - * - * @param options 指向矩阵运算的缩放参数对象的指针。 - * @param centerY 变换中心点的y轴坐标。单位为px。默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterY(const ArkUI_Matrix4ScaleOptions* options, float* centerY); - - /** - * @brief 定义矩阵旋转的旋转对象。 - * - * @since 24 - */ - typedef struct ArkUI_Matrix4RotationOptions ArkUI_Matrix4RotationOptions; - - /** - * @brief 创建矩阵运算的旋转参数对象的指针。在新创建的对象中,单次矩阵变换中心点相对于组件变换中心点的x轴偏移值centerX、单次矩阵变换中心点相对于组件变换中心点的y轴偏移值centerY、旋转角度angle的默认值,为0。 - * 如果未指定x、y、z方向的方向向量中的任何一个,则等同于x=0、y=0、z=1,表示绕z轴旋转。一旦指定了x、y、z方向的方向向量中的任意一个,其余未指定的值等同于0。 - * - * @return 返回指向新创建的{@link ArkUI_Matrix4RotationOptions}的指针 - * @since 24 - */ - ArkUI_Matrix4RotationOptions* OH_ArkUI_Matrix4RotationOptions_Create(); - - /** - * @brief 销毁指向矩阵运算的旋转参数对象的指针。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @since 24 - */ - void OH_ArkUI_Matrix4RotationOptions_Dispose(ArkUI_Matrix4RotationOptions* options); - - /** - * @brief 设置矩阵运算的旋转参数对象x方向的方向向量。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param x x轴方向的方向向量的值。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetX(ArkUI_Matrix4RotationOptions* options, const float x); - - /** - * @brief 获取矩阵运算的旋转参数对象x方向的方向向量。如果从未设置过x值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param x x轴方向的方向向量的值。如果从未设置x的值,其值将未定义。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetX(const ArkUI_Matrix4RotationOptions* options, float* x); - - /** - * @brief 设置矩阵运算的旋转参数对象y方向的方向向量。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param y y轴方向的方向向量的值。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetY(ArkUI_Matrix4RotationOptions* options, const float y); - - /** - * @brief 获取矩阵运算的旋转参数对象y方向的方向向量。如果从未设置过y值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param y y轴方向的方向向量的值。如果从未设置y的值,其值将未定义。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetY(const ArkUI_Matrix4RotationOptions* options, float* y); - - /** - * @brief 设置矩阵运算的旋转参数对象z方向的方向向量。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param z z轴方向的方向向量的值。取值范围:(-∞, +∞)。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetZ(ArkUI_Matrix4RotationOptions* options, const float z); - - /** - * @brief 获取矩阵运算的旋转参数对象z方向的方向向量。如果从未设置过z值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param z z轴方向的方向向量的值。如果从未设置z的值,其值将未定义。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetZ(const ArkUI_Matrix4RotationOptions* options, float* z); - - /** - * @brief 设置矩阵运算的旋转参数对象中旋转角度的值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param angle 旋转角度的值。取值范围:(-∞, +∞)。单位为度。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetAngle(ArkUI_Matrix4RotationOptions* options, const float angle); - - /** - * @brief 获取矩阵运算的旋转参数对象中旋转角度的值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param angle 旋转角度的值。单位为度。如果从未设置angle的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetAngle(const ArkUI_Matrix4RotationOptions* options, float* angle); - - /** - * @brief 设置单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterX(ArkUI_Matrix4RotationOptions* options, const float centerX); - - /** - * @brief 获取单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。单位为px。如果从未设置centerX的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterX(const ArkUI_Matrix4RotationOptions* options, float* centerX); - - /** - * @brief 设置单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterY(ArkUI_Matrix4RotationOptions* options, const float centerY); - - /** - * @brief 获取单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 - * - * @param options 指向矩阵运算的旋转参数对象的指针。 - * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。单位为px。如果从未设置centerY的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterY(const ArkUI_Matrix4RotationOptions* options, float* centerY); - - /** - * @brief 定义矩阵平移的平移对象。 - * - * @since 24 - */ - typedef struct ArkUI_Matrix4TranslationOptions ArkUI_Matrix4TranslationOptions; - - /** - * @brief 创建指向矩阵运算的平移对象的指针。在新创建的对象中,x轴的平移距离x、y轴的平移距离y和z轴的平移距离z的默认值为0。 - * - * @return 返回指向新创建的{@link ArkUI_Matrix4TranslationOptions}的指针。 - * @since 24 - */ - ArkUI_Matrix4TranslationOptions* OH_ArkUI_Matrix4TranslationOptions_Create(); - - /** - * @brief 销毁指向矩阵运算的平移对象的指针。 - * - * @param options 指向要销毁的{@link ArkUI_Matrix4TranslationOptions}对象的指针。 - * @since 24 - */ - void OH_ArkUI_Matrix4TranslationOptions_Dispose(ArkUI_Matrix4TranslationOptions* options); - - /** - * @brief 设置矩阵运算的平移对象x轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param x x轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置x的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetX(ArkUI_Matrix4TranslationOptions* options, const float x); - - /** - * @brief 获取矩阵运算的平移对象x轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param x x轴方向的平移值。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4TranslationOptions* options, float* x); - - /** - * @brief 设置矩阵运算的平移对象y轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param y y轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置y的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetY(ArkUI_Matrix4TranslationOptions* options, const float y); - - /** - * @brief 获取矩阵运算的平移对象y轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param y y轴方向的平移值。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetY(const ArkUI_Matrix4TranslationOptions* options, float* y); - - /** - * @brief 设置矩阵运算的平移对象z轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param z z轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置z的值,其默认值为0。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetZ(ArkUI_Matrix4TranslationOptions* options, const float z); - - /** - * @brief 获取矩阵运算的平移对象z轴方向的平移值。 - * - * @param options 指向矩阵运算的平移参数对象的指针。 - * @param z z轴方向的平移值。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetZ(const ArkUI_Matrix4TranslationOptions* options, float* z); - - /** - * @brief 创建一个单位四阶矩阵对象。 - * - * @return 返回指向创建的单位四阶矩阵对象的指针。 - * @since 24 - */ - ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateIdentity(); - - /** - * @brief 通过指定矩阵的每个元素来创建一个四阶矩阵对象。 - * - * @param elements 指向预期矩阵元素数据的数组指针。数组长度应大于或等于16。该参数不可为空指针。 - * @return 返回新创建的四阶矩阵对象。如果elements指针为空,函数将返回空值。 - * @since 24 - */ - ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateByElements(const float* elements); - - /** - * @brief 销毁矩阵对象的指针。 - * - * @param matrix 指向要销毁的四阶矩阵对象的指针。 - * @since 24 - */ - void OH_ArkUI_Matrix4_Dispose(ArkUI_Matrix4* matrix); - - /** - * @brief 创建四阶矩阵对象的副本。用于对同一个矩阵进行操作以此获取不同矩阵对象。 - * - * @param matrix 指向原始四阶矩阵对象的指针。 - * @return 返回新创建的四阶矩阵对象。 - * @since 24 - */ - ArkUI_Matrix4* OH_ArkUI_Matrix4_Copy(const ArkUI_Matrix4* matrix); - - /** - * @brief 对输入矩阵执行逆矩阵变换。 - * - * @param matrix 指向要逆矩阵变换的四阶矩阵对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4_Invert(ArkUI_Matrix4* matrix); - - /** - * @brief 将另一个矩阵与原始矩阵合并,并将结果矩阵存储在oriMatrix中。结果矩阵相当于先应用oriMatrix的变换,然后再应用anotherMatrix的变换。此函数将修改oriMatrix对象。 - * - * @param oriMatrix 指向原始四阶矩阵对象的指针。 - * @param anotherMatrix 指向要合并的另一个矩阵对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4_Combine(ArkUI_Matrix4* oriMatrix, const ArkUI_Matrix4* anotherMatrix); - - /** - * @brief 对原始矩阵应用平移变换以获取平移后的矩阵。每次平移变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 - * - * @param matrix 指向待平移四阶矩阵对象的指针。 - * @param translate 指向平移对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4_Translate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4TranslationOptions* translate); - - /** - * @brief 对原始矩阵应用缩放变换以获取缩放后的矩阵。每次缩放变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 - * - * @param matrix 指向待缩放四阶矩阵对象的指针。 - * @param scale 指向缩放对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4_Scale(ArkUI_Matrix4* matrix, const ArkUI_Matrix4ScaleOptions* scale); - - /** - * @brief 对原始矩阵应用旋转变换以获取旋转后的矩阵。每次旋转变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 - * - * @param matrix 指向待旋转四阶矩阵对象的指针。 - * @param rotate 指向旋转对象的指针。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4_Rotate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4RotationOptions* rotate); - - /** - * @brief 对原始矩阵应用倾斜变换以获取倾斜后的矩阵。每次倾斜变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 - * - * @param matrix 指向待倾斜四阶矩阵对象的指针。 - * @param skewX x方向的倾斜系数。 - * @param skewY y方向的倾斜系数。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4_Skew(ArkUI_Matrix4* matrix, const float skewX, const float skewY); - - /** - * @brief 计算一个点经过矩阵变换后的新坐标位置。 - * - * @param matrix 指向四阶矩阵对象的指针。 - * @param oriPoint 指向原始坐标点的指针。 - * @param result 指向结果点的指针。不能为空。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4_TransformPoint(const ArkUI_Matrix4* matrix, const ArkUI_PointF* oriPoint, ArkUI_PointF* result); - - /** - * @brief 将一个多边形的顶点坐标映射到另一个多边形的顶点坐标,并计算所需的矩阵。 - * - * @param matrix 指向四阶矩阵对象的指针,用于存放结果矩阵。 - * @param src 指向原始多边形坐标点数组的指针。数组长度应至少为pointCount。 - * @param dst 指向映射后多边形坐标点数组的指针。数组长度应至少为pointCount。 - * @param pointCount 多边形点的数量,必须是0、1、2、3或4中的一个值。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4_SetPolyToPoly(ArkUI_Matrix4* matrix, const ArkUI_PointF* src, const ArkUI_PointF* dst, const uint32_t pointCount); - - /** - * @brief 获取四阶矩阵的16个元素。 - * - * @param matrix 指向四阶矩阵对象的指针。 - * @param result 指向可容纳16个浮点数的数组的指针。不能为空。 - * @return 错误码。 - *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 - *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 - * @since 24 - */ - ArkUI_ErrorCode OH_ArkUI_Matrix4_GetElements(const ArkUI_Matrix4* matrix, float* result); - - #ifdef __cplusplus - } - #endif - - #endif // ARKUI_NATIVE_TYPE_VISUAL_H - /** @} */ - \ No newline at end of file +typedef struct ArkUI_Matrix4 ArkUI_Matrix4; + +/** + * @brief 定义阴影类型枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 彩色阴影。 + */ + ARKUI_SHADOW_TYPE_COLOR = 0, + /** + * 模糊阴影。 + */ + ARKUI_SHADOW_TYPE_BLUR +} ArkUI_ShadowType; + +/** + * @brief 阴影效果枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 超小阴影。 + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_XS = 0, + /** + * 小阴影。 + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_SM, + /** + * 中阴影。 + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_MD, + /** + * 大阴影。 + */ + ARKUI_SHADOW_STYLE_OUTER_DEFAULT_LG, + /** + * 浮动小阴影。 + */ + ARKUI_SHADOW_STYLE_OUTER_FLOATING_SM, + /** + * 浮动中阴影。 + */ + ARKUI_SHADOW_STYLE_OUTER_FLOATING_MD, +} ArkUI_ShadowStyle; + +/** + * @brief 动画曲线枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 动画从头到尾的速度都是相同。 + */ + ARKUI_CURVE_LINEAR = 0, + /** + * 动画以低速开始,然后加快,在结束前变慢。 + */ + ARKUI_CURVE_EASE, + /** + * 动画以低速开始。 + */ + ARKUI_CURVE_EASE_IN, + /** + * 动画以低速结束。 + */ + ARKUI_CURVE_EASE_OUT, + /** + * 动画以低速开始和结束,提供平滑自然的动画过渡效果。 + */ + ARKUI_CURVE_EASE_IN_OUT, + /** + * 动画标准曲线。 + */ + ARKUI_CURVE_FAST_OUT_SLOW_IN, + /** + * 动画减速曲线。 + */ + ARKUI_CURVE_LINEAR_OUT_SLOW_IN, + /** + * 动画加速曲线。 + */ + ARKUI_CURVE_FAST_OUT_LINEAR_IN, + /** + * 动画急缓曲线。 + */ + ARKUI_CURVE_EXTREME_DECELERATION, + /** + * 动画锐利曲线。 + */ + ARKUI_CURVE_SHARP, + /** + * 动画节奏曲线。 + */ + ARKUI_CURVE_RHYTHM, + /** + * 动画平滑曲线。 + */ + ARKUI_CURVE_SMOOTH, + /** + * 动画阻尼曲线。 + */ + ARKUI_CURVE_FRICTION, +} ArkUI_AnimationCurve; + +/** + * @brief 定义动画播放模式。 + * + * @since 12 + */ +typedef enum { + /** + * 动画正向播放。 + */ + ARKUI_ANIMATION_PLAY_MODE_NORMAL = 0, + /** + * 动画反向播放。 + */ + ARKUI_ANIMATION_PLAY_MODE_REVERSE, + /** + * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 + */ + ARKUI_ANIMATION_PLAY_MODE_ALTERNATE, + /** + * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 + */ + ARKUI_ANIMATION_PLAY_MODE_ALTERNATE_REVERSE, +} ArkUI_AnimationPlayMode; + +/** + * @brief 定义背景模糊样式。 + * + * @since 12 + */ +typedef enum { + /** + * 轻薄材质模糊。 + */ + ARKUI_BLUR_STYLE_THIN = 0, + /** + * 普通厚度材质模糊。 + */ + ARKUI_BLUR_STYLE_REGULAR, + /** + * 厚材质模糊。 + */ + ARKUI_BLUR_STYLE_THICK, + /** + * 近距景深模糊。 + */ + ARKUI_BLUR_STYLE_BACKGROUND_THIN, + /** + * 中距景深模糊。 + */ + ARKUI_BLUR_STYLE_BACKGROUND_REGULAR, + /** + * 远距景深模糊。 + */ + ARKUI_BLUR_STYLE_BACKGROUND_THICK, + /** + * 超远距景深模糊。 + */ + ARKUI_BLUR_STYLE_BACKGROUND_ULTRA_THICK, + /** + * 关闭模糊。 + */ + ARKUI_BLUR_STYLE_NONE, + /** + * 组件超轻薄材质模糊。 + */ + ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THIN, + /** + * 组件轻薄材质模糊。 + */ + ARKUI_BLUR_STYLE_COMPONENT_THIN, + /** + * 组件普通材质模糊。 + */ + ARKUI_BLUR_STYLE_COMPONENT_REGULAR, + /** + * 组件厚材质模糊。 + */ + ARKUI_BLUR_STYLE_COMPONENT_THICK, + /** + * 组件超厚材质模糊。 + */ + ARKUI_BLUR_STYLE_COMPONENT_ULTRA_THICK, +} ArkUI_BlurStyle; + +/** + * @brief 定义背景模糊激活策略。 + * + * @since 19 + */ +typedef enum { + /** + * 跟随窗口焦点状态变化,窗口非焦点状态不激活,窗口焦点状态激活。 + */ + ARKUI_BLUR_STYLE_ACTIVE_POLICY_FOLLOWS_WINDOW_ACTIVE_STATE = 0, + /** + * 始终激活。 + */ + ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_ACTIVE, + /** + * 始终不激活。 + */ + ARKUI_BLUR_STYLE_ACTIVE_POLICY_ALWAYS_INACTIVE, +} ArkUI_BlurStyleActivePolicy; + +/** + * @brief 混合模式枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 将上层图像直接覆盖到下层图像上,不进行任何混合操作。 + */ + ARKUI_BLEND_MODE_NONE = 0, + /** + * 将源像素覆盖的目标像素清除为完全透明。 + */ + ARKUI_BLEND_MODE_CLEAR, + /** + * r = s,只显示源像素。 + */ + ARKUI_BLEND_MODE_SRC, + /** + * r = d,只显示目标像素。 + */ + ARKUI_BLEND_MODE_DST, + /** + * r = s + (1 - sa) * d,将源像素按照透明度进行混合,覆盖在目标像素上。 + */ + ARKUI_BLEND_MODE_SRC_OVER, + /** + * r = d + (1 - da) * s,将目标像素按照透明度进行混合,覆盖在源像素上。 + */ + ARKUI_BLEND_MODE_DST_OVER, + /** + * r = s * da,只显示源像素中与目标像素重叠的部分。 + */ + ARKUI_BLEND_MODE_SRC_IN, + /** + * r = d * sa,只显示目标像素中与源像素重叠的部分。 + */ + ARKUI_BLEND_MODE_DST_IN, + /** + * r = s * (1 - da),只显示源像素中与目标像素不重叠的部分。 + */ + ARKUI_BLEND_MODE_SRC_OUT, + /** + * r = d * (1 - sa),只显示目标像素中与源像素不重叠的部分。 + */ + ARKUI_BLEND_MODE_DST_OUT, + /** + * r = s * da + d * (1 - sa),在源像素和目标像素重叠的地方绘制源像素,在源像素和目标像素不重叠的地方绘制目标像素。 + */ + ARKUI_BLEND_MODE_SRC_ATOP, + /** + * r = d * sa + s * (1 - da),在源像素和目标像素重叠的地方绘制目标像素,在源像素和目标像素不重叠的地方绘制源像素。 + */ + ARKUI_BLEND_MODE_DST_ATOP, + /** + * r = s * (1 - da) + d * (1 - sa),只显示源像素与目标像素不重叠的部分。 + */ + ARKUI_BLEND_MODE_XOR, + /** + * r = min(s + d, 1),将源像素值与目标像素值相加,并将结果作为新的像素值。 + */ + ARKUI_BLEND_MODE_PLUS, + /** + * r = s * d,将源像素与目标像素进行乘法运算,并将结果作为新的像素值。 + */ + ARKUI_BLEND_MODE_MODULATE, + /** + * r = s + d - s * d,将两个图像的像素值相加,然后减去它们的乘积来实现混合。 + */ + ARKUI_BLEND_MODE_SCREEN, + /** + * 根据目标像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 + */ + ARKUI_BLEND_MODE_OVERLAY, + /** + * rc = s + d - max(s * da, d * sa), ra = kSrcOver,当两个颜色重叠时,较暗的颜色会覆盖较亮的颜色。 + */ + ARKUI_BLEND_MODE_DARKEN, + /** + * rc = s + d - min(s * da, d * sa), ra = kSrcOver,将源图像和目标图像中的像素进行比较,选取两者中较亮的像素作为最终的混合结果。 + */ + ARKUI_BLEND_MODE_LIGHTEN, + /** + * 使目标像素变得更亮来反映源像素。 + */ + ARKUI_BLEND_MODE_COLOR_DODGE, + /** + * 使目标像素变得更暗来反映源像素。 + */ + ARKUI_BLEND_MODE_COLOR_BURN, + /** + * 根据源像素的值来决定目标像素变得更亮或者更暗。根据源像素来决定使用MULTIPLY混合模式还是SCREEN混合模式。 + */ + ARKUI_BLEND_MODE_HARD_LIGHT, + /** + * 根据源像素来决定使用LIGHTEN混合模式还是DARKEN混合模式。 + */ + ARKUI_BLEND_MODE_SOFT_LIGHT, + /** + * rc = s + d - 2 * (min(s * da, d * sa)), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生高对比度的效果。 + */ + ARKUI_BLEND_MODE_DIFFERENCE, + /** + * rc = s + d - two(s * d), ra = kSrcOver,对比源像素和目标像素,亮度更高的像素减去亮度更低的像素,产生柔和的效果。 + */ + ARKUI_BLEND_MODE_EXCLUSION, + /** + * r = s * (1 - da) + d * (1 - sa) + s * d,将源图像与目标图像进行乘法混合,得到一张新的图像。 + */ + ARKUI_BLEND_MODE_MULTIPLY, + /** + * 保留源图像的亮度和饱和度,但会使用目标图像的色调来替换源图像的色调。 + */ + ARKUI_BLEND_MODE_HUE, + /** + * 保留目标像素的亮度和色调,但会使用源像素的饱和度来替换目标像素的饱和度。 + */ + ARKUI_BLEND_MODE_SATURATION, + /** + * 保留源像素的饱和度和色调,但会使用目标像素的亮度来替换源像素的亮度。 + */ + ARKUI_BLEND_MODE_COLOR, + /** + * 保留目标像素的色调和饱和度,但会用源像素的亮度替换目标像素的亮度。 + */ + ARKUI_BLEND_MODE_LUMINOSITY, +} ArkUI_BlendMode; + +/** + * @brief 前景和阴影颜色的枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 前景色为控件背景色的反色。 + */ + ARKUI_COLOR_STRATEGY_INVERT = 0, + /** + * 控件背景阴影色为控件背景阴影区域的平均色。 + */ + ARKUI_COLOR_STRATEGY_AVERAGE, + /** + * 控件背景阴影色为控件背景阴影区域的主色。 + */ + ARKUI_COLOR_STRATEGY_PRIMARY, +} ArkUI_ColorStrategy; + +/** + * @brief 遮罩类型枚举。遮罩是一种用于限制组件显示区域的手段,它利用特定的形状对组件内容进行裁剪,从而实现只有遮罩区域内的内容才可见的效果。 + * + * @since 12 + */ +typedef enum { + /** + * 矩形类型。 + */ + ARKUI_MASK_TYPE_RECTANGLE = 0, + /** + * 圆形。 + */ + ARKUI_MASK_TYPE_CIRCLE, + /** + * 椭圆形类型。 + */ + ARKUI_MASK_TYPE_ELLIPSE, + /** + * 路径类型。 + */ + ARKUI_MASK_TYPE_PATH, + /** + * 进度类型。 + */ + ARKUI_MASK_TYPE_PROGRESS, +} ArkUI_MaskType; + +/** + * @brief 裁剪类型枚举。 + * + * @since 12 + */ +typedef enum { + /** + * 矩形类型。 + */ + ARKUI_CLIP_TYPE_RECTANGLE = 0, + /** + * 圆形。 + */ + ARKUI_CLIP_TYPE_CIRCLE, + /** + * 椭圆形类型。 + */ + ARKUI_CLIP_TYPE_ELLIPSE, + /** + * 路径类型。 + */ + ARKUI_CLIP_TYPE_PATH, +} ArkUI_ClipType; + +/** + * @brief 自定义形状。 + * + * @since 12 + */ +typedef enum { + /** + * 矩形类型。 + */ + ARKUI_SHAPE_TYPE_RECTANGLE = 0, + /** + * 圆形。 + */ + ARKUI_SHAPE_TYPE_CIRCLE, + /** + * 椭圆形类型。 + */ + ARKUI_SHAPE_TYPE_ELLIPSE, + /** + * 路径类型。 + */ + ARKUI_SHAPE_TYPE_PATH, +} ArkUI_ShapeType; + +/** + * @brief 定义渐变方向结构。 + * + * @since 12 + */ +typedef enum { + /** + * 向左渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT = 0, + /** + * 向上渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_TOP, + /** + * 向右渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT, + /** + * 向下渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_BOTTOM, + /** + * 向左上渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_TOP, + /** + * 向左下渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_LEFT_BOTTOM, + /** + * 向右上渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_TOP, + /** + * 向右下渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_RIGHT_BOTTOM, + /** + * 不渐变。 + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_NONE, + /** + * 自定义渐变方向. + */ + ARKUI_LINEAR_GRADIENT_DIRECTION_CUSTOM, +} ArkUI_LinearGradientDirection; + +/** + * @brief 定义转场从边缘滑入和滑出的效果。 + * + * @since 12 + */ +typedef enum { + /** + * 转场从窗口的上边缘滑入和滑出。 + */ + ARKUI_TRANSITION_EDGE_TOP = 0, + /** + * 转场从窗口的下边缘滑入和滑出。 + */ + ARKUI_TRANSITION_EDGE_BOTTOM, + /** + * 转场从窗口的左边缘滑入和滑出。 + */ + ARKUI_TRANSITION_EDGE_START, + /** + * 转场从窗口的右边缘滑入和滑出。 + */ + ARKUI_TRANSITION_EDGE_END, +} ArkUI_TransitionEdge; + +/** + * @brief 指定的混合模式应用于视图的内容选项. + * + * @since 12 + */ +typedef enum { + /** + * 在目标图像上按顺序混合视图的内容. + */ + BLEND_APPLY_TYPE_FAST = 0, + /** + * 将此组件和子组件内容绘制到离屏画布上,然后整体进行混合. + */ + BLEND_APPLY_TYPE_OFFSCREEN, +} ArkUI_BlendApplyType; + +/** + * @brief 在动画中定义{@link OH_ArkUI_AnimatorOption_RegisterOnFinishCallback}回调的类型。 + * + * @since 12 + */ +typedef enum { + /** + * 当整个动画结束并立即删除时,将触发回调。 + */ + ARKUI_FINISH_CALLBACK_REMOVED = 0, + /** + * 当动画在逻辑上处于下降状态,但可能仍处于其长尾状态时,将触发回调。长尾状态是指动画即将完全停止前的残余变化过程,此时动画的数值变化已非常微小,接近目标值。 + */ + ARKUI_FINISH_CALLBACK_LOGICALLY, +} ArkUI_FinishCallbackType; + +/** + * @brief 定义动画终态内容大小与位置的枚举值。 + * + * @since 12 + */ +typedef enum { + /** + * 保持动画终态的内容大小,并且内容始终与组件保持中心对齐。 + */ + ARKUI_RENDER_FIT_CENTER = 0, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持顶部中心对齐。 + */ + ARKUI_RENDER_FIT_TOP, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持底部中心对齐。 + */ + ARKUI_RENDER_FIT_BOTTOM, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持左侧对齐。 + */ + ARKUI_RENDER_FIT_LEFT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持右侧对齐。 + */ + ARKUI_RENDER_FIT_RIGHT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持左上角对齐。 + */ + ARKUI_RENDER_FIT_TOP_LEFT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持右上角对齐。 + */ + ARKUI_RENDER_FIT_TOP_RIGHT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持左下角对齐。 + */ + ARKUI_RENDER_FIT_BOTTOM_LEFT, + /** + * 保持动画终态的内容大小,并且内容始终与组件保持右下角对齐。 + */ + ARKUI_RENDER_FIT_BOTTOM_RIGHT, + /** + * 不考虑动画终态内容的宽高比,并且内容始终缩放到组件的大小。 + */ + ARKUI_RENDER_FIT_RESIZE_FILL, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内,且与组件保持中心对齐。 + */ + ARKUI_RENDER_FIT_RESIZE_CONTAIN, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持左侧对齐,当组件高方向有剩余时,内容与组件保持顶部对齐。 + */ + ARKUI_RENDER_FIT_RESIZE_CONTAIN_TOP_LEFT, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容完整显示在组件内。当组件宽方向有剩余时,内容与组件保持右侧对齐,当组件高方向有剩余时,内容与组件保持底部对齐。 + */ + ARKUI_RENDER_FIT_RESIZE_CONTAIN_BOTTOM_RIGHT, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容两边都大于或等于组件两边,且与组件保持中心对齐,显示内容的中间部分。 + */ + ARKUI_RENDER_FIT_RESIZE_COVER, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持左侧对齐,显示内容的左侧部分。当内容高方向有剩余时,内容与组件保持顶部对齐,显示内容的顶侧部分。 + */ + ARKUI_RENDER_FIT_RESIZE_COVER_TOP_LEFT, + /** + * 保持动画终态内容的宽高比进行缩小或放大,使内容的两边都恰好大于或等于组件两边。当内容宽方向有剩余时,内容与组件保持右侧对齐,显示内容的右侧部分。当内容高方向有剩余时,内容与组件保持底部对齐,显示内容的底侧部分。 + */ + ARKUI_RENDER_FIT_RESIZE_COVER_BOTTOM_RIGHT +} ArkUI_RenderFit; + +/** + * @brief 定义帧动画组件在动画开始前和结束后的状态。 + * + * @since 12 +*/ +typedef enum { + /** + * 动画未执行时不会将任何样式应用于目标,动画播放完成之后恢复初始默认状态。 + */ + ARKUI_ANIMATION_FILL_MODE_NONE, + /** + * 目标将保留动画执行期间最后一个关键帧的状态。 + */ + ARKUI_ANIMATION_FILL_MODE_FORWARDS, + /** + * 动画将在应用于目标时立即应用第一个关键帧中定义的值,并在{@link delay}期间保留此值。 + */ + ARKUI_ANIMATION_FILL_MODE_BACKWARDS, + /** + * 动画将遵循{@link ARKUI_ANIMATION_FILL_MODE_FORWARDS}和{@link ARKUI_ANIMATION_FILL_MODE_BACKWARDS}的规则,从而在两个方向上扩展动画属性。 + */ + ARKUI_ANIMATION_FILL_MODE_BOTH, +} ArkUI_AnimationFillMode; + +/** + * @brief 定义动画播放模式。 + * + * @since 12 + */ +typedef enum { + /** + * 动画正向循环播放。 + */ + ARKUI_ANIMATION_DIRECTION_NORMAL = 0, + /** + * 动画反向循环播放。 + */ + ARKUI_ANIMATION_DIRECTION_REVERSE, + /** + * 动画交替循环播放,在奇数次正向播放,在偶数次反向播放。 + */ + ARKUI_ANIMATION_DIRECTION_ALTERNATE, + /** + * 动画反向交替循环播放,在奇数次反向播放,在偶数次正向播放。 + */ + ARKUI_ANIMATION_DIRECTION_ALTERNATE_REVERSE, +} ArkUI_AnimationDirection; + +/** + * @brief 定义组件转场时的平移效果对象。 + * + * @since 12 + */ +typedef struct { + /** + * 横向的平移距离,单位为vp。 + */ + float x; + /** + * 纵向的平移距离,单位为vp。 + */ + float y; + /** + * 深度方向的平移距离,单位为vp。 + */ + float z; +} ArkUI_TranslationOptions; + +/** + * @brief 定义组件转场时的缩放效果对象。 + * + * @since 12 + */ +typedef struct { + /** + * x轴的缩放倍数。x>1时以x轴方向放大,01时以y轴方向放大,0新建的{@link ArkUI_MotionPathOptions}对象中,路径动画的运动路径path值为空字符串,路径动画起点进度from值为0,路径动画终点进度to值为1, + * 组件是否沿路径旋转rotatable值为false。 + * @since 23 + */ +ArkUI_MotionPathOptions* OH_ArkUI_MotionPathOptions_Create(); + +/** + * @brief 销毁路径动画的运动路径配置项。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @since 23 + */ +void OH_ArkUI_MotionPathOptions_Dispose(ArkUI_MotionPathOptions* options); + +/** + * @brief 设置路径动画的运动路径。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param svgPath 路径动画的运动路径字符串。 + *
该路径支持使用"start"和"end"作为起点和终点的占位符,例如:"Mstart.x start.y L50 50 Lend.x end.y Z"。路径字符串格式请参考{@link 绘制路径}。若设置为空字符串, + * 等效于未设置路径动画。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetPath(ArkUI_MotionPathOptions* options, const char* svgPath); + +/** + * @brief 获取路径动画的运动路径配置项中存储的运动路径字符串。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param svgPathBuffer 存储运动路径字符串的缓冲区指针。 + * @param bufferSize svgPathBuffer参数的缓冲区大小。 + * @param writeLength 返回{@link ARKUI_ERROR_CODE_NO_ERROR}时,表示实际写入缓冲区的字符串长度。 + *
返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}时,表示如果为入参异常,writeLength不会被赋值,如果为拷贝异常,writeLength为可容纳目标字符串的最小缓冲区大小。 + *
返回{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR}时,表示可容纳目标字符串的最小缓冲区大小。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + *
{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} 缓冲区大小不足。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetPath(const ArkUI_MotionPathOptions* options, char* svgPathBuffer, + const int32_t bufferSize, int32_t* writeLength); + +/** + * @brief 设置路径动画起点进度。进度指已移动路径长度与总路径长度的比值。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param from 路径动画的起点进度,取值范围为[0.0, 1.0],且需满足from小于或等于终点进度to,否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 + *
to的含义参考{@link OH_ArkUI_MotionPathOptions_SetTo}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} from超出[0.0, 1.0]范围,或from大于终点进度to。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetFrom(ArkUI_MotionPathOptions* options, const float from); + +/** + * @brief 获取路径动画的运动路径配置项中的路径动画起点进度。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param from 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中起点进度值的指针。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetFrom(const ArkUI_MotionPathOptions* options, float* from); + +/** + * @brief 设置路径动画终点进度。进度指已移动路径长度与总路径长度的比值。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param to 路径动画的终点进度,取值范围为[0.0, 1.0],且需满足to大或等于起点进度from;否则将返回{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE}错误码。 + *
from的含义参考{@link OH_ArkUI_MotionPathOptions_SetFrom}。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + *
{@link ARKUI_ERROR_CODE_PARAM_OUT_OF_RANGE} to超出[0.0, 1.0]范围,或to小于起点进度from。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetTo(ArkUI_MotionPathOptions* options, const float to); + +/** + * @brief 获取路径动画的运动路径配置项中的路径动画终点进度。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param to 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中终点进度值的指针。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetTo(const ArkUI_MotionPathOptions* options, float* to); + +/** + * @brief 设置组件是否沿运动路径旋转。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param rotatable 组件是否沿路径旋转。true表示组件沿路径旋转;false表示组件不沿路径旋转。默认值:false。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_SetRotatable(ArkUI_MotionPathOptions* options, const bool rotatable); + +/** + * @brief 获取组件是否沿运动路径旋转。 + * + * @param options 指向路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}的指针。 + * @param rotatable 用于接收路径动画的运动路径配置项{@link ArkUI_MotionPathOptions}中rotatable参数值的指针,表示组件是否沿路径旋转。 + *
true表示组件沿路径旋转;false表示组件不沿路径旋转。 + * @return 错误码。 + *
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 + *
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 + * @since 23 + */ +ArkUI_ErrorCode OH_ArkUI_MotionPathOptions_GetRotatable(const ArkUI_MotionPathOptions* options, bool* rotatable); + +/** + * @brief 创建一个阴影选项对象。当该对象不再使用时,请调用{@link OH_ArkUI_ShadowOptions_Destroy}销毁。 + * + * @return 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @since 24 + */ +OH_ArkUI_ShadowOptions* OH_ArkUI_ShadowOptions_Create(); + +/** + * @brief 销毁阴影选项对象。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @since 24 + */ +void OH_ArkUI_ShadowOptions_Destroy(OH_ArkUI_ShadowOptions* options); + +/** + * @brief 设置阴影选项的模糊半径。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param radius 阴影的模糊半径,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetRadius(OH_ArkUI_ShadowOptions* options, float radius); + +/** + * @brief 获取阴影选项的模糊半径。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param radius 阴影的模糊半径,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetRadius(OH_ArkUI_ShadowOptions* options, float* radius); + +/** + * @brief 设置阴影选项的阴影类型。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param type 阴影类型{@link ArkUI_ShadowType}。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType type); + +/** + * @brief 获取阴影选项的阴影类型。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param type 阴影类型{@link ArkUI_ShadowType}。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetType(OH_ArkUI_ShadowOptions* options, ArkUI_ShadowType* type); + +/** + * @brief 设置阴影选项的阴影颜色。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param color 阴影颜色,0xARGB格式。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetColor(OH_ArkUI_ShadowOptions* options, uint32_t color); + +/** + * @brief 获取阴影选项的阴影颜色。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param color 阴影颜色,0xARGB格式。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetColor(OH_ArkUI_ShadowOptions* options, uint32_t* color); + +/** + * @brief 设置阴影在x轴上的偏移量。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetX 阴影在x轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetX(OH_ArkUI_ShadowOptions* options, float offsetX); + +/** + * @brief 获取阴影在x轴上的偏移量。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetX 阴影在x轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetX(OH_ArkUI_ShadowOptions* options, float* offsetX); + +/** + * @brief 设置阴影在y轴上的偏移量。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetY 阴影在y轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetOffsetY(OH_ArkUI_ShadowOptions* options, float offsetY); + +/** + * @brief 获取阴影在y轴上的偏移量。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param offsetY 阴影在y轴上的偏移量,单位为vp。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetOffsetY(OH_ArkUI_ShadowOptions* options, float* offsetY); + +/** + * @brief 设置是否用阴影填充组件内部。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。默认值为false。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_SetFill(OH_ArkUI_ShadowOptions* options, bool isFill); + +/** + * @brief 获取是否用阴影填充组件内部。 + * + * @param options 指向{@link OH_ArkUI_ShadowOptions}对象的指针。 + * @param isFill 是否用阴影填充组件内部。true表示用阴影填充组件内部,false表示不用阴影填充组件内部。 + * @return 返回结果码。 + *
若操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
若参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_ShadowOptions_GetFill(OH_ArkUI_ShadowOptions* options, bool* isFill); + +/** + * @brief 定义矩阵缩放的缩放对象。 + * + * @since 24 + */ +typedef struct ArkUI_Matrix4ScaleOptions ArkUI_Matrix4ScaleOptions; + +/** + * @brief 创建指向矩阵运算的缩放参数对象的指针。在新创建的对象中,x、y和z轴方向的缩放系数默认值,为1。变换中心点的x轴坐标centerX、变换中心点的y轴坐标centerY取默认值,为0。 + * + * @return 返回指向新创建的{@link ArkUI_Matrix4ScaleOptions}的指针。 + * @since 24 + */ +ArkUI_Matrix4ScaleOptions* OH_ArkUI_Matrix4ScaleOptions_Create(); + +/** + * @brief 销毁指向矩阵运算的缩放参数对象的指针。 + * + * @param options 指向要销毁的{@link ArkUI_Matrix4ScaleOptions}对象的指针。 + * @since 24 + */ +void OH_ArkUI_Matrix4ScaleOptions_Dispose(ArkUI_Matrix4ScaleOptions* options); + +/** + * @brief 设置矩阵运算的缩放参数对象x方向的缩放因子。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleX x方向的缩放因子。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetX(ArkUI_Matrix4ScaleOptions* options, const float scaleX); + +/** + * @brief 获取矩阵运算的缩放参数对象x方向的缩放因子。如果从未设置x的值,则x方向的缩放因子默认值为1。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleX x方向的缩放因子。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetX(const ArkUI_Matrix4ScaleOptions* options, float* scaleX); + +/** + * @brief 设置矩阵运算的缩放参数对象y方向的缩放因子。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleY y方向的缩放因子。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetY(ArkUI_Matrix4ScaleOptions* options, const float scaleY); + +/** + * @brief 获取矩阵运算的缩放参数对象y方向的缩放因子。如果从未设置y的值,则y方向的缩放因子默认值为1。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleY y方向的缩放因子。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetY(const ArkUI_Matrix4ScaleOptions* options, float* scaleY); + +/** + * @brief 设置矩阵运算的缩放参数对象z方向的缩放因子。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleZ z方向的缩放因子。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetZ(ArkUI_Matrix4ScaleOptions* options, const float scaleZ); + +/** + * @brief 获取矩阵运算的缩放参数对象z方向的缩放因子。如果从未设置z的值,则z方向的缩放因子默认值为1。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param scaleZ z方向的缩放因子。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetZ(const ArkUI_Matrix4ScaleOptions* options, float* scaleZ); + +/** + * @brief 设置矩阵运算的缩放参数对象变换中心点的x轴坐标。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerX 变换中心点的x轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterX(ArkUI_Matrix4ScaleOptions* options, const float centerX); + +/** + * @brief 获取矩阵运算的缩放参数对象变换中心点的x轴坐标。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerX 变换中心点的x轴坐标。单位为px。默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterX(const ArkUI_Matrix4ScaleOptions* options, float* centerX); + +/** + * @brief 设置矩阵运算的缩放参数对象变换中心点的y轴坐标。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerY 变换中心点的y轴坐标。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_SetCenterY(ArkUI_Matrix4ScaleOptions* options, const float centerY); + +/** + * @brief 获取矩阵运算的缩放参数对象变换中心点的y轴坐标。 + * + * @param options 指向矩阵运算的缩放参数对象的指针。 + * @param centerY 变换中心点的y轴坐标。单位为px。默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4ScaleOptions_GetCenterY(const ArkUI_Matrix4ScaleOptions* options, float* centerY); + +/** + * @brief 定义矩阵旋转的旋转对象。 + * + * @since 24 + */ +typedef struct ArkUI_Matrix4RotationOptions ArkUI_Matrix4RotationOptions; + +/** + * @brief 创建矩阵运算的旋转参数对象的指针。在新创建的对象中,单次矩阵变换中心点相对于组件变换中心点的x轴偏移值centerX、单次矩阵变换中心点相对于组件变换中心点的y轴偏移值centerY、旋转角度angle的默认值,为0。 + * 如果未指定x、y、z方向的方向向量中的任何一个,则等同于x=0、y=0、z=1,表示绕z轴旋转。一旦指定了x、y、z方向的方向向量中的任意一个,其余未指定的值等同于0。 + * + * @return 返回指向新创建的{@link ArkUI_Matrix4RotationOptions}的指针 + * @since 24 + */ +ArkUI_Matrix4RotationOptions* OH_ArkUI_Matrix4RotationOptions_Create(); + +/** + * @brief 销毁指向矩阵运算的旋转参数对象的指针。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @since 24 + */ +void OH_ArkUI_Matrix4RotationOptions_Dispose(ArkUI_Matrix4RotationOptions* options); + +/** + * @brief 设置矩阵运算的旋转参数对象x方向的方向向量。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param x x轴方向的方向向量的值。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetX(ArkUI_Matrix4RotationOptions* options, const float x); + +/** + * @brief 获取矩阵运算的旋转参数对象x方向的方向向量。如果从未设置过x值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param x x轴方向的方向向量的值。如果从未设置x的值,其值将未定义。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetX(const ArkUI_Matrix4RotationOptions* options, float* x); + +/** + * @brief 设置矩阵运算的旋转参数对象y方向的方向向量。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param y y轴方向的方向向量的值。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetY(ArkUI_Matrix4RotationOptions* options, const float y); + +/** + * @brief 获取矩阵运算的旋转参数对象y方向的方向向量。如果从未设置过y值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param y y轴方向的方向向量的值。如果从未设置y的值,其值将未定义。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetY(const ArkUI_Matrix4RotationOptions* options, float* y); + +/** + * @brief 设置矩阵运算的旋转参数对象z方向的方向向量。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param z z轴方向的方向向量的值。取值范围:(-∞, +∞)。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetZ(ArkUI_Matrix4RotationOptions* options, const float z); + +/** + * @brief 获取矩阵运算的旋转参数对象z方向的方向向量。如果从未设置过z值,其值将处于未定义状态,此时函数将返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param z z轴方向的方向向量的值。如果从未设置z的值,其值将未定义。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetZ(const ArkUI_Matrix4RotationOptions* options, float* z); + +/** + * @brief 设置矩阵运算的旋转参数对象中旋转角度的值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param angle 旋转角度的值。取值范围:(-∞, +∞)。单位为度。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetAngle(ArkUI_Matrix4RotationOptions* options, const float angle); + +/** + * @brief 获取矩阵运算的旋转参数对象中旋转角度的值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param angle 旋转角度的值。单位为度。如果从未设置angle的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetAngle(const ArkUI_Matrix4RotationOptions* options, float* angle); + +/** + * @brief 设置单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有x方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterX(ArkUI_Matrix4RotationOptions* options, const float centerX); + +/** + * @brief 获取单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerX 单次矩阵变换中心点相对于组件变换中心点的x轴偏移值。单位为px。如果从未设置centerX的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterX(const ArkUI_Matrix4RotationOptions* options, float* centerX); + +/** + * @brief 设置单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。取值范围:(-∞, +∞)。0表示在变换中心基础上没有y方向偏移。单位为px。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_SetCenterY(ArkUI_Matrix4RotationOptions* options, const float centerY); + +/** + * @brief 获取单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。 + * + * @param options 指向矩阵运算的旋转参数对象的指针。 + * @param centerY 单次矩阵变换中心点相对于组件变换中心点的y轴偏移值。单位为px。如果从未设置centerY的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4RotationOptions_GetCenterY(const ArkUI_Matrix4RotationOptions* options, float* centerY); + +/** + * @brief 定义矩阵平移的平移对象。 + * + * @since 24 + */ +typedef struct ArkUI_Matrix4TranslationOptions ArkUI_Matrix4TranslationOptions; + +/** + * @brief 创建指向矩阵运算的平移对象的指针。在新创建的对象中,x轴的平移距离x、y轴的平移距离y和z轴的平移距离z的默认值为0。 + * + * @return 返回指向新创建的{@link ArkUI_Matrix4TranslationOptions}的指针。 + * @since 24 + */ +ArkUI_Matrix4TranslationOptions* OH_ArkUI_Matrix4TranslationOptions_Create(); + +/** + * @brief 销毁指向矩阵运算的平移对象的指针。 + * + * @param options 指向要销毁的{@link ArkUI_Matrix4TranslationOptions}对象的指针。 + * @since 24 + */ +void OH_ArkUI_Matrix4TranslationOptions_Dispose(ArkUI_Matrix4TranslationOptions* options); + +/** + * @brief 设置矩阵运算的平移对象x轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param x x轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置x的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetX(ArkUI_Matrix4TranslationOptions* options, const float x); + +/** + * @brief 获取矩阵运算的平移对象x轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param x x轴方向的平移值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetX(const ArkUI_Matrix4TranslationOptions* options, float* x); + +/** + * @brief 设置矩阵运算的平移对象y轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param y y轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置y的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetY(ArkUI_Matrix4TranslationOptions* options, const float y); + +/** + * @brief 获取矩阵运算的平移对象y轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param y y轴方向的平移值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetY(const ArkUI_Matrix4TranslationOptions* options, float* y); + +/** + * @brief 设置矩阵运算的平移对象z轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param z z轴方向的平移值。取值范围:(-∞, +∞)。单位为px。如果从未设置z的值,其默认值为0。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_SetZ(ArkUI_Matrix4TranslationOptions* options, const float z); + +/** + * @brief 获取矩阵运算的平移对象z轴方向的平移值。 + * + * @param options 指向矩阵运算的平移参数对象的指针。 + * @param z z轴方向的平移值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4TranslationOptions_GetZ(const ArkUI_Matrix4TranslationOptions* options, float* z); + +/** + * @brief 创建一个单位四阶矩阵对象。 + * + * @return 返回指向创建的单位四阶矩阵对象的指针。 + * @since 24 + */ +ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateIdentity(); + +/** + * @brief 通过指定矩阵的每个元素来创建一个四阶矩阵对象。 + * + * @param elements 指向预期矩阵元素数据的数组指针。数组长度应大于或等于16。该参数不可为空指针。 + * @return 返回新创建的四阶矩阵对象。如果elements指针为空,函数将返回空值。 + * @since 24 + */ +ArkUI_Matrix4* OH_ArkUI_Matrix4_CreateByElements(const float* elements); + +/** + * @brief 销毁矩阵对象的指针。 + * + * @param matrix 指向要销毁的四阶矩阵对象的指针。 + * @since 24 + */ +void OH_ArkUI_Matrix4_Dispose(ArkUI_Matrix4* matrix); + +/** + * @brief 创建四阶矩阵对象的副本。用于对同一个矩阵进行操作以此获取不同矩阵对象。 + * + * @param matrix 指向原始四阶矩阵对象的指针。 + * @return 返回新创建的四阶矩阵对象。 + * @since 24 + */ +ArkUI_Matrix4* OH_ArkUI_Matrix4_Copy(const ArkUI_Matrix4* matrix); + +/** + * @brief 对输入矩阵执行逆矩阵变换。 + * + * @param matrix 指向要逆矩阵变换的四阶矩阵对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Invert(ArkUI_Matrix4* matrix); + +/** + * @brief 将另一个矩阵与原始矩阵合并,并将结果矩阵存储在oriMatrix中。结果矩阵相当于先应用oriMatrix的变换,然后再应用anotherMatrix的变换。此函数将修改oriMatrix对象。 + * + * @param oriMatrix 指向原始四阶矩阵对象的指针。 + * @param anotherMatrix 指向要合并的另一个矩阵对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Combine(ArkUI_Matrix4* oriMatrix, const ArkUI_Matrix4* anotherMatrix); + +/** + * @brief 对原始矩阵应用平移变换以获取平移后的矩阵。每次平移变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 + * + * @param matrix 指向待平移四阶矩阵对象的指针。 + * @param translate 指向平移对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Translate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4TranslationOptions* translate); + +/** + * @brief 对原始矩阵应用缩放变换以获取缩放后的矩阵。每次缩放变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 + * + * @param matrix 指向待缩放四阶矩阵对象的指针。 + * @param scale 指向缩放对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Scale(ArkUI_Matrix4* matrix, const ArkUI_Matrix4ScaleOptions* scale); + +/** + * @brief 对原始矩阵应用旋转变换以获取旋转后的矩阵。每次旋转变换都是在先前的矩阵上累积的。此函数将修改输入的矩阵对象。 + * + * @param matrix 指向待旋转四阶矩阵对象的指针。 + * @param rotate 指向旋转对象的指针。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Rotate(ArkUI_Matrix4* matrix, const ArkUI_Matrix4RotationOptions* rotate); + +/** + * @brief 对原始矩阵应用倾斜变换以获取倾斜后的矩阵。每次倾斜变换都是在先前的矩阵上累积的。变换后将修改输入的矩阵对象。 + * + * @param matrix 指向待倾斜四阶矩阵对象的指针。 + * @param skewX x方向的倾斜系数。 + * @param skewY y方向的倾斜系数。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_Skew(ArkUI_Matrix4* matrix, const float skewX, const float skewY); + +/** + * @brief 计算一个点经过矩阵变换后的新坐标位置。 + * + * @param matrix 指向四阶矩阵对象的指针。 + * @param oriPoint 指向原始坐标点的指针。 + * @param result 指向结果点的指针。不能为空。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_TransformPoint(const ArkUI_Matrix4* matrix, const ArkUI_PointF* oriPoint, ArkUI_PointF* result); + +/** + * @brief 将一个多边形的顶点坐标映射到另一个多边形的顶点坐标,并计算所需的矩阵。 + * + * @param matrix 指向四阶矩阵对象的指针,用于存放结果矩阵。 + * @param src 指向原始多边形坐标点数组的指针。数组长度应至少为pointCount。 + * @param dst 指向映射后多边形坐标点数组的指针。数组长度应至少为pointCount。 + * @param pointCount 多边形点的数量,必须是0、1、2、3或4中的一个值。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_SetPolyToPoly(ArkUI_Matrix4* matrix, const ArkUI_PointF* src, const ArkUI_PointF* dst, const uint32_t pointCount); + +/** + * @brief 获取四阶矩阵的16个元素。 + * + * @param matrix 指向四阶矩阵对象的指针。 + * @param result 指向可容纳16个浮点数的数组的指针。不能为空。 + * @return 错误码。 + *
如果操作成功,返回{@link ARKUI_ERROR_CODE_NO_ERROR}。 + *
如果发生参数异常,返回{@link ARKUI_ERROR_CODE_PARAM_INVALID}。 + * @since 24 + */ +ArkUI_ErrorCode OH_ArkUI_Matrix4_GetElements(const ArkUI_Matrix4* matrix, float* result); + +#ifdef __cplusplus +} +#endif + +#endif // ARKUI_NATIVE_TYPE_VISUAL_H +/** @} */ From c3ef54765a2634d382b4afcc36683265e870a100 Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Fri, 12 Jun 2026 18:12:57 +0800 Subject: [PATCH 42/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] Change-Id: Ic8031c5b2b2d1ef9be6e71f8774f30a395819325 --- arkui/ace_engine/native/native_type.h | 16 ---------------- zh-cn/arkui/ace_engine/native/native_type.h | 16 ---------------- .../arkui/ace_engine/native/native_type_visual.h | 16 ++++++++++++++++ 3 files changed, 16 insertions(+), 32 deletions(-) diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 7d44e2ea8..468607582 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -1599,22 +1599,6 @@ typedef enum { */ typedef struct ArkUI_SystemFontStyleEvent ArkUI_SystemFontStyleEvent; -/** - * @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; - #include "native_type_visual.h" /** diff --git a/zh-cn/arkui/ace_engine/native/native_type.h b/zh-cn/arkui/ace_engine/native/native_type.h index 4db62dfd9..ead6221fe 100644 --- a/zh-cn/arkui/ace_engine/native/native_type.h +++ b/zh-cn/arkui/ace_engine/native/native_type.h @@ -3344,22 +3344,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. * diff --git a/zh-cn/arkui/ace_engine/native/native_type_visual.h b/zh-cn/arkui/ace_engine/native/native_type_visual.h index 0110560a8..fc06d0047 100644 --- a/zh-cn/arkui/ace_engine/native/native_type_visual.h +++ b/zh-cn/arkui/ace_engine/native/native_type_visual.h @@ -44,6 +44,22 @@ extern "C" { #endif +/** + * @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 定义四阶矩阵对象。 * From 02412d34d0ca2abca16f7a754fde36bad43166cb Mon Sep 17 00:00:00 2001 From: wangmiaoliang Date: Fri, 12 Jun 2026 18:58:08 +0800 Subject: [PATCH 43/44] fix MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: wangmiaoliang 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] Change-Id: I177356ad396b043727cb5c8b3487c5b99d6a3966 --- .../ace_engine/native/native_type_visual.h | 33 ++++++++++--------- 1 file changed, 17 insertions(+), 16 deletions(-) diff --git a/zh-cn/arkui/ace_engine/native/native_type_visual.h b/zh-cn/arkui/ace_engine/native/native_type_visual.h index fc06d0047..927d087ad 100644 --- a/zh-cn/arkui/ace_engine/native/native_type_visual.h +++ b/zh-cn/arkui/ace_engine/native/native_type_visual.h @@ -44,22 +44,6 @@ extern "C" { #endif -/** - * @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 定义四阶矩阵对象。 * @@ -815,6 +799,23 @@ typedef struct { float perspective; } ArkUI_RotationOptions; + +/** + * @brief 定义一个二维坐标点结构体,坐标以浮点类型存储。 + * + * @since 24 + */ +typedef struct { + /** + * x轴坐标。取值范围:(-∞, +∞)。 + */ + float x; + /** + * y轴坐标。取值范围:(-∞, +∞)。 + */ + float y; +} ArkUI_PointF; + /** * @brief 定义阴影选项对象。 * From d0012993f47261272432ee84c25073ff3bda166b Mon Sep 17 00:00:00 2001 From: ZouQianshun Date: Fri, 12 Jun 2026 20:25:47 +0800 Subject: [PATCH 44/44] =?UTF-8?q?=E9=80=9A=E7=94=A8=E4=BA=8B=E4=BB=B6?= =?UTF-8?q?=E5=A4=B4=E6=96=87=E4=BB=B6=E6=8B=86=E5=88=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ZouQianshun 🤖‍ AI[0%] 👌 AI Adopted[0%] 🧑 Human[100%] --- arkui/ace_engine/native/BUILD.gn | 3 +- arkui/ace_engine/native/native_type.h | 2 +- .../common_attributes.h} | 8 +- .../kit_sub_system/c_file_kit_sub_system.json | 2 +- zh-cn/arkui/ace_engine/native/native_type.h | 338 +--------------- .../node_attributes/common_attributes.h | 365 ++++++++++++++++++ 6 files changed, 374 insertions(+), 344 deletions(-) rename arkui/ace_engine/native/{node_types/native_type_common.h => node_attributes/common_attributes.h} (99%) create mode 100644 zh-cn/arkui/ace_engine/native/node_attributes/common_attributes.h diff --git a/arkui/ace_engine/native/BUILD.gn b/arkui/ace_engine/native/BUILD.gn index 91a07a9b7..0c11a5371 100644 --- a/arkui/ace_engine/native/BUILD.gn +++ b/arkui/ace_engine/native/BUILD.gn @@ -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", ] @@ -78,7 +77,7 @@ if (!is_arkui_x) { "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", diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 7d44e2ea8..d2242ed0c 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -47,9 +47,9 @@ #include "node_attributes/embedded_component.h" #include "node_attributes/xcomponent.h" +#include "node_attributes/common_attributes.h" #include "node_attributes/navigation_router/navigation_router.h" #include "node_attributes/swiper/swiper.h" -#include "node_types/native_type_common.h" #include "node_attributes/image_animator.h" #include "node_attributes/image.h" #include "node_attributes/picker.h" diff --git a/arkui/ace_engine/native/node_types/native_type_common.h b/arkui/ace_engine/native/node_attributes/common_attributes.h similarity index 99% rename from arkui/ace_engine/native/node_types/native_type_common.h rename to arkui/ace_engine/native/node_attributes/common_attributes.h index 6f6b4439d..e11c6e18f 100644 --- a/arkui/ace_engine/native/node_types/native_type_common.h +++ b/arkui/ace_engine/native/node_attributes/common_attributes.h @@ -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 #include @@ -397,5 +397,5 @@ bool OH_ArkUI_VisibleAreaEventOptions_GetMeasureFromViewport(ArkUI_VisibleAreaEv }; #endif -#endif // ARKUI_NATIVE_TYPE_COMMON_H +#endif // ARKUI_COMMON_ATTRIBUTES_H /** @} */ \ No newline at end of file diff --git a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json index f12655137..a09366320 100644 --- a/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json +++ b/build-tools/capi_parser/src/coreImpl/parser/kit_sub_system/c_file_kit_sub_system.json @@ -48,7 +48,7 @@ { "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_types/native_type_common.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开发框架" }, diff --git a/zh-cn/arkui/ace_engine/native/native_type.h b/zh-cn/arkui/ace_engine/native/native_type.h index 4db62dfd9..38af8f096 100644 --- a/zh-cn/arkui/ace_engine/native/native_type.h +++ b/zh-cn/arkui/ace_engine/native/native_type.h @@ -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 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: - * Checkbox, Radio, Toggle, List, Grid, and MenuItem. - */ - 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. * @@ -5784,195 +5639,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 colorSpace and set isAuto to - * false to achieve optimal snapshot quality. - * Since determining the exact color space used by a component is often difficult, set isAuto to true - * to let the system automatically select the appropriate color space. - * If isAuto is set to true, the colorSpace parameter value is ignored. - * - * @param snapshotOptions Pointer to the target snapshot configuration options. - * @param colorSpace Target color space. Supported values: 3 (DISPLAY_P3), 4 (SRGB), 27 - * (DISPLAY_BT2020_SRGB). - * @param isAuto Whether to auto-detect the color space. - * true: ignores the colorSpace parameter value and auto-detects the color space. - * false: uses the color space specified by colorSpace. - * @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 dynamicRangeMode parameter and set isAuto to false. - * Alternatively, set isAuto to true to let the system auto-detect the appropriate dynamic range mode. - * If isAuto is set to true, the dynamicRangeMode 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. - * true: ignores the dynamicRangeMode parameter value and auto-detects the dynamic range - * mode. - * false: uses the dynamic range mode specified by dynamicRangeMode. - * @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: 1000. -* @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: false. -* @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: 1000. - * @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: false. - * - * @since 22 - */ -bool OH_ArkUI_VisibleAreaEventOptions_GetMeasureFromViewport(ArkUI_VisibleAreaEventOptions* option); - /** * @brief Creates a TextPickerRangeContent instance. * diff --git a/zh-cn/arkui/ace_engine/native/node_attributes/common_attributes.h b/zh-cn/arkui/ace_engine/native/node_attributes/common_attributes.h new file mode 100644 index 000000000..735225ee8 --- /dev/null +++ b/zh-cn/arkui/ace_engine/native/node_attributes/common_attributes.h @@ -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 +#include + +#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 错误码 +*
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 +*
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 +*
异常原因:传入参数验证失败,参数不能为空。 +* +* @since 15 +*/ +int32_t OH_ArkUI_SnapshotOptions_SetScale(ArkUI_SnapshotOptions* snapshotOptions, float scale); + +/** +* @brief 设置截图选项中的色彩空间。 +* +* @param snapshotOptions 截图选项指针。 +* @param colorSpace 指定截图使用的色彩空间。 +*
如果知道需要截图的组件使用的色彩空间,可以通过colorSpace参数指定,并将isAuto设置为false,以达到预期的截图效果。 +*
支持的取值为:3(RGB色域为Display P3类型)、4(RGB色域为SRGB类型)、27(RGB色域为DISPLAY BT2020类型)。 +*
默认值:4 +*
仅当isAuto设置为false,该参数设置生效。 +* @param isAuto 是否由系统自动决定所使用的色彩空间。 +*
true表示系统自动决定所使用的色彩空间。在不确定组件使用的色彩空间时,建议将isAuto设置为true,让系统根据实际情况自动决定使用的色彩空间。 +*
false表示使用通过colorSpace字段设置的色彩空间类型进行截图。 +*
默认值:false +* @return 错误码。 +*
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 +*
{@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 指定截图使用的动态范围模式。 +*
如果知道截图对象使用的动态范围模式,可通过dynamicRangeMode参数指定动态范围模式,并将isAuto设置为false,以达到预期的截图效果。 +*
支持的取值为:{@link ArkUI_DynamicRangeMode}枚举值。 +*
默认值:ARKUI_DYNAMIC_RANGE_MODE_STANDARD +*
仅当isAuto设置为false,该参数设置生效。 +* @param isAuto 是否由系统自动决定所使用的动态范围模式。 +*
true表示系统自动决定所使用的动态范围模式。在不确定组件使用的动态范围模式时,建议将isAuto设置为true,让系统根据实际情况自动决定使用的动态范围模式。 +*
false表示使用通过dynamicRangeMode字段设置的动态范围模式进行截图。 +*
默认值:false +* @return 错误码。 +*
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 +*
{@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 错误码。 +*
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 +*
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 +*
异常原因:传入参数验证失败,参数不能为空。 +* @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 错误码。 +*
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 +*
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常 +*
异常原因:传入参数验证失败,参数不能为空。 +* @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 错误码。 +*
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 +*
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 +*
异常原因:传入参数验证失败,参数不能为空。 +* @since 22 +*/ +int32_t OH_ArkUI_VisibleAreaEventOptions_SetMeasureFromViewport( + ArkUI_VisibleAreaEventOptions* option, bool measureFromViewport); + +/** +* @brief 获取阈值数组。 +* +* @param option 可见区域变化监听的参数实例。 +* @param value 阈值数组。 +* @param size 阈值数组大小。 +* @return 错误码。 +*
{@link ARKUI_ERROR_CODE_NO_ERROR} 成功。 +*
{@link ARKUI_ERROR_CODE_PARAM_INVALID} 函数参数异常。 +*
{@link ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR} 数组大小不够。 +*
异常原因:传入参数验证失败,参数不能为空。 +* @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 +/** @} */ \ No newline at end of file