17777dab0Sopenharmony_ci/* 27777dab0Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd. 37777dab0Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License"); 47777dab0Sopenharmony_ci * you may not use this file except in compliance with the License. 57777dab0Sopenharmony_ci * You may obtain a copy of the License at 67777dab0Sopenharmony_ci * 77777dab0Sopenharmony_ci * http://www.apache.org/licenses/LICENSE-2.0 87777dab0Sopenharmony_ci * 97777dab0Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software 107777dab0Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS, 117777dab0Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 127777dab0Sopenharmony_ci * See the License for the specific language governing permissions and 137777dab0Sopenharmony_ci * limitations under the License. 147777dab0Sopenharmony_ci */ 157777dab0Sopenharmony_ci 167777dab0Sopenharmony_ci/** 177777dab0Sopenharmony_ci * @addtogroup UDMF 187777dab0Sopenharmony_ci * @{ 197777dab0Sopenharmony_ci * 207777dab0Sopenharmony_ci * @brief The Unified Data Management Framework(UDMF) aims to define various standards 217777dab0Sopenharmony_ci * for data across applications, devices, and platforms, providing a unified OpenHarmony 227777dab0Sopenharmony_ci * data language and standardized data access and reading paths. 237777dab0Sopenharmony_ci * 247777dab0Sopenharmony_ci * @since 12 257777dab0Sopenharmony_ci */ 267777dab0Sopenharmony_ci 277777dab0Sopenharmony_ci/** 287777dab0Sopenharmony_ci * @file udmf.h 297777dab0Sopenharmony_ci * 307777dab0Sopenharmony_ci * @brief Provides unified data management framework related functions and enumerations. 317777dab0Sopenharmony_ci * 327777dab0Sopenharmony_ci * @kit ArkData 337777dab0Sopenharmony_ci * @library libudmf.so 347777dab0Sopenharmony_ci * @syscap SystemCapability.DistributedDataManager.UDMF.Core 357777dab0Sopenharmony_ci * 367777dab0Sopenharmony_ci * @since 12 377777dab0Sopenharmony_ci */ 387777dab0Sopenharmony_ci 397777dab0Sopenharmony_ci#ifndef UDMF_H 407777dab0Sopenharmony_ci#define UDMF_H 417777dab0Sopenharmony_ci 427777dab0Sopenharmony_ci#include <inttypes.h> 437777dab0Sopenharmony_ci#include <stdbool.h> 447777dab0Sopenharmony_ci#include "uds.h" 457777dab0Sopenharmony_ci 467777dab0Sopenharmony_ci#ifdef __cplusplus 477777dab0Sopenharmony_ciextern "C" { 487777dab0Sopenharmony_ci#endif 497777dab0Sopenharmony_ci 507777dab0Sopenharmony_ci/** 517777dab0Sopenharmony_ci * @brief The key minimum memory space size of Unified Data. 527777dab0Sopenharmony_ci * 537777dab0Sopenharmony_ci * @since 12 547777dab0Sopenharmony_ci */ 557777dab0Sopenharmony_ci#define UDMF_KEY_BUFFER_LEN (512) 567777dab0Sopenharmony_ci 577777dab0Sopenharmony_ci/** 587777dab0Sopenharmony_ci * @brief Describe the intention type of the udmf. 597777dab0Sopenharmony_ci * 607777dab0Sopenharmony_ci * @since 12 617777dab0Sopenharmony_ci */ 627777dab0Sopenharmony_citypedef enum Udmf_Intention { 637777dab0Sopenharmony_ci /** 647777dab0Sopenharmony_ci * @brief The intention is drag. 657777dab0Sopenharmony_ci */ 667777dab0Sopenharmony_ci UDMF_INTENTION_DRAG, 677777dab0Sopenharmony_ci /** 687777dab0Sopenharmony_ci * @brief The intention is pasteboard. 697777dab0Sopenharmony_ci */ 707777dab0Sopenharmony_ci UDMF_INTENTION_PASTEBOARD, 717777dab0Sopenharmony_ci} Udmf_Intention; 727777dab0Sopenharmony_ci 737777dab0Sopenharmony_ci/** 747777dab0Sopenharmony_ci * @brief Describe intra-device usage range type enumeration. 757777dab0Sopenharmony_ci * 767777dab0Sopenharmony_ci * @since 12 777777dab0Sopenharmony_ci */ 787777dab0Sopenharmony_citypedef enum Udmf_ShareOption { 797777dab0Sopenharmony_ci /** 807777dab0Sopenharmony_ci * @brief Invalid share option. 817777dab0Sopenharmony_ci */ 827777dab0Sopenharmony_ci SHARE_OPTIONS_INVALID, 837777dab0Sopenharmony_ci /** 847777dab0Sopenharmony_ci * @brief Allowed to be used in the same application on this device. 857777dab0Sopenharmony_ci */ 867777dab0Sopenharmony_ci SHARE_OPTIONS_IN_APP, 877777dab0Sopenharmony_ci /** 887777dab0Sopenharmony_ci * @brief Allowed to be used in the cross application on this device. 897777dab0Sopenharmony_ci */ 907777dab0Sopenharmony_ci SHARE_OPTIONS_CROSS_APP 917777dab0Sopenharmony_ci} Udmf_ShareOption; 927777dab0Sopenharmony_ci 937777dab0Sopenharmony_ci/** 947777dab0Sopenharmony_ci * @brief Describes the unified data type. 957777dab0Sopenharmony_ci * 967777dab0Sopenharmony_ci * @since 12 977777dab0Sopenharmony_ci */ 987777dab0Sopenharmony_citypedef struct OH_UdmfData OH_UdmfData; 997777dab0Sopenharmony_ci 1007777dab0Sopenharmony_ci/** 1017777dab0Sopenharmony_ci * @brief Describes the record type in the unified data. 1027777dab0Sopenharmony_ci * 1037777dab0Sopenharmony_ci * @since 12 1047777dab0Sopenharmony_ci */ 1057777dab0Sopenharmony_citypedef struct OH_UdmfRecord OH_UdmfRecord; 1067777dab0Sopenharmony_ci 1077777dab0Sopenharmony_ci/** 1087777dab0Sopenharmony_ci * @brief Defines the data provider. 1097777dab0Sopenharmony_ci * 1107777dab0Sopenharmony_ci * @since 13 1117777dab0Sopenharmony_ci */ 1127777dab0Sopenharmony_citypedef struct OH_UdmfRecordProvider OH_UdmfRecordProvider; 1137777dab0Sopenharmony_ci 1147777dab0Sopenharmony_ci/** 1157777dab0Sopenharmony_ci * @brief Describes some property parameters of unified data. 1167777dab0Sopenharmony_ci * 1177777dab0Sopenharmony_ci * @since 12 1187777dab0Sopenharmony_ci */ 1197777dab0Sopenharmony_citypedef struct OH_UdmfProperty OH_UdmfProperty; 1207777dab0Sopenharmony_ci 1217777dab0Sopenharmony_ci/** 1227777dab0Sopenharmony_ci * @brief Creation a pointer to the instance of the {@link OH_UdmfData}. 1237777dab0Sopenharmony_ci * 1247777dab0Sopenharmony_ci * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfData} 1257777dab0Sopenharmony_ci * structure is returned. If the operation is failed, nullptr is returned. 1267777dab0Sopenharmony_ci * @see OH_UdmfData. 1277777dab0Sopenharmony_ci * @since 12 1287777dab0Sopenharmony_ci */ 1297777dab0Sopenharmony_ciOH_UdmfData* OH_UdmfData_Create(); 1307777dab0Sopenharmony_ci 1317777dab0Sopenharmony_ci/** 1327777dab0Sopenharmony_ci * @brief Destroy a pointer that points to the {@link OH_UdmfData} instance. 1337777dab0Sopenharmony_ci * 1347777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 1357777dab0Sopenharmony_ci * @see OH_UdmfData. 1367777dab0Sopenharmony_ci * @since 12 1377777dab0Sopenharmony_ci */ 1387777dab0Sopenharmony_civoid OH_UdmfData_Destroy(OH_UdmfData* pThis); 1397777dab0Sopenharmony_ci 1407777dab0Sopenharmony_ci/** 1417777dab0Sopenharmony_ci * @brief Add one {OH_UdmfRecord} record to the {@link OH_UdmfData} data. 1427777dab0Sopenharmony_ci * 1437777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 1447777dab0Sopenharmony_ci * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. 1457777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 1467777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 1477777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 1487777dab0Sopenharmony_ci * @see OH_UdmfData Udmf_ErrCode. 1497777dab0Sopenharmony_ci * @since 12 1507777dab0Sopenharmony_ci */ 1517777dab0Sopenharmony_ciint OH_UdmfData_AddRecord(OH_UdmfData* pThis, OH_UdmfRecord* record); 1527777dab0Sopenharmony_ci 1537777dab0Sopenharmony_ci/** 1547777dab0Sopenharmony_ci * @brief Check whether the type exists in the {@link OH_UdmfData} data. 1557777dab0Sopenharmony_ci * 1567777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 1577777dab0Sopenharmony_ci * @param type Represents a string pointer of the type. 1587777dab0Sopenharmony_ci * @return Returns the status of finding type. 1597777dab0Sopenharmony_ci * {@code false} is not existed. 1607777dab0Sopenharmony_ci * {@code true} is existed. 1617777dab0Sopenharmony_ci * @see OH_UdmfData. 1627777dab0Sopenharmony_ci * @since 12 1637777dab0Sopenharmony_ci */ 1647777dab0Sopenharmony_cibool OH_UdmfData_HasType(OH_UdmfData* pThis, const char* type); 1657777dab0Sopenharmony_ci 1667777dab0Sopenharmony_ci/** 1677777dab0Sopenharmony_ci * @brief Get all types in the {@link OH_UdmfData} data. 1687777dab0Sopenharmony_ci * 1697777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 1707777dab0Sopenharmony_ci * @param count Represents the types count that is a output param. 1717777dab0Sopenharmony_ci * @return Returns string array that in {@link OH_UdmfData} when input parameters valid, 1727777dab0Sopenharmony_ci * otherwise return nullptr. 1737777dab0Sopenharmony_ci * @see OH_UdmfData. 1747777dab0Sopenharmony_ci * @since 12 1757777dab0Sopenharmony_ci */ 1767777dab0Sopenharmony_cichar** OH_UdmfData_GetTypes(OH_UdmfData* pThis, unsigned int* count); 1777777dab0Sopenharmony_ci 1787777dab0Sopenharmony_ci/** 1797777dab0Sopenharmony_ci * @brief Get all records in the {@link OH_UdmfData} data. 1807777dab0Sopenharmony_ci * 1817777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}. 1827777dab0Sopenharmony_ci * @param count Represents the records count that is a output param. 1837777dab0Sopenharmony_ci * @return Returns {@link OH_UdmfRecord} pointer array when input parameters valid, otherwise return nullptr. 1847777dab0Sopenharmony_ci * @see OH_UdmfData OH_UdmfRecord. 1857777dab0Sopenharmony_ci * @since 12 1867777dab0Sopenharmony_ci */ 1877777dab0Sopenharmony_ciOH_UdmfRecord** OH_UdmfData_GetRecords(OH_UdmfData* pThis, unsigned int* count); 1887777dab0Sopenharmony_ci 1897777dab0Sopenharmony_ci/** 1907777dab0Sopenharmony_ci * @brief Defines the callback function used free the context. 1917777dab0Sopenharmony_ci * @param context Pointer to the context which is to be free. 1927777dab0Sopenharmony_ci * @since 13 1937777dab0Sopenharmony_ci */ 1947777dab0Sopenharmony_citypedef void (*UdmfData_Finalize)(void* context); 1957777dab0Sopenharmony_ci 1967777dab0Sopenharmony_ci/** 1977777dab0Sopenharmony_ci * @brief Creates an {@link OH_UdmfRecordProvider} instance. 1987777dab0Sopenharmony_ci * 1997777dab0Sopenharmony_ci * @return Returns the pointer to the {@link OH_UdmfRecordProvider} instance created if the operation is successful. 2007777dab0Sopenharmony_ci * Returns nullptr if the memory is not enough. 2017777dab0Sopenharmony_ci * @see OH_UdmfRecordProvider. 2027777dab0Sopenharmony_ci * @since 13 2037777dab0Sopenharmony_ci */ 2047777dab0Sopenharmony_ciOH_UdmfRecordProvider* OH_UdmfRecordProvider_Create(); 2057777dab0Sopenharmony_ci 2067777dab0Sopenharmony_ci/** 2077777dab0Sopenharmony_ci * @brief Destroy an {@link OH_UdmfRecordProvider} instance. 2087777dab0Sopenharmony_ci * 2097777dab0Sopenharmony_ci * @param subscriber Pointer to the {@link OH_UdmfRecordProvider} instance to destroy. 2107777dab0Sopenharmony_ci * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}. 2117777dab0Sopenharmony_ci * Returns {@link UDMF_E_OK} if the operation is successful. 2127777dab0Sopenharmony_ci * Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected. 2137777dab0Sopenharmony_ci * @see OH_UdmfRecordProvider Udmf_ErrCode. 2147777dab0Sopenharmony_ci * @since 13 2157777dab0Sopenharmony_ci */ 2167777dab0Sopenharmony_ciint OH_UdmfRecordProvider_Destroy(OH_UdmfRecordProvider* provider); 2177777dab0Sopenharmony_ci 2187777dab0Sopenharmony_ci/** 2197777dab0Sopenharmony_ci * @brief Defines a callback function used to obtain data by type. 2207777dab0Sopenharmony_ci * 2217777dab0Sopenharmony_ci * @param context Pointer to the context set by {@link OH_UdmfRecordProvider_SetData}. 2227777dab0Sopenharmony_ci * @param type Pointer to the type of data to obtain. For details, see {@link udmf_meta.h}. 2237777dab0Sopenharmony_ci * @return Returns the data content. 2247777dab0Sopenharmony_ci * @since 13 2257777dab0Sopenharmony_ci */ 2267777dab0Sopenharmony_citypedef void* (*OH_UdmfRecordProvider_GetData)(void* context, const char* type); 2277777dab0Sopenharmony_ci 2287777dab0Sopenharmony_ci/** 2297777dab0Sopenharmony_ci * @brief Sets a callback function to obtain data. 2307777dab0Sopenharmony_ci * 2317777dab0Sopenharmony_ci * @param provider Pointer to the {@link OH_UdmfRecordProvider} instance. 2327777dab0Sopenharmony_ci * @param context Pointer to the context set, which is the first parameter in OH_UdmfRecordProvider_GetData. 2337777dab0Sopenharmony_ci * @param callback Callback to set. For details, see {@link OH_UdmfRecordProvider_GetData}. 2347777dab0Sopenharmony_ci * @param finalize Optional callback that can free context when destroy provider. 2357777dab0Sopenharmony_ci * For details, see {@link UdmfData_Finalize}. 2367777dab0Sopenharmony_ci * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}. 2377777dab0Sopenharmony_ci * Returns {@link UDMF_E_OK} if the operation is successful. 2387777dab0Sopenharmony_ci * Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected. 2397777dab0Sopenharmony_ci * @see OH_UdmfRecordProvider OH_UdmfRecordProvider_GetData UdmfData_Finalize Udmf_ErrCode. 2407777dab0Sopenharmony_ci * @since 13 2417777dab0Sopenharmony_ci */ 2427777dab0Sopenharmony_ciint OH_UdmfRecordProvider_SetData(OH_UdmfRecordProvider* provider, void* context, 2437777dab0Sopenharmony_ci const OH_UdmfRecordProvider_GetData callback, const UdmfData_Finalize finalize); 2447777dab0Sopenharmony_ci 2457777dab0Sopenharmony_ci/** 2467777dab0Sopenharmony_ci * @brief Creation a pointer to the instance of the {@link OH_UdmfRecord}, it's relate with UDS data. 2477777dab0Sopenharmony_ci * 2487777dab0Sopenharmony_ci * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfRecord} 2497777dab0Sopenharmony_ci * structure is returned. If the operation is failed, nullptr is returned. 2507777dab0Sopenharmony_ci * @see OH_UdmfRecord. 2517777dab0Sopenharmony_ci * @since 12 2527777dab0Sopenharmony_ci */ 2537777dab0Sopenharmony_ciOH_UdmfRecord* OH_UdmfRecord_Create(); 2547777dab0Sopenharmony_ci 2557777dab0Sopenharmony_ci/** 2567777dab0Sopenharmony_ci * @brief Destroy a pointer that points to an instance of {@link OH_UdmfRecord}. 2577777dab0Sopenharmony_ci * 2587777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 2597777dab0Sopenharmony_ci * @see OH_UdmfRecord. 2607777dab0Sopenharmony_ci * @since 12 2617777dab0Sopenharmony_ci */ 2627777dab0Sopenharmony_civoid OH_UdmfRecord_Destroy(OH_UdmfRecord* pThis); 2637777dab0Sopenharmony_ci 2647777dab0Sopenharmony_ci/** 2657777dab0Sopenharmony_ci * @brief Add one custom data to the {@link OH_UdmfRecord} record. 2667777dab0Sopenharmony_ci * 2677777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 2687777dab0Sopenharmony_ci * @param typeId Represents record type, reference udmf_meta.h. 2697777dab0Sopenharmony_ci * @param entry Represents custom data. 2707777dab0Sopenharmony_ci * @param count Represents the size of data param. 2717777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 2727777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 2737777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 2747777dab0Sopenharmony_ci * @see OH_UdmfRecord Udmf_ErrCode. 2757777dab0Sopenharmony_ci * @since 12 2767777dab0Sopenharmony_ci */ 2777777dab0Sopenharmony_ciint OH_UdmfRecord_AddGeneralEntry(OH_UdmfRecord* pThis, const char* typeId, unsigned char* entry, unsigned int count); 2787777dab0Sopenharmony_ci 2797777dab0Sopenharmony_ci/** 2807777dab0Sopenharmony_ci * @brief Add one {OH_UdsPlainText} data to the {@link OH_UdmfRecord} record. 2817777dab0Sopenharmony_ci * 2827777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 2837777dab0Sopenharmony_ci * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. 2847777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 2857777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 2867777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 2877777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsPlainText Udmf_ErrCode. 2887777dab0Sopenharmony_ci * @since 12 2897777dab0Sopenharmony_ci */ 2907777dab0Sopenharmony_ciint OH_UdmfRecord_AddPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText); 2917777dab0Sopenharmony_ci 2927777dab0Sopenharmony_ci/** 2937777dab0Sopenharmony_ci * @brief Add one {OH_UdsHyperlink} data to the {@link OH_UdmfRecord} record. 2947777dab0Sopenharmony_ci * 2957777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 2967777dab0Sopenharmony_ci * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}. 2977777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 2987777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 2997777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 3007777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsHyperlink Udmf_ErrCode. 3017777dab0Sopenharmony_ci * @since 12 3027777dab0Sopenharmony_ci */ 3037777dab0Sopenharmony_ciint OH_UdmfRecord_AddHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink); 3047777dab0Sopenharmony_ci 3057777dab0Sopenharmony_ci/** 3067777dab0Sopenharmony_ci * @brief Add one {OH_UdsHtml} data to the {@link OH_UdmfRecord} record. 3077777dab0Sopenharmony_ci * 3087777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 3097777dab0Sopenharmony_ci * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. 3107777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 3117777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 3127777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 3137777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsHtml Udmf_ErrCode. 3147777dab0Sopenharmony_ci * @since 12 3157777dab0Sopenharmony_ci */ 3167777dab0Sopenharmony_ciint OH_UdmfRecord_AddHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html); 3177777dab0Sopenharmony_ci 3187777dab0Sopenharmony_ci/** 3197777dab0Sopenharmony_ci * @brief Add one {OH_UdsAppItem} data to the {@link OH_UdmfRecord} record. 3207777dab0Sopenharmony_ci * 3217777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 3227777dab0Sopenharmony_ci * @param appItem Represents a pointer to an instance of {@link OH_UdsAppItem}. 3237777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 3247777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 3257777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 3267777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode. 3277777dab0Sopenharmony_ci * @since 12 3287777dab0Sopenharmony_ci */ 3297777dab0Sopenharmony_ciint OH_UdmfRecord_AddAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); 3307777dab0Sopenharmony_ci 3317777dab0Sopenharmony_ci/** 3327777dab0Sopenharmony_ci * @brief Add one {OH_UdsFileUri} data to the {@link OH_UdmfRecord} record. 3337777dab0Sopenharmony_ci * 3347777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 3357777dab0Sopenharmony_ci * @param fileUri Represents a pointer to an instance of {@link OH_UdsFileUri}. 3367777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 3377777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 3387777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 3397777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsFileUri Udmf_ErrCode. 3407777dab0Sopenharmony_ci * @since 13 3417777dab0Sopenharmony_ci */ 3427777dab0Sopenharmony_ciint OH_UdmfRecord_AddFileUri(OH_UdmfRecord* pThis, OH_UdsFileUri* fileUri); 3437777dab0Sopenharmony_ci 3447777dab0Sopenharmony_ci/** 3457777dab0Sopenharmony_ci * @brief Add one {OH_UdsPixelMap} data to the {@link OH_UdmfRecord} record. 3467777dab0Sopenharmony_ci * 3477777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 3487777dab0Sopenharmony_ci * @param pixelMap Represents a pointer to an instance of {@link OH_UdsPixelMap}. 3497777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 3507777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 3517777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 3527777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsPixelMap Udmf_ErrCode. 3537777dab0Sopenharmony_ci * @since 13 3547777dab0Sopenharmony_ci */ 3557777dab0Sopenharmony_ciint OH_UdmfRecord_AddPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap); 3567777dab0Sopenharmony_ci 3577777dab0Sopenharmony_ci/** 3587777dab0Sopenharmony_ci * @brief Add one {@link OH_UdsArrayBuffer} data to the {@link OH_UdmfRecord} record. 3597777dab0Sopenharmony_ci * 3607777dab0Sopenharmony_ci * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. 3617777dab0Sopenharmony_ci * @param type Represents record type, reference udmf_meta.h. 3627777dab0Sopenharmony_ci * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}. 3637777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 3647777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 3657777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 3667777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsArrayBuffer Udmf_ErrCode. 3677777dab0Sopenharmony_ci * @since 13 3687777dab0Sopenharmony_ci */ 3697777dab0Sopenharmony_ciint OH_UdmfRecord_AddArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer); 3707777dab0Sopenharmony_ci 3717777dab0Sopenharmony_ci/** 3727777dab0Sopenharmony_ci * @brief Get all types in the {@link OH_UdmfRecord} record. 3737777dab0Sopenharmony_ci * 3747777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 3757777dab0Sopenharmony_ci * @param count Represents the types count that is a output param. 3767777dab0Sopenharmony_ci * @return Returns string array that in {@link OH_UdmfRecord} when input parameters valid, 3777777dab0Sopenharmony_ci * otherwise return nullptr. 3787777dab0Sopenharmony_ci * @see OH_UdmfRecord. 3797777dab0Sopenharmony_ci * @since 12 3807777dab0Sopenharmony_ci */ 3817777dab0Sopenharmony_cichar** OH_UdmfRecord_GetTypes(OH_UdmfRecord* pThis, unsigned int* count); 3827777dab0Sopenharmony_ci 3837777dab0Sopenharmony_ci/** 3847777dab0Sopenharmony_ci * @brief Get one entry data from the {@link OH_UdmfRecord} record. 3857777dab0Sopenharmony_ci * 3867777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 3877777dab0Sopenharmony_ci * @param typeId Represents record type, reference udmf_meta.h. 3887777dab0Sopenharmony_ci * @param entry Represents a pointer to entry data that is a output param. 3897777dab0Sopenharmony_ci * @param count Represents the entry data length that is a output param. 3907777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 3917777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 3927777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 3937777dab0Sopenharmony_ci * {@link UDMF_ERR} Internal data error. 3947777dab0Sopenharmony_ci * @see OH_UdmfRecord Udmf_ErrCode. 3957777dab0Sopenharmony_ci * @since 12 3967777dab0Sopenharmony_ci */ 3977777dab0Sopenharmony_ciint OH_UdmfRecord_GetGeneralEntry(OH_UdmfRecord* pThis, const char* typeId, 3987777dab0Sopenharmony_ci unsigned char** entry, unsigned int* count); 3997777dab0Sopenharmony_ci 4007777dab0Sopenharmony_ci/** 4017777dab0Sopenharmony_ci * @brief Get one {OH_UdsPlainText} data from the {@link OH_UdmfRecord} record. 4027777dab0Sopenharmony_ci * 4037777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 4047777dab0Sopenharmony_ci * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. 4057777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 4067777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 4077777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 4087777dab0Sopenharmony_ci * {@link UDMF_ERR} Internal data error. 4097777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsPlainText Udmf_ErrCode. 4107777dab0Sopenharmony_ci * @since 12 4117777dab0Sopenharmony_ci */ 4127777dab0Sopenharmony_ciint OH_UdmfRecord_GetPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText); 4137777dab0Sopenharmony_ci 4147777dab0Sopenharmony_ci/** 4157777dab0Sopenharmony_ci * @brief Get one {OH_UdsHyperlink} data from the {@link OH_UdmfRecord} record. 4167777dab0Sopenharmony_ci * 4177777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 4187777dab0Sopenharmony_ci * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}. 4197777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 4207777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 4217777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 4227777dab0Sopenharmony_ci * {@link UDMF_ERR} Internal data error. 4237777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsHyperlink Udmf_ErrCode. 4247777dab0Sopenharmony_ci * @since 12 4257777dab0Sopenharmony_ci */ 4267777dab0Sopenharmony_ciint OH_UdmfRecord_GetHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink); 4277777dab0Sopenharmony_ci 4287777dab0Sopenharmony_ci/** 4297777dab0Sopenharmony_ci * @brief Get one {OH_UdsHtml} data from the {@link OH_UdmfRecord} record. 4307777dab0Sopenharmony_ci * 4317777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 4327777dab0Sopenharmony_ci * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. 4337777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 4347777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 4357777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 4367777dab0Sopenharmony_ci * {@link UDMF_ERR} Internal data error. 4377777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsHtml Udmf_ErrCode. 4387777dab0Sopenharmony_ci * @since 12 4397777dab0Sopenharmony_ci */ 4407777dab0Sopenharmony_ciint OH_UdmfRecord_GetHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html); 4417777dab0Sopenharmony_ci 4427777dab0Sopenharmony_ci/** 4437777dab0Sopenharmony_ci * @brief Get one {OH_UdsAppItem} data from the {@link OH_UdmfRecord} record. 4447777dab0Sopenharmony_ci * 4457777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 4467777dab0Sopenharmony_ci * @param appItem Represents a pointer to an instance of {@link OH_UdsAppItem}. 4477777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 4487777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 4497777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 4507777dab0Sopenharmony_ci * {@link UDMF_ERR} Internal data error. 4517777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode. 4527777dab0Sopenharmony_ci * @since 12 4537777dab0Sopenharmony_ci */ 4547777dab0Sopenharmony_ciint OH_UdmfRecord_GetAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem); 4557777dab0Sopenharmony_ci 4567777dab0Sopenharmony_ci/** 4577777dab0Sopenharmony_ci * @brief Set the data provider of the types. 4587777dab0Sopenharmony_ci * 4597777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 4607777dab0Sopenharmony_ci * @param types Represents a pointer to a group of data types; 4617777dab0Sopenharmony_ci * @param count Represents the number of data types; 4627777dab0Sopenharmony_ci * @param provider Represents a pointer an instance of {@link OH_UdmfRecordProvider}. 4637777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 4647777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 4657777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 4667777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdmfRecordProvider Udmf_ErrCode. 4677777dab0Sopenharmony_ci * @since 13 4687777dab0Sopenharmony_ci */ 4697777dab0Sopenharmony_ciint OH_UdmfRecord_SetProvider(OH_UdmfRecord* pThis, const char* const* types, unsigned int count, 4707777dab0Sopenharmony_ci OH_UdmfRecordProvider* provider); 4717777dab0Sopenharmony_ci 4727777dab0Sopenharmony_ci/** 4737777dab0Sopenharmony_ci * @brief Get one {OH_UdsFileUri} data from the {@link OH_UdmfRecord} record. 4747777dab0Sopenharmony_ci * 4757777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 4767777dab0Sopenharmony_ci * @param fileUri Represents a pointer to an instance of {@link OH_UdsFileUri}. 4777777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 4787777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 4797777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 4807777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsFileUri Udmf_ErrCode. 4817777dab0Sopenharmony_ci * @since 13 4827777dab0Sopenharmony_ci */ 4837777dab0Sopenharmony_ciint OH_UdmfRecord_GetFileUri(OH_UdmfRecord* pThis, OH_UdsFileUri* fileUri); 4847777dab0Sopenharmony_ci 4857777dab0Sopenharmony_ci/** 4867777dab0Sopenharmony_ci * @brief Get one {OH_UdsPixelMap} data from the {@link OH_UdmfRecord} record. 4877777dab0Sopenharmony_ci * 4887777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}. 4897777dab0Sopenharmony_ci * @param pixelMap Represents a pointer to an instance of {@link OH_UdsPixelMap}. 4907777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 4917777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 4927777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 4937777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsPixelMap Udmf_ErrCode. 4947777dab0Sopenharmony_ci * @since 13 4957777dab0Sopenharmony_ci */ 4967777dab0Sopenharmony_ciint OH_UdmfRecord_GetPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap); 4977777dab0Sopenharmony_ci 4987777dab0Sopenharmony_ci/** 4997777dab0Sopenharmony_ci * @brief Get one {@link OH_UdsArrayBuffer} data from the {@link OH_UdmfRecord} record. 5007777dab0Sopenharmony_ci * 5017777dab0Sopenharmony_ci * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}. 5027777dab0Sopenharmony_ci * @param type Represents record type, reference udmf_meta.h. 5037777dab0Sopenharmony_ci * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}. 5047777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 5057777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 5067777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 5077777dab0Sopenharmony_ci * @see OH_UdmfRecord OH_UdsArrayBuffer Udmf_ErrCode. 5087777dab0Sopenharmony_ci * @since 13 5097777dab0Sopenharmony_ci */ 5107777dab0Sopenharmony_ciint OH_UdmfRecord_GetArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer); 5117777dab0Sopenharmony_ci 5127777dab0Sopenharmony_ci/** 5137777dab0Sopenharmony_ci * @brief Get primary {@link OH_UdsPlainText} data from the {@link OH_UdmfData}. 5147777dab0Sopenharmony_ci * 5157777dab0Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 5167777dab0Sopenharmony_ci * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}. 5177777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 5187777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 5197777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 5207777dab0Sopenharmony_ci * @see OH_UdmfData OH_UdsPlainText Udmf_ErrCode. 5217777dab0Sopenharmony_ci * @since 13 5227777dab0Sopenharmony_ci */ 5237777dab0Sopenharmony_ciint OH_UdmfData_GetPrimaryPlainText(OH_UdmfData* data, OH_UdsPlainText* plainText); 5247777dab0Sopenharmony_ci 5257777dab0Sopenharmony_ci/** 5267777dab0Sopenharmony_ci * @brief Get one {@link OH_UdsHtml} data from the {@link OH_UdmfData}. 5277777dab0Sopenharmony_ci * 5287777dab0Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 5297777dab0Sopenharmony_ci * @param html Represents a pointer to an instance of {@link OH_UdsHtml}. 5307777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 5317777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 5327777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 5337777dab0Sopenharmony_ci * @see OH_UdmfData OH_UdsHtml Udmf_ErrCode. 5347777dab0Sopenharmony_ci * @since 13 5357777dab0Sopenharmony_ci */ 5367777dab0Sopenharmony_ciint OH_UdmfData_GetPrimaryHtml(OH_UdmfData* data, OH_UdsHtml* html); 5377777dab0Sopenharmony_ci 5387777dab0Sopenharmony_ci/** 5397777dab0Sopenharmony_ci * @brief Get the count of {@link OH_UdmfRecord} in the {@link OH_UdmfData}. 5407777dab0Sopenharmony_ci * 5417777dab0Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 5427777dab0Sopenharmony_ci * @return Returns the count of {@link OH_UdmfRecord} 5437777dab0Sopenharmony_ci * @see OH_UdmfData. 5447777dab0Sopenharmony_ci * @since 13 5457777dab0Sopenharmony_ci */ 5467777dab0Sopenharmony_ciint OH_UdmfData_GetRecordCount(OH_UdmfData* data); 5477777dab0Sopenharmony_ci 5487777dab0Sopenharmony_ci/** 5497777dab0Sopenharmony_ci * @brief Get the record of the specified index from the {@link OH_UdmfData}. 5507777dab0Sopenharmony_ci * 5517777dab0Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 5527777dab0Sopenharmony_ci * @param index Represents the index of {@link OH_UdmfRecord} in the {@link OH_UdmfData}. 5537777dab0Sopenharmony_ci * @return Returns {@link OH_UdmfRecord} pointer when input parameters valid, otherwise return nullptr. 5547777dab0Sopenharmony_ci * @see OH_UdmfData. 5557777dab0Sopenharmony_ci * @since 13 5567777dab0Sopenharmony_ci */ 5577777dab0Sopenharmony_ciOH_UdmfRecord* OH_UdmfData_GetRecord(OH_UdmfData* data, unsigned int index); 5587777dab0Sopenharmony_ci 5597777dab0Sopenharmony_ci/** 5607777dab0Sopenharmony_ci * @brief Checks whether the UDMF data is from a local device. 5617777dab0Sopenharmony_ci * 5627777dab0Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}. 5637777dab0Sopenharmony_ci * @return Returns a boolean value, which indicates whether the UDMF data is from a local device. 5647777dab0Sopenharmony_ci * The value {@code true} means the data is from a local device. 5657777dab0Sopenharmony_ci * The value {@code false} means the opposite. 5667777dab0Sopenharmony_ci * @see OH_UdmfData. 5677777dab0Sopenharmony_ci * @since 13 5687777dab0Sopenharmony_ci */ 5697777dab0Sopenharmony_cibool OH_UdmfData_IsLocal(OH_UdmfData* data); 5707777dab0Sopenharmony_ci 5717777dab0Sopenharmony_ci/** 5727777dab0Sopenharmony_ci * @brief Creation a pointer to the instance of the {@link OH_UdmfProperty} 5737777dab0Sopenharmony_ci * from a {@link OH_UdmfData} data. 5747777dab0Sopenharmony_ci * 5757777dab0Sopenharmony_ci * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. 5767777dab0Sopenharmony_ci * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfProperty} 5777777dab0Sopenharmony_ci * structure is returned. If the operation is failed, nullptr is returned. 5787777dab0Sopenharmony_ci * @see OH_UdmfData OH_UdmfProperty. 5797777dab0Sopenharmony_ci * @since 12 5807777dab0Sopenharmony_ci */ 5817777dab0Sopenharmony_ciOH_UdmfProperty* OH_UdmfProperty_Create(OH_UdmfData* unifiedData); 5827777dab0Sopenharmony_ci 5837777dab0Sopenharmony_ci/** 5847777dab0Sopenharmony_ci * @brief Destroy a pointer that points to the {@link OH_UdmfProperty} instance. 5857777dab0Sopenharmony_ci * 5867777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 5877777dab0Sopenharmony_ci * @see OH_UdmfProperty. 5887777dab0Sopenharmony_ci * @since 12 5897777dab0Sopenharmony_ci */ 5907777dab0Sopenharmony_civoid OH_UdmfProperty_Destroy(OH_UdmfProperty* pThis); 5917777dab0Sopenharmony_ci 5927777dab0Sopenharmony_ci/** 5937777dab0Sopenharmony_ci * @brief Get tag value from the {@link OH_UdmfProperty}. 5947777dab0Sopenharmony_ci * 5957777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 5967777dab0Sopenharmony_ci * @return Returns a pointer of the tag value string when input parameters valid, otherwise return nullptr. 5977777dab0Sopenharmony_ci * @see OH_UdmfProperty. 5987777dab0Sopenharmony_ci * @since 12 5997777dab0Sopenharmony_ci */ 6007777dab0Sopenharmony_ciconst char* OH_UdmfProperty_GetTag(OH_UdmfProperty* pThis); 6017777dab0Sopenharmony_ci 6027777dab0Sopenharmony_ci/** 6037777dab0Sopenharmony_ci * @brief Get timestamp value from the {@link OH_UdmfProperty}. 6047777dab0Sopenharmony_ci * 6057777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 6067777dab0Sopenharmony_ci * @return Returns timestamp value. 6077777dab0Sopenharmony_ci * @see OH_UdmfProperty 6087777dab0Sopenharmony_ci * @since 12 6097777dab0Sopenharmony_ci */ 6107777dab0Sopenharmony_ciint64_t OH_UdmfProperty_GetTimestamp(OH_UdmfProperty* pThis); 6117777dab0Sopenharmony_ci 6127777dab0Sopenharmony_ci/** 6137777dab0Sopenharmony_ci * @brief Get share option value from the {@link OH_UdmfProperty}. 6147777dab0Sopenharmony_ci * 6157777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 6167777dab0Sopenharmony_ci * @return Returns {@link Udmf_ShareOption} value. 6177777dab0Sopenharmony_ci * @see OH_UdmfProperty Udmf_ShareOption 6187777dab0Sopenharmony_ci * @since 12 6197777dab0Sopenharmony_ci */ 6207777dab0Sopenharmony_ciUdmf_ShareOption OH_UdmfProperty_GetShareOption(OH_UdmfProperty* pThis); 6217777dab0Sopenharmony_ci 6227777dab0Sopenharmony_ci/** 6237777dab0Sopenharmony_ci * @brief Get integer value by key from the {@link OH_UdmfProperty}. 6247777dab0Sopenharmony_ci * 6257777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 6267777dab0Sopenharmony_ci * @param key Represents key-value pair's key 6277777dab0Sopenharmony_ci * @param defaultValue Represents when get value failure. 6287777dab0Sopenharmony_ci * @return Returns value associated with the key in successfully, otherwise return defaultValue. 6297777dab0Sopenharmony_ci * @see OH_UdmfProperty. 6307777dab0Sopenharmony_ci * @since 12 6317777dab0Sopenharmony_ci */ 6327777dab0Sopenharmony_ciint OH_UdmfProperty_GetExtrasIntParam(OH_UdmfProperty* pThis, 6337777dab0Sopenharmony_ci const char* key, int defaultValue); 6347777dab0Sopenharmony_ci 6357777dab0Sopenharmony_ci/** 6367777dab0Sopenharmony_ci * @brief Get tag value from the {@link OH_UdmfProperty}. 6377777dab0Sopenharmony_ci * 6387777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 6397777dab0Sopenharmony_ci * @param key Represents key-value pair's key. 6407777dab0Sopenharmony_ci * @return Returns a pointer of the key value string when input parameters valid, otherwise return nullptr. 6417777dab0Sopenharmony_ci * @see OH_UdmfProperty 6427777dab0Sopenharmony_ci * @since 12 6437777dab0Sopenharmony_ci */ 6447777dab0Sopenharmony_ciconst char* OH_UdmfProperty_GetExtrasStringParam(OH_UdmfProperty* pThis, const char* key); 6457777dab0Sopenharmony_ci 6467777dab0Sopenharmony_ci/** 6477777dab0Sopenharmony_ci * @brief Set tag value to {@link OH_UdmfProperty} . 6487777dab0Sopenharmony_ci * 6497777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 6507777dab0Sopenharmony_ci * @param tag Represents new tag param. 6517777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 6527777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 6537777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 6547777dab0Sopenharmony_ci * @see OH_UdmfProperty Udmf_ErrCode. 6557777dab0Sopenharmony_ci * @since 12 6567777dab0Sopenharmony_ci */ 6577777dab0Sopenharmony_ciint OH_UdmfProperty_SetTag(OH_UdmfProperty* pThis, const char* tag); 6587777dab0Sopenharmony_ci 6597777dab0Sopenharmony_ci/** 6607777dab0Sopenharmony_ci * @brief Set Udmf_ShareOption value to {@link OH_UdmfProperty}. 6617777dab0Sopenharmony_ci * 6627777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 6637777dab0Sopenharmony_ci * @param option Represents new {@link Udmf_ShareOption} param. 6647777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 6657777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 6667777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 6677777dab0Sopenharmony_ci * @see OH_UdmfProperty Udmf_ShareOption Udmf_ErrCode. 6687777dab0Sopenharmony_ci * @since 12 6697777dab0Sopenharmony_ci */ 6707777dab0Sopenharmony_ciint OH_UdmfProperty_SetShareOption(OH_UdmfProperty* pThis, Udmf_ShareOption option); 6717777dab0Sopenharmony_ci 6727777dab0Sopenharmony_ci/** 6737777dab0Sopenharmony_ci * @brief Set extras param to {@link OH_UdmfProperty}. 6747777dab0Sopenharmony_ci * 6757777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 6767777dab0Sopenharmony_ci * @param key Represents extras param's key value. 6777777dab0Sopenharmony_ci * @param param Represents value of k-v pairs. 6787777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 6797777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 6807777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 6817777dab0Sopenharmony_ci * @see OH_UdmfProperty Udmf_ErrCode. 6827777dab0Sopenharmony_ci * @since 12 6837777dab0Sopenharmony_ci */ 6847777dab0Sopenharmony_ciint OH_UdmfProperty_SetExtrasIntParam(OH_UdmfProperty* pThis, const char* key, int param); 6857777dab0Sopenharmony_ci 6867777dab0Sopenharmony_ci/** 6877777dab0Sopenharmony_ci * @brief Set extras param to {@link OH_UdmfProperty}. 6887777dab0Sopenharmony_ci * 6897777dab0Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}. 6907777dab0Sopenharmony_ci * @param key Represents extras param's key value. 6917777dab0Sopenharmony_ci * @param param Represents value of k-v pairs. 6927777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 6937777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 6947777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 6957777dab0Sopenharmony_ci * @see OH_UdmfProperty Udmf_ErrCode. 6967777dab0Sopenharmony_ci * @since 12 6977777dab0Sopenharmony_ci */ 6987777dab0Sopenharmony_ciint OH_UdmfProperty_SetExtrasStringParam(OH_UdmfProperty* pThis, 6997777dab0Sopenharmony_ci const char* key, const char* param); 7007777dab0Sopenharmony_ci 7017777dab0Sopenharmony_ci/** 7027777dab0Sopenharmony_ci * @brief Get {@link OH_UdmfData} data from udmf database. 7037777dab0Sopenharmony_ci * 7047777dab0Sopenharmony_ci * @param key Represents database store's key value. 7057777dab0Sopenharmony_ci * @param intention Represents data type {@link Udmf_Intention} 7067777dab0Sopenharmony_ci * @param unifiedData Represents output params of {@link OH_UdmfData}; 7077777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 7087777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 7097777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 7107777dab0Sopenharmony_ci * {@link UDMF_ERR} Internal data error. 7117777dab0Sopenharmony_ci * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode. 7127777dab0Sopenharmony_ci * @since 12 7137777dab0Sopenharmony_ci */ 7147777dab0Sopenharmony_ciint OH_Udmf_GetUnifiedData(const char* key, Udmf_Intention intention, OH_UdmfData* unifiedData); 7157777dab0Sopenharmony_ci 7167777dab0Sopenharmony_ci/** 7177777dab0Sopenharmony_ci * @brief Set {@link OH_UdmfData} data to database. 7187777dab0Sopenharmony_ci * 7197777dab0Sopenharmony_ci * @param intention Represents data type {@link Udmf_Intention}. 7207777dab0Sopenharmony_ci * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}. 7217777dab0Sopenharmony_ci * @param key Represents return value after set data to database successfully, 7227777dab0Sopenharmony_ci * it's memory size not less than {@link UDMF_KEY_BUFFER_LEN}. 7237777dab0Sopenharmony_ci * @param keyLen Represents size of key param. 7247777dab0Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}. 7257777dab0Sopenharmony_ci * {@link UDMF_E_OK} success. 7267777dab0Sopenharmony_ci * {@link UDMF_E_INVALID_PARAM} The error code for common invalid args. 7277777dab0Sopenharmony_ci * {@link UDMF_ERR} Internal data error. 7287777dab0Sopenharmony_ci * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode. 7297777dab0Sopenharmony_ci * @since 12 7307777dab0Sopenharmony_ci */ 7317777dab0Sopenharmony_ciint OH_Udmf_SetUnifiedData(Udmf_Intention intention, OH_UdmfData* unifiedData, 7327777dab0Sopenharmony_ci char* key, unsigned int keyLen); 7337777dab0Sopenharmony_ci 7347777dab0Sopenharmony_ci#ifdef __cplusplus 7357777dab0Sopenharmony_ci}; 7367777dab0Sopenharmony_ci#endif 7377777dab0Sopenharmony_ci 7387777dab0Sopenharmony_ci/** @} */ 7397777dab0Sopenharmony_ci#endif