1e41f4b71Sopenharmony_ci# uds.h 2e41f4b71Sopenharmony_ci 3e41f4b71Sopenharmony_ci 4e41f4b71Sopenharmony_ci## Overview 5e41f4b71Sopenharmony_ci 6e41f4b71Sopenharmony_ciDefines the APIs and structs related to the uniform data structs. 7e41f4b71Sopenharmony_ci 8e41f4b71Sopenharmony_ci**File to include**: <database/udmf/uds.h> 9e41f4b71Sopenharmony_ci 10e41f4b71Sopenharmony_ci**Library**: libudmf.so 11e41f4b71Sopenharmony_ci 12e41f4b71Sopenharmony_ci**System capability**: SystemCapability.DistributedDataManager.UDMF.Core 13e41f4b71Sopenharmony_ci 14e41f4b71Sopenharmony_ci**Since**: 12 15e41f4b71Sopenharmony_ci 16e41f4b71Sopenharmony_ci**Related module**: [UDMF](_u_d_m_f.md) 17e41f4b71Sopenharmony_ci 18e41f4b71Sopenharmony_ci 19e41f4b71Sopenharmony_ci## Summary 20e41f4b71Sopenharmony_ci 21e41f4b71Sopenharmony_ci 22e41f4b71Sopenharmony_ci### Types 23e41f4b71Sopenharmony_ci 24e41f4b71Sopenharmony_ci| Name| Description| 25e41f4b71Sopenharmony_ci| -------- | -------- | 26e41f4b71Sopenharmony_ci| typedef struct [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) | Defines a struct for the uniform data of the plain text type.| 27e41f4b71Sopenharmony_ci| typedef struct [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) | Defines a struct for the uniform data of the hyperlink type.| 28e41f4b71Sopenharmony_ci| typedef struct [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) | Defines a struct for the uniform data of the Hypertext Markup Language (HTML) type.| 29e41f4b71Sopenharmony_ci| typedef struct [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) | Defines a struct for the uniform data of the home screen icon type.| 30e41f4b71Sopenharmony_ci| typedef struct [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) | Defines a struct for the file URI type.| 31e41f4b71Sopenharmony_ci| typedef struct [OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) [OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) | Defines a struct for the pixel map type.| 32e41f4b71Sopenharmony_ci| typedef struct [OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) [OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) | Defines a struct for the ArrayBuffer type.| 33e41f4b71Sopenharmony_ci 34e41f4b71Sopenharmony_ci 35e41f4b71Sopenharmony_ci### Functions 36e41f4b71Sopenharmony_ci 37e41f4b71Sopenharmony_ci| Name| Description| 38e41f4b71Sopenharmony_ci| -------- | -------- | 39e41f4b71Sopenharmony_ci| [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) \* [OH_UdsPlainText_Create](_u_d_m_f.md#oh_udsplaintext_create) () | Creates an [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) instance and a pointer to it. If this pointer is no longer required, use [OH_UdsPlainText_Destroy](_u_d_m_f.md#oh_udsplaintext_destroy) to destroy it. Otherwise, memory leaks may occur.| 40e41f4b71Sopenharmony_ci| void [OH_UdsPlainText_Destroy](_u_d_m_f.md#oh_udsplaintext_destroy) ([OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) \*pThis) | Destroys an [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) instance.| 41e41f4b71Sopenharmony_ci| const char \* [OH_UdsPlainText_GetType](_u_d_m_f.md#oh_udsplaintext_gettype) ([OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) \*pThis) | Obtains the type ID from an [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) instance.| 42e41f4b71Sopenharmony_ci| const char \* [OH_UdsPlainText_GetContent](_u_d_m_f.md#oh_udsplaintext_getcontent) ([OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) \*pThis) | Obtains the plaintext from an [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) instance.| 43e41f4b71Sopenharmony_ci| const char \* [OH_UdsPlainText_GetAbstract](_u_d_m_f.md#oh_udsplaintext_getabstract) ([OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) \*pThis) | Obtains the abstract from an [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) instance.| 44e41f4b71Sopenharmony_ci| int [OH_UdsPlainText_SetContent](_u_d_m_f.md#oh_udsplaintext_setcontent) ([OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) \*pThis, const char \*content) | Sets the plaintext content for an [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) instance.| 45e41f4b71Sopenharmony_ci| int [OH_UdsPlainText_SetAbstract](_u_d_m_f.md#oh_udsplaintext_setabstract) ([OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) \*pThis, const char \*abstract) | Sets the abstract for an [OH_UdsPlainText](_u_d_m_f.md#oh_udsplaintext) instance.| 46e41f4b71Sopenharmony_ci| [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) \* [OH_UdsHyperlink_Create](_u_d_m_f.md#oh_udshyperlink_create) () | Creates an [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) instance and a pointer to it. If this pointer is no longer required, use [OH_UdsHyperlink_Destroy](_u_d_m_f.md#oh_udshyperlink_destroy) to destroy it. Otherwise, memory leaks may occur.| 47e41f4b71Sopenharmony_ci| void [OH_UdsHyperlink_Destroy](_u_d_m_f.md#oh_udshyperlink_destroy) ([OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) \*pThis) | Destroys an [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) instance.| 48e41f4b71Sopenharmony_ci| const char \* [OH_UdsHyperlink_GetType](_u_d_m_f.md#oh_udshyperlink_gettype) ([OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) \*pThis) | Obtains the type ID from an [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) instance.| 49e41f4b71Sopenharmony_ci| const char \* [OH_UdsHyperlink_GetUrl](_u_d_m_f.md#oh_udshyperlink_geturl) ([OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) \*pThis) | Obtains the URL from an [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) instance.| 50e41f4b71Sopenharmony_ci| const char \* [OH_UdsHyperlink_GetDescription](_u_d_m_f.md#oh_udshyperlink_getdescription) ([OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) \*pThis) | Obtains the description from an [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) instance.| 51e41f4b71Sopenharmony_ci| int [OH_UdsHyperlink_SetUrl](_u_d_m_f.md#oh_udshyperlink_seturl) ([OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) \*pThis, const char \*url) | Sets the URL for an [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) instance.| 52e41f4b71Sopenharmony_ci| int [OH_UdsHyperlink_SetDescription](_u_d_m_f.md#oh_udshyperlink_setdescription) ([OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) \*pThis, const char \*description) | Sets the description for an [OH_UdsHyperlink](_u_d_m_f.md#oh_udshyperlink) instance.| 53e41f4b71Sopenharmony_ci| [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) \* [OH_UdsHtml_Create](_u_d_m_f.md#oh_udshtml_create) () | Creates an [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) instance and a pointer to it. If this pointer is no longer required, use [OH_UdsHtml_Destroy](_u_d_m_f.md#oh_udshtml_destroy) to destroy it. Otherwise, memory leaks may occur.| 54e41f4b71Sopenharmony_ci| void [OH_UdsHtml_Destroy](_u_d_m_f.md#oh_udshtml_destroy) ([OH_UdsHtml](_u_d_m_f.md#oh_udshtml) \*pThis) | Destroys an [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) instance.| 55e41f4b71Sopenharmony_ci| const char \* [OH_UdsHtml_GetType](_u_d_m_f.md#oh_udshtml_gettype) ([OH_UdsHtml](_u_d_m_f.md#oh_udshtml) \*pThis) | Obtains the type ID from an [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) instance.| 56e41f4b71Sopenharmony_ci| const char \* [OH_UdsHtml_GetContent](_u_d_m_f.md#oh_udshtml_getcontent) ([OH_UdsHtml](_u_d_m_f.md#oh_udshtml) \*pThis) | Obtains the HTML content from an [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) instance.| 57e41f4b71Sopenharmony_ci| const char \* [OH_UdsHtml_GetPlainContent](_u_d_m_f.md#oh_udshtml_getplaincontent) ([OH_UdsHtml](_u_d_m_f.md#oh_udshtml) \*pThis) | Obtains the plaintext from an [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) instance.| 58e41f4b71Sopenharmony_ci| int [OH_UdsHtml_SetContent](_u_d_m_f.md#oh_udshtml_setcontent) ([OH_UdsHtml](_u_d_m_f.md#oh_udshtml) \*pThis, const char \*content) | Sets the HTML content for an [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) instance.| 59e41f4b71Sopenharmony_ci| int [OH_UdsHtml_SetPlainContent](_u_d_m_f.md#oh_udshtml_setplaincontent) ([OH_UdsHtml](_u_d_m_f.md#oh_udshtml) \*pThis, const char \*plainContent) | Sets the plaintext for an [OH_UdsHtml](_u_d_m_f.md#oh_udshtml) instance.| 60e41f4b71Sopenharmony_ci| [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \* [OH_UdsAppItem_Create](_u_d_m_f.md#oh_udsappitem_create) () | Creates an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance and a pointer to it. If this pointer is no longer required, use [OH_UdsAppItem_Destroy](_u_d_m_f.md#oh_udsappitem_destroy) to destroy it. Otherwise, memory leaks may occur.| 61e41f4b71Sopenharmony_ci| void [OH_UdsAppItem_Destroy](_u_d_m_f.md#oh_udsappitem_destroy) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis) | Destroys an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 62e41f4b71Sopenharmony_ci| const char \* [OH_UdsAppItem_GetType](_u_d_m_f.md#oh_udsappitem_gettype) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis) | Obtains the type ID from an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 63e41f4b71Sopenharmony_ci| const char \* [OH_UdsAppItem_GetId](_u_d_m_f.md#oh_udsappitem_getid) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis) | Obtains the application ID from an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 64e41f4b71Sopenharmony_ci| const char \* [OH_UdsAppItem_GetName](_u_d_m_f.md#oh_udsappitem_getname) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis) | Obtains the application name from an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 65e41f4b71Sopenharmony_ci| const char \* [OH_UdsAppItem_GetIconId](_u_d_m_f.md#oh_udsappitem_geticonid) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis) | Obtains the application icon ID from an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 66e41f4b71Sopenharmony_ci| const char \* [OH_UdsAppItem_GetLabelId](_u_d_m_f.md#oh_udsappitem_getlabelid) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis) | Obtains the application label ID from an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 67e41f4b71Sopenharmony_ci| const char \* [OH_UdsAppItem_GetBundleName](_u_d_m_f.md#oh_udsappitem_getbundlename) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis) | Obtains the bundle name from an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 68e41f4b71Sopenharmony_ci| const char \* [OH_UdsAppItem_GetAbilityName](_u_d_m_f.md#oh_udsappitem_getabilityname) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis) | Obtain the ability name from an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 69e41f4b71Sopenharmony_ci| int [OH_UdsAppItem_SetId](_u_d_m_f.md#oh_udsappitem_setid) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis, const char \*appId) | Sets the application ID for an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 70e41f4b71Sopenharmony_ci| int [OH_UdsAppItem_SetName](_u_d_m_f.md#oh_udsappitem_setname) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis, const char \*appName) | Sets the application name for an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 71e41f4b71Sopenharmony_ci| int [OH_UdsAppItem_SetIconId](_u_d_m_f.md#oh_udsappitem_seticonid) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis, const char \*appIconId) | Sets the application icon ID for an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 72e41f4b71Sopenharmony_ci| int [OH_UdsAppItem_SetLabelId](_u_d_m_f.md#oh_udsappitem_setlabelid) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis, const char \*appLabelId) | Sets the application label ID for an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 73e41f4b71Sopenharmony_ci| int [OH_UdsAppItem_SetBundleName](_u_d_m_f.md#oh_udsappitem_setbundlename) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis, const char \*bundleName) | Sets the bundle name for an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 74e41f4b71Sopenharmony_ci| int [OH_UdsAppItem_SetAbilityName](_u_d_m_f.md#oh_udsappitem_setabilityname) ([OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) \*pThis, const char \*abilityName) | Sets the ability name for an [OH_UdsAppItem](_u_d_m_f.md#oh_udsappitem) instance.| 75e41f4b71Sopenharmony_ci| [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) \* [OH_UdsFileUri_Create](_u_d_m_f.md#oh_udsfileuri_create) () | Creates an [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) instance and a pointer to it. If this pointer is no longer required, use [OH_UdsFileUri_Destroy](_u_d_m_f.md#oh_udsfileuri_destroy) to destroy it. Otherwise, memory leaks may occur.| 76e41f4b71Sopenharmony_ci| void [OH_UdsFileUri_Destroy](_u_d_m_f.md#oh_udsfileuri_destroy) ([OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) \*pThis) | Destroys an [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) instance.| 77e41f4b71Sopenharmony_ci| const char \* [OH_UdsFileUri_GetType](_u_d_m_f.md#oh_udsfileuri_gettype) ([OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) \*pThis) | Obtains the type ID from an [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) instance.| 78e41f4b71Sopenharmony_ci| const char \* [OH_UdsFileUri_GetFileUri](_u_d_m_f.md#oh_udsfileuri_getfileuri) ([OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) \*pThis) | Obtains the file URI from an [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) instance.| 79e41f4b71Sopenharmony_ci| const char \* [OH_UdsFileUri_GetFileType](_u_d_m_f.md#oh_udsfileuri_getfiletype) ([OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) \*pThis) | Obtains the file type from an [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) instance.| 80e41f4b71Sopenharmony_ci| int [OH_UdsFileUri_SetFileUri](_u_d_m_f.md#oh_udsfileuri_setfileuri) ([OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) \*pThis, const char \*fileUri) | Sets the URI information for an [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) instance.| 81e41f4b71Sopenharmony_ci| int [OH_UdsFileUri_SetFileType](_u_d_m_f.md#oh_udsfileuri_setfiletype) ([OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) \*pThis, const char \*fileType) | Sets the file type for an [OH_UdsFileUri](_u_d_m_f.md#oh_udsfileuri) instance.| 82e41f4b71Sopenharmony_ci| [OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) \* [OH_UdsPixelMap_Create](_u_d_m_f.md#oh_udspixelmap_create) () | Creates an [OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) instance and a pointer to it. If this pointer is no longer required, use [OH_UdsPixelMap_Destroy](_u_d_m_f.md#oh_udspixelmap_destroy) to destroy it. Otherwise, memory leaks may occur.| 83e41f4b71Sopenharmony_ci| void [OH_UdsPixelMap_Destroy](_u_d_m_f.md#oh_udspixelmap_destroy) ([OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) \*pThis) | Destroys an [OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) instance.| 84e41f4b71Sopenharmony_ci| const char \* [OH_UdsPixelMap_GetType](_u_d_m_f.md#oh_udspixelmap_gettype) ([OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) \*pThis) | Obtains the type ID from an [OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) instance.| 85e41f4b71Sopenharmony_ci| void [OH_UdsPixelMap_GetPixelMap](_u_d_m_f.md#oh_udspixelmap_getpixelmap) ([OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) \*pThis, OH_PixelmapNative \*pixelmapNative) | Obtains the pointer to the **OH_PixelmapNative** instance from an [OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) instance.| 86e41f4b71Sopenharmony_ci| int [OH_UdsPixelMap_SetPixelMap](_u_d_m_f.md#oh_udspixelmap_setpixelmap) ([OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) \*pThis, OH_PixelmapNative \*pixelmapNative) | Sets the pixel map content for an [OH_UdsPixelMap](_u_d_m_f.md#oh_udspixelmap) instance.| 87e41f4b71Sopenharmony_ci| [OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) \* [OH_UdsArrayBuffer_Create](_u_d_m_f.md#oh_udsarraybuffer_create) () | Creates an [OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) instance and a pointer to it. If this pointer is no longer required, use [OH_UdsArrayBuffer_Destroy](_u_d_m_f.md#oh_udsarraybuffer_destroy) to destroy it. Otherwise, memory leaks may occur.| 88e41f4b71Sopenharmony_ci| int [OH_UdsArrayBuffer_Destroy](_u_d_m_f.md#oh_udsarraybuffer_destroy) ([OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) \*buffer) | Destroys an [OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) instance.| 89e41f4b71Sopenharmony_ci| int [OH_UdsArrayBuffer_SetData](_u_d_m_f.md#oh_udsarraybuffer_setdata) ([OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) \*buffer, unsigned char \*data, unsigned int len) | Sets data for an [OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) instance.| 90e41f4b71Sopenharmony_ci| int [OH_UdsArrayBuffer_GetData](_u_d_m_f.md#oh_udsarraybuffer_getdata) ([OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) \*buffer, unsigned char \*\*data, unsigned int \*len) | Obtains the custom ArrayBuffer from an [OH_UdsArrayBuffer](_u_d_m_f.md#oh_udsarraybuffer) instance.| 91