Defines the common types for the native module.
File to include: <arkui/native_type.h>
Library: libace_ndk.z.so
System capability: SystemCapability.ArkUI.ArkUI.Full
Since: 12
Related module: ArkUI_NativeModule
Sample: NativeTypeSample
| Name | typedef Keyword | Description |
|---|---|---|
| ArkUI_ColorStop | ArkUI_ColorStop | Defines a color stop, which is used to configure the gradient effect of a component. Multiple gradient styles can be defined by combining the color array and position array. |
| ArkUI_NativeDialog | - | Defines a custom dialog box controller object for ArkUI on the native side. |
| ArkUI_NativeDialog* | ArkUI_NativeDialogHandle | Defines the handle to the custom dialog box controller of ArkUI on the native side. |
| ArkUI_GestureCollectInterceptInfo | ArkUI_GestureCollectInterceptInfo | Defines gesture collection interception information. |
| ArkUI_ListItemSwipeActionItem | ArkUI_ListItemSwipeActionItem | Defines the item configuration for ListItemSwipeActionOption. |
| ArkUI_ListItemSwipeActionOption | ArkUI_ListItemSwipeActionOption | Defines the configuration for ListItemSwipeActionOption. |
| ArkUI_CustomProperty | ArkUI_CustomProperty | Defines custom property information, which is used to represent the custom property of a component. You can use related APIs to add, remove, and obtain custom properties for ArkUI components, and obtain the string values of custom properties. |
| ArkUI_HostWindowInfo | ArkUI_HostWindowInfo | Defines host window information. |
| ArkUI_ActiveChildrenInfo | ArkUI_ActiveChildrenInfo | Defines active child node information, which is used to store information about the FrameNode child nodes whose internal active state is true. You can query the number of child nodes and obtain child nodes by subscript. The instance of this struct is generated by calling OH_ArkUI_NodeUtils_GetActiveChildrenInfo. After using the instance, you must call OH_ArkUI_ActiveChildrenInfo_Destroy to destroy it. |
| ArkUI_CrossLanguageOption | ArkUI_CrossLanguageOption | Defines a cross-language configuration option, which is used to configure the cross-language access capability of a target node, for example, whether cross-language attribute modification is allowed. Since API version 26.0.0, you can also configure cross-language operation status of a node tree. |
| ArkUI_AccessibilityState | ArkUI_AccessibilityState | Defines a component accessibility state. |
| ArkUI_AccessibilityValue | ArkUI_AccessibilityValue | Defines a component accessibility value. |
| ArkUI_SystemFontStyleEvent | ArkUI_SystemFontStyleEvent | Defines a system font style change event, which is used to pass the event information to the registered system font style change callback when the system font size or weight changes. |
| ArkUI_SelectionOptions | ArkUI_SelectionOptions | Defines the options for the selection operation in ArkUI. It is applicable to scenarios where selection interaction is required within an application, providing you with the capability to customize selection behavior. |
| ArkUI_ContentTransitionEffect | ArkUI_ContentTransitionEffect | Defines the content transition effect. |
| ArkUI_SelectedDragPreviewStyle | ArkUI_SelectedDragPreviewStyle | Defines the text drag preview style in the selected state. It is applicable to scenarios where the preview effect in selected state needs to be displayed during text dragging, improving user interaction experience. |
| OH_ArkUI_LinearGradientOptions | OH_ArkUI_LinearGradientOptions | Defines linear gradient options, which are used to describe the linear color gradient configuration of UI components. You can set the gradient direction, angle, and color to implement flexible linear gradient effects, improving the visual presentation capability of the UI. This is applicable to scenarios where a linear gradient style needs to be applied to components. |
| OH_ArkUI_RadialGradientOptions | OH_ArkUI_RadialGradientOptions | Defines radial gradient options, which are applicable to scenarios where a radial gradient effect needs to be implemented in UI components. This helps you enrich the visual hierarchy of the UI. |
| Name | typedef Keyword | Description |
|---|---|---|
| ArkUI_CopyOptions | ArkUI_CopyOptions | Enumerates the text copy and paste modes. |
| ArkUI_AccessibilityCheckedState | ArkUI_AccessibilityCheckedState | Enumerates the accessibility check box states. |
| ArkUI_AccessibilityActionType | ArkUI_AccessibilityActionType | Enumerates the accessibility action types. |
| ArkUI_BorderStyle | ArkUI_BorderStyle | Enumerates the border styles. |
| ArkUI_AccessibilityMode | ArkUI_AccessibilityMode | Enumerates the accessibility modes. |
| ArkUI_AdaptiveColor | ArkUI_AdaptiveColor | Enumerates the adaptive color modes. |
| ArkUI_ColorMode | ArkUI_ColorMode | Enumerates the color modes. |
| ArkUI_SystemColorMode | ArkUI_SystemColorMode | Enumerates the system color modes. |
| ArkUI_LengthMetricUnit | ArkUI_LengthMetricUnit | Enumerates the component units. |
| ArkUI_ListItemSwipeActionState | ArkUI_ListItemSwipeActionState | Enumerates the item states of swipeAction of the Listitem component. |
| ArkUI_ListItemSwipeEdgeEffect | ArkUI_ListItemSwipeEdgeEffect | Enumerates the item edge effects of swipeAction of the Listitem component. |
| ArkUI_ListItemSwipeActionDirection | ArkUI_ListItemSwipeActionDirection | Enumerates the swipe action menu display directions for the ListItem component. |
| ArkUI_SafeAreaType | ArkUI_SafeAreaType | Enumerates the types of expanded safe areas. |
| ArkUI_KeyboardAvoidMode | ArkUI_KeyboardAvoidMode | Enumerates the soft keyboard avoidance modes. |
| ArkUI_HoverModeAreaType | ArkUI_HoverModeAreaType | Enumerates the types of display areas for the hover mode. |
| ArkUI_ExpandMode | ArkUI_ExpandMode | Enumerates the expansion mode of child nodes. |
| ArkUI_FocusWrapMode | ArkUI_FocusWrapMode | Enumerates the focus wrap mode of components. |
| ArkUI_ItemFillPolicy | ArkUI_ItemFillPolicy | Enumerates preset column layouts for different responsive breakpoints. |
| ArkUI_EdgeDirection | ArkUI_EdgeDirection | Enumerates rectangle edge directions. |
| ArkUI_CornerDirection | ArkUI_CornerDirection | Enumerates corner directions. |
| ArkUI_MenuPolicy | ArkUI_MenuPolicy | Enumerates menu display policies. |
| ArkUI_RenderStrategy | ArkUI_RenderStrategy | Defines rendering strategies for drawing rounded corners. |
| OH_ArkUI_CrossLanguageOperatingStatus | OH_ArkUI_CrossLanguageOperatingStatus | Enumerates the node tree operation states of cross-language configuration options. |
| OH_ArkUI_NodeMountPolicy | OH_ArkUI_NodeMountPolicy | Enumerates the child node mounting policy types. |
| ArkUI_CrownSensitivity | ArkUI_CrownSensitivity | Enumerates crown sensitivity levels. |
enum ArkUI_CopyOptions
Description
Enumerates the text copy and paste modes.
Since: 12
| Value | Description |
|---|---|
| ARKUI_COPY_OPTIONS_NONE = 0 | Copy is not allowed. |
| ARKUI_COPY_OPTIONS_IN_APP = 1 | Intra-application copy is allowed. |
| ARKUI_COPY_OPTIONS_LOCAL_DEVICE = 2 | Intra-device copy is allowed. |
| ARKUI_COPY_OPTIONS_CROSS_DEVICE = 3 | Cross-device copy is allowed. |
enum ArkUI_AccessibilityCheckedState
Description
Enumerates the accessibility check box states.
Since: 12
| Value | Description |
|---|---|
| ARKUI_ACCESSIBILITY_UNCHECKED = 0 | The check box is not selected. |
| ARKUI_ACCESSIBILITY_CHECKED = 1 | The check box is selected. |
enum ArkUI_AccessibilityActionType
Description
Enumerates the accessibility action types.
Since: 12
| Value | Description |
|---|---|
| ARKUI_ACCESSIBILITY_ACTION_CLICK = 1 << 0 | Tapping |
| ARKUI_ACCESSIBILITY_ACTION_LONG_CLICK = 1 << 1 | Long press |
| ARKUI_ACCESSIBILITY_ACTION_CUT = 1 << 2 | Cut. |
| ARKUI_ACCESSIBILITY_ACTION_COPY = 1 << 3 | Copy. |
| ARKUI_ACCESSIBILITY_ACTION_PASTE = 1 << 4 | Paste. |
enum ArkUI_BorderStyle
Description
Enumerates the border styles.
Since: 12
| Value | Description |
|---|---|
| ARKUI_BORDER_STYLE_SOLID = 0 | Solid border. This is the default value. |
| ARKUI_BORDER_STYLE_DASHED = 1 | Dashed border. |
| ARKUI_BORDER_STYLE_DOTTED = 2 | Dotted border. |
enum ArkUI_AccessibilityMode
Description
Enumerates the accessibility modes.
Since: 12
| Value | Description |
|---|---|
| ARKUI_ACCESSIBILITY_MODE_AUTO = 0 | The mode is automatically set to enabled or disabled based on the component. |
| ARKUI_ACCESSIBILITY_MODE_ENABLED = 1 | The component can be identified by the accessibility service. |
| ARKUI_ACCESSIBILITY_MODE_DISABLED = 2 | The component cannot be identified by the accessibility service. |
| ARKUI_ACCESSIBILITY_MODE_DISABLED_FOR_DESCENDANTS = 3 | The component and all its child components cannot be identified by the accessibility service. |
enum ArkUI_AdaptiveColor
Description
Enumerates the adaptive color modes.
Since: 12
| Value | Description |
|---|---|
| ARKUI_ADAPTIVE_COLOR_DEFAULT = 0 | Adaptive color mode is not used. |
| ARKUI_ADAPTIVE_COLOR_AVERAGE = 1 | Adaptive color mode is used. |
enum ArkUI_ColorMode
Description
Enumerates the color modes.
Since: 12
| Value | Description |
|---|---|
| ARKUI_COLOR_MODE_SYSTEM = 0 | Following the system color mode. |
| ARKUI_COLOR_MODE_LIGHT = 1 | Light color mode. |
| ARKUI_COLOR_MODE_DARK = 2 | Dark color mode. |
enum ArkUI_SystemColorMode
Description
Enumerates the system color modes.
Since: 12
| Value | Description |
|---|---|
| ARKUI_SYSTEM_COLOR_MODE_LIGHT = 0 | Light mode. |
| ARKUI_SYSTEM_COLOR_MODE_DARK = 1 | Dark mode. |
enum ArkUI_LengthMetricUnit
Description
Enumerates the component units.
Since: 12
| Value | Description |
|---|---|
| ARKUI_LENGTH_METRIC_UNIT_DEFAULT = -1 | Default, which is fp for fonts and vp for non-fonts. |
| ARKUI_LENGTH_METRIC_UNIT_PX = 0 | The unit is px. |
| ARKUI_LENGTH_METRIC_UNIT_VP = 1 | The unit is vp. |
| ARKUI_LENGTH_METRIC_UNIT_FP = 2 | The unit is fp. |
enum ArkUI_ListItemSwipeActionState
Description
Enumerates the item states of SwipeAction of the Listitem component. The default value is ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_COLLAPSED.
Since: 12
| Value | Description |
|---|---|
| ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_COLLAPSED = 0 | Collapsed state. When the list item is swiped in the opposite direction of the main axis, the swipe action item is hidden. |
| ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_EXPANDED = 1 | Expanded state. When the list item is swiped in the opposite direction of the main axis, the swipe action item is shown. |
| ARKUI_LIST_ITEM_SWIPE_ACTION_STATE_ACTIONING = 2 | In-action state. The list item is in this state when it enters the delete area. |
enum ArkUI_ListItemSwipeEdgeEffect
Description
Enumerates the item edge effects of swipeAction of the Listitem component. The default value is ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_SPRING.
Since: 12
| Value | Description |
|---|---|
| ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_SPRING = 0 | When the list item scrolls to the edge of the list, it can continue to scroll for a distance. |
| ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_NONE = 1 | The list item cannot scroll beyond the edge of the list. |
enum ArkUI_ListItemSwipeActionDirection
Description
Enumerates the swipe action menu display directions for ListItem components.
Since: 21
| Value | Description |
|---|---|
| ARKUI_LIST_ITEM_SWIPE_ACTION_DIRECTION_START = 0 | For vertical lists: left side in LTR mode, right side in RTL mode. For horizontal lists: top side. |
| ARKUI_LIST_ITEM_SWIPE_ACTION_DIRECTION_END = 1 | For vertical lists: right side in LTR mode, left side in RTL mode. For horizontal lists: bottom side. |
enum ArkUI_CrownSensitivity
Description
Enumerates crown sensitivity levels.
Since: 26.0.0
| Value | Description |
|---|---|
| ARKUI_CROWN_SENSITIVITY_LOW = 0 | Low sensitivity. |
| ARKUI_CROWN_SENSITIVITY_MEDIUM = 1 | Medium sensitivity. |
| ARKUI_CROWN_SENSITIVITY_HIGH = 2 | High sensitivity. |
enum ArkUI_SafeAreaType
Description
Enumerates the types of expanded safe areas.
Since: 12
| Value | Description |
|---|---|
| ARKUI_SAFE_AREA_TYPE_SYSTEM = 1 | Default non-safe area of the system, including the status bar and navigation bar. This is the default value. |
| ARKUI_SAFE_AREA_TYPE_CUTOUT = 1 << 1 | Non-safe area of the device, for example, the notch area. |
| ARKUI_SAFE_AREA_TYPE_KEYBOARD = 1 << 2 | Soft keyboard area. |
enum ArkUI_KeyboardAvoidMode
Description
Enumerates the soft keyboard avoidance modes.
Since: 15
| Value | Description |
|---|---|
| ARKUI_KEYBOARD_AVOID_MODE_DEFAULT = 0 | Automatically avoids the soft keyboard and compresses the height when reaching the maximum limit. |
| ARKUI_KEYBOARD_AVOID_MODE_NONE = 1 | The layout is not adjusted to avoid the keyboard. |
enum ArkUI_HoverModeAreaType
Description
Enumerates the types of display areas for the hover mode.
Since: 15
| Value | Description |
|---|---|
| ARKUI_HOVER_MODE_AREA_TYPE_TOP = 0 | Upper half screen. |
| ARKUI_HOVER_MODE_AREA_TYPE_BOTTOM = 1 | Lower half screen. |
enum ArkUI_ExpandMode
Description
Enumerates the expansion mode of child nodes.
Since: 15
| Value | Description |
|---|---|
| ARKUI_NOT_EXPAND = 0 | Child nodes are not expanded. |
| ARKUI_EXPAND = 1 | Child nodes are expanded immediately upon rendering. |
| ARKUI_LAZY_EXPAND = 2 | Lazy expansion, indicating that child nodes are only expanded when needed. For details about the node expansion conditions, see LazyForEach: Lazy Data Loading. |
enum ArkUI_FocusWrapMode
Description
Enumerates the focus wrap mode of components. The default value is ARKUI_FOCUS_WRAP_MODE_DEFAULT for the Grid and List components.
Since: 20
| Value | Description |
|---|---|
| ARKUI_FOCUS_WRAP_MODE_DEFAULT = 0 | Default mode, where focus does not wrap when arrow keys are used. |
| ARKUI_FOCUS_WRAP_WITH_ARROW = 1 | Auto mode, where focus wraps automatically when arrow keys are used. |
enum ArkUI_ItemFillPolicy
Description
Enumerates column count policies for different responsive breakpoints.
Since: 22
| Value | Description |
|---|---|
| ARKUI_ITEMFILLPOLICY_NONE = -1 | No responsive breakpoint policy is set. |
| ARKUI_ITEMFILLPOLICY_DEFAULT = 0 | List or Swiper component: 1 column (SM or smaller), 2 columns (MD), 3 columns (LG or larger). Grid or WaterFlow component: 2 columns (SM or smaller), 3 columns (MD), 5 columns (LG or larger). |
| ARKUI_ITEMFILLPOLICY_SM1MD2LG3 = 1 | 1 column (SM or smaller), 2 columns (MD), 3 columns (LG or larger). |
| ARKUI_ITEMFILLPOLICY_SM2MD3LG5 = 2 | 2 columns (SM or smaller), 3 columns (MD), 5 columns (LG or larger). |
enum ArkUI_EdgeDirection
Description
Enumerates rectangle edge directions.
Since: 20
| Value | Description |
|---|---|
| ARKUI_EDGE_DIRECTION_ALL = 0 | All four edges. |
| ARKUI_EDGE_DIRECTION_LEFT = 1 << 0 | Left edge. |
| ARKUI_EDGE_DIRECTION_RIGHT = 1 << 1 | Right edge. |
| ARKUI_EDGE_DIRECTION_TOP = 1 << 2 | Top edge. |
| ARKUI_EDGE_DIRECTION_BOTTOM = 1 << 3 | Bottom edge. |
enum ArkUI_CornerDirection
Description
Enumerates corner directions.
Since: 20
| Value | Description |
|---|---|
| ARKUI_CORNER_DIRECTION_ALL = 0 | All four corners. |
| ARKUI_CORNER_DIRECTION_TOP_LEFT = 1 << 0 | Upper left corner. |
| ARKUI_CORNER_DIRECTION_TOP_RIGHT = 1 << 1 | Upper right corner. |
| ARKUI_CORNER_DIRECTION_BOTTOM_LEFT = 1 << 2 | Lower left corner. |
| ARKUI_CORNER_DIRECTION_BOTTOM_RIGHT = 1 << 3 | Lower right corner. |
enum ArkUI_RenderStrategy
Description
Enumerates strategies for drawing rounded corners.
Since: 23
| Value | Description |
|---|---|
| ARKUI_RENDERSTRATEGY_FAST = 0 | Online drawing mode. |
| ARKUI_RENDERSTRATEGY_OFFSCREEN = 1 | Off-screen drawing mode. |
enum OH_ArkUI_CrossLanguageOperatingStatus
Description
Enumerates the node tree operation states of cross-language configuration options.
Since: 26.0.0
| Value | Description |
|---|---|
| OH_ARKUI_TREE_OPERATING_STATUS_UNDEFINED = 0 | Undefined, which is the initial value of the node tree operation state. Nodes in this state do not support cross-language node tree operations. |
| OH_ARKUI_TREE_OPERATING_STATUS_ENABLE = 1 | Enabled, which indicates that when the configuration option is applied to a node, the node tree operation state of the node will be enabled. |
| OH_ARKUI_TREE_OPERATING_STATUS_DISABLE = 2 | Disabled, which indicates that when the configuration option is applied to a node, the node tree operation state of the node will be disabled. |
enum OH_ArkUI_NodeMountPolicy
Description
Enumerates the child node mounting policy types.
Since: 26.0.0
| Value | Description |
|---|---|
| OH_ARKUI_NODE_MOUNT_POLICY_SINGLE_IF_RENDER_NODE = 0 | If a RenderNode needs to be mounted as a child node, this RenderNode must be the only child node. |
| OH_ARKUI_NODE_MOUNT_POLICY_MIXED = 1 | Multiple typeNodes and RenderNodes can be mounted at the same time. |
ArkUI_LayoutConstraint* OH_ArkUI_LayoutConstraint_Create()
Description
Creates layout constraints. After the created layout constraint pointer is used, call OH_ArkUI_LayoutConstraint_Dispose to release it. If the pointer is not released, memory leakage may occur.
Since: 12
Returns
| Type | Description |
|---|---|
| ArkUI_LayoutConstraint* | Pointer to the created layout constraint. |
ArkUI_LayoutConstraint* OH_ArkUI_LayoutConstraint_Copy(const ArkUI_LayoutConstraint* Constraint)
Description
Performs a deep copy of a layout constraint. The new layout constraint pointer returned by the deep copy is independent of the original pointer. You need to call OH_ArkUI_LayoutConstraint_Dispose to release them separately after use.
Since: 12
Parameters
| Name | Description |
|---|---|
| const ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
Returns
| Type | Description |
|---|---|
| ArkUI_LayoutConstraint* | Pointer to the new layout constraint. |
void* OH_ArkUI_LayoutConstraint_Dispose(ArkUI_LayoutConstraint* Constraint)
Description
Disposes of a layout constraint pointer. This API must be used together with OH_ArkUI_LayoutConstraint_Create or OH_ArkUI_LayoutConstraint_Copy. Each layout constraint pointer can be destroyed only once. After being destroyed, the pointer should not be used anymore.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
Returns
| Type | Description |
|---|---|
| void* | Null pointer. |
int32_t OH_ArkUI_LayoutConstraint_GetMaxWidth(const ArkUI_LayoutConstraint* Constraint)
Description
Obtains the maximum width using a layout constraint.
Since: 12
Parameters
| Name | Description |
|---|---|
| const ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
Returns
| Type | Description |
|---|---|
| int32_t | Maximum width, in pixels. |
int32_t OH_ArkUI_LayoutConstraint_GetMinWidth(const ArkUI_LayoutConstraint* Constraint)
Description
Obtains the minimum width using a layout constraint.
Since: 12
Parameters
| Name | Description |
|---|---|
| const ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
Returns
| Type | Description |
|---|---|
| int32_t | Minimum width, in px. |
int32_t OH_ArkUI_LayoutConstraint_GetMaxHeight(const ArkUI_LayoutConstraint* Constraint)
Description
Obtains the maximum height using a layout constraint.
Since: 12
Parameters
| Name | Description |
|---|---|
| const ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
Returns
| Type | Description |
|---|---|
| int32_t | Maximum height, in px. |
int32_t OH_ArkUI_LayoutConstraint_GetMinHeight(const ArkUI_LayoutConstraint* Constraint)
Description
Obtains the minimum height using a layout constraint.
Since: 12
Parameters
| Name | Description |
|---|---|
| const ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
Returns
| Type | Description |
|---|---|
| int32_t | Minimum height, in px. |
int32_t OH_ArkUI_LayoutConstraint_GetPercentReferenceWidth(const ArkUI_LayoutConstraint* Constraint)
Description
Obtains the width percentage reference using a layout constraint.
Since: 12
Parameters
| Name | Description |
|---|---|
| const ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
Returns
| Type | Description |
|---|---|
| int32_t | Width percentage reference. |
int32_t OH_ArkUI_LayoutConstraint_GetPercentReferenceHeight(const ArkUI_LayoutConstraint* Constraint)
Description
Obtains the height percentage reference using a layout constraint.
Since: 12
Parameters
| Name | Description |
|---|---|
| const ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
Returns
| Type | Description |
|---|---|
| int32_t | Height percentage reference. |
void OH_ArkUI_LayoutConstraint_SetMaxWidth(ArkUI_LayoutConstraint* Constraint, int32_t value)
Description
Sets the maximum width.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
| int32_t value | Maximum width, in px. The value range is [0, +∞). |
void OH_ArkUI_LayoutConstraint_SetMinWidth(ArkUI_LayoutConstraint* Constraint, int32_t value)
Description
Sets the minimum width.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
| int32_t value | Minimum width, in px. The value range is [0, +∞). |
void OH_ArkUI_LayoutConstraint_SetMaxHeight(ArkUI_LayoutConstraint* Constraint, int32_t value)
Description
Sets the maximum height.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
| int32_t value | Maximum height, in px. The value range is [0, +∞). |
void OH_ArkUI_LayoutConstraint_SetMinHeight(ArkUI_LayoutConstraint* Constraint, int32_t value)
Description
Sets the minimum height.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
| int32_t value | Minimum height, in px. The value range is [0, +∞). |
void OH_ArkUI_LayoutConstraint_SetPercentReferenceWidth(ArkUI_LayoutConstraint* Constraint, int32_t value)
Description
Sets the width percentage reference.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
| int32_t value | Width percentage reference. The value range is [0, +∞). |
void OH_ArkUI_LayoutConstraint_SetPercentReferenceHeight(ArkUI_LayoutConstraint* Constraint, int32_t value)
Description
Sets the height percentage reference.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_LayoutConstraint* Constraint | Pointer to the layout constraint. |
| int32_t value | Height percentage reference. The value range is [0, +∞). |
void* OH_ArkUI_DrawContext_GetCanvas(ArkUI_DrawContext* context)
Description
Obtains the pointer to the canvas for drawing, which can be converted into the OH_Drawing_Canvas pointer of the graphics library for drawing.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_DrawContext* context | Pointer to the drawing context. |
Returns
| Type | Description |
|---|---|
| void* | Pointer to the canvas for drawing. |
ArkUI_IntSize OH_ArkUI_DrawContext_GetSize(ArkUI_DrawContext* context)
Description
Obtains the size of a drawing area.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_DrawContext* context | Pointer to the drawing context. |
Returns
| Type | Description |
|---|---|
| ArkUI_IntSize | Size of the drawing area. |
void OH_ArkUI_SwiperDigitIndicator_SetFontWeight(ArkUI_SwiperDigitIndicator *indicator, ArkUI_FontWeight fontWeight)
Description
Sets the font weight of the digit-style navigation indicator for the Swiper component.
Since: 19
Parameters
| Name | Description |
|---|---|
| ArkUI_SwiperDigitIndicator *indicator | Pointer to the digit-style navigation indicator. |
| ArkUI_FontWeight fontWeight | Font weight. The value is an enumerated value of ArkUI_FontWeight. |
ArkUI_FontWeight OH_ArkUI_SwiperDigitIndicator_GetFontWeight(ArkUI_SwiperDigitIndicator* indicator)
Description
Obtains the font weight of the digit-style navigation indicator of the Swiper component.
Since: 19
Parameters
| Name | Description |
|---|---|
| ArkUI_SwiperDigitIndicator* indicator | Pointer to the digit-style navigation indicator. |
Returns
| Type | Description |
|---|---|
| ArkUI_FontWeight | Font weight. The value is an enumerated value of ArkUI_FontWeight. |
void OH_ArkUI_SwiperDigitIndicator_SetSelectedFontWeight(ArkUI_SwiperDigitIndicator *indicator, ArkUI_FontWeight selectedFontWeight)
Description
Sets the font weight of the selected digit-style navigation indicator for the Swiper component.
Since: 19
Parameters
| Name | Description |
|---|---|
| ArkUI_SwiperDigitIndicator *indicator | Pointer to the digit-style navigation indicator. |
| ArkUI_FontWeight selectedFontWeight | Font weight. The value is an enumerated value of ArkUI_FontWeight. |
ArkUI_FontWeight OH_ArkUI_SwiperDigitIndicator_GetSelectedFontWeight(ArkUI_SwiperDigitIndicator* indicator)
Description
Obtains the font weight of the selected digit-style navigation indicator of the Swiper component.
Since: 19
Parameters
| Name | Description |
|---|---|
| ArkUI_SwiperDigitIndicator* indicator | Pointer to the digit-style navigation indicator. |
Returns
| Type | Description |
|---|---|
| ArkUI_FontWeight | Font weight. The value is an enumerated value of ArkUI_FontWeight. |
ArkUI_ListItemSwipeActionItem* OH_ArkUI_ListItemSwipeActionItem_Create()
Description
Creates a ListItemSwipeActionItem instance.
Since: 12
Returns
| Type | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* | Pointer to the ListItemSwipeActionItem instance. |
void OH_ArkUI_ListItemSwipeActionItem_Dispose(ArkUI_ListItemSwipeActionItem* item)
Description
Disposes of a ListItemSwipeActionItem instance.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance to dispose of. |
void OH_ArkUI_ListItemSwipeActionItem_SetContent(ArkUI_ListItemSwipeActionItem* item, ArkUI_NodeHandle node)
Description
Sets the layout content for a ListItemSwipeActionItem instance.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| ArkUI_NodeHandle node | Layout information. |
void OH_ArkUI_ListItemSwipeActionItem_SetActionAreaDistance(ArkUI_ListItemSwipeActionItem* item, float distance)
Description
Sets the swipe distance threshold for deleting the list item.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| float distance | Swipe distance threshold for deleting the list item, in vp. |
float OH_ArkUI_ListItemSwipeActionItem_GetActionAreaDistance(ArkUI_ListItemSwipeActionItem* item)
Description
Obtains the swipe distance threshold for deleting the list item.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
Returns
| Type | Description |
|---|---|
| float | Swipe distance threshold for deleting the list item, in vp. The value 0 is returned if an exception occurs. |
void OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionArea(ArkUI_ListItemSwipeActionItem* item, void (*callback)())
Description
Sets the callback invoked each time the list item enters the delete area.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| void (*callback)() | Pointer to the callback event. |
void OH_ArkUI_ListItemSwipeActionItem_SetOnEnterActionAreaWithUserData(ArkUI_ListItemSwipeActionItem* item,void* userData, void (*callback)(void* userData))
Description
Sets the callback invoked each time the list item enters the delete area. User-defined data will be passed to the callback event.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| void* userData | Pointer to the user-defined data. |
| void (*callback)(void* userData) | Pointer to the callback event. |
void OH_ArkUI_ListItemSwipeActionItem_SetOnAction(ArkUI_ListItemSwipeActionItem* item, void (*callback)())
Description
Sets the callback invoked when the list item is deleted while in the delete area.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| void (*callback)() | Pointer to the callback event. |
void OH_ArkUI_ListItemSwipeActionItem_SetOnActionWithUserData(ArkUI_ListItemSwipeActionItem* item,void* userData, void (*callback)(void* userData))
Description
Sets the callback invoked when the list item is deleted while in the delete area. User-defined data will be passed to the callback event.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| void* userData | Pointer to the user-defined data. |
| void (*callback)(void* userData) | Pointer to the callback event. |
void OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionArea(ArkUI_ListItemSwipeActionItem* item, void (*callback)())
Description
Sets the callback invoked each time the list item exits the delete area.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| void (*callback)() | Pointer to the callback event. |
void OH_ArkUI_ListItemSwipeActionItem_SetOnExitActionAreaWithUserData(ArkUI_ListItemSwipeActionItem* item,void* userData, void (*callback)(void* userData))
Description
Sets the callback invoked each time the list item exits the delete area. User-defined data will be passed to the callback event.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| void* userData | Pointer to the user-defined data. |
| void (*callback)(void* userData) | Pointer to the callback event. |
void OH_ArkUI_ListItemSwipeActionItem_SetOnStateChange(ArkUI_ListItemSwipeActionItem* item,void (*callback)(ArkUI_ListItemSwipeActionState swipeActionState))
Description
Sets the callback invoked when the swipe state of the list item changes.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| void (*callback)(ArkUI_ListItemSwipeActionState swipeActionState) | Pointer to the callback event. The parameter passed is swipeActionState, which indicates the swipe state of the list item. |
void OH_ArkUI_ListItemSwipeActionItem_SetOnStateChangeWithUserData(ArkUI_ListItemSwipeActionItem* item,void* userData, void (*callback)(ArkUI_ListItemSwipeActionState swipeActionState, void* userData))
Description
Sets the callback invoked when the swipe state of the list item changes. User-defined data will be passed to the callback event.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionItem* item | Pointer to the ListItemSwipeActionItem instance. |
| void* userData | Pointer to the user-defined data. |
| callback | Callback event. The input parameter is swipeActionState, indicating the swipe state of the list item. |
ArkUI_ListItemSwipeActionOption* OH_ArkUI_ListItemSwipeActionOption_Create()
Description
Creates a ListItemSwipeActionOption instance.
Since: 12
Returns
| Type | Description |
|---|---|
| ArkUI_ListItemSwipeActionOption* | Pointer to the ListItemSwipeActionOption instance. |
void OH_ArkUI_ListItemSwipeActionOption_Dispose(ArkUI_ListItemSwipeActionOption* option)
Description
Disposes of a ListItemSwipeActionOption instance.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionOption* option | Pointer to the ListItemSwipeActionOption instance to dispose of. |
void OH_ArkUI_ListItemSwipeActionOption_SetStart(ArkUI_ListItemSwipeActionOption* option, ArkUI_ListItemSwipeActionItem* item)
Description
Sets the layout content for the left edge (for a vertical layout) or top edge (for a horizontal layout) of a ListItemSwipeActionItem instance.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionOption* option | Pointer to the ListItemSwipeActionOption instance. |
| ArkUI_ListItemSwipeActionItem* item | Pointer to the layout information. |
void OH_ArkUI_ListItemSwipeActionOption_SetEnd(ArkUI_ListItemSwipeActionOption* option,ArkUI_ListItemSwipeActionItem* item)
Description
Sets the layout content for the right edge (for a vertical layout) or bottom edge (for a horizontal layout) of a ListItemSwipeActionItem instance.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionOption* option | Pointer to the ListItemSwipeActionOption instance. |
| ArkUI_ListItemSwipeActionItem* item | Pointer to the layout information. |
void OH_ArkUI_ListItemSwipeActionOption_SetEdgeEffect(ArkUI_ListItemSwipeActionOption* option,ArkUI_ListItemSwipeEdgeEffect edgeEffect)
Description
Sets the effect used when the scroll boundary is reached.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionOption* option | Pointer to the ListItemSwipeActionOption instance. |
| ArkUI_ListItemSwipeEdgeEffect edgeEffect | Effect used when the boundary of the scrolling area is reached. |
int32_t OH_ArkUI_ListItemSwipeActionOption_GetEdgeEffect(ArkUI_ListItemSwipeActionOption* option)
Description
Obtains the effect used when the scroll boundary is reached.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionOption* option | Pointer to the ListItemSwipeActionOption instance. |
Returns
| Type | Description |
|---|---|
| int32_t | Effect used when the boundary of the scrolling area is reached. The default return value is ARKUI_LIST_ITEM_SWIPE_EDGE_EFFECT_SPRING. |
void OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChange(ArkUI_ListItemSwipeActionOption* option,void (*callback)(float offset))
Description
Sets the callback invoked when the scroll offset changes.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionOption* option | Pointer to the ListItemSwipeActionOption instance. |
| callback | Callback event. offset: scroll offset, in vp. |
void OH_ArkUI_ListItemSwipeActionOption_SetOnOffsetChangeWithUserData(ArkUI_ListItemSwipeActionOption* option,void* userData, void (*callback)(float offset, void* userData))
Description
Sets the callback invoked when the scroll offset changes. User-defined data will be passed to the callback event.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_ListItemSwipeActionOption* option | Pointer to the ListItemSwipeActionOption instance. |
| void* userData | Pointer to the user-defined data. |
| callback | Callback event. offset: scroll offset, in vp. |
int32_t OH_ArkUI_ListItemSwipeAction_Expand(ArkUI_NodeHandle node, ArkUI_ListItemSwipeActionDirection direction)
Description
Expands the swipe action menu for the specified list item.
Since: 21
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | ListItem node object. |
| ArkUI_ListItemSwipeActionDirection direction | Swipe action menu display direction for the ListItem component. |
Returns
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_PARAM_ERROR if the passed node object type is incorrect. Returns ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE if the passed node is not mounted to the component tree. |
int32_t OH_ArkUI_ListItemSwipeAction_Collapse(ArkUI_NodeHandle node)
Description
Collapses the swipe action menu for the specified list item.
Since: 21
Parameters
| Name | Description |
|---|---|
| ArkUI_NodeHandle node | ListItem node object. |
Returns
| Type | Description |
|---|---|
| int32_t | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_PARAM_ERROR if the passed node object type is incorrect. Returns ARKUI_ERROR_CODE_NODE_NOT_ON_MAIN_TREE if the passed node is not mounted to the component tree. |
ArkUI_AccessibilityState* OH_ArkUI_AccessibilityState_Create(void)
Description
Creates an accessibility state.
Since: 12
Returns
| Type | Description |
|---|---|
| ArkUI_AccessibilityState* | Pointer to the created accessibility state object. If a null pointer is returned, the creation fails. A possible cause is that the application address space is full. |
void OH_ArkUI_AccessibilityState_Dispose(ArkUI_AccessibilityState* state)
Description
Disposes of the pointer to an accessibility state.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityState* state | Pointer to the created accessibility state object. |
void OH_ArkUI_AccessibilityState_SetDisabled(ArkUI_AccessibilityState* state, int32_t isDisabled)
Description
Sets whether an accessibility state is disabled.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityState* state | Pointer to the created accessibility state object. |
| int32_t isDisabled | Whether the accessibility state is disabled. The value 1 means that the accessibility state is disabled, and 0 means the opposite. The default value is 0. |
int32_t OH_ArkUI_AccessibilityState_IsDisabled(ArkUI_AccessibilityState* state)
Description
Obtains whether an accessibility state is disabled.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityState* state | Pointer to the created accessibility state object. |
Returns
| Type | Description |
|---|---|
| int32_t | Whether the accessibility state is disabled. The value 1 means that the accessibility state is disabled, and 0 means the opposite. The default value is 0. If the value of state is null, the default value is returned. |
void OH_ArkUI_AccessibilityState_SetSelected(ArkUI_AccessibilityState* state, int32_t isSelected)
Description
Sets whether an accessibility state is selected.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityState* state | Pointer to the created accessibility state object. |
| int32_t isSelected | Whether the accessibility state is selected. The value 1 means that the accessibility state is selected, and 0 means the opposite. The default value is 0. |
int32_t OH_ArkUI_AccessibilityState_IsSelected(ArkUI_AccessibilityState* state)
Description
Obtains whether an accessibility state is selected.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityState* state | Pointer to the created accessibility state object. |
Returns
| Type | Description |
|---|---|
| int32_t | Whether the accessibility state is selected. The value 1 means that the accessibility state is selected, and 0 means the opposite. The default value is 0. If the value of state is null, the default value is returned. |
void OH_ArkUI_AccessibilityState_SetCheckedState(ArkUI_AccessibilityState* state, int32_t checkedState)
Description
Sets the check box state of an accessibility state.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityState* state | Pointer to the created accessibility state object. |
| int32_t checkedState | Check box status. The parameter type is ArkUI_AccessibilityCheckedState. The default value is ARKUI_ACCESSIBILITY_UNCHECKED. |
int32_t OH_ArkUI_AccessibilityState_GetCheckedState(ArkUI_AccessibilityState* state)
Description
Obtains the check box state of an accessibility state.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityState* state | Pointer to the created accessibility state object. |
Returns
| Type | Description |
|---|---|
| int32_t | Check box status. The parameter type is ArkUI_AccessibilityCheckedState. The default value is ARKUI_ACCESSIBILITY_UNCHECKED. If a parameter error occurs, the default value is returned. |
ArkUI_AccessibilityValue* OH_ArkUI_AccessibilityValue_Create(void)
Description
Creates an AccessibilityValue instance.
Since: 12
Returns
| Type | Description |
|---|---|
| ArkUI_AccessibilityValue* | Pointer to the created AccessibilityValue instance. |
void OH_ArkUI_AccessibilityValue_Dispose(ArkUI_AccessibilityValue* value)
Description
Disposes of the pointer to an AccessibilityValue instance.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the created AccessibilityValue instance. |
void OH_ArkUI_AccessibilityValue_SetMin(ArkUI_AccessibilityValue* value, int32_t min)
Description
Sets the minimum accessibility value.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the created AccessibilityValue instance. |
| int32_t min | Minimum value for the range-based component. The default value is -1. |
int32_t OH_ArkUI_AccessibilityValue_GetMin(ArkUI_AccessibilityValue* value)
Description
Obtains the minimum accessibility value.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the created AccessibilityValue instance. |
Returns
| Type | Description |
|---|---|
| int32_t | Minimum value for the range-based component. The default value is -1. If a parameter error occurs, -1 is returned. |
void OH_ArkUI_AccessibilityValue_SetMax(ArkUI_AccessibilityValue* value, int32_t max)
Description
Sets the maximum accessibility value.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the created AccessibilityValue instance. |
| int32_t max | Maximum value for the range-based component. The default value is -1. |
int32_t OH_ArkUI_AccessibilityValue_GetMax(ArkUI_AccessibilityValue* value)
Description
Obtains the maximum accessibility value.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the created AccessibilityValue instance. |
Returns
| Type | Description |
|---|---|
| int32_t | Maximum value for the range-based component. The default value is -1. If a parameter error occurs, -1 is returned. |
void OH_ArkUI_AccessibilityValue_SetCurrent(ArkUI_AccessibilityValue* value, int32_t current)
Description
Sets the current accessibility value.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the created AccessibilityValue instance. |
| int32_t current | Current value for the range-based component. The default value is -1. |
int32_t OH_ArkUI_AccessibilityValue_GetCurrent(ArkUI_AccessibilityValue* value)
Description
Obtains the current accessibility value.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the created AccessibilityValue instance. |
Returns
| Type | Description |
|---|---|
| int32_t | Current value for the range-based component. The default value is -1. If a parameter error occurs, -1 is returned. |
void OH_ArkUI_AccessibilityValue_SetRangeMin(ArkUI_AccessibilityValue* value, int32_t rangeMin)
Description
Sets the minimum value for accessibility information of the range-based component.
Since: 18
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the accessibility information object of the range-based component for which you want to set the minimum value. |
| int32_t rangeMin | Minimum value for the range-based component. The default value is -1. |
int32_t OH_ArkUI_AccessibilityValue_GetRangeMin(ArkUI_AccessibilityValue* value)
Description
Obtains the minimum value for accessibility information of the range-based component.
Since: 18
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the accessibility information object of the range-based component for which you want to obtain the minimum value. |
Returns
| Type | Description |
|---|---|
| int32_t | Minimum value for the range-based component. The default value is -1. If a parameter error occurs, -1 is returned. |
void OH_ArkUI_AccessibilityValue_SetRangeMax(ArkUI_AccessibilityValue* value, int32_t rangeMax)
Description
Sets the maximum value for accessibility information of the range-based component.
Since: 18
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the accessibility information object of the range-based component for which you want to set the maximum value. |
| int32_t rangeMax | Maximum value for the range-based component. The default value is -1. |
int32_t OH_ArkUI_AccessibilityValue_GetRangeMax(ArkUI_AccessibilityValue* value)
Description
Obtains the maximum value for accessibility information of the range-based component.
Since: 18
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the accessibility information object of the range-based component for which you want to obtain the minimum value. |
Returns
| Type | Description |
|---|---|
| int32_t | Maximum value for the range-based component. The default value is -1. If a parameter error occurs, -1 is returned. |
void OH_ArkUI_AccessibilityValue_SetRangeCurrent(ArkUI_AccessibilityValue* value, int32_t rangeCurrent)
Description
Sets the current value for accessibility information of the range-based component.
Since: 18
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the accessibility information object of the range-based component for which you want to set the current value. |
| int32_t rangeCurrent | Current value for the range-based component. The default value is -1. |
int32_t OH_ArkUI_AccessibilityValue_GetRangeCurrent(ArkUI_AccessibilityValue* value)
Description
Obtains the current value for accessibility information of the range-based component.
Since: 18
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the accessibility information object of the range-based component for which you want to obtain the current value. |
Returns
| Type | Description |
|---|---|
| int32_t | Current value for the range-based component. The default value is -1. If a parameter error occurs, -1 is returned. |
void OH_ArkUI_AccessibilityValue_SetText(ArkUI_AccessibilityValue* value, const char* text)
Description
Sets the text description of an AccessibilityValue instance.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the created AccessibilityValue instance. |
| const char* text | Pointer to the text description. The default value is an empty string. |
const char* OH_ArkUI_AccessibilityValue_GetText(ArkUI_AccessibilityValue* value)
Description
Obtains the text description of an AccessibilityValue instance.
Since: 12
Parameters
| Name | Description |
|---|---|
| ArkUI_AccessibilityValue* value | Pointer to the created AccessibilityValue instance. |
Returns
| Type | Description |
|---|---|
| const char* | Pointer to the text description. The default value is an empty string. If a parameter error occurs, a null pointer is returned. |
void OH_ArkUI_CustomProperty_Destroy(ArkUI_CustomProperty* handle)
Description
Destroys an ArkUI_CustomProperty instance.
Since: 14
Parameters
| Name | Description |
|---|---|
| ArkUI_CustomProperty* handle | Pointer to the instance to be destroyed. |
const char* OH_ArkUI_CustomProperty_GetStringValue(ArkUI_CustomProperty* handle)
Description
Obtains the value of a custom property object.
Since: 14
Parameters
| Name | Description |
|---|---|
| ArkUI_CustomProperty* handle | Pointer to the custom property object. |
Returns
| Type | Description |
|---|---|
| const char* | Pointer to the value of a custom property object. |
const char* OH_ArkUI_HostWindowInfo_GetName(ArkUI_HostWindowInfo* info)
Description
Obtains the window name in an ArkUI_HostWindowInfo object.
Since: 15
Parameters
| Name | Description |
|---|---|
| ArkUI_HostWindowInfo* info | Pointer to the HostWindowInfo object. |
Returns
| Type | Description |
|---|---|
| const char* | Pointer to the window name in the ArkUI_HostWindowInfo object. |
void OH_ArkUI_HostWindowInfo_Destroy(ArkUI_HostWindowInfo* info)
Description
Destroys an ArkUI_HostWindowInfo object.
Since: 15
Parameters
| Name | Description |
|---|---|
| ArkUI_HostWindowInfo* info | Pointer to the ArkUI_HostWindowInfo object to be destroyed. |
void OH_ArkUI_ActiveChildrenInfo_Destroy(ArkUI_ActiveChildrenInfo* handle)
Description
Destroys the ArkUI_ActiveChildrenInfo instance and releases the resources allocated when obtaining information about active child nodes.
Since: 14
Parameters
| Name | Description |
|---|---|
| ArkUI_ActiveChildrenInfo* handle | Pointer to the ArkUI_ActiveChildrenInfo instance to be destroyed. |
ArkUI_NodeHandle OH_ArkUI_ActiveChildrenInfo_GetNodeByIndex(ArkUI_ActiveChildrenInfo* handle, int32_t index)
Description
Obtains the child node whose subscript is index in the ArkUI_ActiveChildrenInfo struct. This API is applicable to traversing active child nodes by subscript.
Since: 14
Parameters
| Name | Description |
|---|---|
| ArkUI_ActiveChildrenInfo* handle | Pointer to the ArkUI_ActiveChildrenInfo instance from which the information is to be obtained. |
| int32_t index | Index of the target child node. |
Returns
| Type | Description |
|---|---|
| ArkUI_NodeHandle | Handle to the child node at the specified index, or nullptr if an error occurs. |
int32_t OH_ArkUI_ActiveChildrenInfo_GetCount(ArkUI_ActiveChildrenInfo* handle)
Description
Obtains the number of child nodes in the ArkUI_ActiveChildrenInfo struct. This API is applicable to determining the number of child nodes before traversing active child nodes.
Since: 14
Parameters
| Name | Description |
|---|---|
| ArkUI_ActiveChildrenInfo* handle | Pointer to the ArkUI_ActiveChildrenInfo instance from which the information is to be obtained. |
Returns
| Type | Description |
|---|---|
| int32_t | Number of child nodes. The default value is 0. |
ArkUI_CrossLanguageOption* OH_ArkUI_CrossLanguageOption_Create(void)
Description
Creates an instance of the cross-language configuration option.
Since: 15
Returns
| Type | Description |
|---|---|
| ArkUI_CrossLanguageOption* | Pointer to the ArkUI_CrossLanguageOption instance created. If a null pointer is returned, creation failed, possibly due to insufficient memory. |
void OH_ArkUI_CrossLanguageOption_Destroy(ArkUI_CrossLanguageOption* option)
Description
Destroys an instance of the cross-language configuration option.
Since: 15
Parameters
| Name | Description |
|---|---|
| ArkUI_CrossLanguageOption* option | Pointer to the cross-language configuration option instance to be destroyed. |
void OH_ArkUI_CrossLanguageOption_SetAttributeSettingStatus(ArkUI_CrossLanguageOption* option, bool enabled)
Description
Sets whether cross-language attribute setting is allowed in the configuration option.
Since: 15
Parameters
| Name | Description |
|---|---|
| ArkUI_CrossLanguageOption* option | Pointer to the cross-language configuration option instance. |
| bool enabled | Whether cross-language attribute setting is allowed. true means that cross-language attribute setting is allowed, and false means the opposite. The default value is false. |
bool OH_ArkUI_CrossLanguageOption_GetAttributeSettingStatus(ArkUI_CrossLanguageOption* option)
Description
Checks whether cross-language attribute setting is allowed in the configuration option.
Since: 15
Parameters
| Name | Description |
|---|---|
| ArkUI_CrossLanguageOption* option | Pointer to the cross-language configuration option instance. |
Returns
| Type | Description |
|---|---|
| bool | Whether cross-language attribute setting is allowed. true means that cross-language attribute setting is allowed, and false means the opposite. |
void OH_ArkUI_CrossLanguageOption_SetTreeOperatingStatus(ArkUI_CrossLanguageOption* option, OH_ArkUI_CrossLanguageOperatingStatus status)
Description
Sets the node tree operation state of a cross-language configuration option.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_CrossLanguageOption* option | Pointer to the cross-language configuration option instance. |
| OH_ArkUI_CrossLanguageOperatingStatus status | Node tree operation state to be set. Default value: OH_ARKUI_TREE_OPERATING_STATUS_UNDEFINED. |
OH_ArkUI_CrossLanguageOperatingStatus OH_ArkUI_CrossLanguageOption_GetTreeOperatingStatus(ArkUI_CrossLanguageOption* option)
Description
Obtains the node tree operation state of a cross-language configuration option.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| ArkUI_CrossLanguageOption* option | Pointer to the cross-language configuration option instance. |
Returns
| Type | Description |
|---|---|
| OH_ArkUI_CrossLanguageOperatingStatus | Node tree operation state of a cross-language configuration option. |
ArkUI_ContentTransitionEffect* OH_ArkUI_ContentTransitionEffect_Create(int32_t type)
Description
Creates a ContentTransitionEffect attribute object.
Since: 21
Parameters
| Name | Description |
|---|---|
| int32_t type | Transition animation type. 0: No transition animation. 1: Fade-in and fade-out transition animation. |
Returns
| Type | Description |
|---|---|
| ArkUI_ContentTransitionEffect* | Pointer to the ContentTransitionEffect object. |
ArkUI_SelectionOptions* OH_ArkUI_SelectionOptions_Create()
Description
Creates a selection option.
Since: 23
Returns
| Type | Description |
|---|---|
| ArkUI_SelectionOptions* | Pointer to the selection option. |
void OH_ArkUI_SelectionOptions_Dispose(ArkUI_SelectionOptions* options)
Description
Releases a selection option object.
Since: 23
Parameters
| Name | Description |
|---|---|
| ArkUI_SelectionOptions* options | Pointer to the selection option to be released. |
ArkUI_SelectedDragPreviewStyle* OH_ArkUI_SelectedDragPreviewStyle_Create();
Description
Creates a preview style shown when dragging selected text.
Since: 23
Returns
| Type | Description |
|---|---|
| ArkUI_SelectedDragPreviewStyle* | Pointer to the ArkUI_SelectedDragPreviewStyle object. |
void OH_ArkUI_SelectedDragPreviewStyle_Dispose(ArkUI_SelectedDragPreviewStyle* config)
Description
Disposes of the preview style shown when dragging selected text.
Since: 23
Parameters
| Name | Description |
|---|---|
| ArkUI_SelectedDragPreviewStyle* config | Pointer to the ArkUI_SelectedDragPreviewStyle object. |
void OH_ArkUI_SelectedDragPreviewStyle_SetColor(ArkUI_SelectedDragPreviewStyle* config, uint32_t color);
Description
Sets the background color of the preview style shown when dragging selected text.
Since: 23
Parameters
| Name | Description |
|---|---|
| ArkUI_SelectedDragPreviewStyle* config | Pointer to the ArkUI_SelectedDragPreviewStyle object. |
| uint32_t color | Background color of the preview style shown when dragging selected text, in RGBA format. |
uint32_t OH_ArkUI_SelectedDragPreviewStyle_GetColor(ArkUI_SelectedDragPreviewStyle* config)
Description
Obtains the background color of the preview style shown when dragging selected text.
Since: 23
Parameters
| Name | Description |
|---|---|
| ArkUI_SelectedDragPreviewStyle* config | Pointer to the ArkUI_SelectedDragPreviewStyle object. |
Returns
| Type | Description |
|---|---|
| uint32_t | Background color of the preview style shown when dragging selected text, in RGBA format. |
ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_SetTextDecorationType(OH_ArkUI_DecorationStyleOptions* options, ArkUI_TextDecorationType type)
Description
Sets the decoration type of the decorative line style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
| ArkUI_TextDecorationType type | Decoration type, specified using ArkUI_TextDecorationType. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_GetTextDecorationType(OH_ArkUI_DecorationStyleOptions* options, ArkUI_TextDecorationType* type)
Description
Obtains the decoration type of the decorative line style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
| ArkUI_TextDecorationType* type | Pointer to the decoration type, specified using ArkUI_TextDecorationType. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_SetColor(OH_ArkUI_DecorationStyleOptions* options, uint32_t color)
Description
Sets the color of the decorative line.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
| uint32_t color | Color of the decorative line, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_GetColor(OH_ArkUI_DecorationStyleOptions* options, uint32_t* color)
Description
Obtains the color of the decorative line.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
| uint32_t* color | Pointer to the color of the decorative line, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_SetTextDecorationStyle(OH_ArkUI_DecorationStyleOptions* options, ArkUI_TextDecorationStyle style)
Description
Sets the style of the decorative line.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
| ArkUI_TextDecorationStyle style | Decorative line style, specified using ArkUI_TextDecorationStyle. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_GetTextDecorationStyle(OH_ArkUI_DecorationStyleOptions* options, ArkUI_TextDecorationStyle* style)
Description
Obtains the style of the decorative line.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
| ArkUI_TextDecorationStyle* style | Pointer to the decorative line style, specified using ArkUI_TextDecorationStyle. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_SetThicknessScale(OH_ArkUI_DecorationStyleOptions* options, float thicknessScale)
Description
Sets the scale factor of the decorative line thickness.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
| float thicknessScale | Scale factor of the decorative line thickness. The value range is [0, +∞). |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_DecorationStyleOptions_GetThicknessScale(OH_ArkUI_DecorationStyleOptions* options, float* thicknessScale)
Description
Obtains the scale factor of the decorative line thickness.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
| float* thicknessScale | Pointer to the scale factor of the decorative line thickness. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextDataDetectorConfig_SetTypes(OH_ArkUI_TextDataDetectorConfig* config, const ArkUI_TextDataDetectorType* types, int32_t length)
Description
Sets the types of the text entity recognition configuration.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextDataDetectorConfig* config | Pointer to the OH_ArkUI_TextDataDetectorConfig object. |
| const ArkUI_TextDataDetectorType* types | Type of the text entity recognition configuration. The value is an enumerated value of ArkUI_TextDataDetectorType. |
| int32_t length | Type quantity. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextDataDetectorConfig_GetTypes(OH_ArkUI_TextDataDetectorConfig* config, ArkUI_TextDataDetectorType* buffer, int32_t bufferSize, int32_t* writeLength)
Description
Obtains the types of the text entity recognition configuration.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextDataDetectorConfig* config | Pointer to the OH_ArkUI_TextDataDetectorConfig object. |
| ArkUI_TextDataDetectorType* buffer | Pointer to the buffer of the type array. |
| int32_t bufferSize | Maximum number of types that can be written to the buffer reserved for the types. |
| int32_t* writeLength | Pointer to the number of types that are actually written to the buffer. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR if the value of bufferSize is less than that of writeLength. |
ArkUI_ErrorCode OH_ArkUI_TextDataDetectorConfig_RegisterOnDetectResultUpdateCallback(OH_ArkUI_TextDataDetectorConfig* config, void* userData, void (*callback)(const char* result, int32_t length, void* userData))
Description
Sets the callback for text entity recognition result updates.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextDataDetectorConfig* config | Pointer to the OH_ArkUI_TextDataDetectorConfig object. |
| void* userData | Pointer to the user data. |
| void (*callback)(const char* result, int32_t length, void* userData) | Pointer to the callback when the recognition result is updated. result indicates the recognized text entity content. length indicates the end position of the selected text. userData indicates the user-defined data, which corresponds to the input parameter userData of the OH_ArkUI_TextDataDetectorConfig_RegisterOnDetectResultUpdateCallback API. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextDataDetectorConfig_SetColor(OH_ArkUI_TextDataDetectorConfig* config, uint32_t color)
Description
Sets the color of the recognized content.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextDataDetectorConfig* config | Pointer to the OH_ArkUI_TextDataDetectorConfig object. |
| uint32_t color | Color of the recognized content, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextDataDetectorConfig_GetColor(OH_ArkUI_TextDataDetectorConfig* config, uint32_t* color)
Description
Obtains the color of the recognized content.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextDataDetectorConfig* config | Pointer to the OH_ArkUI_TextDataDetectorConfig object. |
| uint32_t* color | Pointer to the color of the recognized content, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextDataDetectorConfig_SetDecorationStyleOptions(OH_ArkUI_TextDataDetectorConfig* config, OH_ArkUI_DecorationStyleOptions* decoration)
Description
Sets the decoration style of the recognized content.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextDataDetectorConfig* config | Pointer to the OH_ArkUI_TextDataDetectorConfig object. |
| OH_ArkUI_DecorationStyleOptions* decoration | Pointer to the decoration style of the recognized content. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextDataDetectorConfig_GetDecorationStyleOptions(OH_ArkUI_TextDataDetectorConfig* config, OH_ArkUI_DecorationStyleOptions* decoration)
Description
Obtains the decoration style of the recognized content.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextDataDetectorConfig* config | Pointer to the OH_ArkUI_TextDataDetectorConfig object. |
| OH_ArkUI_DecorationStyleOptions* decoration | Pointer to the decoration style of the recognized content. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_SetValue(OH_ArkUI_TextEditorPlaceholderOptions* options, const char* value)
Description
Sets the text for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| const char* value | Pointer to the placeholder text. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_GetValue(OH_ArkUI_TextEditorPlaceholderOptions* options, char* buffer, int32_t bufferSize, int32_t* writeLength)
Description
Obtains the text for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| char* buffer | Pointer to the buffer for storing the placeholder text in the memory. You need to allocate the memory. |
| int32_t bufferSize | Maximum number of characters that can be written to the buffer. |
| int32_t* writeLength | Pointer to the number of characters that are actually written to the buffer. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR if the value of bufferSize is less than that of writeLength. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_SetFontSize(OH_ArkUI_TextEditorPlaceholderOptions* options, float fontSize)
Description
Sets the font size for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| float fontSize | Font size, in fp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_GetFontSize(OH_ArkUI_TextEditorPlaceholderOptions* options, float* fontSize)
Description
Obtains the font size for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| float* fontSize | Pointer to the font size, in fp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_SetFontWeight(OH_ArkUI_TextEditorPlaceholderOptions* options, uint32_t fontWeight)
Description
Sets the font weight for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| uint32_t fontWeight | Font weight. The value is an enumerated value of ArkUI_FontWeight. The default value is ARKUI_FONT_WEIGHT_W400. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_GetFontWeight(OH_ArkUI_TextEditorPlaceholderOptions* options, uint32_t* fontWeight)
Description
Obtains the font weight for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| uint32_t* fontWeight | Pointer to the font weight. The value is an enumerated value of ArkUI_FontWeight. The default value is ARKUI_FONT_WEIGHT_W400. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_SetFontFamily(OH_ArkUI_TextEditorPlaceholderOptions* options, const char* fontFamily)
Description
Sets the font family for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| const char* fontFamily | Pointer to the font family, containing the font names to be set. Different font names are separated by commas (,). |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_GetFontFamily(OH_ArkUI_TextEditorPlaceholderOptions* options, char* buffer, int32_t bufferSize, int32_t* writeLength)
Description
Obtains the font family for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| char* buffer | Pointer to the buffer for storing the font family in the memory. You need to allocate the memory. |
| int32_t bufferSize | Maximum number of characters that can be written to the buffer. |
| int32_t* writeLength | Pointer to the number of characters that are actually written to the buffer. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. Returns ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR if the value of bufferSize is less than that of writeLength. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_SetFontStyle(OH_ArkUI_TextEditorPlaceholderOptions* options, ArkUI_FontStyle fontStyle)
Description
Sets the font style for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| ArkUI_FontStyle fontStyle | Font style. The value is an enumerated value of ArkUI_FontStyle. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_GetFontStyle(OH_ArkUI_TextEditorPlaceholderOptions* options, ArkUI_FontStyle* fontStyle)
Description
Obtains the font style for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| ArkUI_FontStyle* fontStyle | Pointer to the font style. The value is an enumerated value of ArkUI_FontStyle. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_SetFontColor(OH_ArkUI_TextEditorPlaceholderOptions* options, uint32_t fontColor)
Description
Sets the font color for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| uint32_t fontColor | Font color, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorPlaceholderOptions_GetFontColor(OH_ArkUI_TextEditorPlaceholderOptions* options, uint32_t* fontColor)
Description
Obtains the font color for the placeholder text options used when there is no input.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorPlaceholderOptions* options | Pointer to the OH_ArkUI_TextEditorPlaceholderOptions object. |
| uint32_t* fontColor | Pointer to the font color, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_SetCaretOffset(OH_ArkUI_TextEditorStyledStringController* controller, int32_t caretOffset)
Description
Sets the caret offset using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| int32_t caretOffset | Caret offset. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_GetCaretOffset(OH_ArkUI_TextEditorStyledStringController* controller, int32_t* caretOffset)
Description
Obtains the caret offset using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| int32_t* caretOffset | Pointer to the caret offset. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_SetSelection(OH_ArkUI_TextEditorStyledStringController* controller, uint32_t start, uint32_t end, ArkUI_MenuPolicy menuPolicy)
Description
Sets the selected area using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| uint32_t start | Start position of the selected area. |
| uint32_t end | End position of the selected area. |
| ArkUI_MenuPolicy menuPolicy | Policy for displaying the menu in the selected area. The value is an enumerated value of ArkUI_MenuPolicy. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_IsEditing(OH_ArkUI_TextEditorStyledStringController* controller, bool* isEditing)
Description
Obtains the editing status of the text editor using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| bool* isEditing | Pointer to the isEditing parameter indicating whether the text editor is in the editing state. true means that the text editor is in the editing state, and false means the opposite. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_StopEditing(OH_ArkUI_TextEditorStyledStringController* controller)
Description
Exits the editing status of the text editor using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_GetPreviewText(OH_ArkUI_TextEditorStyledStringController* controller, uint32_t* offset, char* buffer, int32_t bufferSize, int32_t* writeLength)
Description
Obtains the preview text using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| uint32_t* offset | Pointer to the preview text offset. |
| char* buffer | Pointer to the buffer for storing the preview text in the memory. You need to allocate the memory. |
| int32_t bufferSize | Maximum number of characters that can be written to the buffer. |
| int32_t* writeLength | Pointer to the number of characters that are actually written to the buffer. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_GetCaretRect(OH_ArkUI_TextEditorStyledStringController* controller, ArkUI_Rect* rect)
Description
Obtains the caret-selected rectangle using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| ArkUI_Rect* rect | Pointer to the caret-selected rectangle information. The value is an enumerated value of ArkUI_Rect. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_DeleteBackward(OH_ArkUI_TextEditorStyledStringController* controller)
Description
Deletes characters using the styled string controller. If no content is selected, one character before the current caret position is deleted. If content is selected, the selected content is deleted.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_SetTextAlign(OH_ArkUI_TextEditorParagraphStyle* style, ArkUI_TextAlignment align)
Description
Sets the text alignment mode in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| ArkUI_TextAlignment align | Text alignment mode. The value is an enumerated value of ArkUI_TextAlignment. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetTextAlign(OH_ArkUI_TextEditorParagraphStyle* style, ArkUI_TextAlignment* align)
Description
Obtains the text alignment mode in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| ArkUI_TextAlignment* align | Pointer to the text alignment mode. The value is an enumerated value of ArkUI_TextAlignment. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_SetLeadingMarginPixelMap(OH_ArkUI_TextEditorParagraphStyle* style, struct OH_PixelmapNative* pixelmap)
Description
Sets the PixelMap for paragraph indentation in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| struct OH_PixelmapNative* pixelmap | Pointer to the PixelMap for paragraph indentation. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetLeadingMarginPixelMap(OH_ArkUI_TextEditorParagraphStyle* style, struct OH_PixelmapNative** pixelmap)
Description
Obtains the PixelMap for paragraph indentation in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| struct OH_PixelmapNative** pixelmap | Double pointer to the PixelMap for paragraph indentation. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_SetLeadingMarginWidth(OH_ArkUI_TextEditorParagraphStyle* style, uint32_t width)
Description
Sets the width for paragraph indentation in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| uint32_t width | Width for paragraph indentation, in vp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetLeadingMarginWidth(OH_ArkUI_TextEditorParagraphStyle* style, uint32_t* width)
Description
Obtains the width for paragraph indentation in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| uint32_t* width | Pointer to the width for paragraph indentation, in vp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_SetLeadingMarginHeight(OH_ArkUI_TextEditorParagraphStyle* style, uint32_t height)
Description
Sets the height for paragraph indentation in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| uint32_t height | Height for paragraph indentation, in vp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetLeadingMarginHeight(OH_ArkUI_TextEditorParagraphStyle* style, uint32_t* height)
Description
Obtains the height for paragraph indentation in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| uint32_t* height | Pointer to the height for paragraph indentation, in vp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_SetWordBreak(OH_ArkUI_TextEditorParagraphStyle* style, ArkUI_WordBreak wordBreak)
Description
Sets the word breaking mode in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| ArkUI_WordBreak wordBreak | Word breaking mode. The value is an enumerated value of ArkUI_WordBreak. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetWordBreak(OH_ArkUI_TextEditorParagraphStyle* style, ArkUI_WordBreak* wordBreak)
Description
Obtains the word breaking mode in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| ArkUI_WordBreak* wordBreak | Pointer to the word breaking mode. The value is an enumerated value of ArkUI_WordBreak. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_SetLineBreakStrategy(OH_ArkUI_TextEditorParagraphStyle* style, OH_ArkUI_LineBreakStrategy lineBreakStrategy)
Description
Sets the line breaking strategy in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| OH_ArkUI_LineBreakStrategy lineBreakStrategy | Line breaking strategy. The value is an enumerated value of OH_ArkUI_LineBreakStrategy. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetLineBreakStrategy(OH_ArkUI_TextEditorParagraphStyle* style, OH_ArkUI_LineBreakStrategy* lineBreakStrategy)
Description
Obtains the line breaking strategy in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| OH_ArkUI_LineBreakStrategy* lineBreakStrategy | Pointer to the line breaking strategy. The value is an enumerated value of OH_ArkUI_LineBreakStrategy. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_SetParagraphSpacing(OH_ArkUI_TextEditorParagraphStyle* style, uint32_t paragraphSpacing)
Description
Sets the paragraph spacing in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| uint32_t paragraphSpacing | Paragraph spacing, in vp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetParagraphSpacing(OH_ArkUI_TextEditorParagraphStyle* style, uint32_t* paragraphSpacing)
Description
Obtains the paragraph spacing in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| uint32_t* paragraphSpacing | Pointer to the paragraph spacing, in vp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_SetTextVerticalAlign(OH_ArkUI_TextEditorParagraphStyle* style, ArkUI_TextVerticalAlignment verticalAlignment)
Description
Sets the text vertical alignment mode in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| ArkUI_TextVerticalAlignment verticalAlignment | Text vertical alignment mode. The value is an enumerated value of ArkUI_TextVerticalAlignment. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetTextVerticalAlign(OH_ArkUI_TextEditorParagraphStyle* style, ArkUI_TextVerticalAlignment* verticalAlignment)
Description
Obtains the text vertical alignment mode in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| ArkUI_TextVerticalAlignment* verticalAlignment | Pointer to the text vertical alignment mode. The value is an enumerated value of ArkUI_TextVerticalAlignment. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_SetTextDirection(OH_ArkUI_TextEditorParagraphStyle* style, ArkUI_TextDirection textDirection)
Description
Sets the text direction in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| ArkUI_TextDirection textDirection | Text direction. The value is an enumerated value of ArkUI_TextDirection. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorParagraphStyle_GetTextDirection(OH_ArkUI_TextEditorParagraphStyle* style, ArkUI_TextDirection* textDirection)
Description
Obtains the text direction in the paragraph style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the OH_ArkUI_TextEditorParagraphStyle object. |
| ArkUI_TextDirection* textDirection | Pointer to the text direction. The value is an enumerated value of ArkUI_TextDirection. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_SetTypingParagraphStyle(OH_ArkUI_TextEditorStyledStringController* controller, OH_ArkUI_TextEditorParagraphStyle* style)
Description
Sets the typing paragraph style using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| OH_ArkUI_TextEditorParagraphStyle* style | Pointer to the typing paragraph style. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetFontColor(OH_ArkUI_TextEditorTextStyle* style, uint32_t color)
Description
Sets the font color of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| uint32_t color | Font color, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetFontColor(OH_ArkUI_TextEditorTextStyle* style, uint32_t* color)
Description
Obtains the font color of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| uint32_t* color | Pointer to the font color, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetFontSize(OH_ArkUI_TextEditorTextStyle* style, float size)
Description
Sets the font size of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| float size | Font size, in fp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetFontSize(OH_ArkUI_TextEditorTextStyle* style, float* size)
Description
Obtains the font size of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| float* size | Pointer to the font size, in fp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetFontStyle(OH_ArkUI_TextEditorTextStyle* style, ArkUI_FontStyle fontStyle)
Description
Sets the font style of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| ArkUI_FontStyle fontStyle | Font style. The value is an enumerated value of ArkUI_FontStyle. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetFontStyle(OH_ArkUI_TextEditorTextStyle* style, ArkUI_FontStyle* fontStyle)
Description
Obtains the font style of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| ArkUI_FontStyle* fontStyle | Pointer to the font style. The value is an enumerated value of ArkUI_FontStyle. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetFontWeight(OH_ArkUI_TextEditorTextStyle* style, uint32_t fontWeight)
Description
Sets the font weight of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| uint32_t fontWeight | Font weight. The value is an enumerated value of ArkUI_FontWeight. The default value is ARKUI_FONT_WEIGHT_W400. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetFontWeight(OH_ArkUI_TextEditorTextStyle* style, uint32_t* fontWeight)
Description
Obtains the font weight of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| uint32_t* fontWeight | Pointer to the font weight. The value is an enumerated value of ArkUI_FontWeight. The default value is ARKUI_FONT_WEIGHT_W400. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetFontFamily(OH_ArkUI_TextEditorTextStyle* style, const char* fontFamily)
Description
Sets the font family of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| const char* fontFamily | Pointer to the font family, containing the font names to be set. Different font names are separated by commas (,). |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetFontFamily(OH_ArkUI_TextEditorTextStyle* style, char* buffer, int32_t bufferSize, int32_t* writeLength)
Description
Obtains the font family of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| char* buffer | Pointer to the buffer for storing the font family in the memory. You need to allocate the memory. |
| int32_t bufferSize | Maximum number of characters that can be written to the buffer. |
| int32_t* writeLength | Pointer to the number of characters that are actually written to the buffer. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetDecoration(OH_ArkUI_TextEditorTextStyle* style, OH_ArkUI_DecorationStyleOptions* options)
Description
Sets the text decoration options of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetDecoration(OH_ArkUI_TextEditorTextStyle* style, OH_ArkUI_DecorationStyleOptions* options)
Description
Obtains the text decoration options of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| OH_ArkUI_DecorationStyleOptions* options | Pointer to the OH_ArkUI_DecorationStyleOptions object. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetTextShadows(OH_ArkUI_TextEditorTextStyle* style, const OH_ArkUI_ShadowOptions** options, int32_t length)
Description
Sets the text shadow options of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| const OH_ArkUI_ShadowOptions** options | Double pointer to the text shadow options. |
| int32_t length | Length of the text shadow options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetTextShadows(OH_ArkUI_TextEditorTextStyle* style, OH_ArkUI_ShadowOptions** shadowOptions, uint32_t shadowOptionsSize, uint32_t* writeLength)
Description
Obtains the text shadow options of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| OH_ArkUI_ShadowOptions** shadowOptions | Double pointer to the text shadow options. |
| uint32_t shadowOptionsSize | Size of the shadow option buffer. |
| uint32_t* writeLength | Pointer to the number of actual text shadow options in the text style. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetLineHeight(OH_ArkUI_TextEditorTextStyle* style, int32_t lineHeight)
Description
Sets the line height of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| int32_t lineHeight | Line height. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetLineHeight(OH_ArkUI_TextEditorTextStyle* style, int32_t* lineHeight)
Description
Obtains the line height of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| int32_t* lineHeight | Pointer to the line height. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetLetterSpacing(OH_ArkUI_TextEditorTextStyle* style, int32_t letterSpacing)
Description
Sets the letter spacing of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| int32_t letterSpacing | Letter spacing. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetLetterSpacing(OH_ArkUI_TextEditorTextStyle* style, int32_t* letterSpacing)
Description
Obtains the letter spacing of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| int32_t* letterSpacing | Pointer to the letter spacing. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetFontFeature(OH_ArkUI_TextEditorTextStyle* style, const char* fontFeature)
Description
Sets the font feature of the text style, such as monospaced digits.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| const char* fontFeature | Pointer to the font features, containing font features to be set. Multiple features are separated by commas (,). |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetFontFeature(OH_ArkUI_TextEditorTextStyle* style, char* buffer, int32_t bufferSize, int32_t* writeLength)
Description
Obtains the font feature of the text style, such as monospaced digits.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| char* buffer | Pointer to the buffer for storing the font features in the memory. You need to allocate the memory. |
| int32_t bufferSize | Maximum number of characters that can be written to the buffer. |
| int32_t* writeLength | Pointer to the number of characters that are actually written to the buffer. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetHalfLeading(OH_ArkUI_TextEditorTextStyle* style, bool halfLeading)
Description
Sets whether to evenly distribute the line spacing to the top and bottom of each line in the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| bool halfLeading | Whether to enable half leading. true means to enable, and false means the opposite. The default value is false. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetHalfLeading(OH_ArkUI_TextEditorTextStyle* style, bool* halfLeading)
Description
Obtains whether the line spacing is evenly distributed to the top and bottom of each line in the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| bool* halfLeading | Pointer to the halfLeading parameter indicating whether half leading is enabled. true means half leading is enabled, and false means the opposite. The default value is false. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetTextBackgroundColor(OH_ArkUI_TextEditorTextStyle* style, uint32_t color)
Description
Sets the text background color of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| uint32_t color | Text background color, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetTextBackgroundColor(OH_ArkUI_TextEditorTextStyle* style, uint32_t* color)
Description
Obtains the text background color of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| uint32_t* color | Pointer to the text background color, in 0xARGB format. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_SetTextBackgroundRadius(OH_ArkUI_TextEditorTextStyle* style, float topLeft, float topRight, float bottomLeft, float bottomRight)
Description
Sets the radius of the rounded corner of the text background of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| float topLeft | Radius of the rounded corner in the upper left corner of the text background. The unit is vp. |
| float topRight | Radius of the rounded corner in the upper right corner of the text background. The unit is vp. |
| float bottomLeft | Radius of the rounded corner in the lower left corner of the text background. The unit is vp. |
| float bottomRight | Radius of the rounded corner in the lower right corner of the text background. The unit is vp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorTextStyle_GetTextBackgroundRadius(OH_ArkUI_TextEditorTextStyle* style, float* topLeft, float* topRight, float* bottomLeft, float* bottomRight)
Description
Obtains the radius of the rounded corner of the text background of the text style.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the text style of the TextEditor component. |
| float* topLeft | Pointer to the radius of the rounded corner in the upper left corner of the text background. The unit is vp. |
| float* topRight | Pointer to the radius of the rounded corner in the upper right corner of the text background. The unit is vp. |
| float* bottomLeft | Pointer to the radius of the rounded corner in the lower left corner of the text background. The unit is vp. |
| float* bottomRight | Pointer to the radius of the rounded corner in the lower right corner of the text background. The unit is vp. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_SetTypingStyle(OH_ArkUI_TextEditorStyledStringController* controller, OH_ArkUI_TextEditorTextStyle* style)
Description
Sets the typing style using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the typing style. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_GetTypingStyle(OH_ArkUI_TextEditorStyledStringController* controller, OH_ArkUI_TextEditorTextStyle* style)
Description
Obtains the typing style using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| OH_ArkUI_TextEditorTextStyle* style | Pointer to the typing style. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_GetSelection(const OH_ArkUI_TextEditorStyledStringController* controller, uint32_t* start, uint32_t* end)
Description
Obtains the selected area using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| uint32_t* start | Pointer to the start position of the selected area. |
| uint32_t* end | Pointer to the end position of the selected area. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_SetStyledString(const OH_ArkUI_TextEditorStyledStringController* controller, const ArkUI_StyledString_Descriptor* descriptor)
Description
Sets the styled string displayed using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| const ArkUI_StyledString_Descriptor* descriptor | Pointer to the ArkUI_StyledString_Descriptor object. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_GetStyledString(const OH_ArkUI_TextEditorStyledStringController* controller, ArkUI_StyledString_Descriptor* descriptor)
Description
Obtains the styled string displayed using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| ArkUI_StyledString_Descriptor* descriptor | Pointer to the ArkUI_StyledString_Descriptor object. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_SetStyledPlaceholder(const OH_ArkUI_TextEditorStyledStringController* controller, const ArkUI_StyledString_Descriptor* descriptor)
Description
Sets the placeholder text in the styled string style using the styled string controller.
Since: 24
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| const ArkUI_StyledString_Descriptor* descriptor | Pointer to the ArkUI_StyledString_Descriptor object. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextEditorStyledStringController_ScrollToVisible(const OH_ArkUI_TextEditorStyledStringController* controller, int32_t start, int32_t end)
Description
Scrolls the content within the range from the specified start index to the end index to the visible area using the styled string controller.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_TextEditorStyledStringController* controller | Pointer to the OH_ArkUI_TextEditorStyledStringController object. |
| int32_t start | Start index. The start index must be less than or equal to the end index. Otherwise, the API call is invalid. The value range is [0, Total length of the content in the TextEditor component]. If the start index is less than 0, 0 is used. If the start index is greater than the total length, the total length is used. |
| int32_t end | End index. The end index must be greater than or equal to the start index. Otherwise, the API call is invalid. The value range is [0, Total length of the content in the TextEditor component]. If the end index is less than 0, 0 is used. If the end index is greater than the total length, the total length is used. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_PickerIndicatorStyle_ConfigureBackground(ArkUI_PickerIndicatorStyle* style, ArkUI_PickerIndicatorBackground* background)
Description
Sets the background style. This API takes effect only when the type of the selected item indicator is ARKUI_PICKER_INDICATOR_BACKGROUND.
Since: 23
Parameters
| Name | Description |
|---|---|
| ArkUI_PickerIndicatorStyle* style | Pointer to the ArkUI_PickerIndicatorStyle instance. |
| ArkUI_PickerIndicatorBackground* background | Pointer to the background. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Return result. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_PickerIndicatorStyle_ConfigureDivider(ArkUI_PickerIndicatorStyle* style, ArkUI_PickerIndicatorDivider* divider)
Description
Sets the divider style. This API takes effect only when the type of the selected item indicator is ARKUI_PICKER_INDICATOR_DIVIDER.
Since: 23
Parameters
| Name | Description |
|---|---|
| ArkUI_PickerIndicatorStyle* style | Pointer to the ArkUI_PickerIndicatorStyle instance. |
| ArkUI_PickerIndicatorDivider* divider | Pointer to the divider style. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Return result. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_TextController_SetStyledString(OH_ArkUI_TextController* controller, ArkUI_StyledString_Descriptor* descriptor)
Description
Sets a styled string for the text component.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_TextController* controller | Pointer to the OH_ArkUI_TextController object. |
| ArkUI_StyledString_Descriptor* descriptor | Pointer to the ArkUI_StyledString_Descriptor object. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Return result. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
OH_ArkUI_LinearGradientOptions* OH_ArkUI_LinearGradientOptions_Create()
Description
Creates an object for linear gradient effect options.
Since: 26.0.0
Returns
| Type | Description |
|---|---|
| OH_ArkUI_LinearGradientOptions* | Pointer to the OH_ArkUI_LinearGradientOptions* object. |
void OH_ArkUI_LinearGradientOptions_Destroy(OH_ArkUI_LinearGradientOptions* options)
Description
Destroys the object for linear gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_LinearGradientOptions* options | Pointer to the OH_ArkUI_LinearGradientOptions object. |
ArkUI_ErrorCode OH_ArkUI_LinearGradientOptions_SetAngle(OH_ArkUI_LinearGradientOptions* options, float angle)
Description
Sets the angle in linear gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_LinearGradientOptions* options | Pointer to the OH_ArkUI_LinearGradientOptions object. |
| float angle | Angle in linear gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_LinearGradientOptions_GetAngle(const OH_ArkUI_LinearGradientOptions* options, float* angle)
Description
Obtains the angle in linear gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_LinearGradientOptions* options | Pointer to the OH_ArkUI_LinearGradientOptions object. |
| float* angle | Pointer to the angle in linear gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_LinearGradientOptions_SetDirection(OH_ArkUI_LinearGradientOptions* options, ArkUI_LinearGradientDirection direction)
Description
Sets the direction in linear gradient effect options.
When OH_ArkUI_LinearGradientOptions_SetAngle is called to set the angle, the direction setting does not take effect.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_LinearGradientOptions* options | Pointer to the OH_ArkUI_LinearGradientOptions object. |
| ArkUI_LinearGradientDirection direction | Direction in linear gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_LinearGradientOptions_GetDirection(const OH_ArkUI_LinearGradientOptions* options, ArkUI_LinearGradientDirection* direction)
Description
Obtains the direction in linear gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_LinearGradientOptions* options | Pointer to the OH_ArkUI_LinearGradientOptions object. |
| ArkUI_LinearGradientDirection* direction | Pointer to the direction in linear gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_LinearGradientOptions_SetRepeating(OH_ArkUI_LinearGradientOptions* options, bool repeating)
Description
Sets whether the color is repeated in linear gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_LinearGradientOptions* options | Pointer to the OH_ArkUI_LinearGradientOptions object. |
| bool repeating | Whether the color is repeated in linear gradient options. The value false indicates that the color is not repeated, and the value true indicates that the color is repeated. The default value is false. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_LinearGradientOptions_GetRepeating(const OH_ArkUI_LinearGradientOptions* options, bool* repeating)
Description
Obtains whether the color is repeated in linear gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_LinearGradientOptions* options | Pointer to the OH_ArkUI_LinearGradientOptions object. |
| bool* repeating | Pointer to the repeating parameter indicating whether the color is repeated in linear gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_LinearGradientOptions_SetColorStop(OH_ArkUI_LinearGradientOptions* options, const uint32_t* colors, const float* stops, int32_t colorsAndStopsSize)
Description
Sets the color stop in linear gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_LinearGradientOptions* options | Pointer to the OH_ArkUI_LinearGradientOptions object. |
| const uint32_t* colors | Pointer to the color array. |
| const float* stops | Pointer to the color stop array. |
| int32_t colorsAndStopsSize | Number of elements in the color and color stop arrays. The number of elements in the color array must be the same as that in the color stop array. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_LinearGradientOptions_GetColorStop(const OH_ArkUI_LinearGradientOptions* options, uint32_t* colors, float* stops, int32_t colorsAndStopsSize, int32_t* writeLength)
Description
Obtains the color stop in linear gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_LinearGradientOptions* options | Pointer to the OH_ArkUI_LinearGradientOptions object. |
| uint32_t* colors | Pointer to the color array. |
| float* stops | Pointer to the color stop array. |
| int32_t colorsAndStopsSize | Number of elements in the color and color stop arrays. The number of elements in the color array must be the same as that in the color stop array. |
| int32_t* writeLength | Pointer to the number of colors and color stops that are actually written. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
OH_ArkUI_RadialGradientOptions* OH_ArkUI_RadialGradientOptions_Create()
Description
Creates an object for radial gradient effect options.
Since: 26.0.0
Returns
| Type | Description |
|---|---|
| OH_ArkUI_RadialGradientOptions* | Pointer to the OH_ArkUI_RadialGradientOptions object. |
void OH_ArkUI_RadialGradientOptions_Destroy(OH_ArkUI_RadialGradientOptions* options)
Description
Destroys the object for radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_SetCenterX(OH_ArkUI_RadialGradientOptions* options, float centerX)
Description
Sets the X coordinate of the center point in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| float centerX | X coordinate of the center point in radial gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_GetCenterX(const OH_ArkUI_RadialGradientOptions* options, float* centerX)
Description
Obtains the X coordinate of the center point in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| float* centerX | Pointer to the X coordinate of the center point in radial gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_SetCenterY(OH_ArkUI_RadialGradientOptions* options, float centerY)
Description
Sets the Y coordinate of the center point in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| float centerY | Y coordinate of the center point in radial gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_GetCenterY(const OH_ArkUI_RadialGradientOptions* options, float* centerY)
Description
Obtains the Y coordinate of the center point in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| float* centerY | Pointer to the Y coordinate of the center point in radial gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_SetRadius(OH_ArkUI_RadialGradientOptions* options, float radius)
Description
Sets the radius in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| float radius | Radius in radial gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_GetRadius(const OH_ArkUI_RadialGradientOptions* options, float* radius)
Description
Obtains the radius in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| float* radius | Pointer to the radius in radial gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_SetRepeating(OH_ArkUI_RadialGradientOptions* options, bool repeating)
Description
Sets whether the color is repeated in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| bool repeating | Whether the color is repeated in radial gradient options. The value false indicates that the color is not repeated, and the value true indicates that the color is repeated. The default value is false. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_GetRepeating(const OH_ArkUI_RadialGradientOptions* options, bool* repeating)
Description
Obtains whether the color is repeated in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| bool* repeating | Pointer to the repeating parameter indicating whether the color is repeated in radial gradient effect options. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_SetColorStop(OH_ArkUI_RadialGradientOptions* options, const uint32_t* colors, const float* stops, int32_t colorsAndStopsSize)
Description
Sets the color stop in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| const uint32_t* colors | Pointer to the color array. |
| const float* stops | Pointer to the color stop array. |
| int32_t colorsAndStopsSize | Number of elements in the color and color stop arrays. The number of elements in the color array must be the same as that in the color stop array. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |
ArkUI_ErrorCode OH_ArkUI_RadialGradientOptions_GetColorStop(const OH_ArkUI_RadialGradientOptions* options, uint32_t* colors, float* stops, int32_t colorsAndStopsSize, int32_t* writeLength)
Description
Obtains the color stop in radial gradient effect options.
Since: 26.0.0
Parameters
| Name | Description |
|---|---|
| const OH_ArkUI_RadialGradientOptions* options | Pointer to the OH_ArkUI_RadialGradientOptions object. |
| uint32_t* colors | Pointer to the buffer of the color array. |
| float* stops | Pointer to the color stop array. |
| int32_t colorsAndStopsSize | Number of elements in the color and color stop arrays. The number of elements in the color array must be the same as that in the color stop array. |
| int32_t* writeLength | Pointer to the number of color stops that are actually written. |
Returns
| Type | Description |
|---|---|
| ArkUI_ErrorCode | Result code. Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful. Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs. |