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 * @since 12 25 */ 26 27 /** 28 * @file udmf.h 29 * 30 * @brief Provides unified data management framework related functions and enumerations. 31 * 32 * @kit ArkData 33 * @library libudmf.so 34 * @syscap SystemCapability.DistributedDataManager.UDMF.Core 35 * 36 * @since 12 37 */ 38 39 #ifndef UDMF_H 40 #define UDMF_H 41 42 #include <inttypes.h> 43 #include <stdbool.h> 44 #include "uds.h" 45 46 #ifdef __cplusplus 47 extern "C" { 48 #endif 49 50 /** 51 * @brief The key minimum memory space size of Unified Data. 52 * 53 * @since 12 54 */ 55 #define UDMF_KEY_BUFFER_LEN (512) 56 57 /** 58 * @brief Describe the intention type of the udmf. 59 * 60 * @since 12 61 */ 62 typedef enum Udmf_Intention { 63 /** 64 * @brief The intention is drag. 65 */ 66 UDMF_INTENTION_DRAG, 67 /** 68 * @brief The intention is pasteboard. 69 */ 70 UDMF_INTENTION_PASTEBOARD, 71 /** 72 * @brief The intention is data hub. 73 * 74 * @since 20 75 */ 76 UDMF_INTENTION_DATA_HUB, 77 /** 78 * @brief The intention is system share. 79 * 80 * @since 20 81 */ 82 UDMF_INTENTION_SYSTEM_SHARE, 83 /** 84 * @brief The intention is picker. 85 * 86 * @since 20 87 */ 88 UDMF_INTENTION_PICKER, 89 /** 90 * @brief The intention is menu. 91 * 92 * @since 20 93 */ 94 UDMF_INTENTION_MENU, 95 } Udmf_Intention; 96 97 /** 98 * @brief Describe intra-device usage range type enumeration. 99 * 100 * @since 12 101 */ 102 typedef enum Udmf_ShareOption { 103 /** 104 * @brief Invalid share option. 105 */ 106 SHARE_OPTIONS_INVALID, 107 /** 108 * @brief Allowed to be used in the same application on this device. 109 */ 110 SHARE_OPTIONS_IN_APP, 111 /** 112 * @brief Allowed to be used in the cross application on this device. 113 */ 114 SHARE_OPTIONS_CROSS_APP 115 } Udmf_ShareOption; 116 117 /** 118 * @brief Describe the types of file conflict options when getting data from the udmf. 119 * 120 * @since 15 121 */ 122 typedef enum Udmf_FileConflictOptions { 123 /** 124 * @brief Overwrite when dest uri has file with same name. 125 */ 126 UDMF_OVERWRITE = 0, 127 /** 128 * @brief Skip when dest uri has file with same name. 129 */ 130 UDMF_SKIP = 1, 131 } Udmf_FileConflictOptions; 132 133 /** 134 * @brief Describe the types of progress indicator when getting data from the udmf. 135 * 136 * @since 15 137 */ 138 typedef enum Udmf_ProgressIndicator { 139 /** 140 * @brief Getting data without system default progress indicator. 141 */ 142 UDMF_NONE = 0, 143 /** 144 * @brief Getting data with system default progress indicator. 145 */ 146 UDMF_DEFAULT = 1 147 } Udmf_ProgressIndicator; 148 149 /** 150 * @brief Describe the visibility range of data 151 * 152 * @since 20 153 */ 154 typedef enum Udmf_Visibility { 155 /** 156 * @brief The visibility level that specifies that any hap or native can be obtained. 157 */ 158 UDMF_ALL, 159 160 /** 161 * @brief The visibility level that specifies that only data providers can be obtained. 162 */ 163 UDMF_OWN_PROCESS 164 } Udmf_Visibility; 165 166 /** 167 * @brief Describes the unified data type. 168 * 169 * @since 12 170 */ 171 typedef struct OH_UdmfData OH_UdmfData; 172 173 /** 174 * @brief Describes the record type in the unified data. 175 * 176 * @since 12 177 */ 178 typedef struct OH_UdmfRecord OH_UdmfRecord; 179 180 /** 181 * @brief Defines the data provider. 182 * 183 * @since 13 184 */ 185 typedef struct OH_UdmfRecordProvider OH_UdmfRecordProvider; 186 187 /** 188 * @brief Describes some property parameters of unified data. 189 * 190 * @since 12 191 */ 192 typedef struct OH_UdmfProperty OH_UdmfProperty; 193 194 /** 195 * @brief Represents the udmf progress information. 196 * 197 * @since 15 198 */ 199 typedef struct OH_Udmf_ProgressInfo OH_Udmf_ProgressInfo; 200 201 /** 202 * @brief Represents the parameters of udmf get data with progress info. 203 * 204 * @since 15 205 */ 206 typedef struct OH_UdmfGetDataParams OH_UdmfGetDataParams; 207 208 /** 209 * @brief Defines the callback function used to return the progress information and data. 210 * 211 * @param progressInfo The progress information notified to Application. 212 * @param data Represents the unified data. 213 * @since 15 214 */ 215 typedef void (*OH_Udmf_DataProgressListener)(OH_Udmf_ProgressInfo* progressInfo, OH_UdmfData* data); 216 217 /** 218 * @brief Describes the optional arguments of data operation 219 * 220 * @since 20 221 */ 222 typedef struct OH_UdmfOptions OH_UdmfOptions; 223 224 /** 225 * @brief Indicates data loading params. 226 * 227 * @since 20 228 */ 229 typedef struct OH_UdmfDataLoadParams OH_UdmfDataLoadParams; 230 231 /** 232 * @brief Indicates data loading information. 233 * 234 * @since 20 235 */ 236 typedef struct OH_UdmfDataLoadInfo OH_UdmfDataLoadInfo; 237 238 /** 239 * @brief Indicates the callback function for loading data. 240 * 241 * @param acceptableInfo Indicates the type and number of data that can be accepted by the receiver. 242 * @return Returns the data to be loaded. 243 * @since 20 244 */ 245 typedef OH_UdmfData* (*OH_Udmf_DataLoadHandler)(OH_UdmfDataLoadInfo* acceptableInfo); 246 247 /** 248 * @brief Creation a pointer to the instance of the {@link OH_UdmfData}. 249 * 250 * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfData} 251 * structure is returned. If the operation is failed, nullptr is returned. 252 * @see OH_UdmfData. 253 * @since 12 254 */ 255 OH_UdmfData* OH_UdmfData_Create(); 256 257 /** 258 * @brief Destroy a pointer that points to the {@link OH_UdmfData} instance. 259 * 260 * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 261 * @see OH_UdmfData. 262 * @since 12 263 */ 264 void OH_UdmfData_Destroy(OH_UdmfData* pThis); 265 266 /** 267 * @brief Add one {OH_UdmfRecord} record to the {@link OH_UdmfData} data. 268 * 269 * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 270 * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. 271 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 272 * {@link UDMF_E_OK} success. 273 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 274 * @see OH_UdmfData Udmf_ErrCode. 275 * @since 12 276 */ 277 int OH_UdmfData_AddRecord(OH_UdmfData* pThis, OH_UdmfRecord* record); 278 279 /** 280 * @brief Check whether the type exists in the {@link OH_UdmfData} data. 281 * 282 * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 283 * @param type Represents a string pointer of the type. 284 * @return Returns the status of finding type. 285 * {@code false} is not existed. 286 * {@code true} is existed. 287 * @see OH_UdmfData. 288 * @since 12 289 */ 290 bool OH_UdmfData_HasType(OH_UdmfData* pThis, const char* type); 291 292 /** 293 * @brief Get all types in the {@link OH_UdmfData} data. 294 * 295 * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 296 * @param count Represents the types count that is a output param. 297 * @return Returns string array that in {@link OH_UdmfData} when input parameters valid, 298 * otherwise return nullptr. 299 * @see OH_UdmfData. 300 * @since 12 301 */ 302 char** OH_UdmfData_GetTypes(OH_UdmfData* pThis, unsigned int* count); 303 304 /** 305 * @brief Get all records in the {@link OH_UdmfData} data. 306 * 307 * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 308 * @param count Represents the records count that is a output param. 309 * @return Returns {@link OH_UdmfRecord} pointer array when input parameters valid, otherwise return nullptr. 310 * @see OH_UdmfData OH_UdmfRecord. 311 * @since 12 312 */ 313 OH_UdmfRecord** OH_UdmfData_GetRecords(OH_UdmfData* pThis, unsigned int* count); 314 315 /** 316 * @brief Defines the callback function used free the context. 317 * @param context Pointer to the context which is to be free. 318 * @since 13 319 */ 320 typedef void (*UdmfData_Finalize)(void* context); 321 322 /** 323 * @brief Creates an {@link OH_UdmfRecordProvider} instance. 324 * 325 * @return Returns the pointer to the {@link OH_UdmfRecordProvider} instance created if the operation is successful. 326 * Returns nullptr if the memory is not enough. 327 * @see OH_UdmfRecordProvider. 328 * @since 13 329 */ 330 OH_UdmfRecordProvider* OH_UdmfRecordProvider_Create(); 331 332 /** 333 * @brief Destroy an {@link OH_UdmfRecordProvider} instance. 334 * 335 * @param provider Pointer to the {@link OH_UdmfRecordProvider} instance to destroy. 336 * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}. 337 * Returns {@link UDMF_E_OK} if the operation is successful. 338 * Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected. 339 * @see OH_UdmfRecordProvider Udmf_ErrCode. 340 * @since 13 341 */ 342 int OH_UdmfRecordProvider_Destroy(OH_UdmfRecordProvider* provider); 343 344 /** 345 * @brief Defines a callback function used to obtain data by type. 346 * 347 * @param context Pointer to the context set by {@link OH_UdmfRecordProvider_SetData}. 348 * @param type Pointer to the type of data to obtain. For details, see {@link udmf_meta.h}. 349 * @return Returns the data content. 350 * @since 13 351 */ 352 typedef void* (*OH_UdmfRecordProvider_GetData)(void* context, const char* type); 353 354 /** 355 * @brief Sets a callback function to obtain data. 356 * 357 * @param provider Pointer to the {@link OH_UdmfRecordProvider} instance. 358 * @param context Pointer to the context set, which is the first parameter in OH_UdmfRecordProvider_GetData. 359 * @param callback Callback to set. For details, see {@link OH_UdmfRecordProvider_GetData}. 360 * @param finalize Optional callback that can free context when destroy provider. 361 * For details, see {@link UdmfData_Finalize}. 362 * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}. 363 * Returns {@link UDMF_E_OK} if the operation is successful. 364 * Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected. 365 * @see OH_UdmfRecordProvider OH_UdmfRecordProvider_GetData UdmfData_Finalize Udmf_ErrCode. 366 * @since 13 367 */ 368 int OH_UdmfRecordProvider_SetData(OH_UdmfRecordProvider* provider, void* context, 369 const OH_UdmfRecordProvider_GetData callback, const UdmfData_Finalize finalize); 370 371 /** 372 * @brief Creation a pointer to the instance of the {@link OH_UdmfRecord}, it's relate with UDS data. 373 * 374 * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfRecord} 375 * structure is returned. If the operation is failed, nullptr is returned. 376 * @see OH_UdmfRecord. 377 * @since 12 378 */ 379 OH_UdmfRecord* OH_UdmfRecord_Create(); 380 381 /** 382 * @brief Destroy a pointer that points to an instance of {@link OH_UdmfRecord}. 383 * 384 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 385 * @see OH_UdmfRecord. 386 * @since 12 387 */ 388 void OH_UdmfRecord_Destroy(OH_UdmfRecord* pThis); 389 390 /** 391 * @brief Add one custom data to the {@link OH_UdmfRecord} record. 392 * 393 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 394 * @param typeId Represents record type, reference udmf_meta.h. 395 * @param entry Represents custom data. 396 * @param count Represents the size of data param. 397 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 398 * {@link UDMF_E_OK} success. 399 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 400 * @see OH_UdmfRecord Udmf_ErrCode. 401 * @since 12 402 */ 403 int OH_UdmfRecord_AddGeneralEntry(OH_UdmfRecord* pThis, const char* typeId, unsigned char* entry, unsigned int count); 404 405 /** 406 * @brief Add one {OH_UdsPlainText} data to the {@link OH_UdmfRecord} record. 407 * 408 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 409 * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. 410 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 411 * {@link UDMF_E_OK} success. 412 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 413 * @see OH_UdmfRecord OH_UdsPlainText Udmf_ErrCode. 414 * @since 12 415 */ 416 int OH_UdmfRecord_AddPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText); 417 418 /** 419 * @brief Add one {OH_UdsHyperlink} data to the {@link OH_UdmfRecord} record. 420 * 421 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 422 * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}. 423 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 424 * {@link UDMF_E_OK} success. 425 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 426 * @see OH_UdmfRecord OH_UdsHyperlink Udmf_ErrCode. 427 * @since 12 428 */ 429 int OH_UdmfRecord_AddHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink); 430 431 /** 432 * @brief Add one {OH_UdsHtml} data to the {@link OH_UdmfRecord} record. 433 * 434 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 435 * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. 436 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 437 * {@link UDMF_E_OK} success. 438 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 439 * @see OH_UdmfRecord OH_UdsHtml Udmf_ErrCode. 440 * @since 12 441 */ 442 int OH_UdmfRecord_AddHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html); 443 444 /** 445 * @brief Add one {OH_UdsAppItem} data to the {@link OH_UdmfRecord} record. 446 * 447 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 448 * @param appItem Represents a pointer to an instance of {@link OH_UdsAppItem}. 449 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 450 * {@link UDMF_E_OK} success. 451 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 452 * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode. 453 * @since 12 454 */ 455 int OH_UdmfRecord_AddAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); 456 457 /** 458 * @brief Add one {OH_UdsFileUri} data to the {@link OH_UdmfRecord} record. 459 * 460 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 461 * @param fileUri Represents a pointer to an instance of {@link OH_UdsFileUri}. 462 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 463 * {@link UDMF_E_OK} success. 464 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 465 * @see OH_UdmfRecord OH_UdsFileUri Udmf_ErrCode. 466 * @since 13 467 */ 468 int OH_UdmfRecord_AddFileUri(OH_UdmfRecord* pThis, OH_UdsFileUri* fileUri); 469 470 /** 471 * @brief Add one {OH_UdsPixelMap} data to the {@link OH_UdmfRecord} record. 472 * 473 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 474 * @param pixelMap Represents a pointer to an instance of {@link OH_UdsPixelMap}. 475 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 476 * {@link UDMF_E_OK} success. 477 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 478 * @see OH_UdmfRecord OH_UdsPixelMap Udmf_ErrCode. 479 * @since 13 480 */ 481 int OH_UdmfRecord_AddPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap); 482 483 /** 484 * @brief Add one {@link OH_UdsArrayBuffer} data to the {@link OH_UdmfRecord} record. 485 * 486 * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. 487 * @param type Represents record type, reference udmf_meta.h. 488 * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}. 489 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 490 * {@link UDMF_E_OK} success. 491 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 492 * @see OH_UdmfRecord OH_UdsArrayBuffer Udmf_ErrCode. 493 * @since 13 494 */ 495 int OH_UdmfRecord_AddArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer); 496 497 /** 498 * @brief Add one {@link OH_UdsContentForm} data to the {@link OH_UdmfRecord} record. 499 * 500 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 501 * @param contentForm Represents a pointer to an instance of {@link OH_UdsContentForm}. 502 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 503 * {@link UDMF_E_OK} success. 504 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 505 * @see OH_UdmfRecord OH_UdsContentForm Udmf_ErrCode. 506 * @since 14 507 */ 508 int OH_UdmfRecord_AddContentForm(OH_UdmfRecord* pThis, OH_UdsContentForm* contentForm); 509 510 /** 511 * @brief Get all types in the {@link OH_UdmfRecord} record. 512 * 513 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 514 * @param count Represents the types count that is a output param. 515 * @return Returns string array that in {@link OH_UdmfRecord} when input parameters valid, 516 * otherwise return nullptr. 517 * @see OH_UdmfRecord. 518 * @since 12 519 */ 520 char** OH_UdmfRecord_GetTypes(OH_UdmfRecord* pThis, unsigned int* count); 521 522 /** 523 * @brief Get one entry data from the {@link OH_UdmfRecord} record. 524 * 525 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 526 * @param typeId Represents record type, reference udmf_meta.h. 527 * @param entry Represents a pointer to entry data that is a output param. 528 * @param count Represents the entry data length that is a output param. 529 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 530 * {@link UDMF_E_OK} success. 531 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 532 * {@link UDMF_ERR} Internal data error. 533 * @see OH_UdmfRecord Udmf_ErrCode. 534 * @since 12 535 */ 536 int OH_UdmfRecord_GetGeneralEntry(OH_UdmfRecord* pThis, const char* typeId, 537 unsigned char** entry, unsigned int* count); 538 539 /** 540 * @brief Get one {OH_UdsPlainText} data from the {@link OH_UdmfRecord} record. 541 * 542 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 543 * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. 544 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 545 * {@link UDMF_E_OK} success. 546 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 547 * {@link UDMF_ERR} Internal data error. 548 * @see OH_UdmfRecord OH_UdsPlainText Udmf_ErrCode. 549 * @since 12 550 */ 551 int OH_UdmfRecord_GetPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText); 552 553 /** 554 * @brief Get one {OH_UdsHyperlink} data from the {@link OH_UdmfRecord} record. 555 * 556 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 557 * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}. 558 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 559 * {@link UDMF_E_OK} success. 560 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 561 * {@link UDMF_ERR} Internal data error. 562 * @see OH_UdmfRecord OH_UdsHyperlink Udmf_ErrCode. 563 * @since 12 564 */ 565 int OH_UdmfRecord_GetHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink); 566 567 /** 568 * @brief Get one {OH_UdsHtml} data from the {@link OH_UdmfRecord} record. 569 * 570 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 571 * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. 572 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 573 * {@link UDMF_E_OK} success. 574 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 575 * {@link UDMF_ERR} Internal data error. 576 * @see OH_UdmfRecord OH_UdsHtml Udmf_ErrCode. 577 * @since 12 578 */ 579 int OH_UdmfRecord_GetHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html); 580 581 /** 582 * @brief Get one {OH_UdsAppItem} data from the {@link OH_UdmfRecord} record. 583 * 584 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 585 * @param appItem Represents a pointer to an instance of {@link OH_UdsAppItem}. 586 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 587 * {@link UDMF_E_OK} success. 588 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 589 * {@link UDMF_ERR} Internal data error. 590 * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode. 591 * @since 12 592 */ 593 int OH_UdmfRecord_GetAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); 594 595 /** 596 * @brief Get one {OH_UdsFileUri} data from the {@link OH_UdmfRecord} record. 597 * 598 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 599 * @param fileUri Represents a pointer to an instance of {@link OH_UdsFileUri}. 600 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 601 * {@link UDMF_E_OK} success. 602 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 603 * @see OH_UdmfRecord OH_UdsFileUri Udmf_ErrCode. 604 * @since 13 605 */ 606 int OH_UdmfRecord_GetFileUri(OH_UdmfRecord* pThis, OH_UdsFileUri* fileUri); 607 608 /** 609 * @brief Get one {OH_UdsPixelMap} data from the {@link OH_UdmfRecord} record. 610 * 611 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 612 * @param pixelMap Represents a pointer to an instance of {@link OH_UdsPixelMap}. 613 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 614 * {@link UDMF_E_OK} success. 615 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 616 * @see OH_UdmfRecord OH_UdsPixelMap Udmf_ErrCode. 617 * @since 13 618 */ 619 int OH_UdmfRecord_GetPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap); 620 621 /** 622 * @brief Set the data provider of the types. 623 * 624 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 625 * @param types Represents a pointer to a group of data types; 626 * @param count Represents the number of data types; 627 * @param provider Represents a pointer an instance of {@link OH_UdmfRecordProvider}. 628 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 629 * {@link UDMF_E_OK} success. 630 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 631 * @see OH_UdmfRecord OH_UdmfRecordProvider Udmf_ErrCode. 632 * @since 13 633 */ 634 int OH_UdmfRecord_SetProvider(OH_UdmfRecord* pThis, const char* const* types, unsigned int count, 635 OH_UdmfRecordProvider* provider); 636 637 /** 638 * @brief Get one {@link OH_UdsArrayBuffer} data from the {@link OH_UdmfRecord} record. 639 * 640 * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. 641 * @param type Represents record type, reference udmf_meta.h. 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_UdmfRecord OH_UdsArrayBuffer Udmf_ErrCode. 647 * @since 13 648 */ 649 int OH_UdmfRecord_GetArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer); 650 651 /** 652 * @brief Get one {@link OH_UdsContentForm} data from the {@link OH_UdmfRecord} record. 653 * 654 * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 655 * @param contentForm Represents a pointer to an instance of {@link OH_UdsContentForm}. 656 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 657 * {@link UDMF_E_OK} success. 658 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 659 * @see OH_UdmfRecord OH_UdsContentForm Udmf_ErrCode. 660 * @since 14 661 */ 662 int OH_UdmfRecord_GetContentForm(OH_UdmfRecord* pThis, OH_UdsContentForm* contentForm); 663 664 /** 665 * @brief Get primary {@link OH_UdsPlainText} data from the {@link OH_UdmfData}. 666 * 667 * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 668 * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. 669 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 670 * {@link UDMF_E_OK} success. 671 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 672 * @see OH_UdmfData OH_UdsPlainText Udmf_ErrCode. 673 * @since 13 674 */ 675 int OH_UdmfData_GetPrimaryPlainText(OH_UdmfData* data, OH_UdsPlainText* plainText); 676 677 /** 678 * @brief Get one {@link OH_UdsHtml} data from the {@link OH_UdmfData}. 679 * 680 * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 681 * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. 682 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 683 * {@link UDMF_E_OK} success. 684 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 685 * @see OH_UdmfData OH_UdsHtml Udmf_ErrCode. 686 * @since 13 687 */ 688 int OH_UdmfData_GetPrimaryHtml(OH_UdmfData* data, OH_UdsHtml* html); 689 690 /** 691 * @brief Get the count of {@link OH_UdmfRecord} in the {@link OH_UdmfData}. 692 * 693 * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 694 * @return Returns the count of {@link OH_UdmfRecord} 695 * @see OH_UdmfData. 696 * @since 13 697 */ 698 int OH_UdmfData_GetRecordCount(OH_UdmfData* data); 699 700 /** 701 * @brief Get the record of the specified index from the {@link OH_UdmfData}. 702 * 703 * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 704 * @param index Represents the index of {@link OH_UdmfRecord} in the {@link OH_UdmfData}. 705 * @return Returns {@link OH_UdmfRecord} pointer when input parameters valid, otherwise return nullptr. 706 * @see OH_UdmfData. 707 * @since 13 708 */ 709 OH_UdmfRecord* OH_UdmfData_GetRecord(OH_UdmfData* data, unsigned int index); 710 711 /** 712 * @brief Checks whether the UDMF data is from a local device. 713 * 714 * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 715 * @return Returns a boolean value, which indicates whether the UDMF data is from a local device. 716 * The value {@code true} means the data is from a local device. 717 * The value {@code false} means the opposite. 718 * @see OH_UdmfData. 719 * @since 13 720 */ 721 bool OH_UdmfData_IsLocal(OH_UdmfData* data); 722 723 /** 724 * @brief Creation a pointer to the instance of the {@link OH_UdmfProperty} 725 * from a {@link OH_UdmfData} data. 726 * 727 * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. 728 * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfProperty} 729 * structure is returned. If the operation is failed, nullptr is returned. 730 * @see OH_UdmfData OH_UdmfProperty. 731 * @since 12 732 */ 733 OH_UdmfProperty* OH_UdmfProperty_Create(OH_UdmfData* unifiedData); 734 735 /** 736 * @brief Destroy a pointer that points to the {@link OH_UdmfProperty} instance. 737 * 738 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 739 * @see OH_UdmfProperty. 740 * @since 12 741 */ 742 void OH_UdmfProperty_Destroy(OH_UdmfProperty* pThis); 743 744 /** 745 * @brief Get tag value from the {@link OH_UdmfProperty}. 746 * 747 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 748 * @return Returns a pointer of the tag value string when input parameters valid, otherwise return nullptr. 749 * @see OH_UdmfProperty. 750 * @since 12 751 */ 752 const char* OH_UdmfProperty_GetTag(OH_UdmfProperty* pThis); 753 754 /** 755 * @brief Get timestamp value from the {@link OH_UdmfProperty}. 756 * 757 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 758 * @return Returns timestamp value. 759 * @see OH_UdmfProperty 760 * @since 12 761 */ 762 int64_t OH_UdmfProperty_GetTimestamp(OH_UdmfProperty* pThis); 763 764 /** 765 * @brief Get share option value from the {@link OH_UdmfProperty}. 766 * 767 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 768 * @return Returns {@link Udmf_ShareOption} value. 769 * @see OH_UdmfProperty Udmf_ShareOption 770 * @since 12 771 */ 772 Udmf_ShareOption OH_UdmfProperty_GetShareOption(OH_UdmfProperty* pThis); 773 774 /** 775 * @brief Get integer value by key from the {@link OH_UdmfProperty}. 776 * 777 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 778 * @param key Represents key-value pair's key 779 * @param defaultValue Represents when get value failure. 780 * @return Returns value associated with the key in successfully, otherwise return defaultValue. 781 * @see OH_UdmfProperty. 782 * @since 12 783 */ 784 int OH_UdmfProperty_GetExtrasIntParam(OH_UdmfProperty* pThis, 785 const char* key, int defaultValue); 786 787 /** 788 * @brief Get tag value from the {@link OH_UdmfProperty}. 789 * 790 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 791 * @param key Represents key-value pair's key. 792 * @return Returns a pointer of the key value string when input parameters valid, otherwise return nullptr. 793 * @see OH_UdmfProperty 794 * @since 12 795 */ 796 const char* OH_UdmfProperty_GetExtrasStringParam(OH_UdmfProperty* pThis, const char* key); 797 798 /** 799 * @brief Set tag value to {@link OH_UdmfProperty} . 800 * 801 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 802 * @param tag Represents new tag param. 803 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 804 * {@link UDMF_E_OK} success. 805 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 806 * @see OH_UdmfProperty Udmf_ErrCode. 807 * @since 12 808 */ 809 int OH_UdmfProperty_SetTag(OH_UdmfProperty* pThis, const char* tag); 810 811 /** 812 * @brief Set Udmf_ShareOption value to {@link OH_UdmfProperty}. 813 * 814 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 815 * @param option Represents new {@link Udmf_ShareOption} param. 816 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 817 * {@link UDMF_E_OK} success. 818 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 819 * @see OH_UdmfProperty Udmf_ShareOption Udmf_ErrCode. 820 * @since 12 821 */ 822 int OH_UdmfProperty_SetShareOption(OH_UdmfProperty* pThis, Udmf_ShareOption option); 823 824 /** 825 * @brief Set extras param to {@link OH_UdmfProperty}. 826 * 827 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 828 * @param key Represents extras param's key value. 829 * @param param Represents value of k-v pairs. 830 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 831 * {@link UDMF_E_OK} success. 832 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 833 * @see OH_UdmfProperty Udmf_ErrCode. 834 * @since 12 835 */ 836 int OH_UdmfProperty_SetExtrasIntParam(OH_UdmfProperty* pThis, const char* key, int param); 837 838 /** 839 * @brief Set extras param to {@link OH_UdmfProperty}. 840 * 841 * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 842 * @param key Represents extras param's key value. 843 * @param param Represents value of k-v pairs. 844 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 845 * {@link UDMF_E_OK} success. 846 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 847 * @see OH_UdmfProperty Udmf_ErrCode. 848 * @since 12 849 */ 850 int OH_UdmfProperty_SetExtrasStringParam(OH_UdmfProperty* pThis, 851 const char* key, const char* param); 852 853 /** 854 * @brief Creation a pointer to the instance of the {@link OH_UdmfOptions}. 855 * 856 * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfOptions} 857 * structure is returned. If the operation is failed, nullptr is returned. 858 * @see OH_UdmfOptions. 859 * @since 20 860 */ 861 OH_UdmfOptions* OH_UdmfOptions_Create(); 862 863 /** 864 * @brief Destroy the heap memory pointed to by the pointer of {@link OH_UdmfOptions}. 865 * Note that this function cannot be called repeatedly for the same pointer. 866 * 867 * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. 868 * @see OH_UdmfOptions. 869 * @since 20 870 */ 871 void OH_UdmfOptions_Destroy(OH_UdmfOptions* pThis); 872 873 /** 874 * @brief Get key from the {@link OH_UdmfOptions}. 875 * 876 * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. 877 * @return Returns a pointer of the value string when input args normally, otherwise return nullptr. 878 * @see OH_UdmfOptions 879 * @since 20 880 */ 881 const char* OH_UdmfOptions_GetKey(OH_UdmfOptions* pThis); 882 883 /** 884 * @brief Set the key to the {@link OH_UdmfOptions}. 885 * 886 * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. 887 * @param key Represents a new string value of the key. 888 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 889 * {@link UDMF_E_OK} success. 890 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 891 * @see OH_UdmfOptions Udmf_ErrCode 892 * @since 20 893 */ 894 int OH_UdmfOptions_SetKey(OH_UdmfOptions* pThis, const char* key); 895 896 /** 897 * @brief Get intention from the {@link OH_UdmfOptions}. 898 * 899 * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. 900 * @return Returns {@link Udmf_Intention} value. 901 * @see OH_UdmfOptions Udmf_Intention 902 * @since 20 903 */ 904 Udmf_Intention OH_UdmfOptions_GetIntention(OH_UdmfOptions* pThis); 905 906 /** 907 * @brief Set intention value to {@link OH_UdmfOptions}. 908 * 909 * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. 910 * @param intention Represents new {@link Udmf_Intention} param. 911 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 912 * {@link UDMF_E_OK} success. 913 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 914 * @see OH_UdmfOptions Udmf_Intention Udmf_ErrCode. 915 * @since 20 916 */ 917 int OH_UdmfOptions_SetIntention(OH_UdmfOptions* pThis, Udmf_Intention intention); 918 919 /** 920 * @brief Reset {@link OH_UdmfOptions} to default. 921 * 922 * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. 923 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 924 * {@link UDMF_E_OK} success. 925 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 926 * @see OH_UdmfOptions Udmf_ErrCode. 927 * @since 20 928 */ 929 int OH_UdmfOptions_Reset(OH_UdmfOptions* pThis); 930 931 /** 932 * @brief Get visibility from the {@link OH_UdmfOptions}. 933 * 934 * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. 935 * @return Returns {@link Udmf_Visibility} value. 936 * @see OH_UdmfOptions Udmf_Visibility 937 * @since 20 938 */ 939 Udmf_Visibility OH_UdmfOptions_GetVisibility(OH_UdmfOptions* pThis); 940 941 /** 942 * @brief Set visibility value to {@link OH_UdmfOptions}. 943 * 944 * @param pThis Represents a pointer to an instance of {@link OH_UdmfOptions}. 945 * @param visibility Represents new {@link Udmf_Visibility} param. 946 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 947 * {@link UDMF_E_OK} success. 948 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 949 * @see OH_UdmfOptions Udmf_Visibility Udmf_ErrCode. 950 * @since 20 951 */ 952 int OH_UdmfOptions_SetVisibility(OH_UdmfOptions* pThis, Udmf_Visibility visibility); 953 954 /** 955 * @brief Get {@link OH_UdmfData} data from udmf database. 956 * 957 * @param key Represents database store's key value. 958 * @param intention Represents data type {@link Udmf_Intention} 959 * @param unifiedData Represents output params of {@link OH_UdmfData}; 960 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 961 * {@link UDMF_E_OK} success. 962 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 963 * {@link UDMF_ERR} Internal data error. 964 * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode. 965 * @since 12 966 */ 967 int OH_Udmf_GetUnifiedData(const char* key, Udmf_Intention intention, OH_UdmfData* unifiedData); 968 969 /** 970 * @brief Get {@link OH_UdmfData} data array from udmf database by intention. 971 * 972 * @param options Represents a pointer to an instance of {@link OH_UdmfOptions}. 973 * @param dataArray Represents output params of {@link OH_UdmfData}. 974 * This pointer needs to be released using the {@link OH_Udmf_DestroyDataArray} function. 975 * @param dataSize Represents the data count of output params. 976 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 977 * {@link UDMF_E_OK} success. 978 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 979 * {@link UDMF_ERR} Internal data error. 980 * @see OH_UdmfData Udmf_Intention Udmf_ErrCode. 981 * @since 20 982 */ 983 int OH_Udmf_GetUnifiedDataByOptions(OH_UdmfOptions* options, OH_UdmfData** dataArray, unsigned int* dataSize); 984 985 /** 986 * @brief Set {@link OH_UdmfData} data to database. 987 * 988 * @param intention Represents data type {@link Udmf_Intention}. 989 * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. 990 * @param key Represents return value after set data to database successfully, 991 * it's memory size not less than {@link UDMF_KEY_BUFFER_LEN}. 992 * @param keyLen Represents size of key param. 993 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 994 * {@link UDMF_E_OK} success. 995 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 996 * {@link UDMF_ERR} Internal data error. 997 * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode. 998 * @since 12 999 */ 1000 int OH_Udmf_SetUnifiedData(Udmf_Intention intention, OH_UdmfData* unifiedData, 1001 char* key, unsigned int keyLen); 1002 1003 /** 1004 * @brief Set {@link OH_UdmfData} data to database with options. 1005 * 1006 * @param options Represents a pointer to an instance of {@link OH_UdmfOptions}. 1007 * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. 1008 * @param key Represents return value after set data to database successfully, 1009 * it's memory size not less than {@link UDMF_KEY_BUFFER_LEN}. 1010 * @param keyLen Represents size of key param. 1011 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 1012 * {@link UDMF_E_OK} success. 1013 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 1014 * {@link UDMF_ERR} Internal data error. 1015 * @see OH_UdmfOptions OH_UdmfData Udmf_ErrCode. 1016 * @since 20 1017 */ 1018 int OH_Udmf_SetUnifiedDataByOptions(OH_UdmfOptions* options, OH_UdmfData *unifiedData, char *key, unsigned int keyLen); 1019 1020 /** 1021 * @brief Update {@link OH_UdmfData} data to database with options. 1022 * 1023 * @param options Represents a pointer to an instance of {@link OH_UdmfOptions}. 1024 * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. 1025 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 1026 * {@link UDMF_E_OK} success. 1027 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 1028 * {@link UDMF_ERR} Internal data error. 1029 * @see OH_UdmfOptions OH_UdmfData Udmf_ErrCode. 1030 * @since 20 1031 */ 1032 int OH_Udmf_UpdateUnifiedData(OH_UdmfOptions* options, OH_UdmfData* unifiedData); 1033 1034 /** 1035 * @brief Delete {@link OH_UdmfData} data of database with options. 1036 * 1037 * @param options Represents a pointer to an instance of {@link OH_UdmfOptions}. 1038 * @param dataArray Represents output params of {@link OH_UdmfData}. 1039 * This pointer needs to be released using the {@link OH_Udmf_DestroyDataArray} function. 1040 * @param dataSize Represents the data count of output params. 1041 * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 1042 * {@link UDMF_E_OK} success. 1043 * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 1044 * {@link UDMF_ERR} Internal data error. 1045 * @see OH_UdmfData Udmf_Intention Udmf_ErrCode. 1046 * @since 20 1047 */ 1048 int OH_Udmf_DeleteUnifiedData(OH_UdmfOptions* options, OH_UdmfData** dataArray, unsigned int* dataSize); 1049 1050 /** 1051 * @brief Destroy data array memory. 1052 * 1053 * @param dataArray Represents a point to {@link OH_UdmfData}. 1054 * @param dataSize Represents data size in list. 1055 * @see OH_UdmfData 1056 * @since 20 1057 */ 1058 void OH_Udmf_DestroyDataArray(OH_UdmfData** dataArray, unsigned int dataSize); 1059 1060 /** 1061 * @brief Gets the progress from the {@OH_Udmf_ProgressInfo}. 1062 * 1063 * @param progressInfo Represents a pointer to an instance of {@link OH_Udmf_ProgressInfo}. 1064 * @return Returns the progress. 1065 * @see OH_Udmf_ProgressInfo 1066 * @since 15 1067 */ 1068 int OH_UdmfProgressInfo_GetProgress(OH_Udmf_ProgressInfo* progressInfo); 1069 1070 /** 1071 * @brief Gets the status from the {@OH_Udmf_ProgressInfo}. 1072 * 1073 * @param progressInfo Represents a pointer to an instance of {@link OH_Udmf_ProgressInfo}. 1074 * @return Returns the status code. See {@link Udmf_ListenerStatus}. 1075 * @see OH_Udmf_ProgressInfo Udmf_ListenerStatus 1076 * @since 15 1077 */ 1078 int OH_UdmfProgressInfo_GetStatus(OH_Udmf_ProgressInfo* progressInfo); 1079 1080 /** 1081 * @brief Creation a pointer to the instance of the {@link OH_UdmfGetDataParams}. 1082 * 1083 * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfGetDataParams} 1084 * structure is returned. If the operation is failed, nullptr is returned. 1085 * @see OH_UdmfGetDataParams 1086 * @since 15 1087 */ 1088 OH_UdmfGetDataParams* OH_UdmfGetDataParams_Create(); 1089 1090 /** 1091 * @brief Destroy a pointer that points to an instance of {@link OH_UdmfGetDataParams}. 1092 * 1093 * @param pThis Represents a pointer to an instance of {@link OH_UdmfGetDataParams}. 1094 * @see OH_UdmfGetDataParams 1095 * @since 15 1096 */ 1097 void OH_UdmfGetDataParams_Destroy(OH_UdmfGetDataParams* pThis); 1098 1099 /** 1100 * @brief Sets the destination uri to the {@OH_UdmfGetDataParams}. 1101 * 1102 * @param params Represents a pointer to an instance of {@link OH_UdmfGetDataParams}. 1103 * @param destUri Pointer to a destination uri. 1104 * @see OH_UdmfGetDataParams 1105 * @since 15 1106 */ 1107 void OH_UdmfGetDataParams_SetDestUri(OH_UdmfGetDataParams* params, const char* destUri); 1108 1109 /** 1110 * @brief Sets the file conflict options to the {@OH_UdmfGetDataParams}. 1111 * 1112 * @param params Represents a pointer to an instance of {@link OH_UdmfGetDataParams}. 1113 * @param options Represents to the file conflict options. 1114 * @see OH_UdmfGetDataParams Udmf_FileConflictOptions 1115 * @since 15 1116 */ 1117 void OH_UdmfGetDataParams_SetFileConflictOptions(OH_UdmfGetDataParams* params, const Udmf_FileConflictOptions options); 1118 1119 /** 1120 * @brief Sets the progress indicator to the {@OH_UdmfGetDataParams}. 1121 * 1122 * @param params Represents a pointer to an instance of {@link OH_UdmfGetDataParams}. 1123 * @param progressIndicator Represents to the progress indicator. 1124 * @see OH_UdmfGetDataParams Udmf_ProgressIndicator 1125 * @since 15 1126 */ 1127 void OH_UdmfGetDataParams_SetProgressIndicator(OH_UdmfGetDataParams* params, 1128 const Udmf_ProgressIndicator progressIndicator); 1129 1130 /** 1131 * @brief Sets the progress indicator to the {@OH_UdmfGetDataParams}. 1132 * 1133 * @param params Represents a pointer to an instance of {@link OH_UdmfGetDataParams}. 1134 * @param dataProgressListener Represents to the data progress listener. 1135 * @see OH_UdmfGetDataParams OH_Udmf_DataProgressListener 1136 * @since 15 1137 */ 1138 void OH_UdmfGetDataParams_SetDataProgressListener(OH_UdmfGetDataParams* params, 1139 const OH_Udmf_DataProgressListener dataProgressListener); 1140 1141 /** 1142 * @brief Sets the acceptable info to the {@OH_UdmfGetDataParams}. 1143 * 1144 * @param params Represents a pointer to an instance of {@link OH_UdmfGetDataParams}. 1145 * @param acceptableInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. 1146 * @see OH_UdmfGetDataParams OH_UdmfDataLoadInfo 1147 * @since 20 1148 */ 1149 void OH_UdmfGetDataParams_SetAcceptableInfo(OH_UdmfGetDataParams* params, OH_UdmfDataLoadInfo* acceptableInfo); 1150 1151 /** 1152 * @brief Creation a pointer to the instance of the {@link OH_UdmfDataLoadParams}. 1153 * 1154 * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfDataLoadParams} 1155 * structure is returned. If the operation is failed, nullptr is returned. 1156 * @see OH_UdmfDataLoadParams 1157 * @since 20 1158 */ 1159 OH_UdmfDataLoadParams* OH_UdmfDataLoadParams_Create(); 1160 1161 /** 1162 * @brief Destroy a pointer that points to an instance of {@link OH_UdmfDataLoadParams}. 1163 * 1164 * @param pThis Represents a pointer to an instance of {@link OH_UdmfDataLoadParams}. 1165 * @see OH_UdmfDataLoadParams 1166 * @since 20 1167 */ 1168 void OH_UdmfDataLoadParams_Destroy(OH_UdmfDataLoadParams* pThis); 1169 1170 /** 1171 * @brief Sets the data load handler to the {@OH_UdmfDataLoadParams}. 1172 * 1173 * @param params Represents a pointer to an instance of {@link OH_UdmfDataLoadParams}. 1174 * @param dataLoadHandler Represents to the data load handler. 1175 * @see OH_UdmfDataLoadParams OH_Udmf_DataLoadHandler 1176 * @since 20 1177 */ 1178 void OH_UdmfDataLoadParams_SetLoadHandler(OH_UdmfDataLoadParams* params, const OH_Udmf_DataLoadHandler dataLoadHandler); 1179 1180 /** 1181 * @brief Sets the data load info to the {@OH_UdmfDataLoadParams}. 1182 * 1183 * @param params Represents a pointer to an instance of {@link OH_UdmfDataLoadParams}. 1184 * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. 1185 * @see OH_UdmfDataLoadParams OH_UdmfDataLoadInfo 1186 * @since 20 1187 */ 1188 void OH_UdmfDataLoadParams_SetDataLoadInfo(OH_UdmfDataLoadParams* params, OH_UdmfDataLoadInfo* dataLoadInfo); 1189 1190 /** 1191 * @brief Creation a pointer to the instance of the {@link OH_UdmfDataLoadInfo}. 1192 * 1193 * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfDataLoadInfo} 1194 * structure is returned. If the operation is failed, nullptr is returned. 1195 * @see OH_UdmfDataLoadInfo 1196 * @since 20 1197 */ 1198 OH_UdmfDataLoadInfo* OH_UdmfDataLoadInfo_Create(); 1199 1200 /** 1201 * @brief Destroy the heap memory pointed to by the pointer of {@link OH_UdmfDataLoadInfo}. 1202 * Note that this function cannot be called repeatedly for the same pointer. 1203 * 1204 * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. 1205 * @see OH_UdmfDataLoadInfo 1206 * @since 20 1207 */ 1208 void OH_UdmfDataLoadInfo_Destroy(OH_UdmfDataLoadInfo* dataLoadInfo); 1209 1210 /** 1211 * @brief Gets the types from the {@OH_UdmfDataLoadInfo}. 1212 * 1213 * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. 1214 * @param count the types count of data. 1215 * @return Returns the types of data. 1216 * @see OH_UdmfDataLoadInfo 1217 * @since 20 1218 */ 1219 char** OH_UdmfDataLoadInfo_GetTypes(OH_UdmfDataLoadInfo* dataLoadInfo, unsigned int* count); 1220 1221 /** 1222 * @brief Sets the data load info to the {@OH_UdmfDataLoadInfo}. 1223 * 1224 * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. 1225 * @param type Represents the type of data. 1226 * @see OH_UdmfDataLoadInfo 1227 * @since 20 1228 */ 1229 void OH_UdmfDataLoadInfo_SetType(OH_UdmfDataLoadInfo* dataLoadInfo, const char* type); 1230 1231 /** 1232 * @brief Gets the record count from the {@OH_UdmfDataLoadInfo}. 1233 * 1234 * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. 1235 * @return Returns the record count. 1236 * @see OH_UdmfDataLoadInfo 1237 * @since 20 1238 */ 1239 int OH_UdmfDataLoadInfo_GetRecordCount(OH_UdmfDataLoadInfo* dataLoadInfo); 1240 1241 /** 1242 * @brief Sets the record count to the {@OH_UdmfDataLoadInfo}. 1243 * 1244 * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. 1245 * @param recordCount Represents the types of data. 1246 * @see OH_UdmfDataLoadInfo 1247 * @since 20 1248 */ 1249 void OH_UdmfDataLoadInfo_SetRecordCount(OH_UdmfDataLoadInfo* dataLoadInfo, unsigned int recordCount); 1250 1251 #ifdef __cplusplus 1252 }; 1253 #endif 1254 1255 /** @} */ 1256 #endif