add new define

Signed-off-by: lizhuojun <lizhuojun3@huawei.com>
This commit is contained in:
lizhuojun 2024-07-23 21:57:29 +08:00
parent d2fbd537e2
commit c39bc96a5a
4 changed files with 94 additions and 92 deletions

View File

@ -255,7 +255,7 @@ int OH_UdmfRecord_AddHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html);
/**
* @brief Add one {OH_UdsAppItem} data to the {@link OH_UdmfRecord} record.
*
* @param repThisord Represents a pointer to an instance of {@link OH_UdmfRecord}.
* @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
* @param appItem Represents a pointer to an instance of {@link OH_UdsAppItem}.
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
@ -265,6 +265,32 @@ int OH_UdmfRecord_AddHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html);
*/
int OH_UdmfRecord_AddAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem);
/**
* @brief Add one {OH_UdsFileUri} data to the {@link OH_UdmfRecord} record.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
* @param fileUri Represents a pointer to an instance of {@link OH_UdsFileUri}.
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* @see OH_UdmfRecord OH_UdsFileUri Udmf_ErrCode.
* @since 13
*/
int OH_UdmfRecord_AddFileUri(OH_UdmfRecord* pThis, OH_UdsFileUri* fileUri);
/**
* @brief Add one {OH_UdsPixelMap} data to the {@link OH_UdmfRecord} record.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
* @param pixelMap Represents a pointer to an instance of {@link OH_UdsPixelMap}.
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* @see OH_UdmfRecord OH_UdsPixelMap Udmf_ErrCode.
* @since 13
*/
int OH_UdmfRecord_AddPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap);
/**
* @brief Get all types in the {@link OH_UdmfRecord} record.
*
@ -287,7 +313,6 @@ char** OH_UdmfRecord_GetTypes(OH_UdmfRecord* pThis, unsigned int* count);
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* {@link UDMF_ERR} 1.Internal data error. 2.Record data count exceeds the maximum value.
* @see OH_UdmfRecord Udmf_ErrCode.
* @since 12
*/
@ -302,7 +327,6 @@ int OH_UdmfRecord_GetGeneralEntry(OH_UdmfRecord* pThis, const char* typeId,
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* {@link UDMF_ERR} The record type is not plain text.
* @see OH_UdmfRecord OH_UdsPlainText Udmf_ErrCode.
* @since 12
*/
@ -316,7 +340,6 @@ int OH_UdmfRecord_GetPlainText(OH_UdmfRecord* pThis, OH_UdsPlainText* plainText)
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* {@link UDMF_ERR} The record type is not hyperlink.
* @see OH_UdmfRecord OH_UdsHyperlink Udmf_ErrCode.
* @since 12
*/
@ -330,7 +353,6 @@ int OH_UdmfRecord_GetHyperlink(OH_UdmfRecord* pThis, OH_UdsHyperlink* hyperlink)
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* {@link UDMF_ERR} The record type is not HTML.
* @see OH_UdmfRecord OH_UdsHtml Udmf_ErrCode.
* @since 12
*/
@ -344,12 +366,37 @@ int OH_UdmfRecord_GetHtml(OH_UdmfRecord* pThis, OH_UdsHtml* html);
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* {@link UDMF_ERR} The record type is not open harmony app item.
* @see OH_UdmfRecord OH_UdsAppItem Udmf_ErrCode.
* @since 12
*/
int OH_UdmfRecord_GetAppItem(OH_UdmfRecord* pThis, OH_UdsAppItem* appItem);
/**
* @brief Get one {OH_UdsFileUri} data from the {@link OH_UdmfRecord} record.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
* @param fileUri Represents a pointer to an instance of {@link OH_UdsFileUri}.
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* @see OH_UdmfRecord OH_UdsFileUri Udmf_ErrCode.
* @since 13
*/
int OH_UdmfRecord_GetFileUri(OH_UdmfRecord* pThis, OH_UdsFileUri* fileUri);
/**
* @brief Get one {OH_UdsPixelMap} data from the {@link OH_UdmfRecord} record.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdmfRecord}.
* @param pixelMap Represents a pointer to an instance of {@link OH_UdsPixelMap}.
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* @see OH_UdmfRecord OH_UdsPixelMap Udmf_ErrCode.
* @since 13
*/
int OH_UdmfRecord_GetPixelMap(OH_UdmfRecord* pThis, OH_UdsPixelMap* pixelMap);
/**
* @brief Creation a pointer to the instance of the {@link OH_UdmfProperty}
* from a {@link OH_UdmfData} data.
@ -489,7 +536,6 @@ int OH_UdmfProperty_SetExtrasStringParam(OH_UdmfProperty* pThis,
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* {@link UDMF_ERR} The UDMF client fails to obtain data.
* @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode.
* @since 12
*/
@ -506,7 +552,6 @@ int OH_Udmf_GetUnifiedData(const char* key, Udmf_Intention intention, OH_UdmfDat
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* {@link UDMF_ERR} The UDMF client fails to obtain data, or string copy error.
* @see OH_UdmfProperty Udmf_Intention Udmf_ErrCode.
* @since 12
*/

View File

@ -56,14 +56,22 @@ typedef enum Udmf_ErrCode {
* The error code in the correct case.
*/
UDMF_E_OK = 0,
/**
* @brief The error when the capability not supported.
*/
UDMF_E_NOT_SUPPORTED = 801,
/**
* @brief The error code for common exceptions.
*/
UDMF_ERR = 20400000,
/**
* @brief The error code for not support this data parse exceptions.
*/
UDMF_E_NOT_PARSE_DATA = (UDMF_ERR + 1),
/**
* @brief The error code for common invalid args.
*/
UDMF_E_INVALID_PARAM = (UDMF_ERR + 1),
UDMF_E_INVALID_PARAM = (UDMF_ERR + 2),
} Udmf_ErrCode;
#ifdef __cplusplus

View File

@ -990,6 +990,13 @@ extern "C" {
*/
#define UDMF_META_OPENHARMONY_WANT "openharmony.want"
/**
* @brief A specific type of uniform data type.
*
* @since 13
*/
#define UDMF_META_GENERAL_FILE_URI "general.file-uri"
#ifdef __cplusplus
};
#endif

View File

@ -40,9 +40,10 @@
#ifndef UDS_H
#define UDS_H
#include "pixelmap_native.h"
#include "multimedia/image_framework/image/pixelmap_native.h"
#ifdef __cplusplus
extern "C" {
#endif
@ -74,24 +75,17 @@ typedef struct OH_UdsHtml OH_UdsHtml;
*/
typedef struct OH_UdsAppItem OH_UdsAppItem;
/**
* @brief Describes the unified data struct of open harmony form.
*
* @since 12
*/
typedef struct OH_UdsForm OH_UdsForm;
/**
* @brief Describes the unified data struct of file uri.
*
* @since 12
* @since 13
*/
typedef struct OH_UdsFileUri OH_UdsFileUri;
/**
* @brief Describes the unified data struct of open harmony pixel map.
*
* @since 12
* @since 13
*/
typedef struct OH_UdsPixelMap OH_UdsPixelMap;
@ -487,65 +481,13 @@ int OH_UdsAppItem_SetBundleName(OH_UdsAppItem* pThis, const char* bundleName);
*/
int OH_UdsAppItem_SetAbilityName(OH_UdsAppItem* pThis, const char* abilityName);
/**
* @brief Creation a pointer to the instance of the {@link OH_UdsForm}.
*
* @return If the operation is successful, a pointer to the instance of the {@link OH_UdsForm}
* structure is returned. If the operation is failed, nullptr is returned.
* @see OH_UdsForm
* @since 12
*/
OH_UdsForm* OH_UdsForm_Create();
/**
* @brief Destroy a pointer that points to the {@link OH_UdsForm} instance.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsForm}.
* @see OH_UdsForm
* @since 12
*/
void OH_UdsForm_Destroy(OH_UdsForm* pThis);
/**
* @brief Get type id from the {@link OH_UdsForm}.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsForm}.
* @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
* @see OH_UdsForm
* @since 12
*/
const char* OH_UdsForm_GetType(OH_UdsForm* pThis);
/**
* @brief Get form content from the {@link OH_UdsForm}.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsForm}.
* @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
* @see OH_UdsForm
* @since 12
*/
const char* OH_UdsForm_GetFormContent(OH_UdsForm* pThis);
/**
* @brief Set form content to the {@link OH_UdsForm}.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsForm}.
* @param content Represents a new form content string.
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* @see OH_UdsForm Udmf_ErrCode
* @since 12
*/
int OH_UdsForm_SetFormContent(OH_UdsForm* pThis, const char* formContent);
/**
* @brief Creation a pointer to the instance of the {@link OH_UdsFileUri}.
*
* @return If the operation is successful, a pointer to the instance of the {@link OH_UdsFileUri}
* structure is returned. If the operation is failed, nullptr is returned.
* structure is returned. If the memory is not enough, nullptr is returned.
* @see OH_UdsFileUri
* @since 12
* @since 13
*/
OH_UdsFileUri* OH_UdsFileUri_Create();
@ -554,7 +496,7 @@ OH_UdsFileUri* OH_UdsFileUri_Create();
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
* @see OH_UdsFileUri
* @since 12
* @since 13
*/
void OH_UdsFileUri_Destroy(OH_UdsFileUri* pThis);
@ -564,7 +506,7 @@ void OH_UdsFileUri_Destroy(OH_UdsFileUri* pThis);
* @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
* @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
* @see OH_UdsFileUri
* @since 12
* @since 13
*/
const char* OH_UdsFileUri_GetType(OH_UdsFileUri* pThis);
@ -574,7 +516,7 @@ const char* OH_UdsFileUri_GetType(OH_UdsFileUri* pThis);
* @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
* @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
* @see OH_UdsFileUri
* @since 12
* @since 13
*/
const char* OH_UdsFileUri_GetFileUri(OH_UdsFileUri* pThis);
@ -584,7 +526,7 @@ const char* OH_UdsFileUri_GetFileUri(OH_UdsFileUri* pThis);
* @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
* @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
* @see OH_UdsFileUri
* @since 12
* @since 13
*/
const char* OH_UdsFileUri_GetFileType(OH_UdsFileUri* pThis);
@ -592,12 +534,12 @@ const char* OH_UdsFileUri_GetFileType(OH_UdsFileUri* pThis);
* @brief Set file uri to the {@link OH_UdsFileUri}.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
* @param content Represents a new content string.
* @param fileUri Represents a new file uri string.
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* @see OH_UdsFileUri Udmf_ErrCode
* @since 12
* @since 13
*/
int OH_UdsFileUri_SetFileUri(OH_UdsFileUri* pThis, const char* fileUri);
@ -605,12 +547,12 @@ int OH_UdsFileUri_SetFileUri(OH_UdsFileUri* pThis, const char* fileUri);
* @brief Set file type to the {@link OH_UdsFileUri}.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsFileUri}.
* @param content Represents a new content string.
* @param fileType Represents a new file type string.
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* @see OH_UdsFileUri Udmf_ErrCode
* @since 12
* @since 13
*/
int OH_UdsFileUri_SetFileType(OH_UdsFileUri* pThis, const char* fileType);
@ -618,9 +560,9 @@ int OH_UdsFileUri_SetFileType(OH_UdsFileUri* pThis, const char* fileType);
* @brief Creation a pointer to the instance of the {@link OH_UdsPixelMap}.
*
* @return If the operation is successful, a pointer to the instance of the {@link OH_UdsPixelMap}
* structure is returned. If the operation is failed, nullptr is returned.
* structure is returned. If the memory is not enough, nullptr is returned.
* @see OH_UdsPixelMap
* @since 12
* @since 13
*/
OH_UdsPixelMap* OH_UdsPixelMap_Create();
@ -629,7 +571,7 @@ OH_UdsPixelMap* OH_UdsPixelMap_Create();
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}.
* @see OH_UdsPixelMap
* @since 12
* @since 13
*/
void OH_UdsPixelMap_Destroy(OH_UdsPixelMap* pThis);
@ -639,7 +581,7 @@ void OH_UdsPixelMap_Destroy(OH_UdsPixelMap* pThis);
* @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}.
* @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
* @see OH_UdsPixelMap
* @since 12
* @since 13
*/
const char* OH_UdsPixelMap_GetType(OH_UdsPixelMap* pThis);
@ -647,24 +589,24 @@ const char* OH_UdsPixelMap_GetType(OH_UdsPixelMap* pThis);
* @brief Get pixel map from the {@link OH_UdsPixelMap}.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}.
* @return Returns a pointer of the value string when input args normally, otherwise return nullptr.
* @param pixelmapNative Represents output params of {@link OH_PixelmapNative}.
* @see OH_UdsPixelMap
* @since 12
* @since 13
*/
const OH_PixelmapNative* OH_UdsPixelMap_GetPixelMap(OH_UdsPixelMap* pThis);
void OH_UdsPixelMap_GetPixelMap(OH_UdsPixelMap* pThis, OH_PixelmapNative* pixelmapNative);
/**
* @brief Set form content to the {@link OH_UdsPixelMap}.
* @brief Set pixel map to the {@link OH_UdsPixelMap}.
*
* @param pThis Represents a pointer to an instance of {@link OH_UdsPixelMap}.
* @param pixelMap Represents a new pixel map.
* @param pixelmapNative Represents a new {@link OH_PixelmapNative}.
* @return Returns the status code of the execution. See {@link Udmf_ErrCode}.
* {@link UDMF_E_OK} success.
* {@link UDMF_E_INVALID_PARAM} The error code for common invalid args.
* @see OH_UdsPixelMap Udmf_ErrCode
* @since 12
* @since 13
*/
int OH_UdsPixelMap_SetPixelMap(OH_UdsPixelMap* pThis, const OH_PixelmapNative* pixelMap);
int OH_UdsPixelMap_SetPixelMap(OH_UdsPixelMap* pThis, OH_PixelmapNative* pixelmapNative);
#ifdef __cplusplus
};