From e3307745988ee9d5bc05196d66bb6ae4023813f0 Mon Sep 17 00:00:00 2001 From: zhanghang Date: Tue, 6 May 2025 15:31:14 +0800 Subject: [PATCH] Add focus wrap mode for grid Signed-off-by: zhanghang --- arkui/ace_engine/native/native_node.h | 16 ++++++++++++++++ arkui/ace_engine/native/native_type.h | 12 ++++++++++++ 2 files changed, 28 insertions(+) diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index c1458a02f..22d36fd4a 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -6251,6 +6251,22 @@ typedef enum { */ NODE_GRID_CACHED_COUNT, + /** + * @brief Defines the focus wrap mode for the Grid component. + * This attribute can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].i32: focus wrap mode of the Grid component. + * The parameter type is {@link ArkUI_FocusWrapMode}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: focus wrap mode of the Grid component. + * The parameter type is {@link ArkUI_FocusWrapMode}. \n + * + * @since 20 + */ + NODE_GRID_FOCUS_WRAP_MODE, + /** * @brief Defines the column width of the text picker. * This attribute can be set, reset, and obtained as required through APIs. diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index ff4522e3c..adf2dbcc6 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -647,6 +647,18 @@ typedef enum { ARKUI_EFFECT_EDGE_END = 2, } ArkUI_EffectEdge; +/** + * @brief Enumerates the focus wrap mode of components. + * + * @since 20 + */ +typedef enum { + /** Default mode, where focus does not wrap when arrow keys are used. */ + ARKUI_FOCUS_WRAPMODE_DEFAULT = 0, + /** Focus wraps automatically when arrow keys are used. */ + ARKUI_FOCUS_WRAPMODE_WRAP_WITH_ARROW = 1, +} ArkUI_FocusWrapMode; + /** * @brief Enumerates the scroll directions for the component. * -- Gitee