From ef7a8603bed415a068ee2b0d3dc6870cf136911b Mon Sep 17 00:00:00 2001 From: zph Date: Fri, 23 May 2025 21:02:31 +0800 Subject: [PATCH 1/3] update Signed-off-by: zph --- distributeddatamgr/udmf/include/udmf.h | 132 +++++++++++++++++++++++ distributeddatamgr/udmf/libudmf.ndk.json | 44 ++++++++ 2 files changed, 176 insertions(+) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index 32d57814f..022f71bde 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -204,6 +204,29 @@ typedef void (*OH_Udmf_DataProgressListener)(OH_Udmf_ProgressInfo* progressInfo, */ typedef struct OH_UdmfOptions OH_UdmfOptions; +/** + * @brief Represents the parameters of udmf get data with data load. + * + * @since 20 +*/ +typedef struct OH_UdmfDataLoadParams OH_UdmfDataLoadParams; + +/** + * @brief Represents the udmf data load information. + * + * @since 20 +*/ +typedef struct OH_UdmfDataLoadInfo OH_UdmfDataLoadInfo; + +/** + * @brief Indicates the callback function for loading data. + * + * @param acceptableInfo Indicates the type and number of data that can be accepted by the receiver. + * @param data Returns the data to be loaded. + * @since 20 +*/ +typedef OH_UdmfData* (*OH_Udmf_DataLoadHandler)(OH_UdmfDataLoadInfo* acceptableInfo); + /** * @brief Creation a pointer to the instance of the {@link OH_UdmfData}. * @@ -1074,6 +1097,115 @@ void OH_UdmfGetDataParams_SetProgressIndicator(OH_UdmfGetDataParams* params, void OH_UdmfGetDataParams_SetDataProgressListener(OH_UdmfGetDataParams* params, const OH_Udmf_DataProgressListener dataProgressListener); +/** + * @brief Sets the acceptable info to the {@OH_UdmfGetDataParams}. + * + * @param params Represents a pointer to an instance of {@link OH_UdmfGetDataParams}. + * @param acceptableInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadParams}. + * @see OH_UdmfGetDataParams OH_UdmfDataLoadInfo + * @since 20 + */ +void OH_UdmfGetDataParams_SetAcceptableInfo(OH_UdmfGetDataParams* params, OH_UdmfDataLoadInfo* acceptableInfo); + +/** + * @brief Creation a pointer to the instance of the {@link OH_UdmfDataLoadParams}. + * + * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfDataLoadParams} + * structure is returned. If the operation is failed, nullptr is returned. + * @see OH_UdmfDataLoadParams + * @since 20 + */ +OH_UdmfDataLoadParams* OH_UdmfDataLoadParams_Create(); + +/** + * @brief Destroy a pointer that points to an instance of {@link OH_UdmfDataLoadParams}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfDataLoadParams}. + * @see OH_UdmfDataLoadParams + * @since 20 + */ +void OH_UdmfDataLoadParams_Destroy(OH_UdmfDataLoadParams* pThis); + +/** + * @brief Sets the data load handler to the {@OH_UdmfDataLoadParams}. + * + * @param params Represents a pointer to an instance of {@link OH_UdmfDataLoadParams}. + * @param dataLoadHandler Represents to the data load handler. + * @see OH_UdmfDataLoadParams OH_Udmf_DataLoadHandler + * @since 20 + */ +void OH_UdmfDataLoadParams_SetLoadHandler(OH_UdmfDataLoadParams* params, const OH_Udmf_DataLoadHandler dataLoadHandler); + +/** + * @brief Sets the data load info to the {@OH_UdmfDataLoadParams}. + * + * @param params Represents a pointer to an instance of {@link OH_UdmfDataLoadParams}. + * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. + * @see OH_UdmfDataLoadParams OH_UdmfDataLoadInfo + * @since 20 + */ +void OH_UdmfDataLoadParams_SetDataLoadInfo(OH_UdmfDataLoadParams* params, OH_UdmfDataLoadInfo* dataLoadInfo); + +/** + * @brief Creation a pointer to the instance of the {@link OH_UdmfDataLoadInfo}. + * + * @return If the operation is successful, a pointer to the instance of the {@link OH_UdmfDataLoadInfo} + * structure is returned. If the operation is failed, nullptr is returned. + * @see OH_UdmfDataLoadInfo + * @since 20 + */ +OH_UdmfDataLoadInfo* OH_UdmfDataLoadInfo_Create(); + +/** + * @brief Destroy a pointer that points to an instance of {@link OH_UdmfDataLoadInfo}. + * + * @param pThis Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. + * @see OH_UdmfDataLoadInfo + * @since 20 + */ +void OH_UdmfDataLoadInfo_Destroy(OH_UdmfDataLoadInfo* dataLoadInfo); + +/** + * @brief Gets the types from the {@OH_UdmfDataLoadInfo}. + * + * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. + * @param count the types count of data. + * @return Returns the types of data. + * @see OH_UdmfDataLoadInfo + * @since 20 + */ +char** OH_UdmfDataLoadInfo_GetTypes(OH_UdmfDataLoadInfo* dataLoadInfo, unsigned int* count); + +/** + * @brief Sets the data load info to the {@OH_UdmfDataLoadInfo}. + * + * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. + * @param types Represents the type of data. + * @see OH_UdmfDataLoadInfo + * @since 20 + */ +void OH_UdmfDataLoadInfo_SetType(OH_UdmfDataLoadInfo* dataLoadInfo, const char* type); + +/** + * @brief Gets the record count from the {@OH_UdmfDataLoadInfo}. + * + * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. + * @return Returns the record count. + * @see OH_UdmfDataLoadInfo + * @since 20 + */ +int OH_UdmfDataLoadInfo_GetRecordCount(OH_UdmfDataLoadInfo* dataLoadInfo); + +/** + * @brief Sets the record count to the {@OH_UdmfDataLoadInfo}. + * + * @param dataLoadInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. + * @param recordCount Represents the types of data. + * @see OH_UdmfDataLoadInfo + * @since 20 + */ +void OH_UdmfDataLoadInfo_SetRecordCount(OH_UdmfDataLoadInfo* dataLoadInfo, unsigned int recordCount); + #ifdef __cplusplus }; #endif diff --git a/distributeddatamgr/udmf/libudmf.ndk.json b/distributeddatamgr/udmf/libudmf.ndk.json index 93efe5e1f..27336bceb 100644 --- a/distributeddatamgr/udmf/libudmf.ndk.json +++ b/distributeddatamgr/udmf/libudmf.ndk.json @@ -606,5 +606,49 @@ { "first_introduced": "20", "name": "OH_Udmf_DestroyDataArray" + }, + { + "first_introduced": "20", + "name": "OH_UdmfGetDataParams_SetAcceptableInfo" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadParams_Create" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadParams_Destroy" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadParams_SetLoadHandler" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadParams_SetDataLoadInfo" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadInfo_Create" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadInfo_Destroy" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadInfo_GetTypes" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadInfo_SetType" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadInfo_GetRecordCount" + }, + { + "first_introduced": "20", + "name": "OH_UdmfDataLoadInfo_SetRecordCount" } ] \ No newline at end of file -- Gitee From f4a2de4776a9dc89296c8152ba1eb123352e3645 Mon Sep 17 00:00:00 2001 From: zph Date: Sat, 24 May 2025 16:43:13 +0800 Subject: [PATCH 2/3] update Signed-off-by: zph --- distributeddatamgr/udmf/include/udmf.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index 022f71bde..51cdb7452 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -208,23 +208,23 @@ typedef struct OH_UdmfOptions OH_UdmfOptions; * @brief Represents the parameters of udmf get data with data load. * * @since 20 -*/ + */ typedef struct OH_UdmfDataLoadParams OH_UdmfDataLoadParams; /** * @brief Represents the udmf data load information. * * @since 20 -*/ + */ typedef struct OH_UdmfDataLoadInfo OH_UdmfDataLoadInfo; /** * @brief Indicates the callback function for loading data. * * @param acceptableInfo Indicates the type and number of data that can be accepted by the receiver. - * @param data Returns the data to be loaded. + * @return Returns the data to be loaded. * @since 20 -*/ + */ typedef OH_UdmfData* (*OH_Udmf_DataLoadHandler)(OH_UdmfDataLoadInfo* acceptableInfo); /** @@ -1101,7 +1101,7 @@ void OH_UdmfGetDataParams_SetDataProgressListener(OH_UdmfGetDataParams* params, * @brief Sets the acceptable info to the {@OH_UdmfGetDataParams}. * * @param params Represents a pointer to an instance of {@link OH_UdmfGetDataParams}. - * @param acceptableInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadParams}. + * @param acceptableInfo Represents a pointer to an instance of {@link OH_UdmfDataLoadInfo}. * @see OH_UdmfGetDataParams OH_UdmfDataLoadInfo * @since 20 */ -- Gitee From eaa0bafbc79575ff06cb95bb117e817753ccf500 Mon Sep 17 00:00:00 2001 From: zph Date: Sat, 24 May 2025 16:55:51 +0800 Subject: [PATCH 3/3] update Signed-off-by: zph --- distributeddatamgr/udmf/include/udmf.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/distributeddatamgr/udmf/include/udmf.h b/distributeddatamgr/udmf/include/udmf.h index 51cdb7452..5e4b93cab 100644 --- a/distributeddatamgr/udmf/include/udmf.h +++ b/distributeddatamgr/udmf/include/udmf.h @@ -205,14 +205,14 @@ typedef void (*OH_Udmf_DataProgressListener)(OH_Udmf_ProgressInfo* progressInfo, typedef struct OH_UdmfOptions OH_UdmfOptions; /** - * @brief Represents the parameters of udmf get data with data load. + * @brief Indicates data loading params. * * @since 20 */ typedef struct OH_UdmfDataLoadParams OH_UdmfDataLoadParams; /** - * @brief Represents the udmf data load information. + * @brief Indicates data loading information. * * @since 20 */ -- Gitee