harmony 鸿蒙styled_string.h

2025-06-12 浏览 (1)

styled_string.h

Overview

Provides styled string APIs of ArkUI on the native side.

Library: libace_ndk.z.so

File to include: <arkui/styled_string.h>

System capability: SystemCapability.ArkUI.ArkUI.Full

Since: 12

Related module: ArkUI_NativeModule

Summary

Types

NameDescription
typedef struct ArkUI_StyledString ArkUI_StyledStringDefines a styled string object supported by the text component.

Functions

NameDescription
ArkUI_StyledString * OH_ArkUI_StyledString_Create (OH_Drawing_TypographyStyle *style, OH_Drawing_FontCollection *collection)Creates an 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 an OH_Drawing_Typography object based on an ArkUI_StyledString object.
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)Destroys an ArkUI_StyledString_Descriptor object and reclaims the memory occupied by the object.
int32_t OH_ArkUI_UnmarshallStyledStringDescriptor (uint8_t *buffer, size_t bufferSize, ArkUI_StyledString_Descriptor *descriptor, size_t *resultSize)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)Marshals the styled string information into a byte array.
const char * OH_ArkUI_ConvertToHtml (ArkUI_StyledString_Descriptor *descriptor)Converts styled string information into HTML.

你可能感兴趣的鸿蒙文章

harmony 鸿蒙ArkUI

harmony 鸿蒙ARKUI_TextPickerCascadeRangeContent

harmony 鸿蒙ARKUI_TextPickerRangeContent

harmony 鸿蒙ArkUI_AnimateCompleteCallback

harmony 鸿蒙ArkUI_AttributeItem

harmony 鸿蒙ArkUI_ColorStop

harmony 鸿蒙ArkUI_ContextCallback

harmony 鸿蒙ArkUI_EventModule

harmony 鸿蒙ArkUI_ExpectedFrameRateRange

harmony 鸿蒙ArkUI_IntOffset

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