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