114cf0368Sopenharmony_ci/*
214cf0368Sopenharmony_ci * Copyright (c) 2024 Huawei Device Co., Ltd.
314cf0368Sopenharmony_ci * Licensed under the Apache License, Version 2.0 (the "License");
414cf0368Sopenharmony_ci * you may not use this file except in compliance with the License.
514cf0368Sopenharmony_ci * You may obtain a copy of the License at
614cf0368Sopenharmony_ci *
714cf0368Sopenharmony_ci *     http://www.apache.org/licenses/LICENSE-2.0
814cf0368Sopenharmony_ci *
914cf0368Sopenharmony_ci * Unless required by applicable law or agreed to in writing, software
1014cf0368Sopenharmony_ci * distributed under the License is distributed on an "AS IS" BASIS,
1114cf0368Sopenharmony_ci * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1214cf0368Sopenharmony_ci * See the License for the specific language governing permissions and
1314cf0368Sopenharmony_ci * limitations under the License.
1414cf0368Sopenharmony_ci */
1514cf0368Sopenharmony_ci
1614cf0368Sopenharmony_ci/**
1714cf0368Sopenharmony_ci * @addtogroup UDMF
1814cf0368Sopenharmony_ci * @{
1914cf0368Sopenharmony_ci *
2014cf0368Sopenharmony_ci * @brief The Unified Data Management Framework(UDMF) aims to define various standards
2114cf0368Sopenharmony_ci * for data across applications, devices, and platforms, providing a unified OpenHarmony
2214cf0368Sopenharmony_ci * data language and standardized data access and reading paths.
2314cf0368Sopenharmony_ci *
2414cf0368Sopenharmony_ci * @since 12
2514cf0368Sopenharmony_ci */
2614cf0368Sopenharmony_ci
2714cf0368Sopenharmony_ci/**
2814cf0368Sopenharmony_ci * @file udmf.h
2914cf0368Sopenharmony_ci *
3014cf0368Sopenharmony_ci * @brief Provides unified data management framework related functions and enumerations.
3114cf0368Sopenharmony_ci *
3214cf0368Sopenharmony_ci * @kit ArkData
3314cf0368Sopenharmony_ci * @library libudmf.so
3414cf0368Sopenharmony_ci * @syscap SystemCapability.DistributedDataManager.UDMF.Core
3514cf0368Sopenharmony_ci *
3614cf0368Sopenharmony_ci * @since 12
3714cf0368Sopenharmony_ci */
3814cf0368Sopenharmony_ci
3914cf0368Sopenharmony_ci#ifndef UDMF_H
4014cf0368Sopenharmony_ci#define UDMF_H
4114cf0368Sopenharmony_ci
4214cf0368Sopenharmony_ci#include <inttypes.h>
4314cf0368Sopenharmony_ci#include <stdbool.h>
4414cf0368Sopenharmony_ci#include "uds.h"
4514cf0368Sopenharmony_ci
4614cf0368Sopenharmony_ci#ifdef __cplusplus
4714cf0368Sopenharmony_ciextern "C" {
4814cf0368Sopenharmony_ci#endif
4914cf0368Sopenharmony_ci
5014cf0368Sopenharmony_ci/**
5114cf0368Sopenharmony_ci * @brief The key minimum memory space size of Unified Data.
5214cf0368Sopenharmony_ci *
5314cf0368Sopenharmony_ci * @since 12
5414cf0368Sopenharmony_ci */
5514cf0368Sopenharmony_ci#define UDMF_KEY_BUFFER_LEN (512)
5614cf0368Sopenharmony_ci
5714cf0368Sopenharmony_ci/**
5814cf0368Sopenharmony_ci * @brief Describe the intention type of the udmf.
5914cf0368Sopenharmony_ci *
6014cf0368Sopenharmony_ci * @since 12
6114cf0368Sopenharmony_ci */
6214cf0368Sopenharmony_citypedef enum Udmf_Intention {
6314cf0368Sopenharmony_ci    /**
6414cf0368Sopenharmony_ci     * @brief The intention is drag.
6514cf0368Sopenharmony_ci     */
6614cf0368Sopenharmony_ci    UDMF_INTENTION_DRAG,
6714cf0368Sopenharmony_ci    /**
6814cf0368Sopenharmony_ci     * @brief The intention is pasteboard.
6914cf0368Sopenharmony_ci     */
7014cf0368Sopenharmony_ci    UDMF_INTENTION_PASTEBOARD,
7114cf0368Sopenharmony_ci} Udmf_Intention;
7214cf0368Sopenharmony_ci
7314cf0368Sopenharmony_ci/**
7414cf0368Sopenharmony_ci * @brief Describe intra-device usage range type enumeration.
7514cf0368Sopenharmony_ci *
7614cf0368Sopenharmony_ci * @since 12
7714cf0368Sopenharmony_ci */
7814cf0368Sopenharmony_citypedef enum Udmf_ShareOption {
7914cf0368Sopenharmony_ci    /**
8014cf0368Sopenharmony_ci     * @brief Invalid share option.
8114cf0368Sopenharmony_ci     */
8214cf0368Sopenharmony_ci    SHARE_OPTIONS_INVALID,
8314cf0368Sopenharmony_ci    /**
8414cf0368Sopenharmony_ci     * @brief Allowed to be used in the same application on this device.
8514cf0368Sopenharmony_ci     */
8614cf0368Sopenharmony_ci    SHARE_OPTIONS_IN_APP,
8714cf0368Sopenharmony_ci    /**
8814cf0368Sopenharmony_ci     * @brief Allowed to be used in the cross application on this device.
8914cf0368Sopenharmony_ci     */
9014cf0368Sopenharmony_ci    SHARE_OPTIONS_CROSS_APP
9114cf0368Sopenharmony_ci} Udmf_ShareOption;
9214cf0368Sopenharmony_ci
9314cf0368Sopenharmony_ci/**
9414cf0368Sopenharmony_ci * @brief Describes the unified data type.
9514cf0368Sopenharmony_ci *
9614cf0368Sopenharmony_ci * @since 12
9714cf0368Sopenharmony_ci */
9814cf0368Sopenharmony_citypedef struct OH_UdmfData OH_UdmfData;
9914cf0368Sopenharmony_ci
10014cf0368Sopenharmony_ci/**
10114cf0368Sopenharmony_ci * @brief Describes the record type in the unified data.
10214cf0368Sopenharmony_ci *
10314cf0368Sopenharmony_ci * @since 12
10414cf0368Sopenharmony_ci */
10514cf0368Sopenharmony_citypedef struct OH_UdmfRecord OH_UdmfRecord;
10614cf0368Sopenharmony_ci
10714cf0368Sopenharmony_ci/**
10814cf0368Sopenharmony_ci * @brief Defines the data provider.
10914cf0368Sopenharmony_ci *
11014cf0368Sopenharmony_ci * @since 13
11114cf0368Sopenharmony_ci */
11214cf0368Sopenharmony_citypedef struct OH_UdmfRecordProvider OH_UdmfRecordProvider;
11314cf0368Sopenharmony_ci
11414cf0368Sopenharmony_ci/**
11514cf0368Sopenharmony_ci * @brief Describes some property parameters of unified data.
11614cf0368Sopenharmony_ci *
11714cf0368Sopenharmony_ci * @since 12
11814cf0368Sopenharmony_ci */
11914cf0368Sopenharmony_citypedef struct OH_UdmfProperty OH_UdmfProperty;
12014cf0368Sopenharmony_ci
12114cf0368Sopenharmony_ci/**
12214cf0368Sopenharmony_ci * @brief Creation a pointer to the instance of the {@link OH_UdmfData}.
12314cf0368Sopenharmony_ci *
12414cf0368Sopenharmony_ci * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfData}
12514cf0368Sopenharmony_ci * structure is returned. If the operation is failed, nullptr is returned.
12614cf0368Sopenharmony_ci * @see OH_UdmfData.
12714cf0368Sopenharmony_ci * @since 12
12814cf0368Sopenharmony_ci */
12914cf0368Sopenharmony_ciOH_UdmfData* OH_UdmfData_Create();
13014cf0368Sopenharmony_ci
13114cf0368Sopenharmony_ci/**
13214cf0368Sopenharmony_ci * @brief Destroy a pointer that points to the {@link OH_UdmfData} instance.
13314cf0368Sopenharmony_ci *
13414cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}.
13514cf0368Sopenharmony_ci * @see OH_UdmfData.
13614cf0368Sopenharmony_ci * @since 12
13714cf0368Sopenharmony_ci */
13814cf0368Sopenharmony_civoid OH_UdmfData_Destroy(OH_UdmfData* pThis);
13914cf0368Sopenharmony_ci
14014cf0368Sopenharmony_ci/**
14114cf0368Sopenharmony_ci * @brief Add one {OH_UdmfRecord} record to the {@link OH_UdmfData} data.
14214cf0368Sopenharmony_ci *
14314cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}.
14414cf0368Sopenharmony_ci * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}.
14514cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
14614cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
14714cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
14814cf0368Sopenharmony_ci * @see OH_UdmfData Udmf_ErrCode.
14914cf0368Sopenharmony_ci * @since 12
15014cf0368Sopenharmony_ci */
15114cf0368Sopenharmony_ciint OH_UdmfData_AddRecord(OH_UdmfData* pThis, OH_UdmfRecord* record);
15214cf0368Sopenharmony_ci
15314cf0368Sopenharmony_ci/**
15414cf0368Sopenharmony_ci * @brief Check whether the type exists in the {@link OH_UdmfData} data.
15514cf0368Sopenharmony_ci *
15614cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}.
15714cf0368Sopenharmony_ci * @param type Represents a string pointer of the type.
15814cf0368Sopenharmony_ci * @return Returns the status of finding type.
15914cf0368Sopenharmony_ci *         {@code false} is not existed.
16014cf0368Sopenharmony_ci *         {@code true} is existed.
16114cf0368Sopenharmony_ci * @see OH_UdmfData.
16214cf0368Sopenharmony_ci * @since 12
16314cf0368Sopenharmony_ci */
16414cf0368Sopenharmony_cibool OH_UdmfData_HasType(OH_UdmfData* pThis, const char* type);
16514cf0368Sopenharmony_ci
16614cf0368Sopenharmony_ci/**
16714cf0368Sopenharmony_ci * @brief Get all types in the {@link OH_UdmfData} data.
16814cf0368Sopenharmony_ci *
16914cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}.
17014cf0368Sopenharmony_ci * @param count Represents the types count that is a output param.
17114cf0368Sopenharmony_ci * @return Returns string array that in {@link OH_UdmfData} when input parameters valid,
17214cf0368Sopenharmony_ci * otherwise return nullptr.
17314cf0368Sopenharmony_ci * @see OH_UdmfData.
17414cf0368Sopenharmony_ci * @since 12
17514cf0368Sopenharmony_ci */
17614cf0368Sopenharmony_cichar** OH_UdmfData_GetTypes(OH_UdmfData* pThis, unsigned int* count);
17714cf0368Sopenharmony_ci
17814cf0368Sopenharmony_ci/**
17914cf0368Sopenharmony_ci * @brief Get all records in the {@link OH_UdmfData} data.
18014cf0368Sopenharmony_ci *
18114cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfData}.
18214cf0368Sopenharmony_ci * @param count Represents the records count that is a output param.
18314cf0368Sopenharmony_ci * @return Returns {@link OH_UdmfRecord} pointer array when input parameters valid, otherwise return nullptr.
18414cf0368Sopenharmony_ci * @see OH_UdmfData OH_UdmfRecord.
18514cf0368Sopenharmony_ci * @since 12
18614cf0368Sopenharmony_ci */
18714cf0368Sopenharmony_ciOH_UdmfRecord** OH_UdmfData_GetRecords(OH_UdmfData* pThis, unsigned int* count);
18814cf0368Sopenharmony_ci
18914cf0368Sopenharmony_ci/**
19014cf0368Sopenharmony_ci * @brief Defines the callback function used free the context.
19114cf0368Sopenharmony_ci * @param context Pointer to the context which is to be free.
19214cf0368Sopenharmony_ci * @since 13
19314cf0368Sopenharmony_ci */
19414cf0368Sopenharmony_citypedef void (*UdmfData_Finalize)(void* context);
19514cf0368Sopenharmony_ci
19614cf0368Sopenharmony_ci/**
19714cf0368Sopenharmony_ci * @brief Creates an {@link OH_UdmfRecordProvider} instance.
19814cf0368Sopenharmony_ci *
19914cf0368Sopenharmony_ci * @return Returns the pointer to the {@link OH_UdmfRecordProvider} instance created if the operation is successful.
20014cf0368Sopenharmony_ci * Returns nullptr if the memory is not enough.
20114cf0368Sopenharmony_ci * @see OH_UdmfRecordProvider.
20214cf0368Sopenharmony_ci * @since 13
20314cf0368Sopenharmony_ci */
20414cf0368Sopenharmony_ciOH_UdmfRecordProvider* OH_UdmfRecordProvider_Create();
20514cf0368Sopenharmony_ci
20614cf0368Sopenharmony_ci/**
20714cf0368Sopenharmony_ci * @brief Destroy an {@link OH_UdmfRecordProvider} instance.
20814cf0368Sopenharmony_ci *
20914cf0368Sopenharmony_ci * @param subscriber Pointer to the {@link OH_UdmfRecordProvider} instance to destroy.
21014cf0368Sopenharmony_ci * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}.
21114cf0368Sopenharmony_ci *         Returns {@link UDMF_E_OK} if the operation is successful.
21214cf0368Sopenharmony_ci *         Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected.
21314cf0368Sopenharmony_ci * @see OH_UdmfRecordProvider Udmf_ErrCode.
21414cf0368Sopenharmony_ci * @since 13
21514cf0368Sopenharmony_ci */
21614cf0368Sopenharmony_ciint OH_UdmfRecordProvider_Destroy(OH_UdmfRecordProvider* provider);
21714cf0368Sopenharmony_ci
21814cf0368Sopenharmony_ci/**
21914cf0368Sopenharmony_ci * @brief Defines a callback function used to obtain data by type.
22014cf0368Sopenharmony_ci *
22114cf0368Sopenharmony_ci * @param context Pointer to the context set by {@link OH_UdmfRecordProvider_SetData}.
22214cf0368Sopenharmony_ci * @param type Pointer to the type of data to obtain. For details, see {@link udmf_meta.h}.
22314cf0368Sopenharmony_ci * @return Returns the data content.
22414cf0368Sopenharmony_ci * @since 13
22514cf0368Sopenharmony_ci */
22614cf0368Sopenharmony_citypedef void* (*OH_UdmfRecordProvider_GetData)(void* context, const char* type);
22714cf0368Sopenharmony_ci
22814cf0368Sopenharmony_ci/**
22914cf0368Sopenharmony_ci * @brief Sets a callback function to obtain data.
23014cf0368Sopenharmony_ci *
23114cf0368Sopenharmony_ci * @param provider Pointer to the {@link OH_UdmfRecordProvider} instance.
23214cf0368Sopenharmony_ci * @param context Pointer to the context set, which is the first parameter in OH_UdmfRecordProvider_GetData.
23314cf0368Sopenharmony_ci * @param callback Callback to set. For details, see {@link OH_UdmfRecordProvider_GetData}.
23414cf0368Sopenharmony_ci * @param finalize Optional callback that can free context when destroy provider.
23514cf0368Sopenharmony_ci *         For details, see {@link UdmfData_Finalize}.
23614cf0368Sopenharmony_ci * @return Returns the status code of the execution. For details, see {@link Udmf_ErrCode}.
23714cf0368Sopenharmony_ci *         Returns {@link UDMF_E_OK} if the operation is successful.
23814cf0368Sopenharmony_ci *         Returns {@link UDMF_E_INVALID_PARAM} if invalid args are detected.
23914cf0368Sopenharmony_ci * @see OH_UdmfRecordProvider OH_UdmfRecordProvider_GetData UdmfData_Finalize Udmf_ErrCode.
24014cf0368Sopenharmony_ci * @since 13
24114cf0368Sopenharmony_ci */
24214cf0368Sopenharmony_ciint OH_UdmfRecordProvider_SetData(OH_UdmfRecordProvider* provider, void* context,
24314cf0368Sopenharmony_ci    const OH_UdmfRecordProvider_GetData callback, const UdmfData_Finalize finalize);
24414cf0368Sopenharmony_ci
24514cf0368Sopenharmony_ci/**
24614cf0368Sopenharmony_ci * @brief Get primary {@link OH_UdsPlainText} data from the {@link OH_UdmfData}.
24714cf0368Sopenharmony_ci *
24814cf0368Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}.
24914cf0368Sopenharmony_ci * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}.
25014cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
25114cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
25214cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
25314cf0368Sopenharmony_ci * @see OH_UdmfData OH_UdsPlainText Udmf_ErrCode.
25414cf0368Sopenharmony_ci * @since 13
25514cf0368Sopenharmony_ci */
25614cf0368Sopenharmony_ciint OH_UdmfData_GetPrimaryPlainText(OH_UdmfData* data, OH_UdsPlainText* plainText);
25714cf0368Sopenharmony_ci
25814cf0368Sopenharmony_ci/**
25914cf0368Sopenharmony_ci * @brief Get one {@link OH_UdsHtml} data from the {@link OH_UdmfData}.
26014cf0368Sopenharmony_ci *
26114cf0368Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}.
26214cf0368Sopenharmony_ci * @param html Represents a pointer to an instance of {@link OH_UdsHtml}.
26314cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
26414cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
26514cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
26614cf0368Sopenharmony_ci * @see OH_UdmfData OH_UdsHtml Udmf_ErrCode.
26714cf0368Sopenharmony_ci * @since 13
26814cf0368Sopenharmony_ci */
26914cf0368Sopenharmony_ciint OH_UdmfData_GetPrimaryHtml(OH_UdmfData* data, OH_UdsHtml* html);
27014cf0368Sopenharmony_ci
27114cf0368Sopenharmony_ci/**
27214cf0368Sopenharmony_ci * @brief Get the count of {@link OH_UdmfRecord} in the {@link OH_UdmfData}.
27314cf0368Sopenharmony_ci *
27414cf0368Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}.
27514cf0368Sopenharmony_ci * @return Returns the count of {@link OH_UdmfRecord}
27614cf0368Sopenharmony_ci * @see OH_UdmfData.
27714cf0368Sopenharmony_ci * @since 13
27814cf0368Sopenharmony_ci */
27914cf0368Sopenharmony_ciint OH_UdmfData_GetRecordCount(OH_UdmfData* data);
28014cf0368Sopenharmony_ci
28114cf0368Sopenharmony_ci/**
28214cf0368Sopenharmony_ci * @brief Get the record of the specified index from the {@link OH_UdmfData}.
28314cf0368Sopenharmony_ci *
28414cf0368Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}.
28514cf0368Sopenharmony_ci * @param index Represents the index of {@link OH_UdmfRecord} in the {@link OH_UdmfData}.
28614cf0368Sopenharmony_ci * @return Returns the count of {@link OH_UdmfRecord}
28714cf0368Sopenharmony_ci * @see OH_UdmfData.
28814cf0368Sopenharmony_ci * @since 13
28914cf0368Sopenharmony_ci */
29014cf0368Sopenharmony_ciOH_UdmfRecord* OH_UdmfData_GetRecord(OH_UdmfData* data, unsigned int index);
29114cf0368Sopenharmony_ci
29214cf0368Sopenharmony_ci/**
29314cf0368Sopenharmony_ci * @brief Checks whether the UDMF data is from a local device.
29414cf0368Sopenharmony_ci *
29514cf0368Sopenharmony_ci * @param data Represents a pointer to an instance of {@link OH_UdmfData}.
29614cf0368Sopenharmony_ci * @return Returns the count of {@link OH_UdmfRecord}
29714cf0368Sopenharmony_ci * @see OH_UdmfData.
29814cf0368Sopenharmony_ci * @since 13
29914cf0368Sopenharmony_ci */
30014cf0368Sopenharmony_cibool OH_UdmfData_IsLocal(OH_UdmfData* data);
30114cf0368Sopenharmony_ci
30214cf0368Sopenharmony_ci/**
30314cf0368Sopenharmony_ci * @brief Creation a pointer to the instance of the {@link OH_UdmfRecord}, it's relate with UDS data.
30414cf0368Sopenharmony_ci *
30514cf0368Sopenharmony_ci * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfRecord}
30614cf0368Sopenharmony_ci * structure is returned. If the operation is failed, nullptr is returned.
30714cf0368Sopenharmony_ci * @see OH_UdmfRecord.
30814cf0368Sopenharmony_ci * @since 12
30914cf0368Sopenharmony_ci */
31014cf0368Sopenharmony_ciOH_UdmfRecord* OH_UdmfRecord_Create();
31114cf0368Sopenharmony_ci
31214cf0368Sopenharmony_ci/**
31314cf0368Sopenharmony_ci * @brief Destroy a pointer that points to an instance of {@link OH_UdmfRecord}.
31414cf0368Sopenharmony_ci *
31514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
31614cf0368Sopenharmony_ci * @see OH_UdmfRecord.
31714cf0368Sopenharmony_ci * @since 12
31814cf0368Sopenharmony_ci */
31914cf0368Sopenharmony_civoid OH_UdmfRecord_Destroy(OH_UdmfRecord* pThis);
32014cf0368Sopenharmony_ci
32114cf0368Sopenharmony_ci/**
32214cf0368Sopenharmony_ci * @brief Add one custom data to the {@link OH_UdmfRecord} record.
32314cf0368Sopenharmony_ci *
32414cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
32514cf0368Sopenharmony_ci * @param typeId Represents record type, reference udmf_meta.h.
32614cf0368Sopenharmony_ci * @param entry Represents custom data.
32714cf0368Sopenharmony_ci * @param count Represents the size of data param.
32814cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
32914cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
33014cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
33114cf0368Sopenharmony_ci * @see OH_UdmfRecord Udmf_ErrCode.
33214cf0368Sopenharmony_ci * @since 12
33314cf0368Sopenharmony_ci */
33414cf0368Sopenharmony_ciint OH_UdmfRecord_AddGeneralEntry(OH_UdmfRecord* record, const char* typeId,
33514cf0368Sopenharmony_ci                                  const unsigned char* entry, unsigned int count);
33614cf0368Sopenharmony_ci
33714cf0368Sopenharmony_ci/**
33814cf0368Sopenharmony_ci * @brief Add one {@link OH_UdsPlainText} data to the {@link OH_UdmfRecord} record.
33914cf0368Sopenharmony_ci *
34014cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
34114cf0368Sopenharmony_ci * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}.
34214cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
34314cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
34414cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
34514cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsPlainText Udmf_ErrCode.
34614cf0368Sopenharmony_ci * @since 12
34714cf0368Sopenharmony_ci */
34814cf0368Sopenharmony_ciint OH_UdmfRecord_AddPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText);
34914cf0368Sopenharmony_ci
35014cf0368Sopenharmony_ci/**
35114cf0368Sopenharmony_ci * @brief Add one {@link OH_UdsHyperlink} data to the {@link OH_UdmfRecord} record.
35214cf0368Sopenharmony_ci *
35314cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
35414cf0368Sopenharmony_ci * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}.
35514cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
35614cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
35714cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
35814cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsHyperlink Udmf_ErrCode.
35914cf0368Sopenharmony_ci * @since 12
36014cf0368Sopenharmony_ci */
36114cf0368Sopenharmony_ciint OH_UdmfRecord_AddHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink);
36214cf0368Sopenharmony_ci
36314cf0368Sopenharmony_ci/**
36414cf0368Sopenharmony_ci * @brief Add one {@link OH_UdsHtml} data to the {@link OH_UdmfRecord} record.
36514cf0368Sopenharmony_ci *
36614cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
36714cf0368Sopenharmony_ci * @param html Represents a pointer to an instance of {@link OH_UdsHtml}.
36814cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
36914cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
37014cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
37114cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsHtml Udmf_ErrCode.
37214cf0368Sopenharmony_ci * @since 12
37314cf0368Sopenharmony_ci */
37414cf0368Sopenharmony_ciint OH_UdmfRecord_AddHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html);
37514cf0368Sopenharmony_ci
37614cf0368Sopenharmony_ci/**
37714cf0368Sopenharmony_ci * @brief Add one {@link OH_UdsAppItem} data to the {@link OH_UdmfRecord} record.
37814cf0368Sopenharmony_ci *
37914cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
38014cf0368Sopenharmony_ci * @param appItem Represents a pointer to an instance of {@link OH_UdsAppItem}.
38114cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
38214cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
38314cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
38414cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode.
38514cf0368Sopenharmony_ci * @since 12
38614cf0368Sopenharmony_ci */
38714cf0368Sopenharmony_ciint OH_UdmfRecord_AddAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem);
38814cf0368Sopenharmony_ci
38914cf0368Sopenharmony_ci/**
39014cf0368Sopenharmony_ci * @brief Add one {@link OH_UdsFileUri} data to the {@link OH_UdmfRecord} record.
39114cf0368Sopenharmony_ci *
39214cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
39314cf0368Sopenharmony_ci * @param fileUri Represents a pointer to an instance of {@link OH_UdsFileUri}.
39414cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
39514cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
39614cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
39714cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsFileUri Udmf_ErrCode.
39814cf0368Sopenharmony_ci * @since 13
39914cf0368Sopenharmony_ci */
40014cf0368Sopenharmony_ciint OH_UdmfRecord_AddFileUri(OH_UdmfRecord* pThis, OH_UdsFileUri* fileUri);
40114cf0368Sopenharmony_ci
40214cf0368Sopenharmony_ci/**
40314cf0368Sopenharmony_ci * @brief Add one {@link OH_UdsPixelMap} data to the {@link OH_UdmfRecord} record.
40414cf0368Sopenharmony_ci *
40514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
40614cf0368Sopenharmony_ci * @param pixelMap Represents a pointer to an instance of {@link OH_UdsPixelMap}.
40714cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
40814cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
40914cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
41014cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsPixelMap Udmf_ErrCode.
41114cf0368Sopenharmony_ci * @since 13
41214cf0368Sopenharmony_ci */
41314cf0368Sopenharmony_ciint OH_UdmfRecord_AddPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap);
41414cf0368Sopenharmony_ci
41514cf0368Sopenharmony_ci/**
41614cf0368Sopenharmony_ci * @brief Add one {@link OH_UdsArrayBuffer} data to the {@link OH_UdmfRecord} record.
41714cf0368Sopenharmony_ci *
41814cf0368Sopenharmony_ci * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}.
41914cf0368Sopenharmony_ci * @param type Represents record type, reference udmf_meta.h.
42014cf0368Sopenharmony_ci * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}.
42114cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
42214cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
42314cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
42414cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsArrayBuffer Udmf_ErrCode.
42514cf0368Sopenharmony_ci * @since 13
42614cf0368Sopenharmony_ci */
42714cf0368Sopenharmony_ciint OH_UdmfRecord_AddArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer);
42814cf0368Sopenharmony_ci
42914cf0368Sopenharmony_ci/**
43014cf0368Sopenharmony_ci * @brief Add one {@link OH_UdsContentForm} data to the {@link OH_UdmfRecord} record.
43114cf0368Sopenharmony_ci *
43214cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
43314cf0368Sopenharmony_ci * @param contentForm Represents a pointer to an instance of {@link OH_UdsContentForm}.
43414cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
43514cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
43614cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
43714cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsContentForm Udmf_ErrCode.
43814cf0368Sopenharmony_ci * @since 14
43914cf0368Sopenharmony_ci */
44014cf0368Sopenharmony_ciint OH_UdmfRecord_AddContentForm(OH_UdmfRecord* pThis, OH_UdsContentForm* contentForm);
44114cf0368Sopenharmony_ci
44214cf0368Sopenharmony_ci/**
44314cf0368Sopenharmony_ci * @brief Get all types in the {@link OH_UdmfRecord} record.
44414cf0368Sopenharmony_ci *
44514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
44614cf0368Sopenharmony_ci * @param count Represents the types count that is a output param.
44714cf0368Sopenharmony_ci * @return Returns string array that in {@link OH_UdmfRecord} when input parameters valid,
44814cf0368Sopenharmony_ci * otherwise return nullptr.
44914cf0368Sopenharmony_ci * @see OH_UdmfRecord.
45014cf0368Sopenharmony_ci * @since 12
45114cf0368Sopenharmony_ci */
45214cf0368Sopenharmony_cichar** OH_UdmfRecord_GetTypes(OH_UdmfRecord* pThis, unsigned int* count);
45314cf0368Sopenharmony_ci
45414cf0368Sopenharmony_ci/**
45514cf0368Sopenharmony_ci * @brief Get one entry data from the {@link OH_UdmfRecord} record.
45614cf0368Sopenharmony_ci *
45714cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
45814cf0368Sopenharmony_ci * @param typeId Represents record type, reference udmf_meta.h.
45914cf0368Sopenharmony_ci * @param entry Represents a pointer to entry data that is a output param.
46014cf0368Sopenharmony_ci * @param count Represents the entry data length that is a output param.
46114cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
46214cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
46314cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
46414cf0368Sopenharmony_ci * @see OH_UdmfRecord Udmf_ErrCode.
46514cf0368Sopenharmony_ci * @since 12
46614cf0368Sopenharmony_ci */
46714cf0368Sopenharmony_ciint OH_UdmfRecord_GetGeneralEntry(OH_UdmfRecord* pThis, const char* typeId,
46814cf0368Sopenharmony_ci    unsigned char** entry, unsigned int* count);
46914cf0368Sopenharmony_ci
47014cf0368Sopenharmony_ci/**
47114cf0368Sopenharmony_ci * @brief Get one {@link OH_UdsPlainText} data from the {@link OH_UdmfRecord} record.
47214cf0368Sopenharmony_ci *
47314cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
47414cf0368Sopenharmony_ci * @param plainText Represents a pointer to an instance of {@link OH_UdsPlainText}.
47514cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
47614cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
47714cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
47814cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsPlainText Udmf_ErrCode.
47914cf0368Sopenharmony_ci * @since 12
48014cf0368Sopenharmony_ci */
48114cf0368Sopenharmony_ciint OH_UdmfRecord_GetPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText);
48214cf0368Sopenharmony_ci
48314cf0368Sopenharmony_ci/**
48414cf0368Sopenharmony_ci * @brief Get one {@link OH_UdsHyperlink} data from the {@link OH_UdmfRecord} record.
48514cf0368Sopenharmony_ci *
48614cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
48714cf0368Sopenharmony_ci * @param hyperlink Represents a pointer to an instance of {@link OH_UdsHyperlink}.
48814cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
48914cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
49014cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
49114cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsHyperlink Udmf_ErrCode.
49214cf0368Sopenharmony_ci * @since 12
49314cf0368Sopenharmony_ci */
49414cf0368Sopenharmony_ciint OH_UdmfRecord_GetHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink);
49514cf0368Sopenharmony_ci
49614cf0368Sopenharmony_ci/**
49714cf0368Sopenharmony_ci * @brief Get one {@link OH_UdsHtml} data from the {@link OH_UdmfRecord} record.
49814cf0368Sopenharmony_ci *
49914cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
50014cf0368Sopenharmony_ci * @param html Represents a pointer to an instance of {@link OH_UdsHtml}.
50114cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
50214cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
50314cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
50414cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsHtml Udmf_ErrCode.
50514cf0368Sopenharmony_ci * @since 12
50614cf0368Sopenharmony_ci */
50714cf0368Sopenharmony_ciint OH_UdmfRecord_GetHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html);
50814cf0368Sopenharmony_ci
50914cf0368Sopenharmony_ci/**
51014cf0368Sopenharmony_ci * @brief Get one {@link OH_UdsAppItem} data from the {@link OH_UdmfRecord} record.
51114cf0368Sopenharmony_ci *
51214cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
51314cf0368Sopenharmony_ci * @param appItem Represents a pointer to an instance of {@link OH_UdsAppItem}.
51414cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
51514cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
51614cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
51714cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode.
51814cf0368Sopenharmony_ci * @since 12
51914cf0368Sopenharmony_ci */
52014cf0368Sopenharmony_ciint OH_UdmfRecord_GetAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem);
52114cf0368Sopenharmony_ci
52214cf0368Sopenharmony_ci/**
52314cf0368Sopenharmony_ci * @brief Get one {@link OH_UdsFileUri} data from the {@link OH_UdmfRecord} record.
52414cf0368Sopenharmony_ci *
52514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
52614cf0368Sopenharmony_ci * @param fileUri Represents a pointer to an instance of {@link OH_UdsFileUri}.
52714cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
52814cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
52914cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
53014cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsFileUri Udmf_ErrCode.
53114cf0368Sopenharmony_ci * @since 13
53214cf0368Sopenharmony_ci */
53314cf0368Sopenharmony_ciint OH_UdmfRecord_GetFileUri(OH_UdmfRecord* pThis, OH_UdsFileUri* fileUri);
53414cf0368Sopenharmony_ci
53514cf0368Sopenharmony_ci/**
53614cf0368Sopenharmony_ci * @brief Get one {@link OH_UdsPixelMap} data from the {@link OH_UdmfRecord} record.
53714cf0368Sopenharmony_ci *
53814cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
53914cf0368Sopenharmony_ci * @param pixelMap Represents a pointer to an instance of {@link OH_UdsPixelMap}.
54014cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
54114cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
54214cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
54314cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsPixelMap Udmf_ErrCode.
54414cf0368Sopenharmony_ci * @since 13
54514cf0368Sopenharmony_ci */
54614cf0368Sopenharmony_ciint OH_UdmfRecord_GetPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap);
54714cf0368Sopenharmony_ci
54814cf0368Sopenharmony_ci/**
54914cf0368Sopenharmony_ci * @brief Get one {@link OH_UdsArrayBuffer} data from the {@link OH_UdmfRecord} record.
55014cf0368Sopenharmony_ci *
55114cf0368Sopenharmony_ci * @param record Represents a pointer to an instance of {@link OH_UdmfRecord}.
55214cf0368Sopenharmony_ci * @param type Represents record type, reference udmf_meta.h.
55314cf0368Sopenharmony_ci * @param buffer Represents a pointer to an instance of {@link OH_UdsArrayBuffer}.
55414cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
55514cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
55614cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
55714cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsArrayBuffer Udmf_ErrCode.
55814cf0368Sopenharmony_ci * @since 13
55914cf0368Sopenharmony_ci */
56014cf0368Sopenharmony_ciint OH_UdmfRecord_GetArrayBuffer(OH_UdmfRecord* record, const char* type, OH_UdsArrayBuffer* buffer);
56114cf0368Sopenharmony_ci
56214cf0368Sopenharmony_ci/**
56314cf0368Sopenharmony_ci * @brief Get one {@link OH_UdsContentForm} data from the {@link OH_UdmfRecord} record.
56414cf0368Sopenharmony_ci *
56514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
56614cf0368Sopenharmony_ci * @param contentForm Represents a pointer to an instance of {@link OH_UdsContentForm}.
56714cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
56814cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
56914cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
57014cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdsContentForm Udmf_ErrCode.
57114cf0368Sopenharmony_ci * @since 14
57214cf0368Sopenharmony_ci */
57314cf0368Sopenharmony_ciint OH_UdmfRecord_GetContentForm(OH_UdmfRecord* pThis, OH_UdsContentForm* contentForm);
57414cf0368Sopenharmony_ci
57514cf0368Sopenharmony_ci/**
57614cf0368Sopenharmony_ci * @brief Set the data provider of the types.
57714cf0368Sopenharmony_ci *
57814cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
57914cf0368Sopenharmony_ci * @param types Represents a pointer to a group of data types;
58014cf0368Sopenharmony_ci * @param count Represents the number of data types;
58114cf0368Sopenharmony_ci * @param provider Represents a pointer an instance of {@link OH_UdmfRecordProvider}.
58214cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
58314cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
58414cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
58514cf0368Sopenharmony_ci * @see OH_UdmfRecord OH_UdmfRecordProvider Udmf_ErrCode.
58614cf0368Sopenharmony_ci * @since 13
58714cf0368Sopenharmony_ci */
58814cf0368Sopenharmony_ciint OH_UdmfRecord_SetProvider(OH_UdmfRecord* pThis, const char* const* types, unsigned int count,
58914cf0368Sopenharmony_ci    OH_UdmfRecordProvider* provider);
59014cf0368Sopenharmony_ci
59114cf0368Sopenharmony_ci/**
59214cf0368Sopenharmony_ci * @brief Creation a pointer to the instance of the {@link OH_UdmfProperty}
59314cf0368Sopenharmony_ci * from a {@link OH_UdmfData} data.
59414cf0368Sopenharmony_ci *
59514cf0368Sopenharmony_ci * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}.
59614cf0368Sopenharmony_ci * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfProperty}
59714cf0368Sopenharmony_ci * structure is returned. If the operation is failed, nullptr is returned.
59814cf0368Sopenharmony_ci * @see OH_UdmfData OH_UdmfProperty.
59914cf0368Sopenharmony_ci * @since 12
60014cf0368Sopenharmony_ci */
60114cf0368Sopenharmony_ciOH_UdmfProperty* OH_UdmfProperty_Create(OH_UdmfData* unifiedData);
60214cf0368Sopenharmony_ci
60314cf0368Sopenharmony_ci/**
60414cf0368Sopenharmony_ci * @brief Destroy a pointer that points to the {@link OH_UdmfProperty} instance.
60514cf0368Sopenharmony_ci *
60614cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
60714cf0368Sopenharmony_ci * @see OH_UdmfProperty.
60814cf0368Sopenharmony_ci * @since 12
60914cf0368Sopenharmony_ci */
61014cf0368Sopenharmony_civoid OH_UdmfProperty_Destroy(OH_UdmfProperty* pThis);
61114cf0368Sopenharmony_ci
61214cf0368Sopenharmony_ci/**
61314cf0368Sopenharmony_ci * @brief Get tag value from the {@link OH_UdmfProperty}.
61414cf0368Sopenharmony_ci *
61514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
61614cf0368Sopenharmony_ci * @return Returns a pointer of the tag value string when input parameters valid, otherwise return nullptr.
61714cf0368Sopenharmony_ci * @see OH_UdmfProperty.
61814cf0368Sopenharmony_ci * @since 12
61914cf0368Sopenharmony_ci */
62014cf0368Sopenharmony_ciconst char* OH_UdmfProperty_GetTag(OH_UdmfProperty* pThis);
62114cf0368Sopenharmony_ci
62214cf0368Sopenharmony_ci/**
62314cf0368Sopenharmony_ci * @brief Get timestamp value from the {@link OH_UdmfProperty}.
62414cf0368Sopenharmony_ci *
62514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
62614cf0368Sopenharmony_ci * @return Returns timestamp value.
62714cf0368Sopenharmony_ci * @see OH_UdmfProperty
62814cf0368Sopenharmony_ci * @since 12
62914cf0368Sopenharmony_ci */
63014cf0368Sopenharmony_ciint64_t OH_UdmfProperty_GetTimestamp(OH_UdmfProperty* pThis);
63114cf0368Sopenharmony_ci
63214cf0368Sopenharmony_ci/**
63314cf0368Sopenharmony_ci * @brief Get share option value from the {@link OH_UdmfProperty}.
63414cf0368Sopenharmony_ci *
63514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
63614cf0368Sopenharmony_ci * @return Returns {@link Udmf_ShareOption} value.
63714cf0368Sopenharmony_ci * @see OH_UdmfProperty Udmf_ShareOption
63814cf0368Sopenharmony_ci * @since 12
63914cf0368Sopenharmony_ci */
64014cf0368Sopenharmony_ciUdmf_ShareOption OH_UdmfProperty_GetShareOption(OH_UdmfProperty* pThis);
64114cf0368Sopenharmony_ci
64214cf0368Sopenharmony_ci/**
64314cf0368Sopenharmony_ci * @brief Get integer value by key from the {@link OH_UdmfProperty}.
64414cf0368Sopenharmony_ci *
64514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
64614cf0368Sopenharmony_ci * @param key Represents key-value pair's key
64714cf0368Sopenharmony_ci * @param defaultValue Represents when get value failure.
64814cf0368Sopenharmony_ci * @return Returns value associated with the key in successfully, otherwise return defaultValue.
64914cf0368Sopenharmony_ci * @see OH_UdmfProperty.
65014cf0368Sopenharmony_ci * @since 12
65114cf0368Sopenharmony_ci */
65214cf0368Sopenharmony_ciint OH_UdmfProperty_GetExtrasIntParam(OH_UdmfProperty* pThis,
65314cf0368Sopenharmony_ci    const char* key, int defaultValue);
65414cf0368Sopenharmony_ci
65514cf0368Sopenharmony_ci/**
65614cf0368Sopenharmony_ci * @brief Get tag value from the {@link OH_UdmfProperty}.
65714cf0368Sopenharmony_ci *
65814cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
65914cf0368Sopenharmony_ci * @param key Represents key-value pair's key.
66014cf0368Sopenharmony_ci * @return Returns a pointer of the key value string when input parameters valid, otherwise return nullptr.
66114cf0368Sopenharmony_ci * @see OH_UdmfProperty
66214cf0368Sopenharmony_ci * @since 12
66314cf0368Sopenharmony_ci */
66414cf0368Sopenharmony_ciconst char* OH_UdmfProperty_GetExtrasStringParam(OH_UdmfProperty* pThis, const char* key);
66514cf0368Sopenharmony_ci
66614cf0368Sopenharmony_ci/**
66714cf0368Sopenharmony_ci * @brief Set tag value to {@link OH_UdmfProperty} .
66814cf0368Sopenharmony_ci *
66914cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
67014cf0368Sopenharmony_ci * @param tag Represents new tag param.
67114cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
67214cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
67314cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
67414cf0368Sopenharmony_ci * @see OH_UdmfProperty Udmf_ErrCode.
67514cf0368Sopenharmony_ci * @since 12
67614cf0368Sopenharmony_ci */
67714cf0368Sopenharmony_ciint OH_UdmfProperty_SetTag(OH_UdmfProperty* pThis, const char* tag);
67814cf0368Sopenharmony_ci
67914cf0368Sopenharmony_ci/**
68014cf0368Sopenharmony_ci * @brief Set Udmf_ShareOption value to {@link OH_UdmfProperty}.
68114cf0368Sopenharmony_ci *
68214cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
68314cf0368Sopenharmony_ci * @param option Represents new {@link Udmf_ShareOption} param.
68414cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
68514cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
68614cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
68714cf0368Sopenharmony_ci * @see OH_UdmfProperty Udmf_ShareOption Udmf_ErrCode.
68814cf0368Sopenharmony_ci * @since 12
68914cf0368Sopenharmony_ci */
69014cf0368Sopenharmony_ciint OH_UdmfProperty_SetShareOption(OH_UdmfProperty* pThis, Udmf_ShareOption option);
69114cf0368Sopenharmony_ci
69214cf0368Sopenharmony_ci/**
69314cf0368Sopenharmony_ci * @brief Set extras param to {@link OH_UdmfProperty}.
69414cf0368Sopenharmony_ci *
69514cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
69614cf0368Sopenharmony_ci * @param key Represents extras param's key value.
69714cf0368Sopenharmony_ci * @param param Represents value of k-v pairs.
69814cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
69914cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
70014cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
70114cf0368Sopenharmony_ci * @see OH_UdmfProperty Udmf_ErrCode.
70214cf0368Sopenharmony_ci * @since 12
70314cf0368Sopenharmony_ci */
70414cf0368Sopenharmony_ciint OH_UdmfProperty_SetExtrasIntParam(OH_UdmfProperty* pThis, const char* key, int param);
70514cf0368Sopenharmony_ci
70614cf0368Sopenharmony_ci/**
70714cf0368Sopenharmony_ci * @brief Set extras param to {@link OH_UdmfProperty}.
70814cf0368Sopenharmony_ci *
70914cf0368Sopenharmony_ci * @param pThis Represents a pointer to an instance of {@link OH_UdmfProperty}.
71014cf0368Sopenharmony_ci * @param key Represents extras param's key value.
71114cf0368Sopenharmony_ci * @param param Represents value of k-v pairs.
71214cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
71314cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
71414cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
71514cf0368Sopenharmony_ci * @see OH_UdmfProperty Udmf_ErrCode.
71614cf0368Sopenharmony_ci * @since 12
71714cf0368Sopenharmony_ci */
71814cf0368Sopenharmony_ciint OH_UdmfProperty_SetExtrasStringParam(OH_UdmfProperty* pThis,
71914cf0368Sopenharmony_ci    const char* key, const char* param);
72014cf0368Sopenharmony_ci
72114cf0368Sopenharmony_ci/**
72214cf0368Sopenharmony_ci * @brief Get {@link OH_UdmfData} data from udmf database.
72314cf0368Sopenharmony_ci *
72414cf0368Sopenharmony_ci * @param key Represents database store's key value.
72514cf0368Sopenharmony_ci * @param intention Represents data type {@link Udmf_Intention}
72614cf0368Sopenharmony_ci * @param unifiedData Represents output params of {@link OH_UdmfData};
72714cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
72814cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
72914cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
73014cf0368Sopenharmony_ci * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode.
73114cf0368Sopenharmony_ci * @since 12
73214cf0368Sopenharmony_ci */
73314cf0368Sopenharmony_ciint OH_Udmf_GetUnifiedData(const char* key, Udmf_Intention intention, OH_UdmfData* unifiedData);
73414cf0368Sopenharmony_ci
73514cf0368Sopenharmony_ci/**
73614cf0368Sopenharmony_ci * @brief Set {@link OH_UdmfData} data to database.
73714cf0368Sopenharmony_ci *
73814cf0368Sopenharmony_ci * @param intention Represents data type {@link Udmf_Intention}.
73914cf0368Sopenharmony_ci * @param unifiedData Represents a pointer to an instance of {@link OH_UdmfData}.
74014cf0368Sopenharmony_ci * @param key Represents return value after set data to database successfully,
74114cf0368Sopenharmony_ci * it's memory size not less than {@link UDMF_KEY_BUFFER_LEN}.
74214cf0368Sopenharmony_ci * @param keyLen Represents size of key param.
74314cf0368Sopenharmony_ci * @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
74414cf0368Sopenharmony_ci *         {@link UDMF_E_OK} success.
74514cf0368Sopenharmony_ci *         {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
74614cf0368Sopenharmony_ci * @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode.
74714cf0368Sopenharmony_ci * @since 12
74814cf0368Sopenharmony_ci */
74914cf0368Sopenharmony_ciint OH_Udmf_SetUnifiedData(Udmf_Intention intention, OH_UdmfData* unifiedData,
75014cf0368Sopenharmony_ci    char* key, unsigned int keyLen);
75114cf0368Sopenharmony_ci
75214cf0368Sopenharmony_ci#ifdef __cplusplus
75314cf0368Sopenharmony_ci};
75414cf0368Sopenharmony_ci#endif
75514cf0368Sopenharmony_ci
75614cf0368Sopenharmony_ci/** @} */
75714cf0368Sopenharmony_ci#endif