属性字符串与html的序列化和反序列化接口

Signed-off-by: zyx0121 <zhangyingxiang2@huawei.com>
This commit is contained in:
zyx0121 2024-09-29 17:03:07 +08:00
parent 0590010269
commit 61fea1df60
3 changed files with 50 additions and 0 deletions

View File

@ -2362,5 +2362,17 @@
{
"first_introduced": "13",
"name": "OH_ArkUI_AccessibilityElementInfoSetElementId"
},
{
"first_introduced": "14",
"name": "OH_ArkUI_StyledString_Descriptor_Create"
},
{
"first_introduced": "14",
"name": "OH_ArkUI_StyledString_Descriptor_Destroy"
},
{
"first_introduced": "14",
"name": "OH_ArkUI_ConvertToHtml"
}
]

View File

@ -136,6 +136,13 @@ typedef struct ArkUI_Context* ArkUI_ContextHandle;
*/
typedef struct ArkUI_SwiperIndicator ArkUI_SwiperIndicator;
/**
* @brief Define the data objects of styled string supported by text components.
*
* @since 14
*/
typedef struct ArkUI_StyledString_Descriptor ArkUI_StyledString_Descriptor;
/**
* @brief specifies the alignment rules for subcomponents set in relative containers.
*
@ -1911,6 +1918,11 @@ typedef enum {
ARKUI_ERROR_CODE_NON_SCROLLABLE_CONTAINER = 180001,
/** The buffer is not large enough. */
ARKUI_ERROR_CODE_BUFFER_SIZE_NOT_ENOUGH = 180002,
/**
* @error invalid styled string.
* @since 14
*/
ARKUI_ERROR_CODE_INVALID_STYLED_STRING = 180101,
} ArkUI_ErrorCode;
/**

View File

@ -39,6 +39,7 @@
#include "native_drawing/drawing_text_declaration.h"
#include "native_drawing/drawing_text_typography.h"
#include "native_type.h"
#ifdef __cplusplus
extern "C" {
@ -118,6 +119,31 @@ OH_Drawing_Typography* OH_ArkUI_StyledString_CreateTypography(ArkUI_StyledString
*/
void OH_ArkUI_StyledString_AddPlaceholder(ArkUI_StyledString* handle, OH_Drawing_PlaceholderSpan* placeholder);
/**
* @brief Create a ArkUI_StyledString_Descriptor object.
*
* @return Pointer to the ArkUI_StyledString_Descriptor object.
* @since 14
*/
ArkUI_StyledString_Descriptor* OH_ArkUI_StyledString_Descriptor_Create();
/**
* @brief Release the memory occupied by the ArkUI_StyledString_Descriptor object.
*
* @param str Pointer to the ArkUI_StyledString_Descriptor object.
* @since 14
*/
void OH_ArkUI_StyledString_Descriptor_Destroy(ArkUI_StyledString_Descriptor* str);
/**
* @brief Convert the styled string into html.
*
* @param str Pointer to the ArkUI_StyledString_Descriptor object.
* @return The converted html.
* @since 14
*/
const char* OH_ArkUI_ConvertToHtml(ArkUI_StyledString_Descriptor* str);
#ifdef __cplusplus
};
#endif