1# uds.h
2
3
4## Overview
5
6Defines the APIs and structs related to the uniform data structs.
7
8**File to include**: <database/udmf/uds.h>
9
10**Library**: libudmf.so
11
12**System capability**: SystemCapability.DistributedDataManager.UDMF.Core
13
14**Since**: 12
15
16**Related module**: [UDMF](_u_d_m_f.md)
17
18
19## Summary
20
21
22### Types
23
24| Name| Description|
25| -------- | -------- |
26| 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.|
27| 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.|
28| 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.|
29| 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.|
30| 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.|
31| 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.|
32| 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.|
33
34
35### Functions
36
37| Name| Description|
38| -------- | -------- |
39| [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.|
40| 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.|
41| 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.|
42| 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.|
43| 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.|
44| 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.|
45| 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.|
46| [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.|
47| 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.|
48| 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.|
49| 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.|
50| 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.|
51| 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.|
52| 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.|
53| [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.|
54| 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.|
55| 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.|
56| 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.|
57| 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.|
58| 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.|
59| 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.|
60| [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.|
61| 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.|
62| 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.|
63| 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.|
64| 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.|
65| 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.|
66| 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.|
67| 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.|
68| 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.|
69| 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.|
70| 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.|
71| 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.|
72| 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.|
73| 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.|
74| 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.|
75| [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.|
76| 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.|
77| 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.|
78| 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.|
79| 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.|
80| 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.|
81| 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.|
82| [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.|
83| 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.|
84| 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.|
85| 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.|
86| 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.|
87| [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.|
88| 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.|
89| 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.|
90| 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