From 9ce1f7a7fd4419aa6dc2aaf2f3a5ab6749a2306b Mon Sep 17 00:00:00 2001 From: zoulinken Date: Tue, 12 Mar 2024 10:09:48 +0800 Subject: [PATCH] upload customDialog api Signed-off-by: zoulinken --- arkui/ace_engine/native/BUILD.gn | 1 + arkui/ace_engine/native/libace.ndk.json | 4 + arkui/ace_engine/native/native_dialog.h | 60 +++++ arkui/ace_engine/native/native_interface.h | 14 +- arkui/ace_engine/native/native_node.h | 263 +++++++++++++++++++++ arkui/ace_engine/native/native_type.h | 121 ++++++++++ 6 files changed, 462 insertions(+), 1 deletion(-) create mode 100644 arkui/ace_engine/native/native_dialog.h diff --git a/arkui/ace_engine/native/BUILD.gn b/arkui/ace_engine/native/BUILD.gn index 2dc4d659a..5cad4eef6 100644 --- a/arkui/ace_engine/native/BUILD.gn +++ b/arkui/ace_engine/native/BUILD.gn @@ -26,6 +26,7 @@ if (!is_arkui_x) { ohos_ndk_headers("arkui_header") { dest_dir = "$ndk_headers_out_dir/arkui/" sources = [ + "native_dialog.h", "native_event.h", "native_interface.h", "native_node.h", diff --git a/arkui/ace_engine/native/libace.ndk.json b/arkui/ace_engine/native/libace.ndk.json index 6566446ad..e650b1257 100644 --- a/arkui/ace_engine/native/libace.ndk.json +++ b/arkui/ace_engine/native/libace.ndk.json @@ -170,5 +170,9 @@ { "first_introduced": "12", "name": "OH_NativeXComponent_RegisterOnTouchInterceptCallback" + }, + { + "first_introduced": "12", + "name": "OH_ArkUI_QueryModuleInterface" } ] \ No newline at end of file diff --git a/arkui/ace_engine/native/native_dialog.h b/arkui/ace_engine/native/native_dialog.h new file mode 100644 index 000000000..71815619f --- /dev/null +++ b/arkui/ace_engine/native/native_dialog.h @@ -0,0 +1,60 @@ +/* + * 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. + */ + +#ifndef ARKUI_NATIVE_DIALOG_H +#define ARKUI_NATIVE_DIALOG_H + +#include "native_type.h" +#ifdef __cplusplus +extern "C" { +#endif + +typedef enum { + DIALOG_DISMISS_BACK_PRESS = 0, + DIALOG_DISMISS_TOUCH_OUTSIDE, +} ArkUI_DismissReason; + +typedef bool (*OnWillDismissEvent)(int32_t reason); +typedef struct { + int32_t version; + // 创建和销毁弹窗 + ArkUI_NativeDialogHandler (*create)(); + void (*dispose)(ArkUI_NativeDialogHandler handler); + // 挂载和卸载自定义弹窗内容 + void (*attachContent)(ArkUI_NativeDialogHandler handler, ArkUI_NodeHandle content); + void (*detachContent)(ArkUI_NativeDialogHandler handler, ArkUI_NodeHandle content); + // 设置自定义弹窗属性 + void (*setContentAlignment)(ArkUI_NativeDialogHandler handler, int32_t alignment, float offsetX, float offsetY); + void (*resetContentAlignment)(ArkUI_NativeDialogHandler handler); + void (*setMode)(ArkUI_NativeDialogHandler handler, bool useModalMode, bool autoCancel); + void (*setMask)(ArkUI_NativeDialogHandler handler, uint32_t maskColor, const ArkUI_VpRect* rect); + void (*setBackgroundColor)(ArkUI_NativeDialogHandler handler, uint32_t backgroundColor); + void (*setCornerRadius)(ArkUI_NativeDialogHandler handler, float topleft, float topRight, + float bottomLeft, float bottomRight); + void (*setGridCount)(ArkUI_NativeDialogHandler handler, int32_t gridCount); + void (*setCustomStyle)(ArkUI_NativeDialogHandler handler, bool customStyle); + // 注册关闭事件 + void (*registerOnWillDismiss)(ArkUI_NativeDialogHandler handler, OnWillDismissEvent eventHandler); + // 显示和关闭弹窗 + void (*show)(ArkUI_NativeDialogHandler handler, bool showInSubWindow); + void (*close)(ArkUI_NativeDialogHandler handler); + void (*setCustomAnimation)(ArkUI_NativeDialogHandler handler, bool useCustomAnimation); +} ArkUI_NativeDialogAPI_1; + +#ifdef __cplusplus +}; +#endif + +#endif // ARKUI_NATIVE_DIALOG_H \ No newline at end of file diff --git a/arkui/ace_engine/native/native_interface.h b/arkui/ace_engine/native/native_interface.h index fff9b4954..0b4c96632 100644 --- a/arkui/ace_engine/native/native_interface.h +++ b/arkui/ace_engine/native/native_interface.h @@ -64,6 +64,8 @@ typedef struct { typedef enum { /** API type related to UI components. */ ARKUI_NATIVE_NODE, + /** API type related to Dialog. */ + ARKUI_NATIVE_DIALOG, } ArkUI_NativeAPIVariantKind; /** @@ -73,9 +75,19 @@ typedef enum { */ typedef enum { /** The ARKUI_NATIVE_NODE type supports the structure {@link ArkUI_NativeNodeAPI_1} of version 1. */ - ARKUI_NATIVE_NODE_VERSION_1, + ARKUI_NATIVE_NODE_VERSION_1 = 1, } ArkUI_NativeNodeAPIVersion; +/** + * @brief Defines the version information supported by the ARKUI_DIALOG_NODE type. + * + * @since 12 + */ +typedef enum { + /** The ARKUI_DIALOG_NODE type supports the structure {@link ArkUI_NativeDialogAPI_1} of version 1. */ + ARKUI_NATIVE_DIALOG_VERSION_1 = 1, +} ArkUI_NativeDialogAPIVersion; + /** * @brief Obtains the native API set of a specified version. * diff --git a/arkui/ace_engine/native/native_node.h b/arkui/ace_engine/native/native_node.h index 0c3c6eb2c..4e4a46a4b 100644 --- a/arkui/ace_engine/native/native_node.h +++ b/arkui/ace_engine/native/native_node.h @@ -107,6 +107,8 @@ typedef enum { ARKUI_NODE_FLEX, /** Refresh component. */ ARKUI_NODE_REFRESH, + /** 瀑布流容器。 */ + ARKUI_NODE_WATER_FLOW, } ArkUI_NodeType; /** @@ -800,6 +802,18 @@ typedef enum { * */ NODE_TRANSLATE_TRANSITION, + /** + * @brief Defines the slide-in and slide-out of the component from the screen edge during transition. + * 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: The parameter type is {@link ArkUI_TransitionEdge}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * value[0].i32: The parameter type is {@link ArkUI_TransitionEdge}. \n + * + */ + NODE_MOVE_TRANSITION, /** * @brief Defines the focus attribute, which can be set, reset, and obtained as required through APIs. @@ -1341,6 +1355,17 @@ typedef enum { * */ NODE_FOCUS_STATUS, + /** + * @brief Defines the aspect ratio attribute, which can be set, reset, and obtained as required through APIs. + * + * Format of the {@link ArkUI_AttributeItem} parameter for setting the attribute:\n + * .value[0].f32: aspect ratio of the component, in width/height format. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].f32: aspect ratio of the component, in width/height format. \n + * + */ + NODE_ASPECT_RATIO, /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. @@ -1605,6 +1630,28 @@ typedef enum { * */ NODE_TEXT_INDENT, + /** + * @brief Defines the line break rule. 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: The parameter type is {@link ArkUI_WordBreak}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: The parameter type is {@link ArkUI_WordBreak}. \n + * + */ + NODE_TEXT_WORD_BREAK, + /** + * @brief Defines the ellipsis position. 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: The parameter type is {@link ArkUI_EllipsisMode}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: The parameter type is {@link ArkUI_EllipsisMode}. \n + * + */ + NODE_TEXT_ELLIPSIS_MODE, /** * @brief Defines the text content attribute, which can be set, reset, and obtained as required through APIs. * @@ -1616,6 +1663,28 @@ typedef enum { * */ NODE_SPAN_CONTENT = MAX_NODE_SCOPE_NUM * ARKUI_NODE_SPAN, + /** + * @brief Defines the text background style. + * 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].u32: color of the text background, in 0xARGB format, for example, 0xFFFF0000 indicating red. \n + * The second parameter indicates the rounded corners of the text background. Two setting modes are available: \n + * 1: .value[1].f32: radius of the four corners, in vp. \n + * 2: .value[1].f32: radius of the upper left corner, in vp. \n + * .value[2].f32: radius of the upper right corner, in vp. \n + * .value[3].f32: radius of the lower left corner, in vp. \n + * .value[4].f32: radius of the lower right corner, in vp. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].u32: color of the text background, in 0xARGB format. \n + * .value[1].f32: radius of the upper left corner, in vp. \n + * .value[2].f32: radius of the upper right corner, in vp. \n + * .value[3].f32: radius of the lower left corner, in vp. \n + * .value[4].f32: radius of the lower right corner, in vp. \n + * + */ + NODE_SPAN_TEXT_BACKGROUND_STYLE, /** * @brief Defines the image source of the image span. * This attribute can be set, reset, and obtained as required through APIs. @@ -1727,6 +1796,29 @@ typedef enum { * */ NODE_IMAGE_ALT, + /** + * @brief Defines whether the image is draggable. + * 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: whether the image is draggable. The value true means that the image is draggable. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether the image is draggable. \n + * + */ + NODE_IMAGE_DRAGGABLE, + /** + * @brief Defines the image rendering mode. 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: The parameter type is {@link ArkUI_RenderMode}. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: The parameter type is {@link ArkUI_RenderMode}. \n + * + */ + NODE_IMAGE_RENDER_MODE, /** * @brief Defines the color of the component when it is selected. * This attribute can be set, reset, and obtained as required through APIs. @@ -1751,6 +1843,17 @@ typedef enum { * */ NODE_TOGGLE_SWITCH_POINT_COLOR, + /** + * @brief Switch类型的开关值,支持属性设置,属性重置和属性获取接口。 + * + * 属性设置方法参数{@link ArkUI_AttributeItem}格式:\n + * .value[0].i32:设置开关的值,true表示开启。\n + * \n + * 属性获取方法返回值{@link ArkUI_AttributeItem}格式:\n + * .value[0].i32:设置开关的值。\n + * + */ + NODE_TOGGLE_VALUE, /** * @brief Defines the foreground color of the loading progress bar. @@ -1981,6 +2084,19 @@ typedef enum { * */ NODE_TEXT_INPUT_CANCEL_BUTTON, + /** + * @brief 单行文本设置文本选中并高亮的区域,支持属性设置,属性重置和属性获取接口。 + * + * 属性设置方法参数{@link ArkUI_AttributeItem}格式:\n + * .value[0].i32:选中文本的起始位置;\n + * .value[1].i32:选中文本的终止位置;\n + * \n + * 属性获取方法返回值{@link ArkUI_AttributeItem}格式:\n + * .value[0].i32:选中文本的起始位置;\n + * .value[1].i32:选中文本的终止位置;\n + * + */ + NODE_TEXT_INPUT_TEXT_SELECTION, /** * @brief Defines the default placeholder text for the multi-line text box. @@ -2074,6 +2190,38 @@ typedef enum { * */ NODE_TEXT_AREA_EDITING, + /** + * @brief Defines the text box type. 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: text box type {@link ArkUI_TextAreaType}. + * The default value is ARKUI_TEXTAREA_TYPE_NORMAL. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: text box type {@link ArkUI_TextAreaType}. \n + * + */ + NODE_TEXT_AREA_TYPE, + /** + * @brief Defines the counter settings. 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: whether to show a character counter. The value true means to show a character counter. \n + * .value[1]?.f32: threshold percentage for displaying the character counter. The character counter is displayed + * when the number of characters that have been entered is greater than the maximum number of characters multiplied + * by the threshold percentage value. The value range is 1 to 100. If the value is a decimal, it is rounded down. \n + * .value[2]?.i32: whether to highlight the border when the number of entered characters reaches the maximum. \n + * \n + * Format of the return value {@link ArkUI_AttributeItem}:\n + * .value[0].i32: whether to show a character counter. \n + * .value[1].f32: threshold percentage for displaying the character counter. The character counter is displayed + * when the number of characters that have been entered is greater than the maximum number of characters multiplied + * by the threshold percentage value. The value range is 1 to 100. \n + * .value[2].i32: whether to highlight the border when the number of entered characters reaches the maximum. + * The default value is true. \n + * + */ + NODE_TEXT_AREA_SHOW_COUNTER, /** * @brief Defines the button text content. This attribute can be set, reset, and obtained as required through APIs. @@ -3320,6 +3468,19 @@ typedef enum { */ NODE_SWIPER_SHOW_DISPLAY_ARROW, + /** + * @brief 设置Swiper的边缘滑动效果,支持属性设置,属性重置和属性获取接口。 + * + * 属性设置方法参数{@link ArkUI_AttributeItem}格式: \n + * .value[0].i32: 边缘滑动效果,参数类型{@link ArkUI_EdgeEffect}, \n + * 默认值为ARKUI_EDGE_EFFECT_SPRING。 \n + * \n + * 属性获取方法返回值{@link ArkUI_AttributeItem}格式: \n + * .value[0].i32: 边缘滑动效果,参数类型{@link ArkUI_EdgeEffect}, \n + * + */ + NODE_SWIPER_EFFECT_MODE, + /** * @brief Defines the header of the list item group. * This attribute can be set, reset, and obtained as required through APIs. @@ -3460,6 +3621,23 @@ typedef enum { * */ NODE_REFRESH_REFRESHING = MAX_NODE_SCOPE_NUM * ARKUI_NODE_REFRESH, + /** + * @brief 设置下拉区域的自定义内容,支持属性设置和重置。 + * + * 属性设置方法{@link ArkUI_AttributeItem}参数格式: \n + * .object:参数类型{@Link ArkUI_NodeHandle}。 + * + */ + NODE_REFRESH_CONTENT, + + /** + * @brief 定义瀑布流组件布局主轴方向,支持属性设置、重置和获取。 + * + * 属性设置方法{@link ArkUI_AttributeItem}参数格式: \n + * .value[0].i32 主轴方向,参数类型{@Link ArkUI_FlexDirection}。 + * + */ + NODE_WATER_FLOW_LAYOUT_DIRECTION = MAX_NODE_SCOPE_NUM * ARKUI_NODE_WATER_FLOW, } ArkUI_NodeAttributeType; #define MAX_COMPONENT_EVENT_ARG_NUM 12 @@ -3505,6 +3683,14 @@ typedef enum { * {@link ArkUI_NodeComponentEvent} does not contain parameters. */ NODE_EVENT_ON_APPEAR, + /** + * @brief Defines the unmount event. + * + * This event is triggered when the component is unmounted and hidden. \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} does not contain parameters. + */ + NODE_EVENT_ON_DISAPPEAR, /** * @brief Defines the area change event. @@ -3680,6 +3866,17 @@ typedef enum { * */ NODE_TEXT_INPUT_ON_PASTE, + /** + * @brief Defines the event triggered when the text selection position changes. + * + \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains two parameters:\n + * ArkUI_NodeComponentEvent.data[0].i32: start position of the text selection area. \n + * ArkUI_NodeComponentEvent.data[1].i32: end position of the text selection area. \n + * + */ + NODE_TEXT_INPUT_ON_TEXT_SELECTION_CHANGE, /** * @brief Defines the event triggered when the input in the text box changes. * @@ -3691,6 +3888,30 @@ typedef enum { * */ NODE_TEXT_AREA_ON_CHANGE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_TEXT_AREA, + /** + * @brief Defines the event triggered when the paste button on the pasteboard, which displays when the text box is + * long pressed, is clicked. + * + \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_StringAsyncEvent}. \n + * {@link ArkUI_StringAsyncEvent} contains one parameter:\n + * ArkUI_StringAsyncEvent.pStr: text that is pasted + * + */ + NODE_TEXT_AREA_ON_PASTE, + /** + * @brief Defines the event triggered when the text selection position changes. + * + \n + * When the event callback occurs, the union type in the {@link ArkUI_NodeEvent} object is + * {@link ArkUI_NodeComponentEvent}. \n + * {@link ArkUI_NodeComponentEvent} contains two parameters:\n + * ArkUI_NodeComponentEvent.data[0].i32: start position of the text selection area. \n + * ArkUI_NodeComponentEvent.data[1].i32: end position of the text selection area. \n + * + */ + NODE_TEXT_AREA_ON_TEXT_SELECTION_CHANGE, /** * @brief Defines the event triggered when the selected status of the ARKUI_NODE_CHECKBOX component changes. @@ -3759,6 +3980,48 @@ typedef enum { */ NODE_SLIDER_EVENT_ON_CHANGE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_SLIDER, + /** + * @brief 定义ARKUI_NODE_SWIPER当前元素索引变化时触发事件回调。 + * + * 事件回调发生时,事件参数{@link ArkUI_NodeEvent}对象中的联合体类型为{@link ArkUI_NodeComponentEvetn}。\n + * {@link ArkUI_NodeComponentEvent}中包含1个参数:\n + * ArkUI_NodeComponentEvent.data[0].i32:表示当前显示元素的索引。\n + */ + NODE_SWIPER_EVENT_ON_CHANGE = MAX_NODE_SCOPE_NUM * ARKUI_NODE_SWIPER, + + /** + * @brief 定义ARKUI_NODE_SWIPER切换动画开始时触发回调。 + * + * 事件回调发生时,事件参数{@link ArkUI_NodeEvent}对象中的联合体类型为{@link ArkUI_NodeComponentEvent}。\n + * {@link ArkUI_NodeComponentEvent}中包含5个参数:\n + * ArkUI_NodeComponentEvent.data[0].i32:表示当前显示元素的索引。\n + * ArkUI_NodeComponentEvent.data[1].i32:表示切换动画目标元素的索引。\n + * ArkUI_NodeComponentEvent.data[2].f32:表示主轴方向上当前显示元素相对Swiper起始位置的位移。\n + * ArkUI_NodeComponentEvent.data[3].f32:表示主轴方向上目标元素相对Swiper起始位置的位移。\n + * ArkUI_NodeComponentEvent.data[4].f32:表示离手速度。\n + */ + NODE_SWIPER_EVENT_ON_ANIMATION_START, + + /** + * @brief 定义ARKUI_NODE_SWIPER切换动画结束是触发回调。 + * + * 事件回调发生时,事件参数{@link ArkUI_NodeEvent}对象中的联合体类型为{@link ArkUI_NodeComponentEvent}。\n + * {@link ArkUI_NodeComponentEvent}中包含2个参数:\n + * ArkUI_NodeComponentEvent.data[0].i32:表示当前显示元素的索引。\n + * ArkUI_NodeComponentEvent.data[1].f32:表示主轴方向上当前显示元素相对Swiper起始位置的位移。\n + */ + NODE_SWIPER_EVENT_ON_ANIMATION_END, + + /** + * @brief 定义ARKUI_NODE_SWIPER在页面跟手滑动过程中,逐帧触发该回调。 + * + * 事件回调发生时,事件参数{@link ArkUI_NodeEvent}对象中的联合体类型为{@link ArkUI_NodeComponentEvent}。\n + * {@link ArkUI_NodeComponentEvent}中包含2个参数:\n + * ArkUI_NodeComponentEvent.data[0].i32:表示当前显示元素的索引。\n + * ArkUI_NodeComponentEvent.data[1].f32:表示主轴方向上当前显示元素相对Swiper起始位置的位移。\n + */ + NODE_SWIPER_EVENT_GESTURE_SWIPE, + /** * @brief Defines the event triggered when the ARKUI_NODE_SCROLL component scrolls. * diff --git a/arkui/ace_engine/native/native_type.h b/arkui/ace_engine/native/native_type.h index 3cdd51892..0e2919cfb 100644 --- a/arkui/ace_engine/native/native_type.h +++ b/arkui/ace_engine/native/native_type.h @@ -49,6 +49,13 @@ extern "C" { */ struct ArkUI_Node; +/** + * @brief Defines the ArkUI native dialog object. + * + * @since 12 + */ +struct ArkUI_NativeDialog; + /** * @brief Defines the pointer to the ArkUI native component object. * @@ -56,6 +63,8 @@ struct ArkUI_Node; */ typedef struct ArkUI_Node* ArkUI_NodeHandle; +typedef struct ArkUI_NativeDialog* ArkUI_NativeDialogHandler; + /** * @brief Provides the number types of ArkUI in the native code. * @@ -228,6 +237,22 @@ typedef enum { ARKUI_TEXTINPUT_TYPE_NUMBER_DECIMAL = 12, } 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, +} ArkUI_TextAreaType; + /** * @brief Enumerates the styles of the Cancel button. * @@ -1203,6 +1228,102 @@ typedef enum { ARKUI_LINEAR_GRADIENT_DIRECTION_NONE, } ArkUI_LinearGradientDirection; +/** + * @brief 弹窗在垂直方向上的对齐方式. + * + * @since 12 + */ +typedef enum { + /** 垂直顶部对齐。 */ + ARKUI_DIALOG_ALIGNMENT_TOP = 0, + /** 垂直居中对齐。 */ + ARKUI_DIALOG_ALIGNMENT_CENTER, + /** 垂直底部对齐。 */ + ARKUI_DIALOG_ALIGNMENT_BOTTOM, + /** 默认对齐。 */ + ARKUI_DIALOG_ALIGNMENT_DEFAULT, + /** 左上对齐。 */ + ARKUI_DIALOG_ALIGNMENT_TOP_START, + /** 右上对齐。 */ + ARKUI_DIALOG_ALIGNMENT_TOP_END, + /** 左中对齐。 */ + ARKUI_DIALOG_ALIGNMENT_CENTER_START, + /** 右中对齐。 */ + ARKUI_DIALOG_ALIGNMENT_CENTER_END, + /** 左下对齐。 */ + ARKUI_DIALOG_ALIGNMENT_BOTTOM_START, + /** 右下对齐。 */ + ARKUI_DIALOG_ALIGNMENT_BOTTOM_END, +} ArkUI_DialogAlignment; + +typedef struct +{ + float x; + float y; + float width; + float height; +} ArkUI_VpRect; + +/** + * @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, +}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, +}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 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; + #ifdef __cplusplus }; #endif -- Gitee