openharmony 鸿蒙 capi-styled-string-h

2026-08-25 浏览 (1)

styled_string.h

Overview

Defines the text style and layout manager for the component whose type is set to ARKUI_NODE_TEXT on the native side.

File to include: <arkui/styled_string.h>

Library: libace_ndk.z.so

System capability: SystemCapability.ArkUI.ArkUI.Full

Since: 12

Related module: ArkUI_NativeModule

Sample: StyledStringSample

Summary

Structs

Nametypedef KeywordDescription
ArkUI_StyledStringArkUI_StyledStringDefines a styled string object supported by the text component.
OH_ArkUI_SpanStyleOH_ArkUI_SpanStyleDefines a styled string style object.
OH_ArkUI_SpanStyle_Create can be used to create a styled string style object.
OH_ArkUI_SpanStyle_Destroy can be used to destroy the styled string style object.
After the object is created, OH_ArkUI_SpanStyle_SetStart and OH_ArkUI_SpanStyle_SetLength can be used to set the usage scope of the style.
After the object is created, the OH_ArkUI_SpanStyle_SetXXXStyle series APIs can be used to set the specific styles that take effect. For example, you can use OH_ArkUI_SpanStyle_SetTextStyle to set the font style.
OH_ArkUI_ImageAttachmentOH_ArkUI_ImageAttachmentDefines an image style object.
OH_ArkUI_ImageAttachment_Create can be used to create an image style object.
OH_ArkUI_ImageAttachment_Destroy can be used to destroy the image style object.
After the object is created, the OH_ArkUI_ImageAttachment_SetXXX series APIs can be used to set the styles that take effect. For example, you can use OH_ArkUI_ImageAttachment_SetPixelMap to set an image source.
OH_ArkUI_CustomSpanOH_ArkUI_CustomSpanDefines a custom span.
OH_ArkUI_CustomSpan_Create can be used to create a custom span object.
OH_ArkUI_CustomSpan_Destroy can be used to destroy the custom span object.
After the object is created, OH_ArkUI_CustomSpan_RegisterOnMeasureCallback and OH_ArkUI_CustomSpan_RegisterOnDrawCallback can be used to register drawing callback functions.
OH_ArkUI_TextStyleOH_ArkUI_TextStyleDefines a text font style.
OH_ArkUI_TextStyle_Create can be used to create a text font style object.
OH_ArkUI_TextStyle_Destroy can be used to destroy the text font style object.
After the object is created, the OH_ArkUI_TextStyle_SetXXX series APIs can be used to set the specific styles that take effect. For example, you can use OH_ArkUI_TextStyle_SetFontColor to set a text color.
OH_ArkUI_ParagraphStyleOH_ArkUI_ParagraphStyleDefines a paragraph style.
OH_ArkUI_ParagraphStyle_Create can be used to create a paragraph style object.
OH_ArkUI_ParagraphStyle_Destroy can be used to destroy the paragraph style object.
After the object is created, the OH_ArkUI_ParagraphStyle_SetXXX series APIs can be used to set the specific styles that take effect. For example, you can use OH_ArkUI_ParagraphStyle_SetTextAlign to set a text alignment method.
OH_ArkUI_GestureStyleOH_ArkUI_GestureStyleDefines a gesture style.
OH_ArkUI_GestureStyle_Create can be used to create a gesture style object.
OH_ArkUI_GestureStyle_Destroy can be used to destroy the gesture style object.
After the object is created, the OH_ArkUI_GestureStyle_RegisterOnXXXCallback series APIs can be used to register specific event callbacks. For example, you can use OH_ArkUI_GestureStyle_RegisterOnClickCallback to register a click event callback.
OH_ArkUI_TextShadowStyleOH_ArkUI_TextShadowStyleDefines a text shadow style.
OH_ArkUI_TextShadowStyle_Create can be used to create a text shadow style object.
OH_ArkUI_TextShadowStyle_Destroy can be used to destroy the text shadow style object.
After the object is created, OH_ArkUI_TextShadowStyle_SetTextShadow can be used to set a style.
OH_ArkUI_DecorationStyleOH_ArkUI_DecorationStyleDefines a text decoration style.
OH_ArkUI_DecorationStyle_Create can be used to create a text decoration style object.
OH_ArkUI_DecorationStyle_Destroy can be used to destroy the text decoration style object.
After the object is created, the OH_ArkUI_DecorationStyle_SetXXX series APIs can be used to set the specific styles that take effect. For example, you can use OH_ArkUI_DecorationStyle_SetTextDecorationType to set the decoration type.
OH_ArkUI_BaselineOffsetStyleOH_ArkUI_BaselineOffsetStyleDefines a baseline offset style.
OH_ArkUI_BaselineOffsetStyle_Create can be used to create a baseline offset style object.
OH_ArkUI_BaselineOffsetStyle_Destroy can be used to destroy the baseline offset style object.
After the object is created, OH_ArkUI_BaselineOffsetStyle_SetBaselineOffset can be used to set a baseline offset.
OH_ArkUI_LetterSpacingStyleOH_ArkUI_LetterSpacingStyleDefines a letter spacing style.
OH_ArkUI_LetterSpacingStyle_Create can be used to create a letter spacing style object.
OH_ArkUI_LetterSpacingStyle_Destroy can be used to destroy the letter spacing style object.
After the object is created, OH_ArkUI_LetterSpacingStyle_SetLetterSpacing can be used to set letter spacing.
OH_ArkUI_LineHeightStyleOH_ArkUI_LineHeightStyleDefines a line height style.
OH_ArkUI_LineHeightStyle_Create can be used to create a line height style object.
OH_ArkUI_LineHeightStyle_Destroy can be used to destroy the line height style object.
After the object is created, OH_ArkUI_LineHeightStyle_SetLineHeight can be used to set fixed line height.
Since API version 26.0.0, OH_ArkUI_LineHeightStyle_SetLineHeightMultiple can be used to set the line height multiplier after the object is created.
OH_ArkUI_LineSpacingStyleOH_ArkUI_LineSpacingStyleDefines a line spacing style.
OH_ArkUI_LineSpacingStyle_Create can be used to create a line spacing style object.
OH_ArkUI_LineSpacingStyle_Destroy can be used to destroy the line spacing style object.
After the object is created, OH_ArkUI_LineSpacingStyle_SetLineSpacing can be used to set a line spacing value.
After the object is created, OH_ArkUI_LineSpacingStyle_SetOnlyBetweenLines can be used to set whether the line spacing takes effect only between lines.
OH_ArkUI_UrlStyleOH_ArkUI_UrlStyleDefines a URL style.
OH_ArkUI_UrlStyle_Create can be used to create a URL style object.
OH_ArkUI_UrlStyle_Destroy can be used to destroy the URL style object.
After the object is created, OH_ArkUI_UrlStyle_SetUrl can be used to set a URL.
OH_ArkUI_BackgroundColorStyleOH_ArkUI_BackgroundColorStyleDefines a background color style.
OH_ArkUI_BackgroundColorStyle_Create can be used to create a background color style object.
OH_ArkUI_BackgroundColorStyle_Destroy can be used to destroy the background color style object.
After the object is created, OH_ArkUI_BackgroundColorStyle_SetColor and OH_ArkUI_BackgroundColorStyle_SetRadius can be used to set the background color and rounded corners.
OH_ArkUI_UserDataSpanOH_ArkUI_UserDataSpanDefines a user data span style.
OH_ArkUI_UserDataSpan_Create can be used to create a user data span style object.
OH_ArkUI_UserDataSpan_Destroy can be used to destroy the user data span style object.
After the object is created, OH_ArkUI_UserDataSpan_SetUserData can be used to bind user data.
OH_ArkUI_LeadingMarginSpanDrawInfoOH_ArkUI_LeadingMarginSpanDrawInfoDefines the custom drawing information for paragraph indentation.
OH_ArkUI_LeadingMarginSpanDrawInfo_Create can be used to create a custom drawing information object for paragraph indentation.
OH_ArkUI_LeadingMarginSpanDrawInfo_Destroy can be used to destroy the custom drawing information object for paragraph indentation.
This object is used to provide the drawing context information of the current line in the callback function registered by OH_ArkUI_ParagraphStyle_RegisterOnDrawLeadingMarginCallback.
ArkUI_TextLayoutManagerArkUI_TextLayoutManagerDefines a text layout manager.

Enumeration

Nametypedef KeywordDescription
OH_ArkUI_StyledStringKeyOH_ArkUI_StyledStringKeyEnumerates the attribute types of a styled string.
OH_ArkUI_SuperscriptStyleOH_ArkUI_SuperscriptStyleEnumerates the text superscript and subscript styles.

Functions

NameDescription
ArkUI_StyledString* OH_ArkUI_StyledString_Create(OH_Drawing_TypographyStyle* style, OH_Drawing_FontCollection* collection)Creates a pointer to the ArkUI_StyledString object.
void OH_ArkUI_StyledString_Destroy(ArkUI_StyledString* handle)Destroys an ArkUI_StyledString object and reclaims the memory occupied by the object.
void OH_ArkUI_StyledString_PushTextStyle(ArkUI_StyledString* handle, OH_Drawing_TextStyle* style)Pushes a text style to the top of the style stack of a styled string.
void OH_ArkUI_StyledString_AddText(ArkUI_StyledString* handle, const char* content)Adds text for a styled string.
void OH_ArkUI_StyledString_PopTextStyle(ArkUI_StyledString* handle)Pops the style at the top of the style stack of a styled string.
OH_Drawing_Typography* OH_ArkUI_StyledString_CreateTypography(ArkUI_StyledString* handle)Creates a pointer to the OH_Drawing_Typography object based on an ArkUI_StyledString object for text measurement and typesetting in advance.
void OH_ArkUI_StyledString_AddPlaceholder(ArkUI_StyledString* handle, OH_Drawing_PlaceholderSpan* placeholder)Adds a placeholder.
ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_Create(void)Creates an ArkUI_StyledString_Descriptor object.
void OH_ArkUI_StyledString_Descriptor_Destroy(ArkUI_StyledString_Descriptor* descriptor)Releases the memory occupied by the ArkUI_StyledString_Descriptor object.
int32_t OH_ArkUI_UnmarshallStyledStringDescriptor(uint8_t* buffer, size_t bufferSize, ArkUI_StyledString_Descriptor* descriptor)Unmarshals a byte array containing styled string information into a styled string.
int32_t OH_ArkUI_MarshallStyledStringDescriptor(uint8_t* buffer, size_t bufferSize, ArkUI_StyledString_Descriptor* descriptor, size_t* resultSize)Marshals the styled string information into a byte array.
const char* OH_ArkUI_ConvertToHtml(ArkUI_StyledString_Descriptor* descriptor)Converts styled string information into HTML.
ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_CreateWithString(const char* value, const OH_ArkUI_SpanStyle** styles, int32_t length)Creates an ArkUI_StyledString_Descriptor object of the plain text content type.
ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_CreateWithImageAttachment(const OH_ArkUI_ImageAttachment* value)Creates an ArkUI_StyledString_Descriptor object of the image content type.
ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_CreateWithCustomSpan(const OH_ArkUI_CustomSpan* value)Creates an ArkUI_StyledString_Descriptor object of the custom span content type.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_GetLength(const ArkUI_StyledString_Descriptor* descriptor, int32_t* length)Obtains the length of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_GetString(const ArkUI_StyledString_Descriptor* descriptor, char* buffer, int32_t bufferSize, int32_t* writeLength)Obtains the text content of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_IsEqual(const ArkUI_StyledString_Descriptor* firstDescriptor, const ArkUI_StyledString_Descriptor* secondDescriptor, bool* isEqual)Checks whether a styled string is the same as another styled string. The two styled strings are the same if they have the same text and style.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_SubStyledString(const ArkUI_StyledString_Descriptor* descriptor, ArkUI_StyledString_Descriptor* subDescriptor, uint32_t start, uint32_t length)Obtains a sub-styled string of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_GetStyles(const ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length, OH_ArkUI_StyledStringKey styledKey, OH_ArkUI_SpanStyle** styles, uint32_t stylesSize, uint32_t* writeLength)Obtains the style set within a specified range of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_FromHtml(ArkUI_StyledString_Descriptor* descriptor, const char* html)Converts an HTML string to a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_ReplaceString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length, const char* string)Replaces the text within a specified range of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_InsertString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, const char* string)Inserts text at a specified position of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_RemoveString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length)Removes the text within a specified range of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_ReplaceStyle(ArkUI_StyledString_Descriptor* descriptor, const OH_ArkUI_SpanStyle* spanStyle)Replaces the style within a specified range of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_SetStyle(ArkUI_StyledString_Descriptor* descriptor, const OH_ArkUI_SpanStyle* spanStyle)Sets a new style for a specified range of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_RemoveStyle(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length, OH_ArkUI_StyledStringKey styledKey)Removes the specified style for a specified range of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_ClearStyles(ArkUI_StyledString_Descriptor* descriptor)Clears all styles of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_ReplaceStyledString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length, const ArkUI_StyledString_Descriptor* other)Replaces the styled string within a specified range.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_InsertStyledString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, const ArkUI_StyledString_Descriptor* other)Inserts a new styled string at a specified position of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_AppendStyledString(ArkUI_StyledString_Descriptor* descriptor, const ArkUI_StyledString_Descriptor* other)Appends a new styled string to the end of a styled string.
ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_InvalidateCustomSpan(const ArkUI_StyledString_Descriptor* descriptor)Actively refreshes the custom span in a styled string.
OH_ArkUI_TextStyle* OH_ArkUI_TextStyle_Create()Creates an OH_ArkUI_TextStyle object.
void OH_ArkUI_TextStyle_Destroy(OH_ArkUI_TextStyle* textStyle)Releases the memory occupied by the OH_ArkUI_TextStyle object.
ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontColor(OH_ArkUI_TextStyle* textStyle, uint32_t fontColor)Sets text color for a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontColor(const OH_ArkUI_TextStyle* textStyle, uint32_t* fontColor)Obtains the text color of a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontFamily(OH_ArkUI_TextStyle* textStyle, const char* fontFamily)Sets a font family for a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontFamily(const OH_ArkUI_TextStyle* textStyle, char* buffer, int32_t bufferSize, int32_t* writeLength)Obtains the font family of a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontSize(OH_ArkUI_TextStyle* textStyle, float fontSize)Sets font size for a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontSize(const OH_ArkUI_TextStyle* textStyle, float* fontSize)Obtains the font size of a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontWeight(OH_ArkUI_TextStyle* textStyle, uint32_t fontWeight)Sets font weight for a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontWeight(const OH_ArkUI_TextStyle* textStyle, uint32_t* fontWeight)Obtains the font weight of a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontStyle(OH_ArkUI_TextStyle* textStyle, ArkUI_FontStyle fontStyle)Sets font style for a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontStyle(const OH_ArkUI_TextStyle* textStyle, ArkUI_FontStyle* fontStyle)Obtains the font style of a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_SetStrokeWidth(OH_ArkUI_TextStyle* textStyle, float strokeWidth)Sets stroke width for a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_GetStrokeWidth(const OH_ArkUI_TextStyle* textStyle, float* strokeWidth)Obtains the stroke width of a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_SetStrokeColor(OH_ArkUI_TextStyle* textStyle, uint32_t strokeColor)Sets a stroke color for a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_GetStrokeColor(const OH_ArkUI_TextStyle* textStyle, uint32_t* strokeColor)Obtains the stroke color of a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_SetSuperscript(OH_ArkUI_TextStyle* textStyle, OH_ArkUI_SuperscriptStyle superscript)Sets superscript and subscript styles for a text font style.
ArkUI_ErrorCode OH_ArkUI_TextStyle_GetSuperscript(const OH_ArkUI_TextStyle* textStyle, OH_ArkUI_SuperscriptStyle* superscript)Obtains the superscript and subscript styles of a text font style.
OH_ArkUI_SpanStyle* OH_ArkUI_SpanStyle_Create()Creates an OH_ArkUI_SpanStyle object.
void OH_ArkUI_SpanStyle_Destroy(OH_ArkUI_SpanStyle* spanStyle)Releases the memory occupied by the OH_ArkUI_SpanStyle object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetStyledKey(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_StyledStringKey* styledKey)Obtains the style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetStart(OH_ArkUI_SpanStyle* spanStyle, int32_t start)Sets the start position for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetStart(const OH_ArkUI_SpanStyle* spanStyle, int32_t* start)Obtains the start position of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetLength(OH_ArkUI_SpanStyle* spanStyle, int32_t length)Sets the length for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetLength(const OH_ArkUI_SpanStyle* spanStyle, int32_t* length)Obtains the length of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetTextStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_TextStyle* textStyle)Sets the text font style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetTextStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_TextStyle* textStyle)Obtains the text font style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetParagraphStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_ParagraphStyle* paragraphStyle)Sets the paragraph style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetParagraphStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_ParagraphStyle* paragraphStyle)Obtains the paragraph style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetGestureStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_GestureStyle* gestureStyle)Sets the gesture style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetGestureStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_GestureStyle* gestureStyle)Obtains the gesture style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetTextShadowStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_TextShadowStyle* textShadowStyle)Sets the text shadow style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetTextShadowStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_TextShadowStyle* textShadowStyle)Obtains the text shadow style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetDecorationStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_DecorationStyle* decorationStyle)Sets the text decorative line style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetDecorationStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_DecorationStyle* decorationStyle)Obtains the text decorative line style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetBaselineOffsetStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle)Sets the baseline offset style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetBaselineOffsetStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle)Obtains the baseline offset style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetLetterSpacingStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_LetterSpacingStyle* letterSpacingStyle)Sets the letter spacing style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetLetterSpacingStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_LetterSpacingStyle* letterSpacingStyle)Obtains the letter spacing style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetLineHeightStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_LineHeightStyle* lineHeightStyle)Sets the line height style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetLineHeightStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_LineHeightStyle* lineHeightStyle)Obtains the line height style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetUrlStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_UrlStyle* urlStyle)Sets the URL style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetUrlStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_UrlStyle* urlStyle)Obtains the URL style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetBackgroundColorStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_BackgroundColorStyle* backgroundColorStyle)Sets the background color style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetBackgroundColorStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_BackgroundColorStyle* backgroundColorStyle)Obtains the background color style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetUserDataSpan(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_UserDataSpan* userDataSpan)Sets the user data span style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetUserDataSpan(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_UserDataSpan* userDataSpan)Obtains the user data span style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetCustomSpan(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_CustomSpan* customSpan)Sets the custom span style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetCustomSpan(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_CustomSpan* customSpan)Obtains the custom span style of the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetImageAttachment(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_ImageAttachment* imageAttachment)Sets the image style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetImageAttachment(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_ImageAttachment* imageAttachment)Obtains the image style of the styled string style object.
OH_ArkUI_LeadingMarginSpanDrawInfo* OH_ArkUI_LeadingMarginSpanDrawInfo_Create()Creates an OH_ArkUI_LeadingMarginSpanDrawInfo object.
void OH_ArkUI_LeadingMarginSpanDrawInfo_Destroy(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo)Releases the memory occupied by the OH_ArkUI_LeadingMarginSpanDrawInfo object.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetX(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float x)Sets the horizontal offset of the current line relative to the component in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetX(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float* x)Obtains the horizontal offset of the current line relative to the component in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetTop(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float top)Sets the distance between the top of a line and the top edge of the component in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetTop(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float* top)Obtains the distance between the top of a line and the top edge of the component in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetBottom(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float bottom)Sets the distance between the bottom of a line and the top edge of the component in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetBottom(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float* bottom)Obtains the distance between the bottom of a line and the top edge of the component in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetBaseline(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float baseline)Sets the distance between the baseline of the current line and the top edge of the component in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetBaseline(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float* baseline)Obtains the distance between the baseline of the current line and the top edge of the component in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetTextDirection(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, ArkUI_TextDirection direction)Sets the text direction in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetTextDirection(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, ArkUI_TextDirection* direction)Obtains the text direction in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetStart(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, uint32_t start)Sets the start index of the current line in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetStart(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, uint32_t* start)Obtains the start index of the current line in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetEnd(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, uint32_t end)Sets the end index of the current line in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetEnd(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, uint32_t* end)Obtains the end index of the current line in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetFirst(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, bool first)Sets whether the current line is the first line of the paragraph in the custom drawing information object for paragraph indentation.
ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetFirst(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, bool* first)Obtains whether the current line is the first line of the paragraph in the custom drawing information object for paragraph indentation.
OH_ArkUI_ParagraphStyle* OH_ArkUI_ParagraphStyle_Create()Creates an OH_ArkUI_ParagraphStyle object.
void OH_ArkUI_ParagraphStyle_Destroy(OH_ArkUI_ParagraphStyle* paragraphStyle)Releases the memory occupied by the OH_ArkUI_ParagraphStyle object.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetTextAlign(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextAlignment align)Sets the horizontal text alignment method in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetTextAlign(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextAlignment* align)Obtains the horizontal text alignment method in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetTextIndent(OH_ArkUI_ParagraphStyle* paragraphStyle, float textIndent)Sets the first-line text indentation in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetTextIndent(const OH_ArkUI_ParagraphStyle* paragraphStyle, float* textIndent)Obtains the first-line text indentation in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetMaxLines(OH_ArkUI_ParagraphStyle* paragraphStyle, int32_t maxLines)Sets the maximum number of lines in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetMaxLines(const OH_ArkUI_ParagraphStyle* paragraphStyle, int32_t* maxLines)Obtains the maximum number of lines in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetOverflow(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextOverflow overflow)Sets the display mode when the paragraph is too long in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetOverflow(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextOverflow* overflow)Obtains the display mode when the paragraph is too long in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetWordBreak(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_WordBreak wordBreak)Sets the word breaking rule in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetWordBreak(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_WordBreak* wordBreak)Obtains the word breaking rule in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetLeadingMarginPixelMap(OH_ArkUI_ParagraphStyle* paragraphStyle, struct OH_PixelmapNative* pixelmap)Sets the PixelMap for paragraph indentation in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetLeadingMarginPixelMap(const OH_ArkUI_ParagraphStyle* paragraphStyle, struct OH_PixelmapNative** pixelmap)Obtains the PixelMap for paragraph indentation in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetLeadingMarginWidth(OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t width)Sets the width for paragraph indentation in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetLeadingMarginWidth(const OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t* width)Obtains the width for paragraph indentation in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetLeadingMarginHeight(OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t height)Sets the height for paragraph indentation in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetLeadingMarginHeight(const OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t* height)Obtains the height for paragraph indentation in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetParagraphSpacing(OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t paragraphSpacing)Sets the paragraph spacing in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetParagraphSpacing(const OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t* paragraphSpacing)Obtains the paragraph spacing in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetTextVerticalAlign(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextVerticalAlignment verticalAlignment)Sets the vertical text alignment method in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetTextVerticalAlign(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextVerticalAlignment* verticalAlignment)Obtains the vertical text alignment method in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_RegisterOnDrawLeadingMarginCallback(OH_ArkUI_ParagraphStyle* paragraphStyle, void(*onDraw)(ArkUI_DrawContext* context, OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo))Sets the callback function triggered when the paragraph indentation is drawn in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_RegisterOnGetLeadingMarginCallback(OH_ArkUI_ParagraphStyle* paragraphStyle, float(*leadingMargin)())Sets the callback function triggered when the paragraph indentation distance is obtained in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetTextDirection(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextDirection textDirection)Sets the text direction in the paragraph style.
ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetTextDirection(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextDirection* textDirection)Obtains the text direction in the paragraph style.
OH_ArkUI_GestureStyle* OH_ArkUI_GestureStyle_Create()Creates an OH_ArkUI_GestureStyle object.
void OH_ArkUI_GestureStyle_Destroy(OH_ArkUI_GestureStyle* gestureStyle)Releases the memory occupied by the OH_ArkUI_GestureStyle object.
ArkUI_ErrorCode OH_ArkUI_GestureStyle_RegisterOnClickCallback(OH_ArkUI_GestureStyle* gestureStyle, void(*onClick)(ArkUI_NodeEvent*))Sets the click event callback in the event gesture style.
ArkUI_ErrorCode OH_ArkUI_GestureStyle_RegisterOnLongPressCallback(OH_ArkUI_GestureStyle* gestureStyle, void(*onLongPress)(ArkUI_GestureEvent*))Sets the long-pressing event callback in the event gesture style.
ArkUI_ErrorCode OH_ArkUI_GestureStyle_RegisterOnTouchCallback(OH_ArkUI_GestureStyle* gestureStyle, void(*onTouch)(ArkUI_NodeEvent*))Sets the touch event callback in the event gesture style.
OH_ArkUI_TextShadowStyle* OH_ArkUI_TextShadowStyle_Create()Creates an OH_ArkUI_TextShadowStyle object.
void OH_ArkUI_TextShadowStyle_Destroy(OH_ArkUI_TextShadowStyle* textShadowStyle)Releases the memory occupied by the OH_ArkUI_TextShadowStyle object.
ArkUI_ErrorCode OH_ArkUI_TextShadowStyle_SetTextShadow(OH_ArkUI_TextShadowStyle* textShadowStyle, const OH_ArkUI_ShadowOptions** options, uint32_t length)Sets the text shadow options for the text shadow style.
ArkUI_ErrorCode OH_ArkUI_TextShadowStyle_GetTextShadow(const OH_ArkUI_TextShadowStyle* textShadowStyle, OH_ArkUI_ShadowOptions** shadowOptions, uint32_t shadowOptionsSize, uint32_t* writeLength)Obtains the text shadow options of the text shadow style.
OH_ArkUI_DecorationStyle* OH_ArkUI_DecorationStyle_Create()Creates an OH_ArkUI_DecorationStyle object.
void OH_ArkUI_DecorationStyle_Destroy(OH_ArkUI_DecorationStyle* decorationStyle)Releases the memory occupied by the OH_ArkUI_DecorationStyle object.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetTextDecorationType(OH_ArkUI_DecorationStyle* decorationStyle, ArkUI_TextDecorationType type)Sets the decoration type for the text decorative line style.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetTextDecorationType(const OH_ArkUI_DecorationStyle* decorationStyle, ArkUI_TextDecorationType* type)Obtains the decoration type of the text decorative line style.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetColor(OH_ArkUI_DecorationStyle* decorationStyle, uint32_t color)Sets the decoration color for the text decorative line style.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetColor(const OH_ArkUI_DecorationStyle* decorationStyle, uint32_t* color)Obtains the decoration color of the text decorative line style.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetTextDecorationStyle(OH_ArkUI_DecorationStyle* decorationStyle, ArkUI_TextDecorationStyle style)Sets the decoration style for the text decorative line style.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetTextDecorationStyle(const OH_ArkUI_DecorationStyle* decorationStyle, ArkUI_TextDecorationStyle* style)Obtains the decoration style of the text decorative line style.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetThicknessScale(OH_ArkUI_DecorationStyle* decorationStyle, float thicknessScale)Sets the thickness scaling factor of the text decorative line style.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetThicknessScale(const OH_ArkUI_DecorationStyle* decorationStyle, float* thicknessScale)Obtains the thickness scaling factor of the text decorative line style.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetEnableMultiType(OH_ArkUI_DecorationStyle* decorationStyle, bool enableMultiType)Sets whether to enable the display of multiple decorative lines in the text decorative line style.
ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetEnableMultiType(const OH_ArkUI_DecorationStyle* decorationStyle, bool* enableMultiType)Obtains whether the display of multiple decorative lines is enabled in the text decorative line style.
OH_ArkUI_BaselineOffsetStyle* OH_ArkUI_BaselineOffsetStyle_Create()Creates an OH_ArkUI_BaselineOffsetStyle object.
void OH_ArkUI_BaselineOffsetStyle_Destroy(OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle)Releases the memory occupied by the OH_ArkUI_BaselineOffsetStyle object.
ArkUI_ErrorCode OH_ArkUI_BaselineOffsetStyle_SetBaselineOffset(OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle, float baselineOffset)Sets the baseline offset.
ArkUI_ErrorCode OH_ArkUI_BaselineOffsetStyle_GetBaselineOffset(const OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle, float* baselineOffset)Obtains the baseline offset.
OH_ArkUI_LetterSpacingStyle* OH_ArkUI_LetterSpacingStyle_Create()Creates an OH_ArkUI_LetterSpacingStyle object.
void OH_ArkUI_LetterSpacingStyle_Destroy(OH_ArkUI_LetterSpacingStyle* letterSpacingStyle)Releases the memory occupied by the OH_ArkUI_LetterSpacingStyle object.
ArkUI_ErrorCode OH_ArkUI_LetterSpacingStyle_SetLetterSpacing(OH_ArkUI_LetterSpacingStyle* letterSpacingStyle, float letterSpacing)Sets the letter spacing.
ArkUI_ErrorCode OH_ArkUI_LetterSpacingStyle_GetLetterSpacing(const OH_ArkUI_LetterSpacingStyle* letterSpacingStyle, float* letterSpacing)Obtains the letter spacing.
OH_ArkUI_LineHeightStyle* OH_ArkUI_LineHeightStyle_Create()Creates an OH_ArkUI_LineHeightStyle object.
void OH_ArkUI_LineHeightStyle_Destroy(OH_ArkUI_LineHeightStyle* lineHeightStyle)Releases the memory occupied by the OH_ArkUI_LineHeightStyle object.
ArkUI_ErrorCode OH_ArkUI_LineHeightStyle_SetLineHeight(OH_ArkUI_LineHeightStyle* lineHeightStyle, float lineHeight)Sets the line height.
ArkUI_ErrorCode OH_ArkUI_LineHeightStyle_GetLineHeight(const OH_ArkUI_LineHeightStyle* lineHeightStyle, float* lineHeight)Obtains the line height.
ArkUI_ErrorCode OH_ArkUI_LineHeightStyle_SetLineHeightMultiple(OH_ArkUI_LineHeightStyle* lineHeightStyle, float lineHeightMultiple)Sets a line height multiplier.
ArkUI_ErrorCode OH_ArkUI_LineHeightStyle_GetLineHeightMultiple(const OH_ArkUI_LineHeightStyle* lineHeightStyle, float* lineHeightMultiple)Obtains the line height multiplier.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetLineSpacingStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_LineSpacingStyle* lineSpacingStyle)Sets a line spacing style for the styled string style object.
ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetLineSpacingStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_LineSpacingStyle* lineSpacingStyle)Obtains the line spacing style of the styled string style object.
OH_ArkUI_LineSpacingStyle* OH_ArkUI_LineSpacingStyle_Create()Creates an OH_ArkUI_LineSpacingStyle object.
void OH_ArkUI_LineSpacingStyle_Destroy(OH_ArkUI_LineSpacingStyle* lineSpacingStyle)Releases the memory occupied by the OH_ArkUI_LineSpacingStyle object.
ArkUI_ErrorCode OH_ArkUI_LineSpacingStyle_SetLineSpacing(OH_ArkUI_LineSpacingStyle* lineSpacingStyle, float lineSpacing)Sets line spacing.
ArkUI_ErrorCode OH_ArkUI_LineSpacingStyle_GetLineSpacing(const OH_ArkUI_LineSpacingStyle* lineSpacingStyle, float* lineSpacing)Queries the line spacing.
ArkUI_ErrorCode OH_ArkUI_LineSpacingStyle_SetOnlyBetweenLines(OH_ArkUI_LineSpacingStyle* lineSpacingStyle, bool onlyBetweenLines)Sets whether the line spacing takes effect only between lines.
ArkUI_ErrorCode OH_ArkUI_LineSpacingStyle_GetOnlyBetweenLines(const OH_ArkUI_LineSpacingStyle* lineSpacingStyle, bool* onlyBetweenLines)Checks whether the line spacing takes effect only between lines.
OH_ArkUI_BackgroundColorStyle* OH_ArkUI_BackgroundColorStyle_Create()Creates an OH_ArkUI_BackgroundColorStyle object.
void OH_ArkUI_BackgroundColorStyle_Destroy(OH_ArkUI_BackgroundColorStyle* style)Releases the memory occupied by the OH_ArkUI_BackgroundColorStyle object.
ArkUI_ErrorCode OH_ArkUI_BackgroundColorStyle_SetColor(OH_ArkUI_BackgroundColorStyle* style, uint32_t color)Sets the background color for the background color style.
ArkUI_ErrorCode OH_ArkUI_BackgroundColorStyle_GetColor(const OH_ArkUI_BackgroundColorStyle* style, uint32_t* color)Obtains the background color of the background color style.
ArkUI_ErrorCode OH_ArkUI_BackgroundColorStyle_SetRadius(OH_ArkUI_BackgroundColorStyle* style, float topLeft, float topRight, float bottomLeft, float bottomRight)Sets the background radii for the background color style.
ArkUI_ErrorCode OH_ArkUI_BackgroundColorStyle_GetRadius(const OH_ArkUI_BackgroundColorStyle* style, float* topLeft, float* topRight, float* bottomLeft, float* bottomRight)Obtains the background radii of the background color style.
OH_ArkUI_UrlStyle* OH_ArkUI_UrlStyle_Create()Creates an OH_ArkUI_UrlStyle object.
void OH_ArkUI_UrlStyle_Destroy(OH_ArkUI_UrlStyle* style)Releases the memory occupied by the OH_ArkUI_UrlStyle object.
ArkUI_ErrorCode OH_ArkUI_UrlStyle_SetUrl(OH_ArkUI_UrlStyle* style, const char* url)Sets the URL content for the URL style.
ArkUI_ErrorCode OH_ArkUI_UrlStyle_GetUrl(const OH_ArkUI_UrlStyle* style, char* buffer, int32_t bufferSize, int32_t* writeLength)Obtains the URL content of the URL style.
OH_ArkUI_UserDataSpan* OH_ArkUI_UserDataSpan_Create()Creates an OH_ArkUI_UserDataSpan object.
void OH_ArkUI_UserDataSpan_Destroy(OH_ArkUI_UserDataSpan* userDataSpan)Releases the memory occupied by the OH_ArkUI_UserDataSpan object.
ArkUI_ErrorCode OH_ArkUI_UserDataSpan_SetUserData(OH_ArkUI_UserDataSpan* userDataSpan, void* userData)Sets the user data in the user data span style.
ArkUI_ErrorCode OH_ArkUI_UserDataSpan_GetUserData(const OH_ArkUI_UserDataSpan* userDataSpan, void** userData)Obtains the user data in the user data span style.
OH_ArkUI_CustomSpan* OH_ArkUI_CustomSpan_Create()Creates an OH_ArkUI_CustomSpan object.
void OH_ArkUI_CustomSpan_Destroy(OH_ArkUI_CustomSpan* customSpan)Releases the memory occupied by the OH_ArkUI_CustomSpan object.
ArkUI_ErrorCode OH_ArkUI_CustomSpan_RegisterOnMeasureCallback(OH_ArkUI_CustomSpan* customSpan, ArkUI_CustomSpanMetrics*(*onMeasure)(float))Sets the callback function triggered when metrics are obtained for the custom span.
ArkUI_ErrorCode OH_ArkUI_CustomSpan_RegisterOnDrawCallback(OH_ArkUI_CustomSpan* customSpan, void(*onDraw)(ArkUI_DrawContext*, ArkUI_CustomSpanDrawInfo*))Registers the callback function triggered when the custom span is drawn.
OH_ArkUI_ImageAttachment* OH_ArkUI_ImageAttachment_Create()Creates an OH_ArkUI_ImageAttachment object.
void OH_ArkUI_ImageAttachment_Destroy(OH_ArkUI_ImageAttachment* imageAttachment)Releases the memory occupied by the OH_ArkUI_ImageAttachment object.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetPixelMap(OH_ArkUI_ImageAttachment* imageAttachment, struct OH_PixelmapNative* pixelmap)Sets the image data source in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetPixelMap(const OH_ArkUI_ImageAttachment* imageAttachment, struct OH_PixelmapNative** pixelmap)Obtains the image data source in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetResource(OH_ArkUI_ImageAttachment* imageAttachment, const char* resource)Sets the image resource address in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetResource(const OH_ArkUI_ImageAttachment* imageAttachment, char* buffer, int32_t bufferSize, int32_t* writeLength)Obtains the image resource address in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetSizeWidth(OH_ArkUI_ImageAttachment* imageAttachment, float width)Sets the image width in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetSizeWidth(const OH_ArkUI_ImageAttachment* imageAttachment, float* width)Obtains the image width in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetSizeHeight(OH_ArkUI_ImageAttachment* imageAttachment, float height)Sets the image height in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetSizeHeight(const OH_ArkUI_ImageAttachment* imageAttachment, float* height)Obtains the image height in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetVerticalAlign(OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_ImageSpanAlignment verticalAlign)Sets the image alignment method in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetVerticalAlign(const OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_ImageSpanAlignment* verticalAlign)Obtains the image alignment method in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetObjectFit(OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_ObjectFit objectFit)Sets the image scaling type in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetObjectFit(const OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_ObjectFit* objectFit)Obtains the image scaling type in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetMargin(OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_Margin margin)Sets the image margin in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetMargin(const OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_Margin* margin)Obtains the image margin in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetPadding(OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_Margin padding)Sets the image padding in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetPadding(const OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_Margin* padding)Obtains the image padding in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetBorderRadiuses(OH_ArkUI_ImageAttachment* imageAttachment, float topLeft, float topRight, float bottomLeft, float bottomRight)Sets the image border radii in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetBorderRadiuses(const OH_ArkUI_ImageAttachment* imageAttachment, float* topLeft, float* topRight, float* bottomLeft, float* bottomRight)Obtains the image border radii in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetColorFilter(OH_ArkUI_ImageAttachment* imageAttachment, const float* colorFilter, uint32_t size)Sets the image color filter in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetColorFilter(const OH_ArkUI_ImageAttachment* imageAttachment, float** colorFilter, uint32_t colorFilterSize, uint32_t* writeLength)Obtains the image color filter in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetDrawingColorFilter(OH_ArkUI_ImageAttachment* imageAttachment, const OH_Drawing_ColorFilter* drawingColorFilter)Sets the image drawing color filter in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetDrawingColorFilter(const OH_ArkUI_ImageAttachment* imageAttachment, OH_Drawing_ColorFilter* drawingColorFilter)Obtains the image drawing color filter in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetSyncLoad(OH_ArkUI_ImageAttachment* imageAttachment, bool syncLoad)Sets whether to load the image synchronously in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetSyncLoad(const OH_ArkUI_ImageAttachment* imageAttachment, bool* syncLoad)Obtains whether the image is loaded synchronously in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetSupportSvg(OH_ArkUI_ImageAttachment* imageAttachment, bool supportSvg)Sets whether to enable the enhanced SVG tag parsing feature in the image style.
ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetSupportSvg(const OH_ArkUI_ImageAttachment* imageAttachment, bool* supportSvg)Obtains whether the enhanced SVG tag parsing feature is enabled in the image style.
ArkUI_ErrorCode OH_ArkUI_TextEditorChangeEvent_GetRangeBefore(const OH_ArkUI_TextEditorChangeEvent* event, uint32_t* start, uint32_t* end)Obtains the range of the content to be replaced in the text change information.
ArkUI_ErrorCode OH_ArkUI_TextEditorChangeEvent_GetReplacementStyledString(const OH_ArkUI_TextEditorChangeEvent* event, ArkUI_StyledString_Descriptor* descriptor)Obtains the styled string used for replacement in the text change information.
ArkUI_ErrorCode OH_ArkUI_TextEditorChangeEvent_GetPreviewStyledString(const OH_ArkUI_TextEditorChangeEvent* event, ArkUI_StyledString_Descriptor* descriptor)Obtains the styled string of the previewed content in the text change information.
void OH_ArkUI_TextLayoutManager_Dispose(ArkUI_TextLayoutManager* layoutManager)Releases the memory occupied by the text layout manager.
ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetLineCount(ArkUI_TextLayoutManager* layoutManager, int32_t* outLineCount)Obtains the number of lines.
ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetRectsForRange(ArkUI_TextLayoutManager* layoutManager, int32_t start, int32_t end, OH_Drawing_RectWidthStyle widthStyle, OH_Drawing_RectHeightStyle heightStyle, OH_Drawing_TextBox** outTextBoxes)Obtains the drawing area information of characters or placeholders within a specified text range under the given rectangle width and height.
ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetGlyphPositionAtCoordinate(ArkUI_TextLayoutManager* layoutManager, double dx, double dy, OH_Drawing_PositionAndAffinity** outPos)Obtains the position of the glyph closest to the given coordinates.
ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetLineMetrics(ArkUI_TextLayoutManager* layoutManager, int32_t lineNumber, OH_Drawing_LineMetrics* outMetrics)Obtains the information about the specified line, including line metrics, text style information, and font properties.
ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetCharacterPositionAtCoordinate(ArkUI_TextLayoutManager* layoutManager, double dx, double dy, OH_Drawing_PositionAndAffinity** outPos)Obtains the position of the character closest to the specified control.
ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetGlyphRangeForCharacterRange(ArkUI_TextLayoutManager* layoutManager, OH_Drawing_Range* charRange, OH_Drawing_Range** outGlyphRange, OH_Drawing_Range** outActualCharRange)Obtains the glyph range generated by the specified character range.
ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetCharacterRangeForGlyphRange(ArkUI_TextLayoutManager* layoutManager, OH_Drawing_Range* glyphRange, OH_Drawing_Range** outCharRange, OH_Drawing_Range** outActualGlyphRange)Obtains the character range generated by the specified glyph range.

Enum Description

OH_ArkUI_StyledStringKey

enum OH_ArkUI_StyledStringKey

Description

Enumerates the styles of a styled string.

Since: 24

ValueDescription
OH_ARKUI_STYLEDSTRINGKEY_UNSPECIFIED = -1No style is specified.
OH_ARKUI_STYLEDSTRINGKEY_FONT = 0Text font style.
OH_ARKUI_STYLEDSTRINGKEY_DECORATION = 1Text decorative line style.
OH_ARKUI_STYLEDSTRINGKEY_BASELINE_OFFSET = 2Text baseline offset style.
OH_ARKUI_STYLEDSTRINGKEY_LETTER_SPACING = 3Text letter spacing style.
OH_ARKUI_STYLEDSTRINGKEY_TEXT_SHADOW = 4Text shadow style.
OH_ARKUI_STYLEDSTRINGKEY_LINE_HEIGHT = 5Text line height style.
OH_ARKUI_STYLEDSTRINGKEY_BACKGROUND_COLOR = 6Text background color style.
OH_ARKUI_STYLEDSTRINGKEY_URL = 7URL style.
OH_ARKUI_STYLEDSTRINGKEY_LINE_SPACING = 8Text line spacing style. Since: 26.0.0
OH_ARKUI_STYLEDSTRINGKEY_GESTURE = 100Gesture style.
OH_ARKUI_STYLEDSTRINGKEY_PARAGRAPH_STYLE = 200Text paragraph style.
OH_ARKUI_STYLEDSTRINGKEY_IMAGE = 300Image style.
OH_ARKUI_STYLEDSTRINGKEY_CUSTOM_SPAN = 400Custom span style.
OH_ARKUI_STYLEDSTRINGKEY_USER_DATA = 500User data span style.

OH_ArkUI_SuperscriptStyle

enum OH_ArkUI_SuperscriptStyle

Description

Enumerates the text superscript and subscript styles.

Since: 24

ValueDescription
OH_ARKUI_SUPERSCRIPTSTYLE_NORMAL = 0Normal text style.
OH_ARKUI_SUPERSCRIPTSTYLE_SUPERSCRIPT = 1Superscript text style.
OH_ARKUI_SUPERSCRIPTSTYLE_SUBSCRIPT = 2Subscript text style.

Function Description

OH_ArkUI_StyledString_Create()

ArkUI_StyledString* OH_ArkUI_StyledString_Create(OH_Drawing_TypographyStyle* style, OH_Drawing_FontCollection* collection)

Description

Creates a pointer to the ArkUI_StyledString object.

Since: 12

Parameters

NameDescription
OH_Drawing_TypographyStyle* stylePointer to an OH_Drawing_TypographyStyle object, obtained using OH_Drawing_CreateTypographyStyle.
OH_Drawing_FontCollection* collectionPointer to an OH_Drawing_FontCollection object, obtained using OH_Drawing_CreateFontCollection.

Return value

TypeDescription
ArkUI_StyledString*Pointer to the created ArkUI_StyledString object. If a null pointer is returned, the creation fails. Possible causes include a full application address space or parameter errors, such as a null pointer being passed for the style or collection parameter.

OH_ArkUI_StyledString_Destroy()

void OH_ArkUI_StyledString_Destroy(ArkUI_StyledString* handle)

Description

Destroys an ArkUI_StyledString object and reclaims the memory occupied by the object.

Since: 12

Parameters

NameDescription
ArkUI_StyledString* handlePointer to an ArkUI_StyledString object.

OH_ArkUI_StyledString_PushTextStyle()

void OH_ArkUI_StyledString_PushTextStyle(ArkUI_StyledString* handle, OH_Drawing_TextStyle* style)

Description

Pushes a text style to the top of the style stack of a styled string.

Since: 12

Parameters

NameDescription
ArkUI_StyledString* handlePointer to an ArkUI_StyledString object.
OH_Drawing_TextStyle* stylePointer to an OH_Drawing_TextStyle object.

OH_ArkUI_StyledString_AddText()

void OH_ArkUI_StyledString_AddText(ArkUI_StyledString* handle, const char* content)

Description

Adds text for a styled string.

Since: 12

Parameters

NameDescription
ArkUI_StyledString* handlePointer to an ArkUI_StyledString object.
const char* contentPointer to the text content.

OH_ArkUI_StyledString_PopTextStyle()

void OH_ArkUI_StyledString_PopTextStyle(ArkUI_StyledString* handle)

Description

Pops the style at the top of the style stack of a styled string.

Since: 12

Parameters

NameDescription
ArkUI_StyledString* handlePointer to an ArkUI_StyledString object.

OH_ArkUI_StyledString_CreateTypography()

OH_Drawing_Typography* OH_ArkUI_StyledString_CreateTypography(ArkUI_StyledString* handle)

Description

Creates an OH_Drawing_Typography object based on an ArkUI_StyledString object.

Since: 12

Parameters

NameDescription
ArkUI_StyledString* handlePointer to an ArkUI_StyledString object.

Return value

TypeDescription
OH_Drawing_Typography*Pointer to the OH_Drawing_Typography object. If a null pointer is returned, the creation fails. A possible cause is that a parameter error, for example, a null pointer for the handle parameter, occurs.

OH_ArkUI_StyledString_AddPlaceholder()

void OH_ArkUI_StyledString_AddPlaceholder(ArkUI_StyledString* handle, OH_Drawing_PlaceholderSpan* placeholder)

Description

Adds a placeholder.

Since: 12

Parameters

NameDescription
ArkUI_StyledString* handlePointer to an ArkUI_StyledString object.
OH_Drawing_PlaceholderSpan* placeholderPointer to an OH_Drawing_PlaceholderSpan object.

OH_ArkUI_StyledString_Descriptor_Create()

ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_Create(void)

Description

Creates an ArkUI_StyledString_Descriptor object.

Since: 14

Return value

TypeDescription
ArkUI_StyledString_Descriptor*Pointer to an ArkUI_StyledString_Descriptor object.

OH_ArkUI_StyledString_Descriptor_Destroy()

void OH_ArkUI_StyledString_Descriptor_Destroy(ArkUI_StyledString_Descriptor* descriptor)

Description

Destroys an ArkUI_StyledString_Descriptor object and reclaims the memory occupied by the object.

Since: 14

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to an ArkUI_StyledString_Descriptor object.

OH_ArkUI_UnmarshallStyledStringDescriptor()

int32_t OH_ArkUI_UnmarshallStyledStringDescriptor(uint8_t* buffer, size_t bufferSize, ArkUI_StyledString_Descriptor* descriptor)

Description

Unmarshals a byte array containing styled string information into a styled string.

Since: 14

Parameters

NameDescription
uint8_t* bufferPointer to the byte array to be deserialized.
size_t bufferSizeLength of the byte array.
ArkUI_StyledString_Descriptor* descriptorPointer to an ArkUI_StyledString_Descriptor object.

Return value

TypeDescription
int32_tResult 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_MarshallStyledStringDescriptor()

int32_t OH_ArkUI_MarshallStyledStringDescriptor(uint8_t* buffer, size_t bufferSize, ArkUI_StyledString_Descriptor* descriptor, size_t* resultSize)

Description

Marshals the styled string information into a byte array.

Since: 14

Parameters

NameDescription
uint8_t* bufferPointer to the byte array where the serialized data will be stored.
size_t bufferSizeLength of the byte array.
ArkUI_StyledString_Descriptor* descriptorPointer to an ArkUI_StyledString_Descriptor object.
size_t* resultSizePointer to the actual length of the resulting byte array after deserialization.

Return value

TypeDescription
int32_tResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_ConvertToHtml()

const char* OH_ArkUI_ConvertToHtml(ArkUI_StyledString_Descriptor* descriptor)

Description

Converts styled string information into HTML.

Since: 14

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to an ArkUI_StyledString_Descriptor object.

Return value

TypeDescription
const char*Pointer to the HTML object. This pointer is internally managed and is released when OH_ArkUI_StyledString_Descriptor_Destroy() is called.

OH_ArkUI_StyledString_Descriptor_CreateWithString()

ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_CreateWithString(const char* value, const OH_ArkUI_SpanStyle** styles, int32_t length)

Description

Creates an ArkUI_StyledString_Descriptor object of the plain text content type.

NOTE

When the object is no longer used, call OH_ArkUI_StyledString_Descriptor_Destroy to destroy it.

Since: 24

Parameters

NameDescription
const char* valuePointer to text content string of the styled string.
const OH_ArkUI_SpanStyle** stylesPointer to the initialization option of the styled string, which points to an array of the OH_ArkUI_SpanStyle object.
int32_t lengthLength of the initialization option of the styled string.

Return value

TypeDescription
ArkUI_StyledString_Descriptor*Pointer to the created ArkUI_StyledString_Descriptor object.
If a null pointer is returned, the creation fails. The possible cause is that an input parameter is abnormal.

OH_ArkUI_StyledString_Descriptor_CreateWithImageAttachment()

ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_CreateWithImageAttachment(const OH_ArkUI_ImageAttachment* value)

Description

Creates an ArkUI_StyledString_Descriptor object of the image content type.

NOTE

When the object is no longer used, call OH_ArkUI_StyledString_Descriptor_Destroy to destroy it.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* valuePointer to the OH_ArkUI_ImageAttachment object.

Return value

TypeDescription
ArkUI_StyledString_Descriptor*Pointer to the created ArkUI_StyledString_Descriptor object.
If a null pointer is returned, the creation fails. The possible cause is that an input parameter is abnormal.

OH_ArkUI_StyledString_Descriptor_CreateWithCustomSpan()

ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_CreateWithCustomSpan(const OH_ArkUI_CustomSpan* value)

Description

Creates an ArkUI_StyledString_Descriptor object of the custom span content type.

NOTE

When the object is no longer used, call OH_ArkUI_StyledString_Descriptor_Destroy to destroy it.

Since: 24

Parameters

NameDescription
const OH_ArkUI_CustomSpan* valuePointer to the OH_ArkUI_CustomSpan object.

Return value

TypeDescription
ArkUI_StyledString_Descriptor*Pointer to the created ArkUI_StyledString_Descriptor object.
If a null pointer is returned, the creation fails. The possible cause is that an input parameter is abnormal.

OH_ArkUI_StyledString_Descriptor_GetLength()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_GetLength(const ArkUI_StyledString_Descriptor* descriptor, int32_t* length)

Description

Obtains the length of a styled string.

Since: 24

Parameters

NameDescription
const ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
int32_t* lengthPointer to the character length.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_GetString()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_GetString(const ArkUI_StyledString_Descriptor* descriptor, char* buffer, int32_t bufferSize, int32_t* writeLength)

Description

Obtains the text content of a styled string.

Since: 24

Parameters

NameDescription
const ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
char* bufferPointer to the buffer for storing the text content in the memory. You need to allocate the memory.
int32_t bufferSizeBuffer size.
int32_t* writeLengthPointer to the length of the data actually written to the buffer if ARKUI_ERROR_CODE_NO_ERROR is returned.
Pointer to the minimum length required for writing the entire string to the buffer if ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR is returned.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.
Returns ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR if the buffer size is insufficient.

OH_ArkUI_StyledString_Descriptor_IsEqual()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_IsEqual(const ArkUI_StyledString_Descriptor* firstDescriptor, const ArkUI_StyledString_Descriptor* secondDescriptor, bool* isEqual)

Description

Checks whether a styled string is the same as another styled string. The two styled strings are the same if they have the same text and style.

Since: 24

Parameters

NameDescription
const ArkUI_StyledString_Descriptor* firstDescriptorPointer to the ArkUI_StyledString_Descriptor object.
const ArkUI_StyledString_Descriptor* secondDescriptorPointer to another ArkUI_StyledString_Descriptor object.
bool* isEqualPointer to the isEqual parameter indicating whether the two styled strings are the same. true if the two are the same; returns false otherwise.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_SubStyledString()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_SubStyledString(const ArkUI_StyledString_Descriptor* descriptor, ArkUI_StyledString_Descriptor* subDescriptor, uint32_t start, uint32_t length)

Description

Obtains a sub-styled string of a styled string.

Since: 24

Parameters

NameDescription
const ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
ArkUI_StyledString_Descriptor* subDescriptorPointer to the ArkUI_StyledString_Descriptor sub-styled string object.
uint32_t startStart position of the sub-styled string. The value range is [0, length of the styled string].
uint32_t lengthLength of the sub-styled string. The value range is [0, difference between the length of the styled string and the value of start].

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_GetStyles()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_GetStyles(const ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length, OH_ArkUI_StyledStringKey styledKey, OH_ArkUI_SpanStyle** styles, uint32_t stylesSize, uint32_t* writeLength)

Description

Obtains the style set within a specified range of a styled string.

Since: 24

Parameters

NameDescription
const ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
uint32_t startStart position of the specified range. The value range is [0, length of the styled string].
uint32_t lengthLength of the specified range. The value range is [0, difference between the length of the styled string and the value of start].
OH_ArkUI_StyledStringKey styledKeyStyle type to be obtained. The value is an enumerated value of OH_ArkUI_StyledStringKey.
OH_ArkUI_SpanStyle** stylesPointer to the buffer of the style object array.
uint32_t stylesSizeSize of the buffer for the style object array.
uint32_t* writeLengthPointer to the actual size of the array of the style object obtained from the styled string.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.
Returns ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR if the buffer size is insufficient.

OH_ArkUI_StyledString_Descriptor_FromHtml()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_FromHtml(ArkUI_StyledString_Descriptor* descriptor, const char* html)

Description

Converts an HTML string to a styled string.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
const char* htmlPointer to the HTML string to be converted into a styled string.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_ReplaceString()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_ReplaceString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length, const char* string)

Description

Replaces the text within a specified range of a styled string.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
uint32_t startStart position of the specified range. The value range is [0, length of the styled string].
uint32_t lengthLength of the specified range. The value range is [0, difference between the length of the styled string and the value of start].
const char* stringPointer to the string to replace the content in the target range.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_InsertString()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_InsertString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, const char* string)

Description

Inserts text at a specified position of a styled string.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
uint32_t startInsertion position. The value range is [0, length of the styled string].
const char* stringPointer to the string to insert.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_RemoveString()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_RemoveString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length)

Description

Removes the text within a specified range of a styled string.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
uint32_t startStart position of the specified range. The value range is [0, length of the styled string].
uint32_t lengthLength of the specified range. The value range is [0, difference between the length of the styled string and the value of start].

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_ReplaceStyle()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_ReplaceStyle(ArkUI_StyledString_Descriptor* descriptor, const OH_ArkUI_SpanStyle* spanStyle)

Description

Replaces the style within a specified range of a styled string.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
You need to call OH_ArkUI_SpanStyle_SetStart and OH_ArkUI_SpanStyle_SetLength to set the target range in the object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_SetStyle()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_SetStyle(ArkUI_StyledString_Descriptor* descriptor, const OH_ArkUI_SpanStyle* spanStyle)

Description

Sets a new style for a specified range of a styled string.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object. You need to call OH_ArkUI_SpanStyle_SetStart and OH_ArkUI_SpanStyle_SetLength to set the target range in the object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_RemoveStyle()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_RemoveStyle(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length, OH_ArkUI_StyledStringKey styledKey)

Description

Removes the specified style for a specified range of a styled string.

NOTE

After the style is removed, the default value of the corresponding attribute of the TextEditor component is used.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
uint32_t startStart position of the specified range. The value range is [0, length of the styled string].
uint32_t lengthLength of the specified range. The value range is [0, difference between the length of the styled string and the value of start].
OH_ArkUI_StyledStringKey styledKeyStyle type. The value is an enumerated value of OH_ArkUI_StyledStringKey.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_ClearStyles()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_ClearStyles(ArkUI_StyledString_Descriptor* descriptor)

Description

Clears all styles of a styled string.

NOTE

After the styles are removed, the default value of the corresponding attribute of the TextEditor component is used.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_ReplaceStyledString()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_ReplaceStyledString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, uint32_t length, const ArkUI_StyledString_Descriptor* other)

Description

Replaces the styled string within a specified range.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
uint32_t startStart position of the specified range. The value range is [0, length of the styled string].
uint32_t lengthLength of the specified range. The value range is [0, difference between the length of the styled string and the value of start].
const ArkUI_StyledString_Descriptor* otherPointer to the new ArkUI_StyledString_Descriptor object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_InsertStyledString()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_InsertStyledString(ArkUI_StyledString_Descriptor* descriptor, uint32_t start, const ArkUI_StyledString_Descriptor* other)

Description

Inserts a new styled string at a specified position of a styled string.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
uint32_t startInsertion position. The value range is [0, length of the styled string].
const ArkUI_StyledString_Descriptor* otherPointer to the new ArkUI_StyledString_Descriptor object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_AppendStyledString()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_AppendStyledString(ArkUI_StyledString_Descriptor* descriptor, const ArkUI_StyledString_Descriptor* other)

Description

Appends a new styled string to the end of a styled string.

Since: 24

Parameters

NameDescription
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.
const ArkUI_StyledString_Descriptor* otherPointer to the new ArkUI_StyledString_Descriptor object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_StyledString_Descriptor_InvalidateCustomSpan()

ArkUI_ErrorCode OH_ArkUI_StyledString_Descriptor_InvalidateCustomSpan(const ArkUI_StyledString_Descriptor* descriptor)

Description

Actively refreshes the custom span in a styled string.

NOTE

Calling this API immediately triggers the callback function registered on the custom span using OH_ArkUI_CustomSpan_RegisterOnDrawCallback.

Since: 24

Parameters

NameDescription
const ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_INVALID_STYLED_STRING if the styled string is invalid.

OH_ArkUI_TextStyle_Create()

OH_ArkUI_TextStyle* OH_ArkUI_TextStyle_Create()

Description

Creates an OH_ArkUI_TextStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_TextStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_TextStyle*Pointer to the OH_ArkUI_TextStyle object.

OH_ArkUI_TextStyle_Destroy()

void OH_ArkUI_TextStyle_Destroy(OH_ArkUI_TextStyle* textStyle)

Description

Releases the memory occupied by the OH_ArkUI_TextStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.

OH_ArkUI_TextStyle_SetFontColor()

ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontColor(OH_ArkUI_TextStyle* textStyle, uint32_t fontColor)

Description

Sets text color for a text font style.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
uint32_t fontColorFont color, in 0xARGB format.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_GetFontColor()

ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontColor(const OH_ArkUI_TextStyle* textStyle, uint32_t* fontColor)

Description

Obtains the text color of a text font style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
uint32_t* fontColorPointer to the font color, in 0xARGB format.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_SetFontFamily()

ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontFamily(OH_ArkUI_TextStyle* textStyle, const char* fontFamily)

Description

Sets a font family for a text font style.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
const char* fontFamilyPointer to the font family, containing the font names to be set. Different font names are separated by commas (,).

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_GetFontFamily()

ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontFamily(const OH_ArkUI_TextStyle* textStyle, char* buffer, int32_t bufferSize, int32_t* writeLength)

Description

Obtains the font family of a text font style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
char* bufferPointer to the buffer for storing the font family in the memory. You need to allocate the memory.
int32_t bufferSizeMaximum number of characters that can be written to the buffer.
int32_t* writeLengthPointer to the length of the string actually written to the buffer if ARKUI_ERROR_CODE_NO_ERROR is returned.
Pointer to the minimum length required for writing the entire string to the buffer if ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR is returned.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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 buffer size is insufficient.

OH_ArkUI_TextStyle_SetFontSize()

ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontSize(OH_ArkUI_TextStyle* textStyle, float fontSize)

Description

Sets font size for a text font style.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
float fontSizeFont size, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_GetFontSize()

ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontSize(const OH_ArkUI_TextStyle* textStyle, float* fontSize)

Description

Obtains the font size of a text font style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
float* fontSizePointer to the font size, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_SetFontWeight()

ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontWeight(OH_ArkUI_TextStyle* textStyle, uint32_t fontWeight)

Description

Sets font weight for a text font style.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
uint32_t fontWeightFont weight. The value is an integer multiple of 100 within the [100, 900] range, for example, 100 or 900.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_GetFontWeight()

ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontWeight(const OH_ArkUI_TextStyle* textStyle, uint32_t* fontWeight)

Description

Obtains the font weight of a text font style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
uint32_t* fontWeightPointer to the font weight. The value is an integer multiple of 100 within the [100, 900] range, for example, 100 or 900.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_SetFontStyle()

ArkUI_ErrorCode OH_ArkUI_TextStyle_SetFontStyle(OH_ArkUI_TextStyle* textStyle, ArkUI_FontStyle fontStyle)

Description

Sets font style for a text font style.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
ArkUI_FontStyle fontStyleFont style. The value is an enumerated value of ArkUI_FontStyle.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_GetFontStyle()

ArkUI_ErrorCode OH_ArkUI_TextStyle_GetFontStyle(const OH_ArkUI_TextStyle* textStyle, ArkUI_FontStyle* fontStyle)

Description

Obtains the font style of a text font style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
ArkUI_FontStyle* fontStylePointer to the font style. The value is an enumerated value of ArkUI_FontStyle.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_SetStrokeWidth()

ArkUI_ErrorCode OH_ArkUI_TextStyle_SetStrokeWidth(OH_ArkUI_TextStyle* textStyle, float strokeWidth)

Description

Sets stroke width for a text font style.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
float strokeWidthStroke width, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_GetStrokeWidth()

ArkUI_ErrorCode OH_ArkUI_TextStyle_GetStrokeWidth(const OH_ArkUI_TextStyle* textStyle, float* strokeWidth)

Description

Obtains the stroke width of a text font style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
float* strokeWidthPointer to the stroke width, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_SetStrokeColor()

ArkUI_ErrorCode OH_ArkUI_TextStyle_SetStrokeColor(OH_ArkUI_TextStyle* textStyle, uint32_t strokeColor)

Description

Sets a stroke color for a text font style.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
uint32_t strokeColorStroke color, in 0xARGB format.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_GetStrokeColor()

ArkUI_ErrorCode OH_ArkUI_TextStyle_GetStrokeColor(const OH_ArkUI_TextStyle* textStyle, uint32_t* strokeColor)

Description

Obtains the stroke color of a text font style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
uint32_t* strokeColorPointer to the stroke color, in 0xARGB format.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_SetSuperscript()

ArkUI_ErrorCode OH_ArkUI_TextStyle_SetSuperscript(OH_ArkUI_TextStyle* textStyle, OH_ArkUI_SuperscriptStyle superscript)

Description

Sets superscript and subscript styles for a text font style.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
OH_ArkUI_SuperscriptStyle superscriptSuperscript and subscript styles. The value is an enumerated value of OH_ArkUI_SuperscriptStyle.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextStyle_GetSuperscript()

ArkUI_ErrorCode OH_ArkUI_TextStyle_GetSuperscript(const OH_ArkUI_TextStyle* textStyle, OH_ArkUI_SuperscriptStyle* superscript)

Description

Obtains the superscript and subscript styles of a text font style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.
OH_ArkUI_SuperscriptStyle* superscriptPointer to the superscript and subscript styles. The value is an enumerated value of OH_ArkUI_SuperscriptStyle.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_Create()

OH_ArkUI_SpanStyle* OH_ArkUI_SpanStyle_Create()

Description

Creates an OH_ArkUI_SpanStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_SpanStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_SpanStyle*Pointer to the OH_ArkUI_SpanStyle object.

OH_ArkUI_SpanStyle_Destroy()

void OH_ArkUI_SpanStyle_Destroy(OH_ArkUI_SpanStyle* spanStyle)

Description

Releases the memory occupied by the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.

OH_ArkUI_SpanStyle_GetStyledKey()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetStyledKey(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_StyledStringKey* styledKey)

Description

Obtains the style of the styled string object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_StyledStringKey* styledKeyPointer to the style type. The value is an enumerated value of OH_ArkUI_StyledStringKey.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetStart()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetStart(OH_ArkUI_SpanStyle* spanStyle, int32_t start)

Description

Sets the start position for the styled string object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
int32_t startStart position of the styled string style object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetStart()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetStart(const OH_ArkUI_SpanStyle* spanStyle, int32_t* start)

Description

Obtains the start position of the styled string object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
int32_t* startPointer to the start position of the styled string style object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetLength()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetLength(OH_ArkUI_SpanStyle* spanStyle, int32_t length)

Description

Sets the length for the styled string object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
int32_t lengthLength of the styled string style object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetLength()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetLength(const OH_ArkUI_SpanStyle* spanStyle, int32_t* length)

Description

Obtains the length of the styled string object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
int32_t* lengthPointer to the length of the styled string style object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetTextStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetTextStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_TextStyle* textStyle)

Description

Sets the text font style for the styled string object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetTextStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetTextStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_TextStyle* textStyle)

Description

Obtains the text font style of the styled string object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_TextStyle* textStylePointer to the OH_ArkUI_TextStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetParagraphStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetParagraphStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_ParagraphStyle* paragraphStyle)

Description

Sets the paragraph style for the styled string object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetParagraphStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetParagraphStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_ParagraphStyle* paragraphStyle)

Description

Obtains the paragraph style of the styled string object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetGestureStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetGestureStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_GestureStyle* gestureStyle)

Description

Sets the gesture style for the styled string object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_GestureStyle* gestureStylePointer to the OH_ArkUI_GestureStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetGestureStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetGestureStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_GestureStyle* gestureStyle)

Description

Obtains the gesture style of the styled string object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_GestureStyle* gestureStylePointer to the OH_ArkUI_GestureStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetTextShadowStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetTextShadowStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_TextShadowStyle* textShadowStyle)

Description

Sets the text shadow style for the styled string object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_TextShadowStyle* textShadowStylePointer to the OH_ArkUI_TextShadowStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetTextShadowStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetTextShadowStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_TextShadowStyle* textShadowStyle)

Description

Obtains the text shadow style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_TextShadowStyle* textShadowStylePointer to the OH_ArkUI_TextShadowStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetDecorationStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetDecorationStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_DecorationStyle* decorationStyle)

Description

Sets the text decorative line style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetDecorationStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetDecorationStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_DecorationStyle* decorationStyle)

Description

Obtains the text decorative line style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetBaselineOffsetStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetBaselineOffsetStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle)

Description

Sets the baseline offset style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_BaselineOffsetStyle* baselineOffsetStylePointer to the OH_ArkUI_BaselineOffsetStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetBaselineOffsetStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetBaselineOffsetStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle)

Description

Obtains the baseline offset style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_BaselineOffsetStyle* baselineOffsetStylePointer to the OH_ArkUI_BaselineOffsetStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetLetterSpacingStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetLetterSpacingStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_LetterSpacingStyle* letterSpacingStyle)

Description

Sets the letter spacing style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_LetterSpacingStyle* letterSpacingStylePointer to the OH_ArkUI_LetterSpacingStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetLetterSpacingStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetLetterSpacingStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_LetterSpacingStyle* letterSpacingStyle)

Description

Obtains the letter spacing style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_LetterSpacingStyle* letterSpacingStylePointer to the OH_ArkUI_LetterSpacingStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetLineHeightStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetLineHeightStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_LineHeightStyle* lineHeightStyle)

Description

Sets the line height style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_LineHeightStyle* lineHeightStylePointer to the OH_ArkUI_LineHeightStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetLineHeightStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetLineHeightStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_LineHeightStyle* lineHeightStyle)

Description

Obtains the line height style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_LineHeightStyle* lineHeightStylePointer to the OH_ArkUI_LineHeightStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetUrlStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetUrlStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_UrlStyle* urlStyle)

Description

Sets the URL style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_UrlStyle* urlStylePointer to the OH_ArkUI_UrlStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetUrlStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetUrlStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_UrlStyle* urlStyle)

Description

Obtains the URL style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_UrlStyle* urlStylePointer to the OH_ArkUI_UrlStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetBackgroundColorStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetBackgroundColorStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_BackgroundColorStyle* backgroundColorStyle)

Description

Sets the background color style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_BackgroundColorStyle* backgroundColorStylePointer to the OH_ArkUI_BackgroundColorStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetBackgroundColorStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetBackgroundColorStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_BackgroundColorStyle* backgroundColorStyle)

Description

Obtains the background color style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_BackgroundColorStyle* backgroundColorStylePointer to the OH_ArkUI_BackgroundColorStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetUserDataSpan()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetUserDataSpan(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_UserDataSpan* userDataSpan)

Description

Sets the user data span style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_UserDataSpan* userDataSpanPointer to the OH_ArkUI_UserDataSpan object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetUserDataSpan()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetUserDataSpan(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_UserDataSpan* userDataSpan)

Description

Obtains the user data span style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_UserDataSpan* userDataSpanPointer to the OH_ArkUI_UserDataSpan object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetCustomSpan()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetCustomSpan(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_CustomSpan* customSpan)

Description

Sets the custom span style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_CustomSpan* customSpanPointer to the OH_ArkUI_CustomSpan object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetCustomSpan()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetCustomSpan(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_CustomSpan* customSpan)

Description

Obtains the custom span style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_CustomSpan* customSpanPointer to the OH_ArkUI_CustomSpan object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetImageAttachment()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetImageAttachment(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_ImageAttachment* imageAttachment)

Description

Sets the image style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetImageAttachment()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetImageAttachment(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_ImageAttachment* imageAttachment)

Description

Obtains the image style of the styled string style object.

Since: 24

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_Create()

OH_ArkUI_LeadingMarginSpanDrawInfo* OH_ArkUI_LeadingMarginSpanDrawInfo_Create()

Description

Creates an OH_ArkUI_LeadingMarginSpanDrawInfo object.

NOTE

When the object is no longer used, call OH_ArkUI_LeadingMarginSpanDrawInfo_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_LeadingMarginSpanDrawInfo*Pointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.

OH_ArkUI_LeadingMarginSpanDrawInfo_Destroy()

void OH_ArkUI_LeadingMarginSpanDrawInfo_Destroy(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo)

Description

Releases the memory occupied by the OH_ArkUI_LeadingMarginSpanDrawInfo object.

Since: 24

Parameters

NameDescription
OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.

OH_ArkUI_LeadingMarginSpanDrawInfo_SetX()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetX(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float x)

Description

Sets the horizontal offset of the current line relative to the component in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
float xHorizontal offset of the current line relative to the component, in px.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_GetX()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetX(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float* x)

Description

Obtains the horizontal offset of the current line relative to the component in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
float* xPointer to the horizontal offset of the current line relative to the component, in px.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_SetTop()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetTop(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float top)

Description

Sets the distance between the top of a line and the top edge of the component in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
float topDistance between the top of a line and the top edge of the component, in px.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_GetTop()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetTop(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float* top)

Description

Obtains the distance between the top of a line and the top edge of the component in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
float* topPointer to the distance between the top of a line and the top edge of the component, in px.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_SetBottom()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetBottom(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float bottom)

Description

Sets the distance between the bottom of a line and the top edge of the component in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
float bottomDistance between the bottom of a line and the top edge of the component, in px.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_GetBottom()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetBottom(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float* bottom)

Description

Obtains the distance between the bottom of a line and the top edge of the component in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
float* bottomPointer to the distance between the bottom of a line and the top edge of the component, in px.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_SetBaseline()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetBaseline(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float baseline)

Description

Sets the distance between the baseline of the current line and the top edge of the component in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
float baselineDistance between the baseline of the current line and the top edge of the component, in px.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_GetBaseline()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetBaseline(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, float* baseline)

Description

Obtains the distance between the baseline of the current line and the top edge of the component in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
float* baselinePointer to the distance between the baseline of the current line and the top edge of the component, in px.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_SetTextDirection()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetTextDirection(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, ArkUI_TextDirection direction)

Description

Sets the text direction in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
ArkUI_TextDirection directionText direction. The value is an enumerated value of ArkUI_TextDirection.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_GetTextDirection()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetTextDirection(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, ArkUI_TextDirection* direction)

Description

Obtains the text direction in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
ArkUI_TextDirection* directionPointer to the text direction. The value is an enumerated value of ArkUI_TextDirection.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_SetStart()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetStart(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, uint32_t start)

Description

Sets the start index of the current line in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
uint32_t startStart index of the current line.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_GetStart()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetStart(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, uint32_t* start)

Description

Obtains the start index of the current line in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
uint32_t* startPointer to the start index of the current line.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_SetEnd()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetEnd(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, uint32_t end)

Description

Sets the end index of the current line in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
uint32_t endEnd index of the current line.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_GetEnd()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetEnd(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, uint32_t* end)

Description

Obtains the end index of the current line in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
uint32_t* endPointer to the end index of the current line.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_SetFirst()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_SetFirst(OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, bool first)

Description

Sets whether the current line is the first line of the paragraph in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
bool firstWhether the current line is the first line of the paragraph. true indicates the first line, and false indicates the opposite.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LeadingMarginSpanDrawInfo_GetFirst()

ArkUI_ErrorCode OH_ArkUI_LeadingMarginSpanDrawInfo_GetFirst(const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo, bool* first)

Description

Obtains whether the current line is the first line of the paragraph in the custom drawing information object for paragraph indentation.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfoPointer to the OH_ArkUI_LeadingMarginSpanDrawInfo object.
bool* firstPointer to the first parameter indicating whether the current line is the first line of the paragraph. true indicates the first line, and false indicates the opposite.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_Create()

OH_ArkUI_ParagraphStyle* OH_ArkUI_ParagraphStyle_Create()

Description

Creates an OH_ArkUI_ParagraphStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_ParagraphStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_ParagraphStyle*Pointer to the OH_ArkUI_ParagraphStyle object.

OH_ArkUI_ParagraphStyle_Destroy()

void OH_ArkUI_ParagraphStyle_Destroy(OH_ArkUI_ParagraphStyle* paragraphStyle)

Description

Releases the memory occupied by the OH_ArkUI_ParagraphStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.

OH_ArkUI_ParagraphStyle_SetTextAlign()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetTextAlign(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextAlignment align)

Description

Sets the horizontal text alignment method in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_TextAlignment alignHorizontal text alignment method. The value is an enumerated value of ArkUI_TextAlignment.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetTextAlign()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetTextAlign(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextAlignment* align)

Description

Obtains the horizontal text alignment method in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_TextAlignment* alignPointer to the horizontal text alignment method. The value is an enumerated value of ArkUI_TextAlignment.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetTextIndent()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetTextIndent(OH_ArkUI_ParagraphStyle* paragraphStyle, float textIndent)

Description

Sets the first-line text indentation in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
float textIndentFirst-line indentation value, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetTextIndent()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetTextIndent(const OH_ArkUI_ParagraphStyle* paragraphStyle, float* textIndent)

Description

Obtains the first-line text indentation in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
float* textIndentPointer to the first-line indentation value, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetMaxLines()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetMaxLines(OH_ArkUI_ParagraphStyle* paragraphStyle, int32_t maxLines)

Description

Sets the maximum number of lines in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
int32_t maxLinesMaximum number of lines.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetMaxLines()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetMaxLines(const OH_ArkUI_ParagraphStyle* paragraphStyle, int32_t* maxLines)

Description

Obtains the maximum number of lines in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
int32_t* maxLinesPointer to the maximum number of lines.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetOverflow()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetOverflow(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextOverflow overflow)

Description

Sets the display mode when the paragraph is too long in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_TextOverflow overflowDisplay mode when the paragraph is too long. The value is an enumerated value of ArkUI_TextOverflow.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetOverflow()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetOverflow(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextOverflow* overflow)

Description

Obtains the display mode when the paragraph is too long in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_TextOverflow* overflowPointer to the display mode when the paragraph is too long. The value is an enumerated value of ArkUI_TextOverflow.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetWordBreak()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetWordBreak(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_WordBreak wordBreak)

Description

Sets the word breaking rule in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_WordBreak wordBreakWord breaking rule. The value is an enumerated value of ArkUI_WordBreak.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetWordBreak()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetWordBreak(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_WordBreak* wordBreak)

Description

Obtains the word breaking rule in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_WordBreak* wordBreakPointer to the word breaking rule. The value is an enumerated value of ArkUI_WordBreak.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetLeadingMarginPixelMap()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetLeadingMarginPixelMap(OH_ArkUI_ParagraphStyle* paragraphStyle, struct OH_PixelmapNative* pixelmap)

Description

Sets the PixelMap for paragraph indentation in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
struct OH_PixelmapNative* pixelmapPointer to the PixelMap for paragraph indentation.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetLeadingMarginPixelMap()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetLeadingMarginPixelMap(const OH_ArkUI_ParagraphStyle* paragraphStyle, struct OH_PixelmapNative** pixelmap)

Description

Obtains the PixelMap for paragraph indentation in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
struct OH_PixelmapNative** pixelmapDouble pointer to the PixelMap for paragraph indentation.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetLeadingMarginWidth()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetLeadingMarginWidth(OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t width)

Description

Sets the width for paragraph indentation in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
uint32_t widthWidth for paragraph indentation, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetLeadingMarginWidth()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetLeadingMarginWidth(const OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t* width)

Description

Obtains the width for paragraph indentation in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
uint32_t* widthPointer to the width for paragraph indentation, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetLeadingMarginHeight()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetLeadingMarginHeight(OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t height)

Description

Sets the height for paragraph indentation in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
uint32_t heightHeight for paragraph indentation, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetLeadingMarginHeight()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetLeadingMarginHeight(const OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t* height)

Description

Obtains the height for paragraph indentation in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
uint32_t* heightPointer to the height for paragraph indentation, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetParagraphSpacing()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetParagraphSpacing(OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t paragraphSpacing)

Description

Sets the paragraph spacing in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
uint32_t paragraphSpacingParagraph spacing, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetParagraphSpacing()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetParagraphSpacing(const OH_ArkUI_ParagraphStyle* paragraphStyle, uint32_t* paragraphSpacing)

Description

Obtains the paragraph spacing in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
uint32_t* paragraphSpacingPointer to the paragraph spacing, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetTextVerticalAlign()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetTextVerticalAlign(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextVerticalAlignment verticalAlignment)

Description

Sets the vertical text alignment method in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_TextVerticalAlignment verticalAlignmentVertical text alignment method. The value is an enumerated value of ArkUI_TextVerticalAlignment.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetTextVerticalAlign()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetTextVerticalAlign(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextVerticalAlignment* verticalAlignment)

Description

Obtains the vertical text alignment method in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_TextVerticalAlignment* verticalAlignmentPointer to the vertical text alignment method. The value is an enumerated value of ArkUI_TextVerticalAlignment.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_RegisterOnDrawLeadingMarginCallback()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_RegisterOnDrawLeadingMarginCallback(OH_ArkUI_ParagraphStyle* paragraphStyle, void(*onDraw)(ArkUI_DrawContext* context, OH_ArkUI_LeadingMarginSpanDrawInfo* drawInfo))

Description

Sets the callback function triggered when the paragraph indentation is drawn in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
void(*onDraw)(ArkUI_DrawContext* contextCallback function triggered when the paragraph indentation is drawn. context indicates the graphics drawing context. drawInfo indicates the custom drawing information.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_RegisterOnGetLeadingMarginCallback()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_RegisterOnGetLeadingMarginCallback(OH_ArkUI_ParagraphStyle* paragraphStyle, float(*leadingMargin)())

Description

Sets the callback function triggered when the paragraph indentation distance is obtained in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
float(*leadingMargin)()Callback function triggered when the paragraph indentation distance is obtained.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_SetTextDirection()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_SetTextDirection(OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextDirection textDirection)

Description

Sets the text direction in the paragraph style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_TextDirection textDirectionText direction. The value is an enumerated value of ArkUI_TextDirection.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ParagraphStyle_GetTextDirection()

ArkUI_ErrorCode OH_ArkUI_ParagraphStyle_GetTextDirection(const OH_ArkUI_ParagraphStyle* paragraphStyle, ArkUI_TextDirection* textDirection)

Description

Obtains the text direction in the paragraph style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ParagraphStyle* paragraphStylePointer to the OH_ArkUI_ParagraphStyle object.
ArkUI_TextDirection* textDirectionPointer to the text direction. The value is an enumerated value of ArkUI_TextDirection.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_GestureStyle_Create()

OH_ArkUI_GestureStyle* OH_ArkUI_GestureStyle_Create()

Description

Creates an OH_ArkUI_GestureStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_GestureStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_GestureStyle*Pointer to the OH_ArkUI_GestureStyle object.

OH_ArkUI_GestureStyle_Destroy()

void OH_ArkUI_GestureStyle_Destroy(OH_ArkUI_GestureStyle* gestureStyle)

Description

Releases the memory occupied by the OH_ArkUI_GestureStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_GestureStyle* gestureStylePointer to the OH_ArkUI_GestureStyle object.

OH_ArkUI_GestureStyle_RegisterOnClickCallback()

ArkUI_ErrorCode OH_ArkUI_GestureStyle_RegisterOnClickCallback(OH_ArkUI_GestureStyle* gestureStyle, void(*onClick)(ArkUI_NodeEvent*))

Description

Sets the click event callback in the event gesture style.

Since: 24

Parameters

NameDescription
OH_ArkUI_GestureStyle* gestureStylePointer to the OH_ArkUI_GestureStyle object.
void(*onClick)(ArkUI_NodeEvent*)Callback of the click event.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_GestureStyle_RegisterOnLongPressCallback()

ArkUI_ErrorCode OH_ArkUI_GestureStyle_RegisterOnLongPressCallback(OH_ArkUI_GestureStyle* gestureStyle, void(*onLongPress)(ArkUI_GestureEvent*))

Description

Sets the long-pressing event callback in the event gesture style.

Since: 24

Parameters

NameDescription
OH_ArkUI_GestureStyle* gestureStylePointer to the OH_ArkUI_GestureStyle object.
void(*onLongPress)(ArkUI_GestureEvent*)Callback of the long-pressing event.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_GestureStyle_RegisterOnTouchCallback()

ArkUI_ErrorCode OH_ArkUI_GestureStyle_RegisterOnTouchCallback(OH_ArkUI_GestureStyle* gestureStyle, void(*onTouch)(ArkUI_NodeEvent*))

Description

Sets the touch event callback in the event gesture style.

Since: 24

Parameters

NameDescription
OH_ArkUI_GestureStyle* gestureStylePointer to the OH_ArkUI_GestureStyle object.
void(*onTouch)(ArkUI_NodeEvent*)Callback of the touch event.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextShadowStyle_Create()

OH_ArkUI_TextShadowStyle* OH_ArkUI_TextShadowStyle_Create()

Description

Creates an OH_ArkUI_TextShadowStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_TextShadowStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_TextShadowStyle*Pointer to the OH_ArkUI_TextShadowStyle object.

OH_ArkUI_TextShadowStyle_Destroy()

void OH_ArkUI_TextShadowStyle_Destroy(OH_ArkUI_TextShadowStyle* textShadowStyle)

Description

Releases the memory occupied by the OH_ArkUI_TextShadowStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextShadowStyle* textShadowStylePointer to the OH_ArkUI_TextShadowStyle object.

OH_ArkUI_TextShadowStyle_SetTextShadow()

ArkUI_ErrorCode OH_ArkUI_TextShadowStyle_SetTextShadow(OH_ArkUI_TextShadowStyle* textShadowStyle, const OH_ArkUI_ShadowOptions** options, uint32_t length)

Description

Sets the text shadow options for the text shadow style.

Since: 24

Parameters

NameDescription
OH_ArkUI_TextShadowStyle* textShadowStylePointer to the OH_ArkUI_TextShadowStyle object.
const OH_ArkUI_ShadowOptions** optionsDouble pointer to the text shadow options, which points to an array of the OH_ArkUI_ShadowOptions object.
uint32_t lengthLength of the text shadow options.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextShadowStyle_GetTextShadow()

ArkUI_ErrorCode OH_ArkUI_TextShadowStyle_GetTextShadow(const OH_ArkUI_TextShadowStyle* textShadowStyle, OH_ArkUI_ShadowOptions** shadowOptions, uint32_t shadowOptionsSize, uint32_t* writeLength)

Description

Obtains the text shadow options of the text shadow style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextShadowStyle* textShadowStylePointer to the OH_ArkUI_TextShadowStyle object.
OH_ArkUI_ShadowOptions** shadowOptionsDouble pointer to the text shadow options, which points to an array of the OH_ArkUI_ShadowOptions object.
uint32_t shadowOptionsSizeSize of the shadow option buffer.
uint32_t* writeLengthPointer to the number of actual text shadow options in the text shadow style.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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 buffer size is insufficient.

OH_ArkUI_DecorationStyle_Create()

OH_ArkUI_DecorationStyle* OH_ArkUI_DecorationStyle_Create()

Description

Creates an OH_ArkUI_DecorationStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_DecorationStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_DecorationStyle*Pointer to the OH_ArkUI_DecorationStyle object.

OH_ArkUI_DecorationStyle_Destroy()

void OH_ArkUI_DecorationStyle_Destroy(OH_ArkUI_DecorationStyle* decorationStyle)

Description

Releases the memory occupied by the OH_ArkUI_DecorationStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.

OH_ArkUI_DecorationStyle_SetTextDecorationType()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetTextDecorationType(OH_ArkUI_DecorationStyle* decorationStyle, ArkUI_TextDecorationType type)

Description

Sets the decoration type for the text decorative line style.

Since: 24

Parameters

NameDescription
OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
ArkUI_TextDecorationType typeType of the text decorative line. The value is an enumerated value of ArkUI_TextDecorationType.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_DecorationStyle_GetTextDecorationType()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetTextDecorationType(const OH_ArkUI_DecorationStyle* decorationStyle, ArkUI_TextDecorationType* type)

Description

Obtains the decoration type of the text decorative line style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
ArkUI_TextDecorationType* typePointer to the type of the text decorative line. The value is an enumerated value of ArkUI_TextDecorationType.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_DecorationStyle_SetColor()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetColor(OH_ArkUI_DecorationStyle* decorationStyle, uint32_t color)

Description

Sets the decoration color for the text decorative line style.

Since: 24

Parameters

NameDescription
OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
uint32_t colorDecoration color, in 0xARGB format.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_DecorationStyle_GetColor()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetColor(const OH_ArkUI_DecorationStyle* decorationStyle, uint32_t* color)

Description

Obtains the decoration color of the text decorative line style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
uint32_t* colorPointer to the decoration color, in 0xARGB format.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_DecorationStyle_SetTextDecorationStyle()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetTextDecorationStyle(OH_ArkUI_DecorationStyle* decorationStyle, ArkUI_TextDecorationStyle style)

Description

Sets the decoration style for the text decorative line style.

Since: 24

Parameters

NameDescription
OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
ArkUI_TextDecorationStyle styleStyle of the text decorative line. The value is an enumerated value of ArkUI_TextDecorationStyle.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_DecorationStyle_GetTextDecorationStyle()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetTextDecorationStyle(const OH_ArkUI_DecorationStyle* decorationStyle, ArkUI_TextDecorationStyle* style)

Description

Obtains the decoration style of the text decorative line style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
ArkUI_TextDecorationStyle* stylePointer to the style of the text decorative line. The value is an enumerated value of ArkUI_TextDecorationStyle.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_DecorationStyle_SetThicknessScale()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetThicknessScale(OH_ArkUI_DecorationStyle* decorationStyle, float thicknessScale)

Description

Sets the thickness scaling factor of the text decorative line style.

Since: 24

Parameters

NameDescription
OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
float thicknessScaleScaling factor of the decorative line thickness. The value range is [0, +∞).

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_DecorationStyle_GetThicknessScale()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetThicknessScale(const OH_ArkUI_DecorationStyle* decorationStyle, float* thicknessScale)

Description

Obtains the thickness scaling factor of the text decorative line style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
float* thicknessScalePointer to the scaling factor of the decorative line thickness. The value range is [0, +∞).

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_DecorationStyle_SetEnableMultiType()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_SetEnableMultiType(OH_ArkUI_DecorationStyle* decorationStyle, bool enableMultiType)

Description

Sets whether to enable the display of multiple decorative lines in the text decorative line style.

Since: 24

Parameters

NameDescription
OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
bool enableMultiTypeWhether to enable the display of multiple decorative lines. true to enable; false otherwise.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_DecorationStyle_GetEnableMultiType()

ArkUI_ErrorCode OH_ArkUI_DecorationStyle_GetEnableMultiType(const OH_ArkUI_DecorationStyle* decorationStyle, bool* enableMultiType)

Description

Obtains whether the display of multiple decorative lines is enabled in the text decorative line style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_DecorationStyle* decorationStylePointer to the OH_ArkUI_DecorationStyle object.
bool* enableMultiTypePointer to the enableMultiType parameter indicating whether the display of multiple decorative lines is enabled. true means the display is enabled; false otherwise.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_BaselineOffsetStyle_Create()

OH_ArkUI_BaselineOffsetStyle* OH_ArkUI_BaselineOffsetStyle_Create()

Description

Creates an OH_ArkUI_BaselineOffsetStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_BaselineOffsetStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_BaselineOffsetStyle*Pointer to the OH_ArkUI_BaselineOffsetStyle object.

OH_ArkUI_BaselineOffsetStyle_Destroy()

void OH_ArkUI_BaselineOffsetStyle_Destroy(OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle)

Description

Releases the memory occupied by the OH_ArkUI_BaselineOffsetStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_BaselineOffsetStyle* baselineOffsetStylePointer to the OH_ArkUI_BaselineOffsetStyle object.

OH_ArkUI_BaselineOffsetStyle_SetBaselineOffset()

ArkUI_ErrorCode OH_ArkUI_BaselineOffsetStyle_SetBaselineOffset(OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle, float baselineOffset)

Description

Sets the baseline offset.

Since: 24

Parameters

NameDescription
OH_ArkUI_BaselineOffsetStyle* baselineOffsetStylePointer to the OH_ArkUI_BaselineOffsetStyle object.
float baselineOffsetBaseline offset, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_BaselineOffsetStyle_GetBaselineOffset()

ArkUI_ErrorCode OH_ArkUI_BaselineOffsetStyle_GetBaselineOffset(const OH_ArkUI_BaselineOffsetStyle* baselineOffsetStyle, float* baselineOffset)

Description

Obtains the baseline offset.

Since: 24

Parameters

NameDescription
const OH_ArkUI_BaselineOffsetStyle* baselineOffsetStylePointer to the OH_ArkUI_BaselineOffsetStyle object.
float* baselineOffsetPointer to the baseline offset, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LetterSpacingStyle_Create()

OH_ArkUI_LetterSpacingStyle* OH_ArkUI_LetterSpacingStyle_Create()

Description

Creates an OH_ArkUI_LetterSpacingStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_LetterSpacingStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_LetterSpacingStyle*Pointer to the OH_ArkUI_LetterSpacingStyle object.

OH_ArkUI_LetterSpacingStyle_Destroy()

void OH_ArkUI_LetterSpacingStyle_Destroy(OH_ArkUI_LetterSpacingStyle* letterSpacingStyle)

Description

Releases the memory occupied by the OH_ArkUI_LetterSpacingStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_LetterSpacingStyle* letterSpacingStylePointer to the OH_ArkUI_LetterSpacingStyle object.

OH_ArkUI_LetterSpacingStyle_SetLetterSpacing()

ArkUI_ErrorCode OH_ArkUI_LetterSpacingStyle_SetLetterSpacing(OH_ArkUI_LetterSpacingStyle* letterSpacingStyle, float letterSpacing)

Description

Sets the letter spacing.

Since: 24

Parameters

NameDescription
OH_ArkUI_LetterSpacingStyle* letterSpacingStylePointer to the OH_ArkUI_LetterSpacingStyle object.
float letterSpacingLetter spacing value, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LetterSpacingStyle_GetLetterSpacing()

ArkUI_ErrorCode OH_ArkUI_LetterSpacingStyle_GetLetterSpacing(const OH_ArkUI_LetterSpacingStyle* letterSpacingStyle, float* letterSpacing)

Description

Obtains the letter spacing.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LetterSpacingStyle* letterSpacingStylePointer to the OH_ArkUI_LetterSpacingStyle object.
float* letterSpacingPointer to the letter spacing value, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LineHeightStyle_Create()

OH_ArkUI_LineHeightStyle* OH_ArkUI_LineHeightStyle_Create()

Description

Creates an OH_ArkUI_LineHeightStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_LineHeightStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_LineHeightStyle*Pointer to the OH_ArkUI_LineHeightStyle object.

OH_ArkUI_LineHeightStyle_Destroy()

void OH_ArkUI_LineHeightStyle_Destroy(OH_ArkUI_LineHeightStyle* lineHeightStyle)

Description

Releases the memory occupied by the OH_ArkUI_LineHeightStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_LineHeightStyle* lineHeightStylePointer to the OH_ArkUI_LineHeightStyle object.

OH_ArkUI_LineHeightStyle_SetLineHeight()

ArkUI_ErrorCode OH_ArkUI_LineHeightStyle_SetLineHeight(OH_ArkUI_LineHeightStyle* lineHeightStyle, float lineHeight)

Description

Sets the line height.

Since: 24

Parameters

NameDescription
OH_ArkUI_LineHeightStyle* lineHeightStylePointer to the OH_ArkUI_LineHeightStyle object.
float lineHeightFixed line height, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LineHeightStyle_GetLineHeight()

ArkUI_ErrorCode OH_ArkUI_LineHeightStyle_GetLineHeight(const OH_ArkUI_LineHeightStyle* lineHeightStyle, float* lineHeight)

Description

Obtains the line height.

Since: 24

Parameters

NameDescription
const OH_ArkUI_LineHeightStyle* lineHeightStylePointer to the OH_ArkUI_LineHeightStyle object.
float* lineHeightPointer to the fixed line height, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LineHeightStyle_SetLineHeightMultiple()

ArkUI_ErrorCode OH_ArkUI_LineHeightStyle_SetLineHeightMultiple(OH_ArkUI_LineHeightStyle* lineHeightStyle, float lineHeightMultiple)

Description

Sets a line height multiplier.

Since: 26.0.0

Parameters

NameDescription
OH_ArkUI_LineHeightStyle* lineHeightStylePointer to the OH_ArkUI_LineHeightStyle object.
float lineHeightMultipleLine height multiplier. The value range is [0, +∞).

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LineHeightStyle_GetLineHeightMultiple()

ArkUI_ErrorCode OH_ArkUI_LineHeightStyle_GetLineHeightMultiple(const OH_ArkUI_LineHeightStyle* lineHeightStyle, float* lineHeightMultiple)

Description

Obtains the line height multiplier.

Since: 26.0.0

Parameters

NameDescription
const OH_ArkUI_LineHeightStyle* lineHeightStylePointer to the OH_ArkUI_LineHeightStyle object.
float* lineHeightMultiplePointer to the line height multiplier. The value range is [0, +∞).

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_SetLineSpacingStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_SetLineSpacingStyle(OH_ArkUI_SpanStyle* spanStyle, const OH_ArkUI_LineSpacingStyle* lineSpacingStyle)

Description

Sets a line spacing style for the styled string style object.

NOTE

This operation will replace other styles that have been set in the OH_ArkUI_SpanStyle object.

Since: 26.0.0

Parameters

NameDescription
OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
const OH_ArkUI_LineSpacingStyle* lineSpacingStylePointer to the OH_ArkUI_LineSpacingStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_SpanStyle_GetLineSpacingStyle()

ArkUI_ErrorCode OH_ArkUI_SpanStyle_GetLineSpacingStyle(const OH_ArkUI_SpanStyle* spanStyle, OH_ArkUI_LineSpacingStyle* lineSpacingStyle)

Description

Obtains the line spacing style of the styled string style object.

Since: 26.0.0

Parameters

NameDescription
const OH_ArkUI_SpanStyle* spanStylePointer to the OH_ArkUI_SpanStyle object.
OH_ArkUI_LineSpacingStyle* lineSpacingStylePointer to the OH_ArkUI_LineSpacingStyle object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LineSpacingStyle_Create()

OH_ArkUI_LineSpacingStyle* OH_ArkUI_LineSpacingStyle_Create()

Description

Creates an OH_ArkUI_LineSpacingStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_LineSpacingStyle_Destroy to destroy it in a timely manner.

Since: 26.0.0

Return value

TypeDescription
OH_ArkUI_LineSpacingStyle*Pointer to the OH_ArkUI_LineSpacingStyle object.

OH_ArkUI_LineSpacingStyle_Destroy()

void OH_ArkUI_LineSpacingStyle_Destroy(OH_ArkUI_LineSpacingStyle* lineSpacingStyle)

Description

Releases the memory occupied by the OH_ArkUI_LineSpacingStyle object.

Since: 26.0.0

Parameters

NameDescription
OH_ArkUI_LineSpacingStyle* lineSpacingStylePointer to the OH_ArkUI_LineSpacingStyle object.

OH_ArkUI_LineSpacingStyle_SetLineSpacing()

ArkUI_ErrorCode OH_ArkUI_LineSpacingStyle_SetLineSpacing(OH_ArkUI_LineSpacingStyle* lineSpacingStyle, float lineSpacing)

Description

Sets line spacing.

Since: 26.0.0

Parameters

NameDescription
OH_ArkUI_LineSpacingStyle* lineSpacingStylePointer to the OH_ArkUI_LineSpacingStyle object.
float lineSpacingLine spacing value, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LineSpacingStyle_GetLineSpacing()

ArkUI_ErrorCode OH_ArkUI_LineSpacingStyle_GetLineSpacing(const OH_ArkUI_LineSpacingStyle* lineSpacingStyle, float* lineSpacing)

Description

Queries the line spacing.

Since: 26.0.0

Parameters

NameDescription
const OH_ArkUI_LineSpacingStyle* lineSpacingStylePointer to the OH_ArkUI_LineSpacingStyle object.
float* lineSpacingPointer to the line spacing value, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LineSpacingStyle_SetOnlyBetweenLines()

ArkUI_ErrorCode OH_ArkUI_LineSpacingStyle_SetOnlyBetweenLines(OH_ArkUI_LineSpacingStyle* lineSpacingStyle, bool onlyBetweenLines)

Description

Sets whether the line spacing takes effect only between lines.

Since: 26.0.0

Parameters

NameDescription
OH_ArkUI_LineSpacingStyle* lineSpacingStylePointer to the OH_ArkUI_LineSpacingStyle object.
bool onlyBetweenLinesWhether the line spacing takes effect only between lines. true indicates that the spacing is added only between lines, and no extra spacing is added above the first line or below the last line. false indicates that the complete line spacing is added between all lines, above the first line, and below the last line.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_LineSpacingStyle_GetOnlyBetweenLines()

ArkUI_ErrorCode OH_ArkUI_LineSpacingStyle_GetOnlyBetweenLines(const OH_ArkUI_LineSpacingStyle* lineSpacingStyle, bool* onlyBetweenLines)

Description

Checks whether the line spacing takes effect only between lines.

Since: 26.0.0

Parameters

NameDescription
const OH_ArkUI_LineSpacingStyle* lineSpacingStylePointer to the OH_ArkUI_LineSpacingStyle object.
bool* onlyBetweenLinesPointer to the onlyBetweenLines parameter indicating whether the line spacing takes effect only between lines. true indicates that the spacing is added only between lines, and no extra spacing is added above the first line or below the last line. false indicates that the complete line spacing is added between all lines, above the first line, and below the last line.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_BackgroundColorStyle_Create()

OH_ArkUI_BackgroundColorStyle* OH_ArkUI_BackgroundColorStyle_Create()

Description

Creates an OH_ArkUI_BackgroundColorStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_BackgroundColorStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_BackgroundColorStyle*Pointer to the OH_ArkUI_BackgroundColorStyle object.

OH_ArkUI_BackgroundColorStyle_Destroy()

void OH_ArkUI_BackgroundColorStyle_Destroy(OH_ArkUI_BackgroundColorStyle* style)

Description

Releases the memory occupied by the OH_ArkUI_BackgroundColorStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_BackgroundColorStyle* stylePointer to the OH_ArkUI_BackgroundColorStyle object.

OH_ArkUI_BackgroundColorStyle_SetColor()

ArkUI_ErrorCode OH_ArkUI_BackgroundColorStyle_SetColor(OH_ArkUI_BackgroundColorStyle* style, uint32_t color)

Description

Sets the background color for the background color style.

Since: 24

Parameters

NameDescription
OH_ArkUI_BackgroundColorStyle* stylePointer to the OH_ArkUI_BackgroundColorStyle object.
uint32_t colorBackground color, in 0xARGB format.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_BackgroundColorStyle_GetColor()

ArkUI_ErrorCode OH_ArkUI_BackgroundColorStyle_GetColor(const OH_ArkUI_BackgroundColorStyle* style, uint32_t* color)

Description

Obtains the background color of the background color style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_BackgroundColorStyle* stylePointer to the OH_ArkUI_BackgroundColorStyle object.
uint32_t* colorPointer to the background color, in 0xARGB format.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_BackgroundColorStyle_SetRadius()

ArkUI_ErrorCode OH_ArkUI_BackgroundColorStyle_SetRadius(OH_ArkUI_BackgroundColorStyle* style, float topLeft, float topRight, float bottomLeft, float bottomRight)

Description

Sets the background radii for the background color style.

Since: 24

Parameters

NameDescription
OH_ArkUI_BackgroundColorStyle* stylePointer to the OH_ArkUI_BackgroundColorStyle object.
float topLeftRadius of the upper left corner, in vp.
float topRightRadius of the upper right corner, in vp.
float bottomLeftRadius of the lower left corner, in vp.
float bottomRightRadius of the lower right corner, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_BackgroundColorStyle_GetRadius()

ArkUI_ErrorCode OH_ArkUI_BackgroundColorStyle_GetRadius(const OH_ArkUI_BackgroundColorStyle* style, float* topLeft, float* topRight, float* bottomLeft, float* bottomRight)

Description

Obtains the background radii of the background color style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_BackgroundColorStyle* stylePointer to the OH_ArkUI_BackgroundColorStyle object.
float* topLeftPointer to the radius of the upper left corner, in vp.
float* topRightPointer to the radius of the upper right corner, in vp.
float* bottomLeftPointer to the radius of the lower left corner, in vp.
float* bottomRightPointer to the radius of the lower right corner, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_UrlStyle_Create()

OH_ArkUI_UrlStyle* OH_ArkUI_UrlStyle_Create()

Description

Creates an OH_ArkUI_UrlStyle object.

NOTE

When the object is no longer used, call OH_ArkUI_UrlStyle_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_UrlStyle*Pointer to the OH_ArkUI_UrlStyle object.

OH_ArkUI_UrlStyle_Destroy()

void OH_ArkUI_UrlStyle_Destroy(OH_ArkUI_UrlStyle* style)

Description

Releases the memory occupied by the OH_ArkUI_UrlStyle object.

Since: 24

Parameters

NameDescription
OH_ArkUI_UrlStyle* stylePointer to the OH_ArkUI_UrlStyle object.

OH_ArkUI_UrlStyle_SetUrl()

ArkUI_ErrorCode OH_ArkUI_UrlStyle_SetUrl(OH_ArkUI_UrlStyle* style, const char* url)

Description

Sets the URL content for the URL style.

Since: 24

Parameters

NameDescription
OH_ArkUI_UrlStyle* stylePointer to the OH_ArkUI_UrlStyle object.
const char* urlPointer to the URL content.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_UrlStyle_GetUrl()

ArkUI_ErrorCode OH_ArkUI_UrlStyle_GetUrl(const OH_ArkUI_UrlStyle* style, char* buffer, int32_t bufferSize, int32_t* writeLength)

Description

Obtains the URL content of the URL style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_UrlStyle* stylePointer to the OH_ArkUI_UrlStyle object.
char* bufferPointer to the buffer for storing the URL content in the memory. You need to allocate the memory.
int32_t bufferSizeMaximum number of characters that can be written to the buffer.
int32_t* writeLengthPointer to the number of characters that are actually written to the buffer if ARKUI_ERROR_CODE_NO_ERROR is returned.
Pointer to the minimum length required for writing the entire string to the buffer if ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR is returned.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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 buffer size is insufficient.

OH_ArkUI_UserDataSpan_Create()

OH_ArkUI_UserDataSpan* OH_ArkUI_UserDataSpan_Create()

Description

Creates an OH_ArkUI_UserDataSpan object.

NOTE

When the object is no longer used, call OH_ArkUI_UserDataSpan_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_UserDataSpan*Pointer to the OH_ArkUI_UserDataSpan object.

OH_ArkUI_UserDataSpan_Destroy()

void OH_ArkUI_UserDataSpan_Destroy(OH_ArkUI_UserDataSpan* userDataSpan)

Description

Releases the memory occupied by the OH_ArkUI_UserDataSpan object.

Since: 24

Parameters

NameDescription
OH_ArkUI_UserDataSpan* userDataSpanPointer to the OH_ArkUI_UserDataSpan object.

OH_ArkUI_UserDataSpan_SetUserData()

ArkUI_ErrorCode OH_ArkUI_UserDataSpan_SetUserData(OH_ArkUI_UserDataSpan* userDataSpan, void* userData)

Description

Sets the user data in the user data span style.

NOTE

This API allows you to associate custom data of any type with the current style object, in order to store user data in the styled string.

Since: 24

Parameters

NameDescription
OH_ArkUI_UserDataSpan* userDataSpanPointer to the OH_ArkUI_UserDataSpan object.
void* userDataPointer to the user data. You need to manage the data lifecycle.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_UserDataSpan_GetUserData()

ArkUI_ErrorCode OH_ArkUI_UserDataSpan_GetUserData(const OH_ArkUI_UserDataSpan* userDataSpan, void** userData)

Description

Obtains the user data in the user data span style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_UserDataSpan* userDataSpanPointer to the OH_ArkUI_UserDataSpan object.
void** userDataDouble pointer to the user data.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_CustomSpan_Create()

OH_ArkUI_CustomSpan* OH_ArkUI_CustomSpan_Create()

Description

Creates an OH_ArkUI_CustomSpan object.

NOTE

When the object is no longer used, call OH_ArkUI_CustomSpan_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_CustomSpan*Pointer to the OH_ArkUI_CustomSpan object.

OH_ArkUI_CustomSpan_Destroy()

void OH_ArkUI_CustomSpan_Destroy(OH_ArkUI_CustomSpan* customSpan)

Description

Releases the memory occupied by the OH_ArkUI_CustomSpan object.

Since: 24

Parameters

NameDescription
OH_ArkUI_CustomSpan* customSpanPointer to the OH_ArkUI_CustomSpan object.

OH_ArkUI_CustomSpan_RegisterOnMeasureCallback()

ArkUI_ErrorCode OH_ArkUI_CustomSpan_RegisterOnMeasureCallback(OH_ArkUI_CustomSpan* customSpan, ArkUI_CustomSpanMetrics*(*onMeasure)(float))

Description

Sets the callback function triggered when metrics are obtained for the custom span.

Since: 24

Parameters

NameDescription
OH_ArkUI_CustomSpan* customSpanPointer to the OH_ArkUI_CustomSpan object.
ArkUI_CustomSpanMetrics*(*onMeasure)(float)Pointer to the callback function used to obtain the metrics. fontSize indicates the font size of the text in the component, in fp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_CustomSpan_RegisterOnDrawCallback()

ArkUI_ErrorCode OH_ArkUI_CustomSpan_RegisterOnDrawCallback(OH_ArkUI_CustomSpan* customSpan, void(*onDraw)(ArkUI_DrawContext*, ArkUI_CustomSpanDrawInfo*))

Description

Registers the callback function triggered when the custom span is drawn.

Since: 24

Parameters

NameDescription
OH_ArkUI_CustomSpan* customSpanPointer to the OH_ArkUI_CustomSpan object.
void(*onDraw)(ArkUI_DrawContext*Callback function triggered during drawing. context indicates the graphics drawing context. drawInfo indicates the drawing information of the custom span.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_Create()

OH_ArkUI_ImageAttachment* OH_ArkUI_ImageAttachment_Create()

Description

Creates an OH_ArkUI_ImageAttachment object.

NOTE

When the object is no longer used, call OH_ArkUI_ImageAttachment_Destroy to destroy it.

Since: 24

Return value

TypeDescription
OH_ArkUI_ImageAttachment*Pointer to the OH_ArkUI_ImageAttachment object.

OH_ArkUI_ImageAttachment_Destroy()

void OH_ArkUI_ImageAttachment_Destroy(OH_ArkUI_ImageAttachment* imageAttachment)

Description

Releases the memory occupied by the OH_ArkUI_ImageAttachment object.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.

OH_ArkUI_ImageAttachment_SetPixelMap()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetPixelMap(OH_ArkUI_ImageAttachment* imageAttachment, struct OH_PixelmapNative* pixelmap)

Description

Sets the image data source in the image style.

NOTE

If both this API and OH_ArkUI_ImageAttachment_SetResource are set, the API set later takes effect.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
struct OH_PixelmapNative* pixelmapPointer to the image data source.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetPixelMap()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetPixelMap(const OH_ArkUI_ImageAttachment* imageAttachment, struct OH_PixelmapNative** pixelmap)

Description

Obtains the image data source in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
struct OH_PixelmapNative** pixelmapDouble pointer to the image data source.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetResource()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetResource(OH_ArkUI_ImageAttachment* imageAttachment, const char* resource)

Description

Sets the image resource address in the image style.

NOTE

If both this API and OH_ArkUI_ImageAttachment_SetPixelMap are set, the API set later takes effect.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
const char* resourcePointer to the image resource address.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetResource()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetResource(const OH_ArkUI_ImageAttachment* imageAttachment, char* buffer, int32_t bufferSize, int32_t* writeLength)

Description

Obtains the image resource address in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
char* bufferPointer to the buffer for storing the image resource address string in the memory. You need to allocate the memory.
int32_t bufferSizeBuffer size.
int32_t* writeLengthPointer to the length of the string actually written to the buffer if ARKUI_ERROR_CODE_NO_ERROR is returned.
Pointer to the minimum length required for writing the entire string to the buffer if ARKUI_ERROR_CODE_BUFFER_SIZE_ERROR is returned.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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 buffer size is insufficient.

OH_ArkUI_ImageAttachment_SetSizeWidth()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetSizeWidth(OH_ArkUI_ImageAttachment* imageAttachment, float width)

Description

Sets the image width in the image style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
float widthImage width, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetSizeWidth()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetSizeWidth(const OH_ArkUI_ImageAttachment* imageAttachment, float* width)

Description

Obtains the image width in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
float* widthPointer to the image width, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetSizeHeight()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetSizeHeight(OH_ArkUI_ImageAttachment* imageAttachment, float height)

Description

Sets the image height in the image style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
float heightImage height, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetSizeHeight()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetSizeHeight(const OH_ArkUI_ImageAttachment* imageAttachment, float* height)

Description

Obtains the image height in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
float* heightPointer to the image height, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetVerticalAlign()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetVerticalAlign(OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_ImageSpanAlignment verticalAlign)

Description

Sets the image alignment method in the image style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
ArkUI_ImageSpanAlignment verticalAlignImage alignment method. The value is an enumerated value of ArkUI_ImageSpanAlignment.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetVerticalAlign()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetVerticalAlign(const OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_ImageSpanAlignment* verticalAlign)

Description

Obtains the image alignment method in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
ArkUI_ImageSpanAlignment* verticalAlignPointer to the image alignment method. The value is an enumerated value of ArkUI_ImageSpanAlignment.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetObjectFit()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetObjectFit(OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_ObjectFit objectFit)

Description

Sets the image scaling type in the image style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
ArkUI_ObjectFit objectFitImage scaling type. The value is an enumerated value of ArkUI_ObjectFit.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetObjectFit()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetObjectFit(const OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_ObjectFit* objectFit)

Description

Obtains the image scaling type in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
ArkUI_ObjectFit* objectFitPointer to the image scaling type. The value is an enumerated value of ArkUI_ObjectFit.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetMargin()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetMargin(OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_Margin margin)

Description

Sets the image margin in the image style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
ArkUI_Margin marginImage margin, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetMargin()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetMargin(const OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_Margin* margin)

Description

Obtains the image margin in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
ArkUI_Margin* marginPointer to the image margin, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetPadding()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetPadding(OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_Margin padding)

Description

Sets the image padding in the image style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
ArkUI_Margin paddingImage padding, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetPadding()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetPadding(const OH_ArkUI_ImageAttachment* imageAttachment, ArkUI_Margin* padding)

Description

Obtains the image padding in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
ArkUI_Margin* paddingPointer to the image padding, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetBorderRadiuses()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetBorderRadiuses(OH_ArkUI_ImageAttachment* imageAttachment, float topLeft, float topRight, float bottomLeft, float bottomRight)

Description

Sets the image border radii in the image style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
float topLeftRadius of the upper left corner, in vp.
float topRightRadius of the upper right corner, in vp.
float bottomLeftRadius of the lower left corner, in vp.
float bottomRightRadius of the lower right corner, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetBorderRadiuses()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetBorderRadiuses(const OH_ArkUI_ImageAttachment* imageAttachment, float* topLeft, float* topRight, float* bottomLeft, float* bottomRight)

Description

Obtains the image border radii in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
float* topLeftPointer to the radius of the upper left corner, in vp.
float* topRightPointer to the radius of the upper right corner, in vp.
float* bottomLeftPointer to the radius of the lower left corner, in vp.
float* bottomRightPointer to the radius of the lower right corner, in vp.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetColorFilter()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetColorFilter(OH_ArkUI_ImageAttachment* imageAttachment, const float* colorFilter, uint32_t size)

Description

Sets the image color filter in the image style.

NOTE

If both this API and OH_ArkUI_ImageAttachment_SetDrawingColorFilter are set, the API set later takes effect.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
const float* colorFilterPointer to the image color filter.
uint32_t sizeSize of the filter array.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetColorFilter()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetColorFilter(const OH_ArkUI_ImageAttachment* imageAttachment, float** colorFilter, uint32_t colorFilterSize, uint32_t* writeLength)

Description

Obtains the image color filter in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
float** colorFilterDouble pointer to the buffer for storing the image color filter in the memory. You need to allocate the memory.
uint32_t colorFilterSizeBuffer size.
uint32_t* writeLengthPointer to the actual size of the image color filter array.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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 buffer size is insufficient.

OH_ArkUI_ImageAttachment_SetDrawingColorFilter()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetDrawingColorFilter(OH_ArkUI_ImageAttachment* imageAttachment, const OH_Drawing_ColorFilter* drawingColorFilter)

Description

Sets the image drawing color filter in the image style.

NOTE

If both this API and OH_ArkUI_ImageAttachment_SetColorFilter are set, the API set later takes effect.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
const OH_Drawing_ColorFilter* drawingColorFilterPointer to the image drawing color filter.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetDrawingColorFilter()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetDrawingColorFilter(const OH_ArkUI_ImageAttachment* imageAttachment, OH_Drawing_ColorFilter* drawingColorFilter)

Description

Obtains the image drawing color filter in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
OH_Drawing_ColorFilter* drawingColorFilterPointer to the image drawing color filter.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetSyncLoad()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetSyncLoad(OH_ArkUI_ImageAttachment* imageAttachment, bool syncLoad)

Description

Sets whether to load the image synchronously in the image style.

NOTE

This attribute is valid only when the image source is set to a resource address using OH_ArkUI_ImageAttachment_SetResource.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
bool syncLoadWhether to load images synchronously. true to load synchronously; false to load asynchronously.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetSyncLoad()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetSyncLoad(const OH_ArkUI_ImageAttachment* imageAttachment, bool* syncLoad)

Description

Obtains whether the image is loaded synchronously in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
bool* syncLoadPointer to the syncLoad parameter indicating whether the image is loaded synchronously. true indicates that the image is loaded synchronously; false indicates that the image is loaded asynchronously.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_SetSupportSvg()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_SetSupportSvg(OH_ArkUI_ImageAttachment* imageAttachment, bool supportSvg)

Description

Sets whether to enable the enhanced SVG tag parsing feature in the image style.

Since: 24

Parameters

NameDescription
OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
bool supportSvgWhether to enable the enhanced SVG tag parsing feature. true to enable, false otherwise.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_ImageAttachment_GetSupportSvg()

ArkUI_ErrorCode OH_ArkUI_ImageAttachment_GetSupportSvg(const OH_ArkUI_ImageAttachment* imageAttachment, bool* supportSvg)

Description

Obtains whether the enhanced SVG tag parsing feature is enabled in the image style.

Since: 24

Parameters

NameDescription
const OH_ArkUI_ImageAttachment* imageAttachmentPointer to the OH_ArkUI_ImageAttachment object.
bool* supportSvgPointer to the supportSvg parameter indicating whether the enhanced SVG tag parsing feature is enabled. true means the enhanced SVG tag parsing feature is enabled, and false means the opposite.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextEditorChangeEvent_GetRangeBefore()

ArkUI_ErrorCode OH_ArkUI_TextEditorChangeEvent_GetRangeBefore(const OH_ArkUI_TextEditorChangeEvent* event, uint32_t* start, uint32_t* end)

Description

Obtains the range of the content to be replaced in the text change information.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextEditorChangeEvent* eventPointer to the OH_ArkUI_TextEditorChangeEvent object.
uint32_t* startPointer to the start index of the range of the content to be replaced.
uint32_t* endPointer to the end index of the range of the content to be replaced.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextEditorChangeEvent_GetReplacementStyledString()

ArkUI_ErrorCode OH_ArkUI_TextEditorChangeEvent_GetReplacementStyledString(const OH_ArkUI_TextEditorChangeEvent* event, ArkUI_StyledString_Descriptor* descriptor)

Description

Obtains the styled string used for replacement in the text change information.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextEditorChangeEvent* eventPointer to the OH_ArkUI_TextEditorChangeEvent object.
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextEditorChangeEvent_GetPreviewStyledString()

ArkUI_ErrorCode OH_ArkUI_TextEditorChangeEvent_GetPreviewStyledString(const OH_ArkUI_TextEditorChangeEvent* event, ArkUI_StyledString_Descriptor* descriptor)

Description

Obtains the styled string of the previewed content in the text change information.

Since: 24

Parameters

NameDescription
const OH_ArkUI_TextEditorChangeEvent* eventPointer to the OH_ArkUI_TextEditorChangeEvent object.
ArkUI_StyledString_Descriptor* descriptorPointer to the ArkUI_StyledString_Descriptor object.

Return value

TypeDescription
ArkUI_ErrorCodeResult 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_TextLayoutManager_Dispose()

void OH_ArkUI_TextLayoutManager_Dispose(ArkUI_TextLayoutManager* layoutManager)

Description

Releases the memory occupied by the text layout manager.

Since: 22

Parameters

NameDescription
ArkUI_TextLayoutManager* layoutManagerPointer to the ArkUI_TextLayoutManager object.

OH_ArkUI_TextLayoutManager_GetLineCount()

ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetLineCount(ArkUI_TextLayoutManager* layoutManager, int32_t* outLineCount)

Description

Obtains the number of lines.

Since: 22

Parameters

NameDescription
ArkUI_TextLayoutManager* layoutManagerPointer to the ArkUI_TextLayoutManager object.
int32_t* outLineCountPointer to the number of text lines.

Return value

TypeDescription
ArkUI_ErrorCodeReturn 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_TextLayoutManager_GetRectsForRange()

ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetRectsForRange(ArkUI_TextLayoutManager* layoutManager, int32_t start, int32_t end, OH_Drawing_RectWidthStyle widthStyle, OH_Drawing_RectHeightStyle heightStyle, OH_Drawing_TextBox** outTextBoxes)

Description

Obtains the drawing area information of characters or placeholders within a specified text range under the given rectangle width and height.

Since: 22

Parameters

NameDescription
ArkUI_TextLayoutManager* layoutManagerPointer to the ArkUI_TextLayoutManager object.
int32_t startStart index. The value of start must be greater than or equal to 0. Otherwise, a parameter error is returned.
int32_t endEnd index. The value of end must be greater than or equal to that of start. Otherwise, a parameter error is returned.
OH_Drawing_RectWidthStyle widthStyleWidth style of the rectangle.
OH_Drawing_RectHeightStyle heightStyleHeight style of the rectangle.
OH_Drawing_TextBox** outTextBoxesLevel-2 pointer to the OH_Drawing_TextBox object.

Return value

TypeDescription
ArkUI_ErrorCodeReturn 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_TextLayoutManager_GetGlyphPositionAtCoordinate()

ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetGlyphPositionAtCoordinate(ArkUI_TextLayoutManager* layoutManager, double dx, double dy, OH_Drawing_PositionAndAffinity** outPos)

Description

Obtains the position of the glyph closest to the given coordinates.

Since: 22

Parameters

NameDescription
ArkUI_TextLayoutManager* layoutManagerPointer to the ArkUI_TextLayoutManager object.
double dxX coordinate relative to the control, in px.
double dyY coordinate relative to the control, in px.
OH_Drawing_PositionAndAffinity** outPosLevel-2 pointer to the OH_Drawing_PositionAndAffinity object.

Return value

TypeDescription
ArkUI_ErrorCodeReturn 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_TextLayoutManager_GetLineMetrics()

ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetLineMetrics(ArkUI_TextLayoutManager* layoutManager, int32_t lineNumber, OH_Drawing_LineMetrics* outMetrics)

Description

Obtains the information about the specified line, including line metrics, text style information, and font properties.

Since: 22

Parameters

NameDescription
ArkUI_TextLayoutManager* layoutManagerPointer to the ArkUI_TextLayoutManager object.
int32_t lineNumberIndex of the line number. It starts from 0. If the value of lineNumber is less than 0 or greater than or equal to the number of text lines, a parameter error is returned.
OH_Drawing_LineMetrics* outMetricsPointer to the OH_Drawing_LineMetrics object.

Return value

TypeDescription
ArkUI_ErrorCodeReturn 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_TextLayoutManager_GetCharacterPositionAtCoordinate()

ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetCharacterPositionAtCoordinate(ArkUI_TextLayoutManager* layoutManager, double dx, double dy, OH_Drawing_PositionAndAffinity** outPos)

Description

Obtains the position of the character closest to the specified control.

Since: 24

Parameters

NameDescription
ArkUI_TextLayoutManager* layoutManagerPointer to the ArkUI_TextLayoutManager object.
double dxX coordinate relative to the control, in px.
double dyY coordinate relative to the control, in px.
OH_Drawing_PositionAndAffinity** outPosLevel-2 pointer to the OH_Drawing_PositionAndAffinity object.

Return value

TypeDescription
ArkUI_ErrorCodeReturn 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_TextLayoutManager_GetGlyphRangeForCharacterRange()

ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetGlyphRangeForCharacterRange(ArkUI_TextLayoutManager* layoutManager, OH_Drawing_Range* charRange, OH_Drawing_Range** outGlyphRange,
OH_Drawing_Range** outActualCharRange);

Description

Obtains the glyph index range generated by the specified character index range and the actual character index range. If the first glyph is a Chinese character, the glyph index range of the character is [0, 1]. A Chinese character occupies three characters, so the corresponding character index range is [0, 3]. If the specified character index range is [0, 1], one third of a Chinese character cannot be parsed, so the actual character index range is [0, 3]. After the OH_Drawing_Range objects returned by outGlyphRange and outActualCharRange are used, you need to release them by calling OH_Drawing_ReleaseRangeBuffer.

Since: 24

Parameters

NameDescription
ArkUI_TextLayoutManager* layoutManagerPointer to the ArkUI_TextLayoutManager object.
OH_Drawing_Range* charRangePointer to the OH_Drawing_Range object, indicating the character index range.
OH_Drawing_Range** outGlyphRangeLevel-2 pointer to the OH_Drawing_Range object, indicating the glyph index range.
OH_Drawing_Range** outActualCharRangeLevel-2 pointer to the OH_Drawing_Range object, indicating the actual character index range.

Return value

TypeDescription
ArkUI_ErrorCodeReturn 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_TextLayoutManager_GetCharacterRangeForGlyphRange()

ArkUI_ErrorCode OH_ArkUI_TextLayoutManager_GetCharacterRangeForGlyphRange(ArkUI_TextLayoutManager* layoutManager, OH_Drawing_Range* glyphRange, OH_Drawing_Range** outCharRange,
OH_Drawing_Range** outActualGlyphRange)

Description

Obtains the character index range generated by the specified glyph index range and the actual glyph index range. If a text contains two Chinese characters and five letters, the glyph index range of the text is [0, 7]. A Chinese character occupies three characters, so the corresponding character index range is [0, 11]. If the specified index range is [0, 11], but there are only seven glyphs, the actual glyph index range is [0, 7]. After the OH_Drawing_Range objects returned by outCharRange and outActualGlyphRange are used, you need to release them by calling OH_Drawing_ReleaseRangeBuffer.

Since: 24

Parameters

NameDescription
ArkUI_TextLayoutManager* layoutManagerPointer to the ArkUI_TextLayoutManager object.
OH_Drawing_Range* glyphRangePointer to the OH_Drawing_Range object, indicating the glyph index range.
OH_Drawing_Range** outCharRangeLevel-2 pointer to the OH_Drawing_Range object, indicating the character index range.
OH_Drawing_Range** outActualGlyphRangeLevel-2 pointer to the OH_Drawing_Range object, indicating the actual glyph index range.

Return value

TypeDescription
ArkUI_ErrorCodeReturn result.
Returns ARKUI_ERROR_CODE_NO_ERROR if the operation is successful.
Returns ARKUI_ERROR_CODE_PARAM_INVALID if a parameter error occurs.

你可能感兴趣的鸿蒙文章

openharmony 鸿蒙 arkts-apis-uicontext-contextmenucontroller

openharmony 鸿蒙 errorcode-canvas

openharmony 鸿蒙 capi-oh-nativexcomponent-native-xcomponent-oh-nativexcomponent

openharmony 鸿蒙 errorcode-bindSheet

openharmony 鸿蒙 js-apis-arkui-uiExtension-sys

openharmony 鸿蒙 capi-arkui-accessibility-arkui-accessibilityeventinfo

openharmony 鸿蒙 capi-arkui-rendernodeutils

openharmony 鸿蒙 js-apis-arkui-node

openharmony 鸿蒙 capi-native-node-h

openharmony 鸿蒙 capi-arkui-nativemodule-arkui-listitemswipeactionitem

  • 所属分类: 后端技术
  • 本文标签: 软件 鸿蒙
  • 版权声明: 本文链接 https://seaxiang.com/blog/HI1U8tGu