1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 /**
17  * @addtogroup UDMF
18  * @{
19  *
20  * @brief The Unified Data Management Framework(UDMF) aims to define various standards
21  * for data across applications, devices, and platforms, providing a unified OpenHarmony
22  * data language and standardized data access and reading paths.
23  *
24  * @syscap SystemCapability.DistributedDataManager.UDMF.Core
25  *
26  * @since 12
27  */
28 
29 /**
30  * @file uds.h
31  *
32  * @brief Provides uniform data struct(UDS).
33  *
34  * @kit ArkData
35  * @library libudmf.so
36  * @syscap SystemCapability.DistributedDataManager.UDMF.Core
37  * @since 12
38  */
39 
40 #ifndef UDS_H
41 #define UDS_H
42 
43 #ifdef __cplusplus
44 extern "C" {
45 #endif
46 
47 /**
48  * @brief Describes the unified data struct of plaintext.
49  *
50  * @since 12
51  */
52 typedef struct OH_UdsPlainText OH_UdsPlainText;
53 
54 /**
55  * @brief Describes the unified data struct of hyperlink.
56  *
57  * @since 12
58  */
59 typedef struct OH_UdsHyperlink OH_UdsHyperlink;
60 
61 /**
62  * @brief Describes the unified data struct of html.
63  *
64  * @since 12
65  */
66 typedef struct OH_UdsHtml OH_UdsHtml;
67 
68 /**
69  * @brief Describes the unified data struct of open harmony application item.
70  *
71  * @since 12
72  */
73 typedef struct OH_UdsAppItem OH_UdsAppItem;
74 
75 /**
76  * @brief Describes the unified data struct of file uri.
77  *
78  * @since 13
79  */
80 typedef struct OH_UdsFileUri OH_UdsFileUri;
81 
82 /**
83  * @brief Describes the unified data struct of open harmony pixel map.
84  *
85  * @since 13
86  */
87 typedef struct OH_UdsPixelMap OH_UdsPixelMap;
88 
89 /**
90  * @brief Describes the unified data struct of content form.
91  *
92  * @since 14
93  */
94 typedef struct OH_UdsContentForm OH_UdsContentForm;
95 
96 /**
97  * @brief Describes the of pixel map native.
98  *
99  * @since 13
100  */
101 struct OH_PixelmapNative;
102 
103 /**
104  * @brief Describes the unified data struct of array buffer.
105  *
106  * @since 13
107  */
108 typedef struct OH_UdsArrayBuffer OH_UdsArrayBuffer;
109 
110 /**
111  * @brief Creation a pointer to the instance of the {@link OH_UdsPlainText}.
112  *
113  * @return If the operation is successful, a pointer to the instance of the {@link OH_UdsPlainText}
114  * structure is returned. If the operation is failed, nullptr is returned.
115  * @see OH_UdsPlainText
116  * @since 12
117  */
118 OH_UdsPlainText* OH_UdsPlainText_Create();
119 
120 /**
121  * @brief Destroy a pointer that points to the {@link OH_UdsPlainText} instance.
122  *
123  * @param pThis Represents a pointer to an instance of {@link OH_UdsPlainText}.
124  * @see OH_UdsPlainText
125  * @since 12
126  */
127 void OH_UdsPlainText_Destroy(OH_UdsPlainText* pThis);
128 
129 /**
130  * @brief Get type id from the {@link OH_UdsPlainText}.
131  *
132  * @param pThis Represents a pointer to an instance of {@link OH_UdsPlainText}.
133  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
134  * @see OH_UdsPlainText
135  * @since 12
136  */
137 const char* OH_UdsPlainText_GetType(OH_UdsPlainText* pThis);
138 
139 /**
140  * @brief Get content from the {@link OH_UdsPlainText}.
141  *
142  * @param pThis Represents a pointer to an instance of {@link OH_UdsPlainText}.
143  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
144  * @see OH_UdsPlainText
145  * @since 12
146  */
147 const char* OH_UdsPlainText_GetContent(OH_UdsPlainText* pThis);
148 
149 /**
150  * @brief Get abstract from the {@link OH_UdsPlainText}.
151  *
152  * @param pThis Represents a pointer to an instance of {@link OH_UdsPlainText}.
153  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
154  * @see OH_UdsPlainText
155  * @since 12
156  */
157 const char* OH_UdsPlainText_GetAbstract(OH_UdsPlainText* pThis);
158 
159 /**
160  * @brief Set content to the {@link OH_UdsPlainText}.
161  *
162  * @param pThis Represents a pointer to an instance of {@link OH_UdsPlainText}.
163  * @param content Represents a new content string.
164  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
165  *         {@link UDMF_E_OK} success.
166  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
167  * @see OH_UdsPlainText Udmf_ErrCode
168  * @since 12
169  */
170 int OH_UdsPlainText_SetContent(OH_UdsPlainText* pThis, const char* content);
171 
172 /**
173  * @brief Set abstract to the {@link OH_UdsPlainText}.
174  *
175  * @param pThis Represents a pointer to an instance of {@link OH_UdsPlainText}.
176  * @param abstract Represents a new string value.
177  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
178  *         {@link UDMF_E_OK} success.
179  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
180  * @see OH_UdsPlainText Udmf_ErrCode
181  * @since 12
182  */
183 int OH_UdsPlainText_SetAbstract(OH_UdsPlainText* pThis, const char* abstract);
184 
185 /**
186  * @brief Creation a pointer to the instance of the {@link OH_UdsHyperlink}.
187  *
188  * @return If the operation is successful, a pointer to the instance of {@link OH_UdsHyperlink}
189  * structure is returned. If the operation is failed, nullptr is returned.
190  * @see OH_UdsHyperlink
191  * @since 12
192  */
193 OH_UdsHyperlink* OH_UdsHyperlink_Create();
194 
195 /**
196  * @brief Destroy a pointer that points to the {@link OH_UdsHyperlink} instance.
197  *
198  * @param pThis Represents a pointer to an  instance of {@link OH_UdsHyperlink}.
199  * @see OH_UdsHyperlink
200  * @since 12
201  */
202 void OH_UdsHyperlink_Destroy(OH_UdsHyperlink* pThis);
203 
204 /**
205  * @brief Get type from the {@link OH_UdsHyperlink}.
206  *
207  * @param pThis Represents a pointer to an instance of {@link OH_UdsHyperlink}.
208  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
209  * @see OH_UdsHyperlink
210  * @since 12
211  */
212 const char* OH_UdsHyperlink_GetType(OH_UdsHyperlink* pThis);
213 
214 /**
215  * @brief Get url from the {@link OH_UdsHyperlink}.
216  *
217  * @param pThis Represents a pointer to an instance of {@link OH_UdsHyperlink}.
218  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
219  * @see OH_UdsHyperlink
220  * @since 12
221  */
222 const char* OH_UdsHyperlink_GetUrl(OH_UdsHyperlink* pThis);
223 
224 /**
225  * @brief Get description from the {@link OH_UdsHyperlink}.
226  *
227  * @param pThis Represents a pointer to an instance of {@link OH_UdsHyperlink}.
228  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
229  * @see OH_UdsHyperlink
230  * @since 12
231  */
232 const char* OH_UdsHyperlink_GetDescription(OH_UdsHyperlink* pThis);
233 
234 /**
235  * @brief Set url to the {@link OH_UdsHyperlink}.
236  *
237  * @param pThis Represents a pointer to an instance of {@link OH_UdsHyperlink}.
238  * @param url Represents a new string value.
239  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
240  *         {@link UDMF_E_OK} success.
241  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
242  * @see OH_UdsHyperlink Udmf_ErrCode
243  * @since 12
244  */
245 int OH_UdsHyperlink_SetUrl(OH_UdsHyperlink* pThis, const char* url);
246 
247 /**
248  * @brief Set description to the {@link OH_UdsHyperlink}.
249  *
250  * @param pThis Represents a pointer to an instance of {@link OH_UdsHyperlink}.
251  * @param description Represents a new string value.
252  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
253  *         {@link UDMF_E_OK} success.
254  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
255  * @see OH_UdsHyperlink Udmf_ErrCode
256  * @since 12
257  */
258 int OH_UdsHyperlink_SetDescription(OH_UdsHyperlink* pThis, const char* description);
259 
260 /**
261  * @brief Creation a pointer to the instance of the {@link OH_UdsHtml}.
262  *
263  * @return If the operation is successful, a pointer to the instance of the {@link OH_UdsHtml}
264  * structure is returned. If the operation is failed, nullptr is returned.
265  * @see OH_UdsHtml
266  * @since 12
267  */
268 OH_UdsHtml* OH_UdsHtml_Create();
269 
270 /**
271  * @brief Destroy a pointer that points to the {@link OH_UdsHtml} instance.
272  *
273  * @param pThis Represents a pointer to an instance of {@link OH_UdsHtml}.
274  * @see OH_UdsHtml
275  * @since 12
276  */
277 void OH_UdsHtml_Destroy(OH_UdsHtml* pThis);
278 
279 /**
280  * @brief Get html from the {@link OH_UdsHtml}.
281  *
282  * @param pThis Represents a pointer to an instance of {@link OH_UdsHtml}.
283  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
284  * @see OH_UdsHtml
285  * @since 12
286  */
287 const char* OH_UdsHtml_GetType(OH_UdsHtml* pThis);
288 
289 /**
290  * @brief Get content from the {@link OH_UdsHtml}.
291  *
292  * @param pThis Represents a pointer to an instance of {@link OH_UdsHtml}.
293  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
294  * @see OH_UdsHtml
295  * @since 12
296  */
297 const char* OH_UdsHtml_GetContent(OH_UdsHtml* pThis);
298 
299 /**
300  * @brief Get plain content from the {@link OH_UdsHtml}.
301  *
302  * @param pThis Represents a pointer to an instance of {@link OH_UdsHtml}.
303  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
304  * @see OH_UdsHtml
305  * @since 12
306  */
307 const char* OH_UdsHtml_GetPlainContent(OH_UdsHtml* pThis);
308 
309 /**
310  * @brief Set content to the {@link OH_UdsHtml}.
311  *
312  * @param pThis Represents a pointer to an instance of {@link OH_UdsHtml}.
313  * @param content Represents a new string value.
314  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
315  *         {@link UDMF_E_OK} success.
316  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
317  * @see OH_UdsHtml Udmf_ErrCode
318  * @since 12
319  */
320 int OH_UdsHtml_SetContent(OH_UdsHtml* pThis, const char* content);
321 
322 /**
323  * @brief Set plain content to the {@link OH_UdsHtml}.
324  *
325  * @param pThis Represents a pointer to an instance of {@link OH_UdsHtml}.
326  * @param plainContent Represents a new string value.
327  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
328  *         {@link UDMF_E_OK} success.
329  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
330  * @see OH_UdsHtml Udmf_ErrCode
331  * @since 12
332  */
333 int OH_UdsHtml_SetPlainContent(OH_UdsHtml* pThis, const char* plainContent);
334 
335 /**
336  * @brief Creation a pointer to the instance of the {@link OH_UdsAppItem}.
337  *
338  * @return If the operation is successful, a pointer to the instance of the {@link OH_UdsAppItem}
339  * structure is returned. sIf the operation is failed, nullptr is returned.
340  * @see OH_UdsAppItem
341  * @since 12
342  */
343 OH_UdsAppItem* OH_UdsAppItem_Create();
344 
345 /**
346  * @brief Destroy a pointer that points to the {@link OH_UdsAppItem} instance.
347  *
348  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
349  * @see OH_UdsAppItem
350  * @since 12
351  */
352 void OH_UdsAppItem_Destroy(OH_UdsAppItem* pThis);
353 
354 /**
355  * @brief Get type from the {@link OH_UdsAppItem}.
356  *
357  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
358  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
359  * @see OH_UdsAppItem
360  * @since 12
361  */
362 const char* OH_UdsAppItem_GetType(OH_UdsAppItem* pThis);
363 
364 /**
365  * @brief Get app id from the {@link OH_UdsAppItem}.
366  *
367  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
368  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
369  * @see OH_UdsAppItem
370  * @since 12
371  */
372 const char* OH_UdsAppItem_GetId(OH_UdsAppItem* pThis);
373 
374 /**
375  * @brief Get app name from the {@link OH_UdsAppItem}.
376  *
377  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
378  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
379  * @see OH_UdsAppItem
380  * @since 12
381  */
382 const char* OH_UdsAppItem_GetName(OH_UdsAppItem* pThis);
383 
384 /**
385  * @brief Get app icon id from the {@link OH_UdsAppItem}.
386  *
387  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
388  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
389  * @see OH_UdsAppItem
390  * @since 12
391  */
392 const char* OH_UdsAppItem_GetIconId(OH_UdsAppItem* pThis);
393 
394 /**
395  * @brief Get app label id from the {@link OH_UdsAppItem}.
396  *
397  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
398  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
399  * @see OH_UdsAppItem
400  * @since 12
401  */
402 const char* OH_UdsAppItem_GetLabelId(OH_UdsAppItem* pThis);
403 
404 /**
405  * @brief Get bundle name from the {@link OH_UdsAppItem}.
406  *
407  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
408  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
409  * @see OH_UdsAppItem
410  * @since 12
411  */
412 const char* OH_UdsAppItem_GetBundleName(OH_UdsAppItem* pThis);
413 
414 /**
415  * @brief Get ability name from the {@link OH_UdsAppItem}.
416  *
417  * @param pThis Represents a pointer to an instance {@link OH_UdsAppItem}.
418  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
419  * @see OH_UdsAppItem
420  * @since 12
421  */
422 const char* OH_UdsAppItem_GetAbilityName(OH_UdsAppItem* pThis);
423 
424 /**
425  * @brief Set application id to the {@link OH_UdsAppItem}.
426  *
427  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
428  * @param appId Represents a new string value.
429  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
430  *         {@link UDMF_E_OK} success.
431  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
432  * @see OH_UdsAppItem Udmf_ErrCode
433  * @since 12
434  */
435 int OH_UdsAppItem_SetId(OH_UdsAppItem* pThis, const char* appId);
436 
437 /**
438  * @brief Set application name to the {@link OH_UdsAppItem}.
439  *
440  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
441  * @param appName Represents a new string value.
442  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
443  *         {@link UDMF_E_OK} success.
444  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
445  * @see OH_UdsAppItem Udmf_ErrCode
446  * @since 12
447  */
448 int OH_UdsAppItem_SetName(OH_UdsAppItem* pThis, const char* appName);
449 
450 /**
451  * @brief Set application icon id to the {@link OH_UdsAppItem}.
452  *
453  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
454  * @param appIconId Represents a new string value.
455  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
456  *         {@link UDMF_E_OK} success.
457  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
458  * @see OH_UdsAppItem Udmf_ErrCode
459  * @since 12
460  */
461 int OH_UdsAppItem_SetIconId(OH_UdsAppItem* pThis, const char* appIconId);
462 
463 /**
464  * @brief Set application label id to the {@link OH_UdsAppItem}.
465  *
466  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
467  * @param appLabelId Represents a new string value.
468  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
469  *         {@link UDMF_E_OK} success.
470  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
471  * @see OH_UdsAppItem Udmf_ErrCode
472  * @since 12
473  */
474 int OH_UdsAppItem_SetLabelId(OH_UdsAppItem* pThis, const char* appLabelId);
475 
476 /**
477  * @brief Set bundle name to the {@link OH_UdsAppItem}.
478  *
479  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
480  * @param bundleName Represents a new string value.
481  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
482  *         {@link UDMF_E_OK} success.
483  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
484  * @see OH_UdsAppItem Udmf_ErrCode
485  * @since 12
486  */
487 int OH_UdsAppItem_SetBundleName(OH_UdsAppItem* pThis, const char* bundleName);
488 
489 /**
490  * @brief Set ability name to the {@link OH_UdsAppItem}.
491  *
492  * @param pThis Represents a pointer to an instance of {@link OH_UdsAppItem}.
493  * @param abilityName Represents a new string value.
494  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
495  *         {@link UDMF_E_OK} success.
496  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
497  * @see OH_UdsAppItem Udmf_ErrCode
498  * @since 12
499  */
500 int OH_UdsAppItem_SetAbilityName(OH_UdsAppItem* pThis, const char* abilityName);
501 
502 /**
503  * @brief Creation a pointer to the instance of the {@link OH_UdsFileUri}.
504  *
505  * @return If the operation is successful, a pointer to the instance of the {@link OH_UdsFileUri}
506  * structure is returned. If the operation is failed, nullptr is returned.
507  * @see OH_UdsFileUri
508  * @since 13
509  */
510 OH_UdsFileUri* OH_UdsFileUri_Create();
511 
512 /**
513  * @brief Destroy a pointer that points to the {@link OH_UdsFileUri} instance.
514  *
515  * @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
516  * @see OH_UdsFileUri
517  * @since 13
518  */
519 void OH_UdsFileUri_Destroy(OH_UdsFileUri* pThis);
520 
521 /**
522  * @brief Get type id from the {@link OH_UdsFileUri}.
523  *
524  * @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
525  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
526  * @see OH_UdsFileUri
527  * @since 13
528  */
529 const char* OH_UdsFileUri_GetType(OH_UdsFileUri* pThis);
530 
531 /**
532  * @brief Get file uri from the {@link OH_UdsFileUri}.
533  *
534  * @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
535  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
536  * @see OH_UdsFileUri
537  * @since 13
538  */
539 const char* OH_UdsFileUri_GetFileUri(OH_UdsFileUri* pThis);
540 
541 /**
542  * @brief Get file type from the {@link OH_UdsFileUri}.
543  *
544  * @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
545  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
546  * @see OH_UdsFileUri
547  * @since 13
548  */
549 const char* OH_UdsFileUri_GetFileType(OH_UdsFileUri* pThis);
550 
551 /**
552  * @brief Set file uri to the {@link OH_UdsFileUri}.
553  *
554  * @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
555  * @param fileUri Represents a new file uri string.
556  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
557  *         {@link UDMF_E_OK} success.
558  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
559  * @see OH_UdsFileUri Udmf_ErrCode
560  * @since 13
561  */
562 int OH_UdsFileUri_SetFileUri(OH_UdsFileUri* pThis, const char* fileUri);
563 
564 /**
565  * @brief Set file type to the {@link OH_UdsFileUri}.
566  *
567  * @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
568  * @param fileType Represents a new file type string.
569  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
570  *         {@link UDMF_E_OK} success.
571  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
572  * @see OH_UdsFileUri Udmf_ErrCode
573  * @since 13
574  */
575 int OH_UdsFileUri_SetFileType(OH_UdsFileUri* pThis, const char* fileType);
576 
577 /**
578  * @brief Creation a pointer to the instance of the {@link OH_UdsPixelMap}.
579  *
580  * @return If the operation is successful, a pointer to the instance of the {@link OH_UdsPixelMap}
581  * structure is returned. If the operation is failed, nullptr is returned.
582  * @see OH_UdsPixelMap
583  * @since 13
584  */
585 OH_UdsPixelMap* OH_UdsPixelMap_Create();
586 
587 /**
588  * @brief Destroy a pointer that points to the {@link OH_UdsPixelMap} instance.
589  *
590  * @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}.
591  * @see OH_UdsPixelMap
592  * @since 13
593  */
594 void OH_UdsPixelMap_Destroy(OH_UdsPixelMap* pThis);
595 
596 /**
597  * @brief Get type id from the {@link OH_UdsPixelMap}.
598  *
599  * @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}.
600  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
601  * @see OH_UdsPixelMap
602  * @since 13
603  */
604 const char* OH_UdsPixelMap_GetType(OH_UdsPixelMap* pThis);
605 
606 /**
607  * @brief Get pixel map from the {@link OH_UdsPixelMap}.
608  *
609  * @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}.
610  * @param pixelmapNative Represents output params of {@link OH_PixelmapNative}.
611  * @see OH_UdsPixelMap
612  * @since 13
613  */
614 void OH_UdsPixelMap_GetPixelMap(OH_UdsPixelMap* pThis, OH_PixelmapNative* pixelmapNative);
615 
616 /**
617  * @brief Set pixel map to the {@link OH_UdsPixelMap}.
618  *
619  * @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}.
620  * @param pixelmapNative Represents a new {@link OH_PixelmapNative}.
621  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
622  *         {@link UDMF_E_OK} success.
623  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
624  * @see OH_UdsPixelMap Udmf_ErrCode
625  * @since 13
626  */
627 int OH_UdsPixelMap_SetPixelMap(OH_UdsPixelMap* pThis, OH_PixelmapNative* pixelmapNative);
628 
629 /**
630  * @brief Creation a pointer to the instance of the {@link OH_UdsArrayBuffer}.
631  *
632  * @return If the operation is successful, a pointer to the instance of the {@link OH_UdsArrayBuffer}
633  * structure is returned. If the memory is not enough, nullptr is returned.
634  * @see OH_UdsArrayBuffer
635  * @since 13
636  */
637 OH_UdsArrayBuffer* OH_UdsArrayBuffer_Create();
638 
639 /**
640  * @brief Destroy a pointer that points to the {@link OH_UdsArrayBuffer} instance.
641  *
642  * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}.
643  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
644  *         {@link UDMF_E_OK} success.
645  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
646  * @see OH_UdsArrayBuffer Udmf_ErrCode
647  * @since 13
648  */
649 int OH_UdsArrayBuffer_Destroy(OH_UdsArrayBuffer* buffer);
650 
651 /**
652  * @brief Set array buffer data to the {@link OH_UdsArrayBuffer}.
653  *
654  * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}.
655  * @param data Represents the array buffer data.
656  * @param len Represents the length of data param.
657  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
658  *         {@link UDMF_E_OK} success.
659  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
660  * @see OH_UdsArrayBuffer Udmf_ErrCode
661  * @since 13
662  */
663 int OH_UdsArrayBuffer_SetData(OH_UdsArrayBuffer* buffer, unsigned char* data, unsigned int len);
664 
665 /**
666  * @brief Get array buffer data from the {@link OH_UdsArrayBuffer}.
667  *
668  * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}.
669  * @param data Represents a pointer to array buffer data that is a output param.
670  * @param len Represents the array buffer data length that is a output param.
671  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
672  *         {@link UDMF_E_OK} success.
673  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
674  * @see OH_UdsArrayBuffer Udmf_ErrCode
675  * @since 13
676  */
677 int OH_UdsArrayBuffer_GetData(OH_UdsArrayBuffer* buffer, unsigned char** data, unsigned int* len);
678 
679 /**
680  * @brief Creation a pointer to the instance of the {@link OH_UdsContentForm}.
681  *
682  * @return If the operation is successful, a pointer to the instance of the {@link OH_UdsContentForm}
683  * structure is returned. If the operation is failed, nullptr is returned.
684  * @see OH_UdsContentForm
685  * @since 14
686  */
687 OH_UdsContentForm* OH_UdsContentForm_Create();
688 
689 /**
690  * @brief Destroy a pointer that points to the {@link OH_UdsContentForm} instance.
691  *
692  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
693  * @see OH_UdsContentForm
694  * @since 14
695  */
696 void OH_UdsContentForm_Destroy(OH_UdsContentForm* pThis);
697 
698 /**
699  * @brief Get type id from the {@link OH_UdsContentForm}.
700  *
701  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
702  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
703  * @see OH_UdsContentForm
704  * @since 14
705  */
706 const char* OH_UdsContentForm_GetType(OH_UdsContentForm* pThis);
707 
708 /**
709  * @brief Get thumb data from the {@link OH_UdsContentForm}.
710  *
711  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
712  * @param thumbData Represents a pointer to thumb data that is a output param.
713  * @param len Represents the thumb data length that is a output param.
714  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
715  *         {@link UDMF_E_OK} success.
716  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
717  *         {@link UDMF_ERR} Internal data error.
718  * @see OH_UdsContentForm Udmf_ErrCode
719  * @since 14
720  */
721 int OH_UdsContentForm_GetThumbData(OH_UdsContentForm* pThis, unsigned char** thumbData, unsigned int* len);
722 
723 /**
724  * @brief Get description from the {@link OH_UdsContentForm}.
725  *
726  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
727  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
728  * @see OH_UdsContentForm
729  * @since 14
730  */
731 const char* OH_UdsContentForm_GetDescription(OH_UdsContentForm* pThis);
732 
733 /**
734  * @brief Get title from the {@link OH_UdsContentForm}.
735  *
736  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
737  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
738  * @see OH_UdsContentForm
739  * @since 14
740  */
741 const char* OH_UdsContentForm_GetTitle(OH_UdsContentForm* pThis);
742 
743 /**
744  * @brief Get thumb data from the {@link OH_UdsContentForm}.
745  *
746  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
747  * @param appIcon Represents a pointer to app icon that is a output param.
748  * @param len Represents the app icon length that is a output param.
749  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
750  *         {@link UDMF_E_OK} success.
751  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
752  *         {@link UDMF_ERR} Internal data error.
753  * @see OH_UdsContentForm Udmf_ErrCode
754  * @since 14
755  */
756 int OH_UdsContentForm_GetAppIcon(OH_UdsContentForm* pThis, unsigned char** appIcon, unsigned int* len);
757 
758 /**
759  * @brief Get app name from the {@link OH_UdsContentForm}.
760  *
761  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
762  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
763  * @see OH_UdsContentForm
764  * @since 14
765  */
766 const char* OH_UdsContentForm_GetAppName(OH_UdsContentForm* pThis);
767 
768 /**
769  * @brief Get link url from the {@link OH_UdsContentForm}.
770  *
771  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
772  * @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
773  * @see OH_UdsContentForm
774  * @since 14
775  */
776 const char* OH_UdsContentForm_GetLinkUri(OH_UdsContentForm* pThis);
777 
778 /**
779  * @brief Set thumb data to the {@link OH_UdsContentForm}.
780  *
781  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
782  * @param thumbData Represents the thumb data.
783  * @param len Represents the length of thumb data param.
784  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
785  *         {@link UDMF_E_OK} success.
786  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
787  * @see OH_UdsContentForm Udmf_ErrCode
788  * @since 14
789  */
790 int OH_UdsContentForm_SetThumbData(OH_UdsContentForm* pThis, const unsigned char* thumbData, unsigned int len);
791 
792 /**
793  * @brief Set description to the {@link OH_UdsContentForm}.
794  *
795  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
796  * @param description Represents a description string.
797  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
798  *         {@link UDMF_E_OK} success.
799  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
800  * @see OH_UdsContentForm Udmf_ErrCode
801  * @since 14
802  */
803 int OH_UdsContentForm_SetDescription(OH_UdsContentForm* pThis, const char* description);
804 
805 /**
806  * @brief Set title to the {@link OH_UdsContentForm}.
807  *
808  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
809  * @param title Represents a title string.
810  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
811  *         {@link UDMF_E_OK} success.
812  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
813  * @see OH_UdsContentForm Udmf_ErrCode
814  * @since 14
815  */
816 int OH_UdsContentForm_SetTitle(OH_UdsContentForm* pThis, const char* title);
817 
818 /**
819  * @brief Set thumb data to the {@link OH_UdsContentForm}.
820  *
821  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
822  * @param appIcon Represents the app icon.
823  * @param len Represents the length of app icon param.
824  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
825  *         {@link UDMF_E_OK} success.
826  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
827  * @see OH_UdsContentForm Udmf_ErrCode
828  * @since 14
829  */
830 int OH_UdsContentForm_SetAppIcon(OH_UdsContentForm* pThis, const unsigned char* appIcon, unsigned int len);
831 
832 /**
833  * @brief Set app name to the {@link OH_UdsContentForm}.
834  *
835  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
836  * @param appName Represents a app name string.
837  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
838  *         {@link UDMF_E_OK} success.
839  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
840  * @see OH_UdsContentForm Udmf_ErrCode
841  * @since 14
842  */
843 int OH_UdsContentForm_SetAppName(OH_UdsContentForm* pThis, const char* appName);
844 
845 /**
846  * @brief Set link uri to the {@link OH_UdsContentForm}.
847  *
848  * @param pThis Represents a pointer to an instance of {@link OH_UdsContentForm}.
849  * @param linkUri Represents a link uri string.
850  * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
851  *         {@link UDMF_E_OK} success.
852  *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
853  * @see OH_UdsContentForm Udmf_ErrCode
854  * @since 14
855  */
856 int OH_UdsContentForm_SetLinkUri(OH_UdsContentForm* pThis, const char* linkUri);
857 
858 #ifdef __cplusplus
859 };
860 #endif
861 
862 /** @} */
863 #endif
864